:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0e1014;
  color: #f7f2e8;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at 15% 16%, rgba(224, 53, 77, 0.2), transparent 27%),
    radial-gradient(circle at 85% 72%, rgba(72, 207, 173, 0.18), transparent 30%),
    linear-gradient(135deg, #11141a 0%, #17161d 46%, #111817 100%);
}

button {
  font: inherit;
}

.app {
  width: min(1220px, 100%);
  min-height: 100svh;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(320px, 760px) minmax(280px, 1fr);
  gap: 22px;
  align-items: center;
}

.game-shell {
  height: min(780px, calc(100svh - 40px));
  min-height: 640px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(13, 16, 22, 0.9);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.hud {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.hud > div {
  padding: 11px 10px;
  min-width: 0;
  background: #171b23;
}

.hud span {
  display: block;
  margin-bottom: 3px;
  color: #aab3b4;
  font-size: 11px;
  letter-spacing: 0;
}

.hud strong {
  color: #f3cf5d;
  font-size: clamp(18px, 3.6vw, 28px);
  line-height: 1;
}

#game {
  min-height: 0;
  background: #0a0d10;
}

#game canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.panel {
  padding: 12px;
  background: #171b23;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.readout {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #dce3e2;
}

.readout strong {
  color: #f3cf5d;
}

.actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}

button {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #263038;
  color: #f7f2e8;
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  color: #748087;
  background: #1b2027;
}

button:not(:disabled):active {
  transform: translateY(1px);
}

#playBtn {
  background: linear-gradient(180deg, #f3cf5d, #e58a35);
  color: #141414;
  border: 0;
}

#message {
  min-height: 20px;
  margin: 8px 0 0;
  color: #bfc8c9;
  font-size: 13px;
}

.info {
  padding: 26px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.info h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 0.96;
}

.info p {
  color: #cbd3d2;
  line-height: 1.55;
}

.info ul {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.info li {
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #dce4e1;
}

.info b {
  color: #48cfad;
}

.shop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(5, 7, 9, 0.72);
  backdrop-filter: blur(6px);
}

.shop.hidden {
  display: none;
}

.shop-box {
  width: min(680px, 100%);
  padding: 18px;
  border-radius: 8px;
  background: #171b23;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

.shop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shop-head h2 {
  margin: 0;
}

.shop-items {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.shop-items button {
  min-height: 116px;
  padding: 12px;
  text-align: left;
}

.shop-items small {
  display: block;
  margin-top: 7px;
  color: #aeb8b9;
  font-weight: 500;
}

@media (max-width: 860px) {
  body {
    overflow: hidden;
  }

  .app {
    min-height: 100svh;
    padding: 8px;
    display: block;
  }

  .game-shell {
    height: calc(100svh - 16px);
    min-height: 0;
  }

  .hud > div {
    padding: 8px 6px;
  }

  .hud span {
    font-size: 10px;
  }

  .panel {
    padding: 9px;
  }

  .actions {
    gap: 6px;
  }

  button {
    min-height: 38px;
    border-radius: 7px;
    font-size: 13px;
  }

  #message {
    font-size: 12px;
  }

  .readout {
    font-size: 13px;
  }

  .info {
    display: none;
  }

  .shop-items {
    grid-template-columns: 1fr;
  }
}
