/* Zyvora phone-first playable layout: portrait + landscape, no forced rotation. */
:root{--zv-safe-bottom:env(safe-area-inset-bottom,0px)}
html,body{max-width:100%;min-width:0;overflow-x:clip}
.site-nav,.game-shell,.game-header,.game-actions,.stage,.overlay,.modal{min-width:0}
.game-shell{width:100%;max-width:1480px}
.game-header{flex-wrap:wrap}
.game-actions{min-width:0;max-width:100%;justify-content:flex-end}
.game-actions .small-btn{white-space:nowrap}
.stage{max-width:100%;min-height:0}
.overlay{width:100%;max-width:100%;overscroll-behavior:contain}
.modal{max-width:min(550px,100%);min-width:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain}
.modal p,.modal h2,.controls-info{overflow-wrap:anywhere}
#zv-fullscreen{border-color:#a7efaf91;background:linear-gradient(145deg,#173943,#142838);color:#d1ffe8}
#zv-fullscreen[aria-pressed=true]{background:#315c4d}
.hud-pill{min-width:0;max-width:100%;white-space:normal}
#hud-extra{overflow:hidden;text-overflow:ellipsis}
.touch-controls{padding-bottom:var(--zv-safe-bottom)}
.touch-btn{min-width:0;min-height:0}
.stage:after{content:"";position:absolute;z-index:3;inset:0;pointer-events:none;box-shadow:inset 0 0 46px #080f1f33,inset 0 -18px 40px #060a1680}
.stage .v4-atmosphere{background:radial-gradient(ellipse at 58% 16%,#c7e8ff19,transparent 45%),radial-gradient(ellipse at 16% 82%,#466a9d22,transparent 64%),linear-gradient(180deg,#05112610,transparent 36%,#01041058 100%)}
.modal{background:linear-gradient(148deg,#172641f5,#080e21fa);border-color:#9ac3ed56;box-shadow:0 16px 60px #01040dc4,0 0 0 1px #a6f5ff10}
.modal .cta{background:linear-gradient(110deg,#bafc73,#89f3cf);box-shadow:0 5px 22px #a8ff7c28}
@media(max-width:640px) and (orientation:portrait){
 .site-nav{height:48px;padding:0 4vw}
 .brand{font-size:1rem}
 .game-shell{padding:8px 8px 24px}
 .game-header{display:flex;gap:6px;margin-bottom:8px}
 .game-header h1{font-size:1.05rem;flex:1 0 100%;min-width:0}
 .game-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;width:100%;max-width:100%}
 .game-actions .small-btn{padding:7px 3px;font-size:.67rem;text-align:center;line-height:1.2;min-width:0;white-space:nowrap}
 .stage{height:clamp(440px,73dvh,810px);border-radius:14px;min-height:0}
 .overlay{align-items:center;justify-content:center;padding:9px}
 .modal{width:100%;max-width:100%;max-height:calc(100% - 8px);padding:clamp(11px,3.2vw,18px);border-radius:17px}
 .modal h2{font-size:clamp(1.35rem,5vw,1.72rem);margin-bottom:7px}
 .modal p{font-size:.76rem;line-height:1.38;margin:8px 0}
 .modal .cta{padding:11px 10px;margin-top:8px;font-size:.86rem}
 .level-grid{grid-template-columns:repeat(5,minmax(0,1fr));max-height:25dvh}
 .choice-row{gap:5px;margin:9px 0}
 .choice{padding:8px 4px;font-size:.66rem}
 .touch-controls{display:flex;align-items:flex-end;justify-content:space-between;left:8px;right:8px;bottom:8px;gap:5px}
 .joystick{width:96px;height:96px;flex-basis:96px}
 .stick-thumb{width:46px;height:46px}
 .actpad{display:grid;grid-template-columns:repeat(3,minmax(0,44px));max-width:142px;gap:5px;align-items:end;justify-content:end}
 .actpad .touch-btn,.actpad .touch-btn.elite-btn{width:44px!important;height:44px!important;font-size:.52rem!important;line-height:1.05;padding:2px!important;border-radius:13px}
 .dpad{grid-template-columns:repeat(3,40px);grid-template-rows:repeat(2,40px);gap:3px}
 .hud{top:7px;left:7px;right:7px;gap:4px;max-width:calc(100% - 14px)}
 .hud-pill{padding:5px 6px;font-size:.59rem;border-radius:7px}
 #hud-extra{max-width:calc(100vw - 36px);white-space:nowrap}
 .objective{top:72px;left:8px;max-width:calc(100% - 16px);font-size:.65rem;line-height:1.3}
 .controls-info{font-size:.7rem}
}
@media(max-width:350px) and (orientation:portrait){
 .game-actions .small-btn{font-size:.60rem}
 .joystick{width:82px;height:82px;flex-basis:82px}
 .actpad{grid-template-columns:repeat(3,38px);max-width:124px}
 .actpad .touch-btn,.actpad .touch-btn.elite-btn{width:38px!important;height:38px!important;font-size:.47rem!important}
}
@media(orientation:landscape) and (max-height:600px){
 .site-nav{height:28px;padding:0 12px}
 .brand{font-size:.9rem}
 .game-shell{padding:4px 8px 2px;max-width:none}
 .game-header{height:34px;flex-wrap:nowrap;gap:6px;margin-bottom:4px}
 .game-header h1{flex:0 1 auto;font-size:.94rem;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .game-actions{gap:4px;flex:0 1 auto;max-width:76%;flex-wrap:nowrap}
 .game-actions .small-btn{font-size:.62rem;padding:6px 7px;border-radius:7px}
 .stage{height:calc(100dvh - 74px);min-height:190px;border-radius:10px}
 .overlay{align-items:center;justify-content:center;padding:5px}
 .modal{width:min(460px,70vw);max-height:calc(100% - 2px);padding:8px 14px;border-radius:14px}
 .modal h2{font-size:1.12rem;margin:3px 0}
 .modal p{font-size:.66rem;line-height:1.23;margin:4px 0}
 .modal .eyebrow{margin:3px 0;font-size:.6rem}
 .modal .cta{padding:8px;font-size:.74rem;margin-top:4px;border-radius:8px}
 .choice-row{gap:3px;margin:5px 0}
 .choice{padding:5px 2px;font-size:.58rem}
 .choice strong{font-size:.7rem;margin:2px}
 .level-grid{max-height:42vh;gap:3px}
 .hud{top:5px;left:6px;gap:3px;max-width:calc(100% - 12px)}
 .hud-pill{padding:3px 5px;font-size:.53rem;border-radius:6px}
 #hud-extra{max-width:62vw;white-space:nowrap}
 .objective{top:37px;left:6px;max-width:70%;font-size:.55rem;line-height:1.25;padding:3px 6px}
 .touch-controls{display:flex;left:9px;right:9px;bottom:6px;padding-bottom:0}
 .joystick{width:75px;height:75px;flex-basis:75px}
 .stick-ring{inset:12px}
 .stick-thumb{width:38px;height:38px}
 .dpad{grid-template-columns:repeat(3,34px);grid-template-rows:repeat(2,34px);gap:3px}
 .actpad{max-width:275px;display:flex;flex-wrap:wrap;gap:5px}
 .actpad .touch-btn,.actpad .touch-btn.elite-btn{width:39px!important;height:39px!important;font-size:.48rem!important;padding:1px!important}
 .controls-info{display:none}
 .v4-intro{top:32%;padding:7px}
 .v4-intro strong{font-size:1.2rem}
 .v4-intro small{font-size:.63rem}
}
@media(orientation:landscape) and (max-height:340px){
 .site-nav{display:none}
 .stage{height:calc(100dvh - 48px)}
 .modal{max-height:100%;padding:5px 10px}
 .modal p{font-size:.61rem}
}
.game-shell:fullscreen,
body.zyvora-immersive .game-shell{position:fixed;inset:0;z-index:100000;width:100%;max-width:none;height:100dvh;margin:0;background:#050a17;padding:env(safe-area-inset-top,5px) 7px env(safe-area-inset-bottom,5px);overflow:hidden}
body.zyvora-immersive{overflow:hidden}
body.zyvora-immersive .site-nav{display:none}
.game-shell:fullscreen .game-header,body.zyvora-immersive .game-header{margin:0 0 4px}
.game-shell:fullscreen .stage,body.zyvora-immersive .stage{height:calc(100dvh - 62px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));min-height:0}
@media(orientation:portrait) and (max-width:640px){
 .game-shell:fullscreen .stage,body.zyvora-immersive .stage{height:calc(100dvh - 109px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))}
}
@media(prefers-reduced-motion:reduce){.v4-intro.show{animation:none!important;opacity:1;transform:none}.stage .v4-atmosphere:after{opacity:0}}
