:root{color-scheme:dark;--bg:#0c1226;--surface:#17223b;--border:#354769;--text:#eef6ff;--muted:#b8c8e0;--cyan:#55e7ff;--yellow:#ffdb3f;--pink:#ee6da9}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;background:radial-gradient(ellipse at 45% -5%,#233d64 0,#0c1226 60%);color:var(--text);font-family:'Trebuchet MS',Verdana,sans-serif;min-height:100vh}
button,input{font:inherit}
button{cursor:pointer;border-radius:10px;padding:11px 14px;border:1px solid #51698a;background:#253553;color:white;font-weight:800;transition:background .14s,transform .12s}
button:hover{background:#365078}
button:active{transform:translateY(1px)}
button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid var(--cyan);outline-offset:2px}
.primary{border-color:#71f2ff;background:#08add0;color:#06192e;box-shadow:0 4px 0 #0b6284}
.primary:hover{background:#54e1f6}
.danger{background:#4b2438;border-color:#b66a85;color:#ffe1eb}
a{color:#70eaff;text-decoration:none}
.skip{position:absolute;left:10px;top:-100px;background:white;color:black;padding:10px;z-index:10}
.skip:focus{top:8px}
.site-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px max(22px,calc((100vw - 1180px)/2));border-bottom:1px solid #354769;background:#101a30}
.brand{display:flex;align-items:center;gap:11px;white-space:nowrap;color:white;letter-spacing:.08em;font-size:13px;font-weight:800}
.brand img{height:34px;width:34px;object-fit:contain}
.brand b{color:#7be8ff}
.header-chip{color:#f9da70;background:#292943;border:1px solid #5a527d;padding:8px 13px;border-radius:25px;font-size:11px;font-weight:800;letter-spacing:.08em}
.back{font-size:12px;font-weight:700}
main{max-width:1224px;margin:0 auto;padding:20px 22px 60px}
.title-row{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:17px 0 25px}
.eyebrow{font:800 11px 'Courier New',monospace;letter-spacing:.15em;color:#a3def9}
.title-row h1{font-size:clamp(36px,6vw,65px);letter-spacing:-.05em;margin:8px 0;line-height:1}
.title-row h1 span:first-child{color:var(--yellow);text-shadow:4px 5px 0 #9e5d17}
.title-row h1 .blink{color:var(--cyan)}
.title-row p{max-width:680px;line-height:1.7;color:var(--muted);margin:12px 0 0}
.title-player{padding:14px;background:linear-gradient(145deg,#284a73,#191e3d);border:2px solid #5775ad;box-shadow:8px 8px 0 #0a0f20;transform:rotate(-8deg)}
.title-player img{display:block;width:80px;height:80px;image-rendering:pixelated}
.game-shell,.card{background:var(--surface);border:1px solid var(--border);border-radius:18px;box-shadow:0 14px 35px #0006;overflow:hidden}
.game-top{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:15px 17px;background:#131e35;flex-wrap:wrap}
.tabs{display:flex;gap:6px;flex-wrap:wrap}
.tab{background:#1a2a46;border-color:transparent;font-size:12px}
.tab.active{color:#06192e;background:var(--yellow);border-color:#ffe983}
.game-actions{display:flex;gap:8px}
.game-actions button{font-size:11px}
.hud{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:0;background:#162844}
.hud-item{display:flex;align-items:center;justify-content:center;gap:9px;padding:10px 7px;border-right:1px solid #354769}
.hud-item:last-child{border-right:0}
.hud-item small{font:800 10px 'Courier New',monospace;color:#a8d3e9}
.hud-item b{font-size:16px;color:#ffe17d}
.progress-track{height:13px;background:#09192c;position:relative;overflow:hidden}
#progress-fill{height:100%;width:0;background:linear-gradient(90deg,#2de5fa,#e8f578);transition:width .14s}
#progress-text{position:absolute;top:-1px;right:9px;color:white;font:800 11px 'Courier New',monospace;text-shadow:1px 1px 2px black}
.stage-shell{position:relative;overflow:hidden;background:#0b1329}
#stage{display:block;width:100%;height:auto;touch-action:none;image-rendering:pixelated;cursor:pointer;user-select:none}
.stage-shell:focus-within{outline:2px solid #5fdbfa;outline-offset:-2px}
.overlay{position:absolute;inset:0;display:none;align-items:center;justify-content:center;flex-direction:column;text-align:center;background:#071324c7;backdrop-filter:blur(3px);padding:20px}
.overlay.visible{display:flex}
.overlay h2{font-size:clamp(27px,5vw,48px);margin:0 0 12px;letter-spacing:.05em;color:var(--yellow);text-shadow:4px 4px #653d2f}
.overlay p{max-width:480px;color:#e0f2ff;line-height:1.55;margin:0 0 23px}
.overlay button{font-size:18px;padding:15px 30px}
.stage-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 19px;color:#b6d3e9;min-height:62px;font-size:13px}
.jump-btn{min-width:110px;color:#101b32;background:#ffdd49;border-color:#ffed93;touch-action:none}
.jump-btn:hover{background:#ffe875}
.card{padding:24px;margin-top:26px;overflow:visible}
.section-title{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;flex-wrap:wrap}
.section-title h2,.help h2{margin:4px 0 10px;font-size:25px}
.section-title p{line-height:1.6;color:var(--muted);max-width:720px;margin:0}
.save-badge{font-size:12px;color:#9ee8be;border:1px solid #3f8873;border-radius:20px;padding:8px 12px;white-space:nowrap}
.palette{display:grid;grid-template-columns:repeat(auto-fit,minmax(85px,1fr));gap:9px;margin-top:22px}
.tool{background:#1b2a45;border:2px solid #40577c;border-radius:12px;min-height:103px;padding:11px 6px;display:flex;flex-direction:column;gap:8px;align-items:center;justify-content:center;font:800 11px 'Courier New',monospace;letter-spacing:.03em}
.tool img{width:46px;height:46px;object-fit:contain;image-rendering:pixelated}
.tool.active{background:#3b315e;border-color:var(--pink);box-shadow:0 0 0 2px #ee6da94d inset}
.tool:hover{border-color:#9edaff}
.spawn-icon,.erase-icon{display:grid;place-items:center;width:46px;height:46px;background:#23bda6;color:#0c1226;border:3px solid #a0fff5;font:bold 30px 'Courier New',monospace}
.erase-icon{background:#f27a90;border-color:#ffd0dd}
.editor-scroll{display:flex;gap:14px;align-items:center;margin:24px 0 12px}
.editor-scroll label,.editor-scroll output{font-size:12px;color:#bbd4ea;white-space:nowrap}
.editor-scroll input{flex:1;min-width:50px;accent-color:#e475af}
.editor-actions{display:flex;gap:10px;flex-wrap:wrap}
.editor-actions button{font-size:12px}
.editor-note{font-size:12px;line-height:1.6;color:#a9c4da;margin:18px 0 0}
.help-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.help-grid>div{background:#202e49;border:1px solid #34476d;border-radius:10px;padding:15px;min-height:90px;display:flex;flex-direction:column;gap:8px}
.help-grid b{color:#f4e187;font:800 13px 'Courier New',monospace}
.help-grid span{color:#c1d0e6;font-size:12px;line-height:1.55}
.help p{color:#a9c4da;line-height:1.6;font-size:12px;margin:19px 0 0}
footer{text-align:center;padding:20px;color:#849fb9;font:11px 'Courier New',monospace;letter-spacing:.1em}
@media(max-width:800px){.header-chip{display:none}.title-player img{width:53px;height:53px}.hud-item{flex-direction:column;gap:1px}.hud-item b{font-size:13px}.help-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.site-header{padding:12px 14px}.brand{font-size:10px}.brand img{width:27px;height:27px}.back{font-size:10px}main{padding:14px 10px 45px}.title-row{padding:12px 5px 22px}.title-row p{font-size:12px}.title-player{padding:7px}.title-player img{width:42px;height:42px}.game-top{padding:9px;gap:7px}.tab,.game-actions button{font-size:10px;padding:9px 8px}.hud-item small{font-size:8px}.hud-item b{font-size:12px}.hud-item{padding:8px 2px}.stage-bottom{padding:10px;font-size:11px}.card{padding:16px}.palette{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}.tool{min-height:78px;font-size:9px;padding:6px 2px}.tool img{width:34px;height:34px}.editor-scroll{gap:8px;flex-wrap:wrap}.editor-scroll label{width:100%}.help-grid{grid-template-columns:1fr}.editor-actions button{flex:1;min-width:120px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important;animation:none!important}}
