:root{font-family:system-ui,-apple-system,"Segoe UI",sans-serif;color:#fff7dc;background:#071521;--accent:#6ed4ff;--deep:#123649;--touch:clamp(62px,17.4dvh,132px);color-scheme:dark}*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;overscroll-behavior:none}body{-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}button,input,select{font:inherit}button{cursor:pointer;touch-action:manipulation;color:inherit}button:focus-visible,a:focus-visible{outline:3px solid white;outline-offset:4px}button:disabled{opacity:.4;cursor:default}#game{width:100vw;height:100dvh;position:relative;isolation:isolate;overflow:hidden;background:#071521}#scene,.shade{position:absolute;inset:0;width:100%;height:100%}.shade{z-index:1;pointer-events:none;background:linear-gradient(#0004,transparent 23%,transparent 86%,#0004)}.glass{border:1px solid #fff8;box-shadow:inset 0 2px 6px #fff7,0 4px 12px #0005;background:linear-gradient(140deg,color-mix(in srgb,var(--accent),transparent 68%),color-mix(in srgb,var(--deep),transparent 12%));backdrop-filter:blur(13px);border-radius:18px}.modes{position:absolute;top:max(2dvh,env(safe-area-inset-top),var(--native-safe-top,0px));left:max(1.5vw,env(safe-area-inset-left),var(--native-safe-left,0px));display:grid;gap:1.4dvh;z-index:3}.modes button{width:clamp(86px,11vw,190px);height:clamp(38px,8.5dvh,70px);font-size:clamp(15px,2.8dvh,28px);font-weight:700}.modes button.active{border-color:var(--accent);box-shadow:inset 0 2px 7px #fffa,0 0 13px color-mix(in srgb,var(--accent),transparent 40%)}.hud{position:absolute;z-index:3;top:max(1.8dvh,env(safe-area-inset-top),var(--native-safe-top,0px));left:16%;right:16%;display:flex;justify-content:center;align-items:center;gap:2vw;text-shadow:0 2px 5px #000a;pointer-events:none}.identity{text-align:center;max-width:50%}.identity strong{font-size:clamp(16px,3.5dvh,36px);text-transform:uppercase;font-weight:800;letter-spacing:.035em;white-space:nowrap}.identity small{display:block;font-size:clamp(12px,1.8dvh,15px);margin-top:.2em;color:#fff9}.score-group{text-align:center;border-inline-start:1px solid #fff8;padding-inline-start:2vw}#score{display:block;font:700 clamp(30px,8dvh,70px)/1 ui-monospace,monospace;font-variant-numeric:tabular-nums;letter-spacing:.06em}#best{display:block;font-size:clamp(12px,1.8dvh,15px);color:#fff9}.lives{display:flex;gap:.5vw}.lives i{width:clamp(14px,2.1vw,30px);aspect-ratio:1;background:var(--accent);border:2px solid #fff9;border-radius:5px;transform:rotate(30deg);box-shadow:0 0 12px color-mix(in srgb,var(--accent),transparent 50%)}.lives i.lost{background:#18273377;box-shadow:none;opacity:.5}.lives i.half{background:linear-gradient(90deg,var(--accent) 50%,#18273377 50%)}.tools{position:absolute;z-index:3;right:max(1.5vw,env(safe-area-inset-right),var(--native-safe-right,0px));top:max(2dvh,env(safe-area-inset-top),var(--native-safe-top,0px));display:flex;gap:1vw}.square{width:clamp(40px,8.7dvh,76px);height:clamp(40px,8.7dvh,76px);font-size:clamp(25px,5.5dvh,42px);display:grid;place-items:center}.square svg,.bottom svg{width:60%;height:60%;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}.catch-button{position:absolute;z-index:4;width:var(--touch);height:var(--touch);padding:20%;padding:0;border-radius:50%;border:3px solid #fff9;background:radial-gradient(circle at 40% 20%,color-mix(in srgb,var(--accent),white 18%),var(--accent) 8%,var(--deep) 86%);box-shadow:inset 0 4px 7px #ffff, inset 0 -5px 10px var(--accent),0 0 0 5px #091d2388,0 7px 14px #0005;touch-action:none;transition:filter .1s,box-shadow .1s,scale .08s}.catch-button:after{content:"";position:absolute;inset:8% 10% 53%;border-radius:100%;background:linear-gradient(#fff5,#fff0);pointer-events:none}.catch-button svg{height:55%;width:55%;fill:none;stroke:#fff9dc;stroke-width:4;stroke-linecap:round;stroke-linejoin:round}.catch-button.left{left:max(2vw,env(safe-area-inset-left),var(--native-safe-left,0px))}.catch-button.right{right:max(2vw,env(safe-area-inset-right),var(--native-safe-right,0px))}.catch-button.upper{top:35%}.catch-button.lower{top:66%}.catch-button.active{filter:brightness(1.17);box-shadow:inset 0 4px 7px #ffff,inset 0 -5px 10px var(--accent),0 0 0 5px #fff5,0 0 28px var(--accent)}.catch-button.pressed{scale:.95}.brand{position:absolute;bottom:max(2dvh,env(safe-area-inset-bottom),var(--native-safe-bottom,0px));left:max(1.7vw,env(safe-area-inset-left));font-size:clamp(15px,3dvh,28px);font-weight:800;font-style:italic;text-shadow:0 2px 8px #000;z-index:3}.bottom{position:absolute;bottom:max(1.6dvh,env(safe-area-inset-bottom),var(--native-safe-bottom,0px));left:50%;transform:translateX(-50%);height:clamp(42px,9dvh,78px);display:flex;align-items:stretch;padding:2px;z-index:4}.bottom button{width:clamp(45px,6vw,88px);padding:4px 8px;border:0;border-right:1px solid #fff3;background:transparent;display:grid;place-items:center;font-size:clamp(25px,5dvh,40px);border-radius:15px}.bottom button:last-child{border:0}.bottom button:hover{background:#fff1}#impulse{position:absolute;z-index:4;right:18%;bottom:max(2dvh,env(safe-area-inset-bottom),var(--native-safe-bottom,0px));height:clamp(40px,8dvh,65px);font-size:clamp(14px,2.7dvh,22px);padding:5px 15px}#impulse.ready{box-shadow:0 0 18px var(--accent),inset 0 1px 6px #fff9}.helper{position:absolute;top:19%;left:43%;z-index:3;padding:5px 12px;font-size:clamp(12px,2.3dvh,18px);color:var(--accent);text-shadow:0 1px 3px #000}#toast{position:absolute;z-index:5;top:25%;left:25%;right:25%;text-align:center;font-size:clamp(15px,3dvh,26px);font-weight:750;text-shadow:0 2px 5px #000;pointer-events:none}#loading{position:absolute;inset:0;background:#071521;z-index:20;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:16px;font-size:20px}.spinner{width:40px;height:40px;border:3px solid #fff2;border-top-color:var(--accent);border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}[hidden]{display:none!important}.floating-card{position:absolute;z-index:6;left:50%;top:53%;transform:translate(-50%,-50%);padding:clamp(16px,3dvh,28px);min-width:min(440px,54vw);max-width:58vw;text-align:center;background:linear-gradient(140deg,#0d2530ec,#091823e8);border-color:var(--accent)}.floating-card strong{font-size:clamp(20px,4dvh,30px)}.floating-card p{font-size:clamp(14px,2.6dvh,18px);margin:.7em 0;line-height:1.5}.row{display:flex;gap:12px;justify-content:center;flex-wrap:wrap}.primary,.secondary{border-radius:12px;min-height:44px;padding:10px 22px;border:1px solid #fff6;font-weight:700;font-size:16px}.primary{background:var(--accent);color:#10232c}.secondary{background:#ffffff13;color:#fff}.toggle{display:flex;align-items:center;justify-content:center;gap:10px;font-size:15px;margin-top:14px}.toggle input{width:21px;height:21px;accent-color:var(--accent)}dialog{padding:0;border:1px solid var(--accent);border-radius:22px;background:#0a1b26f5;color:#fff7dc;width:min(570px,88vw);max-height:92dvh;z-index:50;box-shadow:0 20px 90px #000b}dialog::backdrop{background:#05121bb0;backdrop-filter:blur(4px)}.dialog-card{padding:26px;overflow:auto;max-height:90dvh}.close{position:absolute;right:10px;top:6px;border:0;background:transparent;font-size:30px;line-height:1;min-width:40px;min-height:40px}.dialog-card h2{margin:0 35px 16px 0;font-size:25px}.dialog-card p,.dialog-card li{font-size:16px;line-height:1.55}.dialog-card ul{padding-inline-start:22px}.setting-row{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:12px 0;border-bottom:1px solid #fff2;font-size:16px}.setting-row select,.setting-row input[type=time]{background:#0d2b3a;color:#fff;border:1px solid #fff5;border-radius:8px;padding:8px;font-size:16px;max-width:180px}.setting-row input[type=checkbox]{width:22px;height:22px;accent-color:var(--accent)}.hint{color:#bed2de;font-size:14px!important}.dialog-card a{color:var(--accent)}.rotate-screen{display:none;position:absolute;inset:0;z-index:40;background:#071521f5;align-items:center;justify-content:center;flex-direction:column;text-align:center;padding:25px}.rotate-screen svg{width:110px;stroke:var(--accent);stroke-width:3;fill:none}.rotate-screen h2{font-size:26px;margin-bottom:5px}.rotate-screen p{font-size:17px;max-width:300px;line-height:1.5}@media(orientation:portrait){.rotate-screen{display:flex}}@media(max-height:380px){.identity strong{font-size:15px}.identity small,#best{font-size:11px}.hud{gap:1vw;left:17%;right:17%}.lives{gap:4px}.modes button{height:34px;min-height:34px}.tools .square{width:36px;height:36px;border-radius:12px}.bottom{height:39px}.floating-card{padding:13px}.floating-card p{margin:5px 0}.toggle{margin-top:8px}.dialog-card{padding:18px 22px}.dialog-card h2{font-size:22px}.setting-row{padding:7px 0}}@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
#case{width:clamp(80px,10vw,132px);grid-template-rows:1fr auto;gap:0;padding:3px 5px}#case svg{height:22px;width:30px}#case span{font-size:clamp(12px,2dvh,16px);line-height:1.1;white-space:nowrap}.brand{font-size:clamp(15px,2.8dvh,25px);font-style:normal;letter-spacing:-.025em}.brand small{font-size:.64em;font-weight:500;letter-spacing:.05em}.future-case{display:none;position:absolute;inset:0;z-index:2;pointer-events:none;border:clamp(4px,.7dvh,8px) solid #7196ad;border-radius:clamp(18px,4dvh,40px);box-shadow:inset 0 0 0 2px #d8f5ff99,inset 0 0 18px #02131d,0 0 0 8px #05151e;background:linear-gradient(180deg,#bcd6e4ee 0,#284552 1.1%,transparent 2.3%,transparent 95.8%,#315461 98.7%,#ccefff 100%)}.framed .future-case{display:block}.side-panel{position:absolute;top:0;bottom:0;width:13.1%;background:repeating-linear-gradient(173deg,#ffffff03 0 1px,#0a20240a 1px 3px),linear-gradient(100deg,#122932 0,#40616a 15%,#132c38 39%,#173d4a 75%,#94adb6 98%,#12242e 100%);box-shadow:inset 0 0 25px #021722;opacity:.97}.panel-left{left:0;border-radius:26px 0 0 26px;border-right:1px solid #cefaff80;clip-path:polygon(0 0,96% 0,96% 18%,100% 24%,100% 79%,91% 85%,91% 100%,0 100%)}.panel-right{right:0;transform:scaleX(-1);border-radius:26px 0 0 26px;border-right:1px solid #cefaff80;clip-path:polygon(0 0,96% 0,96% 18%,100% 24%,100% 79%,91% 85%,91% 100%,0 100%)}.side-panel:after{content:"";position:absolute;top:23%;bottom:12%;right:7%;width:2px;background:var(--accent);box-shadow:0 0 8px var(--accent),0 0 18px var(--accent);opacity:.8}.screen-rim{position:absolute;inset:1.5% 13% 2.5%;border:1px solid #dbf7ff85;border-radius:18px;box-shadow:0 0 0 3px #102b38,inset 0 0 12px #061f3088,0 0 14px #7df6ff55}.case-screw{position:absolute;width:6px;height:6px;border:1px solid #152a34;border-radius:50%;background:linear-gradient(45deg,#bad4df 40%,#233c48 45% 55%,#92b1c0 60%)}.screw-tl{top:1.5%;left:1%}.screw-tr{top:1.5%;right:1%}.screw-bl{bottom:1.5%;left:1%}.screw-br{bottom:1.5%;right:1%}.framed .brand{bottom:3.1dvh;left:1.6vw;width:11%;text-align:center;line-height:1.1;font-size:clamp(14px,2.7dvh,24px);color:#d8f7ff;text-shadow:0 1px 1px #00111e,0 0 8px #68dcff55}.framed .brand small{display:block;margin-top:3px}.framed .glass{border-color:#bee7ed80;background:linear-gradient(140deg,#94aeba70,#153442dc 40%,#0a2638ed);box-shadow:inset 0 1px 3px #eaffff99,0 4px 9px #0007}.framed .catch-button{border:2px solid #d7f7ffad;background:radial-gradient(circle at 38% 25%,#efffff55,transparent 45%),linear-gradient(145deg,#214954,#071e2c 70%);box-shadow:inset 0 0 0 5px #091e2c,inset 0 0 0 7px var(--accent),inset 0 -8px 18px #0009,0 0 0 4px #273e4b,0 0 0 6px #89c3cf55,0 8px 14px #0009;}.framed .catch-button.active{box-shadow:inset 0 0 0 5px #091e2c,inset 0 0 0 7px var(--accent),inset 0 0 24px var(--accent),0 0 0 4px #273e4b,0 0 18px var(--accent)}.framed .catch-button svg{stroke:var(--accent);filter:drop-shadow(0 0 5px var(--accent))}.framed .bottom{border-radius:14px}#impulse{right:15%;max-width:18vw}.bottom{max-width:52vw}.bottom button{flex-shrink:1;min-width:36px}.hud{background:linear-gradient(180deg,#061c2e70,transparent);border-radius:12px}@media(max-height:380px){#case svg{height:17px}#case span{font-size:11px}.framed .brand{font-size:14px}.bottom{bottom:1.3dvh}.hud{gap:1.3vw}}

.setting-volume{padding:12px 0;border-bottom:1px solid #fff2}.setting-volume label{display:flex;justify-content:space-between;gap:18px;font-size:16px}.setting-volume output{font-variant-numeric:tabular-nums;color:var(--accent);min-width:4ch}.setting-volume input{display:block;width:100%;min-height:36px;margin:5px 0 7px;accent-color:var(--accent);touch-action:pan-x}.setting-volume .hint{margin:8px 0 0}.setting-volume button{padding:7px 14px;min-height:40px}.setting-volume input:focus-visible{outline:2px solid white;outline-offset:3px;border-radius:8px}
.helper{top:17.5%;left:50%;transform:translateX(-50%);padding:0;width:clamp(64px,17dvh,128px);height:clamp(64px,17dvh,128px);pointer-events:none;animation:helper-enter .3s ease-out}.helper-window{width:100%;height:100%;border-radius:50% 50% 38% 38%;border:1px solid color-mix(in srgb,var(--accent),transparent 25%);background:radial-gradient(ellipse at 50% 100%,color-mix(in srgb,var(--accent),transparent 70%),#081925bc 70%);box-shadow:inset 0 1px 5px #fff5,0 0 13px color-mix(in srgb,var(--accent),transparent 65%);overflow:hidden}.helper-mascot{display:block;width:100%;height:100%;background-image:var(--helper-image,url('assets/helpers.webp'));background-size:var(--helper-size,300% 200%);background-position:var(--helper-x) var(--helper-y);background-repeat:no-repeat}.helper-rule{position:absolute;right:-6px;bottom:-2px;display:grid;place-items:center;width:29px;height:29px;border-radius:50%;background:var(--accent);border:2px solid #fff9;color:#09212c;font-weight:850;font-size:20px;text-shadow:none}.helper-explanation{display:flex;align-items:center;gap:14px;border:1px solid #fff2;border-radius:15px;padding:12px;background:#ffffff06}.helper-explanation .helper-mascot{width:85px;height:85px;flex:0 0 85px}.helper-explanation p{margin:0;font-size:14px}.lives i.half{animation:half-life 1s steps(2,end) infinite}@keyframes half-life{50%{opacity:.5}}@keyframes helper-enter{from{opacity:0;translate:0 -10px}to{opacity:1;translate:0 0}}@media(prefers-reduced-motion:reduce){.helper,.lives i.half{animation:none}}

#toast{top:18%;left:18%;right:auto;width:23%;font-size:clamp(12px,2.7dvh,22px);text-align:center}

.helper-name{position:absolute;top:100%;left:50%;transform:translateX(-50%);padding:2px 8px;border:1px solid #bfffea66;border-radius:7px;background:#09212be8;color:#fff;font-size:12px;font-weight:700;line-height:1.25;white-space:nowrap;text-shadow:none}.helper-name[hidden]{display:none}

.standalone-helper .helper{left:22%;top:3.5%;width:clamp(44px,13dvh,76px);height:clamp(44px,13dvh,76px)}.standalone-helper .helper-rule{width:23px;height:23px;font-size:16px;right:-6px;bottom:-2px}.standalone-helper .helper-name{top:calc(100% + 3px);font-size:12px}

.nav-exit{display:flex;align-items:center;justify-content:center;gap:6px!important;height:clamp(32px,6.2dvh,48px)!important;font-size:clamp(12px,2.2dvh,18px)!important}.nav-exit svg,.all-games svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.all-games{position:absolute;z-index:4;top:calc(max(2dvh,env(safe-area-inset-top),var(--native-safe-top,0px)) + clamp(40px,8.7dvh,76px) + 1.5dvh);right:max(1.5vw,env(safe-area-inset-right),var(--native-safe-right,0px));height:clamp(34px,6.4dvh,50px);width:clamp(88px,11vw,160px);display:flex;align-items:center;justify-content:center;gap:6px;font-size:clamp(11px,2.2dvh,17px);font-weight:650;padding:4px 8px}.all-games span{white-space:nowrap}@media(max-height:380px){.nav-exit{height:30px!important;min-height:30px!important}.all-games{height:30px;top:calc(max(2dvh,env(safe-area-inset-top),var(--native-safe-top,0px)) + 36px + 1.5dvh)}}

.dialog-nav{display:flex;gap:10px;border-top:1px solid #ffffff22;margin-top:18px;padding-top:12px}.dialog-nav button{flex:1;font-size:14px;padding:8px 12px;min-height:40px}

.catch-button kbd{display:none}.catch-button.key-held{scale:.95;filter:brightness(1.25);box-shadow:inset 0 0 0 5px #091e2c,inset 0 0 0 7px var(--accent),inset 0 0 26px var(--accent),0 0 0 5px #ffffff55,0 0 25px var(--accent)}@media(hover:hover) and (pointer:fine){.catch-button kbd{display:grid;place-items:center;position:absolute;left:50%;bottom:7%;transform:translateX(-50%);min-width:1.65em;height:1.45em;font:750 clamp(12px,2.3dvh,21px)/1 ui-monospace,monospace;border:1px solid #d7f7ff99;border-radius:5px;background:#061c2ad6;color:#ecfffa;box-shadow:0 2px 0 #00111bcc;pointer-events:none}.catch-button svg{transform:translateY(-8%)}}

#trialTime{font:600 12px system-ui;color:#e9f9ff;padding:0 6px;white-space:nowrap} .top-actions #account{white-space:nowrap}

/* Shared phone/desktop control geometry: separate touch targets and safe-area gutters. */
:root{--edge-left:max(1.6vw,env(safe-area-inset-left),var(--native-safe-left,0px));--edge-right:max(1.6vw,env(safe-area-inset-right),var(--native-safe-right,0px));--utility-height:clamp(44px,8.5dvh,70px)}
.modes{display:contents}.modes #modeA,.modes #modeB{position:absolute;left:var(--edge-left);z-index:4;height:var(--utility-height);min-height:44px;width:clamp(86px,11vw,190px)}
#modeA{top:max(2dvh,env(safe-area-inset-top),var(--native-safe-top,0px))}#modeB{top:calc(max(2dvh,env(safe-area-inset-top),var(--native-safe-top,0px)) + var(--utility-height) + 6px)}
.modes .nav-exit{position:absolute;left:var(--edge-left);bottom:max(1.6dvh,env(safe-area-inset-bottom),var(--native-safe-bottom,0px));z-index:4;height:clamp(44px,7dvh,56px)!important;min-height:44px!important;width:clamp(86px,11vw,190px);font-size:clamp(12px,2.3dvh,18px)!important;padding:4px 7px}
.tools{right:var(--edge-right);gap:6px}.tools .square{height:clamp(44px,8.7dvh,76px);width:clamp(44px,8.7dvh,76px)}
.all-games{right:var(--edge-right);min-height:44px;top:calc(max(2dvh,env(safe-area-inset-top),var(--native-safe-top,0px)) + clamp(44px,8.7dvh,76px) + 6px);height:44px;width:clamp(94px,11vw,160px);font-size:clamp(12px,2.2dvh,17px)}
.catch-button.upper{top:35%}.catch-button.lower{top:62%}.catch-button:disabled{opacity:1;cursor:default}.catch-button:disabled svg{opacity:.65}
.bottom{left:45%;width:46vw;max-width:none;height:clamp(48px,9dvh,78px);bottom:max(1.6dvh,env(safe-area-inset-bottom),var(--native-safe-bottom,0px));padding:2px}.bottom button{width:auto;flex:1;min-width:44px;min-height:44px}.bottom #case{width:auto;flex:1.65;min-width:74px}
#impulse{right:13.8%;width:15.8%;max-width:none;min-height:44px;height:clamp(44px,8dvh,65px);padding:5px 6px;font-size:clamp(12px,2.5dvh,20px);white-space:nowrap;bottom:max(1.6dvh,env(safe-area-inset-bottom),var(--native-safe-bottom,0px))}
.brand,.framed .brand{left:auto;right:var(--edge-right);width:11%;bottom:max(2dvh,env(safe-area-inset-bottom),var(--native-safe-bottom,0px));font-size:clamp(12px,2.5dvh,22px);text-align:center;line-height:1.1}.brand small{display:block}
.hud{display:grid;grid-template-columns:minmax(0,1fr) auto auto;left:17%;right:17%;gap:1.3vw}.identity{max-width:none;min-width:0}.identity strong{display:block;white-space:normal;text-wrap:balance;font-size:clamp(14px,3.2dvh,30px);line-height:1.15}.identity small{line-height:1.2}.score-group{padding-inline-start:1.2vw}.lives{padding-inline-end:4px}
.standalone-helper .helper{top:18%;left:23%;width:clamp(44px,13dvh,76px);height:clamp(44px,13dvh,76px)}
.floating-card{width:min(440px,58vw);min-width:0;max-width:60vw;max-height:69dvh;overflow:auto;overscroll-behavior:contain}.floating-card.preview-locked>.row,.floating-card.preview-locked>.toggle,#previewLabel{display:none}.preview-locked #previewNote{color:#d6e8f2;margin:12px 0;line-height:1.45}#previewUnlock{width:100%;border-color:var(--accent);min-height:44px}
#trialTime{position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);padding:4px 10px;border-radius:12px;background:#061522e6;border:1px solid #ffffff35;pointer-events:none}
.close{min-width:44px;min-height:44px}.dialog-card h2{margin-inline-end:36px;margin-inline-start:0}.dialog-nav button{min-height:44px}.setting-volume button{min-height:44px}.setting-row input[type=checkbox],.toggle input{flex-shrink:0}.setting-row select{min-height:44px;min-width:100px}.rotate-screen .secondary{margin-top:18px;min-width:180px}
@media(max-height:380px){.hud{left:18%;right:18%;gap:8px}.identity strong{font-size:14px}.identity small{font-size:10px}.lives i{width:14px}#score{font-size:30px}.floating-card{padding:14px}.floating-card p{line-height:1.35}.brand,.framed .brand{font-size:12px}.bottom{bottom:max(1.6dvh,env(safe-area-inset-bottom),var(--native-safe-bottom,0px))}.bottom #case span{font-size:11px}}
@media(max-height:300px) and (orientation:landscape){:root{--touch:56px;--utility-height:40px}.modes #modeA,.modes #modeB{min-height:40px}.modes .nav-exit{min-height:40px!important;height:40px!important}.catch-button.lower{top:61%}.floating-card{max-height:66dvh}.identity small{display:none}}

.toggle{min-height:44px;margin-top:8px}.setting-row{min-height:48px}

/* The dock owns physical space below the canvas in both frame and fill modes.
   One canvas size drives the backdrop, tracks, receivers and falling objects. */
:root{--dock-safe:max(env(safe-area-inset-bottom),var(--native-safe-bottom,0px));--dock-controls:clamp(44px,5.4dvh,56px);--dock-height:calc(var(--dock-controls) + var(--case-border) * 2 + 4px + var(--dock-safe));--play-height:calc(100dvh - var(--dock-height));--top-edge:max(2dvh,env(safe-area-inset-top),var(--native-safe-top,0px))}
#scene,.shade{height:var(--play-height);bottom:auto}
#game::after{content:"";position:absolute;z-index:2;inset:auto 0 0;height:var(--dock-height);pointer-events:none;border-top:1px solid #b5e9f342;background:linear-gradient(180deg,color-mix(in srgb,var(--deep),#102832 35%),#061723);box-shadow:0 -2px 10px #0003}
.screen-rim{bottom:calc(var(--dock-height) + 4px)}
.bottom{height:var(--dock-controls);bottom:calc(var(--dock-safe) + 4px);border-radius:14px}
.modes .nav-exit{bottom:calc(var(--dock-safe) + 6px);height:calc(var(--dock-controls) - 4px)!important}
#impulse{bottom:calc(var(--dock-safe) + 6px);height:calc(var(--dock-controls) - 4px)}
.brand,.framed .brand{bottom:calc(var(--dock-safe) + 4px);height:var(--dock-controls);display:flex;flex-direction:column;justify-content:center;font-size:clamp(12px,2.5dvh,20px)}
.brand small{margin:0}.brand:has(#trialTime:not([hidden])) small{display:none}
#trialTime{position:static;transform:none;border:0;background:none;padding:2px 0 0;font-size:12px;line-height:1.1}
.catch-button.upper{top:max(calc(var(--play-height) * .35),calc(var(--top-edge) + var(--utility-height) * 2 + 14px))}
.catch-button.lower{top:min(calc(var(--play-height) * .68),calc(var(--play-height) - var(--touch) - 10px))}
@media(max-height:380px){.bottom{bottom:calc(var(--dock-safe) + 4px)}}

/* World-specific life symbols stay legible, including a half penalty. */
.lives{align-items:center;gap:3px;flex-shrink:0}
.lives i,.lives i.half,.lives i.lost{display:block;position:relative;width:clamp(20px,2.8vw,32px);height:auto;aspect-ratio:1;background:none;border:0;border-radius:0;transform:none;box-shadow:none;opacity:1;animation:none}
.lives i span{position:absolute;inset:0;display:block}.lives svg{display:block;width:100%;height:100%;overflow:visible}.life-ghost{filter:grayscale(1);opacity:.25}.life-fill{filter:drop-shadow(0 1px 2px #0008)}.lives .half .life-fill{clip-path:inset(0 50% 0 0)}.lives .lost .life-fill{visibility:hidden}
@media(max-height:380px){.lives i,.lives i.half,.lives i.lost{width:20px}.lives{gap:2px}}

/* Controls are recessed into the case's lower edge, as in the approved preview.
   This bezel owns its layout space; the canvas never extends underneath it. */
#game::after{left:var(--case-border);right:var(--case-border);bottom:var(--case-border);height:calc(var(--dock-height) - var(--case-border));border-top:1px solid #d5f4e58c;border-radius:0 0 clamp(14px,3dvh,32px) clamp(14px,3dvh,32px);background:radial-gradient(ellipse at 50% 0,color-mix(in srgb,var(--accent),transparent 88%),transparent 70%),repeating-linear-gradient(173deg,#ffffff03 0 1px,#0a202408 1px 3px),linear-gradient(180deg,#315362,#143441 28%,#102c39 72%,#274956);box-shadow:inset 0 1px 2px #f0ffe942,inset 0 -1px 1px #8ccbdc66}
.bottom,.framed .bottom{left:50%;width:clamp(286px,34vw,460px);max-width:calc(100vw - 200px);height:var(--dock-controls);bottom:calc(var(--case-border) + var(--dock-safe) + 2px);padding:0;border:0;border-radius:0;background:none;box-shadow:none;backdrop-filter:none}
#game:has(#impulse:not([hidden])) .bottom{left:43%}
.bottom button{background:transparent;box-shadow:none;border:0;border-inline-end:1px solid #d9f6ef35;border-radius:0;min-height:44px;padding:4px 8px;font-size:28px}
.bottom button:last-of-type{border-inline-end:0}
.bottom button:hover,.modes .nav-exit:hover{background:#d5fff214}
.bottom button:focus-visible,.modes .nav-exit:focus-visible{outline:2px solid var(--accent);outline-offset:-3px;border-radius:8px}
.bottom button svg{width:26px;height:26px;filter:drop-shadow(0 0 4px #bbf5df28)}
.bottom #case{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:7px;min-width:110px;padding:4px 7px}
.bottom #case svg{width:28px;height:24px;flex-shrink:0}
.bottom #case span{font-size:14px;line-height:1.1;white-space:nowrap}
.modes .nav-exit{bottom:calc(var(--case-border) + var(--dock-safe) + 2px);height:var(--dock-controls)!important;padding:4px 7px;background:none;border:0;box-shadow:none;border-radius:0;backdrop-filter:none;font-size:clamp(14px,2dvh,18px)!important}
.modes .nav-exit svg{width:20px;height:20px}
#impulse,#impulse.ready{bottom:calc(var(--case-border) + var(--dock-safe) + 2px);height:var(--dock-controls);border:0;border-inline-start:1px solid #d9f6ef35;border-radius:0;background:none;box-shadow:none;backdrop-filter:none;font-size:clamp(14px,2dvh,18px)}
#impulse.ready{color:var(--accent);text-shadow:0 0 8px color-mix(in srgb,var(--accent),transparent 40%)}
.brand,.framed .brand{bottom:calc(var(--case-border) + var(--dock-safe) + 2px);height:var(--dock-controls);font-size:clamp(14px,2dvh,18px);text-shadow:0 1px 2px #00111e}
@media(min-width:1100px){.brand,.framed .brand{width:auto;flex-direction:row;gap:.3em;align-items:center}.brand small,.framed .brand small{display:inline;font-size:1em;letter-spacing:0;margin:0}.brand:has(#trialTime:not([hidden])){flex-direction:column;gap:0}}

/* Keep each circular control and its 6px rim inside the physical side panel.
   The same measurements drive the case, screen opening and control centres. */
:root{
  --case-border:clamp(4px,.7dvh,8px);
  --panel-width:calc((100vw - var(--case-border) * 2) * .131);
  --panel-safe-left:max(0px,calc(max(env(safe-area-inset-left),var(--native-safe-left,0px)) - var(--case-border)));
  --panel-safe-right:max(0px,calc(max(env(safe-area-inset-right),var(--native-safe-right,0px)) - var(--case-border)));
  --panel-left-width:max(var(--panel-width),calc((var(--panel-safe-left) + 64px) / .91));
  --panel-right-width:max(var(--panel-width),calc((var(--panel-safe-right) + 64px) / .91));
  --round-top:max(calc(var(--play-height) * .35),calc(var(--top-edge) + var(--utility-height) * 2 + 14px));
  --touch:min(clamp(44px,17.4dvh,132px),calc(var(--panel-left-width) * .91 - var(--panel-safe-left) - 20px),calc(var(--panel-right-width) * .91 - var(--panel-safe-right) - 20px),calc((var(--play-height) - var(--round-top) - 26px) / 2));
}
.future-case{border-width:var(--case-border)}
.panel-left{width:var(--panel-left-width)}
.panel-right{width:var(--panel-right-width)}
.screen-rim{left:var(--panel-left-width);right:var(--panel-right-width)}
.catch-button{width:var(--touch);height:var(--touch);aspect-ratio:1;transform-origin:center;transition:filter .1s,box-shadow .1s}
.catch-button.left{left:calc(var(--case-border) + var(--panel-safe-left) + (var(--panel-left-width) * .91 - var(--panel-safe-left) - var(--touch)) / 2)}
.catch-button.right{right:calc(var(--case-border) + var(--panel-safe-right) + (var(--panel-right-width) * .91 - var(--panel-safe-right) - var(--touch)) / 2)}
.catch-button.upper{top:var(--round-top)}
.catch-button.lower{top:min(max(calc(var(--play-height) * .68),calc(var(--round-top) + var(--touch) + 16px)),calc(var(--play-height) - var(--touch) - 10px))}
.catch-button.pressed,.catch-button.key-held,.catch-button:active{scale:1}
.catch-button.pressed{filter:brightness(1.25)}
/* The helper's frame stays anchored; only its pose switches with a game tick. */
.helper{animation:none}
.helper .helper-mascot{transition:none;transform:none}
.helper.step-pose .helper-mascot{transform:translateY(-3px)}
@media(prefers-reduced-motion:reduce){.helper.step-pose .helper-mascot{transform:none}}
/* Desktop keyboard hints sit below each round button on the same side panel. */
@media(hover:hover) and (pointer:fine){
  :root{
    --key-label-height:clamp(14px,2.6dvh,20px);
    --key-label-space:calc(var(--key-label-height) + 9px);
    --touch:min(clamp(44px,17.4dvh,132px),calc(var(--panel-left-width) * .91 - var(--panel-safe-left) - 20px),calc(var(--panel-right-width) * .91 - var(--panel-safe-right) - 20px),calc((var(--play-height) - var(--round-top) - var(--key-label-space) * 2 - 20px) / 2));
  }
  .catch-button.lower{top:min(max(calc(var(--play-height) * .68),calc(var(--round-top) + var(--touch) + var(--key-label-space) + 10px)),calc(var(--play-height) - var(--touch) - var(--key-label-space) - 10px))}
  .catch-button svg{transform:none}
  .catch-button kbd{top:calc(100% + 9px);bottom:auto;height:var(--key-label-height);min-width:1.8em;font-size:clamp(10px,2dvh,14px);line-height:1;box-shadow:0 1px 0 #00111bcc}
}

/* Keep Close outside the scrollable settings so it never covers a switch. */
.dialog-top{height:44px;display:flex;justify-content:flex-end;align-items:center;padding:0 8px;border-bottom:1px solid #fff2}.dialog-top .close{position:static}.dialog-card{max-height:calc(92dvh - 46px);padding-top:12px}
