:root {
  --ink: #2b1a4a;
  --cream: #fff8ec;
  --sun: #ffd23f;
  --coral: #ff5d5d;
  --teal: #1fb5a8;
  --sky: #4d96ff;
  --grape: #7b5cd6;
  --panel: rgba(255, 248, 236, 0.96);
  --glass: rgba(32, 22, 58, 0.62);
  --r: 18px;
  --font: "Arial Rounded MT Bold", "Nunito", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: #1d1631; }
body { margin: 0; font-family: var(--font); color: var(--cream); background: #1d1631; -webkit-tap-highlight-color: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--sun); color: var(--ink); padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { left: 8px; }
button { font-family: inherit; }
kbd { font-family: inherit; }

.stage { position: relative; height: 100vh; height: 100svh; min-height: 320px; overflow: hidden; outline: none; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; background: #2a2440; overscroll-behavior: none; }
body[data-view="play"] { overscroll-behavior: none; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------------------------------------------------------------- logo */
.logo { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 0.02em; font-size: clamp(40px, 8.4vw, 112px); font-weight: 900; line-height: 0.95; letter-spacing: -0.02em; }
.logo span { display: inline-block; color: var(--c, var(--sun)); -webkit-text-stroke: 0.06em var(--ink); paint-order: stroke fill; text-shadow: 0 0.08em 0 var(--ink), 0 0.14em 0 rgba(0, 0, 0, 0.25); transform: rotate(var(--rot, 0deg)) translateY(var(--dy, 0)); animation: bob 2.4s ease-in-out infinite; animation-delay: var(--d, 0s); }
.logo i { width: 0.28em; }
.logo span:nth-of-type(6n+1) { --c: #ff5d5d; --rot: -7deg; }
.logo span:nth-of-type(6n+2) { --c: #ffd23f; --rot: 5deg; --dy: -0.05em; }
.logo span:nth-of-type(6n+3) { --c: #4d96ff; --rot: -4deg; }
.logo span:nth-of-type(6n+4) { --c: #1fb5a8; --rot: 6deg; }
.logo span:nth-of-type(6n+5) { --c: #ff9f1c; --rot: -5deg; --dy: -0.04em; }
.logo span:nth-of-type(6n) { --c: #b28dff; --rot: 4deg; }
.logo span:nth-of-type(n) { animation-delay: calc(var(--i, 0) * 0.08s); }
.logo span:last-of-type { --c: #ffd23f; --rot: 14deg; --dy: 0.06em; animation-name: flop; }
.logo.small { font-size: 44px; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -0.05em; } }
@keyframes flop { 0%, 60%, 100% { rotate: 0deg; translate: 0 0; } 70% { rotate: 70deg; translate: 0.05em 0.1em; } 85% { rotate: 85deg; translate: 0.08em 0.14em; } }
@media (prefers-reduced-motion: reduce) { .logo span { animation: none; } }

/* ---------------------------------------------------------------- loading */
.loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 18px; background: radial-gradient(circle at 50% 40%, #47367a, #1d1631 70%); z-index: 20; }
.load-track { width: min(320px, 70vw); height: 14px; border-radius: 99px; background: rgba(255, 255, 255, 0.15); overflow: hidden; border: 2px solid rgba(255, 255, 255, 0.25); }
.load-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--sun), var(--coral)); transform-origin: left; transform: scaleX(0); transition: transform 0.3s; }
.loading p { margin: 0; font-size: 16px; opacity: 0.85; }

/* ---------------------------------------------------------------- menu */
.menu { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: calc(56px + var(--safe-t)) calc(16px + var(--safe-r)) calc(16px + var(--safe-b)) calc(16px + var(--safe-l)); background: linear-gradient(180deg, rgba(29, 22, 49, 0.25), rgba(29, 22, 49, 0.05) 40%, rgba(29, 22, 49, 0.55)); overflow-y: auto; touch-action: pan-y; }
.panel { width: min(980px, 100%); display: grid; gap: 14px; justify-items: center; text-align: center; }
.tagline { margin: -4px 0 4px; font-size: clamp(16px, 2.4vw, 22px); text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
.tagline b { color: var(--sun); }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; width: 100%; }
.mode-card.andy { grid-column: 1 / -1; min-height: 104px; background: linear-gradient(160deg, #ffe1d6, #ff9a7a); }
.mode-card.andy b { font-size: 28px; }
.andy .mc-ic { background: radial-gradient(circle at 50% 38%, #fff 0 16%, transparent 17%), linear-gradient(#ff3d3d, #c81d1d); }
.mode-card { position: relative; display: grid; gap: 6px; align-content: start; text-align: left; padding: 18px 18px 18px 86px; min-height: 120px; border-radius: 22px; border: 4px solid var(--ink); background: var(--cream); color: var(--ink); cursor: pointer; box-shadow: 0 7px 0 var(--ink), 0 14px 28px rgba(0, 0, 0, 0.35); transition: transform 0.12s, box-shadow 0.12s; }
.mode-card b { font-size: 22px; }
.mode-card span { font-size: 14px; line-height: 1.3; opacity: 0.8; font-family: system-ui, sans-serif; font-weight: 600; }
.mode-card:hover, .mode-card:focus-visible { transform: translateY(-3px) rotate(-0.6deg); box-shadow: 0 10px 0 var(--ink), 0 18px 30px rgba(0, 0, 0, 0.4); outline: none; }
.mode-card:active { transform: translateY(4px); box-shadow: 0 3px 0 var(--ink); }
.mode-card.sandbox { background: linear-gradient(160deg, #fff6d5, #ffe08a); }
.mode-card.arcade { background: linear-gradient(160deg, #e3f4ff, #9fd0ff); }
.mode-card.stealth { background: linear-gradient(160deg, #f0e6ff, #c6b0ff); }
.mc-ic { position: absolute; left: 16px; top: 18px; width: 56px; height: 56px; border-radius: 16px; border: 3px solid var(--ink); background: var(--coral); }
.sandbox .mc-ic { background: radial-gradient(circle at 35% 30%, #fff 0 10%, transparent 11%), radial-gradient(circle at 50% 55%, #ff9f1c 0 34%, transparent 35%), #ffd23f; }
.arcade .mc-ic { background: conic-gradient(from 0deg, #ff5d5d 0 25%, #ffd23f 0 50%, #4d96ff 0 75%, #1fb5a8 0); }
.stealth .mc-ic { background: radial-gradient(ellipse 60% 34% at 50% 50%, #fff 0 60%, transparent 62%), #7b5cd6; }
.stealth .mc-ic::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px; border-radius: 50%; background: var(--ink); }
.toy-row { display: grid; gap: 8px; justify-items: center; width: 100%; }
.row-label { margin: 6px 0 0; font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.85; text-shadow: 0 1px 4px #000; }
.toys { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.toy-pick { display: grid; justify-items: center; gap: 2px; width: 108px; padding: 10px 6px; border-radius: 16px; border: 3px solid rgba(255, 255, 255, 0.4); background: var(--glass); color: var(--cream); cursor: pointer; backdrop-filter: blur(6px); }
.toy-pick b { font-size: 16px; }
.toy-pick span { font-size: 12px; opacity: 0.8; font-family: system-ui, sans-serif; }
.toy-pick[aria-pressed="true"] { border-color: var(--sun); background: rgba(255, 210, 63, 0.24); box-shadow: 0 0 0 3px rgba(255, 210, 63, 0.35); }
.toy-pick:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.toy-ic { width: 42px; height: 42px; border-radius: 50%; background: var(--c); border: 3px solid var(--ink); position: relative; }
.toy-ic::before, .toy-ic::after { content: ""; position: absolute; top: 14px; width: 8px; height: 10px; border-radius: 50%; background: #fff; box-shadow: inset 0 -3px 0 #111; }
.toy-ic::before { left: 9px; } .toy-ic::after { right: 9px; }
.toy-ic.teddy { box-shadow: -12px -12px 0 -6px var(--c), 12px -12px 0 -6px var(--c); }
.toy-ic.robot { border-radius: 10px; }
.toy-ic.dino { border-radius: 50% 50% 40% 40%; box-shadow: 0 -10px 0 -6px #ff8a3a; }
.toy-blurb { margin: 0; font-size: 14px; min-height: 1.3em; text-shadow: 0 1px 4px #000; font-family: system-ui, sans-serif; font-weight: 600; }
.panel-head { display: flex; align-items: center; gap: 12px; width: 100%; }
.panel-head h2 { margin: 0; font-size: clamp(24px, 4vw, 36px); text-shadow: 0 3px 0 var(--ink); }
.panel-sub { margin: 0; max-width: 640px; text-shadow: 0 1px 4px #000; font-family: system-ui, sans-serif; font-weight: 600; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; width: 100%; }
.list-card { display: grid; gap: 4px; text-align: left; padding: 14px 16px; border-radius: 16px; border: 3px solid var(--ink); background: var(--cream); color: var(--ink); cursor: pointer; box-shadow: 0 5px 0 var(--ink); min-height: 84px; }
.list-card b { font-size: 17px; }
.list-card span { font-size: 13px; opacity: 0.8; font-family: system-ui, sans-serif; font-weight: 600; }
.list-card:hover, .list-card:focus-visible { transform: translateY(-2px); outline: none; background: #fff3c4; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 20px; border-radius: 99px; border: 3px solid var(--ink); background: var(--cream); color: var(--ink); font-size: 16px; font-weight: 800; cursor: pointer; box-shadow: 0 4px 0 var(--ink); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn.primary { background: var(--sun); }
.btn.ghost { background: var(--glass); color: var(--cream); border-color: rgba(255, 255, 255, 0.5); box-shadow: none; backdrop-filter: blur(6px); }
.btn:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }

/* ---------------------------------------------------------------- HUD */
.hud { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.hud > * { pointer-events: none; }
.hud button, .hud input, .hud .hint, .hud .card-wrap, .hud .caught, .hud .replay-bar { pointer-events: auto; }
.hud-top { position: absolute; top: calc(10px + var(--safe-t)); left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r)); display: flex; gap: 8px; align-items: flex-start; }
body[data-view="play"] .hud-top { top: calc(66px + var(--safe-t)); }
.hud-top-right { margin-left: auto; display: flex; gap: 8px; }
.hbtn { display: inline-grid; place-items: center; width: 46px; height: 46px; padding: 0; border-radius: 14px; border: 2px solid rgba(255, 255, 255, 0.35); background: var(--glass); color: var(--cream); cursor: pointer; backdrop-filter: blur(6px); }
.hbtn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.hbtn svg .fill { fill: currentColor; stroke: none; }
.hbtn.pill { width: auto; grid-auto-flow: column; gap: 6px; padding: 0 14px 0 10px; background: rgba(255, 93, 93, 0.85); border-color: #fff; font-weight: 900; }
.hbtn.pill em { font-style: normal; font-size: 15px; }
.hbtn:focus-visible { outline: 3px solid var(--sun); }
.hbtn.pulse { animation: pulse 1.2s ease-in-out infinite; border-color: var(--sun); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(255, 210, 63, 0.35); } }
.mode-chip { display: grid; gap: 1px; padding: 6px 12px; border-radius: 14px; background: var(--glass); backdrop-filter: blur(6px); max-width: min(46vw, 420px); }
.mode-chip b { font-size: 15px; color: var(--sun); }
.mode-chip span { font-size: 13px; font-family: system-ui, sans-serif; font-weight: 600; line-height: 1.25; opacity: 0.92; }

.warn { position: absolute; left: 50%; top: calc(128px + var(--safe-t)); translate: -50% 0; display: grid; justify-items: center; padding: 10px 26px 12px; border-radius: 20px; background: #ff3d3d; border: 4px solid var(--ink); box-shadow: 0 6px 0 var(--ink); text-align: center; animation: shout 0.35s ease-out; }
.warn strong { font-size: clamp(26px, 5vw, 44px); letter-spacing: 0.02em; -webkit-text-stroke: 0.04em var(--ink); paint-order: stroke fill; color: #fff; animation: shake 0.18s linear infinite; }
.warn span { font-size: 18px; font-weight: 900; color: var(--sun); }
.warn-door { position: absolute; right: -54px; top: 50%; width: 42px; height: 42px; margin-top: -21px; display: grid; place-items: center; border-radius: 50%; background: var(--sun); color: var(--ink); border: 3px solid var(--ink); }
.warn-door svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; }
@keyframes shout { from { transform: scale(0.4); } 70% { transform: scale(1.1); } }
@keyframes shake { 25% { translate: -1px 1px; } 50% { translate: 1px -1px; } 75% { translate: -1px -1px; } }
body.reduced .warn, body.reduced .warn strong { animation: none; }
.seen { position: absolute; left: 50%; top: calc(220px + var(--safe-t)); translate: -50% 0; display: grid; grid-template-columns: auto auto; align-items: center; gap: 4px 8px; padding: 8px 14px; border-radius: 14px; background: rgba(20, 14, 38, 0.82); border: 2px solid var(--sun); font-size: 15px; }
.seen svg { width: 26px; height: 26px; fill: none; stroke: var(--sun); stroke-width: 2.2; }
.seen svg .fill { fill: var(--sun); }
.seen i { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--coral); transform-origin: left; transform: scaleX(0); }
.seen.danger { border-color: var(--coral); background: rgba(120, 10, 20, 0.85); }

.target-label { position: absolute; left: 0; top: 0; padding: 5px 10px; border-radius: 10px; background: var(--sun); color: var(--ink); font-size: 14px; font-weight: 900; border: 2px solid var(--ink); white-space: nowrap; }
.target-label::after { content: ""; position: absolute; left: 50%; bottom: -8px; margin-left: -6px; border: 6px solid transparent; border-top-color: var(--ink); }
.captions { position: absolute; left: 50%; bottom: calc(190px + var(--safe-b)); translate: -50% 0; display: flex; gap: 8px; align-items: baseline; padding: 8px 14px; border-radius: 14px; background: rgba(20, 14, 38, 0.8); max-width: min(90vw, 560px); opacity: 0; transition: opacity 0.2s; font-size: 16px; }
.captions.on { opacity: 1; }
.captions b { color: var(--c); }
.captions span { font-family: system-ui, sans-serif; font-weight: 700; }
.toast { position: absolute; left: 50%; top: 44%; translate: -50% -50%; padding: 10px 18px; border-radius: 14px; background: rgba(20, 14, 38, 0.86); font-size: 18px; font-weight: 900; opacity: 0; transition: opacity 0.2s; }
.toast.on { opacity: 1; }
.toast[data-kind="seen"] { background: #ff3d3d; border: 3px solid var(--ink); font-size: 26px; }
.hint { position: absolute; left: 50%; top: calc(128px + var(--safe-t)); translate: -50% 0; display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 16px; border-radius: 16px; background: var(--panel); color: var(--ink); border: 3px solid var(--ink); max-width: min(92vw, 560px); font-family: system-ui, sans-serif; font-weight: 700; font-size: 15px; box-shadow: 0 5px 0 var(--ink); }
.hint .x { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(43, 26, 74, 0.1); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.hint .x svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.6; fill: none; }

.controls { position: absolute; inset: 0; }
.stick-ghost { position: absolute; left: calc(26px + var(--safe-l)); bottom: calc(26px + var(--safe-b)); width: 124px; height: 124px; border-radius: 50%; border: 3px dashed rgba(255, 255, 255, 0.35); display: none; }
.stick-ghost i { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px; border-radius: 50%; background: rgba(255, 255, 255, 0.25); }
.stage[data-touch="1"] .stick-ghost { display: block; }
.hud.sticking .stick-ghost { opacity: 0; }
.stick { position: absolute; width: 128px; height: 128px; margin: -64px 0 0 -64px; border-radius: 50%; background: rgba(20, 14, 38, 0.35); border: 3px solid rgba(255, 255, 255, 0.55); }
.stick i { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; border-radius: 50%; background: var(--cream); border: 3px solid var(--ink); transform: translate(-50%, -50%); }
.key-hints { position: absolute; left: calc(14px + var(--safe-l)); bottom: calc(14px + var(--safe-b)); display: flex; gap: 12px; font-size: 13px; font-family: system-ui, sans-serif; font-weight: 700; text-shadow: 0 1px 3px #000; opacity: 0.85; }
.key-hints kbd, .cbtn kbd { display: inline-block; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.85); color: var(--ink); font-size: 11px; font-weight: 900; text-shadow: none; }
.stage[data-touch="1"] .cbtn kbd, .stage[data-touch="1"] .key-hints { display: none; }

.buttons { position: absolute; right: calc(16px + var(--safe-r)); bottom: calc(18px + var(--safe-b)); width: 280px; height: 250px; }
.cbtn { position: absolute; display: grid; place-items: center; align-content: center; gap: 2px; border-radius: 50%; border: 4px solid var(--ink); color: var(--ink); font-weight: 900; cursor: pointer; box-shadow: 0 5px 0 var(--ink); touch-action: none; transition: transform 0.06s; }
.cbtn.down, .cbtn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.cbtn:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
.cbtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.flop { right: 0; bottom: 0; width: 112px; height: 112px; background: radial-gradient(circle at 35% 30%, #ff9a9a, #ff3d3d 60%); color: #fff; font-size: 23px; -webkit-text-stroke: 1px var(--ink); paint-order: stroke fill; }
.flop.getup { background: radial-gradient(circle at 35% 30%, #c7ffbf, #34c759 60%); font-size: 17px; }
.flop.blocked { filter: grayscale(0.7); opacity: 0.8; }
.jump { right: 124px; bottom: 6px; width: 74px; height: 74px; background: radial-gradient(circle at 35% 30%, #fff8c9, #ffd23f 65%); font-size: 15px; }
.act { right: 10px; bottom: 126px; min-width: 92px; width: auto; height: 64px; padding: 0 14px; border-radius: 32px; background: radial-gradient(circle at 35% 30%, #e1f0ff, #79b8ff 70%); font-size: 14px; max-width: 220px; }
.act span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.more { right: 0; bottom: 200px; width: 50px; height: 50px; background: var(--cream); }
.throw { right: 60px; bottom: 200px; width: 64px; height: 64px; background: radial-gradient(circle at 35% 30%, #ffe1c2, #ff9f1c 70%); font-size: 13px; }
.reset { right: 124px; bottom: 92px; width: 64px; height: 64px; background: var(--cream); font-size: 11px; }
.hud.replaying .controls, .hud.replaying .hud-top, .hud.replaying .warn, .hud.replaying .seen, .hud.replaying .target-label { display: none; }
.stage[data-touch="0"] .buttons { transform: scale(0.82); transform-origin: right bottom; }

/* Portrait phones: stack the right-hand buttons tighter and lift captions above them. */
.stage[data-orient="portrait"] .buttons { width: 210px; height: 240px; }
.stage[data-orient="portrait"] .flop { width: 100px; height: 100px; font-size: 21px; }
.stage[data-orient="portrait"] .jump { right: 108px; bottom: 4px; width: 70px; height: 70px; }
.stage[data-orient="portrait"] .act { bottom: 114px; }
.stage[data-orient="portrait"] .more { bottom: 186px; }
.stage[data-orient="portrait"] .throw { right: 60px; bottom: 186px; width: 58px; height: 58px; }
.stage[data-orient="portrait"] .reset { right: 112px; bottom: 84px; width: 58px; height: 58px; }
.stage[data-orient="portrait"] .captions { bottom: calc(262px + var(--safe-b)); }
.stage[data-orient="portrait"] .hint { top: calc(186px + var(--safe-t)); }
.stage[data-orient="portrait"] .mode-chip { max-width: calc(100vw - 120px); }
.stage[data-orient="portrait"] .hud-top { flex-wrap: wrap; }
.stage[data-orient="portrait"] .hud-top-right { order: -1; margin-left: auto; }
.stage[data-orient="portrait"] .mode-chip { order: 2; flex-basis: 100%; max-width: none; }
.stage[data-orient="portrait"] .hbtn.pill em { display: none; }
.stage[data-orient="portrait"] .hbtn.pill { padding: 0 10px; }
.stage[data-orient="portrait"] .warn { top: calc(190px + var(--safe-t)); }
.stage[data-orient="portrait"] .seen { top: calc(276px + var(--safe-t)); }
/* Short landscape phones. */
@media (max-height: 460px) {
  body[data-view="play"] .hud-top { top: calc(10px + var(--safe-t)); left: calc(128px + var(--safe-l)); }
  .warn { top: calc(60px + var(--safe-t)); padding: 6px 18px 8px; }
  .warn strong { font-size: 28px; }
  .seen { top: calc(136px + var(--safe-t)); }
  .buttons { transform: scale(0.86); transform-origin: right bottom; }
  .captions { bottom: calc(12px + var(--safe-b)); max-width: 46vw; font-size: 14px; }
  .hint { top: calc(62px + var(--safe-t)); padding: 6px 6px 6px 12px; font-size: 14px; }
  .mode-chip span { display: none; }
  .menu { padding-top: calc(12px + var(--safe-t)); place-items: start center; }
  .logo { font-size: 50px; }
  .modes { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .mode-card.andy { min-height: 72px; }
  .mode-card.andy b { font-size: 20px; }
  .mode-card { min-height: 92px; padding: 12px 12px 12px 66px; }
  .mode-card b { font-size: 17px; }
  .mode-card span { font-size: 12px; }
  .mc-ic { width: 42px; height: 42px; left: 12px; top: 14px; }
  .toy-pick { width: 92px; padding: 6px; }
  .toy-ic { width: 34px; height: 34px; }
  .toy-ic::before, .toy-ic::after { top: 10px; }
}
@media (max-width: 720px) {
  .modes { grid-template-columns: 1fr; }
  .mode-card { min-height: 92px; }
}

.replay-bar { position: absolute; left: 50%; bottom: calc(18px + var(--safe-b)); translate: -50% 0; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 18px; background: rgba(20, 14, 38, 0.85); width: min(680px, calc(100vw - 24px)); }
.replay-bar input { flex: 1; min-width: 60px; accent-color: var(--sun); height: 32px; }
.seg { display: flex; border-radius: 12px; overflow: hidden; border: 2px solid rgba(255, 255, 255, 0.35); }
.seg button { border: 0; background: transparent; color: var(--cream); min-width: 40px; height: 40px; font-weight: 900; cursor: pointer; font-size: 15px; }
.seg button.on { background: var(--sun); color: var(--ink); }
.replay-tag { position: absolute; left: 50%; top: calc(14px + var(--safe-t)); translate: -50% 0; padding: 4px 14px; border-radius: 10px; background: var(--coral); font-weight: 900; letter-spacing: 0.15em; border: 3px solid var(--ink); }
body[data-view="play"] .replay-tag { top: calc(66px + var(--safe-t)); }
@media (max-width: 520px) { .replay-bar { flex-wrap: wrap; justify-content: center; } .replay-bar input { flex-basis: 100%; order: -1; } }

.card-wrap, .modal { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(20, 14, 38, 0.45); z-index: 12; }
.card, .sheet { width: min(460px, 100%); max-height: calc(100% - 20px); overflow-y: auto; display: grid; gap: 12px; padding: 22px; border-radius: 24px; background: var(--panel); color: var(--ink); border: 4px solid var(--ink); box-shadow: 0 8px 0 var(--ink); text-align: center; }
.card h2, .sheet h2 { margin: 0; font-size: 30px; }
.card p { margin: 0; font-family: system-ui, sans-serif; font-weight: 700; }
.card .kicker { text-transform: uppercase; letter-spacing: 0.14em; font-size: 13px; color: var(--grape); }
.card #h-card-line { font-size: 22px; font-family: var(--font); color: #e0452f; }
.row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.sheet .btn { width: 100%; }
.sheet .row .btn { width: auto; flex: 1 1 140px; }
.settings { text-align: left; }
.field { display: grid; gap: 4px; font-weight: 800; }
.field input[type="range"] { width: 100%; accent-color: var(--grape); height: 28px; }
.field select { height: 42px; border-radius: 10px; border: 2px solid var(--ink); font: inherit; padding: 0 8px; }
.tog { display: flex; align-items: center; gap: 10px; font-weight: 800; flex-wrap: wrap; }
.tog input { width: 24px; height: 24px; accent-color: var(--grape); }
.tog small { flex-basis: 100%; margin-left: 34px; font-family: system-ui, sans-serif; font-weight: 600; opacity: 0.7; }
.shot img { width: 100%; height: auto; border-radius: 12px; border: 3px solid var(--ink); background: #333; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.chips button { border: 2px solid var(--ink); border-radius: 99px; background: #fff; color: var(--ink); font-weight: 900; padding: 6px 10px; font-size: 13px; cursor: pointer; min-height: 36px; }
.chips button.on { background: var(--sun); }
.caught { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; background: rgba(255, 61, 61, 0.28); z-index: 11; }
.caught b { font-size: clamp(44px, 10vw, 110px); color: #fff; -webkit-text-stroke: 0.05em var(--ink); paint-order: stroke fill; text-shadow: 0 6px 0 var(--ink); animation: shout 0.4s ease-out; transform: rotate(-4deg); }
.caught small { font-size: 16px; font-weight: 800; text-shadow: 0 1px 4px #000; }

/* ---------------------------------------------------------------- page copy */
.game-copy { max-width: 1060px; margin: 0 auto; padding: 40px 20px; color: #f2ecff; font-family: system-ui, sans-serif; line-height: 1.6; }
.game-copy h2 { font-family: var(--font); font-size: 28px; margin: 0 0 8px; color: var(--sun); }
.game-copy h3 { font-family: var(--font); margin: 0 0 6px; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin: 24px 0; }
.how-grid article { padding: 18px; border-radius: 16px; background: rgba(255, 255, 255, 0.06); }
.faq details { padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.faq summary { cursor: pointer; font-weight: 700; }

.hud.warning .hint { display: none; }
@media (max-width: 520px) {
  .menu { padding-top: calc(74px + var(--safe-t)); }
  .toys { gap: 8px; flex-wrap: nowrap; }
  .toy-pick { width: 80px; padding: 8px 4px; }
  .toy-pick span { font-size: 11px; }
}
/* Short phones (375x667 and similar): all four modes must fit in the first viewport. */
@media (max-width: 520px) and (max-height: 740px) {
  .menu { padding-top: calc(64px + var(--safe-t)); }
  .logo { font-size: 40px; }
  .tagline { margin: -6px 0 2px; font-size: 15px; }
  .mode-card, .mode-card.andy { min-height: 0; gap: 3px; padding: 12px 14px 12px 72px; }
  .mode-card b { font-size: 19px; }
  .mode-card.andy b { font-size: 23px; }
  .mode-card span { font-size: 13px; line-height: 1.25; }
  .mc-ic { width: 44px; height: 44px; left: 14px; top: 14px; }
}
