:root{color-scheme:dark}*{box-sizing:border-box}html,body,#root{margin:0;height:100%}body{background:#0c0c12;color:#e6e6f0;font-family:system-ui,sans-serif;display:flex;align-items:center;justify-content:center}.app{display:flex;flex-direction:column;align-items:center;gap:12px;padding:16px}.stage{display:flex;align-items:stretch;justify-content:center;gap:16px;max-width:100%}.stage-side{display:flex;flex-direction:column;align-items:stretch;gap:16px;width:202px;flex:none}.game-canvas{align-self:flex-start;width:min(90vw - 220px,1024px);image-rendering:pixelated;height:auto;background:#181820;border-radius:4px;box-shadow:0 8px 40px #0009}.floor-map{display:flex;flex-direction:column;align-items:center;gap:6px}.floor-map>canvas{width:202px;height:202px;image-rendering:pixelated;background:#181820;border-radius:4px}.floor-map-label{font-size:.7rem;letter-spacing:.15em;opacity:.55}.hint{font-size:.85rem;opacity:.6}.rewind{display:flex;align-items:center;justify-content:space-between;gap:8px;-webkit-user-select:none;user-select:none;container-type:inline-size}.rewind-clock{display:flex;flex:none;align-items:baseline;justify-content:flex-start;gap:6px}.rewind-clock-label{font-size:.7rem;letter-spacing:.15em;opacity:.55}@container (max-width: 200px){.rewind-clock-label{display:none}}.rewind-clock-value{font-size:1.05rem;font-variant-numeric:tabular-nums}.rewind-buttons{display:flex;gap:6px}.rewind-open{position:relative;flex:none;width:36px;min-height:32px;padding:0;display:flex;align-items:center;justify-content:center;border:1px solid #2a2a3c;border-radius:8px;cursor:pointer}.rewind-save{order:1}.rewind-load{order:2}.rewind-rewind{order:3}.rewind-open-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.rewind-open-icon{width:15px;height:15px}.rewind-open:disabled{opacity:.4;cursor:default}.rewind-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#06060cbf;display:flex;align-items:center;justify-content:center;z-index:10}.rewind-dialog{width:480px;max-width:calc(100vw - 32px);padding:20px 24px;border:1px solid #2a2a3c;border-radius:8px;background:#14141e;box-shadow:0 12px 48px #000000b3}.rewind-dialog h2{margin:0 0 8px;font-size:1.1rem;color:#ff897d}.rewind-dialog-lead{margin:0 0 16px;font-size:.85rem;opacity:.8;line-height:1.45}.rewind-presets{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.rewind-preset{display:flex;flex-direction:column;align-items:center;gap:3px;padding:8px 4px;border:1px solid #2a2a3c;border-radius:6px;background:#1c1c2a;color:#e6e6f0;cursor:pointer}.rewind-preset:hover:not(:disabled){background:#26263a}.rewind-preset.active{border-color:#5a5af0;background:#23234a}.rewind-preset:disabled{opacity:.35;cursor:default}.rewind-preset-label{font-size:.78rem;text-align:center;line-height:1.2}.rewind-preset-time{font-size:.72rem;opacity:.6;font-variant-numeric:tabular-nums}.rewind-picker{display:flex;align-items:center;gap:10px;margin-top:16px;font-size:.8rem;opacity:.85}.rewind-picker select{flex:1;min-width:0;padding:6px 8px;border:1px solid #2a2a3c;border-radius:6px;background:#1c1c2a;color:#e6e6f0;font-size:.8rem}.rewind-input{width:100%;padding:8px 10px;border:1px solid #2a2a3c;border-radius:6px;background:#1c1c2a;color:#e6e6f0;font:inherit;font-size:.9rem}.rewind-input:focus{outline:none;border-color:#5a5af0}.rewind-input+.rewind-dialog-buttons{margin-top:18px}.rewind-summary{margin:12px 0 18px;font-size:.8rem;opacity:.7;line-height:1.45}.rewind-dialog-buttons{display:flex;justify-content:flex-end;gap:10px}.rewind-delete{margin-right:auto}.rewind-delete:disabled{opacity:.35;cursor:default}.rewind-delete.armed{background:#6d1f28;color:#ffd9dc}.rewind-delete.armed:hover{background:#85252f}.rewind-dialog-buttons button{padding:8px 18px;font-size:.9rem;border:none;border-radius:6px;cursor:pointer}.btn-primary{background:#5a5af0;color:#fff}.btn-primary:hover{background:#6e6efc}.btn-secondary{background:#24243a;color:#e6e6f0}.btn-secondary:hover{background:#30304c}.hint-log{flex:1 1 0;min-width:0;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:5px;padding:2px 0 0;touch-action:pan-y;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scrollbar-width:thin;scrollbar-color:#303048 transparent}.hint-log.scrolled{mask-image:linear-gradient(to bottom,transparent 0,#000 14px);-webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 14px)}.hint-log::-webkit-scrollbar{width:6px}.hint-log::-webkit-scrollbar-thumb{background:#303048;border-radius:3px}.hint-bubble{align-self:stretch;max-width:100%;padding:6px 10px 7px;border-radius:13px 13px 13px 4px;background:#23233a;font-size:.72rem;line-height:1.35}.hint-bubble.latest{background:#2b2b52;box-shadow:inset 0 0 0 1px #43438a}.controls-help{flex:none;padding-top:10px;border-top:1px solid #23233a;-webkit-user-select:none;user-select:none}.ch-title{margin:0 0 8px;font-size:.7rem;font-weight:400;letter-spacing:.15em;opacity:.55}.ch-key{display:inline-flex;align-items:center;justify-content:center;min-width:16px;height:16px;padding:0 3px;border:1px solid #3a3a4a;border-bottom-color:#2a2a36;border-bottom-width:2px;border-radius:3px;background:linear-gradient(#26262f,#1b1b23);color:#b9b9c8;font-family:inherit;font-size:8px;line-height:1}.ch-cross{flex:none;display:grid;grid-template-columns:repeat(3,16px);gap:2px}.ch-cross .ch-key-up{grid-area:1 / 2}.ch-cross .ch-key:not(.ch-key-up){grid-row:2}.ch-move{display:flex;align-items:center;gap:10px}.ch-move-text{display:flex;flex-direction:column;gap:2px;min-width:0}.ch-move-text b{font-size:.6rem;font-weight:500;letter-spacing:.12em;opacity:.85}.ch-move-text span{font-size:.6rem;line-height:1.25;opacity:.5}.ch-note{margin:8px 0 0;font-size:.6rem;line-height:1.3;opacity:.5}.ch-note b{font-weight:600;opacity:.9}.ch-hold{display:flex;align-items:center;gap:5px;margin:10px 0 6px;font-size:.6rem;letter-spacing:.12em;opacity:.5}.ch-key-space{padding:0 6px;letter-spacing:.08em;opacity:1}.ch-combos{display:flex;flex-direction:column;gap:5px;padding-left:10px}.ch-row{display:flex;align-items:center;gap:8px}.ch-keys{flex:none;display:flex;gap:3px;width:35px}.ch-row b{font-size:.6rem;font-weight:500;letter-spacing:.1em;opacity:.85}.ch-row-use .ch-key{color:#ffb0a6;border-color:#6c2733;border-bottom-color:#4d1c25}.ch-row-take .ch-key{color:#8fb8ff;border-color:#2b3f77;border-bottom-color:#1f2d55}.about-port{display:flex;flex-direction:column;flex:none;width:202px;-webkit-user-select:none;user-select:none}.about-port-title{margin:auto 0 8px;padding-top:10px;border-top:1px solid #23233a;font-size:.7rem;font-weight:400;letter-spacing:.15em;opacity:.55}.about-port p{margin:0 0 8px;font-size:.66rem;line-height:1.5;opacity:.55}.about-port p:last-child{margin-bottom:0}.about-port b{font-weight:600;opacity:.9}.map-peek{position:fixed;top:0;right:0;bottom:0;left:0;z-index:20;background:#06060cbd;opacity:0;transition:opacity .16s ease;touch-action:none}.map-peek.open{opacity:1}.map-peek canvas{position:absolute;image-rendering:pixelated;border-radius:4px;border:1px solid #33334a;background:#181820;transition:width .19s ease,height .19s ease}.map-peek-caption{position:absolute;padding:4px 9px;border-radius:8px;background:#0c0c14d9;font-size:.58rem;letter-spacing:.14em;opacity:.8;white-space:nowrap}.keypad{position:relative;flex:0 1 auto;display:flex;gap:12px;align-items:stretch;justify-content:space-between;padding:6px 14px calc(18px + env(safe-area-inset-bottom));min-height:auto;overflow:hidden;touch-action:none}.stick-zone{flex:none;min-height:auto;display:flex;align-items:center;justify-content:center}.stick-ring{position:relative;height:196px;max-height:100%;width:auto;aspect-ratio:1;flex-shrink:1;min-height:150px;border-radius:50%;border:1px solid #2e2e44;background:radial-gradient(circle at 50% 50%,#202034,#14141e 78%);touch-action:none}.stick-tick{position:absolute;font-size:.72rem;line-height:1;color:#8076f1;opacity:.55;transform:translate(-50%,-50%)}.stick-tick-n{left:50%;top:9%}.stick-tick-ne{left:79.5%;top:20.5%}.stick-tick-e{left:91%;top:50%}.stick-tick-se{left:79.5%;top:79.5%}.stick-tick-s{left:50%;top:91%}.stick-tick-sw{left:20.5%;top:79.5%}.stick-tick-w{left:9%;top:50%}.stick-tick-nw{left:20.5%;top:20.5%}.stick-tick.on{opacity:1;transform:translate(-50%,-50%) scale(1.45);color:#fff}.stick-dead{position:absolute;left:50%;top:50%;width:27.5%;height:27.5%;transform:translate(-50%,-50%);border-radius:50%;border:1px dashed #2e2e44}.stick-knob{position:absolute;left:50%;top:50%;width:39%;height:39%;border-radius:50%;border:1px solid #4a4a78;background:linear-gradient(#2e2e48,#1e1e2e);box-shadow:0 3px #101018;transform:translate(-50%,-50%);transition:transform 90ms ease-out}.stick-knob.live{transition:none;border-color:#6a6ab0}.keypad-keys{flex:1;min-width:0;--legend-block: 56px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px}.keypad-cluster{position:relative;--cluster-w: 100;--cluster-h: 95;--cluster-max: 176px;width:min(100%,var(--cluster-max));min-width:128px;aspect-ratio:var(--cluster-w) / var(--cluster-h);flex:none}.pad-key{position:absolute;display:flex;align-items:center;justify-content:center;padding:0;border-radius:50%;border:1px solid #2a2a3c;background:linear-gradient(#22222f,#1a1a26);color:#e6e6f0;font-family:inherit;box-shadow:0 3px #101018;touch-action:none}.pad-key svg{width:46%;height:46%;display:block}.key-face{font-size:1.5rem;font-weight:600;letter-spacing:.02em;line-height:1;transform:translateY(-4%)}.pad-key:active,.pad-key.pressed{box-shadow:none;transform:translateY(3px);filter:brightness(1.35)}.pad-key-use{color:#ffb0a6;border-color:#97323f;background:radial-gradient(circle at 50% 30%,#7d2532,#3c1219)}.pad-key-take{color:#8fb8ff;border-color:#33529f;background:radial-gradient(circle at 50% 30%,#22409c,#131f42)}.pad-key-prev,.pad-key-next{color:#b9b9c8;border-color:#3a3a4a;background:radial-gradient(circle at 50% 32%,#26262f,#191921)}.pad-key-use{width:44%;aspect-ratio:1;right:0;bottom:10.5%}.pad-key-take{width:44%;aspect-ratio:1;left:0;bottom:0}.pad-key-next{width:31%;aspect-ratio:1;right:2%;top:0}.pad-key-prev{width:31%;aspect-ratio:1;right:40%;top:10.5%}.keypad-legend{align-self:center;width:100%;max-width:176px;padding-left:2px;display:flex;flex-direction:column;gap:3px}.legend-row{display:flex;align-items:center;gap:6px;font-size:.53rem;letter-spacing:.1em;opacity:.5;transition:opacity .12s ease}.legend-chip{flex:none;width:13px;height:13px;border-radius:50%;display:flex;align-items:center;justify-content:center;border:1px solid currentColor}.legend-chip svg{width:7px;height:7px;display:block}.legend-chip .key-face{font-size:7px}.legend-use{color:#ffb0a6}.legend-take{color:#8fb8ff}.legend-item{color:#b9b9c8}.legend-item .legend-chip{width:17px;border-radius:20px}.legend-item .legend-chip svg{width:12px}.legend-row b{font-weight:500;color:#e6e6f0;opacity:.85}.legend-row.lit,.legend-row.lit b{opacity:1}.keypad-classic-right{flex-direction:row-reverse}.keypad-cluster-fire{--cluster-w: 100;--cluster-h: 100;--cluster-max: 148px}.keypad-classic .keypad-keys{--legend-block: 68px}.pad-key-fire{left:0;top:0;width:100%;aspect-ratio:1;color:#ffdcb4;border-color:#c2701a;background:radial-gradient(circle at 50% 30%,#d2761b,#66330a);box-shadow:0 4px #101018}.pad-key-fire:active,.pad-key-fire.pressed{transform:translateY(4px)}.pad-key-fire .key-face{font-size:1.3rem;letter-spacing:.1em}.keypad-legend-classic{gap:4px}.legend-hold{font-size:.5rem;letter-spacing:.14em;opacity:.42}.keypad-legend-classic .legend-row{padding-left:4px}.keypad-legend-classic .legend-use .legend-chip svg,.keypad-legend-classic .legend-take .legend-chip svg{width:9px;height:9px}@supports (width: 1cqh){.keypad-keys{container-type:size}.keypad-cluster{width:min(100%,var(--cluster-max),calc((100cqh - var(--legend-block)) * var(--cluster-w) / var(--cluster-h)));container-type:inline-size}.pad-key .key-face{font-size:15.5cqi}.pad-key-fire .key-face{font-size:11.5cqi}}.key{flex:0 1 auto;min-height:44px;height:58px;border:1px solid #2a2a3c;border-radius:12px;background:linear-gradient(#22222f,#1a1a26);color:#e6e6f0;font-family:inherit;font-size:.95rem;letter-spacing:.08em;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;box-shadow:0 2px #101018;touch-action:none}.key small{font-size:.6rem;letter-spacing:.12em;opacity:.5}.key:active,.key.pressed{box-shadow:none;transform:translateY(2px);filter:brightness(1.25)}.keypad-wide .key{flex:1;min-height:64px;font-size:1.15rem}.key-start{color:#65dbef}.control-picker{flex:none;padding:14px 14px 0;display:flex;flex-direction:column;align-items:center;gap:8px}.cp-title{margin:0;font-size:.55rem;font-weight:500;letter-spacing:.18em;opacity:.45}.cp-options{display:flex;gap:8px;width:100%;max-width:340px}.cp-option{flex:1;min-width:0;min-height:56px;padding:7px 4px 6px;display:flex;flex-direction:column;align-items:center;gap:3px;border:1px solid #2a2a3c;border-radius:10px;background:#1a1a26;color:#e6e6f0;font-family:inherit;cursor:pointer}.cp-option.active{border-color:#4a4a78;background:#262640;color:#65dbef}.cp-option b{font-size:.6rem;font-weight:600;letter-spacing:.1em}.cp-option small{font-size:.5rem;letter-spacing:.06em;opacity:.5;color:#e6e6f0}.cp-glyph{width:100%;max-width:46px;height:auto;display:block}.cp-stick{fill:#14141e;stroke:#4a4a78;stroke-width:1}.cp-knob{fill:#2e2e48;stroke:#4a4a78;stroke-width:.8}.cp-fire{fill:#c46c18}.cp-a{fill:#7d2532}.cp-b{fill:#22409c}.cp-item{fill:#3a3a4a}.text-entry{flex-direction:column;align-items:stretch;justify-content:center;gap:8px}.text-entry-caption{font-size:.85rem;text-align:center;color:#ded087}.text-entry-hint{font-size:.62rem;letter-spacing:.06em;text-align:center;opacity:.45}.text-entry-field{position:absolute;left:0;bottom:0;width:1px;height:1px;opacity:0;border:0;padding:0;pointer-events:none}.text-entry .key-cancel{min-height:40px;height:40px;font-size:.8rem;color:#ccc}@media (max-width: 900px){html,body{position:fixed;top:0;right:0;bottom:0;left:0;overflow:hidden;overscroll-behavior:none;touch-action:none;-webkit-touch-callout:none;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}body{display:block}.app{height:100%;padding:0;gap:0;align-items:stretch;justify-content:flex-start}.stage,.stage-main{display:contents}.game-canvas{flex:0 .25 auto;align-self:stretch;width:100%;min-height:0;max-height:100%;object-fit:contain;border-radius:0;box-shadow:none;touch-action:none}.game-canvas:focus{outline:none}.hint{display:none}.about-port{flex:none;width:auto;margin-top:auto;min-height:0;overflow:hidden;padding:0 20px calc(14px + env(safe-area-inset-bottom));text-align:center}.about-port-title{margin:0 0 6px;padding-top:0;border-top:none}.about-port p{max-width:30em;margin-inline:auto;font-size:.7rem}.stage-side{flex:1 1 0;width:auto;min-height:150px;overflow:hidden;padding:12px 14px;gap:12px;display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);align-items:stretch}.stage-side .floor-map{grid-row:1 / 3;grid-column:1;min-height:0;justify-content:center}.stage-side .rewind{grid-row:1;grid-column:2}.stage-side .hint-log{grid-row:2;grid-column:2}.hint-log{scrollbar-width:none}.hint-bubble{align-self:flex-start;max-width:94%;padding:5px 9px 6px}.hint-log::-webkit-scrollbar{width:0}.floor-map>canvas{width:auto;height:auto;max-width:176px;max-height:100%;min-height:0;touch-action:none}.floor-map-label{display:none}.rewind-clock{gap:5px}.rewind-clock-label{font-size:.55rem}.rewind-clock-value{font-size:.95rem}.rewind-open{width:34px;min-height:30px}.rewind-backdrop{bottom:auto;height:var(--visible-height, 100%);align-items:flex-start;padding:10px 12px}.rewind-dialog{max-height:100%;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;padding:14px 16px}.rewind-input{font-size:16px}}@media (max-width: 900px) and (max-height: 640px){.stage-side{min-height:140px}.stick-ring{min-height:118px}.keypad-cluster{max-width:140px}.legend-row{font-size:.5rem}}@media (max-width: 900px) and (max-height: 520px){.rewind-dialog-lead,.about-port,.cp-title{display:none}.cp-option{min-height:44px;padding:4px 4px 3px}.cp-glyph{max-width:38px}.rewind-dialog{padding:12px 14px}.rewind-dialog h2{margin-bottom:12px}.rewind-input+.rewind-dialog-buttons,.rewind-summary{margin-top:12px}.rewind-summary{margin-bottom:12px}}@media (max-width: 900px) and (max-height: 600px){.keypad-legend{display:none}.keypad-keys,.keypad-classic .keypad-keys{--legend-block: 0px}}
