:root {
  color-scheme: dark;
  --night: #07100f;
  --ink: #0a1513;
  --felt: #0d6851;
  --felt-light: #149071;
  --cream: #f2ead9;
  --gold: #d8b46a;
  --muted: #8c9993;
  --line: rgba(242,234,217,.15);
  --panel: rgba(8,18,16,.86);
  --safe-top: max(16px, env(safe-area-inset-top));
  --safe-right: max(16px, env(safe-area-inset-right));
  --safe-bottom: max(16px, env(safe-area-inset-bottom));
  --safe-left: max(16px, env(safe-area-inset-left));
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--night);
  color: var(--cream);
  font-family: "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
  touch-action: none;
}

button { color: inherit; font: inherit; }
button, canvas { -webkit-tap-highlight-color: transparent; }

#gameShell {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 360px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 40%, #18312b 0, #0a1714 40%, #050b0a 78%),
    #07100f;
}

#gameCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; }

.grain, .vignette { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.grain { opacity: .13; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.2'/%3E%3C/svg%3E"); mix-blend-mode: soft-light; }
.vignette { background: radial-gradient(ellipse at center, transparent 42%, rgba(2,7,6,.22) 72%, rgba(1,4,3,.72) 100%); }
.is-hidden { display: none !important; }

.game-hud {
  position: absolute;
  z-index: 5;
  top: var(--safe-top);
  left: var(--safe-left);
  right: var(--safe-right);
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr);
  align-items: start;
  gap: 18px;
  pointer-events: none;
}

.player-card {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  opacity: .54;
  transition: opacity .25s, transform .25s;
}
.player-card.is-active { opacity: 1; transform: translateY(2px); }
.player-two { justify-content: flex-end; text-align: right; }
.avatar { display: grid; place-items: center; flex: 0 0 43px; height: 43px; border: 1px solid rgba(216,180,106,.62); border-radius: 50%; color: var(--gold); background: rgba(7,16,14,.78); font-family: Georgia, serif; font-size: 15px; font-weight: 700; box-shadow: 0 0 0 4px rgba(216,180,106,.05); }
.cpu-avatar { color: #b7dacf; border-color: rgba(183,218,207,.45); }
.player-copy { display: flex; flex-direction: column; min-width: 72px; }
.player-label, .overline { color: var(--gold); font-size: 8px; font-weight: 700; letter-spacing: .22em; }
.player-copy strong { margin: 2px 0; font-size: 13px; letter-spacing: .08em; }
.group-label { color: var(--muted); font-size: 8px; letter-spacing: .12em; }
.mini-balls { display: flex; flex-wrap: wrap; max-width: 92px; gap: 3px; }
.mini-ball { width: 9px; height: 9px; border: 1px solid rgba(255,255,255,.65); border-radius: 50%; box-shadow: 0 1px 3px #000; }
.mini-ball.stripe { background: linear-gradient(to bottom, #eee 0 27%, var(--ball-color) 28% 72%, #eee 73%); }
.mini-ball.pocketed { opacity: .16; filter: grayscale(1); }

.turn-center { padding-top: 1px; text-align: center; text-shadow: 0 2px 10px #000; }
.turn-center span { display: block; margin-bottom: 4px; color: var(--gold); font-size: 8px; font-weight: 700; letter-spacing: .24em; }
.turn-center strong { font-family: Georgia, "Times New Roman", serif; font-size: 14px; font-style: italic; font-weight: 400; letter-spacing: .08em; }

.shot-ui {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: var(--safe-bottom);
  display: grid;
  grid-template-columns: auto minmax(160px, 310px) 42px;
  align-items: center;
  gap: 12px;
  width: min(470px, calc(100vw - 210px));
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .18em;
  pointer-events: none;
}
.power-track { position: relative; height: 5px; background: rgba(242,234,217,.15); }
.power-track i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #e9d7a9, var(--gold), #d56a45); box-shadow: 0 0 12px rgba(216,180,106,.35); }
.power-track b { position: absolute; top: -4px; left: 0; width: 2px; height: 13px; background: var(--cream); box-shadow: 0 0 6px white; transform: translateX(-1px); }
.shot-ui strong { color: var(--cream); font-size: 10px; }

.spin-ui {
  position: absolute;
  z-index: 7;
  left: var(--safe-left);
  bottom: var(--safe-bottom);
  display: grid;
  grid-template-columns: auto 66px;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 4px 12px;
  padding: 10px 12px;
  border: 1px solid rgba(242,234,217,.12);
  background: rgba(7,16,14,.67);
  backdrop-filter: blur(8px);
}
.spin-copy { display: flex; flex-direction: column; min-width: 72px; }
.spin-copy span { color: var(--gold); font-size: 8px; font-weight: 700; letter-spacing: .18em; }
.spin-copy small { margin-top: 5px; color: var(--muted); font-size: 7px; font-weight: 700; letter-spacing: .1em; }
.spin-ball {
  position: relative;
  grid-column: 2;
  grid-row: 1 / 3;
  width: 66px;
  height: 66px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fff 0, #f3eee2 46%, #c9c5bb 76%, #878780 100%);
  box-shadow: inset -7px -8px 11px rgba(0,0,0,.22), 0 5px 14px rgba(0,0,0,.32);
  cursor: crosshair;
  touch-action: none;
}
.spin-ball i { position: absolute; inset: 14%; border: 1px dashed rgba(22,35,31,.18); border-radius: 50%; pointer-events: none; }
.spin-ball::before, .spin-ball::after { content: ""; position: absolute; background: rgba(22,35,31,.13); pointer-events: none; }
.spin-ball::before { top: 50%; left: 12%; right: 12%; height: 1px; }
.spin-ball::after { top: 12%; bottom: 12%; left: 50%; width: 1px; }
.spin-ball b { position: absolute; top: 50%; left: 50%; width: 10px; height: 10px; border: 2px solid #fff; border-radius: 50%; background: #ba493e; box-shadow: 0 1px 4px rgba(0,0,0,.55); transform: translate(-50%, -50%); pointer-events: none; }
.spin-reset { align-self: start; width: max-content; border: 0; padding: 3px 0; color: rgba(242,234,217,.48); background: none; cursor: pointer; font-size: 7px; font-weight: 700; letter-spacing: .13em; }
.spin-reset:hover { color: var(--cream); }

/* Touch-mode micro-label + one-time attention pulse: on phones the compact
   layout hides the CUE STRIKE copy, leaving the spin control an anonymous
   white ball. The label names it; the pulse (added by game.js the first time
   an aim drag ends in a session) points at it once. */
.spin-touch-label { display: none; color: var(--gold); font-size: 9px; font-weight: 700; letter-spacing: .18em; text-align: center; text-shadow: 0 1px 4px #000; pointer-events: none; }
@keyframes spinAttention {
  0% { box-shadow: inset -7px -8px 11px rgba(0,0,0,.22), 0 5px 14px rgba(0,0,0,.32), 0 0 0 0 rgba(216,180,106,.7); }
  70% { box-shadow: inset -7px -8px 11px rgba(0,0,0,.22), 0 5px 14px rgba(0,0,0,.32), 0 0 0 13px rgba(216,180,106,0); }
  100% { box-shadow: inset -7px -8px 11px rgba(0,0,0,.22), 0 5px 14px rgba(0,0,0,.32), 0 0 0 0 rgba(216,180,106,0); }
}
.spin-ball.spin-attention { animation: spinAttention .9s ease-out 3; }

.call-pocket {
  position: absolute;
  z-index: 8;
  top: 15%;
  left: 50%;
  min-width: 230px;
  padding: 11px 20px 10px;
  border: 1px solid rgba(216,180,106,.48);
  text-align: center;
  background: rgba(6,15,13,.88);
  box-shadow: 0 8px 25px rgba(0,0,0,.32), inset 0 0 18px rgba(216,180,106,.05);
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}
.call-pocket span { display: block; color: var(--cream); font-family: Georgia, serif; font-size: 12px; font-style: italic; letter-spacing: .06em; }
.call-pocket small { display: block; margin-top: 4px; color: var(--gold); font-size: 7px; font-weight: 700; letter-spacing: .2em; }

/* Two-step control coach — prominent gold-on-dark banner, top and centre,
   sitting just below the match HUD so it never overlaps the player cards or
   any bottom control. game.js owns the copy (step 1 aim → step 2 fire) and
   hides it for good after the session's first fired shot. */
.coach {
  position: absolute;
  z-index: 6;
  top: calc(var(--safe-top) + 84px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 11px 22px 10px;
  border: 1px solid rgba(216,180,106,.55);
  border-radius: 999px;
  color: var(--gold);
  text-align: center;
  background: rgba(6,15,13,.88);
  backdrop-filter: blur(9px);
  box-shadow: 0 8px 25px rgba(0,0,0,.35), inset 0 0 18px rgba(216,180,106,.06);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .18em;
  white-space: nowrap;
  pointer-events: none;
}

/* FIRE affordance: one-time attention pulse when the coach reaches step 2
   (same pattern as the spin ball's spinAttention). Cleared on animationend or
   the first FIRE/Space press; the global reduced-motion rule disables it. */
@keyframes fireAttention {
  0% { box-shadow: 0 8px 22px rgba(0,0,0,.4), inset 0 0 16px rgba(216,180,106,.06), 0 0 0 0 rgba(216,180,106,.7); }
  70% { box-shadow: 0 8px 22px rgba(0,0,0,.4), inset 0 0 16px rgba(216,180,106,.06), 0 0 0 16px rgba(216,180,106,0); }
  100% { box-shadow: 0 8px 22px rgba(0,0,0,.4), inset 0 0 16px rgba(216,180,106,.06), 0 0 0 0 rgba(216,180,106,0); }
}
.fire-button.fire-attention { animation: fireAttention .9s ease-out 3; }

.toast {
  position: absolute;
  z-index: 8;
  top: 17%;
  left: 50%;
  opacity: 0;
  transform: translate(-50%, 8px);
  padding: 9px 15px;
  border: 1px solid rgba(216,180,106,.3);
  color: var(--cream);
  background: rgba(5,14,12,.8);
  backdrop-filter: blur(9px);
  font-family: Georgia, serif;
  font-size: 12px;
  font-style: italic;
  letter-spacing: .06em;
  transition: opacity .18s, transform .18s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* FIRE button — all pointer schemes (hold to charge, release to shoot).
   Thumb-sized, bottom-right, above the sound/pause cluster and clear of the
   spin ball on the left; same spot on desktop, mouse-clickable. */
.fire-button {
  position: absolute;
  z-index: 7;
  right: var(--safe-right);
  bottom: calc(var(--safe-bottom) + 52px);
  width: 68px;
  height: 68px;
  padding: 0;
  border: 1px solid rgba(216,180,106,.55);
  border-radius: 50%;
  color: var(--gold);
  background: radial-gradient(circle at 34% 28%, rgba(216,180,106,.14) 0, rgba(7,16,14,.82) 58%), rgba(7,16,14,.82);
  backdrop-filter: blur(8px);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2em;
  text-indent: .2em;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 8px 22px rgba(0,0,0,.4), inset 0 0 16px rgba(216,180,106,.06);
}
.fire-button.is-charging {
  border-color: var(--gold);
  color: var(--cream);
  box-shadow: 0 0 20px rgba(216,180,106,.38), inset 0 0 24px rgba(216,180,106,.16);
}
.fire-button:hover { border-color: var(--gold); color: var(--cream); }

.game-actions { position: absolute; z-index: 7; right: var(--safe-right); bottom: var(--safe-bottom); display: flex; gap: 8px; }
.round-button { width: 38px; height: 38px; border: 1px solid rgba(242,234,217,.14); border-radius: 50%; color: rgba(242,234,217,.72); background: rgba(7,16,14,.7); cursor: pointer; backdrop-filter: blur(8px); }
.round-button:hover { border-color: var(--gold); color: var(--cream); }

.overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(3,9,8,.38);
  backdrop-filter: blur(2px);
}
.menu-overlay { grid-template-columns: minmax(280px, 1fr) minmax(320px, 440px); gap: clamp(38px, 8vw, 130px); padding-inline: clamp(30px, 8vw, 130px); }
.brand-lockup { justify-self: end; text-align: center; }
.brand-kicker { color: var(--gold); font-size: 9px; font-weight: 700; letter-spacing: .32em; }
h1, h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
h1 { margin-top: 12px; font-size: clamp(66px, 10vw, 128px); line-height: .82; letter-spacing: -.07em; text-shadow: 0 16px 40px rgba(0,0,0,.55); }
h1 i { display: inline-grid; place-items: center; width: .78em; height: .78em; border-radius: 50%; color: #f5f2e9; background: #090a0a; font-style: normal; font-size: .72em; text-shadow: 0 1px 0 #000; box-shadow: inset -8px -10px 15px #000, inset 7px 7px 9px rgba(255,255,255,.11), 0 12px 24px rgba(0,0,0,.35); }
h1 i.snooker-brand { color: transparent; background: #bd3036; }
.brand-lockup p { margin: 22px 0 0; color: var(--muted); font-family: Georgia, serif; font-size: 12px; font-style: italic; letter-spacing: .1em; }
.menu-panel { width: min(440px, 92vw); padding: 28px; border: 1px solid var(--line); background: linear-gradient(150deg, rgba(13,28,24,.92), rgba(5,13,11,.9)); box-shadow: 0 32px 80px rgba(0,0,0,.38); }

.game-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 13px; }
.game-choice { display: flex; align-items: center; gap: 11px; min-height: 58px; padding: 9px 12px; border: 1px solid var(--line); color: var(--muted); text-align: left; background: rgba(255,255,255,.025); cursor: pointer; transition: border-color .16s, color .16s, background .16s, transform .16s; }
.game-choice:hover { color: var(--cream); border-color: rgba(216,180,106,.38); transform: translateY(-1px); }
.game-choice.is-selected { color: var(--cream); border-color: rgba(216,180,106,.62); background: rgba(216,180,106,.08); box-shadow: inset 0 0 18px rgba(216,180,106,.04); }
.game-choice span { display: flex; flex-direction: column; }
.game-choice b { font-size: 10px; letter-spacing: .12em; }
.game-choice small { margin-top: 4px; color: var(--muted); font-size: 7px; font-weight: 700; letter-spacing: .1em; }
.choice-ball { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; font-family: Arial, sans-serif; font-size: 10px; font-style: normal; font-weight: 700; box-shadow: inset -4px -5px 7px rgba(0,0,0,.48), inset 3px 3px 5px rgba(255,255,255,.13), 0 3px 8px rgba(0,0,0,.35); }
.eight-choice { color: white; background: #090a0a; }
.snooker-choice { position: relative; background: #b82f30; }
.snooker-choice::after { content: ""; position: absolute; right: -5px; bottom: -2px; width: 13px; height: 13px; border-radius: 50%; background: #e0b52b; box-shadow: inset -2px -2px 3px rgba(0,0,0,.3); }
.match-overline { display: block; margin-top: 19px; }

.primary-button, .secondary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 68px;
  margin-top: 16px;
  padding: 0 20px;
  border: 1px solid transparent;
  text-align: left;
  cursor: pointer;
  transition: transform .16s, filter .16s, border-color .16s;
}
.primary-button { color: #17201c; background: var(--cream); }
.secondary-button { color: var(--cream); border-color: var(--line); background: rgba(255,255,255,.035); }
/* Direct child only: the descendant form also caught the nested day-number
   span in "DAILY CHALLENGE #N", turning it into a column flex container and
   forcing the number onto its own line. */
.primary-button > span, .secondary-button > span { display: flex; flex-direction: column; }
.primary-button b, .secondary-button b { font-size: 11px; letter-spacing: .13em; }
.primary-button small, .secondary-button small { margin-top: 5px; opacity: .55; font-size: 8px; font-weight: 700; letter-spacing: .12em; }
.primary-button > i, .secondary-button > i { font-family: Arial, sans-serif; font-size: 24px; font-style: normal; font-weight: 300; }
.primary-button:hover, .secondary-button:hover { transform: translateY(-2px); filter: brightness(1.08); }
.secondary-button:hover { border-color: rgba(216,180,106,.5); }
.menu-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 19px; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .14em; }
.text-button { border: 0; padding: 8px 0; color: var(--muted); background: none; cursor: pointer; font-size: 8px; font-weight: 700; letter-spacing: .15em; }
.text-button:hover { color: var(--cream); }

/* Daily challenge — the house special, gold over the cream primary */
.daily-button { color: #191207; border-color: rgba(216,180,106,.85); background: linear-gradient(135deg, #ecd39a, var(--gold) 52%, #b98f47); box-shadow: 0 14px 34px rgba(216,180,106,.18); }
.daily-button small { opacity: .62; }
.daily-button:hover { filter: brightness(1.05); }

.compact-overlay { background: rgba(3,8,7,.72); backdrop-filter: blur(9px); }
.modal-card { width: min(380px, 90vw); padding: 34px; border: 1px solid var(--line); text-align: center; background: linear-gradient(145deg, rgba(14,30,26,.98), rgba(6,15,13,.98)); box-shadow: 0 32px 90px rgba(0,0,0,.5); }
.modal-card h2 { margin-top: 7px; font-size: 45px; letter-spacing: -.04em; }
.modal-card p { margin: 11px 0 24px; color: var(--muted); font-family: Georgia, serif; font-size: 12px; font-style: italic; }
.centered { justify-content: center; min-height: 54px; text-align: center; }
.modal-card .secondary-button { min-height: 52px; margin-top: 9px; }
.modal-card > .text-button { margin-top: 13px; }
.result-eight { display: grid; place-items: center; width: 70px; height: 70px; margin: 17px auto 13px; border-radius: 50%; color: white; background: #080909; font-family: Arial, sans-serif; font-size: 29px; font-weight: 700; box-shadow: inset -8px -10px 16px #000, inset 5px 6px 10px rgba(255,255,255,.12), 0 10px 30px rgba(0,0,0,.45); }

button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Compact in-game layout. Triggered by narrow width (phone portrait) OR short
   height (phone LANDSCAPE — 812×375 / 844×390 are wider than 760px but the
   desktop bottom rail collides with the spin panel and clips controls there).
   Horizontal placement stays on var(--safe-left/right) = env(safe-area-inset-*),
   which is where landscape phones put their notches. */
@media (max-width: 760px), (max-height: 480px) {
  .menu-overlay { grid-template-columns: 1fr; gap: 22px; padding: 20px; }
  .brand-lockup { align-self: end; justify-self: center; }
  h1 { font-size: clamp(62px, 19vw, 92px); }
  .brand-lockup p { margin-top: 13px; }
  .menu-panel { align-self: start; padding: 21px; }
  .primary-button, .secondary-button { min-height: 58px; margin-top: 11px; }
  .game-hud { grid-template-columns: 1fr auto 1fr; gap: 8px; }
  .avatar { width: 32px; height: 32px; flex-basis: 32px; font-size: 11px; }
  .player-label, .mini-balls { display: none; }
  .turn-center strong { font-size: 11px; }
  .shot-ui { bottom: calc(var(--safe-bottom) + 4px); grid-template-columns: auto minmax(90px, 1fr) 34px; width: calc(100vw - 150px); }
  .spin-ui { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px; background: transparent; border-color: transparent; backdrop-filter: none; }
  .spin-copy, .spin-reset { display: none; }
  .spin-ball { grid-column: 1; width: 50px; height: 50px; }
  /* The compact layout hides the CUE STRIKE copy — name the bare ball. */
  body.touch-ui .spin-touch-label { display: block; }
  .call-pocket { top: 12%; min-width: 210px; }
  /* Coach: compact HUD is shorter — tuck the banner in closer, still clear of
     the player cards, and let long copy wrap inside the pill. */
  .coach {
    top: calc(var(--safe-top) + 58px);
    padding: 9px 16px 8px;
    font-size: 13px;
    letter-spacing: .14em;
    line-height: 1.45;
    white-space: normal;
    border-radius: 22px;
    max-width: min(360px, calc(100vw - 24px));
  }
}

@media (max-width: 400px) {
  /* At 375px the power % readout (last shot-ui column) sat under the
     sound/pause cluster (x 266–300 vs 275–359). End the shot UI before the
     cluster starts and let the track give up width instead. */
  .shot-ui { width: calc(100vw - 210px); grid-template-columns: auto minmax(52px, 1fr) 34px; gap: 8px; }
  /* "DAILY CHALLENGE #N" must hold one line at 360–390px (the &nbsp; glues
     #N to CHALLENGE; tighter tracking keeps the whole label comfortably fit).
     b.daily-label so this outranks the earlier .primary-button b rule. */
  b.daily-label { letter-spacing: .09em; }
}

@media (max-height: 560px) {
  .menu-overlay { grid-template-columns: minmax(250px, 1fr) minmax(310px, 390px); gap: 40px; padding: 18px 50px; }
  .brand-lockup p { display: none; }
  h1 { font-size: clamp(58px, 11vw, 88px); }
  .menu-panel { padding: 20px; }
  .primary-button, .secondary-button { min-height: 54px; margin-top: 9px; }
  .modal-card { transform: scale(.86); }
}

/* Phone landscape (812×375 / 844×390). AFTER the 560 block so these win. */
@media (max-height: 480px) {
  /* The bottom rail is shared by the spin ball (left), power rail (centre) and
     FIRE + sound/pause (right). Cap the power rail clear of both clusters. */
  .shot-ui { width: min(470px, calc(100vw - 320px)); }
  /* The 560-block menu still overflowed a 375px-tall viewport (the foot's
     sound toggle sat fully below the fold, the 2-player button flush with the
     edge). Compress to fit, and keep a scroll as the backstop. */
  .menu-overlay { align-items: center; overflow-y: auto; padding-block: 10px; }
  h1 { font-size: clamp(44px, 8vw, 64px); }
  .menu-panel { padding: 13px 16px; }
  .primary-button, .secondary-button { min-height: 44px; margin-top: 7px; }
  .game-choice { min-height: 44px; padding-block: 5px; }
  .match-overline { margin-top: 11px; }
  .menu-foot { margin-top: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Landscape phones: overlays must scroll and result/pause cards compact —
   place-items:center clips tall cards at short viewports (buttons cut off). */
@media (max-height: 480px) {
  .overlay { place-items: start center; overflow-y: auto; }
  .modal-card { transform: none; margin: 10px auto 16px; padding: 16px 22px 18px; }
  .modal-card h2 { font-size: 28px; }
  .modal-card p { margin: 7px 0 12px; }
  .result-eight { width: 42px; height: 42px; margin: 6px auto 8px; font-size: 18px; }
  .modal-card .primary-button, .modal-card .secondary-button { min-height: 44px; }
  .modal-card > .text-button { margin-top: 8px; }
}
