.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; }.arcade-game--chain .game { padding-top:16px; }.arcade-game--chain .game .game__header { margin-bottom:12px; }
.arcade-game--chain .game #board { border-color:#4c6b77; border-radius:16px; box-shadow:0 4px 0 #102636,0 18px 35px #142c3e26; }
.arcade-game--chain .game .overlay__card { background:#193a4ef5; border-color:#819ca566; }
.arcade-game--chain .game .overlay__card .btn,.arcade-game--chain .game #resolve { color:#142c3e; background:#f5d783; border-color:#f5d783; box-shadow:0 3px 0 #be956b; }
.arcade-game--chain .game #resolve:disabled{ box-shadow:none; }
@media(prefers-color-scheme:dark) {
 .arcade-game--chain { background:#122631; }
}
@media(max-width:680px) {.arcade-game--chain .game .overlay:is([data-state="won"],[data-state="gameover"]) { position:relative; inset:auto; padding:0; margin-top:12px; background:none; backdrop-filter:none; }.arcade-game--chain .game .overlay:is([data-state="won"],[data-state="gameover"]) .overlay__card { width:100%; max-width:none; max-height:none; padding:16px 18px; text-align:left; }
}

/* 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; }
}
