.game {
  background:
    radial-gradient(70% 50% at 50% 100%, rgba(31,62,166,.22), transparent 60%),
    linear-gradient(180deg, var(--wine-900), var(--wine-950));
}
.game__head { margin-bottom: clamp(24px, 4vh, 44px); display: grid; gap: 14px; }
.game__title { font-size: var(--fs-h2); }
.game__stage { display: grid; place-items: center; }
.game__frame {
  position: relative; aspect-ratio: 1 / 2;
  height: min(78svh, 760px); max-width: 100%;
  border-radius: 18px; overflow: hidden; outline: none;
  box-shadow: 0 40px 80px -40px rgba(0,0,0,.9), 0 0 0 1px rgba(227,203,160,.18), inset 0 0 0 1px rgba(255,255,255,.06);
  touch-action: none; user-select: none; -webkit-user-select: none;
  background: var(--court-blue-deep);
}
.game__frame:focus-visible { box-shadow: 0 0 0 3px var(--focus), 0 40px 80px -40px rgba(0,0,0,.9); }
.game__frame.is-playing { cursor: none; }
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.game__hud {
  position: absolute; inset: 0 0 auto 0; z-index: 3; display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; pointer-events: none;
}
.game__score {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px; border-radius: 999px;
  background: rgba(18,3,5,.55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-family: var(--font-display); font-size: 1.5rem; font-variation-settings: "opsz" 40; font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 0 1px rgba(227,203,160,.2);
}
.game__score i { font-style: normal; color: var(--fg-faint); font-size: 1rem; }
.game__score span { display: inline-block; min-width: 1ch; }
.game__score span.is-bump { animation: bump 500ms var(--ease-spring); color: var(--gold-200); }
@keyframes bump { 30% { transform: scale(1.5); } }
.game__hud-actions { display: flex; gap: 6px; pointer-events: auto; }
.game__icon {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(18,3,5,.55); color: var(--cream-100); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px rgba(227,203,160,.2); transition: background var(--dur-fast), transform var(--dur-fast);
}
.game__icon:hover { background: rgba(75,9,14,.8); transform: translateY(-1px); }
.game__icon[aria-pressed="false"] .wave { display: none; }

.game__overlay {
  position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: 14px; padding: 28px;
  background: linear-gradient(180deg, rgba(18,3,5,.75), rgba(18,3,5,.88));
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity var(--dur) var(--ease-out);
}
.game__overlay[hidden] { display: none; }
.game__overlay.is-active { opacity: 1; }
.game__overlay h3 { font-size: clamp(2rem, 6vw, 3rem); line-height: 1; }
.game__overlay p { color: var(--fg-muted); max-width: 30ch; font-size: 0.95rem; }
.game__overlay-kicker { font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-300) !important; }
.game__overlay-kicker strong { color: var(--cream-100); font-family: var(--font-display); font-size: 1rem; letter-spacing: 0; text-transform: none; }
.game__start-btn { min-width: 180px; }
.game__hint { font-size: 0.78rem !important; color: var(--fg-faint) !important; }
.only-touch { display: none; }
@media (hover: none) { .only-desktop { display: none; } .only-touch { display: inline; } }
.game__final { font-family: var(--font-display); font-size: clamp(3rem, 10vw, 5rem); line-height: 1; color: var(--gold-200) !important; }
.game__end-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

@media (max-width: 900px) {
  .game__frame { height: auto; width: min(100%, calc((100svh - 140px) / 2)); }
  .game__stage { padding-inline: 0; }
}
