/* Compact circles; labels live outside the button so controls retain their shape. */
button,input,select,textarea{font:inherit}button{min-height:0}button[hidden]{display:none!important}button:focus-visible,a:focus-visible,summary:focus-visible{outline:2px solid #fff3c5;outline-offset:3px}button:disabled{cursor:default;opacity:.4}input,select,textarea{font-size:16px}
.game-shell{height:100svh;height:100dvh;min-height:0;max-height:none;max-width:1280px}
.mobile-header{display:grid;grid-template-columns:38px minmax(0,1fr) 38px;gap:12px;align-items:center;padding:max(8px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) 8px max(16px,env(safe-area-inset-left));border-bottom:1px solid #49415e;background:#111428}
.mobile-header .hud-button{width:38px;height:38px;min-height:0;display:grid;place-items:center;padding:0;background:#25243c;border:1px solid #a88c5d;border-radius:50%;color:#ffedbd;box-shadow:0 2px #080c1c;clip-path:none}.hud-button>span{font-size:23px;line-height:1}.hud-button>small{display:none}.hud-button:active{background:#5d4864;transform:translateY(2px)}
.mobile-header .chapter{display:flex;flex-direction:row;justify-content:center;gap:10px;min-width:0}.mobile-header .edition{font-size:11px;letter-spacing:0;max-width:150px;color:#c3b5cf;line-height:1.4}.mobile-header .chapter button{width:42px;height:42px;min-width:42px;min-height:0;flex-shrink:0;display:flex;flex-direction:column;justify-content:center;gap:0;padding:0;font-size:15px;line-height:1;letter-spacing:0;border:1px solid #81708c;box-shadow:none;clip-path:none;border-radius:50%;background:#25243c}.mobile-header .chapter button::after{content:'∞';font-size:12px;color:#b5a6c3;line-height:1.2}.mobile-header .flag,.level-chevron{display:none}.mobile-header .chapter button:active{background:#3b304e}
.level-bar{top:12px;left:14px;right:14px;gap:10px}.level-bar h1{font-size:13px;letter-spacing:0;max-width:68%;line-height:1.4}.level-bar #deaths{font-size:11px;white-space:nowrap}.run-status{top:43px;left:14px;font-size:10px;line-height:1.4;padding:4px 6px}.toast{top:78px;font-size:12px;line-height:1.55;max-width:calc(100% - 28px)}
.control-dock{padding:10px max(26px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(22px,env(safe-area-inset-left));border-top:1px solid #534668;background:linear-gradient(#18172f,#0d1023)}.control-dock .touch-controls{position:static;display:flex;justify-content:space-between;align-items:center;gap:24px;padding:0;pointer-events:auto}.control-dock .dpad{--pad-size:112px;border-width:2px;box-shadow:inset 0 0 0 2px #89749c,inset 0 -4px #15172e,0 4px #060b18,0 5px #a17a3d}.touch-controls .dpad button{min-width:0;min-height:0;border-radius:50%}.touch-controls .dpad .arrow{width:18px;height:18px}.dpad-center{border-width:1px}.touch-controls #jump{width:74px;min-width:74px;height:74px;min-height:74px;flex-direction:column;gap:0;border-radius:50%;border:2px solid #ffe59a;background:radial-gradient(circle at 35% 20%,#ffe8a7,#e9b950 78%);color:#33263a;box-shadow:inset 0 0 0 1px #d9a344,inset 0 -4px #b98235,0 4px #090d20,0 5px #9f753c;text-shadow:none;letter-spacing:0;touch-action:none}.touch-controls #jump .jump-word{font-size:20px;color:inherit;transform:none;text-shadow:none;font-weight:900}.touch-controls #jump small{display:none}.touch-controls #jump:active,.touch-controls #jump.pressed{background:#e1ac45;box-shadow:inset 0 3px 8px #a46e36,0 2px #090d20;transform:translateY(3px)}.keyboard-help{display:none}
/* Pause panel stays compact even on a desktop-size preview. */
dialog.mobile-sheet{width:min(308px,calc(100% - 28px));max-height:calc(100dvh - 28px);padding:16px;background:#1b1b32;border:1px solid #b49668;border-radius:18px;clip-path:none;box-shadow:0 12px 45px #060815aa;color:#fff0cf;overflow:auto;overscroll-behavior:contain;scroll-padding:12px}dialog.mobile-sheet::backdrop{background:#060916b3;backdrop-filter:blur(3px)}.mobile-sheet .modal-top{gap:12px;align-items:center}.mobile-sheet .modal-top h2{font-size:19px;line-height:1.4;margin:2px 0}.mobile-sheet .modal-top button{display:grid;place-items:center;flex:0 0 30px;width:30px;height:30px;min-height:0;padding:0;border:1px solid #756480;border-radius:50%;background:#302a46;font-size:22px;color:#fff0cf}.sheet-eyebrow{font-size:10px;letter-spacing:1px;color:#d6b775}.menu-promise{margin:8px 0 12px;font-size:11px;color:#bfb1cc;line-height:1.5}
.resume-control{display:flex;flex-direction:column;align-items:center;gap:7px}.resume-control>span{font-size:12px;line-height:1.3;color:#f7dfac}.primary-action,.dialog #overlay-action{display:grid;place-items:center;width:56px;height:56px;min-height:0;flex-shrink:0;padding:0;font-size:20px;background:#f7d67f;color:#2a2437;border:1px solid #ffe8ad;border-radius:50%;clip-path:none;box-shadow:inset 0 -3px #c19448,0 3px #090d20}.primary-action>span,.dialog #overlay-action>span{margin-left:3px}.primary-action:active,.dialog #overlay-action:active{background:#eac068;transform:translateY(2px)}
.menu-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:18px 0 14px}.round-item{display:flex;flex-direction:column;align-items:center;gap:7px}.round-item>span{font-size:10px;line-height:1.3;white-space:nowrap;color:#c9bed5}.menu-actions button{width:44px;height:44px;min-height:0;padding:0;display:grid;place-items:center;background:#302b46;border:1px solid #796483;border-radius:50%;font-size:24px;color:#fff0cf;line-height:1}.menu-actions button[aria-pressed=true]{border-color:#93c8af;color:#b8f1ce;background:#263b3b}.menu-actions button:active{background:#574460}.menu-controls-help{border-top:1px solid #51435f;padding-top:10px;margin:0;font-size:10px;line-height:1.5;color:#bfb1cc;text-align:center}.mobile-sheet .run-records{display:flex;justify-content:center;flex-wrap:wrap;gap:3px 10px;padding-top:8px;margin:0;font-size:9px;line-height:1.5}.mobile-sheet .run-records span:last-child{color:#f3cf80}
.dialog-layer{padding:14px}.dialog-layer .dialog{width:min(286px,100%);max-height:100%;padding:18px;background:#19192ff5;border:1px solid #b7996c;border-radius:18px;clip-path:none;box-shadow:0 10px 40px #05091988;overflow:auto}.dialog h2{font-size:23px;line-height:1.4;margin:10px 0}.dialog p{font-size:13px;line-height:1.65;margin:10px 0 16px}.dialog small{font-size:10px;margin-top:13px}.tagline{font-size:10px;letter-spacing:1px}.death-feedback{bottom:18px;border-radius:12px;clip-path:none;padding:10px;align-items:center;gap:10px;max-width:330px}.death-feedback strong{font-size:13px;line-height:1.5}.death-feedback p{font-size:11px}.death-feedback small{font-size:10px}.death-feedback button{width:40px;height:40px;min-width:40px;min-height:0;padding:0;font-size:11px;border-radius:50%}.playtest-bar{bottom:8px}.arena:has(.playtest-bar) .death-feedback{bottom:60px}
#level-dialog .modal-top+p{font-size:11px;line-height:1.6;margin:8px 0}#journey-records{font-size:10px;margin:8px 0;padding:8px}.journey-status{display:flex;gap:10px;align-items:center;font-size:11px;margin-bottom:14px}.endless-control{display:flex;align-items:center;gap:7px}.endless-control>span{max-width:55px;font-size:10px;line-height:1.4}.journey-status button{flex:none;width:36px;height:36px;min-height:0;font-size:24px;padding:0;border-radius:50%}
#level-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px 6px}.level-item{display:flex;flex-direction:column;align-items:center;gap:5px;min-width:0}#level-grid button{display:grid;place-items:center;width:46px;height:46px;min-height:0;padding:0;border:1px solid #88708c;border-radius:50%;clip-path:none;background:#302b46}#level-grid button:disabled{opacity:.35}#level-grid strong{font-size:18px;line-height:1.2}#level-grid small{width:100%;font-size:9px;line-height:1.4;height:25px;margin:0;text-align:center;color:#b8a8c9;overflow:hidden;overflow-wrap:anywhere}#level-grid button[aria-current]{border:2px solid #f0cf7d;background:#55415b}#level-dialog .level-pages{gap:10px;font-size:11px;margin:12px 0}#level-dialog .level-pages button{width:34px;height:34px;min-width:0;min-height:0;padding:0;font-size:24px;border-radius:50%}
#level-jump{display:grid;grid-template-columns:minmax(0,1fr) 38px;gap:8px;font-size:11px}#level-jump label{grid-column:1 / -1}#level-number{width:100%;height:38px;min-height:0;padding:8px;font-size:16px;border-radius:8px}#level-jump button{width:38px;height:38px;min-height:0;padding:0;font-size:11px;border-radius:50%}.restart-row{display:flex;align-items:center;gap:10px;margin:12px 0;font-size:11px;color:#dcc1cf}.restart-row small{display:block;font-size:9px;color:#a99ab4;margin-top:3px}.restart-level{width:36px;height:36px;min-height:0;flex-shrink:0;padding:0;font-size:23px;border-radius:50%;margin:0}.journey-extra{margin-top:16px;border-top:1px solid #55445f;padding-top:6px}.journey-extra>summary,#chapter-atlas>summary,#offline-panel>summary{display:flex;align-items:center;min-height:36px;font-size:11px;cursor:pointer}.journey-extra>summary::after{content:'＋';margin-left:auto;padding-left:10px}.journey-extra[open]>summary::after{content:'−'}#offline-panel{font-size:11px}#offline-panel button{width:58px;height:58px;min-height:0;font-size:10px;line-height:1.4;border-radius:50%;padding:8px;margin:5px 6px 5px 0}#offline-panel small{font-size:10px}.playtest-link{display:flex;align-items:center;min-height:34px;font-size:11px}#retry-save{width:44px;height:44px;min-height:0;padding:6px;font-size:11px;border-radius:50%}.save-warning{top:68px;border-radius:12px;line-height:1.5;padding:10px}.chapter-cards figcaption,#chapter-atlas small{font-size:10px;line-height:1.5}#trial-dialog,#trial-picker{border-radius:18px;clip-path:none;max-height:calc(100dvh - 28px)}#trial-feedback select,#trial-feedback textarea{font-size:16px}.playtest-bar button{min-height:32px}
@media(max-width:370px){.mobile-header{padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right));gap:8px}.mobile-header .edition{font-size:10px;max-width:130px}.control-dock{padding-left:max(18px,env(safe-area-inset-left));padding-right:max(22px,env(safe-area-inset-right))}.control-dock .dpad{--pad-size:104px}.touch-controls #jump{width:68px;height:68px;min-width:68px;min-height:68px}.level-bar h1{font-size:12px}.run-status{font-size:9px}}
@media(orientation:landscape) and (min-width:500px) and (max-height:500px){.mobile-header{padding-top:max(5px,env(safe-area-inset-top));padding-bottom:5px}.mobile-header .hud-button{width:34px;height:34px}.mobile-header .chapter button{width:36px;height:36px;min-width:36px;font-size:13px}.control-dock{height:12px;min-height:12px;padding:0;border:0}.control-dock .touch-controls{position:absolute;bottom:max(14px,env(safe-area-inset-bottom));left:max(18px,env(safe-area-inset-left));right:max(22px,env(safe-area-inset-right));pointer-events:none;gap:20px;align-items:flex-end;z-index:2}.control-dock .dpad{--pad-size:104px;pointer-events:auto}.touch-controls #jump{width:68px;height:68px;min-width:68px;min-height:68px;pointer-events:auto;margin-bottom:0}.level-bar{top:8px}.run-status{top:35px}.dialog-layer{padding:10px 136px;z-index:3}.dialog-layer .dialog{padding:12px 16px}.dialog h2{font-size:20px;margin:6px 0}.dialog p{font-size:12px;line-height:1.5;margin:6px 0 10px}.dialog #overlay-action{width:44px;height:44px;font-size:16px}.dialog small{display:none}.death-feedback{max-width:calc(100% - 260px);bottom:18px}.playtest-bar{bottom:5px}.arena:has(.playtest-bar) .death-feedback{bottom:60px}}
@media(prefers-reduced-motion:reduce){button{transition:none!important}}
