.arcade-kicker { font-size:.65rem; letter-spacing:.14em; font-weight:750; color:var(--muted); }
.arcade-section-title { display:flex; align-items:end; justify-content:space-between; gap:20px; margin-bottom:16px; }
.arcade-section-title h2 { margin:5px 0 0; font-size:1.25rem; letter-spacing:-.035em; }
.arcade-section-title p { margin:0; }
.arcade-section-title > a { font-size:.8rem; min-height:44px; display:flex; align-items:center; white-space:nowrap; }
.feature-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.feature { color:#eaf2d8; background:#10271f; border:1px solid rgba(255,255,255,.08); border-radius:20px; overflow:hidden; text-decoration:none; display:flex; flex-direction:column; box-shadow:0 10px 24px rgba(15,29,24,.08); transition:transform .18s,box-shadow .18s; }
.feature--orbit { background:#0b202b; color:#e2f4f6; }.feature--circuit { background:#0d2925; color:#e7f3da; }
.feature img { display:block; width:100%; height:auto; aspect-ratio:1.6; object-fit:cover; }
.feature__copy { padding:18px 22px 0; }
.feature .arcade-kicker { color:#aebfba; font-size:.58rem; }
.feature h3 { font-size:1.65rem; letter-spacing:-.04em; margin:5px 0 8px; }
.feature p { font-size:.87rem; line-height:1.5; color:#b9ccc4; margin:0 0 20px; }
.feature__action { border-top:1px solid #ffffff24; display:flex; justify-content:space-between; align-items:center; min-height:52px; font-size:.78rem; font-weight:650; }
.feature__action span { font-size:1.25rem; }
.feature:hover { transform:translateY(-4px); box-shadow:0 16px 30px rgba(15,29,24,.18); }
.feature:focus-visible { outline:3px solid var(--accent-2); outline-offset:4px; }
.arcade-features { margin-bottom:44px; }
@media(max-width:680px) {
 .arcade-section-title { align-items:start; }.arcade-section-title h2 { font-size:1.1rem; }
 .arcade-section-title > a { font-size:.72rem; }
 .feature-grid { display:flex; gap:12px; overflow-x:auto; padding:4px 3px 12px; margin:0 -3px; scroll-snap-type:x mandatory; }
 .feature { flex:0 0 84%; scroll-snap-align:start; }
 .feature__copy { padding:16px 18px 0; }.feature h3 { font-size:1.5rem; }.feature p { margin-bottom:14px; }
 .arcade-features { margin-bottom:24px; }
}
@media(prefers-reduced-motion:reduce) { .feature { transition:none; }.feature:hover { transform:none; }.feature-grid { scroll-behavior:auto; } }

/* The game worlds share a control language while retaining their own board palettes. */
.arcade-game { background:#f1f0e9; }
.arcade-game .game { padding-top:24px; }
.arcade-game .game .game__header { margin-bottom:18px; }
.arcade-game .game .game__header h1 { font-weight:750; letter-spacing:-.05em; }
.arcade-game .game .btn { border-radius:10px; transition:background .15s,box-shadow .15s,transform .15s; }
.arcade-game .game .btn:not(:disabled):active { transform:translateY(1px); }
.arcade-game .game #board { border:1px solid #496052; box-shadow:0 4px 0 #243f35,0 18px 35px #10241c26; border-radius:18px; }
.arcade-game .game .overlay { padding:12px; background:rgba(5,17,15,.38); backdrop-filter:blur(1px); border-radius:18px; }
.arcade-game .game .overlay__card { color:#eff5e5; background:#132d26ed; border:1px solid #a1c3a445; border-radius:16px; padding:22px; max-width:300px; max-height:100%; overflow:auto; box-shadow:0 12px 30px #0004; }
.arcade-game .game .overlay__card p { color:#c4d7cd; font-size:.86rem; line-height:1.5; }
.arcade-game .game .overlay__card h2 { font-size:1.75rem; line-height:1.06; letter-spacing:-.05em; margin:8px 0 12px; }
.arcade-game .game .overlay__card .btn { background:#c1e895; color:#173225; border-color:#c1e895; font-weight:750; box-shadow:0 3px 0 #79a75b; min-height:44px; }
.overlay__identity::before { content:var(--i18n-world-pocket-arcade,'POCKET ARCADE'); color:#acc7b8; font-size:.6rem; font-weight:750; letter-spacing:.18em; }
.arcade-game .overlay[data-state="paused"] { background:#07140e1a; backdrop-filter:none; }
.arcade-game .overlay[data-state="paused"] .overlay__card { padding:16px 24px; }
.arcade-game .overlay[data-state="paused"] .overlay__card h2 { font-size:1.25rem; margin:0 0 6px; }
.arcade-game .overlay[data-state="paused"] .overlay__identity { display:none; }
.arcade-game .overlay[data-state="gameover"] .overlay__identity::before { content:var(--i18n-world-run-complete,'RUN COMPLETE'); color:#f7ba9c; }
.arcade-game .overlay[data-state="won"] .overlay__identity::before { content:var(--i18n-world-all-clear,'ALL CLEAR'); color:#c1e895; }
.arcade-game .result-score { display:none; }
.arcade-game .overlay[data-state="gameover"] .result-score,.arcade-game .overlay[data-state="won"] .result-score { display:flex; flex-direction:column; gap:3px; margin:12px 0; }
.result-score span { color:#adc2b7; font-size:.57rem; letter-spacing:.16em; }
.result-score b { font-size:2.8rem; line-height:1; font-weight:750; letter-spacing:-.065em; font-variant-numeric:tabular-nums; }
.arcade-game .game #mute { font-size:0; position:relative; }
.arcade-game .game #mute::before { content:''; display:block; width:20px; height:20px; margin:auto; background:currentColor; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9h4l5-4v14l-5-4H4zM16 8c3 2 3 6 0 8M19 5c5 4 5 10 0 14' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; }
.arcade-game .game #mute[aria-pressed="true"]::after { content:''; position:absolute; width:24px; height:2px; background:currentColor; left:10px; top:20px; transform:rotate(-45deg); }
.arcade-game .game .hint,.arcade-game .game details { color:var(--muted); }
@media(prefers-color-scheme:dark) { .arcade-game { background:#101914; } }
@media(max-width:380px) { .arcade-game .game .overlay__card { padding:16px; }.arcade-game .game .overlay__card h2 { font-size:1.35rem; }.result-score b { font-size:2.2rem; }.arcade-game .game .overlay__card p { font-size:.78rem; } }
@media(prefers-reduced-motion:reduce) { .arcade-game .game .btn { transition:none; }.arcade-game .game .btn:not(:disabled):active { transform:none; } }
.feature:hover { text-decoration:none; }
@media(max-width:680px) {
 .feature-grid { padding:8px 8px 14px; margin:0 -8px; }
}

.arcade-arrow { display:inline-block; vertical-align:middle; flex:0 0 auto; }

.arcade-game .game .btn:disabled { opacity:.45; cursor:default; pointer-events:none; box-shadow:none; transform:none; }
/* Let the featured worlds enter the first phone-sized view. */
@media(max-width:680px) {
 .arcade-section-title { gap:12px; margin-bottom:10px; }
}

.arcade-game .game .tiles .btn:disabled,.arcade-game .game .controls .btn:disabled { box-shadow:none; }

/* Survival expeditions: the route, resource and native controls frame each world. */
.arcade-game--survival { --survival-ink:#18313e; --survival-rim:#577b8b; --survival-paper:#dcebee; --survival-accent:#c9e7ed; --survival-shade:#8cbdc8; }
.arcade-game--survival .game { max-width:512px; padding:16px 16px 40px; }
.arcade-game--survival .game .game__header { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:10px; margin:0 0 10px; }
.arcade-game--survival .game .game__header h1 { font-size:1.25rem; letter-spacing:-.04em; text-align:center; white-space:nowrap; }
.arcade-game--survival .game .back { font-size:.75rem; color:var(--muted); white-space:nowrap; min-height:44px; display:flex; align-items:center; }
.arcade-game--survival .game__tools { display:flex; gap:4px; }
.arcade-game--survival .game__tools .btn { width:44px; height:44px; padding:0; }
.arcade-game--survival .game .hud { display:grid; grid-template-columns:1fr 1fr; gap:10px; padding:8px 0; margin:0 0 8px; border:0; border-block:1px solid var(--border); border-radius:0; background:none; }
.arcade-game--survival .hud > span { display:flex; flex-direction:column; gap:2px; min-width:0; font-size:.7rem; line-height:1.35; }
.arcade-game--survival .hud > span:last-child { text-align:right; }
.arcade-game--survival .hud b { font-size:.9rem; font-weight:700; line-height:1.4; font-variant-numeric:tabular-nums; }
.arcade-game--survival .field-note { margin:0 0 8px; font-size:.75rem; line-height:1.4; color:var(--muted); }
.arcade-game--survival .game .goalbar { height:4px; margin:0 0 10px; border:0; background:var(--border); }
.arcade-game--survival .game .goalbar__fill { background:var(--survival-rim); }
.arcade-game--survival .stage { position:relative; display:block; width:100%; }
.arcade-game--survival .game #board { display:block; width:100%; max-width:100%; height:auto; background:var(--survival-ink); touch-action:none; border:1px solid var(--survival-rim); border-radius:16px; box-shadow:0 4px 0 var(--survival-ink),0 18px 35px #142c3e26; }
.arcade-game--survival .game .overlay { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; background:#0a1b2940; }
.arcade-game--survival .game .overlay[hidden] { display:none; }
.arcade-game--survival .game .overlay__card { max-width:340px; padding:18px 20px; text-align:center; color:#eaf4f2; background:var(--survival-ink); border-color:var(--survival-rim); }
.arcade-game--survival .game .overlay__card h2 { font-size:1.6rem; margin:6px 0 10px; }
.arcade-game--survival .game .overlay__card p { margin:0 0 14px; font-size:.85rem; line-height:1.5; color:#c7dfe3; }
.arcade-game--survival .game .overlay__card .btn { color:var(--survival-ink); background:var(--survival-accent); border-color:var(--survival-accent); box-shadow:0 3px 0 var(--survival-shade); min-width:128px; }
.arcade-game--survival .result-score span { color:#bed5db; }
.arcade-game--survival .result-score b { font-size:2.25rem; }
.arcade-game--survival .game .controls { display:grid; grid-template-columns:1fr 1fr minmax(64px,.7fr); gap:8px; margin:14px 0 0; width:100%; }
.arcade-game--survival .game .controls .btn { display:flex; align-items:center; justify-content:center; gap:7px; min-width:0; min-height:48px; padding:8px 6px; font-size:.86rem; font-weight:700; background:var(--survival-paper); color:var(--survival-ink); border-color:var(--survival-rim); box-shadow:0 3px 0 var(--survival-shade); }
.arcade-game--survival .game .controls .btn small { font-size:.68rem; font-weight:500; }
.arcade-game--survival .game .controls .btn--primary { background:var(--survival-accent); }
.arcade-game--survival .game .controls .btn--ghost { color:var(--muted); background:none; border-color:var(--border); box-shadow:none; font-weight:600; }
.arcade-game--survival .game .controls .btn:disabled { opacity:.5; box-shadow:none; }
.arcade-game--survival .game .milestone { margin:12px 0 0; padding:0; border:0; border-radius:0; background:none; font-size:.77rem; line-height:1.5; color:var(--muted); }
.arcade-game--survival .survival-stats { display:flex; flex-wrap:wrap; gap:6px 16px; margin-top:12px; font-size:.75rem; line-height:1.5; color:var(--muted); font-variant-numeric:tabular-nums; }
.arcade-game--survival .survival-stats b { color:var(--text); }
.arcade-game--survival .survival-guide { border-top:1px solid var(--border); margin-top:14px; }
.arcade-game--survival .survival-guide summary { min-height:44px; padding:12px 0; font-size:.8rem; font-weight:600; cursor:pointer; }
.arcade-game--survival .survival-guide .hint { margin:0 0 12px; font-size:.8rem; }
.arcade-game--survival .game :focus-visible { outline:3px solid var(--accent-2); outline-offset:3px; }
.arcade-game--survival .game .overlay[data-state="paused"] { background:#07141b1a; backdrop-filter:none; }
.arcade-game--survival .game .overlay[data-state="paused"] .overlay__card { padding:12px 18px; }
.arcade-game--survival .game .overlay[data-state="paused"] .overlay__card h2 { font-size:1.15rem; margin:0 0 6px; }
.arcade-game--survival .game .overlay[data-state="paused"] .overlay__card p { font-size:.78rem; margin-bottom:10px; }
.arcade-game--frost { --survival-ink:#17394b; --survival-rim:#658f9d; --survival-paper:#dce8e8; --survival-accent:#f2cf91; --survival-shade:#9badb0; }
.arcade-game--frost .game .hud { grid-template-columns:.75fr 1.4fr; }
.arcade-game--frost .overlay[data-state="ready"] .overlay__identity::before { content:var(--i18n-world-endless-glacier,'ENDLESS GLACIER'); color:#bddce5; }
.arcade-game--frost .overlay[data-state="gameover"] .overlay__identity::before { content:var(--i18n-world-expedition-report,'EXPEDITION REPORT'); color:#f2cf91; }
@media(prefers-color-scheme:dark) {
 .arcade-game--frost { background:#112b37; }
 .arcade-game--survival .game .controls .btn:not(.btn--primary):not(.btn--ghost) { background:var(--survival-ink); color:#e0eded; }
}
@media(max-width:680px) {
 /* The shallow field and all narrow result reports retain an unobstructed primary action. */
 .arcade-game--survival .game .overlay:not([data-state="paused"]) { position:relative; inset:auto; margin-top:12px; padding:0; background:none; backdrop-filter:none; }
 .arcade-game--survival .game .overlay:not([data-state="paused"]) .overlay__card { width:100%; max-width:none; max-height:none; overflow:visible; padding:16px 18px; text-align:left; }
 .arcade-game--survival .game .overlay:not([data-state="paused"]) .overlay__card h2 { font-size:1.4rem; }
 .arcade-game--survival .game .overlay:not([data-state="paused"]) .overlay__card p { font-size:.8rem; }
}
@media(max-width:380px) {
 .arcade-game--survival .game .game__header { gap:5px; }
 .arcade-game--survival .game .game__header h1 { font-size:1.1rem; }
 .arcade-game--survival .game .controls .btn { gap:4px; font-size:.8rem; }
 .arcade-game--frost .game .controls .btn small { display:none; }
 .arcade-game--survival .game .overlay[data-state="paused"] .overlay__card { padding:9px 14px; }
 .arcade-game--survival .game .overlay[data-state="paused"] .overlay__card p { font-size:.75rem; margin-bottom:8px; }
}

/* Planning worlds: a brass rail workshop, cooling bay and potting bench. */
.arcade-game { min-height:100vh; min-height:100dvh; }

/* Quiet, optional reproducibility details below the game controls. */
.run-layout { margin-top:14px; border-top:1px solid var(--border); font-size:.8rem; line-height:1.6; }
.run-layout summary { min-height:44px; padding:12px 0; cursor:pointer; font-weight:600; }
.run-layout p { margin:8px 0; }
.run-layout code { font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.run-layout a { display:inline-block; padding:8px 0; min-height:44px; }

/* Reusable challenge actions: readable code, generous targets, honest fallback. */
.game .replay-panel { padding:0 14px 12px; border:1px solid var(--border); border-radius:12px; background:var(--bg-elev); font-size:.85rem; }
.game .replay-panel summary { min-height:48px; font-weight:650; }
.game .replay-panel .replay-panel__code { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; margin:14px 0 10px; }
.replay-panel__code code { padding:4px 10px; border:1px solid var(--border); border-radius:6px; background:var(--bg); color:var(--text); font-size:1rem; font-weight:650; letter-spacing:.08em; font-variant-numeric:tabular-nums; }
.game .replay-panel .replay-panel__actions { display:flex; flex-wrap:wrap; align-items:stretch; gap:8px; margin:0; }
.game .replay-panel .replay-panel__actions .btn { display:inline-flex; align-items:center; justify-content:center; flex:1 1 180px; min-width:0; min-height:48px; padding:10px 14px; text-align:center; line-height:1.5; white-space:normal; font-size:.85rem; }
.game .replay-panel .replay-panel__status { margin:10px 0 0; font-size:.8rem; line-height:1.6; overflow-wrap:anywhere; }
.game .replay-panel .replay-panel__status:empty { display:none; }
.replay-panel__fallback { margin-top:10px; }
.replay-panel__fallback label { display:block; margin-bottom:6px; font-size:.8rem; font-weight:600; }
.replay-panel__fallback input { display:block; width:100%; min-width:0; min-height:48px; padding:10px; border:1px solid var(--border); border-radius:8px; background:var(--bg); color:var(--text); font:inherit; font-size:16px; }
.replay-panel :focus-visible { outline:3px solid var(--accent-2); outline-offset:3px; }

/* Long localized titles reflow instead of pushing Help off a narrow screen.
   Retain each game's existing rows, native tools and desktop composition. */
@media(max-width:540px) {
 .arcade-game .game .game__header { grid-template-columns:auto minmax(0,1fr) auto; }
 .arcade-game .game .game__header h1 { min-width:0; white-space:normal; overflow-wrap:anywhere; text-align:center; }
}
