/* Viewport-led layout. Last stylesheet intentionally supersedes old poster sizing. */
:root{--app-height:100vh;--app-width:100vw;--accent:#eac67e}@supports(height:100dvh){:root{--app-height:100dvh}}
html,body{height:100%;overflow:hidden;overscroll-behavior:none}#app{height:var(--app-height);width:100%;overflow:hidden;position:relative}button{flex-shrink:0;min-height:44px;min-width:44px}*,*:before,*:after{min-width:0}.screen{height:100%;min-height:0;max-width:740px;margin:0 auto;display:flex;flex-direction:column;gap:0;padding:calc(12px + env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));overflow:hidden;animation:screen-arrive .3s ease-out}.screen:before{height:100%;max-height:none}.screen:after{inset:5px;z-index:-1}.screen>nav{flex:none;margin:0 0 8px}.screen>.eyebrow{flex:none;font-size:11px;line-height:1.4;min-height:15px}.screen>h1{flex:none;font-size:clamp(20px,3.8dvh,30px);line-height:1.15;margin:6px 0 12px}.screen>h1:after{margin-top:8px}.screen>button.primary{margin:10px 0 0;min-height:52px;padding:12px 16px}.screen>.prose{margin:10px 0;font-size:clamp(14px,2dvh,17px);line-height:1.65}.screen-prologue{justify-content:flex-start}.screen-prologue>h1{margin:8px 0}.screen-prologue>.prose{flex:1;display:flex;align-items:center;padding:14px;margin:12px 0;font-size:clamp(14px,2dvh,17px);overflow:visible}.title-screen{height:auto;max-height:100%;width:min(100%,calc(var(--app-height)*.4609375));margin:auto}.title-reference{height:auto}.title-screen button{min-height:44px}
.screen-map{max-width:860px}.screen-map>h1{font-size:26px;margin:4px 0 5px}.map-progress{font-size:13px;line-height:1.3;margin:2px 0 10px;color:#d2c6ad}.resume-stage{min-height:44px;margin:0 0 8px;padding:8px;font-size:12px}.worlds{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr)) minmax(80px,.7fr);gap:9px;flex:1;min-height:0;margin:0}.world-card{height:auto;min-height:0;padding:9px 10px;display:grid;grid-template-rows:auto minmax(0,1fr) auto;align-items:stretch;overflow:hidden;gap:3px;border-radius:9px}.world-number{font-size:10px;letter-spacing:.06em;line-height:1.4}.world-card h2{font-size:clamp(14px,2.35dvh,20px);line-height:1.07;margin:4px 0;max-width:100%;align-self:center}.card-actions{display:flex;gap:4px;position:relative;z-index:2}.world-card button,.world-card .quiet{min-height:44px;height:44px;padding:5px 8px;margin:0;font-size:11px;line-height:1.1;min-width:44px;border-radius:6px}.card-actions>button:first-child{flex:1}.card-actions>.quiet{width:44px;flex:0 0 44px;font-size:18px}.world-card.classified{grid-column:1/-1;grid-template-columns:1fr auto;grid-template-rows:auto 1fr;gap:2px 10px;min-height:0;border-color:#be9bff;background:radial-gradient(ellipse at 70% 20%,#4c286caa,transparent 60%),radial-gradient(ellipse at 20% 90%,#107b7a88,transparent 65%),linear-gradient(105deg,#080c19,#302237,#0e2634);box-shadow:inset 0 0 24px #4a38b522,0 0 13px #b787ff33;filter:none}.classified:before{border-color:#c6b2ff66}.classified .world-number{grid-column:1}.classified h2{font-style:normal;letter-spacing:.06em;font-size:clamp(15px,2.4dvh,21px);max-width:80%;grid-column:1}.classified .card-actions{grid-row:1/3;grid-column:2;align-self:center}.question{font-size:90px;line-height:1;top:0;right:120px;color:#d2caff22;pointer-events:none}.map-footer{order:10;display:flex;justify-content:space-between;gap:6px;margin:10px 0 0!important}.map-footer button{flex:1;font-size:10px;padding:7px 5px;min-height:44px;margin:0}
.screen-intro .intro-scene{flex:1;min-height:60px;height:auto;margin:0 0 8px}.screen-intro>.prose{position:static;font-size:clamp(14px,1.95dvh,17px);line-height:1.55;margin:6px 0;padding:12px;flex:0 1 auto}.screen-intro>.prose:empty{display:none}
.screen-play{max-width:none;padding:calc(6px + env(safe-area-inset-top)) 0 env(safe-area-inset-bottom);border:0}.screen-play>nav{padding:0 10px;gap:8px;margin:0 0 3px}.screen-play>h1{font-size:17px;margin:2px 14px 7px;line-height:1.1}.screen-play>h1:after{display:none}.screen-play>.eyebrow{display:none}.game{position:relative;flex:1;width:100%;height:auto;max-width:none;min-height:0;min-width:0;display:flex;flex-direction:column;gap:8px;padding:12px 16px!important;margin:0!important;border:0;border-radius:0;overflow:hidden;background:#0a1115bb;box-shadow:none}.game>.prose{font-size:clamp(14px,2dvh,17px);line-height:1.6;flex:1;margin:8px 0;overflow:auto}.game>button{margin:2px 0}.game.running{padding:0!important;background:#080f13}.game.running>canvas{position:absolute;inset:0;width:100%!important;height:100%!important;aspect-ratio:auto;margin:0!important;border:0;border-radius:0;z-index:0}.game.running>h2{position:absolute;top:10px;left:14px;right:14px;z-index:2;font-size:18px;margin:0;padding:7px 10px;background:#061019a6;border-radius:6px;pointer-events:none}.game.running>.hud{position:absolute;top:52px;left:14px;right:14px;z-index:2;font-size:13px;line-height:1.4;min-height:0;margin:0;padding:8px 10px;color:#ffe6b6;background:#07121bd1;border:1px solid #d8b77066;border-radius:6px;pointer-events:none}.game.zone-sector>.hud,.game.zone-range>.hud{top:12px}.game.running>.hint{position:absolute;left:14px;right:14px;bottom:66px;z-index:2;font-size:14px;line-height:1.3;margin:0;padding:7px 9px;background:#07121bbd;border-radius:6px;pointer-events:none}.game.zone-sector>.hint{bottom:auto;top:65px}.game.zone-range>.hint{bottom:64px}.game.running>.toolbar{position:absolute;right:12px;bottom:12px;z-index:4;display:flex;gap:5px;margin:0;opacity:.78}.toolbar>button{font-size:10px;font-weight:500;min-height:44px;min-width:44px;padding:8px;background:#09131bb5;border:1px solid #b3a47b77;box-shadow:none}.game.running>.actions{position:absolute;left:14px;right:14px;bottom:66px;display:flex;gap:12px;z-index:4;margin:0}.game.running>.actions button{min-height:52px;background:#102936d9;border-color:#a2d5d6}.game.world-rush>.hint{top:100px;bottom:auto}.game.running>.fightActions{position:absolute;bottom:65px;left:14px;right:14px;z-index:4;margin:0;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.game.running>.fightPrompt{position:absolute;top:110px;left:14px;right:14px;z-index:3;font-size:15px;line-height:1.5;min-height:70px;padding:10px;background:#070f17da;pointer-events:none}.game.world-fight>.hint{display:none}.game.world-fight>button:not(.primary){position:absolute;bottom:195px;left:14px;right:14px;z-index:3;width:auto;min-height:44px;font-size:12px;margin:0;background:#0a141ed9}.game.world-fight>button:last-child{z-index:6}.game.running .notice{position:absolute;inset:22% 14px auto;z-index:10;background:#111a22f5;border-radius:12px;box-shadow:0 8px 40px #000}.game.running .notice button{width:100%}.zone-sector .joystick{position:absolute;left:18px;bottom:18px;width:100px;height:100px;margin:0;z-index:4}.transition-note{font-size:16px;color:#c9d7d1;line-height:1.6}.zone-sector:not(.running){justify-content:center;text-align:center}.zone-sector:not(.running)>.primary{margin-top:20px}.stage-gate{justify-content:flex-start}.gate-art{flex:1;min-height:90px;border:1px solid #b79761;border-radius:12px;background-image:url('../assets/adventure-atlas.webp');background-size:300% 300%}.wave-art{background-position:50% 50%}.road-art{background-position:100% 50%}.stage-gate>h2{text-align:center;font-size:24px}
.game.world-chess{justify-content:center;overflow:hidden}.game.world-chess>.hint{font-size:14px;line-height:1.4;margin:5px 0}.game.world-chess h2{font-size:20px;margin:3px 0}.chessboard{width:min(100%,calc(var(--app-height) - 265px));max-width:480px;margin:0 auto;align-self:center;flex:0 1 auto}.square{min-height:0;min-width:0;box-shadow:none}.chess-success{position:absolute;left:16px;right:16px;top:20%;z-index:8;background:#101a25f5;border:1px solid #d0b276;border-radius:12px;padding:24px;box-shadow:0 12px 50px #000b;text-align:center}.chess-success h3{font-size:22px;line-height:1.3;color:#b8f9ca}.chess-success .primary{width:100%}.game.world-chess.solved>.hint{visibility:hidden}.game.world-passion,.game.world-engineer{gap:6px}.game .riddle{font-size:clamp(16px,2.5dvh,20px);line-height:1.5;margin:8px 0}.choices{gap:9px}.choices button,.world-engineer>button{min-height:44px;font-size:14px;margin:3px 0}.diagnostic{padding:8px;margin:0;max-height:30%;flex:0 1 auto;overflow:hidden}.diagnostic-image{height:100%;max-height:140px;width:100%;object-fit:contain;margin:0}.diagnostic>span{display:block}.world-passion>p[role=status],.world-engineer>p[role=status]{font-size:14px;margin:4px 0;min-height:20px}
.screen-stats>.emblem{height:64px;width:64px;min-height:0;margin:0 auto 4px}.screen-stats .mission-title{font-size:22px;margin:4px 0 10px}.stats-grid{flex:1;min-height:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(0,1fr);gap:9px}.stats-panel{min-height:0;background:#08111ad9;border:1px solid #a9915d66;border-radius:8px;padding:9px}.stats-panel h3{font-size:11px;line-height:1.3;margin:0 0 6px}.stats{display:grid;grid-template-columns:1fr auto;gap:3px 8px;padding:0;margin:0;font-size:14px;line-height:1.5;border:0;background:none;box-shadow:none}.stats dd{font-variant-numeric:tabular-nums}.stats-summary{font-size:12px;line-height:1.5;margin:8px 0 0;color:#dac6a0}.screen-stats>button{margin-top:10px!important}
.screen-fragment{--fragment-color:#61ffb0;text-align:center;justify-content:flex-start}.fragment-reveal{position:relative;flex:1;min-height:90px;display:grid;place-items:center;isolation:isolate}.fragment-piece{position:relative;width:min(100%,320px);height:100%;max-height:340px;object-fit:contain;filter:drop-shadow(0 0 17px var(--fragment-color));animation:fragment-arrival 1.15s cubic-bezier(.2,.75,.2,1) both}.fragment-aura{position:absolute;width:min(100%,270px);aspect-ratio:1;border-radius:50%;background:radial-gradient(ellipse,var(--fragment-color),transparent 70%);opacity:.14;animation:gem-breathe 3s infinite alternate}.fragment-0{--fragment-color:#61ffb0}.fragment-1{--fragment-color:#73d8ff}.fragment-2{--fragment-color:#c6b9ff}.fragment-3{--fragment-color:#ff9665}.fragment-4{--fragment-color:#ef9fdf}.fragment-5{--fragment-color:#ffd578}.quality-title{font-size:clamp(25px,4.5dvh,38px)!important;line-height:1.1;color:#ffe3a3;text-shadow:0 0 20px #efbf5955;margin:15px 0 20px}
.screen-letter>.letter-paper,.screen-secret>.letter-paper{position:relative;display:flex;flex-direction:column;flex:1;min-height:0;margin:0;padding:16px;background:linear-gradient(145deg,#19232eeb,#101922ef);color:#efece5;border:1px solid #b7a17566;border-radius:12px;box-shadow:inset 0 0 28px #0002}.letter-paper:before{display:none}.letter-paper .prose{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:0;padding:0 6px 10px 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;font-size:17px;line-height:1.8;color:inherit;text-shadow:none}.screen-secret>h1{font-size:29px;font-weight:500;color:#f9e5c5}.screen-secret>.eyebrow:empty{display:none}.screen-secret>.final-letter{background:radial-gradient(ellipse at top,#8a673025,#101722ed 75%);border-color:#cfb98a66;box-shadow:0 0 40px #e2ae4014}.final-letter .prose{animation:screen-arrive .8s ease-out}.final-continue{align-self:flex-end;background:transparent!important;border:0;border-bottom:1px solid #c4ac7a77;border-radius:0;box-shadow:none;color:#f5dbad;font-size:18px;font-weight:400;padding:12px 4px;min-height:48px;margin-top:10px;text-shadow:0 0 18px #c4974155}.screen-gift>.emblem{width:110px;height:110px;margin:12px auto}.screen-gift>h2{text-align:center;font-size:26px;line-height:1.2;margin:12px 0}.screen-gift>.prose{flex:1;display:grid;place-items:center;text-align:center;background:#0a1420ba;border:1px solid #aa946b55;border-radius:10px;padding:20px;font-size:18px}
.portal-scene{position:relative;flex:1;min-height:90px;width:100%;height:auto;margin:0;overflow:hidden;border-radius:45% 45% 18px 18px;background:#080e17;box-shadow:inset 0 0 40px #000,0 0 20px #dfa34d33}.portal-destination{position:absolute;inset:0;background-size:100% 100%,300% 300%;background-position:center,var(--art-x,0%) var(--art-y,0%);animation:portal-reveal 1.5s cubic-bezier(.2,.7,.2,1) both}.portal-destination.chess{background-size:100% 100%,300% 200%;background-position:center,100% 0%}.portal-ring{inset:7% 10%;pointer-events:none;animation:portal-opening 1.5s ease-out both,portal-pulse 2.5s 1.5s infinite alternate;border-color:#ffdf91}.screen-portal .portal-heading{font-size:clamp(22px,4dvh,30px);margin:12px 0 4px;animation:portal-caption .4s 1s both}.screen-portal>.prose{font-size:16px;line-height:1.55;margin:5px 0;padding:10px;animation:portal-caption .4s 1.1s both}.portal-enter{animation:portal-caption .4s 1.3s both}
.fusion-stage{position:relative;width:min(100%,360px);align-self:center;flex:1;min-height:100px;max-height:370px;isolation:isolate}.fusion-piece{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;animation:assemble-fragments 2.8s cubic-bezier(.25,.5,.1,1) both;filter:drop-shadow(0 0 7px #edcd7a88)}.fusion-piece-0{--from-x:-90px;--from-y:-90px}.fusion-piece-1{--from-x:110px;--from-y:-65px}.fusion-piece-2{--from-x:110px;--from-y:55px}.fusion-piece-3{--from-x:50px;--from-y:100px}.fusion-piece-4{--from-x:-65px;--from-y:100px}.fusion-piece-5{--from-x:-110px;--from-y:5px}.fusion-core{position:absolute;inset:20%;border-radius:50%;background:radial-gradient(#fff1b399,#e4bd5222,transparent 70%);animation:fusion-glow 3.2s both;mix-blend-mode:screen}.fusion-message{text-align:center;animation:portal-caption .5s 2.8s both}.fusion-message h2{font-size:26px;line-height:1.2;color:#ffe5ae;margin:10px 0}.fusion-message p{font-size:16px;line-height:1.55}.fusion-message button{width:100%;margin-top:10px}.screen-love,.screen-door{justify-content:center}.screen-love .confession,.screen-door .confession{flex:1;display:grid;place-items:center;margin:10px 0;font-size:clamp(38px,7dvh,60px);animation:confession-reveal 1.5s ease-out both}.screen-door .door{flex:0 1 190px;margin:15px auto 5px;min-height:80px}.screen-settings>button{margin:8px 0}.screen-settings .notice{overflow:auto}.achievement-list{flex:1;min-height:0;gap:6px;margin:12px 0}.achievement-row{padding:9px;font-size:14px;line-height:1.4}.screen-profile h2{font-size:22px;margin:8px 0}
@keyframes screen-arrive{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}@keyframes fragment-arrival{from{opacity:0;transform:scale(.3) rotate(-35deg);filter:drop-shadow(0 0 50px white)}to{opacity:1;transform:scale(1) rotate(0)}}@keyframes gem-breathe{to{opacity:.28;transform:scale(1.08)}}@keyframes portal-reveal{from{clip-path:ellipse(1% 2% at 50% 50%);filter:brightness(2)}to{clip-path:ellipse(70% 75% at 50% 50%);filter:brightness(1)}}@keyframes portal-opening{from{transform:scale(.05);opacity:0}to{transform:scale(1);opacity:1}}@keyframes portal-caption{from{opacity:0;transform:translateY(8px);pointer-events:none}to{opacity:1;transform:none;pointer-events:auto}}@keyframes assemble-fragments{0%{opacity:0;transform:translate(var(--from-x),var(--from-y)) scale(.5) rotate(18deg)}20%{opacity:1;transform:translate(var(--from-x),var(--from-y)) scale(.8)}80%,100%{opacity:1;transform:translate(0,0) scale(1) rotate(0)}}@keyframes fusion-glow{0%,60%{opacity:0;transform:scale(.3)}100%{opacity:1;transform:scale(1)}}@keyframes confession-reveal{from{opacity:0;filter:blur(4px)}to{opacity:1;filter:blur(0)}}
@media(max-height:650px){.screen{padding-top:calc(7px + env(safe-area-inset-top));padding-bottom:calc(7px + env(safe-area-inset-bottom))}.screen>h1{font-size:20px;margin:3px 0 7px}.screen>h1:after{margin-top:5px}.worlds{gap:5px;grid-template-rows:repeat(3,minmax(0,1fr)) minmax(65px,.65fr)}.world-card{padding:5px 7px}.world-card h2{font-size:14px;margin:1px 0}.world-number{font-size:9px}.map-progress{margin-bottom:5px}.map-footer{margin-top:5px!important}.screen-map>h1{font-size:22px}.stats-panel{padding:6px}.stats{font-size:13px;line-height:1.4}.screen-stats>.emblem{width:44px;height:44px}.screen-stats .mission-title{font-size:19px;margin-bottom:6px}.quality-title{font-size:25px!important;margin:8px 0}.screen-intro>.prose{font-size:14px;line-height:1.4;padding:8px}.screen-intro .intro-scene{min-height:25px}.game.running>.hint{font-size:12px}.game.running>.fightPrompt{top:95px;font-size:14px;min-height:58px}.game.world-fight>button:not(.primary){bottom:182px}.letter-paper .prose{font-size:16px}.screen-gift>.emblem{width:70px;height:70px;margin:4px auto}.screen-gift>h2{font-size:23px}.screen-play{padding-top:env(safe-area-inset-top)}.screen-play>nav{margin-bottom:0}.screen-play>h1{font-size:15px}.zone-sector .joystick{width:86px;height:86px}.fusion-message h2{font-size:22px}.fusion-message p{font-size:14px}}
@media(orientation:landscape){#rotate{display:none}.screen-play{max-width:none}.game.running>.hud{max-width:430px}.game.running>.hint{max-width:400px}.worlds{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr)) minmax(65px,.6fr)}.world-card.classified{grid-column:1/-1}.screen-intro{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto auto minmax(0,1fr) auto;gap:6px 16px}.screen-intro nav,.screen-intro>.eyebrow,.screen-intro>h1{grid-column:1/-1}.screen-intro>.intro-scene{grid-column:1;grid-row:4/6;margin:0}.screen-intro>.prose{grid-column:2;margin:0;font-size:14px}.screen-intro>.primary{grid-column:2}.screen-prologue .prose{font-size:14px;line-height:1.4}.stats-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.screen-stats>.emblem{display:none}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}.reduced *,.reduced *:before,.reduced *:after{animation:none!important;transition:none!important}
body[data-world='0'] .stats-grid{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:minmax(0,1fr) minmax(0,1.1fr)}body[data-world='0'] .stats-panel:last-child{grid-column:1/-1}body[data-world='0'] .stats-panel:last-child .stats{grid-template-columns:repeat(3,minmax(0,1fr) auto);gap:6px 7px}.stats dt{overflow-wrap:anywhere}.stats-panel{overflow:hidden}
@media(max-height:650px){body[data-world='0'] .stats{font-size:13px;line-height:1.35}body[data-world='0'] .stats-panel:last-child .stats{gap:4px}}
@media(orientation:landscape){body[data-world='0'] .stats-grid{grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:minmax(0,1fr)}body[data-world='0'] .stats-panel:last-child{grid-column:auto}body[data-world='0'] .stats-panel:last-child .stats{grid-template-columns:1fr auto}}
.screen-intro>.prose{min-height:0;overflow:auto;overscroll-behavior:contain}.screen-intro>.intro-scene{flex:1 1 120px}.screen-intro>.primary{flex-shrink:0}
.game.world-chess>.hint{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);padding:0;margin:0}.game.world-chess>.hint[role=status]:not(:empty){clip-path:none;position:absolute;top:40px;left:16px;right:16px;z-index:5;width:auto;height:auto;padding:9px;background:#111e2df2;border:1px solid #bb9e64;border-radius:8px}.game.world-chess .chessboard{width:min(100%,calc(var(--app-height) - 175px));flex-shrink:0}.game.world-chess>button{min-height:44px;font-size:12px}.game.world-chess h2{font-size:17px}
@media(orientation:landscape) and (max-height:550px){.game.world-chess{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,.65fr);grid-template-rows:auto 1fr auto;gap:8px 18px;align-items:center}.game.world-chess .chessboard{grid-column:1;grid-row:1/-1;width:min(100%,calc(var(--app-height) - 105px))}.game.world-chess>h2,.game.world-chess>button{grid-column:2}.screen-intro>.prose{flex:1;overflow:auto}}
@media(orientation:landscape) and (max-height:550px){.screen-map .worlds{grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:5px}.screen-map .world-card.classified{grid-column:3/5;grid-row:2}.screen-map>.eyebrow{display:none}.screen-map>h1{font-size:20px}.screen-map .world-card{padding:4px 6px;gap:2px}.screen-map .world-card h2{font-size:13px}.screen-map .map-footer{margin-top:5px!important}.screen-stats>h1,.screen-stats>.eyebrow{display:none}.screen-stats .mission-title{font-size:20px;margin:3px 0 7px}.screen-stats .stats-summary{font-size:11px;margin-top:4px}}
