:root{color-scheme:dark;--bg:#10131c;--panel:#1b2030;--line:#34384a;--gold:#ddc38c;--muted:#a8adbd;--text:#f5f0e7;--blue:#91bffa;font-family:"Yu Gothic UI","Meiryo",sans-serif}*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at top,#292d3e,#0b0e15 75%);color:var(--text);min-height:100vh}button,input,select,textarea{font:inherit}button{cursor:pointer;border:1px solid #65627666;background:#202537;color:var(--text);border-radius:5px;padding:9px 13px;transition:background .15s,border .15s}button:hover{background:#394052;border-color:var(--gold)}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--gold);outline-offset:2px}button.active,.primary{background:#66563b;border-color:var(--gold)}button:disabled{opacity:.4;cursor:default}[hidden]{display:none!important}input,select,textarea{background:#111725;border:1px solid var(--line);color:var(--text);padding:8px;border-radius:4px;max-width:100%}textarea{resize:vertical;width:100%;min-height:82px}input[type=range]{padding:0;accent-color:var(--gold)}#app{display:flex;min-height:100vh;align-items:center;justify-content:center;gap:14px;padding:18px}#player{width:min(1360px,100%);min-width:0}#stage{width:100%;aspect-ratio:16/9;position:relative;overflow:hidden;background:#101019;isolation:isolate;box-shadow:0 20px 80px #0009;border:1px solid #d7c29140;container-type:inline-size;outline:none}#world,#background,#characters,#cg,#flash{position:absolute;inset:0}#world{overflow:hidden}#background,#cg{background-size:cover;background-position:center;transition:opacity .45s}#cg{opacity:0;pointer-events:none}#cg.on{opacity:1}#characters{transition:opacity .35s}.char{position:absolute;bottom:-1%;height:96%;width:auto;max-width:none;transform:translateX(-50%);transition:left .45s,bottom .45s,height .45s,opacity .35s,filter .2s;filter:brightness(.40) saturate(.72);transform-origin:bottom center}.char.speaking{filter:brightness(1.05) drop-shadow(0 0 16px #fff1)}#flash{background:white;opacity:0;pointer-events:none;z-index:4}#sceneBadge{position:absolute;top:22px;left:24px;font-size:13px;letter-spacing:.12em;padding:9px 16px;background:#141927bf;border:1px solid #d5bb7c55;backdrop-filter:blur(8px);z-index:5}.diamond{color:var(--gold);font-size:10px;margin-right:7px}#menuButton{position:absolute;top:18px;right:18px;z-index:5;background:#151a28b0}#dialogue{position:absolute;left:5%;right:5%;bottom:5%;min-height:25%;background:linear-gradient(115deg,#101725ed,#202339eb);border:1px solid #dac08b99;border-left:3px solid var(--gold);box-shadow:0 6px 30px #0008;padding:2.1% 3% 2.6%;backdrop-filter:blur(12px);z-index:5;cursor:pointer}#speaker{font-weight:600;font-size:clamp(15px,1.75cqw,25px);color:var(--gold);margin-bottom:.6em;min-height:1em;letter-spacing:.08em}#speaker:empty{display:none}#text{font-family:"Yu Mincho","Hiragino Mincho ProN","Meiryo",serif;font-size:clamp(15px,1.85cqw,27px);line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere}#text.thought{color:#ccd9ea}#nextMark{position:absolute;bottom:12px;right:22px;color:var(--gold);font-size:12px;animation:breathe 1.6s infinite}#modeIndicator{position:absolute;bottom:1%;right:6%;font-size:11px;color:var(--gold);z-index:6}#toolbar{display:flex;gap:4px;justify-content:center;flex-wrap:wrap;padding:10px 0 5px}#toolbar button{font-size:12px;padding:7px 10px;background:#141a28}#toolbar button.active{background:#66563b}#statusLine{font-size:11px;color:var(--muted);display:flex;justify-content:space-between;gap:10px;padding:5px 3px}#titleScreen{position:absolute;inset:0;z-index:10;background-size:cover;background-position:center}.titleShade{position:absolute;inset:0;background:linear-gradient(90deg,#0c1324e8,#11192dbb 45%,#121c3533)}.titleContent{position:relative;padding:6% 7%;height:100%}.eyebrow{font-size:clamp(8px,.8cqw,12px);color:#ead7ac;letter-spacing:.35em;margin:0 0 1.2em}h1{font-family:"Yu Mincho",serif;font-weight:600;font-size:clamp(32px,6cqw,85px);letter-spacing:.14em;margin:0;text-shadow:0 3px 20px #000}.goldline{height:1px;background:linear-gradient(90deg,var(--gold),transparent);width:45%;margin:2% 0}.chapterTitle{font-family:"Yu Mincho",serif;font-size:clamp(12px,1.55cqw,22px);letter-spacing:.08em;margin:1% 0}.titleCaption{font-size:clamp(10px,1cqw,15px);color:#d6d7e0;margin:2% 0 3%}.titleButtons{display:grid;grid-template-columns:repeat(2,minmax(110px,180px));gap:8px;width:max-content;max-width:70%}.titleButtons button{text-align:left;border-radius:0;background:#121b2ca8;border:1px solid #d4ba8255;font-size:clamp(11px,1.1cqw,16px);padding:10px 16px}.titleButtons span{display:block;font-size:8px;letter-spacing:.2em;color:#b9b2a5;margin-top:4px}.version{font-size:10px;color:#afafbd;margin-top:3%}body.editing #app{align-items:flex-start}body.editing #player{position:sticky;top:18px;flex:1}#editor{width:430px;flex-shrink:0;background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:14px;max-height:calc(100vh - 36px);overflow:auto}header{display:flex;justify-content:space-between;align-items:center;gap:8px}header h2{font-size:18px;margin:4px 0 12px}header small{font-size:9px;color:var(--gold);letter-spacing:.2em}.editorActions,.rowActions{display:flex;gap:5px;flex-wrap:wrap}.editorActions button,.rowActions button{font-size:11px;padding:7px}#saveState{font-size:11px;padding:8px 0;color:var(--muted)}.sceneFilter{display:grid;gap:6px}#cueList{max-height:210px;overflow:auto;margin:10px 0;border:1px solid var(--line)}.cueRow{display:block;border:0;border-radius:0;border-left:3px solid #738297;width:100%;text-align:left;background:#151b29;padding:8px;font-size:11px;border-bottom:1px solid #2f3441}.cueRow.dialogue{border-left-color:#7ab3ff}.cueRow.thought{border-left-color:#c3a2f1}.cueRow.selected{background:#364256}.cueRow small{display:block;color:#a0adbd;font-size:9px}.cueRow .chips{color:#dab88a;font-size:9px}.section{margin-top:14px;border-top:1px solid var(--line);padding-top:10px}.section h3{font-size:13px;color:var(--gold);margin:0 0 8px}.fields{display:grid;grid-template-columns:1fr 1fr;gap:8px}.field{display:flex;flex-direction:column;gap:4px;font-size:11px;color:var(--muted)}.field input,.field select{width:100%;min-width:0}.field.full{grid-column:1/-1}.assetChoice{display:flex;align-items:center;gap:7px;margin:6px 0}.assetChoice img{width:65px;height:40px;object-fit:contain;background:#090c13}.assetChoice button{font-size:11px;flex:1;text-align:left}.castCard,.effectCard{background:#111725;border:1px solid #30394b;padding:10px;border-radius:5px;margin:8px 0}.cardHeader{display:flex;justify-content:space-between;align-items:center;font-size:12px;margin-bottom:8px}.cardHeader button{padding:2px 7px}.hint{color:var(--muted);font-size:11px;line-height:1.7}.badge{font-size:10px;background:#5d4c30;color:#f0d8ad;padding:3px 6px;border-radius:3px}dialog{border:1px solid #b59d7066;background:#171d2b;color:var(--text);border-radius:10px;padding:22px;width:min(900px,94vw);max-height:90vh;box-shadow:0 20px 80px #000b}dialog::backdrop{background:#080c14cc;backdrop-filter:blur(5px)}dialog header{border-bottom:1px solid var(--line);margin-bottom:16px}dialog header button{margin-bottom:10px}.slots{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.slot{text-align:left;min-height:140px;padding:0;overflow:hidden}.slot img{width:100%;height:85px;object-fit:cover;opacity:.7}.slot div{padding:8px;font-size:12px}.slot small{display:block;color:var(--muted);font-size:10px;margin-top:4px}.logEntry{width:100%;text-align:left;margin-bottom:8px;line-height:1.7;font-size:14px}.logEntry strong{color:var(--gold);display:block;font-size:12px}.settingsGrid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.settingsGrid label{display:flex;flex-direction:column;gap:8px;font-size:13px}.gallery,.assetGrid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.assetTile{padding:6px;font-size:11px;overflow:hidden;overflow-wrap:anywhere}.assetTile img{width:100%;height:100px;object-fit:contain;background:#080c14}.gallery .assetTile img{object-fit:cover;height:auto;aspect-ratio:16/9}.modalTools{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0}.modalTools input{flex:1;min-width:140px}#toast{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);background:#293348f5;border:1px solid var(--gold);padding:12px 20px;border-radius:6px;z-index:100;max-width:90vw;opacity:0;pointer-events:none;transition:opacity .2s;font-size:13px}#toast.show{opacity:1}.endPanel{text-align:center;padding:20px}.endPanel h3{font-family:"Yu Mincho",serif;font-size:28px}.fullImage{width:100%;object-fit:contain;max-height:70vh}.warn{color:#ffca8c}@keyframes breathe{50%{opacity:.25}}@media(max-width:1000px){body.editing #app{flex-direction:column;align-items:center}body.editing #player{position:static;width:100%}#editor{width:100%;max-height:none}#cueList{max-height:220px}}@media(max-width:600px){#app{padding:6px;align-items:flex-start;padding-top:20px}#stage{aspect-ratio:4/3}#sceneBadge{font-size:9px;top:8px;left:8px;padding:6px}#menuButton{top:7px;right:7px;padding:4px 8px}#dialogue{left:3%;right:3%;bottom:4%;padding:12px;min-height:31%;max-height:52%;overflow:auto}#text{font-size:15px;line-height:1.65}#speaker{font-size:14px;margin-bottom:6px}#nextMark{right:9px;bottom:6px;font-size:8px}.char{height:90%}#toolbar button{font-size:11px;padding:7px}#statusLine{font-size:9px;flex-direction:column;gap:3px}.titleContent{padding:11% 6%}.titleButtons{max-width:90%;gap:6px}.titleButtons button{padding:8px 12px}.titleCaption{margin:6% 0}.version{font-size:8px}.slots{grid-template-columns:repeat(2,1fr)}.settingsGrid{grid-template-columns:1fr}.assetGrid,.gallery{grid-template-columns:repeat(2,1fr)}dialog{padding:14px}.chapterTitle{font-size:13px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}#nextMark{animation:none}}
#player{width:min(1360px,100%,calc((100dvh - 110px)*16/9))}@media(max-width:600px){#player{width:100%}}

/* Keep the text origin identical for narration and dialogue. */
#dialogue{height:25%;display:flex;flex-direction:column;overflow:hidden}
#speaker{display:block;line-height:1.2;min-height:1.2em;flex:0 0 auto}
#speaker:empty{display:block;visibility:hidden}
#text{flex:1;min-height:0;overflow-y:auto;scrollbar-width:thin;padding-right:8px}
#stage,#toolbar,.logEntry{-webkit-user-select:none;user-select:none}
#stage img{-webkit-user-drag:none;pointer-events:none}
#editor input,#editor textarea{-webkit-user-select:text;user-select:text}
#cg{inset:-1.8cqw;background-color:#101019}
@media(max-width:600px){#dialogue{height:31%;min-height:31%;overflow:hidden}}

#sceneCurtain{position:absolute;inset:0;background:black;opacity:0;z-index:8;pointer-events:none}#flash{z-index:9}

@media(max-width:600px){#titleScreen{overflow:auto}.titleContent{padding:6%}.titleButtons button{padding:5px 10px}.titleCaption{margin:3% 0}.titleButtons span{font-size:7px;margin-top:2px}.version{margin-top:2%}}

/* Page-based text, fixed log controls, temporary cast labels. */
#text{overflow:hidden;scrollbar-width:none;padding-right:0}
#dialogue{overflow:hidden}
#modal[open]{display:flex;flex-direction:column;overflow:hidden}
#modal>header{flex:none;position:sticky;top:0;background:#171d2b;z-index:2}
#modalBody{overflow:auto;min-height:0;overscroll-behavior:contain}
.placeholderLabel{position:absolute;top:12%;transform:translateX(-50%);background:#302b17ed;border:1px dashed #f8ce67;color:#ffe39a;padding:5px 8px;font-size:12px;z-index:3;white-space:nowrap}
@media(max-width:600px){#dialogue{height:40%;min-height:40%;padding:9px 12px 16px}#speaker{font-size:13px;line-height:1.2;margin-bottom:5px}#text{line-height:1.55}#nextMark{font-size:10px}.placeholderLabel{font-size:10px}}

/* Revision 8: stable stage and fixed two-line reading window. */
.char{transition-property:opacity,filter}
#dialogue{height:25%;min-height:25%;max-height:25%;padding-top:1.2%;padding-bottom:1.6%}
#speaker{margin-bottom:.3em}
#text{line-height:1.65}
@media(max-width:600px){#dialogue{height:40%;min-height:40%;max-height:40%;padding:9px 12px 16px}#text{line-height:1.55}}

.editorNav{display:flex;gap:5px;margin-top:8px;position:sticky;top:0;z-index:8;background:var(--panel);padding:6px 0}.editorNav button{font-size:11px;padding:7px}.section summary{cursor:pointer;color:var(--gold);font-size:13px;font-weight:600}.section[open] summary{margin-bottom:10px}

/* Consistent 16:9 stage and composition across PC, mobile and fullscreen. */
#stage{aspect-ratio:16/9}
#dialogue{left:5%;right:5%;bottom:5%;height:25%;min-height:25%;max-height:25%;padding:1.2% 3% 1.6%}
#speaker{font-size:1.75cqw;line-height:1.2;margin-bottom:.6em}
#text{line-height:1.8}
#nextMark{right:1.65%;bottom:6%;font-size:.9cqw}

/* Playback controls stay within the viewport; stage retains its 16:9 ratio. */
body:not(.editing) #app{height:100dvh;min-height:0;padding:6px;overflow:hidden}
body:not(.editing) #player{width:min(1360px,100%,calc((100dvh - 104px)*16/9));max-height:100dvh}
body.account-player #toolbar{display:flex;flex-wrap:wrap;gap:4px;padding:6px 0 0}
body.account-player #toolbar button{flex:0 1 auto;min-height:32px;padding:6px 9px;font-size:12px}
.currentLog{border-color:var(--gold);background:#3d4353}
@media(max-width:600px){body:not(.editing) #app{align-items:center;padding:4px}body:not(.editing) #player{width:min(100%,calc((100dvh - 92px)*16/9))}body.account-player #toolbar button{font-size:11px;min-height:30px;padding:5px 8px}#titleScreen{overflow:hidden}.titleContent{padding:3% 5%}.eyebrow{margin:0 0 2px}h1{font-size:8cqw}.goldline{margin:1% 0}.chapterTitle{font-size:2.9cqw;margin:0}.titleCaption{font-size:2.1cqw;margin:1% 0}.titleButtons{grid-template-columns:repeat(2,minmax(110px,1fr));width:min(75%,350px);max-width:75%;gap:3px}.titleButtons button{font-size:clamp(9px,2.3cqw,14px);padding:3px 7px}.titleButtons span{font-size:6px;margin-top:0}.version{margin:1% 0;font-size:8px}}
/* Adjust title contents to the actual 16:9 stage size, including landscape phones. */
@container (max-width:650px){
 #titleScreen{overflow:hidden}
 .titleContent{padding:3% 5%}
 .eyebrow{font-size:1.5cqw;margin:0 0 2px}
 h1{font-size:8cqw}
 .goldline{margin:1% 0}
 .chapterTitle{font-size:2.9cqw;margin:0}
 .titleCaption{font-size:2.1cqw;margin:1% 0}
 .titleButtons{grid-template-columns:repeat(2,minmax(0,1fr));width:min(75%,350px);max-width:75%;gap:3px}
 .titleButtons button{font-size:clamp(9px,2.3cqw,14px);padding:3px 7px}
 .titleButtons span{font-size:6px;margin-top:0}
 .version{margin:1% 0;font-size:8px}
}
@container (max-width:650px){.titleButtons{grid-template-columns:repeat(3,minmax(0,1fr));width:min(90%,510px);max-width:90%}}
.titleButtons{grid-template-columns:repeat(3,minmax(0,1fr));width:min(80%,540px);max-width:80%}
@container (max-width:650px){.titleButtons{width:min(90%,510px);max-width:90%}}

#gamePrompt{width:min(440px,92vw);padding:24px;border:1px solid var(--gold);background:#171d2b;color:var(--text)}
#gamePrompt h2{margin:0 0 14px;font-size:18px;color:var(--gold)}
#gamePrompt p{line-height:1.7;white-space:pre-wrap}
#gamePrompt input{width:100%;margin:5px 0 12px}
.gamePromptActions{display:flex;justify-content:flex-end;gap:10px;margin-top:22px}

/* Save/load: one vertical list, compact rows and fixed dialog header. */
.slots{grid-template-columns:minmax(0,1fr);gap:8px}
.slot{display:flex;align-items:center;min-height:82px;width:100%}
.slot img{width:144px;height:81px;flex:0 0 144px;object-fit:cover}
.slot div{min-width:0;padding:9px 12px;overflow-wrap:anywhere}
@media(max-width:600px){.slots{grid-template-columns:minmax(0,1fr)}.slot{min-height:64px}.slot img{width:104px;height:59px;flex-basis:104px}.slot div{padding:6px 9px}}

/* Controls live inside the 16:9 game picture. */
body:not(.editing) #player{width:min(1360px,100%,calc((100dvh - 12px)*16/9));max-height:100dvh}
body:not(.editing) #statusLine{display:none}
#stage #menuButton{font-size:clamp(11px,1.4cqw,15px);white-space:nowrap}
#stage #sceneBadge{max-width:calc(100% - 130px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#stage #toolbar,body.account-player #stage #toolbar{position:absolute;right:5%;bottom:0;z-index:7;display:flex;flex-wrap:nowrap;align-items:center;gap:4px;height:clamp(24px,4.8cqw,40px);padding:2px 0}
#stage #toolbar button,body.account-player #stage #toolbar button{min-width:clamp(48px,8cqw,96px);min-height:0;height:100%;padding:1px 5px;font-size:clamp(10px,1.35cqw,13px);white-space:nowrap;background:#182031d9;border-color:#d5bb7c55}
#stage #toolbar button.active,body.account-player #stage #toolbar button.active{background:#66563b;border-color:var(--gold)}
#dialogue{bottom:calc(clamp(24px,4.8cqw,40px) + 1%)}
#modeIndicator{bottom:calc(clamp(24px,4.8cqw,40px) + .5%)}
#contentNotice{position:absolute;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;background:#101521f7;padding:2% 5%;color:#f5f0e7}
.noticeCard{max-width:800px;width:100%;text-align:center;font-family:"Yu Mincho","Meiryo",serif}
.noticeCard h2{color:var(--gold);font-size:clamp(14px,2.2cqw,24px);margin:0 0 2%}
.noticeCard p{font-size:clamp(10px,1.65cqw,17px);line-height:1.65;margin:1% 0}
.noticeCard button{margin-top:2%;padding:.5em 2.5em;font-size:clamp(10px,1.35cqw,14px)}
@media(max-width:600px){body:not(.editing) #player{width:min(100%,calc((100dvh - 8px)*16/9))}}
/* Title artwork, animated backdrop and silver-blue menu ribbons. */
#titleScreen{overflow:hidden;background-color:#183344}
#titleMovie,.titleShade{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
#titleMovie{object-fit:cover}
#titleScreen .titleShade{background:radial-gradient(ellipse at 50% 65%,#102d5263,transparent 50%),linear-gradient(0deg,#10234548,transparent 20%)}
#titleScreen .titleContent{position:absolute;inset:0;padding:0}
#titleScreen .titleBrand{position:absolute;top:-7.5%;left:50%;width:73%;margin:0;transform:translateX(-50%);line-height:0}
.titleLogo{position:relative;width:100%;height:auto;filter:drop-shadow(0 0 .26cqw #f8fdffee) drop-shadow(0 0 .85cqw #dbefffa8)}
.titleGlitch{position:absolute;inset:0;width:100%;height:auto;opacity:0;transform:scale(1.12) translateY(-4%);filter:drop-shadow(0 0 .8cqw #58baff)}
.titleMotion .titleGlitch{animation:titleSignal 17s linear infinite}
@keyframes titleSignal{
 0%,32%,35%,72%,75%,100%{opacity:0}
 32.3%{opacity:.45;clip-path:inset(36% 0 12%);transform:scale(1.12) translate(-2%,-4%)}
 33%{opacity:.1;clip-path:inset(40% 0 21%);transform:scale(1.12) translate(2%,-4%)}
 34%,73%{opacity:.55;clip-path:inset(25% 0 7%);transform:scale(1.12) translate(1%,-4%)}
 74%{opacity:.2;clip-path:inset(47% 0 13%);transform:scale(1.12) translate(-1%,-4%)}
}
#titleScreen .titleButtons{
 position:absolute;top:54%;left:50%;transform:translateX(-50%);
 display:grid;grid-template-columns:minmax(0,1fr);gap:clamp(2px,.55cqw,7px);
 width:clamp(118px,24cqw,325px);max-width:52%;
}
#titleScreen .titleButtons button{
 position:relative;width:100%;height:clamp(16px,3.02cqw,41px);
 display:grid;place-items:center;padding:0 12%;overflow:hidden;
 border:1px solid #e2f6ffdf;border-radius:4px;color:#f9fdff;
 background:linear-gradient(90deg,#23476cc9,#234d72bd 25%,#173554d9 74%,#3d7195ce);
 box-shadow:inset 0 0 .85cqw #bce8ff5c,0 1px .65cqw #14254170;
 font:600 clamp(9px,1.48cqw,21px)/1 "Yu Mincho","Hiragino Mincho ProN","Meiryo",serif;
 text-align:center;letter-spacing:.08em;text-shadow:0 1px 4px #061020;white-space:nowrap;
}
#titleScreen .titleButtons button::before,#titleScreen .titleButtons button::after{
 content:"";position:absolute;top:50%;width:11%;aspect-ratio:1;
 background:linear-gradient(135deg,#caf3ff88,transparent 75%);border:1px solid #d6eeffdb;
 transform:translateY(-50%) rotate(45deg);pointer-events:none;
}
#titleScreen .titleButtons button::before{left:-6%}
#titleScreen .titleButtons button::after{right:-6%}
#titleScreen .titleButtons button:enabled:is(:hover,:focus-visible){
 background:linear-gradient(90deg,#5799c9ed,#336d9aee,#5799c9ed);
 box-shadow:inset 0 0 .9cqw #d9f5ff,0 0 1.05cqw #c2f0ff;
 border-color:white;
}
#titleScreen .titleButtons button:disabled{opacity:.65;color:#dae6ee}
.titleEdition,.titleUtilities{position:absolute;bottom:2.5%;margin:0;color:#f4f9ff;font-size:clamp(8px,.85cqw,12px);text-shadow:0 1px 5px #000,0 0 5px #000}
.titleEdition{left:3%}
.titleUtilities{right:3%;display:flex;gap:clamp(3px,.5cqw,7px)}
.titleUtilities button{padding:.35em .55em;font-size:inherit;white-space:nowrap;background:#163451ab;border-color:#c5e6ff52}
@container (max-width:650px){
 #titleScreen .titleBrand{width:72%;top:-9%}
 #titleScreen .titleButtons{top:52.5%}
 #titleScreen .titleButtons button{height:clamp(12px,4.1cqw,26px)}
 .titleUtilities{top:2%;bottom:auto}
}
/* CG gallery and viewer shared by players and the admin views. */
.stillTile{min-width:0;display:grid;gap:5px;padding:5px;text-align:left}
.stillTile:disabled{opacity:1;color:var(--muted)}
.stillThumb{position:relative;display:grid;place-items:center;aspect-ratio:16/9;overflow:hidden;border-radius:3px;background:linear-gradient(145deg,#202941,#121929)}
.stillThumb img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.stillLocked{font-size:clamp(18px,5vw,34px);color:#667b9b}
.stillCaption{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:clamp(10px,1.5vw,13px);line-height:1.6}
.stillCaption small{color:#c5d6ec}
.stillViewerFrame{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:clamp(3px,1vw,12px)}
.stillViewerFrame button{width:clamp(30px,5vw,46px);min-height:44px;padding:0;font-size:28px}
#modal.stillView{width:min(1180px,98vw);max-height:96dvh}
.stillViewerFrame .fullImage{display:block;max-height:65dvh}
#modal.stillFullscreen{
 width:100vw;height:100dvh;max-width:none;max-height:none;
 margin:0;padding:clamp(6px,1vw,14px);border:0;border-radius:0;background:#0b101a;
}
.stillFullscreen>header{margin-bottom:6px}
.stillFullscreen #modalBody{flex:1;display:flex;overflow:hidden}
.stillFullscreen .stillViewer{width:100%;min-height:0;display:flex;flex-direction:column}
.stillFullscreen .stillViewerFrame{position:relative;display:block;flex:1;min-height:0}
.stillFullscreen .stillViewerFrame .fullImage{height:100%;max-height:none}
.stillFullscreen .stillViewerFrame button{position:absolute;top:50%;transform:translateY(-50%);background:#141b2bd9}
.stillFullscreen #stillPrevious{left:4px}
.stillFullscreen #stillNext{right:4px}
.stillFullscreen .stillOwners{max-height:18dvh;overflow:auto}
.stillViewerActions{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:8px;margin-top:10px}
.stillOwners{margin-top:14px;padding:9px 0;border-top:1px solid var(--line)}
.stillOwners>div{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px;font-size:13px}
.stillOwners span{padding:3px 8px;border:1px solid var(--line);border-radius:4px;overflow-wrap:anywhere}
.accountUser{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.accountUser small{display:block;margin-top:4px;color:var(--muted)}
.accountUserActions{display:flex;gap:6px;flex-wrap:wrap}
.accountUserActions button{padding:5px 8px;font-size:12px}

/* Overlay controls leave the stage and its 16:9 viewport untouched. */
#socialTicker{
 position:absolute;
 left:5%;
 right:5%;
 bottom:0;
 height:27px;
 z-index:10;
 pointer-events:none;
 color:#f8f3e8;
}
#socialTicker[hidden]{display:none}
#socialTickerLane{
 position:relative;
 min-width:0;
 height:27px;
 overflow:hidden;
 border:1px solid #c6ad8260;
 border-radius:4px;
 background:#182334;
 color:#f8f3e8;
 white-space:nowrap;
 font:13px/25px system-ui,sans-serif;
}
#socialTickerLane.tickerStatic{overflow-x:auto;overflow-y:hidden;pointer-events:auto}
.tickerMessage{position:absolute;left:0;display:inline-block;width:max-content;padding:0 12px;white-space:pre}
.tickerStatic .tickerMessage{position:static}
#socialActions{
 position:absolute;
 right:0;
 bottom:100%;
 display:flex;
 justify-content:flex-end;
 gap:4px;
 pointer-events:auto;
}
#socialList.hasNew{border-color:var(--gold);color:#ffdf9e}
#socialCommentList{max-width:760px;margin:auto}
.commentFilters{
 position:sticky;
 top:0;
 z-index:1;
 display:flex;
 flex-wrap:wrap;
 gap:6px;
 padding:2px 0 12px;
 background:#171d2b;
}
.commentFilters button{padding:5px 12px;border-radius:999px;color:#dbe6f3}
.commentFilters button[aria-pressed="true"]{background:#364458;border-color:#d7bd82;color:#fff4d8}
.commentCards{display:grid;gap:9px;padding-bottom:4px}
.commentCard{
 display:grid;
 grid-template-columns:minmax(0,1fr) auto;
 gap:7px 12px;
 padding:12px 14px;
 border:1px solid #4c596e;
 border-radius:8px;
 background:#222d40;
}
.commentCardMeta{
 grid-column:1/-1;
 display:flex;
 align-items:center;
 gap:8px;
 color:#c3cfe0;
 font-size:12px;
 overflow-wrap:anywhere;
}
.commentNewBadge{
 flex:none;
 padding:1px 6px;
 border-radius:4px;
 background:#e7c880;
 color:#242015;
 font-size:10px;
 font-weight:700;
}
.commentCardBody{
 grid-column:1/-1;
 margin:0;
 color:#fff7e8;
 font-size:15px;
 line-height:1.65;
 white-space:pre-wrap;
 overflow-wrap:anywhere;
}
.commentCardReactions{
 grid-column:1/-1;
 display:flex;
 flex-wrap:wrap;
 gap:4px;
}
.commentCardReactions span{
 padding:2px 6px;
 border:1px solid #53647e;
 border-radius:6px;
 background:#303e54;
 font-size:15px;
}
.commentCardSource{
 min-width:0;
 padding:4px 8px;
 border-left:2px solid #7487a6;
 background:#171f2e;
}
.commentCardSource span{color:#a7b6ce;font-size:10px}
.commentCardSource blockquote{
 margin:2px 0 0;
 color:#d6dfec;
 font-size:12px;
 line-height:1.5;
 white-space:pre-wrap;
 overflow-wrap:anywhere;
}
.commentCardJump{
 align-self:end;
 min-height:34px;
 padding:4px 9px;
 white-space:nowrap;
 color:#fff0ce;
 font-size:12px;
}
.commentListEmpty{margin:8px 0;color:#bac7db}
@media(max-width:480px){
 .commentCard{grid-template-columns:minmax(0,1fr);padding:10px;gap:6px}
 .commentCardJump{justify-self:end;min-height:36px}
}
#socialActions button{min-width:0;white-space:nowrap;font-size:clamp(9px,1.25cqw,12px);padding:3px 6px}
#socialInline{
 position:absolute;
 right:0;
 bottom:calc(100% + 26px);
 max-width:90%;
 width:420px;
 display:flex;
 flex-wrap:wrap;
 align-items:center;
 justify-content:flex-end;
 gap:5px;
 padding:5px;
 border-radius:4px;
 background:#182334ed;
 pointer-events:auto;
}
#socialInline.socialIsHidden,#socialTickerLane.socialIsHidden{visibility:hidden}
#socialInline [hidden]{display:none}
#socialForm{display:flex;flex:1;min-width:min(100%,180px);gap:5px}
#socialInput{width:100%;min-width:0;height:36px;min-height:36px;padding:5px 8px;line-height:22px;resize:none;font-size:16px}
#socialForm button{flex:none;white-space:nowrap}
#socialReactions{display:flex;flex-wrap:wrap;gap:4px}
#socialReactions button{min-width:32px;padding:3px 6px;font-size:14px}
#socialReactions button[aria-pressed="true"]{background:#66563b;border-color:var(--gold)}
.moderationRow{display:flex;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid var(--line)}
.moderationRow p{white-space:pre-wrap;overflow-wrap:anywhere;min-width:0}
.moderationRow button{flex:none}

#stage:has(#socialTicker:not([hidden])) #toolbar{bottom:54px}
#stage:has(#socialTicker:not([hidden])) #dialogue{bottom:calc(clamp(24px,4.8cqw,40px) + 54px + 1%)}
#stage:has(#socialTicker:not([hidden])) #modeIndicator{bottom:calc(clamp(24px,4.8cqw,40px) + 54px + .5%)}
@container (max-width:365px){
 #socialActions{gap:2px}
 #socialActions button{font-size:9px;padding-inline:3px}
}

@container (min-width:650px){
 #stage:has(#socialTicker:not([hidden])) #toolbar{left:5%;right:auto;bottom:27px}
 #stage:has(#socialTicker:not([hidden])) #dialogue{bottom:calc(clamp(24px,4.8cqw,40px) + 27px + 1%)}
 #stage:has(#socialTicker:not([hidden])) #modeIndicator{bottom:calc(clamp(24px,4.8cqw,40px) + 27px + .5%)}
}

.commentCardMeta{flex-wrap:wrap}
.commentAuthor{color:#f0d698}
.commentAdminTools{
 grid-column:1/-1;
 display:grid;
 justify-items:start;
 gap:7px;
 padding-top:8px;
 border-top:1px solid #4c596e;
}
.commentAdminTools details{width:100%}
.commentAdminTools summary{cursor:pointer;color:#cfdbed;font-size:12px}
.commentAdminTools details>div{
 display:flex;
 flex-wrap:wrap;
 align-items:center;
 justify-content:space-between;
 gap:5px;
 padding:5px 0;
}
.commentDelete{padding:4px 8px;border-color:#885c58;color:#ffcec2;font-size:12px}

#socialInline{z-index:1}
#stage:has(#socialInline:not(.socialIsHidden)) #toolbar{visibility:hidden}

#visualSurvey{width:min(780px,94vw);max-height:92dvh;overflow:auto}
#visualSurvey h2{margin:0;color:var(--gold)}
#visualSurvey p{line-height:1.6}
.visualChoices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:15px 0}
.visualChoices label{display:grid;grid-template-columns:auto 1fr;gap:8px;align-items:center;padding:8px;border:1px solid #556278;border-radius:6px;cursor:pointer;font-size:clamp(11px,2vw,15px)}
.visualChoices label:has(input:checked){border-color:var(--gold);background:#394253}
.visualChoices img{grid-column:1/-1;width:100%;height:clamp(150px,42dvh,380px);object-fit:contain;object-position:center;background:#111925}
#visualSurvey form>button{display:block;margin:auto}
.visualVoteTable{width:100%;border-collapse:collapse}
.visualVoteTable th,.visualVoteTable td{text-align:left;padding:8px;border-bottom:1px solid var(--line);overflow-wrap:anywhere}

.visualVoteReset{margin:6px 0 12px}.visualVoteTable button{padding:4px 6px;font-size:12px}.visualVoteTable td:last-child{white-space:nowrap}

@media (pointer:coarse) and (max-width:1024px){#dialogue,#sceneBadge,dialog::backdrop{-webkit-backdrop-filter:none;backdrop-filter:none}.char.speaking{filter:brightness(1.05)}}


#landscapeNotice h2{font-size:clamp(18px,4cqw,32px)}

#titleScreen{background-image:url("title-media/poster.jpg?v=title-frame-1")}

body.screenshot-mode #stage > :not(#world),body.screenshot-mode :is(#statusLine,#editor,#toast,.accountNotice){visibility:hidden!important;pointer-events:none!important}body.screenshot-mode #stage{border-color:transparent;box-shadow:none}

/* The same 16:9 composition fits either phone orientation. */
@media (any-pointer:coarse){
 body:not(.editing) #app{align-items:center;padding:4px}
 body:not(.editing) #player{width:min(1360px,100%,calc((100dvh - 8px)*16/9))}
 #stage{-webkit-text-size-adjust:100%;text-size-adjust:100%;aspect-ratio:16/9}
 #stage #sceneBadge{top:3.5%;left:3%;max-width:68%;font-size:1.65cqw;padding:.85cqw 1.45cqw}
 #stage #menuButton{top:3.5%;right:3%;font-size:1.45cqw;padding:.85cqw 1.35cqw}
 #stage #dialogue{left:5%;right:5%;height:25%;min-height:25%;max-height:25%;padding:1.2cqw 2.7cqw 1.6cqw;bottom:5.2cqw}
 #stage #speaker{font-size:1.75cqw;line-height:1.2;margin-bottom:.6em}
 #stage #text{line-height:1.8}
 #stage #toolbar,body.account-player #stage #toolbar{left:5%;right:auto;bottom:0;gap:.55cqw;height:4.15cqw;padding:0}
 #stage #toolbar button,body.account-player #stage #toolbar button{font-size:1.3cqw;min-width:7.8cqw;min-height:0;padding:0 .65cqw}
 #stage #socialTicker,#stage #socialTickerLane{height:3.4cqw}
 #stage #socialTickerLane{font-size:1.45cqw;line-height:3.2cqw}
 #stage #socialActions{height:3.45cqw;gap:.5cqw;align-items:stretch}
 #stage #socialActions button{font-size:1.24cqw;padding:0 .68cqw}
 #stage #socialInline{bottom:6.85cqw}
 #stage:has(#socialTicker:not([hidden])) #toolbar{bottom:3.95cqw}
 #stage:has(#socialTicker:not([hidden])) #dialogue{bottom:9cqw}
 #stage:has(#socialTicker:not([hidden])) #modeIndicator{bottom:8.4cqw}
}
