/* v1.2: page navigation uses the browser scrollbar; gameplay remains fixed. */
html.tb-document-page,html.tb-document-page body{height:auto!important;min-height:100%;overflow-y:auto!important;overflow-x:clip!important}
html.tb-document-page #canvas-container{position:fixed!important}
html.tb-document-page #typhoon-stage-interlude{position:relative!important;inset:auto!important;min-height:100dvh;display:block!important;overflow:visible!important;padding:32px 20px!important}
#typhoon-stage-interlude .tb-journey-shell{width:min(1080px,100%)!important;max-height:none!important;height:auto!important;overflow:visible!important;border:0!important;box-shadow:none!important;background:none!important;border-radius:0!important;margin:0 auto;padding:0!important}
#typhoon-stage-interlude h1.game-brand{font-size:clamp(24px,4vw,56px)!important;white-space:nowrap!important}
/* Shared wordmark scales; desktop Journey title remains one line. */
#leaderboard-page>div.game-brand,#typhoon-stage-interlude h1.game-brand{font-size:clamp(22px,4vw,56px)!important;letter-spacing:-.045em!important;line-height:1.04!important}
#touch-rotate{position:fixed;inset:0;z-index:12000;display:flex;align-items:center;justify-content:center;padding:32px;text-align:center;background:#071525f5;color:white;font:700 24px system-ui}#touch-rotate[hidden]{display:none!important}
html.tb-touch #game-ui>div:first-child>div:first-child{display:none!important}
html.tb-touch #tb-life-hud{top:max(8px,env(safe-area-inset-top))!important;bottom:auto!important;left:max(8px,env(safe-area-inset-left))!important;width:auto!important;min-width:104px;padding:7px 12px!important;background:#08152599!important;font-size:10px!important}
html.tb-touch #tb-life-value{display:block;float:none!important;font-size:28px!important;line-height:1.1;color:white}html.tb-touch #tb-life-track{display:none}
html.tb-touch #ammo-floating-hud{top:max(8px,env(safe-area-inset-top))!important;bottom:auto!important;left:auto!important;right:max(8px,env(safe-area-inset-right))!important;width:auto!important;min-width:104px;padding:7px 12px!important;background:#08152599!important;text-align:right}
html.tb-touch #ammo-display{font-size:28px!important;line-height:1.1}html.tb-touch #ammo-floating-hud .flex{display:block!important}html.tb-touch #ammo-floating-hud .flex>span:last-child,html.tb-touch #ammo-status{display:none}
html.tb-touch #neon-side-hud,html.tb-touch #tb-touch-hint{display:none!important}
html.tb-touch #tb-mobile-h{left:max(10px,env(safe-area-inset-left))!important;right:auto!important;bottom:max(10px,env(safe-area-inset-bottom))!important;width:60px!important;height:60px;min-width:44px;border-radius:50%;padding:3px;background:#17364b99}
html.tb-touch #tb-mobile-h>span{display:block;font-size:26px;line-height:1}html.tb-touch #tb-mobile-h>small{display:block;font-size:8px;line-height:1.1}
html.tb-touch #tb-mobile-pause{right:max(10px,env(safe-area-inset-right))!important;bottom:max(10px,env(safe-area-inset-bottom))!important;width:48px!important;min-width:44px;height:48px;min-height:44px;border-radius:50%;padding:0;background:#17364b99;font-size:24px}
html.tb-touch #game-ui>div:last-child{position:fixed;left:50%;transform:translateX(-50%);bottom:max(8px,env(safe-area-inset-bottom));width:min(56vw,440px)!important;margin:0!important}html.tb-touch #game-ui>div:last-child>div{background:#08152599!important}
html.tb-touch #demo-custom-hud>div:nth-child(2){left:50%!important;transform:translateX(-50%)!important;width:calc(100% - 160px)!important;max-width:560px;bottom:10px!important}html.tb-touch #demo-top-label{top:82px!important;font-size:12px!important}
.review-navigation{display:flex;gap:12px;margin:12px 0}.reviews-entry{display:inline-block;padding:10px 14px;color:#a8f2fa;border:1px solid #526e84;border-radius:10px;text-align:center}
html.tb-document-page #leaderboard-page{position:relative!important;inset:auto!important;display:flex;min-height:100dvh;height:auto!important;max-height:none!important;overflow:visible!important;padding:32px 20px!important;gap:14px}
html.tb-document-page #leaderboard-page-list{width:min(960px,100%)!important;max-width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;border:0!important;background:none!important;box-shadow:none!important;backdrop-filter:none!important;border-radius:0!important;padding:0!important;flex-shrink:0!important}
html.tb-document-page #leaderboard-page-list li{overflow:visible!important;white-space:normal!important;overflow-wrap:anywhere;padding:12px!important;margin:7px 0!important}
body[data-page="journey"] #leaderboard-page{display:none!important}body[data-page="leaderboard"] #typhoon-stage-interlude{display:none!important}
html.tb-document-page #leaderboard-page-list{list-style:none!important;text-align:left!important}

/* v1.5 shared compact cards; public sequential target only. */
#typhoon-stage-interlude .journey-row{padding:6px 12px;gap:2px 12px}
#typhoon-stage-interlude .journey-controls{margin-top:0}
#typhoon-stage-interlude .journey-controls button{min-height:36px!important;padding:6px 10px!important}
#typhoon-stage-interlude .journey-state{position:static;font-size:10px;grid-column:1;grid-row:3}
#typhoon-stage-interlude .journey-controls{grid-row:1 / span 3}
#typhoon-stage-interlude .journey-next{border-color:#ffe16b;box-shadow:0 0 0 1px #ffe16b}
@media(max-width:650px){#typhoon-stage-interlude .journey-row{grid-template-columns:1fr auto;padding:7px 10px}#typhoon-stage-interlude .journey-controls{grid-column:2;grid-row:1 / span 3;display:flex;flex-direction:column;gap:4px}#typhoon-stage-interlude .journey-controls button{min-width:92px!important;min-height:36px!important;font-size:11px!important}#typhoon-stage-interlude .journey-row p{grid-column:1;font-size:12px}#typhoon-stage-interlude .journey-row h3{font-size:16px}}

#typhoon-stage-interlude .journey-row p{margin:0!important}
#typhoon-stage-interlude .journey-state{position:absolute;top:auto;bottom:2px;right:12px;line-height:12px}
#typhoon-stage-interlude .journey-controls{grid-row:1 / span 2;margin-bottom:12px}

/* v1.5 independent two-thumb controls; gameplay movement remains scripted. */
.tb-touch-pad{display:none}html.tb-touch .tb-touch-pad{position:fixed;z-index:9100;display:flex;align-items:center;justify-content:center;width:76px;height:76px;border-radius:50%;border:1px solid #a4e6f799;background:#102d4266;color:#e6faff;font:700 13px system-ui;touch-action:none;user-select:none}html.tb-touch .tb-touch-pad[hidden]{display:none!important}html.tb-touch #tb-mobile-aim{left:max(82px,env(safe-area-inset-left));bottom:82px}html.tb-touch #tb-mobile-fire{right:max(22px,env(safe-area-inset-right));bottom:82px}html.tb-touch #tb-mobile-pause{left:50%!important;right:auto!important;top:max(6px,env(safe-area-inset-top))!important;bottom:auto!important;transform:translateX(-50%);width:44px!important;height:44px!important;font-size:20px;background:#17364b66}

/* v1.6 area ratio: (76*sqrt(2))²/76² = 2. Visual fade never disables hit testing. */
html.tb-touch .tb-touch-pad{width:107.48px;height:107.48px;transition:opacity .5s}html.tb-touch #tb-mobile-aim{left:max(16px,env(safe-area-inset-left));bottom:90px}html.tb-touch #tb-mobile-fire{right:max(16px,env(safe-area-inset-right));bottom:90px}html.tb-touch .tb-touch-pad[data-guide="off"]{opacity:.04}html.tb-touch #tb-mobile-h{left:auto!important;right:max(10px,env(safe-area-inset-right))!important}

/* CR36: only desktop/fine pointer or landscape. Portrait touch remains v57 layout. */
@media(pointer:fine),(orientation:landscape){#typhoon-stage-interlude .journey-row{grid-template-columns:minmax(0,1fr) auto auto;min-height:42px;padding:2px 10px;gap:0 12px}#typhoon-stage-interlude .journey-row h3{font-size:18px;line-height:20px;grid-column:1;grid-row:1}#typhoon-stage-interlude .journey-row p{font-size:12px;line-height:14px;grid-column:1;grid-row:2}#typhoon-stage-interlude .journey-state{position:static;grid-column:2;grid-row:1 / span 2;align-self:center}#typhoon-stage-interlude .journey-controls{grid-column:3;grid-row:1 / span 2;flex-direction:row;margin:0;gap:6px}#typhoon-stage-interlude .journey-controls button{min-height:36px!important;padding:5px 9px!important} }
@media(orientation:landscape) and (max-width:650px){#typhoon-stage-interlude .journey-row{min-height:70px;gap:0 6px}#typhoon-stage-interlude .journey-row h3{font-size:16px}#typhoon-stage-interlude .journey-row p{font-size:11px}#typhoon-stage-interlude .journey-controls button{min-width:80px!important}}

@media(pointer:fine) and (orientation:portrait) and (max-width:650px){#typhoon-stage-interlude .journey-row{grid-template-columns:minmax(0,1fr) auto;min-height:104px;padding:7px 10px;gap:2px 6px}#typhoon-stage-interlude .journey-row h3{font-size:16px}#typhoon-stage-interlude .journey-row p{font-size:12px}#typhoon-stage-interlude .journey-state{grid-column:1;grid-row:3}#typhoon-stage-interlude .journey-controls{grid-column:2;grid-row:1 / span 3;flex-direction:column}#typhoon-stage-interlude .journey-controls button{min-width:92px!important}}

html.tb-touch #tb-mobile-aim,html.tb-touch #tb-mobile-fire{bottom:calc(90px + env(safe-area-inset-bottom))}
/* P17-04: quarter-ellipse fan, 2x the previous circular usable area. No dark sketch outlines. */
html.tb-touch #tb-mobile-aim{width:var(--aim-fan-width,192.26px);height:var(--aim-fan-height,120.16px);border:0;border-radius:0;clip-path:ellipse(100% 100% at 0% 100%);background:radial-gradient(ellipse at left bottom,#46d9f044,#102d4222);box-sizing:border-box}

/* v1.9: responsive independent fan controls and compact safe-area HUD. */
html.tb-touch #tb-mobile-fire{width:var(--fire-fan-width);height:var(--fire-fan-height);right:env(safe-area-inset-right);bottom:env(safe-area-inset-bottom);border:0;border-radius:0;clip-path:ellipse(100% 100% at 100% 100%);background:radial-gradient(ellipse at right bottom,#46d9f044,#102d4222);box-sizing:border-box}
html.tb-touch #tb-mobile-h{right:calc(env(safe-area-inset-right) + var(--rescue-right))!important;bottom:calc(env(safe-area-inset-bottom) + var(--rescue-bottom))!important;width:120px!important;height:120px!important;min-height:120px}
html.tb-touch #tb-life-hud{min-width:88px;box-sizing:border-box;width:88px!important;padding:5px 9px!important;background:#08152566!important}
html.tb-touch #tb-life-value,html.tb-touch #ammo-display{font-size:18.6667px!important;line-height:1.1!important}
html.tb-touch #ammo-floating-hud{min-width:96px;box-sizing:border-box;padding:5px 9px!important;background:#08152566!important}
html.tb-touch #neon-side-hud{display:block!important;top:max(8px,env(safe-area-inset-top))!important;left:calc(max(8px,env(safe-area-inset-left)) + 94px)!important;min-width:88px;width:88px;box-sizing:border-box;padding:5px 6px!important;border-width:1px;border-radius:10px;box-shadow:none;background:#08152599!important}
html.tb-touch #neon-side-hud[hidden]{display:none!important}
html.tb-touch #neon-side-hud>div:first-child{font-size:0!important;letter-spacing:0!important}
html.tb-touch #neon-side-hud>div:first-child::after{content:'NEON';font-size:10px}
html.tb-touch #gold-count-display{font-size:22px!important;line-height:1.1}
html.tb-touch #tb-life-value{white-space:nowrap}
html.tb-touch #neon-side-state{display:none}
html.tb-touch #weapon-hud{display:none!important}
html.tb-touch #game-ui>div:last-child{width:min(34vw,260px)!important;left:calc(var(--stack-center) - env(safe-area-inset-right))!important}
html.tb-touch #demo-custom-hud>div:nth-child(2){width:min(34vw,260px)!important;left:var(--stack-center)!important}
@media(pointer:fine),(orientation:landscape){#typhoon-stage-interlude .journey-rows{width:66.666667%;margin-inline:auto}#typhoon-stage-interlude .journey-row{grid-template-columns:minmax(0,1fr) auto;gap:2px 8px}#typhoon-stage-interlude .journey-state{grid-column:1;grid-row:3;font-size:10px}#typhoon-stage-interlude .journey-controls{grid-column:2;grid-row:1 / span 3}}
@media(orientation:landscape) and (max-width:900px){#typhoon-stage-interlude .journey-controls{flex-direction:column;gap:4px}#typhoon-stage-interlude .journey-controls button{min-width:80px!important}#typhoon-stage-interlude .journey-row h3{font-size:16px}#typhoon-stage-interlude .journey-row p{font-size:11px}}
@media(orientation:portrait) and (max-width:650px){#typhoon-stage-interlude .journey-rows{width:100%;margin-inline:auto}}
/* Ending's existing content must fit short touch landscapes without clipping controls. */
@media(orientation:landscape) and (max-height:500px){
 html.tb-touch #victory-overlay{padding:10px 12px!important;gap:6px;overflow-y:auto}
 html.tb-touch #victory-overlay>div:first-child{font-size:12px;line-height:16px;margin:0}
 html.tb-touch #victory-overlay>h2{font-size:28px!important;line-height:1.08!important;padding:6px 12px!important;margin:0!important}
 html.tb-touch #victory-overlay>p{font-size:14px;line-height:18px;margin:0!important}
 html.tb-touch #victory-overlay>div.bg-slate-900\/80{padding:10px!important;margin:0!important}
 html.tb-touch #victory-score-val{font-size:32px;line-height:1.1}
 html.tb-touch #victory-restart-btn{min-height:44px;padding:8px 20px;font-size:16px}
 html.tb-touch #victory-overlay>[data-feedback-link]{position:static!important;transform:none!important;min-height:28px;padding:4px 8px}
 html.tb-touch body:has(#victory-overlay:not(.hidden)) #game-ui{visibility:hidden}
}

/* v2.0 CR20-02/09/10/11 */
html:not(.tb-touch) #game-ui div:has(>#stage-reward-hud){display:none!important}
html.tb-touch #stage-rank-card{box-sizing:border-box!important;width:min(92vw,700px)!important;max-width:92vw!important;min-width:0!important;white-space:pre-line!important;overflow-wrap:anywhere!important;flex-shrink:0;padding:12px!important}
html.tb-touch #tb-mobile-aim{left:0!important;bottom:0!important;height:calc(var(--aim-fan-height,120.16px) + 90px + env(safe-area-inset-bottom))!important}
html.tb-touch #tb-mobile-fire{right:0!important;bottom:0!important}
html.tb-touch #tb-mobile-aim,html.tb-touch #tb-mobile-fire{color:#ffae48!important;background:radial-gradient(ellipse at bottom,#ff8a0055,#50250022)!important;border-color:#ffae48!important}
html.tb-touch #tb-mobile-h{color:#ffcadf!important;border-color:#ff6b9b!important;background:#9d174d88!important}

html:not(.tb-touch) #game-ui .w-px:has(+div>#stage-reward-hud){display:none!important}

/* v2.2: independent rectangular hit regions; orange guidance stays at the base. */
html.tb-touch #tb-mobile-aim,html.tb-touch #tb-mobile-fire{height:70vh!important;clip-path:none!important;background:transparent!important;align-items:flex-end;padding-bottom:32px;box-sizing:border-box}
html.tb-touch #tb-mobile-aim{width:clamp(192.26px,28vw,300px)!important}
html.tb-touch #tb-mobile-aim::before,html.tb-touch #tb-mobile-fire::before{content:'';position:absolute;inset:auto 0 0;height:min(32vh,130px);background:radial-gradient(ellipse at bottom,#ff8a0055,#50250022);border:1px solid #ffae4866;border-radius:80% 80% 0 0;pointer-events:none}
body.tb-ad-speaking #tb-stage1-story,body.tb-ad-speaking #skeleton-voice-panel{visibility:hidden!important}

/* v2.3: visible fans never clip or intercept the expanded 70vh hit rectangles. */
html.tb-touch #tb-mobile-aim,html.tb-touch #tb-mobile-fire{background:transparent!important;border:0!important;clip-path:none!important;overflow:visible!important}html.tb-touch #tb-mobile-aim::before,html.tb-touch #tb-mobile-fire::before{content:'';position:absolute;inset:auto 0 0;height:90%;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 280' preserveAspectRatio='none'%3E%3Cpath d='M1 279 V2 A317 277 0 0 1 318 279 Z' fill='%23ff8a00' fill-opacity='.23' stroke='%23ffae48' stroke-opacity='.85' stroke-width='2'/%3E%3C/svg%3E") center/100% 100% no-repeat;border:0;border-radius:0;pointer-events:none}html.tb-touch #tb-mobile-fire::before{transform:scaleX(-1)}
/* Extend only the FIRE artwork around H Rescue; keep both existing hit rectangles. */
html.tb-touch #tb-mobile-fire::before{left:auto;right:0;width:calc(100% + 140px);height:100%;transform:scaleX(-1)}
html.tb-touch #tb-mobile-h{z-index:9101}
@media(orientation:landscape){html.tb-touch #stage-rank-card{width:min(61.333333vw,466.666667px)!important;max-width:calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right) - 24px)!important}}
@media(orientation:landscape){html.tb-touch #stage-clear-overlay{overflow-y:auto;justify-content:flex-start;padding-block:12px!important;box-sizing:border-box}html.tb-touch #stage-clear-overlay>*{flex-shrink:0}}
body.tb-ben-reunion #game-ui,
body.tb-ben-reunion #ammo-floating-hud {
  visibility: hidden;
}
#victory-overlay > h2 { background: transparent !important; border: 0 !important; color: white !important; backdrop-filter: none !important; }
html.tb-touch #victory-overlay.studio-logo-only{overflow:hidden!important;padding:0!important;gap:0!important;justify-content:center!important}
html.tb-touch #victory-overlay.studio-logo-only>[data-feedback-link]{position:absolute!important;width:1px!important;height:1px!important;min-height:0!important;padding:0!important;clip-path:inset(50%)!important}

/* Keep the approved studio mark below the existing start actions on short landscape screens. */
@media (orientation:landscape) and (max-height:500px){
 #start-overlay{justify-content:flex-start!important;overflow-y:auto!important;padding:8px 16px!important}
 #start-overlay .tb-edition{margin-bottom:4px!important}
 #start-overlay>h1[class]{font-size:clamp(30px,5vw,42px)!important;line-height:1!important;margin-bottom:0!important}
 #start-overlay label{margin-bottom:3px!important}
 #nickname-input{padding:8px 12px!important;margin-bottom:4px!important}
 #start-btn{min-height:46px!important;margin-bottom:4px!important}
 #start-overlay .start-feedback-button{margin-top:4px!important;padding:7px 14px!important;min-height:36px!important}
 #start-overlay>.studio-copyright{margin-top:-6px!important;margin-bottom:0!important}
 #start-studio-logo{margin-top:0!important}
}
@media (orientation:landscape) and (pointer:coarse){
 html.tb-touch #start-overlay{position:fixed!important;inset:0!important;width:100vw!important;height:100vh;height:100dvh!important;box-sizing:border-box!important;padding-top:max(8px,env(safe-area-inset-top))!important;padding-right:max(16px,env(safe-area-inset-right))!important;padding-bottom:max(8px,env(safe-area-inset-bottom))!important;padding-left:max(16px,env(safe-area-inset-left))!important;background:radial-gradient(ellipse at 15% 15%,rgba(36,78,128,.33),transparent 47%),radial-gradient(ellipse at 88% 86%,rgba(82,46,139,.31),transparent 45%),#040914!important;overflow-y:auto!important;overscroll-behavior:contain}
 html.tb-touch #start-overlay::after{width:min(60vw,70dvh)!important;height:min(60vw,70dvh)!important}
}
