:root{color-scheme:dark;font-family:ui-rounded,'Segoe UI',Arial,sans-serif;color:#fff8e9;background:#101f2b;--mint:#9ce8cb;--ink:#17383d;--cream:#fff8e9;--gold:#ffd984}
*{box-sizing:border-box}body{margin:0;min-height:100svh;display:flex;flex-direction:column;align-items:center;justify-content:center;background:radial-gradient(ellipse at top,#294251,#101f2b 75%)}
button{font:inherit;cursor:pointer;border:0}button:focus-visible{outline:4px solid #fff;outline-offset:5px}button:disabled{opacity:.45;cursor:default}
#game{position:relative;width:min(100vw,calc(177.77svh - 68px),1600px);aspect-ratio:16/9;overflow:hidden;background:#234a50;box-shadow:0 20px 100px #0007;border-radius:18px;isolation:isolate}
canvas{display:block;width:100%;height:100%}#hud{position:absolute;top:0;left:0;right:0;padding:2.4% 3.8%;display:flex;align-items:center;gap:20px;background:linear-gradient(#112c36e8,#112c3600);z-index:2}#hud[hidden]{display:none}
.chapter{min-width:27%}.chapter>span{font-size:clamp(10px,1.1vw,16px);letter-spacing:.14em;color:#c0e3d3}h1{font-size:clamp(16px,2vw,30px);margin:3px 0;font-weight:750}#mission{font-size:clamp(12px,1.6vw,23px);flex:1;text-align:center;text-shadow:0 2px 5px #112c36}
#pause-button{background:#fff8e91a;color:var(--cream);padding:12px 17px;border:1px solid #fff3;border-radius:14px;white-space:nowrap;font-size:clamp(12px,1.3vw,19px)}
#overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;z-index:5;background:#1029387d;backdrop-filter:blur(5px)}#overlay:empty{display:none}
.panel{width:70%;max-height:90%;overflow:auto;border-radius:28px;background:#14373bf2;border:1px solid #adcbbf55;padding:3.1% 4%;box-shadow:0 25px 90px #00182166;text-align:center}.panel.wide{width:87%}.eyebrow{color:var(--mint);font-size:clamp(10px,1.15vw,17px);letter-spacing:.18em;text-transform:uppercase;margin:0 0 12px}
h2{font-size:clamp(24px,4.1vw,60px);line-height:1.08;letter-spacing:-.035em;margin:0 0 16px}h2 .gold{color:var(--gold)}.lede{font-size:clamp(14px,1.8vw,26px);line-height:1.5;margin:12px auto 22px;max-width:740px;color:#deebe2}.small{font-size:clamp(10px,1.15vw,17px);line-height:1.5;color:#bdd3cf}.buttons{display:flex;justify-content:center;flex-wrap:wrap;gap:12px;margin:16px 0}.btn{background:var(--mint);color:var(--ink);padding:14px 24px;border-radius:14px;font-weight:800;font-size:clamp(13px,1.55vw,22px);box-shadow:0 4px 0 #0a202b55}.btn.secondary{background:#345457;color:#fff8e9;border:1px solid #8fb9ac77}.btn.gold{background:var(--gold)}.btn.focused,.choice.focused{outline:4px solid var(--gold);outline-offset:4px}.btn:hover{filter:brightness(1.1)}
.chips{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;margin:15px 0}.chip{border:1px solid #a4d3c047;border-radius:30px;padding:7px 13px;font-size:clamp(10px,1.1vw,16px);color:#d1e6d8}.logo-heart{color:#ffaaa5;font-size:clamp(25px,4vw,60px);display:block;margin-bottom:12px}.chapter-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:10px}.chapter-grid button{font-size:clamp(12px,1.3vw,20px);padding:18px 7px;line-height:1.5}.cast{color:#e6d8af;font-size:clamp(11px,1.1vw,16px);margin-top:22px}
#game-footer{position:absolute;bottom:0;left:0;right:0;display:flex;align-items:center;justify-content:space-between;padding:1.3% 3.8%;background:linear-gradient(transparent,#102c36ef);z-index:3;pointer-events:none;font-size:clamp(10px,1.13vw,16px);color:#d6e4d6}#player-labels{display:flex;gap:18px}.badge{display:inline-block;background:#9ce8cb;color:#163d3d;padding:3px 8px;border-radius:7px;font-weight:800;margin-right:5px}.badge.p2{background:#ffd984}#hint{max-width:52%;text-align:right}
#toast{position:absolute;top:17%;left:50%;transform:translateX(-50%);max-width:80%;text-align:center;padding:12px 23px;background:#fff8e9;color:#17383d;font-weight:700;border-radius:18px;z-index:4;box-shadow:0 7px 20px #0003;font-size:clamp(13px,1.5vw,22px)}
.choices{display:flex;justify-content:center;gap:24px;margin:16px auto}.choice{position:relative;flex:1;max-width:275px;padding:14px;border-radius:22px;background:#fff8e9;color:#17383d;border:5px solid transparent;font-size:clamp(13px,1.7vw,24px);font-weight:800}.choice.selected{border-color:#ffd984}.choice canvas{height:auto;width:100%;max-height:180px;aspect-ratio:1}.count{font-size:clamp(28px,4vw,56px);font-variant-numeric:tabular-nums;color:var(--gold)}.timer-track{height:8px;background:#ffffff25;border-radius:30px;overflow:hidden;margin:0 auto;max-width:500px}.timer-fill{height:100%;background:#ffd984;width:100%}.control-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;text-align:left}.control-grid p{margin:5px 0}#connection{min-height:25px;padding:7px 20px;text-align:center;font-size:13px;color:#c3d4d2;max-width:1100px}
#touch{position:absolute;bottom:10%;left:3%;right:3%;justify-content:space-between;align-items:center;z-index:4;pointer-events:none}#touch:not([hidden]){display:flex}.dpad{display:grid;grid-template:repeat(3,40px)/repeat(3,40px);gap:3px}.dpad button,#touch-action{pointer-events:auto;background:#153941bb;border:1px solid #b8dbc96b;color:#fff8e9;border-radius:12px;touch-action:none;user-select:none}.dpad [data-dir=up]{grid-area:1/2}.dpad [data-dir=left]{grid-area:2/1}.dpad [data-dir=down]{grid-area:2/2}.dpad [data-dir=right]{grid-area:2/3}#touch-action{width:64px;height:64px;border-radius:50%;font-weight:bold;font-size:25px}
@media(max-width:1100px),(max-height:750px){.panel{padding:2% 3%}.lede{margin:8px auto 12px}.eyebrow{margin-bottom:6px}h2{margin-bottom:8px}.buttons{margin:10px 0;gap:8px}.btn{padding:10px 16px}.choices{margin:10px auto;gap:14px}.choice{max-width:230px;padding:8px}.choice canvas{width:160px;max-width:100%;height:140px;max-height:none;margin:auto}.cast{margin-top:10px}.chips{margin:10px 0}.logo-heart{margin-bottom:6px}}
@media(max-width:800px){#game{border-radius:0}.panel{border-radius:18px;padding:2% 3%;width:84%}.choice{padding:5px}.choices{gap:12px}.choice canvas{width:125px;height:109px}#pause-button{padding:8px}#pause-button span{display:none}#connection{font-size:11px}.control-grid{gap:8px}.chapter-grid{gap:7px}.chapter-grid button{padding:9px 4px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto}}
.chapter-grid{grid-template-columns:repeat(4,1fr)}.panel a{color:#b6f0d4;text-underline-offset:3px}.chapter-grid button{padding:12px 7px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:11px}.btn-visual{width:34px;height:34px;flex:none}.btn-visual svg{width:100%;height:100%}.btn-label{line-height:1.25;font-size:.88em}.btn.color-mint{background:#a0e4b1;color:#173d31}.btn.color-gold{background:#ffdc79;color:#473a17}.btn.color-blue{background:#93cbef;color:#193d5c}.btn.color-coral{background:#f6aaa0;color:#522d2d}.btn.color-lavender{background:#c9b6f0;color:#383153}.pad-key{display:inline-flex;align-items:center;justify-content:center;flex:none;width:31px;height:31px;border-radius:50%;font:900 22px Arial,sans-serif;border:2px solid #ffffff90;box-shadow:0 2px 0 #0003}.pad-a{background:#237f3e;color:white}.pad-b{background:#bd333e;color:white}.pad-x{background:#2167b4;color:white}.pad-y{background:#f7cd36;color:#3e3516}#overlay[data-screen=players] .btn-visual{width:56px;height:56px}#overlay[data-screen=home] .btn-visual{width:36px;height:36px}.chapter-card{flex-direction:column;gap:4px}.chapter-picture{display:block;font-size:36px;line-height:1.2}.chapter-caption{font-size:14px}.choice.selected::after{content:'A';position:absolute;right:10px;top:10px;display:grid;place-items:center;background:#237f3e;color:white;border:2px solid white;border-radius:50%;width:32px;height:32px;font:bold 22px Arial}#touch-action{background:#237f3e;color:white;border:3px solid #b9ebbf}#pause-button{background:#f3c979;color:#3f3924;font-weight:800}
@media(max-width:1100px),(max-height:750px){.btn{gap:8px;padding:9px 13px}.btn-visual{width:27px;height:27px}#overlay[data-screen=home] .btn-visual{width:30px;height:30px}.pad-key{width:27px;height:27px;font-size:19px}#overlay[data-screen=players] .btn-visual{width:43px;height:43px}.chapter-picture{font-size:30px}.chapter-caption{font-size:12px}}
.menu-navigation{display:flex;align-items:center;justify-content:center;gap:9px;margin-top:15px;font-size:25px;color:#fff6db}.menu-navigation .pad-b{margin-left:22px}.btn.focused{outline:4px solid #fff1ad;outline-offset:4px;box-shadow:0 0 0 7px #152f3a}.btn.focused .btn-visual{filter:drop-shadow(0 0 5px #ffffff70)}#repeat-button{display:flex;align-items:center;gap:7px;flex:none;border-radius:13px;background:#8cc8ec;color:#173d5c;padding:9px 11px;font-size:20px}#repeat-button .pad-key{width:27px;height:27px;font-size:19px}@media(max-width:800px){.menu-navigation{margin-top:9px;font-size:20px}#repeat-button{padding:6px;gap:3px;font-size:15px}#repeat-button .pad-key{width:22px;height:22px;font-size:16px}#hud{gap:10px}}
.story-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin:20px 0}.story-grid .btn{min-height:135px}.story-grid .chapter-picture{font-size:62px}.design-buttons .btn{min-height:75px}#space-photo{width:100%;height:auto;max-height:150px;border-radius:15px}@media(max-width:800px){.story-grid{gap:9px;margin:10px 0}.story-grid .btn{min-height:100px;padding:8px}.story-grid .chapter-picture{font-size:38px}.story-grid .btn{font-size:13px}.design-buttons .btn{min-height:55px}}
.story-count{display:block;font-size:.62em;font-weight:800;margin-top:4px}
#done-art{display:block;margin:6px auto;width:200px;height:auto;border-radius:15px}
.roles-grid{grid-template-columns:repeat(2,1fr)}.roles-grid .btn{flex-direction:column;min-height:170px}.chapter-card canvas{width:100%;max-width:220px;height:auto}
#game.caps .panel,#game.caps .panel *,#game.caps #toast,#game.caps #hud,#game.caps #hud *,#game.caps #game-footer,#game.caps #game-footer *{text-transform:uppercase}
#overlay[data-screen=bedtime]{background:none;backdrop-filter:none;align-items:flex-end;pointer-events:none}
.bed-vignette{position:absolute;inset:0;background:radial-gradient(ellipse at center,transparent 45%,#050d2ccc 100%),linear-gradient(#0a1233aa,transparent 25%)}
.bed-strip{position:relative;width:86%;margin:0 auto 7%;padding:1.6% 3%;border-radius:22px;background:#0f1d3fdd;color:#fff4dc;text-align:center;box-shadow:0 10px 40px #0007}.bed-strip p{margin:0;font-weight:700;line-height:1.45;font-size:clamp(14px,1.9vw,27px)}
.bed-dark{position:absolute;inset:0;background:#02040f;opacity:0;transition:opacity .4s linear}
#overlay[data-screen=bedtime-pick] .story-grid .btn{min-height:150px}
#game.caps .bed-strip,#game.caps .bed-strip *{text-transform:uppercase}
.music-list{font-size:.8em;line-height:1.6}
