/* Bubbo vs the Mess (play.html). The page is one full-height stage under the nav; nothing scrolls while playing. */
.play-page { --bg: #171411; --ink: #f5f0ea; --muted: #a39e96; --action: #ff7a1a; --action-ink: #171411;
  background: var(--bg); color: var(--ink); height: 100dvh; overflow: hidden; overscroll-behavior: none; }
.play-page ::selection { background: #ff7a1a; color: #171411; }

.game { position: fixed; inset: var(--nav) 0 env(safe-area-inset-bottom, 0px) 0; }
.play-page .nav__actions { margin-left: auto; }
/* on a wide screen the field stays phone-shaped so it plays the same everywhere */
.game__stage { position: absolute; inset: 0; margin-inline: auto; width: min(100%, 560px); touch-action: none; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent; overflow: hidden; }
.game__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* HUD: score left, time right, a thin time bar under both */
.game__hud { position: absolute; inset: 0 0 auto 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end;
  padding: 14px max(16px, env(safe-area-inset-left)) 0; pointer-events: none; }
.game__hud[hidden] { display: none; }
.hud__stat { display: grid; gap: 2px; }
.hud__stat--end { justify-items: end; }
.hud__label { font: 500 12px/1 var(--font-text); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.hud__num { font: 600 34px/1 var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.hud__combo { font: 700 18px/1 var(--font-display); color: #ff7a1a; padding-bottom: 6px; opacity: 0; transform: scale(.8);
  transition: opacity 160ms ease-out, transform 220ms cubic-bezier(.22,1,.36,1); }
.hud__combo.is-on { opacity: 1; transform: none; }
.hud__bar { grid-column: 1 / -1; height: 4px; margin-top: 12px; border-radius: 2px; background: rgb(245 239 230 / .12); overflow: hidden; }
.hud__bar i { display: block; height: 100%; background: #ff7a1a; transform-origin: left; }

/* start, end and pause cards sit centred over the stage */
.game__card { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  justify-content: safe center; overflow-y: auto; text-align: center; gap: 14px; padding: 24px;
  background: rgb(23 20 17 / .94); }
.game__card[hidden] { display: none; }
.game__card--pause { background: rgb(23 20 17 / .82); }
.card__bubbo { width: min(46vw, 190px); height: auto; margin-bottom: -4px; }
.card__h { font: 600 clamp(32px, 9vw, 52px)/1.02 var(--font-display); letter-spacing: -0.04em; margin: 0; text-wrap: balance; }
.card__p { font: 400 17px/1.45 var(--font-text); color: color-mix(in oklab, var(--ink) 82%, var(--bg)); max-width: 32ch; margin: 0; text-wrap: pretty; }
.card__legend { list-style: none; display: flex; gap: 20px; margin: 2px 0 6px; padding: 0; }
.card__legend li { display: flex; align-items: center; gap: 6px; font: 500 15px/1 var(--font-text); color: var(--muted); }
.card__legend img { width: 34px; height: 34px; }
.card__go { min-width: 200px; height: 56px; font-size: 19px; font-weight: 600; }
.card__best { margin: 0; font: 400 15px/1 var(--font-text); color: var(--muted); }
.card__best b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.card__score { margin: 0; display: grid; justify-items: center; gap: 4px; }
.card__score [data-final] { font: 600 88px/0.9 var(--font-display); letter-spacing: -0.05em; color: #ff7a1a; font-variant-numeric: tabular-nums; }
.card__unit { font: 500 13px/1 var(--font-text); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.card__actions { display: grid; gap: 10px; width: min(100%, 300px); margin-top: 6px; }
.card__actions .btn { height: 54px; font-size: 18px; font-weight: 600; }
.card__again { background: transparent; color: var(--ink); border-color: rgb(245 239 230 / .28); }
@media (hover: hover) and (pointer: fine) { .card__again:hover { border-color: var(--ink); } }
.card__fine { margin: 4px 0 0; font: 400 14px/1.45 var(--font-text); color: var(--muted); max-width: 30ch; }
.game__card :focus-visible { outline: 2px solid #ff7a1a; outline-offset: 3px; }

/* the card arrives with a short rise; nothing moves under reduced motion */
@media (prefers-reduced-motion: no-preference) {
  .game__card.is-in > * { animation: card-in 420ms cubic-bezier(.22,1,.36,1) both; }
  .game__card.is-in > :nth-child(2) { animation-delay: 40ms; }
  .game__card.is-in > :nth-child(3) { animation-delay: 80ms; }
  .game__card.is-in > :nth-child(n+4) { animation-delay: 120ms; }
}
@keyframes card-in { from { opacity: 0; transform: translateY(10px); } }

@media (max-height: 700px) {
  .card__bubbo { width: 118px; }
  .card__score [data-final] { font-size: 64px; }
  .game__card { gap: 10px; }
  .card__fine { display: none; }
}
@media (min-width: 600px) {
  .game__stage { border-inline: 1px solid rgb(245 239 230 / .08); }
  .game__hud { padding-inline: 24px; }
}
