:root{color-scheme:light;--ivory:#f8f3e9;--paper:#fffaf1;--aub:#432341;--deep:#301b32;--mint:#b8d6c8;--mint-d:#2f6b58;--gold:#b79357;--ink:#3a2a38;--soft:#6b5a62;--rule:#d8cab1;font-family:Arial,Helvetica,sans-serif}
*{box-sizing:border-box}
body{margin:0;min-height:100vh;color:var(--ink);background:radial-gradient(ellipse at 10% 20%,#e9f1ea 0,transparent 45%),radial-gradient(ellipse at 90% 10%,#efe5e2 0,transparent 45%),var(--ivory);padding-bottom:env(safe-area-inset-bottom)}
button,input{font:inherit}button{cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
a{color:inherit;text-underline-offset:4px}
:focus-visible{outline:3px solid var(--mint-d);outline-offset:3px}
[hidden]{display:none!important}
.skip{position:absolute;left:-999px;top:8px;background:var(--aub);color:#fff;padding:10px 14px;border-radius:6px;z-index:9}.skip:focus{left:8px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.masthead{max-width:1100px;margin:auto;padding:16px 24px 14px;display:flex;justify-content:space-between;align-items:center;gap:14px;border-bottom:1px solid var(--rule);flex-wrap:wrap}
.wordmark{text-decoration:none;font-family:Georgia,serif;font-size:22px;letter-spacing:5px}
.wordmark span{display:block;margin-top:5px;font:9px Arial,sans-serif;letter-spacing:2.2px;text-transform:uppercase;color:var(--soft)}
.masthead nav{display:flex;gap:18px;font-size:13px}
.sound{display:flex;align-items:center;gap:8px}
.sound input{width:90px;accent-color:var(--aub)}
.icon{width:44px;height:44px;border-radius:50%;border:1px solid var(--rule);background:var(--paper);color:var(--aub);font-size:20px;line-height:1}
.icon[aria-pressed=true]{background:var(--aub);color:#fff}
main{max-width:980px;margin:auto;padding:22px 16px 36px;outline:0}
.screen{max-width:760px;margin:0 auto;text-align:center}.screen.wide{max-width:980px}
.eyebrow{margin:0;font-size:11px;letter-spacing:2px;text-transform:uppercase;color:#7b5f38}
h1{font:400 clamp(38px,8vw,64px)/1.05 Georgia,serif;letter-spacing:-1.5px;margin:14px 0 12px;color:var(--aub)}h1 em{color:#8a6d44}
h2{font:400 clamp(26px,5vw,36px) Georgia,serif;color:var(--aub);margin:6px 0 14px}h2:focus{outline:0}
.lede{font:italic 18px/1.5 Georgia,serif;color:var(--soft);margin:0 auto;max-width:560px}
.note{color:var(--soft);font-size:14px;line-height:1.5;max-width:560px;margin:14px auto}
.banner{background:#e9f1ea;border:1px solid var(--mint);border-radius:14px;padding:12px 16px;color:var(--mint-d);max-width:560px;margin:14px auto}
.cast{display:flex;justify-content:center;align-items:flex-end;gap:26px;margin:22px 0 8px}
.cast figure{margin:0;text-align:center;font:italic 14px Georgia,serif;color:var(--soft)}
.cast img[id^=gigi]{height:240px;width:auto}.cast img[id^=wick]{height:150px;width:auto}
.actions{display:flex;justify-content:center;gap:12px;margin:18px 0 6px}.actions.wrap{flex-wrap:wrap}
.primary,.secondary,.ghost{min-height:48px;padding:12px 26px;border-radius:999px;font-size:16px;text-decoration:none;display:inline-flex;align-items:center;justify-content:center}
.primary{border:0;background:var(--aub);color:#fff;box-shadow:0 6px 14px #43234126}
.secondary{border:1px solid var(--aub);background:var(--paper);color:var(--aub)}
.ghost{border:0;background:transparent;color:var(--soft);text-decoration:underline}
.primary:disabled,.secondary:disabled{opacity:.5;cursor:default}
.storybox{display:flex;align-items:flex-end;justify-content:center;gap:14px;margin:12px 0}
.storybox img[id^=gigi]{height:230px;width:auto;flex:none}.storybox img[id^=wick]{height:104px;width:auto;flex:none}
.bubble{background:var(--paper);border:1px solid var(--rule);border-radius:20px;padding:18px 20px;font:italic 19px/1.5 Georgia,serif;color:var(--aub);text-align:left;max-width:360px;align-self:center}
.bubble p{margin:0}
fieldset{border:0;padding:0;margin:18px 0}legend{font-weight:700;font-size:13px;letter-spacing:1px;text-transform:uppercase;color:var(--soft);margin:0 auto 8px}
.choices{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.choices.two{grid-template-columns:repeat(2,1fr)}
.opt{display:block;cursor:pointer}.opt input{position:absolute;opacity:0}
.opt span{display:block;min-height:76px;padding:12px 10px;background:var(--paper);border:1px solid var(--rule);border-radius:16px}
.opt b{display:block;font-family:Georgia,serif;font-size:18px;color:var(--aub);font-weight:400}.opt small{display:block;color:var(--soft);font-size:12px;line-height:1.35;margin-top:3px}
.opt input:checked+span{background:var(--aub);border-color:var(--aub)}.opt input:checked+span b,.opt input:checked+span small{color:#fff}
.opt input:focus-visible+span{outline:3px solid var(--mint-d);outline-offset:3px}
.check{display:flex;gap:10px;text-align:left;max-width:520px;margin:14px auto;cursor:pointer}.check input{margin-top:5px;width:20px;height:20px;accent-color:var(--aub)}
.check b{display:block;font-weight:700}.check small{display:block;color:var(--soft);line-height:1.4}
.row{display:flex;gap:10px;justify-content:center;align-items:center;flex-wrap:wrap;margin:10px 0}.row input{padding:12px 14px;border:1px solid var(--rule);border-radius:12px;min-width:200px}
/* the room */
.hud{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:center;margin-bottom:8px}
.stat{background:var(--paper);border:1px solid var(--rule);border-radius:14px;padding:6px 14px;min-width:78px}
.stat span{display:block;font-size:10px;letter-spacing:1.5px;text-transform:uppercase;color:var(--soft)}.stat b{font:400 22px Georgia,serif;color:var(--aub)}
.hud .secondary{min-height:44px;padding:8px 18px;font-size:14px}.hud .ghost{min-height:44px;padding:8px 10px;font-size:14px}
.tray{display:flex;gap:8px;overflow-x:auto;padding:4px 2px 10px;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch}
.chip{flex:none;display:flex;flex-direction:column;align-items:center;gap:2px;width:68px;padding:5px 4px;border:1px solid var(--rule);border-radius:12px;background:var(--paper);font-size:10px;line-height:1.15;color:var(--ink);scroll-snap-align:start}
.chip img{width:44px;height:44px;object-fit:contain}.chip[aria-pressed=true]{border-color:var(--aub);box-shadow:0 0 0 2px var(--aub)}
.chip.done{background:#e9f1ea;border-color:var(--mint-d);color:var(--mint-d)}.chip.done img{opacity:.45}.chip.done span:after{content:' ✓'}
.scene{width:100%;max-width:min(100%,calc((100svh - 250px) * var(--aspect,1.5)));margin:0 auto;position:relative;overflow:hidden;border:2px solid var(--gold);border-radius:18px;background:#2a1a26;touch-action:none;user-select:none;-webkit-user-select:none;cursor:grab;box-shadow:0 12px 30px #43234130}
.scene:active{cursor:grabbing}
.world{position:relative;width:100%;transform-origin:0 0;will-change:transform}
.world img#room,.world img#front{display:block;width:100%;height:auto;pointer-events:none}
.world img#front{position:absolute;inset:0;z-index:3}
#sprites{position:absolute;inset:0;z-index:2}
.sprite{position:absolute;transform:translate(-50%,-50%);background:none;border:0;padding:0;pointer-events:none;filter:drop-shadow(0 1px 1.5px #1c0f1a66)}
.sprite img{display:block;width:100%;height:auto;pointer-events:none}
.sprite.found{filter:drop-shadow(0 0 6px #ffe9a0) drop-shadow(0 0 2px #fff)}
.kbd .sprite{pointer-events:auto;cursor:pointer;border-radius:50%}.kbd .sprite:focus-visible{outline:3px solid #fff;outline-offset:2px}
#marks{position:absolute;inset:0;z-index:4;pointer-events:none}
.mark{position:absolute;transform:translate(-50%,-50%);border-radius:50%;border:3px solid #ffe9a0;animation:ring .9s ease-out forwards}
.mark.miss{border-color:#ffffffaa;border-width:2px;animation-duration:.6s}
.mark.hint{border:3px dashed #ffe9a0;animation:pulse 1.6s ease-in-out infinite}
@keyframes ring{from{width:10px;height:10px;opacity:1}to{width:70px;height:70px;opacity:0}}
@keyframes pulse{50%{opacity:.35}}
.zoom{position:absolute;right:8px;top:8px;z-index:5;display:flex;flex-direction:column;gap:6px}
.zoom button{width:44px;height:44px;border-radius:12px;border:1px solid var(--gold);background:#fffaf1ee;color:var(--aub);font-size:22px}
.ribbon{position:absolute;left:8px;bottom:8px;z-index:5;margin:0;background:#fffaf1ee;color:var(--aub);border:1px dashed var(--gold);border-radius:999px;padding:5px 12px;font-size:12px}
.lock{position:absolute;left:50%;top:10px;transform:translateX(-50%);z-index:5;margin:0;background:var(--aub);color:#fff;border-radius:999px;padding:8px 16px;font:italic 14px Georgia,serif;width:max-content;max-width:90%}
.talk{display:flex;align-items:center;gap:12px;margin:12px auto 0;max-width:760px;background:var(--paper);border:1px solid var(--rule);border-radius:18px;padding:10px 14px;text-align:left}
.talk p{margin:0;flex:1;font:italic 17px/1.4 Georgia,serif;color:var(--aub);min-height:48px;display:flex;align-items:center}
.avatar{flex:none;width:52px;height:52px;border-radius:50%;overflow:hidden;border:2px solid var(--gold);background:var(--paper)}
.avatar img{display:block;width:100%;height:auto;margin-top:-4px;transform:scale(1.9);transform-origin:50% 6%}
.wick{flex:none;width:46px}.wick img{width:100%;height:auto;display:block}
/* results, dialogs */
.tally{max-width:420px;margin:12px auto;background:var(--paper);border:1px solid var(--rule);border-radius:16px;padding:8px 18px;text-align:left}
.tally div{display:flex;justify-content:space-between;padding:7px 0;border-bottom:1px solid #efe6d4}.tally div:last-child{border:0;font:400 22px Georgia,serif;color:var(--aub)}
.tally dt,.tally dd{margin:0}.tally dd{font-variant-numeric:tabular-nums}
dialog{width:min(560px,94vw);border:1px solid var(--gold);border-radius:20px;background:var(--ivory);color:var(--ink);padding:18px}
dialog::backdrop{background:#301b3288}
.dlg-head{display:flex;justify-content:space-between;align-items:center}
dialog label{display:block;font-size:13px;margin:10px 0 4px}dialog input{width:100%;padding:12px;border:1px solid var(--rule);border-radius:12px}
dialog form .primary{margin-top:14px;width:100%}
.tabs{display:flex;gap:6px;flex-wrap:wrap;margin:6px 0 10px}.tabs button{min-height:40px;padding:6px 14px;border-radius:999px;border:1px solid var(--rule);background:var(--paper);font-size:13px;color:var(--aub)}.tabs button[aria-pressed=true]{background:var(--aub);color:#fff}
.rank{margin:0;padding:0;list-style:none;max-height:50vh;overflow:auto}
.rank li{display:grid;grid-template-columns:34px 1fr auto auto;gap:10px;padding:8px 6px;border-bottom:1px solid #efe6d4;font-size:15px}.rank li.you{background:#e9f1ea;border-radius:8px;font-weight:700}
.rank .t{color:var(--soft);font-size:13px}.rank .empty{display:block;color:var(--soft);padding:16px 4px;text-align:center}
.foot{max-width:980px;margin:auto;padding:16px;border-top:1px solid var(--rule);color:var(--soft)}
@media(max-width:640px){
 .masthead{padding:12px}.wordmark{font-size:18px;letter-spacing:3px}.masthead nav{font-size:12px;gap:12px}
 main{padding:12px 8px 28px}
 .cast img[id^=gigi]{height:170px}.cast img[id^=wick]{height:110px;width:auto}
 .storybox{flex-wrap:wrap}.storybox img[id^=gigi]{height:160px}.storybox img[id^=wick]{height:76px;width:auto}.bubble{font-size:16px;max-width:none;flex:1 1 220px}
 .stat{min-width:64px;padding:4px 10px}.stat b{font-size:19px}
 .choices{grid-template-columns:1fr}.choices.two{grid-template-columns:1fr 1fr}
 .opt span{min-height:0}
 .scene{border-radius:12px;margin:0 -2px}
 .talk{padding:8px 10px}.talk p{font-size:15px}.wick{display:none}
}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}.mark{opacity:.9}}

.startcard{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:6;width:min(86%,340px);box-sizing:border-box;text-align:center;background:#fffaf1f2;border:1px solid var(--gold);border-radius:18px;padding:16px 18px;box-shadow:0 10px 30px #2a1a2666;cursor:default;touch-action:manipulation}
.startcard h3{margin:0 0 6px;font:400 22px Georgia,serif;color:var(--aub)}.startcard p{margin:0 0 12px;font-size:14px;line-height:1.45;color:var(--soft)}
.howto{margin:0 auto 8px;max-width:760px;text-align:center;font-size:13px;color:var(--soft)}

.narr{max-width:760px;margin:14px auto 0;padding:14px 18px;border:1px solid var(--gold);border-radius:16px;background:#fffaf1;text-align:left}
.narr h3{margin:0 0 4px;font:400 20px Georgia,serif;color:var(--aub)}.narr-note{margin:0 0 10px;font-size:13px;color:var(--soft)}
.narr-controls{display:flex;flex-wrap:wrap;gap:10px;align-items:center}.narr-status{min-height:1.3em;margin:8px 0 6px;font-size:13px;color:var(--soft)}
.narr-text{margin:0;font:italic 16px/1.55 Georgia,serif;color:var(--ink,#3b2a38)}
.startcard .secondary{margin-top:8px;min-height:44px;padding:8px 18px;font-size:14px}

.startcard{left:calc(50% - 26px);width:min(calc(100% - 104px),340px)}
.startcard button{display:flex;width:100%;margin:0 auto}.startcard .secondary{margin-top:8px}
@media (min-width:700px){.startcard{left:50%;width:min(86%,360px)}}

.storyvoice{justify-content:center;margin-top:10px}#story-voice-status{text-align:center}

#end-voice .storyvoice{margin:6px 0 0}#end-voice-status{text-align:center}

.choices.three{grid-template-columns:repeat(auto-fit,minmax(200px,1fr))}
.offer{max-width:760px;margin:10px auto;padding:12px 16px;border:1px solid var(--gold);border-radius:16px;background:#fffaf1;text-align:left}
.offer[hidden]{display:none}.offer p{margin:0 0 8px;font:italic 17px/1.45 Georgia,serif}.offer .actions{margin:6px 0 0;justify-content:flex-start}
#clue-note{margin:4px auto}
dialog .howlist{margin:0 0 12px;padding-left:20px;line-height:1.55}
.soundrows .row{display:flex;gap:10px;align-items:center;margin:10px 0;flex-wrap:wrap}
.hud{flex-wrap:wrap}

/* Wick: the transparent artwork floats free, with no frame or panel; a soft shadow follows his outline. */
img[id^=wick]{background:none;border:0;border-radius:0;box-shadow:none;filter:drop-shadow(0 4px 6px rgba(74,45,78,.22));transition:transform .35s ease,filter .35s ease}
img[id^=wick]:hover{transform:translateY(-3px);filter:drop-shadow(0 0 8px rgba(255,214,120,.85)) drop-shadow(0 4px 6px rgba(74,45,78,.22))}

.offer{display:flex;gap:12px;align-items:flex-start}.offer .avatar{margin-top:2px}.offer>div{flex:1}
@media (prefers-reduced-motion:reduce){img[id^=wick]{transition:none}img[id^=wick]:hover{transform:none}}
#viewport.paused{visibility:hidden}
#say-replay{flex:none;min-height:36px;padding:4px 10px;font-size:13px}

.wick-mini{flex:none;width:52px;height:auto;align-self:center}
@keyframes wick-shiver{0%,100%{transform:translate(0,0) rotate(0)}12%{transform:translate(-1.5px,.5px) rotate(-2.5deg)}28%{transform:translate(1.5px,-.5px) rotate(2.5deg)}44%{transform:translate(-1px,.5px) rotate(-2deg)}60%{transform:translate(1px,0) rotate(1.5deg)}78%{transform:translate(-.5px,0) rotate(-.8deg)}}
.shiver{animation:wick-shiver .7s ease-in-out 1}
@media (prefers-reduced-motion:reduce){.shiver{animation:none}}

/* Gigi's videos are opaque (black background), so they sit in a deliberate dark rounded frame */
.vframe{position:relative;margin:12px auto;width:min(86vw,300px);aspect-ratio:9/16;max-height:44vh;border-radius:22px;overflow:hidden;border:2px solid var(--gold);background:#000;box-shadow:0 10px 30px rgba(60,20,70,.25)}
.vframe video{display:block;width:100%;height:100%;object-fit:contain;background:#000}
.vplay{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}
.vcaption{max-width:520px;margin:6px auto;min-height:3em;font:italic 18px/1.45 Georgia,serif;color:var(--aub);text-align:center}
.transcript{max-width:520px;margin:6px auto;text-align:left}.transcript summary{cursor:pointer;font-weight:600}
.talk{position:relative}
.walkpop{position:absolute;left:8px;top:-96px;width:92px;z-index:3;pointer-events:none;border-radius:16px;border:2px solid var(--gold);background:#000;overflow:hidden;box-shadow:0 6px 18px rgba(60,20,70,.3)}
.walkpop[hidden]{display:none}.walkpop video{display:block;width:100%;height:auto;aspect-ratio:2/3;object-fit:cover}
.walkpop button{pointer-events:auto;position:absolute;right:3px;bottom:3px;padding:2px 8px;min-height:30px;font-size:13px;background:#fffaf1;border:1px solid var(--gold);border-radius:999px}
.avatar.speaking{animation:glow 1.6s ease-in-out infinite}
@keyframes glow{0%,100%{box-shadow:0 0 0 0 rgba(212,168,74,.0)}50%{box-shadow:0 0 12px 4px rgba(212,168,74,.55)}}
@media (prefers-reduced-motion:reduce){.avatar.speaking{animation:none;box-shadow:0 0 0 3px rgba(212,168,74,.6)!important}}

/* ---- Level 1 finish: sprites in the room, ornate HUD, no video panels ---- */
:root{--ruby:#a3262f;--emerald:#1f7a5a;--sapphire:#27508f;--gold2:#e7c66f;--gold3:#8a6420}
.stagecast{position:relative;display:flex;justify-content:center;align-items:flex-end;gap:10px;margin:10px auto;min-height:260px}
.stagecast .s-gigi{height:260px;width:auto;background:none;border:0;filter:drop-shadow(0 8px 8px #3a24146e)}
.stagecast .s-wick{height:110px;width:auto;margin-bottom:120px;animation:float 4.2s ease-in-out infinite}
.stagecast.speaking .s-gigi{animation:sway 1.8s ease-in-out infinite;transform-origin:50% 100%}
@keyframes sway{50%{transform:rotate(1.4deg) translateY(-3px)}}
@keyframes float{50%{transform:translateY(-12px) translateX(-4px)}}
@media(max-width:640px){.stagecast{min-height:200px}.stagecast .s-gigi{height:200px}.stagecast .s-wick{height:84px;margin-bottom:90px}}
.guide-float{position:absolute;left:1.5%;top:3%;z-index:4;width:24%;max-width:210px;pointer-events:none;opacity:0;transform:translateY(8px);transition:opacity .4s,transform .4s}
.guide-float.on{opacity:1;transform:none}
.guide-float img{pointer-events:none;background:none;border:0;box-shadow:none}
.f-gigi{display:block;width:70%;height:auto;filter:drop-shadow(0 6px 6px #000a)}
.f-wick{position:absolute;right:-4%;top:6%;width:42%;height:auto;filter:drop-shadow(0 0 10px #ffe08a) drop-shadow(0 3px 4px #0008);animation:float 4.2s ease-in-out infinite}
@media(max-width:640px){.guide-float{width:34%}}
@media(prefers-reduced-motion:reduce){.stagecast .s-wick,.f-wick,.stagecast.speaking .s-gigi{animation:none}.guide-float{transition:none}}
.hud{padding:10px 14px;border-radius:16px;border:3px solid var(--gold2);background:linear-gradient(#3b1f40,#2a1530);box-shadow:0 0 0 2px var(--gold3),0 8px 18px #0004;gap:8px 10px}
.hud .stat{background:#ffffff12;border:1.5px solid var(--gold2);color:#fff}
.hud .stat span{color:var(--gold2)}.hud .stat b{color:#fff}
.hud .stat.prog{min-width:0}.hud ol{display:flex;gap:4px;list-style:none;margin:6px 0 2px;padding:0;flex-wrap:wrap;max-width:140px}
.hud ol li{width:11px;height:11px;transform:rotate(45deg);border:1.5px solid var(--gold2);border-radius:2px}
.hud ol li.done{background:radial-gradient(circle at 30% 30%,#9affd0,var(--emerald))}
.hud .secondary{background:linear-gradient(#a3262f,#7c1a22);border-color:var(--gold2);color:#fff}
.hud .secondary:disabled{opacity:.55}
.hud .ghost{color:#f4e8cc;text-decoration:underline}
.trayhead{margin:8px 2px 2px;font-size:12px;letter-spacing:1px;text-transform:uppercase;color:var(--soft);text-align:left}
.scene{border:3px solid var(--gold2);box-shadow:0 0 0 2px var(--gold3),0 10px 24px #0004}
.note,.screen .lede{color:#4a3320}

/* ======== One immersive stage: the room is the backdrop of every screen; menus are light overlays on it ======== */
html,body{height:100%;overflow:hidden;overscroll-behavior:none}
body{position:fixed;inset:0;min-height:0;height:100%;height:100svh;height:100dvh;background:#1a0d1c;padding:0}
main#stage{position:absolute;inset:10px;max-width:none;margin:0;padding:0;overflow:hidden;border-radius:6px}
.backdrop{position:absolute;inset:0;overflow:hidden;background:#2a1a26}
.backdrop img{display:block;width:100%;height:100%;object-fit:cover;transition:filter .5s}
body:not([data-screen=play]) .backdrop:after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,#1a0d1c55,#1a0d1c10 45%,#1a0d1c66)}
body[data-screen=play] .backdrop img{filter:blur(10px) brightness(.4) saturate(1.1);transform:scale(1.08)}
/* the ornate architectural frame: around the whole game, never around the characters */
body:after{content:"";position:fixed;inset:0;z-index:20;pointer-events:none;border-radius:4px;
 box-shadow:inset 0 0 0 3px #e7c66f,inset 0 0 0 6px #5b3a12,inset 0 0 0 9px #c99a3a,inset 0 0 0 10px #2a1608,inset 0 0 36px 12px #0009;
 background:
  radial-gradient(circle at 50% 50%,var(--ruby) 0 4px,#e7c66f 5px 8px,transparent 9px) 0 0/22px 22px no-repeat,
  radial-gradient(circle at 50% 50%,var(--ruby) 0 4px,#e7c66f 5px 8px,transparent 9px) 100% 0/22px 22px no-repeat,
  radial-gradient(circle at 50% 50%,var(--ruby) 0 4px,#e7c66f 5px 8px,transparent 9px) 0 100%/22px 22px no-repeat,
  radial-gradient(circle at 50% 50%,var(--ruby) 0 4px,#e7c66f 5px 8px,transparent 9px) 100% 100%/22px 22px no-repeat,
  radial-gradient(circle at 50% 50%,var(--emerald) 0 3px,#e7c66f 4px 7px,transparent 8px) 50% 0/18px 18px no-repeat,
  radial-gradient(circle at 50% 50%,var(--sapphire) 0 3px,#e7c66f 4px 7px,transparent 8px) 50% 100%/18px 18px no-repeat,
  radial-gradient(circle at 50% 50%,var(--sapphire) 0 3px,#e7c66f 4px 7px,transparent 8px) 0 50%/18px 18px no-repeat,
  radial-gradient(circle at 50% 50%,var(--emerald) 0 3px,#e7c66f 4px 7px,transparent 8px) 100% 50%/18px 18px no-repeat}
.masthead{position:absolute;z-index:7;top:16px;left:26px;right:26px;max-width:none;margin:0;padding:0;border:0;justify-content:space-between;flex-wrap:nowrap;pointer-events:none}
.masthead a{pointer-events:auto}.wordmark{color:#fff;font-size:17px;letter-spacing:4px;text-shadow:0 1px 6px #000a}.wordmark span{color:#f1e1b8;font-size:8px}
.masthead nav{font-size:13px}.masthead nav a{color:#fff;text-shadow:0 1px 6px #000a}
body[data-screen=play] .masthead{display:none}
.foot{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);padding:0;border:0;margin:0}
/* Gigi and Wick stand in the scenery: transparent sprites, no box, no panel */
.castlayer{position:absolute;z-index:2;left:2%;bottom:0;width:34%;height:92%;pointer-events:none}
body[data-screen=play] .castlayer{display:none}
.castlayer img{position:absolute;background:none;border:0;border-radius:0;box-shadow:none}
.castlayer .c-gigi{left:0;bottom:0;width:100%;height:100%;object-fit:contain;object-position:50% 100%;filter:drop-shadow(0 10px 10px #000a);transform-origin:50% 100%}
.castlayer .c-wick{right:2%;top:12%;width:34%;height:auto;animation:float 4.2s ease-in-out infinite;filter:drop-shadow(0 0 14px #ffe08a) drop-shadow(0 4px 5px #000a)}
.castlayer.speaking .c-gigi{animation:sway 1.8s ease-in-out infinite}
.cast,.stagecast,.storybox img,.talk .avatar,.talk .wick,.offer .avatar,.wick-mini{display:none!important}
/* menus as light overlays */
.screen,.screen.wide{max-width:none}
.screen:not(.wide){position:absolute;z-index:5;right:4%;top:50%;transform:translateY(-50%);width:min(560px,58%);max-height:calc(100% - 84px);overflow:auto;padding:20px 26px;
 background:linear-gradient(#fffaf1ee,#f6ecd8ee);border:2px solid var(--gold2);border-radius:20px;box-shadow:0 0 0 2px var(--gold3),0 18px 40px #000a;color:var(--ink)}
.screen h1{font-size:clamp(30px,4.6vw,50px);margin:8px 0}.screen h2{font-size:clamp(24px,3.4vw,32px);margin:2px 0 8px}
.screen .lede{font-size:16px}.screen .note{margin:8px auto;font-size:13px}
.screen .actions{margin:12px 0 4px}.screen .banner{margin:8px auto}
.screen .bubble{max-width:none;border:0;background:transparent;padding:4px 0;font-size:18px;text-align:center}
.storybox{margin:0}
.vcaption{min-height:0;font-size:16px}.transcript{font-size:14px}
#setup fieldset{margin:8px 0}#setup .opt span{min-height:0;padding:8px}#setup .opt b{font-size:16px}#setup .opt small{font-size:11px}
#setup .choices.three{grid-template-columns:repeat(3,1fr)}
#setup .check{margin:8px auto;font-size:14px}#setup .check small{font-size:12px}
.tally{margin:8px auto}
@media (max-width:760px),(max-aspect-ratio:1/1){
 .screen:not(.wide){right:50%;transform:translateX(50%);top:auto;bottom:14px;width:calc(100% - 24px);max-height:64%;padding:14px 16px}
 .castlayer{left:4%;width:50%;height:42%}.castlayer .c-gigi{object-position:0 100%}.castlayer .c-wick{right:0;top:6%;width:42%}
 #setup .choices.three{grid-template-columns:1fr}.screen .actions{flex-wrap:wrap}
 .masthead nav{display:none}
}
/* the room as a game board */
#play.screen{position:absolute;inset:0;z-index:3;display:flex;flex-direction:column;padding:8px 12px 8px;text-align:left;overflow:hidden}
.hud{order:1;margin:0;padding:6px 12px;flex-wrap:wrap;justify-content:center;flex:none}
.hud .stat{padding:3px 12px;min-width:66px}.hud .stat b{font-size:20px}
.talk{order:2;flex:none;margin:6px auto 0;max-width:900px;width:100%;padding:6px 14px;gap:12px;background:#fffaf1e0;border-color:var(--gold2);border-radius:14px}
.talk p{min-height:0;font-size:15px}.cluenote{flex:none;font-size:12px;color:var(--soft);max-width:34%;line-height:1.25}
.slot{order:3;flex:1;min-height:0;display:flex;align-items:center;justify-content:center;overflow:hidden;margin:6px 0}
.scene{max-width:none;margin:0;flex:none}
.trayhead{order:4;flex:none;margin:0;text-align:center;color:#f1e1b8;font-size:11px}
.tray{order:5;flex:none;justify-content:center;padding:2px 2px 4px;max-width:100%;margin:0 auto}
.tray .chip{width:64px;padding:3px}.tray .chip img{width:36px;height:36px}
.howto{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.offer{position:absolute;z-index:8;left:50%;bottom:104px;transform:translateX(-50%);width:min(600px,92%);margin:0}
.narr{position:absolute;z-index:8;left:16px;bottom:96px;width:min(340px,42%);max-height:44%;overflow:auto;margin:0;padding:10px 14px;text-align:left}
.guide-float{width:22%}
.guide-float .f-gigi{width:62%}
@media (max-width:640px){
 #play.screen{padding:6px 6px}.hud{gap:5px 6px;padding:5px 8px}.hud .stat{min-width:54px}.hud .stat b{font-size:17px}.hud .secondary{padding:4px 12px;min-height:40px}.hud .ghost{min-height:40px;padding:4px 6px;font-size:13px}
 .hud ol{max-width:90px}.talk p{font-size:13px}.cluenote{display:none}.guide-float{width:36%}
 .offer{bottom:92px}.narr{width:92%;max-height:36%}
}
@media (max-height:520px){
 .trayhead{display:none}.tray .chip{width:50px}.tray .chip span{display:none}.tray .chip img{width:34px;height:34px}.talk{display:none}.hud .stat span{display:none}
}

/* iPad and desktop landscape: the collected-treasures tray stands beside the room so the whole room is as large as it can be */
.narr{display:none!important}
.startcard .transcript{margin:6px 0 0;font-size:12px;text-align:left}.startcard .narr-status{margin:6px 0 0;min-height:0}
.startcard{max-height:92%;overflow:auto}
@media (min-width:900px) and (min-aspect-ratio:13/10){
 #play.screen{display:grid;grid-template-columns:minmax(0,1fr) 150px;grid-template-rows:auto auto minmax(0,1fr);column-gap:10px;grid-template-areas:"hud hud" "talk talk" "slot tray"}
 .hud{grid-area:hud}.talk{grid-area:talk}.slot{grid-area:slot;margin:6px 0 0}
 .trayhead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
 .tray{grid-area:tray;display:grid;grid-template-columns:repeat(2,64px);grid-auto-rows:min-content;gap:6px;align-content:start;justify-content:center;overflow-y:auto;overflow-x:hidden;margin:6px 0 0;padding:34px 4px 4px;position:relative;background:#1a0d1c99;border:2px solid var(--gold2);border-radius:14px}
 .tray:before{content:"Collected treasures";position:absolute;top:8px;left:0;right:0;text-align:center;font-size:11px;letter-spacing:1px;text-transform:uppercase;color:#f1e1b8}
 .offer{bottom:34px}
}
.hud ol{max-width:none;flex-wrap:nowrap}
#result:not(.wide){width:min(640px,62%)}
#result .bubble{font-size:16px;line-height:1.45}
#result .tally{display:grid;grid-template-columns:1fr 1fr;column-gap:26px;padding:2px 18px;max-width:none}
#result .tally div{padding:5px 0}#result .tally div:last-child{grid-column:1/-1}
#result .narr-controls .secondary{min-height:40px;padding:6px 16px;font-size:14px}#result .narr-status{margin:4px 0}
#result .banner{padding:8px 12px;font-size:13px}#result .actions{margin:8px 0 0}
#result .actions .primary,#result .actions .secondary{min-height:46px;padding:8px 20px;font-size:15px}
@media (max-width:760px),(max-aspect-ratio:1/1){
 .castlayer{top:46px;bottom:auto;left:2%;width:62%;height:36%}
 .castlayer .c-gigi{object-position:0 100%}
}
.mark.area{width:22%;aspect-ratio:1;height:auto;border:0;pointer-events:none;background:radial-gradient(circle,rgba(255,226,140,.5),rgba(255,226,140,.18) 55%,rgba(255,226,140,0) 72%);animation:areaglow 2.4s ease-in-out infinite}
@keyframes areaglow{50%{opacity:.55}}
@media(prefers-reduced-motion:reduce){.mark.area{animation:none;opacity:.8}}

/* ---- Room first: every menu is a compact dock at the bottom edge, never a block over the room ---- */
.screen:not(.wide){left:auto;right:3%;top:auto;bottom:16px;transform:none;width:min(700px,60%);max-height:40%;padding:10px 18px 12px;border-radius:16px;box-shadow:0 0 0 2px var(--gold3),0 10px 26px #0008}
#setup:not(.wide){max-height:52%;width:min(720px,62%)}
.screen .eyebrow{display:none}
.screen h1{font-size:clamp(24px,3vw,34px);margin:0 0 4px}.screen h2{font-size:clamp(20px,2.4vw,26px);margin:0 0 4px}
.screen .actions{margin:8px 0 0;gap:8px}.screen .actions>*{min-height:44px}
.screen .actions button,.screen .actions a{min-height:44px;padding:8px 18px;font-size:15px}
details.more{margin:4px 0 0;text-align:left;font-size:14px}
details.more>summary{display:flex;align-items:center;min-height:44px;cursor:pointer;font-weight:600;color:var(--aub);list-style:none}
details.more>summary:before{content:"+";display:inline-grid;place-items:center;width:20px;height:20px;margin-right:8px;border:1.5px solid var(--gold3);border-radius:50%;font-size:14px;line-height:1}
details.more[open]>summary:before{content:"−"}
details.more>summary::-webkit-details-marker{display:none}
details.more .lede,details.more .note{margin:4px 0;font-size:14px;text-align:left}
details.more .transcript{margin:6px 0;font-size:14px}
details.more .narr-controls{margin:4px 0;flex-wrap:wrap}
.screen .vcaption{margin:2px 0;font-size:15px;min-height:1.4em}.screen .narr-status{margin:2px 0;min-height:0;font-size:13px}
.screen .bubble{padding:0;font-size:17px}.storybox{margin:0}
#setup fieldset{margin:4px 0;padding:0;border:0}#setup legend{font-size:12px;letter-spacing:1px;text-transform:uppercase;color:var(--soft);padding:0 0 2px}
#setup .choices,#setup .choices.three{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
#setup .opt span{display:block;min-height:44px;padding:6px 8px;text-align:center}
#setup .opt b{font-size:15px}
#setup .opt small{display:none;font-size:11px;line-height:1.25}
#setup .opt input:checked+span small{display:block}
#setup .check{margin:6px 0;text-align:left}
#result:not(.wide){width:min(700px,62%)}
#result .tally{display:flex;flex-wrap:wrap;gap:4px 18px;justify-content:center;padding:0;margin:4px 0}
#result .tally div{padding:2px 0!important;grid-column:auto!important}
#result .banner{margin:4px 0;padding:4px 8px}
/* Wick floats inside the room for the whole search: in the room's own space, beside the ceiling lamp, clear of every treasure */
.wick-room{position:absolute;left:62%;top:8%;width:9%;height:auto;translate:-50% -50%;z-index:3;pointer-events:auto;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;background:none;border:0;box-shadow:none;animation:float 4.2s ease-in-out infinite;filter:drop-shadow(0 0 10px #ffe08a) drop-shadow(0 3px 4px #0008)}
@media(prefers-reduced-motion:reduce){.wick-room{animation:none}}
@media (max-width:760px),(max-aspect-ratio:1/1){
 .screen:not(.wide),#setup:not(.wide),#result:not(.wide){left:10px;right:10px;width:auto;bottom:12px;max-height:46%;transform:none;padding:8px 12px 10px}
 #setup:not(.wide){max-height:58%}
 #setup .choices,#setup .choices.three{grid-template-columns:repeat(3,minmax(0,1fr))}
 #setup .opt b{font-size:14px}
 .wick-room{width:13%}
}
@media (max-height:520px) and (min-aspect-ratio:1/1){
 .screen:not(.wide){max-height:62%}#setup:not(.wide){max-height:70%}
}
/* the pre-search card is a slim strip along the bottom of the room, not a block in the middle */
.startcard,.startcard{top:auto!important;bottom:10px;left:50%!important;transform:translateX(-50%)!important;width:min(94%,600px)!important;max-height:none;overflow:visible;padding:8px 14px 10px;display:flex;flex-wrap:wrap;gap:6px 10px;align-items:center;justify-content:center}
.startcard h3{flex:0 0 100%;margin:0;font-size:18px}.startcard p{flex:0 0 100%;margin:0;font-size:13px;line-height:1.35}
.startcard button,.startcard .secondary{display:inline-flex!important;width:auto!important;margin:0!important;min-height:44px;padding:8px 20px;justify-content:center}
.startcard .transcript,.startcard .narr-status{flex:0 0 100%}
.screen .vcaption{text-align:center}
#result .tally div{display:flex;gap:6px;align-items:baseline;border:0}#result .tally dt{font-size:13px;color:var(--soft)}#result .tally dd{margin:0;font-weight:700}

/* ======== FINAL: child-first. The room is the scenery; no ivory cards anywhere. Controls are small antique-gold-on-dark-wood buttons at the edges. ======== */
.legacy{display:none!important}
.screen:not(.wide){position:absolute;inset:0;left:0;right:0;top:0;bottom:0;transform:none;width:auto;max-width:none;max-height:none;overflow:visible;padding:0;background:none;border:0;border-radius:0;box-shadow:none;pointer-events:none;text-align:center}
.screen:not(.wide):before{content:"";position:absolute;left:0;right:0;bottom:0;height:34%;background:linear-gradient(transparent,#1a0d1ccc);pointer-events:none}
.screen:not(.wide) button,.screen:not(.wide) a,.screen:not(.wide) summary,.screen:not(.wide) details{pointer-events:auto}
.screen h1,.screen h2{position:absolute;left:0;right:0;top:11%;margin:0;color:#fff;text-shadow:0 2px 10px #000,0 0 22px #000a;font-size:clamp(28px,4.6vw,54px)}
.screen h1 em{color:#f1d58b}.screen h2{top:9%;font-size:clamp(22px,3vw,34px)}
.playbtn{position:absolute;left:50%;bottom:7%;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;width:124px;height:124px;border-radius:50%;border:4px solid var(--gold2);background:radial-gradient(circle at 35% 30%,#6a3a1f,#2b160a 75%);color:#f6e3a8;box-shadow:0 0 0 3px #3a2410,0 10px 26px #000a,0 0 30px #ffd97a55;font:700 15px Georgia,serif;letter-spacing:2px;text-transform:uppercase}
.playbtn svg{margin-left:6px}.playbtn:hover,.playbtn:focus-visible{box-shadow:0 0 0 3px #3a2410,0 10px 26px #000a,0 0 38px #ffd97aaa}
.nextbtn{position:absolute;right:max(4%,22px);bottom:14px;min-height:44px;padding:8px 22px;border-radius:12px;border:2px solid var(--gold2);background:linear-gradient(#5a3519,#33200f 55%,#24150a);color:#f6e3a8;font:italic 700 18px Georgia,serif;box-shadow:0 0 0 1px #1a0d06,0 5px 12px #000a;text-shadow:0 1px 0 #0008;text-decoration:none;display:inline-flex;align-items:center;gap:6px}
.nextbtn:active{transform:translateY(1px)}
.nextbtn.vplay{right:auto;left:50%;transform:translateX(-50%);bottom:70px;font-size:15px}
.hear{position:absolute;left:max(3%,18px);bottom:14px;z-index:6;min-height:44px;min-width:44px;padding:6px 14px;border-radius:12px;border:2px solid var(--gold2);background:linear-gradient(#5a3519,#33200f 55%,#24150a);color:#f6e3a8;font:italic 15px Georgia,serif;display:inline-flex;align-items:center;gap:6px;opacity:.92}
body > main .hear.gear,.hear.gear{font-size:22px;padding:4px 12px;font-style:normal}
.hear[hidden]{display:none}
.hear span:not([aria-hidden]){font-size:14px}
#story .bubble,#result .bubble,.vcaption{position:absolute;left:50%;bottom:74px;transform:translateX(-50%);width:min(760px,90%);max-width:none;margin:0;padding:0;background:none;border:0;color:#fff;text-shadow:0 1px 3px #000,0 0 14px #000;font:italic clamp(16px,2.2vw,22px)/1.4 Georgia,serif;text-align:center;pointer-events:none}
#result .bubble{bottom:132px;font-size:clamp(14px,1.8vw,18px)}
.vcaption{min-height:0}.screen .narr-status{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.banner{position:absolute;left:50%;bottom:150px;transform:translateX(-50%);width:max-content;max-width:90%;margin:0;padding:8px 14px;background:#24150acc;border:1px solid var(--gold2);color:#f6e3a8;border-radius:12px;pointer-events:auto}
#resume button{min-height:44px;margin-left:10px;border:1px solid var(--gold2);background:#5a3519;color:#f6e3a8;border-radius:10px;padding:6px 14px}
.strip{position:absolute;left:0;right:0;top:calc(9% + 46px);margin:0;color:#f6e3a8;font:700 clamp(18px,2.6vw,28px) Georgia,serif;text-shadow:0 2px 8px #000}
#result .actions{position:absolute;left:0;right:0;bottom:14px;margin:0;justify-content:center;gap:12px}
#result .nextbtn{position:static}
#result details.more{position:absolute;right:max(3%,18px);top:14px;z-index:6;margin:0;text-align:left}
#result details.more>summary{color:#f6e3a8;text-shadow:0 1px 4px #000;font-size:14px;justify-content:flex-end}
#result details.more>summary:before{border-color:var(--gold2)}
#result details.more[open]>*:not(summary){background:#24150af2;border:1px solid var(--gold2);border-radius:12px;color:#f6e3a8;margin:4px 0;padding:8px 12px;width:min(360px,88vw)}
#result .tally{display:block}#result .tally div{display:flex;justify-content:space-between}#result .tally dt{color:#e9d49a}
#result details .secondary{min-height:44px;background:#5a3519;color:#f6e3a8;border-color:var(--gold2)}
.storybox{display:block}
/* the room screen */
#play.screen{display:grid;grid-template-columns:auto minmax(0,1fr) 62px;grid-template-rows:minmax(46px,auto) minmax(0,1fr);grid-template-areas:"hud talk tray" "slot slot tray";gap:4px 8px;padding:6px 8px}
.hud{grid-area:hud;order:0;padding:2px 8px;gap:6px;flex-wrap:nowrap;background:#1a0d1ccc;border:1.5px solid var(--gold3);box-shadow:none;border-radius:12px;height:44px}
.hud .stat{background:none;border:0;padding:0 4px;min-width:0;display:flex;flex-direction:column;justify-content:center}
.hud .stat span{font-size:8px;line-height:1}.hud .stat b{font-size:17px;line-height:1.05}
.hud .stat.prog{display:none}
.hud .secondary,.hud .ghost{min-height:40px;min-width:40px;padding:4px 10px;font-size:14px;border-radius:10px;text-decoration:none;border:1.5px solid var(--gold2);background:linear-gradient(#5a3519,#33200f);color:#f6e3a8}
.hud .ghost span{font-size:18px}
.hud .secondary:disabled{opacity:.6}
.talk{grid-area:talk;order:0;margin:0;max-width:none;width:auto;min-width:0;padding:0 4px;background:none;border:0;display:flex;align-items:center;gap:8px;text-align:left}
.talk p{font:italic 15px/1.25 Georgia,serif;color:#fff;text-shadow:0 1px 3px #000,0 0 10px #000;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:0}
.cluenote{display:none}
.talk #say-replay{min-height:40px;border:1.5px solid var(--gold2);background:#33200f;color:#f6e3a8;border-radius:10px;text-decoration:none;padding:4px 10px}
.slot{grid-area:slot;margin:0}
.trayhead,.howto,.narr{display:none!important}
.tray{grid-area:tray;display:grid;grid-template-columns:1fr;grid-auto-rows:44px;gap:3px;align-content:start;overflow-y:auto;overflow-x:hidden;padding:3px;margin:0;background:#1a0d1ccc;border:1.5px solid var(--gold3);border-radius:12px;position:static}
.tray:before{content:none!important}
.tray .chip{width:100%;height:44px;padding:0;border-radius:8px;background:#f8f3e9;position:relative;display:flex;align-items:center;justify-content:center}
.tray .chip span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.tray .chip img{width:38px;height:38px}
.tray .chip.done{background:#cfe3d8}.tray .chip.done:after{content:"✓";position:absolute;right:2px;bottom:-1px;color:#1f7a5a;font-weight:700;font-size:15px}.tray .chip.done span:after{content:none}
.tray .chip[aria-pressed=true]{box-shadow:0 0 0 2px var(--gold2)}
.scene{border-width:2px}
.offer{left:50%;bottom:14px;width:max-content;max-width:94%;padding:6px 10px;display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:center;background:#24150af2;border:2px solid var(--gold2);border-radius:14px;color:#f6e3a8}
.offer p{margin:0;font:italic 15px Georgia,serif;color:#f6e3a8}.offer .actions{margin:0;gap:8px}
.offer .primary,.offer .secondary{min-height:44px;padding:6px 16px;font-size:14px;border:2px solid var(--gold2);background:linear-gradient(#5a3519,#33200f);color:#f6e3a8;border-radius:10px}
.wick-room{width:10%;left:62%;top:9%}
@media (max-aspect-ratio:13/10),(max-width:899px){
 #play.screen{grid-template-columns:minmax(0,1fr);grid-template-rows:46px minmax(0,1fr) auto auto;grid-template-areas:"hud" "slot" "talk" "tray";padding:6px 6px}
 .hud{justify-self:stretch;justify-content:space-between}.hud #score-stat{display:none}
 .talk p{font-size:13px;-webkit-line-clamp:2}.talk{min-height:34px}
 .tray{grid-template-columns:repeat(12,minmax(40px,1fr));grid-auto-rows:44px;overflow-x:auto;overflow-y:hidden;height:52px;gap:3px}
 .wick-room{width:15%}
 .nextbtn{right:14px}.playbtn{width:108px;height:108px}
 .banner{bottom:140px}
}
@media (max-width:760px),(max-aspect-ratio:1/1){
 .screen h1{top:15%}.screen h2{top:13%}.strip{top:calc(13% + 40px)}
 #result .actions{flex-wrap:nowrap;gap:8px;left:6px;right:6px}#result .nextbtn{font-size:15px;padding:8px 12px}
 #result details.more{top:auto;bottom:66px;right:12px}
 #story .bubble,.vcaption{bottom:70px}#result .bubble{bottom:128px}
 .masthead nav{display:none}
}
@media(prefers-reduced-motion:reduce){.hear,.nextbtn{transition:none}}
#result:not(.wide),#setup:not(.wide),#enter:not(.wide),#welcome:not(.wide),#story:not(.wide){left:0;right:0;top:0;bottom:0;width:auto;max-height:none;padding:0}
#result details.more{top:auto;bottom:14px}
#result details.more[open]>*:not(summary){position:absolute;right:0;bottom:50px}
@media (max-width:760px),(max-aspect-ratio:1/1){#result details.more{bottom:66px;right:12px}#result details.more[open]>*:not(summary){bottom:46px}}
#welcome-title,#story-title{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);top:0}
#hint-btn{white-space:nowrap}
@media (max-width:760px){#hint-btn{font-size:13px;padding:4px 8px}}
@media (max-width:760px),(max-aspect-ratio:1/1){#enter h1{top:auto;bottom:190px}}

/* Keep story navigation within Safari's visible viewport, above its safe area.
   The text remains the accessible name; only the visual is a transparent gold arrow. */
#welcome-next,#story-next{
 position:absolute;z-index:8;right:max(22px,env(safe-area-inset-right));
 bottom:max(28px,env(safe-area-inset-bottom));width:64px;height:64px;
 min-width:64px;min-height:64px;padding:0;display:flex;align-items:center;
 justify-content:center;background:transparent;border:0;border-radius:8px;
 box-shadow:none;font-size:0;color:#f6d478;text-shadow:none;pointer-events:auto;
}
#welcome-next::before,#story-next::before{
 content:"➜";font:48px/1 Arial,sans-serif;
 filter:drop-shadow(0 2px 2px #140b05) drop-shadow(0 0 3px #140b05);
}
#welcome-next:focus-visible,#story-next:focus-visible{outline:3px solid #f6d478;outline-offset:2px}
#story .bubble,.screen .vcaption{bottom:max(104px,calc(env(safe-area-inset-bottom) + 80px))}
/* pause, continue, chapter line */
.pausebar{position:absolute;left:0;right:0;bottom:14px;z-index:9;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 max(3%,18px);pointer-events:none}
.pausebar button{pointer-events:auto;position:static}
.pausebar p{margin:0;flex:1;text-align:center;color:#fff;text-shadow:0 1px 3px #000,0 0 14px #000;font:italic 20px Georgia,serif}
.pausebar .nextbtn{position:static}
#play.screen:has(#viewport.paused){background:#1a0d1c}
.chapter{position:absolute;left:0;right:0;top:calc(9% + 84px);margin:0;color:#f1e1b8;font:italic clamp(13px,1.6vw,17px) Georgia,serif;text-shadow:0 2px 8px #000;pointer-events:none}
@media (max-width:760px),(max-aspect-ratio:1/1){.chapter{top:calc(13% + 76px)}}
.wick-room.glow{filter:drop-shadow(0 0 18px #fff3b0) drop-shadow(0 0 8px #ffe08a) drop-shadow(0 3px 4px #0008)}
#play.screen:has(#viewport.paused) .talk{visibility:hidden}

.wick-room:focus-visible{outline:2px solid #ffe08a;outline-offset:6px;border-radius:50%}

/* ---- layout fixes: nothing overlays the room art ------------------------------------- */
/* 1. A slim header of its own above the stage, so the links never sit on the shelves. */
.masthead{position:absolute;z-index:7;top:0;left:0;right:0;height:38px;padding:0 18px;background:#1a0d1c;border-bottom:1px solid var(--gold3);align-items:center;pointer-events:auto;box-sizing:border-box}
.masthead .wordmark{font-size:15px;letter-spacing:3px;line-height:1}.masthead .wordmark span{display:none}
main#stage{inset:48px 10px 10px}
body[data-screen=play] main#stage{inset:10px}
@media (max-width:760px),(max-aspect-ratio:1/1){
 .masthead nav{display:flex;gap:10px;font-size:12px}.masthead nav a:not([href="/salon/"]):not([href*="enchanted-dollhouse"]){display:none}
 .masthead{padding:0 12px}
}
/* 2. Zoom buttons live in the toolbar row, outside the room. */
.zoom{position:static;grid-area:zoom;flex-direction:row;gap:4px;align-self:center;justify-self:end;z-index:5}
.zoom button{width:40px;height:40px;border-radius:10px;border:1.5px solid var(--gold2);background:linear-gradient(#5a3519,#33200f);color:#f6e3a8;font-size:20px;padding:0}
#play.screen{grid-template-columns:auto minmax(0,1fr) auto 62px;grid-template-rows:minmax(46px,auto) minmax(0,1fr);grid-template-areas:"hud talk zoom tray" "slot slot slot tray"}
@media (max-aspect-ratio:13/10),(max-width:899px){
 #play.screen{grid-template-columns:minmax(0,1fr);grid-template-rows:46px minmax(0,1fr) auto auto auto;grid-template-areas:"hud" "slot" "zoom" "talk" "tray"}
}
/* 3. Help Gigi: small, standing on the floor at the bottom right; the only Wick in the room is the floating one. */
.guide-float{left:auto;right:1.5%;top:auto;bottom:0;width:12%;max-width:150px;transform:none}
.f-gigi{width:100%}.f-wick{display:none!important}
/* 4. Story, welcome and ending Gigi: feet on the open floor of each scene, Wick above her head, clear of her hand. */
.castlayer{height:82%}
.castlayer .c-wick{left:56%;right:auto;top:-17%;width:30%}
body[data-chapter=underwater] .castlayer{left:50%}
body[data-chapter=castle] .castlayer,body[data-chapter=conservatory] .castlayer{left:3%}
@media (max-width:760px),(max-aspect-ratio:1/1){
 .castlayer,body[data-chapter] .castlayer{top:auto;bottom:25%;left:4%;width:56%;height:44%}
 body[data-chapter=underwater] .castlayer{left:34%}
 .castlayer .c-wick{left:50%;top:-18%;width:34%}
}

/* Chapters five onward: some treasures hide by silhouette (a dark shape on its shadow board) or by pattern (blended into a print). Once found, they show their true colours. */
.sprite.hide-silhouette img{filter:brightness(.2) contrast(1.15)}
.sprite.hide-pattern img{opacity:.9;filter:saturate(.7) contrast(.95);mix-blend-mode:multiply}
.sprite.found img{filter:none;opacity:1;mix-blend-mode:normal}

/* The help offer takes the caption's place in the layout (the caption hides while it is open), so it never covers the room, the picture strip or the zoom buttons. */
.offer{position:static!important;transform:none!important;left:auto!important;bottom:auto!important;order:2;flex:none;width:100%!important;max-width:900px;margin:6px auto 0!important;box-sizing:border-box}
.talk:has(+ .offer:not([hidden])){display:none!important}
@media (min-width:900px) and (min-aspect-ratio:13/10){ .offer{grid-area:talk;justify-self:center} }
@media (max-aspect-ratio:13/10),(max-width:899px){ .offer{grid-area:talk} }

/* Help Gigi stands IN the room: her feet sit on the floor anchor of each chapter (set from game.js as --gx/--gy/--gh, in room coordinates), so she keeps her place on the floor at every zoom and screen size. She never takes taps. */
#world .guide-float{position:absolute!important;left:var(--gx,92%)!important;top:var(--gy,96%)!important;right:auto!important;bottom:auto!important;width:auto!important;max-width:none!important;height:var(--gh,20%)!important;z-index:4;pointer-events:none!important;transition:opacity .4s}
#world .guide-float,#world .guide-float.on{transform:translate(-50%,-99.5%)!important} /* the picture has about half a percent of empty edge under her feet */
#world .guide-float .f-gigi{height:100%!important;width:auto!important;max-width:none!important;filter:drop-shadow(0 3px 3px #0009)}
#world .guide-float:after{content:"";position:absolute;left:10%;right:10%;bottom:-1%;height:4%;border-radius:50%;background:radial-gradient(#0007,#0000 70%);z-index:-1}

/* Portrait: Gigi's boots stand on the floor of the room, not on the line where the wall meets it (chapters whose floor starts near 0.72 of the picture). Chapters two to four keep their approved spot. */
@media (max-width:760px),(max-aspect-ratio:1/1){
 body[data-chapter]:not([data-chapter=underwater]):not([data-chapter=castle]):not([data-chapter=conservatory]) .castlayer{bottom:20%}
}
body[data-chapter=dollhouse] .castlayer{}

/* ================= round 4: the stage screens get a dock of their own =================
   Title, story and ending: the room art (with Gigi and Wick standing in it) fills the area above a dock;
   every button, caption and title lives in the dock, never on the picture. */
body[data-screen=enter]{--dock:158px}
body[data-screen=welcome],body[data-screen=story]{--dock:236px}
body[data-screen=result]{--dock:min(62%,460px)}
body[data-screen=setup]{--dock:236px}
@media (min-width:900px) and (min-aspect-ratio:13/10){body[data-screen=enter]{--dock:176px}body[data-screen=welcome],body[data-screen=story]{--dock:200px}body[data-screen=result]{--dock:300px}}
body:not([data-screen=play]) .backdrop{inset:0 0 var(--dock,0) 0}
body:not([data-screen=play]) .backdrop:after{display:none}
body:not([data-screen=play]) .castlayer{top:0!important;bottom:var(--dock,0)!important;height:auto!important}
body:not([data-screen=play]) .castlayer .c-gigi{height:97%;bottom:3%;object-position:0 100%}
body:not([data-screen=play]) .castlayer .c-wick{top:5%}
body[data-screen=enter] #enter:not([hidden]),body[data-screen=welcome] #welcome:not([hidden]),body[data-screen=story] #story:not([hidden]),body[data-screen=result] #result:not([hidden]){
 position:absolute;left:0;right:0;top:auto;bottom:0;width:auto;height:var(--dock);max-height:none;transform:none;box-sizing:border-box;
 padding:12px max(16px,env(safe-area-inset-right)) 84px max(16px,env(safe-area-inset-left));display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;overflow:hidden;
 background:linear-gradient(#2b180a,#190c06);border:0;border-top:2px solid var(--gold2);border-radius:0;box-shadow:0 -10px 24px #000a;z-index:5}
body[data-screen=enter] #enter:not([hidden]){padding-bottom:12px}
body[data-screen=result] #result:not([hidden]){justify-content:flex-start;padding-bottom:126px;padding-top:10px}
/* captions and titles are ordinary text in the dock */
body[data-screen] #enter h1,body[data-screen] #result h2{position:static;margin:0 0 6px;font-size:clamp(22px,6vw,34px);line-height:1.1;color:#fff;text-shadow:none}
body[data-screen] #story .storybox,body[data-screen] #welcome .storybox,body[data-screen] #result .storybox{display:block;width:100%;max-width:760px;margin:0 auto;overflow-y:auto;min-height:0;flex:0 1 auto}
body[data-screen] #story .bubble,body[data-screen] #result .bubble,body[data-screen] .screen .vcaption{position:static;transform:none;left:auto;bottom:auto;width:auto;max-width:760px;margin:0 auto;padding:0;color:#f3e6c8;text-shadow:none;font:italic 17px/1.4 Georgia,serif;text-align:center}
body[data-screen=result] #result .bubble{font-size:16px}
body[data-screen] #result .strip,body[data-screen] #result .chapter{position:static;margin:2px 0;font-size:15px;line-height:1.3;color:#f6e3a8;text-shadow:none}
body[data-screen] #result .strip{font-weight:700}
body[data-screen] #enter .banner{position:static;transform:none;margin:4px 0}
/* the buttons: big, in the dock's bottom row */
body[data-screen=enter] .playbtn{position:static;transform:none;width:84px;height:84px;flex:none}
body[data-screen=enter] .playbtn svg{width:34px;height:34px}
body[data-screen=enter] #sound-open{position:absolute;left:14px;bottom:14px}
body[data-screen=enter] #enter{padding-top:8px}
#welcome-next,#story-next{bottom:12px;right:max(14px,env(safe-area-inset-right))}
body[data-screen=welcome] #hear-again,body[data-screen=story] #hear-again{left:14px;bottom:14px;position:absolute}
body[data-screen=result] #hear-again{left:14px;bottom:72px}
body[data-screen=result] #result .actions{position:absolute;left:10px;right:10px;bottom:12px;margin:0;display:flex;flex-wrap:nowrap;gap:8px;justify-content:center}
body[data-screen=result] #result .actions .nextbtn{flex:1 1 0;min-width:0;min-height:52px;font-size:15px;padding:6px 8px;display:flex;align-items:center;justify-content:center;text-align:center;line-height:1.15}
body[data-screen=result] #result details.more{position:static;margin:6px 0 0;max-height:40%;overflow:auto;width:100%;max-width:760px;text-align:left}
body[data-screen=result] #result details.more[open]>*:not(summary){position:static}
body[data-screen=result] #result details.more summary{min-height:44px;display:flex;align-items:center}
/* short landscape phone: the dock moves to the right side so the art keeps its height */
@media (max-height:520px) and (min-aspect-ratio:1/1){
 body[data-screen]:not([data-screen=play]){--dockw:min(44%,400px)}
 body:not([data-screen=play]) .backdrop{inset:0 var(--dockw) 0 0}
 body:not([data-screen=play]) .castlayer{bottom:0!important;left:2%;width:calc((100% - var(--dockw)) * .8);right:auto}
 body[data-screen=enter] #enter:not([hidden]),body[data-screen=welcome] #welcome:not([hidden]),body[data-screen=story] #story:not([hidden]),body[data-screen=result] #result:not([hidden]){left:auto;right:0;top:0;bottom:0;width:var(--dockw);height:auto;border-top:0;border-left:2px solid var(--gold2);box-shadow:-10px 0 24px #000a}
 body[data-screen=welcome] #hear-again,body[data-screen=story] #hear-again{left:calc(100% - var(--dockw) + 12px)}
 body[data-screen=result] #hear-again{left:calc(100% - var(--dockw) + 12px);bottom:68px}
 body[data-screen=enter] #sound-open{left:auto;right:calc(var(--dockw) - 58px)}
 body[data-screen] #enter h1,body[data-screen] #result h2{font-size:22px}
 body[data-screen] #story .bubble,body[data-screen] .screen .vcaption{font-size:15px}
}
/* Gigi stands at the left of the art, Wick hovers at its right edge, clear of her head, hands and what she holds */
body:not([data-screen=play]) .castlayer{left:0!important;right:0!important;width:auto!important}
body:not([data-screen=play]) .castlayer .c-gigi{left:3%;width:auto;max-width:62%;height:97%;object-fit:contain;object-position:0 100%}
body:not([data-screen=play]) .castlayer .c-wick{left:auto;right:4%;top:6%;width:clamp(64px,22%,150px)}
body[data-screen=result]{--dock:min(66%,500px)}
body[data-screen=result] #result .bubble{font-size:15px;line-height:1.35}
@media (min-width:900px) and (min-aspect-ratio:13/10){body[data-screen=result]{--dock:300px}body:not([data-screen=play]) .castlayer .c-gigi{left:6%;max-width:40%}body:not([data-screen=play]) .castlayer .c-wick{right:auto;left:min(46%,calc(6% + 340px));width:clamp(80px,9%,150px)}}
@media (max-height:520px) and (min-aspect-ratio:1/1){body:not([data-screen=play]) .castlayer{right:var(--dockw)!important;left:0!important;width:auto!important}body:not([data-screen=play]) .castlayer .c-gigi{max-width:58%}}

/* underwater keeps its approved place on the other side of the picture */
body[data-chapter=underwater]:not([data-screen=play]) .castlayer .c-gigi{left:auto;right:3%}
body[data-chapter=underwater]:not([data-screen=play]) .castlayer .c-wick{right:auto;left:4%}
@media (min-width:900px) and (min-aspect-ratio:13/10){body[data-chapter=underwater]:not([data-screen=play]) .castlayer .c-gigi{left:auto;right:6%}body[data-chapter=underwater]:not([data-screen=play]) .castlayer .c-wick{left:min(46%,calc(6% + 340px));right:auto}}

/* ================= round 4: portrait play ================= */
#hosts{display:contents}
.trayrow{display:contents}.traynav{display:none}
@media (max-aspect-ratio:1/1),(min-aspect-ratio:1/1) and (min-height:521px) and (max-width:899px),(min-aspect-ratio:1/1) and (max-aspect-ratio:13/10) and (min-height:521px){
 #play.screen{grid-template-rows:46px minmax(0,1fr) auto auto auto!important;grid-template-areas:"hud" "slot" "hosts" "talk" "tray"!important}
 /* the hosts' strip: Gigi stands on a floor ledge, Wick hovers beside her, the zoom buttons sit at the other end. Never over the art. */
 #hosts{display:flex;grid-area:hosts;position:relative;align-items:flex-end;gap:10px;height:96px;padding:0 6px 8px;margin:2px 0 0;box-sizing:border-box}
 #hosts:before{content:"";position:absolute;left:0;right:0;bottom:0;height:8px;border-radius:4px;background:linear-gradient(#a06a32,#4a2b12);border-top:1px solid #e7c66f;box-shadow:0 2px 6px #0008}
 #hosts .guide-float{position:relative!important;left:auto!important;top:auto!important;right:auto!important;bottom:auto!important;transform:none!important;opacity:1!important;height:100%!important;width:auto!important;max-width:none!important;flex:none;z-index:2;pointer-events:none!important;transition:none}
 #hosts .guide-float:after{content:"";position:absolute;left:8%;right:8%;bottom:-3px;height:6px;border-radius:50%;background:radial-gradient(#000a,#0000 70%)}
 #hosts .guide-float .f-gigi{height:100%!important;width:auto!important;max-width:none!important;display:block;filter:drop-shadow(0 2px 2px #0008)}
 #hosts .guide-float.speaking .f-gigi{animation:sway 1.8s ease-in-out infinite;transform-origin:50% 100%}
 #hosts .wick-room{position:relative!important;left:auto!important;top:auto!important;translate:none!important;flex:none;width:56px!important;height:auto;align-self:flex-start;margin:4px 0 0 14px;z-index:3;animation:float 4.2s ease-in-out infinite}
 #hosts .wick-room:before{content:""}
 #hosts .zoom{order:5;grid-area:auto;margin:0 0 0 auto;align-self:center;gap:6px;position:relative;z-index:3}
 #hosts .zoom button{width:46px;height:46px}
 .talk{min-height:calc(14.5px * 1.35 * 3 + 14px);align-items:flex-start}
 .talk p{display:block!important;-webkit-line-clamp:unset!important;overflow:visible!important;font-size:14.5px;line-height:1.35;color:#fff}
 .talk{position:relative}
 /* the tray: a row of treasures with arrow buttons at each end */
 .trayrow{display:flex;grid-area:tray;gap:4px;align-items:center;min-width:0}
 .traynav{display:flex;align-items:center;justify-content:center;flex:none;width:44px;height:52px;border-radius:10px;border:1.5px solid var(--gold2);background:linear-gradient(#5a3519,#33200f);color:#f6e3a8;font:700 28px/1 Georgia,serif;padding:0}
 .traynav:disabled{opacity:.35}
 .trayrow .tray{flex:1;min-width:0;grid-template-columns:none!important;grid-auto-flow:column;grid-auto-columns:minmax(48px,48px);scroll-snap-type:x proximity;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
 .tray .chip{scroll-snap-align:start;width:48px}
}
@media (max-aspect-ratio:1/1),(min-aspect-ratio:1/1) and (min-height:521px) and (max-width:899px),(min-aspect-ratio:1/1) and (max-aspect-ratio:13/10) and (min-height:521px){#play.screen:has(#viewport.paused) .trayrow,#play.screen:has(#viewport.paused) #hosts{visibility:hidden}}
@media (max-aspect-ratio:1/1) and (max-height:640px),(min-aspect-ratio:1/1) and (min-height:521px) and (max-height:640px) and (max-width:899px){#hosts{height:80px}}
@media (prefers-reduced-motion:reduce){#hosts .wick-room,#hosts .guide-float.speaking .f-gigi{animation:none}}
/* edge cues: the room goes on past the frame, drag toward them */
.scene:before,.scene:after{content:"";position:absolute;top:0;bottom:0;width:26px;z-index:6;pointer-events:none;opacity:0;transition:opacity .25s;display:flex;align-items:center;font:700 26px/1 Georgia,serif;color:#f6e3a8;text-shadow:0 0 6px #000,0 0 3px #000}
.scene:before{left:0;background:linear-gradient(90deg,#1a0d1caa,#1a0d1c00);content:"‹";padding-left:3px}
.scene:after{right:0;background:linear-gradient(270deg,#1a0d1caa,#1a0d1c00);content:"›";justify-content:flex-end;padding-right:3px}
.scene.pan-l:before,.scene.pan-r:after{opacity:1}
/* generous tap targets and a calm hover, inside the strip */
@keyframes hostbob{50%{transform:translateY(-4px)}}
@keyframes hostsway{50%{transform:rotate(.8deg)}}
@media (max-aspect-ratio:1/1),(min-aspect-ratio:1/1) and (min-height:521px) and (max-width:899px),(min-aspect-ratio:1/1) and (max-aspect-ratio:13/10) and (min-height:521px){
 #play.screen{grid-template-rows:54px minmax(0,1fr) auto auto auto!important}
 .hud{min-height:0}
 .hud button,.hud a.ghost,.hud .ghost,.hud .secondary{min-width:46px;min-height:46px;height:46px;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center}
 #hosts{height:100px}
 #hosts .wick-room{animation:hostbob 3.6s ease-in-out infinite!important;margin-top:12px}
 #hosts .guide-float.speaking .f-gigi{animation:hostsway 1.8s ease-in-out infinite}
 .talk #say-replay,#say-replay{min-height:46px;min-width:62px}
}
@media (max-aspect-ratio:1/1) and (max-height:640px),(min-aspect-ratio:1/1) and (min-height:521px) and (max-height:640px) and (max-width:899px){#hosts{height:84px}}
@media (prefers-reduced-motion:reduce){#hosts .wick-room{animation:none!important}}
/* ending dock: Hear again sits top right of the dock, the three choices fill the bottom row */
body[data-screen=result] #result:not([hidden]){padding-bottom:76px;padding-left:max(16px,calc(env(safe-area-inset-left) + 4px));padding-right:max(16px,env(safe-area-inset-right))}
body[data-screen=result] #hear-again{left:auto;right:12px;top:auto;bottom:auto;position:absolute;z-index:7}
body[data-screen=result] #result h2{padding:0 56px}
@media (max-width:760px),(max-aspect-ratio:1/1){body[data-screen=result] #hear-again span:not([aria-hidden]){display:none}body[data-screen=result] #hear-again{min-width:46px;min-height:46px;padding:4px 10px}}
body[data-screen=result]{--dock:min(62%,440px)}
@media (min-width:900px) and (min-aspect-ratio:13/10){body[data-screen=result]{--dock:300px}body[data-screen=result] #result .actions{left:max(10px,calc(50% - 340px));right:max(10px,calc(50% - 340px))}}
@media (max-height:520px) and (min-aspect-ratio:1/1){
 body[data-screen]:not([data-screen=play]){--dockw:min(52%,460px)}
 body[data-screen=result] #hear-again{left:auto;right:12px}
 body[data-screen=result] #result .chapter{display:none}
 body[data-screen=result] #result .bubble{font-size:13.5px;line-height:1.3}
 body[data-screen=result] #result:not([hidden]){padding-bottom:70px;padding-top:8px}
 body[data-screen=result] #result .actions .nextbtn{min-height:48px;font-size:13px}
 body[data-screen=result] #result h2{font-size:19px}
}
body[data-screen=result] #hear-again{top:calc(100% - var(--dock) + 10px);bottom:auto}
body[data-screen=result]{--dock:min(64%,460px)}
@media (min-width:900px) and (min-aspect-ratio:13/10){
 body[data-screen=result]{--dock:300px}
 body:not([data-screen=play]) .castlayer .c-wick{left:auto;right:6%;width:clamp(80px,9%,150px)}
 body[data-chapter=underwater]:not([data-screen=play]) .castlayer .c-wick{right:auto;left:6%}
}
@media (max-height:520px) and (min-aspect-ratio:1/1){body[data-screen=result] #hear-again{top:10px}}
@media (max-width:380px){body[data-screen=result] #result .bubble{font-size:14px;line-height:1.3}body[data-screen] #result .strip,body[data-screen] #result .chapter{font-size:13px}}

/* ---- The ten approved rooms (body.finalart): Geneva's approved layout proof. In landscape play and in the story scene Gigi stands at left 4%, bottom 5% of the room, 74% of its height (sway pivots at 42% 100%), and Wick hovers at left 27%, top 15%, 6% of its width. The portrait hosts strip is separate and unchanged. ---- */
body.finalart:not(.hostsbar) #world .guide-float .f-gigi{transform-origin:42% 100%}
body.finalart:not(.hostsbar) #world .guide-float:after{display:none}
body.finalart:not(.hostsbar) #world .wick-room{width:6%!important;height:auto}
body.finalart:not([data-screen=play]):not(.hostsbar) .backdrop img{position:absolute;left:var(--rl,0);top:var(--rt,0);width:var(--rw,100%);height:var(--rh,100%);object-fit:cover}
body.finalart:not([data-screen=play]):not(.hostsbar) .castlayer{left:var(--rl2,0)!important;top:var(--rt2,0)!important;right:auto!important;bottom:auto!important;width:var(--rw,100%)!important;height:var(--rh,100%)!important}
body.finalart:not([data-screen=play]):not(.hostsbar) .castlayer .c-gigi{left:4%!important;bottom:5%!important;right:auto!important;top:auto!important;height:74%!important;width:auto!important;max-width:none!important;object-fit:contain;transform-origin:42% 100%}
body.finalart:not([data-screen=play]):not(.hostsbar) .castlayer .c-wick{left:27%!important;top:15%!important;right:auto!important;width:6%!important;height:auto!important}

/* ---- Chapters one to four, landscape opening/story/ending screens (body.fitroom): the whole room picture is shown at its own 3:2 shape, floor included, instead of being cropped by "cover" into a shallow strip. Gigi and Wick stand inside that room rectangle. Portrait keeps the hosts strip; play view is unchanged. ---- */
@media (min-width:900px) and (min-aspect-ratio:13/10){body[data-screen=enter]:not(.finalart){--dock:152px}}
body.fitroom:not(.finalart):not([data-screen=play]):not(.hostsbar) .backdrop img{position:absolute;left:var(--rl,0);top:var(--rt,0);width:var(--rw,100%);height:var(--rh,100%);object-fit:fill}
body.fitroom:not(.finalart):not([data-screen=play]):not(.hostsbar) .castlayer{left:var(--rl2,0)!important;top:var(--rt2,0)!important;right:auto!important;bottom:auto!important;width:var(--rw,100%)!important;height:var(--rh,100%)!important}
body.fitroom:not(.finalart):not([data-screen=play]):not(.hostsbar) .castlayer .c-gigi{height:80%!important;bottom:3%!important;max-width:45%!important}
/* Conservatory opening and story (landscape): Gigi stands on the open stone floor between the rug and the potting bench, both soles clear of the desk, basket and rug, at a size that fits the depth of the room. */
body[data-chapter=conservatory].fitroom:not(.finalart):not([data-screen=play]):not(.hostsbar) .castlayer .c-gigi{left:50%!important;bottom:4%!important;height:62%!important;max-width:30%!important}


/* The recovered paintings already include both hosts. All controls belong
   outside their painted silhouettes except Wick's transparent help button. */
#welcome-stage, #guide-float, #gigi-story, #gigi-end, #gigi-talk, #gigi-offer,
#gigi-welcome, #play .avatar { display:none!important; }
body:not([data-screen=play]) .backdrop img#backdrop { object-fit:contain!important; width:100%; height:100%; }
body[data-screen=play] .backdrop { visibility:hidden; }
#world #wick-room { width:6%; height:10%; min-width:0; min-height:0; padding:0;
  border:0; background:transparent; box-shadow:none; animation:none; transform:none; }
#world #wick-room:focus-visible { outline:2px solid #fff1a8; }
@media (prefers-reduced-motion:no-preference) {
  #room, #backdrop { filter:url(#painted-motion); }
}

/* Fill the phone's story area while keeping Gigi's side of the train in view. */
@media (max-width: 640px) and (orientation: portrait) {
  body[data-chapter=midnight-train][data-screen=story] .backdrop img#backdrop {
    object-fit: cover !important;
    object-position: 28% center;
  }
}
