/* The title owns these rules; gameplay and other menus retain their layouts. */
#root #stage[data-mode=title] .title-identity{display:flex;flex-direction:column;align-items:center;gap:16px;padding-block:16px 10px;width:100%}
#root #stage[data-mode=title] .title-screen .logo{margin:0;gap:9px;isolation:isolate}
#root #stage[data-mode=title] .title-screen .logo strong{font-size:50px}
#root #stage[data-mode=title] .title-screen .logo small{font-size:16px}
#root #stage[data-mode=title] .title-screen .logo em{font-size:24px}
#root #stage[data-mode=title] .title-screen .title-play-actions{grid-template-columns:1fr 1fr}
#sandbox-help{position:fixed;z-index:10001;width:min(320px,calc(100vw - 24px));max-height:calc(100svh - 24px);overflow:auto;padding:12px 14px;background:#152b3cf7;color:#e4fff3;border:2px solid #84d9c5;box-shadow:4px 4px #050d1e;font:20px/1.15 VT323,monospace;text-align:left;touch-action:pan-y}
#sandbox-help[hidden]{display:none}
#root #stage[data-mode=title] .sandbox-option :is(#sandbox-hint,#sandbox-scope){position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);margin:0;padding:0;white-space:nowrap}


/* Preserve the integrated horizontal mobile layout. */
@media(min-width:1001px) and (min-height:601px){
 #root #stage[data-mode=title] .title-identity{padding-top:10px}
}

/* A medal sits beside the gamepad; free play communicates its state in words too. */
#root #stage[data-mode=title] #overlay .title-tools .menu-achievements{background:#4b381c;border-color:#f2ce77;color:#fff1b5;flex:0 0 44px}
#root #stage[data-mode=title] #overlay .title-tools .sandbox-option{border:2px solid #e4c87d;background:#273744;box-shadow:0 3px #091321;padding:0 8px}
#root #stage[data-mode=title] #overlay .title-tools .sandbox-enabled{background:#174738;border-color:#9af0bc;box-shadow:0 3px #091321,inset 0 0 0 1px #9af0bc55}
#root #stage[data-mode=title] #overlay .title-tools .sandbox-toggle{display:flex;gap:7px;min-height:44px}
#root #stage[data-mode=title] #overlay .title-tools .sandbox-toggle strong{color:#fff1bb;font:17px/1 VT323,monospace}
#root #stage[data-mode=title] #overlay .title-tools .sandbox-state{position:static;width:auto;height:auto;clip-path:none;overflow:visible;margin:0;padding:3px 5px;background:#0c1c2b;color:#e9e4cb;font:14px/1 VT323,monospace}
#root #stage[data-mode=title] #overlay .title-tools .sandbox-enabled .sandbox-state{background:#9af0bc;color:#10281d}
#root #stage[data-mode=title] #overlay .title-tools :is(.menu-controls,.sandbox-toggle):focus-visible{outline:3px solid #fff1ae;outline-offset:3px}

#stage .achievements-panel{width:min(860px,calc(100vw - 24px));max-height:calc(100svh - 24px);padding:0;color:#eaf3ee;background:#14243a;border:3px solid #f1cc70;box-shadow:5px 5px #061120;overflow:hidden}
#stage .achievements-panel::backdrop{background:#070d1bd9}
#stage .achievements-panel[open]{display:flex;flex-direction:column}
#stage .achievements-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 16px;background:#1c3047;border-bottom:2px solid #647a84;flex-shrink:0}
#stage .achievements-header h2{display:flex;align-items:center;gap:10px;margin:0;color:#ffe598;font:14px/1.5 'Brasil Arcade',monospace}
#stage .achievements-header h2 svg{width:32px;height:32px;flex-shrink:0}
#stage .achievements-header p{margin:3px 0 0;font:19px/1.1 VT323,monospace;color:#b8cbd8}
#stage .achievements-header button{min-height:44px;padding:8px 14px;font:9px/1.4 'Brasil Arcade',monospace;border:2px solid #f1cc70;background:#3a3829;color:#fff0b5}
#stage .achievements-body{overflow:auto;overscroll-behavior:contain;padding:12px 16px 16px;touch-action:pan-y}
#stage .achievements-body h3{margin:15px 0 9px;font:10px/1.4 'Brasil Arcade',monospace;color:#b5e4d8}
#stage .achievements-total{margin:0;font:23px/1.1 VT323,monospace;color:#ffe598}
#stage .achievements-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
#stage .achievement-card{display:flex;gap:10px;padding:10px;border:2px solid #546b7a;background:#102035;text-align:left}
#stage .achievement-card.earned{border-color:#e3c46d;background:#293b35}
#stage .achievement-mark{display:grid;place-items:center;width:34px;height:40px;flex-shrink:0;color:#8295ad;font:32px VT323,monospace}
#stage .achievement-mark svg{width:32px;height:32px}
#stage .achievement-card>div{min-width:0;flex:1}
#stage .achievement-card small{font:15px VT323,monospace;color:#b5c9db}
#stage .achievement-card h4{margin:3px 0;font:9px/1.5 'Brasil Arcade',monospace;color:#eef2e1}
#stage .achievement-card p{margin:4px 0;font:18px/1.1 VT323,monospace;color:#b8cbd8}
#stage .achievement-card progress{display:block;appearance:none;width:100%;height:8px;margin:7px 0 4px;border:1px solid #718b97;background:#0a1528;accent-color:#e9c56e}
#stage .achievement-card progress::-webkit-progress-bar{background:#0a1528}
#stage .achievement-card progress::-webkit-progress-value{background:#e9c56e}
#stage .achievement-card strong{font:16px VT323,monospace;color:#ffe598}
#stage .achievement-collection{display:grid;grid-template-columns:1fr 1fr;gap:10px}
#stage .achievement-collection section{padding:10px;border:2px solid #546b7a;background:#102035}
#stage .achievement-collection h4{margin:0;font:20px/1.1 VT323,monospace;color:#eaf0df}
#stage .achievement-collection h4 span{float:right;color:#ffe598}
#stage .achievement-collection :is(ul,p){margin:7px 0 0;font:17px/1.2 VT323,monospace;color:#b8cbd8}
#stage .achievement-collection ul{padding-left:18px}
#stage .achievements-panel button:focus-visible{outline:3px solid #fff3b9;outline-offset:3px}
@media(max-height:500px){#stage .achievements-header{padding:7px 12px}#stage .achievements-header h2{font-size:11px}#stage .achievements-header p{font-size:17px}#stage .achievements-body{padding:8px 12px 12px}#stage .achievement-card{padding:7px;gap:6px}}
@media(max-width:560px){#stage .achievements-grid,#stage .achievement-collection{grid-template-columns:1fr}}
