/* Shared game controls: same inputs, clear groups, reachable touch targets. */
/* Fixed action cluster: fire above boost; aim stays beside fire. */
body.nb-world-open .hero-world.nb-world-active .nb-vehicle-boost{left:auto!important;right:max(14px,env(safe-area-inset-right))!important;bottom:max(20px,env(safe-area-inset-bottom))!important;width:64px!important;height:64px!important;}
body.nb-world-open .hero-world.nb-world-active .nb-fire-button{left:auto!important;right:max(14px,env(safe-area-inset-right))!important;bottom:calc(max(20px,env(safe-area-inset-bottom)) + 78px)!important;width:64px!important;height:64px!important;transform:none!important;}
body.nb-world-open .hero-world.nb-world-active .nb-fire-button:hover{transform:scale(1.05)!important;}
body.nb-world-open .hero-world.nb-world-active .nb-aim-zoom{display:block;left:auto!important;right:calc(max(14px,env(safe-area-inset-right)) + 78px)!important;bottom:calc(max(20px,env(safe-area-inset-bottom)) + 82px)!important;}
.nb-world-active{--game-panel:#091a20ed;--game-line:#a4d9c244;--game-green:#81ec83;--game-orange:#ff963f}
.hero-world.nb-world-active .nb-mode-switch{border:1px solid var(--game-line);box-shadow:0 8px 24px #0003;backdrop-filter:blur(12px)}
body.nb-world-open .hero-world.nb-world-active :is(.nb-vehicle-boost,.nb-aim-zoom,.nb-fire-button){border:1px solid #c4e6d566;background:linear-gradient(145deg,#18312fef,#09171bef);box-shadow:inset 0 1px #ffffff1a,0 5px 18px #0005;color:#f5fff8;font:800 11px system-ui;letter-spacing:.04em;touch-action:none}
body.nb-world-open .hero-world.nb-world-active .nb-vehicle-boost{border-color:var(--game-orange);color:#ffb16e}
body.nb-world-open .hero-world.nb-world-active .nb-fire-button{border:2px solid var(--game-orange);background:linear-gradient(145deg,#a74415ed,#55270fee);color:#fff}
body.nb-world-open .hero-world.nb-world-active :is(.nb-vehicle-boost,.nb-aim-zoom,.nb-fire-button).active{background:#28623d;box-shadow:0 0 0 3px #81ec8340}
.nb-bike-tricks{display:none;position:absolute;right:18px;bottom:234px;z-index:45;gap:6px;padding:7px;border:1px solid var(--game-line);border-radius:15px;background:var(--game-panel);box-shadow:0 8px 24px #0003}
.hero-world.nb-world-active.nb-bike-mode:not(.nb-on-foot) .nb-bike-tricks{display:flex}
.nb-bike-tricks button{display:grid;place-content:center;gap:3px;min-width:44px;min-height:52px;padding:5px;border:1px solid #87bd9b55;border-radius:10px;background:#16312b;color:#eaffed;touch-action:none;user-select:none}
.nb-bike-tricks button span{font:500 26px/1 system-ui}.nb-bike-tricks button small{font:800 8px/1.2 system-ui;letter-spacing:.05em}
.nb-bike-tricks button.active{background:#39753e;border-color:#c2ffa5}
.hero-world.nb-world-active .nb-bike-actions{bottom:180px;right:18px;gap:7px;max-width:none;flex-wrap:nowrap}
.nb-bike-actions button{min-height:42px;padding:10px 12px;border-color:var(--game-line);border-radius:11px;background:var(--game-panel);font:800 10px system-ui;letter-spacing:.025em;box-shadow:0 5px 18px #0003}
.nb-bike-actions #nbBikeTrick{display:none}
.nb-puzzle-notes{position:absolute;right:16px;top:76px;z-index:43;border:1px solid #ff963f99;background:#101f20ed;color:#ffd1a3;border-radius:9px;padding:10px 13px;font:800 10px system-ui;letter-spacing:.05em;cursor:pointer}
.nb-puzzle-notes[hidden],.nb-battle-active .nb-puzzle-notes{display:none}
.hero-world.nb-world-active .nb-challenge-hud{top:122px!important;left:16px!important;bottom:auto!important;right:auto!important;max-width:230px;min-width:0!important;text-align:left;pointer-events:none}
/* Keep dialog actions visible while only the riddle text scrolls. */
body .nb-challenge-card{position:fixed!important;box-sizing:border-box;left:50%!important;top:50%!important;transform:translate(-50%,-50%)!important;width:min(620px,calc(100% - 24px))!important;max-height:calc(100dvh - max(24px,env(safe-area-inset-top)) - max(24px,env(safe-area-inset-bottom)))!important;display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;overflow:hidden!important;padding:clamp(16px,3vw,24px)!important;border-radius:16px;background:#09181bf5;box-shadow:0 24px 90px #0009,0 0 0 100vmax #0006}
body .nb-challenge-card[hidden]{display:none!important}
body .nb-challenge-card h3{font-size:clamp(20px,4vw,32px);margin:0 0 12px}
body .nb-challenge-copy{min-height:0;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;padding-right:8px;scrollbar-width:thin;scrollbar-color:#7bb78a #17272b}
body .nb-challenge-actions{margin-top:14px;padding-top:12px;border-top:1px solid #b6d7c72e;gap:8px;background:#09181b}
body .nb-challenge-actions button{min-height:44px;padding:10px 14px;font-size:11px}
body .nb-challenge-eyebrow{font-size:10px;line-height:1.5}
.nb-world-active button:focus-visible{outline:2px solid #e7ffb4;outline-offset:3px}
@media(max-width:900px),(pointer:coarse){
 .hero-world.nb-world-active .nb-bike-actions{right:10px;bottom:180px}
 .nb-bike-tricks{right:10px;bottom:232px;gap:5px;padding:6px}
 .hero-world.nb-world-active .nb-challenge-hud{top:110px!important;left:8px!important;max-width:210px}
 .nb-puzzle-notes{top:66px;right:8px;padding:10px}
}
@media(max-height:500px) and (orientation:landscape){
 .hero-world.nb-world-active .nb-bike-actions{bottom:174px;right:12px}
 .nb-bike-tricks{bottom:226px;right:12px;padding:5px}
 .nb-bike-tricks button{min-height:44px;min-width:44px}.nb-bike-tricks button span{font-size:21px}
 body .nb-challenge-card{width:min(640px,calc(100% - 32px))!important;max-height:calc(100dvh - 24px)!important;padding:14px 18px!important}
 body .nb-challenge-card h3{font-size:22px;margin-bottom:6px}
 body .nb-challenge-copy{font-size:12px;line-height:1.45}
 body .nb-challenge-actions{margin-top:8px;padding-top:8px}
 .hero-world.nb-world-active .nb-challenge-hud{top:110px!important;max-width:190px}
}
@media(max-width:650px) and (max-height:500px) and (orientation:landscape){
 body.nb-world-open .hero-world.nb-world-active:has(.nb-jet-mobile-controls.swapped) .nb-battle-hud{left:110px!important;right:auto!important;}
}
.hero-world.nb-world-active.nb-bike-mode:not(.nb-on-foot) .nb-bike-tricks{display:grid;grid-template-columns:repeat(4,44px)}
.nb-stunt-label{grid-column:1/-1;font:800 8px/1.3 system-ui;letter-spacing:.13em;color:#abceb9;padding:1px 2px 3px}
.nb-bike-tricks{touch-action:none;user-select:none;-webkit-user-select:none;}
.nb-stunt-label.landing-warning{color:#ffb16e}
.hero-world:has(#nbChallengeCard:not([hidden])) .nb-challenge-debug{display:none}
.nb-puzzle-intro-replay{font-size:10px!important}
/* Opening-page padding must not carry into the fixed game viewport. */
body.nb-world-open .hero-world.nb-world-active{padding:0!important;box-sizing:border-box!important;top:var(--nb-visible-top,0px)!important;bottom:auto!important;height:var(--nb-visible-height,100dvh)!important;}
body .nb-challenge-card,body .nb-battle-panel{max-height:calc(var(--nb-visible-height,100dvh) - 24px)!important;top:calc(var(--nb-visible-top,0px) + var(--nb-visible-height,100dvh)/2)!important;}
.nb-challenge-debug{left:16px!important;right:auto!important;bottom:100px!important}
@media(max-width:900px),(pointer:coarse){
 .hero-world.nb-world-active .nb-bike-actions{left:10px;right:auto;bottom:140px;flex-direction:column;width:88px}
 .hero-world.nb-world-active .nb-bike-actions button{padding:10px 6px;width:88px}
 .nb-bike-tricks{bottom:190px}
 .nb-challenge-debug{left:10px!important;bottom:252px!important;width:88px;padding:9px 5px!important;font-size:9px!important}
}
@media(max-height:500px) and (orientation:landscape){
 .nb-challenge-debug{left:350px!important;top:62px!important;bottom:auto!important;width:88px}
 .nb-bike-tricks{bottom:226px}
}
@media(max-width:900px),(pointer:coarse){
 .hero-world.nb-world-active.nb-bike-mode:has(.nb-jet-mobile-controls.swapped) .nb-bike-actions{left:auto;right:10px}
 .hero-world.nb-world-active.nb-bike-mode:has(.nb-jet-mobile-controls.swapped) .nb-bike-tricks{left:10px;right:auto}
 .hero-world.nb-world-active:has(.nb-jet-mobile-controls.swapped) .nb-challenge-debug{left:auto!important;right:10px!important}
}
body .nb-battle-panel{position:fixed;box-sizing:border-box;top:50%;left:50%;width:min(560px,calc(100% - 24px));max-height:calc(100dvh - 24px);display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;overflow:hidden;padding:20px}
body .nb-battle-panel[hidden]{display:none!important}
#nbBattleCopy{min-height:0;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;padding-right:5px}
body .nb-battle-actions{padding-top:12px;margin-top:12px;border-top:1px solid #b6d7c72e;background:#081713}
body .nb-battle-actions button{min-height:44px}
body .nb-jet-control-choice{max-height:calc(100dvh - 24px);overflow:auto;box-sizing:border-box}
.nb-settings-footer-actions{position:sticky;bottom:0;padding:8px 0;background:#071711;z-index:2}

/* Battle telemetry belongs in a corner, away from the aim line. */
.hero-world.nb-world-active .nb-battle-hud{box-sizing:border-box;left:auto;right:12px;top:66px;border-radius:11px;background:#081b1deb;box-shadow:0 5px 20px #0003}
@media(max-height:500px) and (orientation:landscape){
 .hero-world.nb-world-active .nb-battle-hud{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 6px;left:auto;right:10px;top:56px;width:240px;padding:6px 8px;font-size:9px}
 .hero-world.nb-world-active .nb-battle-hud[hidden]{display:none}
 .hero-world.nb-world-active .nb-battle-hud>div{grid-column:1/-1;min-height:28px}
 .hero-world.nb-world-active .nb-battle-hud>div b{font-size:9px;line-height:1.2}
 .hero-world.nb-world-active .nb-battle-hud>div button{min-height:28px;min-width:44px}
 .hero-world.nb-world-active .nb-battle-hud label{grid-column:1/-1;display:flex;align-items:center;gap:5px;margin:0;font-size:8px}
 .hero-world.nb-world-active .nb-battle-hud meter{flex:1;width:auto;min-width:30px;height:7px;margin:0}
 .hero-world.nb-world-active #nbBattleProgress{grid-column:1;margin:0;align-self:center;font-size:8px}
 .hero-world.nb-world-active #nbBattleAmmo{grid-column:2;grid-row:3/5;align-self:center;min-height:32px;font-size:8px}
 .hero-world.nb-world-active #nbBattleAmmo[hidden]{display:none}
 .hero-world.nb-world-active #nbBattleLock{grid-column:1;margin:0;font-size:8px}
 .hero-world.nb-world-active #nbBattleLock:empty{display:none}
 .hero-world.nb-world-active #nbBattleHint{display:none}
 .hero-world.nb-world-active .nb-bike-tricks{bottom:172px}
}
@media(max-width:650px) and (max-height:500px) and (orientation:landscape){
 .hero-world.nb-world-active .nb-battle-hud{width:120px;left:110px;right:auto;top:56px;padding:4px 6px;gap:1px 4px}
 .hero-world.nb-world-active .nb-battle-hud>div b{font-size:8px}
 .hero-world.nb-world-active .nb-bike-tricks{bottom:172px}
}
@media(max-width:650px) and (max-height:500px) and (orientation:landscape){
 .hero-world.nb-world-active:has(.nb-jet-mobile-controls.swapped) .nb-battle-hud{left:auto;right:110px}
}
@media(max-width:360px) and (orientation:portrait){
 .hero-world.nb-world-active .nb-battle-hud{top:94px}
 .hero-world.nb-world-active .nb-battle-launch{top:94px}
}

/* One action layout in every vehicle. Special controls occupy their own row. */
body.nb-world-open .hero-world.nb-world-active{--action-edge:max(12px,env(safe-area-inset-right));--action-base:max(16px,env(safe-area-inset-bottom));}
body.nb-world-open .hero-world.nb-world-active .nb-vehicle-boost{right:var(--action-edge)!important;bottom:var(--action-base)!important;}
body.nb-world-open .hero-world.nb-world-active .nb-fire-button{right:var(--action-edge)!important;bottom:calc(var(--action-base) + 76px)!important;}
body.nb-world-open .hero-world.nb-world-active.nb-bike-mode .nb-fire-button{display:flex!important;align-items:center;justify-content:center;opacity:1!important;visibility:visible!important;pointer-events:auto!important;}
body.nb-world-open .hero-world.nb-world-active.nb-bike-mode .nb-crosshair{display:flex!important;opacity:1!important;visibility:visible!important;}
body.nb-world-open .hero-world.nb-world-active .nb-aim-zoom{right:calc(var(--action-edge) + 76px)!important;bottom:calc(var(--action-base) + 80px)!important;}
body.nb-world-open .hero-world.nb-world-active .nb-jet-stick{left:max(12px,env(safe-area-inset-left))!important;right:auto!important;bottom:var(--action-base)!important;}
body.nb-world-open .hero-world.nb-world-active .nb-sub-mobile-controls{left:auto!important;right:var(--action-edge)!important;bottom:calc(var(--action-base) + 166px)!important;width:auto!important;}
body.nb-world-open .hero-world.nb-world-active.nb-sub-mode .nb-sub-mobile-controls{display:flex;}
body.nb-world-open .hero-world.nb-world-active .nb-sub-depth{display:flex;gap:8px;margin:0!important;}
body.nb-world-open .hero-world.nb-world-active .nb-sub-depth button{width:74px;min-width:74px;height:44px;min-height:44px;border:1px solid #c4e6d566;border-radius:11px;background:#10252ded;color:#f5fff8;font:800 10px system-ui;}
body.nb-world-open .hero-world.nb-world-active .nb-bike-tricks{left:auto!important;right:var(--action-edge)!important;bottom:calc(var(--action-base) + 166px)!important;grid-template-columns:repeat(4,40px);gap:4px;padding:6px;}
body.nb-world-open .hero-world.nb-world-active .nb-bike-tricks button{width:40px;min-width:40px;height:48px;min-height:48px;}
body.nb-world-open .hero-world.nb-world-active .nb-bike-actions{left:max(12px,env(safe-area-inset-left))!important;right:auto!important;bottom:calc(var(--action-base) + 146px)!important;flex-direction:column;gap:8px;width:88px;}
body.nb-world-open .hero-world.nb-world-active .nb-bike-actions button{width:88px;min-height:44px;padding:8px 4px;}
body.nb-world-open .hero-world.nb-world-active .nb-challenge-debug{bottom:calc(var(--action-base) + 254px)!important;}
@media(max-height:500px) and (orientation:landscape){
 body.nb-world-open .hero-world.nb-world-active .nb-bike-tricks{right:auto!important;left:50%!important;transform:translateX(-50%);bottom:var(--action-base)!important;}
 body.nb-world-open .hero-world.nb-world-active .nb-bike-actions{left:calc(50% - 40px)!important;top:62px!important;bottom:auto!important;flex-direction:row;width:auto;}
 body.nb-world-open .hero-world.nb-world-active .nb-sub-mobile-controls{right:auto!important;left:50%!important;transform:translateX(-50%);bottom:var(--action-base)!important;}
 body.nb-world-open .hero-world.nb-world-active .nb-challenge-debug{left:130px!important;right:auto!important;top:62px!important;bottom:auto!important;}
}
