:root{--bg: #101418;--panel: #1b2229;--line: #2d3742;--text: #e8edf2;--muted: #9aa7b4;--accent: #3fa36b;color-scheme:dark}*{box-sizing:border-box}html,body{margin:0;height:100%;background:var(--bg);color:var(--text);font:15px/1.4 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;overflow:hidden;overscroll-behavior:none;-webkit-text-size-adjust:100%}#app{position:fixed;inset:0;display:flex;flex-direction:column;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}#stage{position:relative;flex:1;min-height:0;overflow:hidden;background:#000;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}#screen{position:absolute;left:0;top:0;transform-origin:0 0;image-rendering:pixelated;image-rendering:crisp-edges}#screen.smooth{image-rendering:auto}#cursor{position:absolute;left:-11px;top:-11px;width:22px;height:22px;border:2px solid #fff;border-radius:50%;box-shadow:0 0 0 2px #000;pointer-events:none}#cursor:after{content:"";position:absolute;left:8px;top:8px;width:2px;height:2px;background:#fff}#bar{display:flex;flex-wrap:wrap;gap:6px 14px;padding:6px;background:var(--panel);border-top:1px solid var(--line);overflow:auto;touch-action:manipulation;user-select:none;-webkit-user-select:none}#bar .group{display:flex;flex-wrap:wrap;gap:6px}button,select{font:inherit;color:var(--text);background:#26303a;border:1px solid var(--line);border-radius:8px;min-height:40px;min-width:44px;padding:0 10px;touch-action:manipulation;-webkit-tap-highlight-color:transparent}#bar button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:44px;min-height:44px}#bar .label{display:block;white-space:nowrap}#bar .icon{flex:none;width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}button:active,button[aria-pressed=true]{background:var(--accent);border-color:var(--accent)}#typing{position:fixed;left:0;bottom:0;width:1px;height:1px;opacity:0;border:0;padding:0;font-size:16px}#rotate{display:none}@media(orientation:portrait)and (pointer:coarse){#stage{flex:0 1 auto;width:100%;aspect-ratio:4 / 3}#bar{flex-direction:column;flex-wrap:nowrap;gap:6px;overflow:visible}#bar button{flex:1 1 0;flex-direction:column;gap:2px;min-height:52px;padding:2px;font-size:12px}#bar .key{font-size:15px}#rotate{display:block;flex:1 0 auto;padding:10px;text-align:center;color:var(--muted);font-size:13px}}@media(orientation:landscape)and (pointer:coarse){#app{container:app / size;flex-direction:row}#stage{flex:0 0 auto;height:100%;max-width:calc(100% - 141px);aspect-ratio:4 / 3}#bar{flex:1 1 0;min-width:141px;flex-wrap:nowrap;justify-content:center;align-items:center;gap:4px;padding:4px;border-top:0;border-left:1px solid var(--line);overflow:auto}#bar .group{display:grid;grid-template-columns:64px;grid-auto-rows:44px;gap:3px}#bar button{flex-direction:column;gap:1px;padding:0 2px;font-size:11px}#bar .icon{width:18px;height:18px}#bar .key{font-size:14px}@container app (max-height: 599px){#bar{display:grid;grid-auto-flow:column;grid-auto-columns:max-content;justify-content:center;align-content:center;align-content:safe center;align-items:start}}@container app (max-height: 333px){#stage{max-width:calc(100% - 243px)}#bar{min-width:243px}#bar .group{grid-template-columns:repeat(2,56px)}}@container app (min-height: 600px){#stage{max-width:calc(100% - 73px)}#bar{min-width:73px;flex-direction:column}#bar .group{grid-auto-rows:52px}}}#loading,#fatal{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:16px;background:var(--bg);text-align:center}#loading[hidden],#fatal[hidden]{display:none}#loading h1,#fatal h1{margin:0;font-size:22px}progress{width:min(320px,80vw);height:10px;accent-color:var(--accent)}#status,#fatal-text{color:var(--muted);margin:0;max-width:480px}dialog{width:min(520px,calc(100vw - 32px));max-height:calc(100vh - 32px);overflow-y:auto;color:var(--text);background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:16px}dialog::backdrop{background:#0009}.menu-head,.row{display:flex;align-items:center;justify-content:space-between;gap:8px}.menu-head h2{margin:0;font-size:18px}.hint{color:var(--muted);font-size:13px;margin:8px 0}#beginsaves h3{margin:12px 0 0;font-size:15px}#slots,#beginsaves ul{list-style:none;margin:8px 0;padding:0}#slots li,#beginsaves li{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 0;border-bottom:1px solid var(--line)}#slots li button,#beginsaves li button{flex:none}#beginsaves li button{min-height:44px}.slot-time{margin-left:auto;color:var(--muted);font-size:12px}.slot-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#beginsaves .slot-name{overflow:visible;white-space:normal;overflow-wrap:break-word}.import{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:12px}.import[hidden],.import input[type=file]{display:none}.hint.first{color:var(--text)}#menu-message,#newgame-message{min-height:1.4em;font-size:14px}.options{margin-top:8px;color:var(--muted)}body[data-state=running] #loading{display:none}#busy{position:absolute;left:50%;bottom:12px;transform:translate(-50%);padding:6px 14px;border-radius:999px;background:#101418d1;border:1px solid var(--line);color:var(--text);font-size:14px;pointer-events:none;white-space:nowrap}#busy[hidden]{display:none}#btn-bar{position:absolute;z-index:5;top:calc(env(safe-area-inset-top) + 8px);right:calc(env(safe-area-inset-right) + 8px);display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;opacity:.6;background:#1b22298c}#btn-bar[hidden]{display:none}#btn-bar[aria-expanded=true]{opacity:.95}#btn-bar .icon{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}#tip{position:absolute;z-index:6;top:calc(env(safe-area-inset-top) + 8px);left:50%;transform:translate(-50%);max-width:calc(100% - 140px);padding:6px 14px;border-radius:12px;background:#101418e6;border:1px solid var(--line);color:var(--text);font-size:14px;text-align:center;pointer-events:none}#tip[hidden]{display:none}#app[data-full]{container:app / size;flex-direction:row;align-items:center;justify-content:center}#app[data-full] #stage{flex:none;width:min(100cqw,calc(100cqh * 4 / 3));height:auto;max-width:none;aspect-ratio:4 / 3}#app[data-full] #rotate,#app[data-full] #bar{display:none}#app[data-full][data-bar=open] #bar{position:absolute;z-index:4;top:calc(env(safe-area-inset-top) + 58px);right:calc(env(safe-area-inset-right) + 8px);max-height:calc(100cqh - 66px);min-width:0;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:flex-start;align-items:flex-start;gap:6px;padding:6px;border:1px solid var(--line);border-radius:10px;background:#1b2229f0;overflow:auto}#app[data-full] #bar .group{display:grid;grid-template-columns:repeat(2,64px);grid-auto-rows:44px;gap:3px}#app[data-full] #bar button{flex:none;flex-direction:column;gap:1px;min-height:44px;padding:0 2px;font-size:11px}#app[data-full] #bar .icon{width:18px;height:18px}#app[data-full] #bar .key{font-size:14px}
