:root {
  --bg: #17142c;
  --panel: #24203d;
  --accent: #ffcf67;
  --accent-text: #352005;
  --muted: #c9c2dc;
  --page-glow: rgba(255, 146, 102, 0.19);
}

body {
  background:
    radial-gradient(circle at 15% 8%, rgba(255, 182, 104, 0.18), transparent 24rem),
    radial-gradient(circle at 84% 16%, rgba(132, 101, 255, 0.14), transparent 24rem),
    linear-gradient(180deg, #17142c, #090816);
}

.stage,
.side-panel,
.camera-card,
.control-card {
  border-color: rgba(255, 222, 174, 0.16);
  background: rgba(28, 24, 53, 0.91);
}

.stage {
  aspect-ratio: 5 / 3;
  min-height: 0;
  box-shadow: 0 26px 72px rgba(5, 3, 20, 0.34);
}

#game-canvas {
  min-height: 0;
  background: #191b45;
  touch-action: none;
}

.runner-hud {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.8rem;
  color: #fff;
  font-size: clamp(0.68rem, 1.2vw, 0.88rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 8px rgba(34, 12, 34, 0.5);
}

.hud-cell {
  min-width: 7rem;
  border: 1px solid rgba(255, 237, 201, 0.18);
  border-radius: 8px;
  background: rgba(35, 22, 51, 0.7);
  padding: 0.48rem 0.68rem;
}

.hud-label {
  display: block;
  color: #bbb1d1;
  font-size: 0.63rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hud-value {
  display: block;
  margin-top: 0.13rem;
  white-space: nowrap;
}

.hud-value[data-move="jump"] {
  color: #8fffe0;
}

.hud-value[data-move="duck"],
.hud-value[data-move="drop"] {
  color: #ffcf67;
}

.runner-mode {
  position: absolute;
  right: 0.85rem;
  bottom: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(35, 22, 51, 0.66);
  color: #c6bdd8;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.37rem 0.62rem;
  text-transform: uppercase;
}

.overlay-card {
  width: min(465px, calc(100% - 1.5rem));
  border-color: rgba(255, 207, 103, 0.3);
  background: rgba(27, 19, 48, 0.92);
  backdrop-filter: blur(9px);
}

.overlay-card h1,
.overlay-card h2 {
  letter-spacing: 0.025em;
}

.eyebrow {
  margin-bottom: 0.45rem;
  color: #ffcf67;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.move-brief {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.48rem;
  margin: 1rem 0;
}

.move-brief span {
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: #cdc6df;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.58rem 0.3rem;
}

.move-brief strong {
  display: block;
  margin-top: 0.16rem;
  color: #fff2b7;
  font-size: 0.86rem;
}

.result-score {
  color: #fff !important;
  font-size: 1.12rem;
  font-weight: 900;
}

.new-best {
  color: #8fffe0 !important;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.overlay-button:focus-visible,
.home-link:focus-visible {
  outline: 3px solid rgba(255, 207, 103, 0.55);
  outline-offset: 3px;
}

.control-note {
  margin-bottom: 0 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 0.85rem;
  font-size: 0.82rem;
}

@media (max-width: 980px) {
  .stage {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .runner-hud {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.34rem;
    padding: 0.45rem;
  }

  .hud-cell {
    min-width: 0;
    padding: 0.35rem 0.45rem;
  }

  .hud-label {
    font-size: 0.56rem;
  }

  .runner-mode {
    display: none;
  }

  .move-brief {
    gap: 0.3rem;
  }

  .move-brief span {
    font-size: 0.62rem;
    padding-inline: 0.2rem;
  }
}

@media (max-width: 430px) {
  .stage {
    aspect-ratio: 4 / 3;
  }

  .overlay-card {
    padding: 1rem;
  }

  .overlay-card p {
    font-size: 0.86rem;
  }
}
