:root{color-scheme:dark;--bg:#111414;--panel:#1a1e1e;--panel2:#202525;--line:#303635;--text:#e3e3da;--muted:#8e9994;--gold:#c7ab7c;--gold2:#e1c596;--green:#8ca697;--red:#c97b73;--font:Inter,"Pretendard","Noto Sans KR",system-ui,sans-serif}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:13px var(--font);overflow:hidden}button,input,select,textarea{font:inherit}button{cursor:pointer;color:inherit}button:disabled{opacity:.4;cursor:not-allowed}button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid var(--gold);outline-offset:3px}input,textarea,select{background:#151919;border:1px solid #3b4441;color:var(--text);border-radius:7px;padding:10px 12px;max-width:100%}textarea{resize:vertical;line-height:1.7}button,a,input,textarea,select{-webkit-tap-highlight-color:transparent}a{color:var(--gold)}button{border:0;background:none}svg{width:18px;height:18px;vertical-align:middle;stroke:currentColor;fill:none;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}.app-shell{height:100dvh;display:grid;grid-template-rows:66px 1fr 30px;min-height:480px}.topbar{display:flex;align-items:center;padding:0 24px;border-bottom:1px solid var(--line);gap:24px;background:#171b1a}.brand{display:flex;align-items:center;gap:12px;min-width:180px}.brand-mark{border:1px solid #726b58;color:var(--gold);width:32px;height:34px;display:grid;place-items:center}.brand strong{font-size:21px;font-family:Georgia,"Noto Serif KR",serif;font-weight:600;letter-spacing:3px}.brand small{display:block;font-size:9px;color:#87918b;letter-spacing:2.6px;margin-top:3px}.top-divider{height:24px;width:1px;background:var(--line)}.session-meta{display:flex;align-items:center;gap:12px;color:var(--muted);font-size:12px}.dot{height:6px;width:6px;border-radius:50%;background:var(--green);display:inline-block}.badge{font-size:10px;letter-spacing:.4px;border:1px solid #464738;border-radius:4px;color:var(--gold);padding:4px 7px;white-space:nowrap}.top-actions{margin-left:auto;display:flex;gap:7px;align-items:center}.btn{border:1px solid #3d4441;border-radius:6px;padding:9px 12px;display:inline-flex;align-items:center;gap:7px;background:#222725;font-size:12px;justify-content:center;transition:background .15s,color .15s}.btn:hover{background:#303731}.btn.gold{color:#171a17;background:var(--gold);border-color:var(--gold)}.btn.gold:hover{background:var(--gold2)}.btn.flat{background:none;border-color:transparent;color:var(--muted)}.btn.flat:hover{color:var(--text);background:#252b27}.btn.danger{color:var(--red)}.icon-btn{border-radius:6px;width:34px;height:34px;display:grid;place-items:center;color:var(--muted)}.icon-btn:hover,.icon-btn.active{background:#34382e;color:var(--gold)}.body-grid{display:grid;grid-template-columns:66px minmax(0,1fr) 340px;min-height:0}.floor-rail{display:flex;align-items:center;flex-direction:column;background:#171b1a;border-right:1px solid var(--line);padding:22px 0 12px;gap:8px}.rail-caption{font-size:9px;color:#6f7b74;letter-spacing:1px;margin-bottom:8px}.floor-button{width:42px;height:42px;border-radius:7px;color:#8c9891;font-size:13px;position:relative}.floor-button:hover{background:#252c27}.floor-button.active{background:#383b2e;color:var(--gold2);border:1px solid #5c5840}.floor-button.published:after{content:"";position:absolute;bottom:4px;left:19px;width:4px;height:4px;background:var(--gold);border-radius:50%}.rail-bottom{margin-top:auto;display:flex;flex-direction:column;gap:10px}.workspace{min-width:0;min-height:0;display:grid;grid-template-rows:64px minmax(0,1fr) 105px;position:relative;background:#151919}.scene-bar{display:flex;align-items:center;padding:0 25px;gap:12px;z-index:2}.eyebrow{font-size:9px;letter-spacing:1.8px;color:#8d9c92;margin-bottom:6px;text-transform:uppercase}.scene-title{font-size:17px;font-weight:500}.scene-title small{font-size:11px;color:var(--muted);margin-left:9px;font-weight:400}.scene-actions{margin-left:auto;display:flex;gap:4px}.stage{min-height:0;position:relative;overflow:hidden;display:flex;align-items:center;justify-content:center;background:radial-gradient(ellipse at 40% 45%,#2b3029 0,#1b211d 55%,#171c19 100%)}.stage:before{content:"";position:absolute;inset:0;background-image:radial-gradient(#aab29c25 .65px,transparent .65px);background-size:16px 16px;opacity:.5;pointer-events:none}.map-frame{position:relative;aspect-ratio:3439 / 2131;width:calc(100% - 80px);max-height:calc(100% - 100px);max-width:calc((100dvh - 370px) * 1.6138);background:#000;box-shadow:0 24px 70px #0008,0 0 0 1px #777568;transform-origin:center;touch-action:none}.map-base{position:absolute;inset:0;width:100%;height:100%;user-select:none;pointer-events:none;filter:sepia(.17) contrast(.88) brightness(.95)}.room-image{position:absolute;user-select:none;pointer-events:none;filter:sepia(.17) contrast(.88) brightness(.95)}.room-shade{position:absolute;background:#0a0e0b9c;pointer-events:none;border:1px solid #b6bba51c}.room-tag{position:absolute;font-size:8px;pointer-events:none;color:#ecebd8a0;border:1px solid #d5d5c52a;padding:2px 4px;background:#10171066;transform:translate(-50%,-50%);border-radius:2px}.token{position:absolute;left:var(--x);top:var(--y);width:33px;height:33px;transform:translate(-50%,-50%);border-radius:50%;background:#222b24;border:2px solid var(--color);box-shadow:0 4px 12px #0008;display:grid;place-items:center;color:var(--color);font-size:12px;font-weight:650;z-index:4;user-select:none;touch-action:none;padding:0}.token img{width:100%;height:100%;border-radius:50%;object-fit:cover}.token:before{content:"";position:absolute;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:8px solid var(--color);left:50%;top:50%;transform:translate(-50%,-50%) rotate(var(--angle)) translateY(-23px);transform-origin:center}.token.selected{outline:2px solid #f1e6c9;outline-offset:4px}.token.ghost{opacity:.38;z-index:3;border-style:dashed;pointer-events:none}.token-label{position:absolute;top:36px;left:50%;transform:translateX(-50%);color:#eee8d6;white-space:nowrap;font-size:9px;background:#20271ee6;padding:2px 5px;border-radius:3px;font-weight:400}.map-caption{position:absolute;bottom:20px;left:25px;font-size:10px;color:#869286;display:flex;gap:16px;align-items:center}.keycap{border:1px solid #536051;border-radius:3px;padding:2px 5px;color:#c1caba;margin:0 3px;font-size:9px}.map-controls{position:absolute;bottom:17px;right:21px;display:flex;align-items:center;gap:4px;padding:4px;background:#191f1ce8;border:1px solid #3c4539;border-radius:8px;z-index:8}.zoom-label{font-size:10px;color:#adb5a6;min-width:35px;text-align:center}.timer{position:absolute;right:23px;top:16px;z-index:10;padding:12px 17px;background:#141a16ec;border:1px solid #4b513e;border-radius:10px;box-shadow:0 8px 20px #0003;min-width:145px}.timer-head{font-size:9px;letter-spacing:1.7px;color:#9fa58f;display:flex;justify-content:space-between;gap:10px}.timer-value{font-family:"SFMono-Regular",Consolas,monospace;font-size:32px;letter-spacing:2px;margin:6px 0 2px;color:#dbc59a;font-weight:300}.timer-value.changing{animation:timeflip .5s ease}.timer-label{font-size:9px;color:#808e7c}.timer-delta{position:absolute;bottom:-24px;right:0;color:var(--gold);font:12px monospace}.timer-progress{height:2px;background:#38402f;margin-top:10px}.timer-progress span{display:block;height:2px;background:var(--gold);width:var(--progress)}.scene-label{position:absolute;left:24px;top:20px;color:#a3ae99;font-size:10px;letter-spacing:1px}.cutscene{position:absolute;inset:0;background:#101310;z-index:7;display:flex;align-items:center;justify-content:center;padding:20px}.cutscene img{max-width:100%;max-height:100%;object-fit:contain}.subtitle{position:absolute;left:10%;right:10%;bottom:56px;z-index:9;text-align:center;white-space:pre-line;font-size:21px;line-height:1.8;font-family:Georgia,"Noto Serif KR",serif;color:#fff9e8;text-shadow:0 2px 5px #000,0 0 20px #000}.party-bar{display:flex;gap:10px;padding:16px 20px 17px;border-top:1px solid #313a30;background:#1a201c;min-width:0}.party-card{flex:1;min-width:0;display:flex;align-items:center;gap:10px;border:1px solid #384137;border-radius:8px;padding:10px;background:#20271f;text-align:left;position:relative}.party-card:hover{border-color:#73765b}.party-card.selected{border-color:#8d805e;background:#2c3126}.portrait{height:36px;width:36px;flex:0 0 36px;border-radius:50%;border:2px solid var(--color,var(--gold));color:var(--color,var(--gold));background:#151c18;display:grid;place-items:center;font-size:12px;overflow:hidden}.portrait img{width:100%;height:100%;object-fit:cover}.party-info{min-width:0;flex:1}.party-name{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:flex;align-items:center;gap:6px}.you{font-size:8px;color:#b5bcab}.party-stat{display:flex;gap:9px;font:10px monospace;color:#939f8c;margin-top:8px}.party-stat b{font-weight:400;color:#ced4c6}.handup-pill{position:absolute;left:0;bottom:calc(100% + 7px);background:#d4ba85;color:#1c241b;border-radius:5px;padding:6px 9px;font-size:10px;white-space:nowrap;box-shadow:0 2px 12px #0003}.sidebar{border-left:1px solid var(--line);background:#1a1e1e;display:flex;flex-direction:column;min-height:0;min-width:0}.sidebar-tabs{display:flex;height:54px;flex-shrink:0;padding:0 16px;border-bottom:1px solid var(--line);gap:20px}.tab{font-size:12px;color:#85908b;position:relative;padding:0 3px}.tab.active{color:var(--gold)}.tab.active:after{content:"";position:absolute;height:2px;bottom:-1px;left:0;right:0;background:var(--gold)}.sidebar-content{overflow:auto;flex:1;min-height:0;scrollbar-width:thin;scrollbar-color:#3c443d transparent}.chat-top{display:flex;align-items:center;justify-content:space-between;padding:18px 20px 10px;color:#7d8b82;font-size:10px}.chat-welcome{text-align:center;padding:40px 24px 30px;color:#8e9990}.chat-welcome svg{width:30px;height:30px;color:#baaa84;margin-bottom:17px}.chat-welcome h3{font-weight:500;font-size:14px;color:#c8cbbb;margin:0 0 10px}.chat-welcome p{line-height:1.9;font-size:11px;margin:0}.date-line{display:flex;align-items:center;gap:12px;color:#6e7d73;font-size:9px;margin:15px 20px}.date-line:before,.date-line:after{content:"";height:1px;background:#323b34;flex:1}.message{padding:13px 18px;display:flex;gap:11px;animation:arrive .2s ease}.message .portrait{width:31px;height:31px;flex-basis:31px;font-size:10px}.message-body{min-width:0;flex:1}.message-heading{font-size:11px;color:#b9c0b6;display:flex;gap:10px;align-items:center}.message-heading time{font:9px monospace;color:#6d7c71;margin-left:auto}.message-text{font-size:12px;line-height:1.85;white-space:pre-wrap;overflow-wrap:anywhere;color:#bfc8bd;margin-top:6px}.roll-result{border:1px solid #444b39;border-radius:8px;background:linear-gradient(125deg,#2c3226,#20261f);padding:13px;margin-top:8px}.roll-line{display:flex;justify-content:space-between;color:#a1ad94;font:10px monospace}.roll-total{font-size:29px;line-height:1.3;color:#e0c691;margin-top:4px;font-family:Georgia,serif}.roll-level{font-size:10px;color:#adc4a5;margin-top:5px}.roll-level.fail{color:#d19c8a}.compose{border-top:1px solid var(--line);padding:13px 15px 12px;flex-shrink:0;background:#1c211f}.compose-toolbar{display:flex;align-items:center;margin-bottom:9px;color:#8e9a90;font-size:10px;gap:6px}.compose-toolbar select{padding:4px 6px;font-size:10px;background:none;border-color:transparent;width:110px}.compose textarea{width:100%;background:#151b18;resize:none;border-color:#364036;font-size:12px;min-height:72px}.compose-bottom{display:flex;justify-content:space-between;align-items:center;margin-top:9px}.compose-bottom small{font-size:9px;color:#647566}.compose .send{width:30px;height:30px;border-radius:5px;background:#bda67c;color:#1a2318;display:grid;place-items:center}.statusbar{border-top:1px solid #2c352d;background:#141a16;color:#74826f;display:flex;align-items:center;justify-content:space-between;padding:0 17px;font-size:9px;letter-spacing:.3px}.statusbar-left{display:flex;gap:18px;align-items:center}.statusbar a{font-size:9px;color:#8e9d84;text-decoration:none}.character-panel{padding:22px 18px}.sheet-top{display:flex;align-items:center;gap:13px;margin-bottom:25px}.sheet-top .portrait{width:48px;height:48px;flex-basis:48px}.sheet-top h3{margin:0 0 5px;font-size:16px;font-weight:500}.muted{color:var(--muted);font-size:11px;line-height:1.8}.section-heading{font-size:10px;color:#8f9d8a;letter-spacing:1px;display:flex;align-items:center;justify-content:space-between;margin:23px 0 12px}.vital-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.vital{border:1px solid #364033;padding:12px;border-radius:7px;background:#20271f}.vital label{display:block;color:#8e9e88;font-size:9px;letter-spacing:1px}.vital b{font:22px Georgia,serif;font-weight:400;color:#d7d6bf}.vital small{color:#74846e;margin-left:5px;font:10px monospace}.bar{height:3px;background:#37402e;margin-top:9px}.bar span{display:block;height:3px;background:#9f9e76;width:var(--value)}.attributes{display:grid;grid-template-columns:repeat(4,1fr);gap:1px;background:#343e31;border:1px solid #343e31;border-radius:6px;overflow:hidden}.attribute{padding:10px 3px;background:#20271f;text-align:center}.attribute small{display:block;color:#84947b;font:9px monospace;margin-bottom:5px}.attribute b{font-size:13px;font-weight:400}.skills-list{display:flex;flex-direction:column}.skill{display:flex;align-items:center;width:100%;padding:11px 4px;border-bottom:1px solid #303b2e;text-align:left;gap:10px}.skill:hover{background:#293225}.skill span{flex:1}.skill b{font:12px monospace;color:#bfbea0}.skill small{font:9px monospace;color:#75816b}.timeline{padding:18px}.timeline-controls{display:flex;gap:7px;align-items:center;margin-bottom:15px}.timeline-item{padding:12px;border-left:2px solid #585e43;margin:0 0 10px;background:#222a20;border-radius:0 5px 5px 0}.timeline-item.current{border-color:var(--gold)}.timeline-item h4{margin:0;font-size:11px;font-weight:400;color:#cec7a6;display:flex;justify-content:space-between}.timeline-item p{font-size:10px;color:#8e9b83;line-height:1.7;margin:6px 0}.timeline-item button{font-size:9px;color:#b4b996;padding:3px 6px}.empty{padding:40px 20px;text-align:center;color:#89957f;line-height:1.9;font-size:12px}.dialog-backdrop{position:fixed;inset:0;background:#080c0bb5;z-index:100;display:flex;align-items:center;justify-content:center;backdrop-filter:blur(5px);padding:24px}.dialog{background:#1b221d;border:1px solid #4d5745;border-radius:12px;box-shadow:0 30px 100px #0009;width:min(620px,95vw);max-height:90vh;display:flex;flex-direction:column}.dialog.wide{width:min(840px,95vw)}.dialog-header{display:flex;align-items:center;justify-content:space-between;padding:20px 24px;border-bottom:1px solid #35402f}.dialog-header h2{margin:0;font-size:17px;font-weight:500}.dialog-body{padding:22px 24px;overflow:auto}.dialog-footer{padding:15px 24px;border-top:1px solid #35402f;display:flex;gap:8px;justify-content:flex-end}.field{margin-bottom:15px}.field label{display:block;font-size:11px;color:#aab59e;margin-bottom:8px}.field input,.field textarea,.field select{width:100%;background:#141c16}.field textarea.code{font:11px/1.8 monospace;min-height:250px}.row{display:flex;gap:10px;align-items:center}.row>*{flex:1;min-width:0}.wrap{display:flex;flex-wrap:wrap;gap:8px}.help{background:#273022;border:1px solid #404b35;border-radius:7px;padding:12px 14px;font-size:11px;line-height:1.8;color:#adb99d;margin:12px 0}.asset-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.asset-card{background:#121b14;border:1px solid #394732;border-radius:8px;overflow:hidden;text-align:left;padding:0}.asset-card:hover{border-color:#b3a473}.asset-card img{width:100%;height:110px;object-fit:contain;background:#d0d2c8;padding:5px}.asset-card span{display:block;padding:11px;font-size:11px}.room-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.room-toggle{padding:17px 10px;border:1px solid #414b36;border-radius:7px;color:#849377;background:#1a241b}.room-toggle.open{border-color:#8a8760;background:#343c28;color:#d2c694}.room-toggle span{display:block;font-size:10px;margin-top:7px}.big-time{font:50px monospace;color:var(--gold);text-align:center;padding:15px}.time-buttons{display:grid;grid-template-columns:repeat(6,1fr);gap:6px}.signal-wheel{position:fixed;z-index:150;width:230px;height:230px;border-radius:50%;background:#19231eef;border:1px solid #637153;box-shadow:0 8px 60px #0009;pointer-events:none}.wheel-center{position:absolute;left:75px;top:75px;width:80px;height:80px;border-radius:50%;background:#0d1811;border:1px solid #4e5c43;display:grid;place-items:center;color:#91a280;font-size:10px;text-align:center;padding:9px}.wheel-item{position:absolute;width:65px;height:47px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;color:#9aab8b;font-size:8px;border-radius:10px}.wheel-item strong{font-size:17px;font-weight:400}.wheel-item.active{background:#baaa79;color:#192319}.ping{position:absolute;width:18px;height:18px;border:2px solid var(--gold);border-radius:50%;transform:translate(-50%,-50%);animation:ping 1.5s ease-out forwards;pointer-events:none;z-index:6}.ping span{position:absolute;top:22px;white-space:nowrap;font-size:9px;background:#142012;color:#ddcea0;padding:2px 5px}.live-handups{position:absolute;top:20px;left:20px;z-index:12;display:flex;flex-direction:column;gap:7px}.live-handups .signal{background:#293521ed;border:1px solid #69734b;border-radius:6px;padding:8px 11px;color:#d0cba6;font-size:11px}.audio-indicator{display:flex;gap:6px;align-items:center;color:#cfbd8d;cursor:pointer}.audio-bars{display:flex;align-items:center;gap:2px;height:12px}.audio-bars i{width:2px;height:10px;background:var(--gold);animation:bars .7s ease-in-out infinite alternate}.audio-bars i:nth-child(2){animation-delay:.3s}.audio-bars i:nth-child(3){animation-delay:.1s}.checklist{display:flex;gap:10px;flex-wrap:wrap}.checklist label{display:flex;align-items:center;gap:6px;border:1px solid #404c36;border-radius:6px;padding:10px}.checklist input{accent-color:var(--gold)}#toast{position:fixed;left:50%;bottom:50px;transform:translate(-50%,20px);opacity:0;z-index:300;padding:12px 20px;max-width:90vw;background:#d5c49c;color:#172019;border-radius:8px;box-shadow:0 7px 30px #0007;pointer-events:none;transition:.2s;font-size:12px}#toast.visible{opacity:1;transform:translate(-50%,0)}.lobby{height:100dvh;display:grid;place-items:center;background:radial-gradient(ellipse at 40% 20%,#354231,#101713 70%)}.lobby-card{max-width:430px;width:90vw;background:#19241dee;border:1px solid #5a6245;padding:40px;border-radius:14px;box-shadow:0 30px 100px #0005}.lobby h1{font:36px Georgia,"Noto Serif KR",serif;letter-spacing:6px;color:#d2c294;margin:10px 0}.lobby p{color:#94a28b;line-height:1.9;margin:18px 0 25px}.alert-count{background:#a78e60;color:#1b241a;padding:1px 5px;border-radius:4px;font-size:9px;margin-left:6px}.preview-cursor{position:absolute;bottom:65px;left:50%;transform:translateX(-50%);background:#3d3e28;color:#ddd3a0;border:1px solid #8b8452;padding:8px 12px;border-radius:6px;z-index:12;font-size:11px}.button-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}.full{width:100%}.spacer{height:12px}.upload-label{display:inline-flex;align-items:center;gap:7px;cursor:pointer}.audio-row{display:flex;align-items:center;gap:10px;padding:12px 0;border-bottom:1px solid #35432f}.audio-row span{flex:1}.audio-report{font-size:10px;color:#8ea380;margin-top:10px}.token-actions{position:absolute;bottom:62px;left:50%;transform:translateX(-50%);z-index:11;display:flex;padding:5px;background:#172219ed;border:1px solid #647251;border-radius:7px;gap:4px}.scene-tools-tooltip{display:none}.sidebar.collapsed{display:none}.scene-switch-label{font-size:9px;color:#8a9b80}input[type=range]{padding:0;accent-color:var(--gold);height:20px}.badge.live{color:#a9c3a2;border-color:#4e6646}.warning{color:#c69a7a}.file-label{display:inline-flex;border:1px solid #5b6347;border-radius:6px;padding:9px 12px;color:#c4c6a7;font-size:11px;cursor:pointer}.file-label input{display:none}.profile-preview{padding:12px;border:1px solid #3b4933;border-radius:7px;margin:12px 0}.hint{font-size:10px;color:#7f9175;line-height:1.8}.summary-line{font-size:11px;line-height:1.7;color:#9aaa8e;margin:10px 0}code{font-size:11px;color:#c1bb91}button .label{pointer-events:none}@keyframes ping{0%{box-shadow:0 0 0 0 #c7ab7c66}100%{box-shadow:0 0 0 35px #c7ab7c00;opacity:0}}@keyframes arrive{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}@keyframes timeflip{0%{transform:translateY(-7px);opacity:.4}100%{transform:translateY(0);opacity:1}}@keyframes bars{from{height:3px}to{height:12px}}@media(min-width:1600px){.body-grid{grid-template-columns:72px minmax(0,1fr) 380px}.map-frame{width:calc(100% - 100px)}.party-bar{padding-left:30px;padding-right:30px;gap:16px}.party-card{padding:12px 16px}}@media(max-width:1100px){.body-grid{grid-template-columns:54px minmax(0,1fr) 300px}.topbar{padding:0 16px;gap:14px}.brand{min-width:140px}.top-actions .btn .text{display:none}.party-bar{padding:12px 10px;gap:5px}.party-card{gap:6px;padding:8px 6px}.party-card .portrait{width:29px;height:29px;flex-basis:29px}.party-stat{gap:5px;font-size:8px}.map-frame{width:calc(100% - 30px)}.scene-bar{padding:0 15px}.timer{right:15px;top:12px;min-width:125px;padding:10px 13px}.timer-value{font-size:27px}}@media(max-width:800px){.body-grid{grid-template-columns:45px minmax(0,1fr)}.sidebar{position:fixed;right:0;top:66px;bottom:30px;width:min(340px,85vw);z-index:30;box-shadow:-20px 0 50px #0007}.sidebar:not(.mobile-open){display:none}.session-meta,.top-divider,.badge{display:none}.topbar{gap:8px}.party-card .portrait{display:none}.party-card{padding:8px}.party-name{font-size:10px}.map-caption{max-width:50%;line-height:1.8;font-size:9px}.workspace{grid-template-rows:58px minmax(0,1fr) 90px}.scene-title small{display:none}.asset-grid{grid-template-columns:1fr 1fr}.room-grid{grid-template-columns:repeat(2,1fr)}.time-buttons{grid-template-columns:repeat(3,1fr)}.map-frame{max-width:none;max-height:none}.statusbar-left span:nth-child(2){display:none}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* PC view: the scene and a single sidebar. GM controls remain in the GM layout. */
body[data-role=pc]{--pc-sidebar-width:clamp(280px,28vw,360px);--bg:#080808;--panel:#111;--panel2:#191919;--line:#292929;--text:#e5e5e5;--muted:#929292;--gold:#d0d0d0;--gold2:#eee;--green:#aaa;background:#080808}
.pc-shell{grid-template-rows:minmax(0,1fr);min-height:0}
.pc-shell .body-grid{grid-template-columns:minmax(0,1fr) var(--pc-sidebar-width)}
.pc-shell .workspace{grid-template-rows:minmax(0,1fr);background:#080808}
.pc-shell .stage{background:#080808}
.pc-shell .stage:before{display:none}
.pc-shell .map-frame{width:min(calc(100% - 32px),calc((100dvh - 32px) * 1.6138));max-width:none;max-height:none;flex-shrink:0;box-shadow:0 0 0 1px #292929}
.pc-shell .map-base,.pc-shell .room-image{filter:contrast(.94) brightness(.94)}
.pc-shell .sidebar{position:relative;inset:auto;width:auto;display:flex;min-width:0;box-shadow:none;border-left:1px solid #292929;background:#111;z-index:20}
.pc-shell .sidebar-tabs{min-height:52px;padding:0 10px;display:flex;justify-content:space-between;align-items:center;border-color:#292929;gap:4px}
.pc-shell .tab-list{display:flex;align-self:stretch;min-width:0}
.pc-shell .tab{padding:0 13px;flex:0 0 auto;color:#858585;font-size:12px}
.pc-shell .tab.active{color:#eee;border-color:#ddd}
.pc-shell .sidebar-tools{display:flex;align-items:center;margin-left:auto;gap:2px}
.pc-shell .sidebar-tools .icon-btn{width:30px;height:30px}
.pc-shell .connection-warning{font-size:9px;color:#bbb}
.pc-shell .sidebar-content{background:#111}
.pc-shell .chat-empty{padding:32px 16px;color:#777;font-size:12px}
.pc-shell .compose{padding:10px 12px;background:#111;border-color:#292929}
.pc-shell .compose-toolbar{margin-bottom:5px;color:#a0a0a0}
.pc-shell .compose-toolbar .icon-btn{width:28px;height:28px}
.pc-shell .compose textarea{background:#0b0b0b;border-color:#303030;min-height:64px;color:#e5e5e5}
.pc-shell .compose-bottom small{color:#717171}
.pc-shell .compose .send{background:#d0d0d0;color:#111}
.pc-shell .message-heading{color:#ddd}
.pc-shell .message-heading time{color:#737373}
.pc-shell .message-text{color:#c8c8c8}
.pc-shell .roll-result{background:#1a1a1a;border-color:#383838}
.pc-shell .roll-line,.pc-shell .roll-level{color:#aaa}
.pc-shell .roll-total{color:#eee}
.pc-shell .roll-level.fail{color:#d19c8a}
.pc-shell .timer{right:18px;top:18px;min-width:0;padding:0;border:0;background:transparent;border-radius:0;box-shadow:none;pointer-events:none}
.pc-shell .timer-value{margin:0;font-size:27px;letter-spacing:1px;color:#ddd}
.pc-shell .timer-delta{color:#ddd}
.pc-shell .token{background:#161616}
.pc-shell .token.selected{outline-color:#ddd}
.pc-shell .token-label{background:#111d;color:#ddd}
.pc-shell .cutscene{background:#080808;padding:16px}
.pc-shell .subtitle{bottom:28px;color:#eee}
.pc-shell .live-handups{top:auto;left:auto;right:8px;bottom:50%;width:min(300px,calc(100% - 24px));max-height:calc(50% - 58px);display:flex;flex-direction:column;gap:12px;padding:4px 16px 4px 4px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#444 transparent;pointer-events:auto}
.pc-shell .live-handups .signal{position:relative;flex:0 0 auto;background:var(--signal-color);color:var(--signal-ink);border:0;border-radius:16px 16px 4px 16px;padding:11px 16px;box-shadow:0 5px 18px #0005;overflow-wrap:anywhere;text-align:left}
.pc-shell .live-handups .signal:after{content:"";position:absolute;right:-10px;bottom:12px;border-top:10px solid transparent;border-bottom:0 solid transparent;border-left:12px solid var(--signal-color)}
.pc-shell .signal-name{display:block;font-size:12px;line-height:1.4;margin-bottom:5px;font-weight:500}
.pc-shell .signal-message{display:block;font-size:17px;line-height:1.5;font-weight:650;white-space:pre-wrap}
.pc-shell .character-list{display:flex;flex-direction:column;gap:8px;padding:14px}
.pc-shell .character-card{display:flex;align-items:center;gap:12px;width:100%;padding:14px 12px;text-align:left;background:#191919;border:1px solid #303030;border-radius:7px}
.pc-shell .character-card:hover{background:#222;border-color:#555}
.pc-shell .character-card>svg{width:14px;color:#777;flex-shrink:0}
.pc-shell .character-card .party-info{display:flex;flex-direction:column;gap:7px}
.pc-shell .party-name{font-size:12px;color:#ddd}
.pc-shell .party-stat{font-size:10px;color:#929292}
.pc-shell .party-stat b{color:#ccc}
.pc-shell .you{background:#333;color:#ccc;border:0}
.pc-shell .character-panel{padding:12px 16px 20px}
.pc-shell .sheet-back{margin:0 0 18px;padding:7px 0}
.pc-shell .sheet-top{margin-bottom:18px}
.pc-shell .section-heading,.pc-shell .skill small{color:#929292}
.pc-shell .vital{background:#191919;border-color:#303030}
.pc-shell .vital label,.pc-shell .vital small{color:#999}
.pc-shell .vital b{color:#ddd}
.pc-shell .bar{background:#333}
.pc-shell .bar span{background:#aaa}
.pc-shell .attributes{background:#303030;border-color:#303030}
.pc-shell .attribute{background:#191919}
.pc-shell .attribute small{color:#999}
.pc-shell .skill{border-color:#292929}
.pc-shell .skill:hover{background:#222}
.pc-shell .skill b{color:#ddd}
body[data-role=pc] .portrait{background:#111}
body[data-role=pc] .btn{background:#202020;border-color:#3a3a3a;color:#ccc}
body[data-role=pc] .btn:hover{background:#2a2a2a;color:#eee}
body[data-role=pc] .btn.gold{background:#d0d0d0;border-color:#d0d0d0;color:#111}
body[data-role=pc] .btn.flat{background:transparent;border-color:transparent;color:#aaa}
body[data-role=pc] .icon-btn:hover{background:#282828;color:#eee}
body[data-role=pc] .alert-count{background:#444;color:#eee}
body[data-role=pc] input,body[data-role=pc] textarea,body[data-role=pc] select{background:#0e0e0e;border-color:#3a3a3a}
body[data-role=pc] .popover-layer{position:fixed;top:58px;right:12px;z-index:100;width:min(352px,calc(100vw - 24px));pointer-events:none}
body[data-role=pc] .dialog,body[data-role=pc] .dialog.wide{width:100%;max-height:min(580px,calc(100dvh - 74px));background:#151515;border-color:#414141;border-radius:8px;box-shadow:0 10px 36px #0008;pointer-events:auto}
body[data-role=pc] .dialog-header{padding:10px 14px;border-color:#303030}
body[data-role=pc] .dialog-header h2{font-size:13px}
body[data-role=pc] .dialog-header .icon-btn{width:26px;height:26px}
body[data-role=pc] .dialog-body{padding:14px}
body[data-role=pc] .dialog-footer{padding:10px 14px;border-color:#303030;flex-wrap:wrap}
body[data-role=pc] .dialog .field{margin-bottom:12px}
body[data-role=pc] .field label{color:#aaa;margin-bottom:5px}
body[data-role=pc] .dialog .field textarea.code{min-height:140px}
body[data-role=pc] .dialog .help{background:#1e1e1e;border-color:#333;color:#aaa;padding:9px 10px}
body[data-role=pc] .dialog .file-label,body[data-role=pc] .profile-preview{border-color:#444;color:#ccc}
body[data-role=pc] .dialog .sheet-top{margin-bottom:12px}
body[data-role=pc] .dialog p{margin-top:0}
body[data-role=pc] .volume-row{display:grid;grid-template-columns:1fr 40px 28px;align-items:center;gap:7px}
body[data-role=pc] .volume-value{color:#aaa;font-size:11px;text-align:right}
body[data-role=pc] .sound-details{border-top:1px solid #333;border-bottom:1px solid #333;margin:14px 0;padding:10px 0}
body[data-role=pc] .sound-details summary{cursor:pointer;color:#bbb;font-size:12px}
body[data-role=pc] .sound-details[open] summary{margin-bottom:14px}
body[data-role=pc] .settings-map{display:flex;gap:4px;align-items:center;font-size:11px;color:#aaa}
body[data-role=pc] .settings-map>span{margin-right:auto}
body[data-role=pc] .demo-links{display:flex;flex-direction:column;gap:7px;margin-top:14px;padding-top:12px;border-top:1px solid #333;font-size:10px;color:#888}
body[data-role=pc] .signal-wheel{background:#151515f5;border-color:#555}
body[data-role=pc] .wheel-center{background:#0b0b0b;border-color:#444;color:#aaa}
body[data-role=pc] .wheel-item{color:#bbb}
body[data-role=pc] .wheel-item.active{background:#ccc;color:#111}
body[data-role=pc] #toast{background:#ddd;color:#111;bottom:20px}
@media(max-width:800px){body[data-role=pc]{--pc-sidebar-width:clamp(220px,40vw,300px)}.pc-shell .body-grid{grid-template-columns:minmax(0,1fr) var(--pc-sidebar-width)}.pc-shell .sidebar:not(.mobile-open){display:flex}.pc-shell .map-frame{width:min(calc(100% - 20px),calc((100dvh - 20px) * 1.6138))}.pc-shell .character-card .portrait{display:grid}.pc-shell .timer{right:10px;top:10px;padding:6px 8px}.pc-shell .timer-value{font-size:22px}}
@media(max-width:500px){body[data-role=pc]{--pc-sidebar-width:min(55vw,240px)}.pc-shell .body-grid{grid-template-columns:minmax(0,1fr) var(--pc-sidebar-width)}.pc-shell .sidebar-tabs{padding:0 5px}.pc-shell .tab{padding:0 9px}.pc-shell .compose{padding:8px}.pc-shell .compose-bottom small{font-size:8px}.pc-shell .character-list{padding:8px}.pc-shell .character-card{padding:10px 8px;gap:8px}.pc-shell .character-card>svg{display:none}.pc-shell .party-stat{gap:7px}.pc-shell .character-panel{padding:10px}.pc-shell .vital-grid{gap:6px}.pc-shell .vital{padding:9px}.pc-shell .portrait{width:30px;height:30px;flex-basis:30px}.pc-shell .sheet-top{gap:8px}.pc-shell .sheet-top h3{font-size:14px}}

/* Action controls open beside the chat composer, keeping chat visible. */
body[data-role=pc] .popover-layer.play-action{top:auto;bottom:12px;right:calc(var(--pc-sidebar-width) + 12px);width:min(320px,calc(100vw - var(--pc-sidebar-width) - 24px))}
body[data-role=pc] .popover-layer.play-action .dialog{max-height:calc(100dvh - 24px)}
@media(max-width:600px){body[data-role=pc] .popover-layer.play-action{right:12px;width:min(320px,calc(100vw - 24px))}.pc-shell .live-handups .signal{padding:10px 12px}.pc-shell .signal-message{font-size:15px}}

.pc-shell .live-handups:empty{display:none}

/* The map is a transparent drawing, without a rectangular backing or edge. */
.map-frame,.pc-shell .map-frame{background:transparent;border:0;box-shadow:none}
.pc-shell .map-base,.pc-shell .room-image{filter:none}
.timer-value,.pc-shell .timer-value{font-family:"Iowan Old Style","Palatino Linotype","Book Antiqua",Georgia,serif;font-weight:600;font-variant-numeric:lining-nums tabular-nums;font-size:32px;letter-spacing:1px;line-height:1.1;text-shadow:0 1px 4px #0009}
.timer-delta{font-family:"Iowan Old Style",Georgia,serif;font-variant-numeric:lining-nums tabular-nums}
.live-handups,.pc-shell .live-handups{left:auto;right:0;bottom:auto;top:98px;width:min(300px,calc(100% - 20px));max-height:calc(100% - 116px);display:flex;flex-direction:column;align-items:flex-end;gap:8px;padding:4px 16px 12px 4px;overflow-x:hidden;overflow-y:auto;scrollbar-width:none;pointer-events:none}
.live-handups:empty{display:none}
.live-handups .signal,.pc-shell .live-handups .signal{position:relative;flex:0 0 auto;min-width:76px;max-width:100%;background:var(--signal-color);color:var(--signal-ink);border:0;border-radius:14px 14px 3px 14px;padding:10px 14px;text-align:center;box-shadow:0 3px 12px #0004;animation:signal-enter .24s ease-out both;overflow-wrap:anywhere}
.live-handups .signal:after{content:"";position:absolute;right:-8px;bottom:10px;border-left:10px solid var(--signal-color);border-top:9px solid transparent}
.live-handups .signal.leaving,.pc-shell .live-handups .signal.leaving{animation:signal-leave .22s ease-in both;pointer-events:none}
.signal-symbol{display:grid;place-items:center;padding:2px 8px}
.signal-symbol svg{width:34px;height:34px;stroke-width:1.8}
.live-handups .signal-name{display:block;font-size:10px;line-height:1.4;font-weight:500;margin-bottom:5px}
.live-handups .signal-message{display:block;font-size:15px;line-height:1.5;font-weight:600;white-space:pre-wrap;text-align:left}
.signal-choice{min-height:54px}
.signal-choice svg{width:27px;height:27px}
.wheel-item svg{width:28px;height:28px}
.token[hidden]{display:none}
.token.ghost.stamp-auto{opacity:.30;border-style:dashed}
.token.ghost.stamp-manual{opacity:.54;border-style:double;border-width:4px}
.token.ghost .token-label{font-size:9px}
.timeline-item.stamp-auto{border-left-style:dashed;border-left-color:#778f9b}
.timeline-item.stamp-manual{border-left-style:solid;border-left-width:3px;border-left-color:#c7ab7c}
.stamp-kind{display:flex;align-items:center;gap:5px;font-size:10px;margin-bottom:8px;color:#a7b8bf}
.stamp-manual .stamp-kind{color:#d4bd90}
.stamp-kind svg{width:13px;height:13px}
.layer-image{position:absolute;pointer-events:none;user-select:none}
.layer-controls{margin-top:20px;padding-top:14px;border-top:1px solid var(--line)}
.layer-controls h3{font-size:12px;font-weight:500;margin:0 0 12px}
.layer-controls .room-grid{margin-top:12px}
@keyframes signal-enter{from{transform:translateX(calc(100% + 22px));opacity:0}to{transform:translateX(0);opacity:1}}
@keyframes signal-leave{from{transform:translateX(0);opacity:1}to{transform:translateX(calc(100% + 22px));opacity:0}}
@media(prefers-reduced-motion:reduce){.live-handups .signal,.live-handups .signal.leaving{animation:none!important}}

.ping-layer{position:absolute;inset:0;z-index:6;pointer-events:none}
.ping{width:44px;height:44px;border:0;background:none;box-shadow:none;color:var(--ping-color);transform:translate(-50%,-50%) scale(var(--ping-scale,1));animation:ping-fade 2.1s ease-out forwards;isolation:isolate}
.ping-ring{position:absolute;inset:0;border:3px solid var(--ping-color);border-radius:50%;box-shadow:0 0 0 1px #fff8,0 0 18px var(--ping-color);animation:ping-wave 1.2s ease-out 0s both}
.ping-ring.delayed{animation-delay:.45s}
.ping-core{position:absolute;left:50%;top:50%;width:13px;height:13px;transform:translate(-50%,-50%);background:var(--ping-color);border:2px solid #fff;border-radius:50%;box-shadow:0 0 0 3px #0009,0 0 20px var(--ping-color)}
.ping span{top:calc(100% + 15px);left:50%;transform:translateX(-50%);font:600 12px/1.4 var(--font);background:#080808ed;color:#fff;border:1px solid var(--ping-color);border-radius:5px;padding:5px 9px;box-shadow:0 2px 10px #0009}
@keyframes ping-wave{0%{transform:scale(.45);opacity:1}75%{opacity:.7}100%{transform:scale(2.1);opacity:0}}
@keyframes ping-fade{0%,75%{opacity:1}100%{opacity:0}}
@media(prefers-reduced-motion:reduce){.ping,.ping-ring{animation:none!important}.ping-ring.delayed{display:none}.ping-ring{opacity:.85}}
/* GM shares the player's black palette; map artwork has no tinted backing. */
body[data-role=gm]{--bg:#080808;--panel:#111;--panel2:#1b1b1b;--line:#2b2b2b;--text:#e5e5e5;--muted:#949494;--gold:#c6c6c6;--gold2:#eee;--green:#aaa;--gm-sidebar-width:340px;background:#080808}
body[data-role=gm] :is(.topbar,.floor-rail,.sidebar,.compose,.party-bar,.statusbar){background:#111;border-color:#2b2b2b}
body[data-role=gm] :is(.workspace,.scene-bar,.stage,.cutscene){background:#080808}
body[data-role=gm] .stage:before{display:none}
body[data-role=gm] :is(.map-base,.room-image){filter:none}
body[data-role=gm] :is(.party-card,.vital,.attribute,.roll-result,.room-toggle,.help,.token-actions){background:#191919;border-color:#333;color:#bbb}
body[data-role=gm] :is(.party-name,.message-heading,.scene-title,.vital b,.skill b,.roll-total){color:#e5e5e5}
body[data-role=gm] :is(.party-stat,.vital label,.vital small,.attribute small,.section-heading,.skill small,.statusbar,.roll-line,.roll-level,.scene-label,.map-caption,.scene-switch-label,.eyebrow,.floor-button,.rail-caption,.field label){color:#929292}
body[data-role=gm] :is(.party-card.active,.floor-button.active,.room-toggle.open){background:#2b2b2b;border-color:#777;color:#eee}
body[data-role=gm] :is(.party-card:hover,.skill:hover,.floor-button:hover){background:#242424}
body[data-role=gm] .portrait{background:#111}
body[data-role=gm] .message-text{color:#ccc}
body[data-role=gm] .sidebar-content{background:#111}
body[data-role=gm] :is(.tab,.compose-toolbar,.demo-links){color:#999}
body[data-role=gm] .tab.active{color:#eee;border-color:#ccc}
body[data-role=gm] .btn{background:#202020;border-color:#3a3a3a;color:#ccc}
body[data-role=gm] .btn:hover{background:#2b2b2b;color:#fff}
body[data-role=gm] .btn.gold,body[data-role=gm] .send{background:#c6c6c6;border-color:#c6c6c6;color:#111}
body[data-role=gm] .btn.flat{background:transparent;border-color:transparent;color:#aaa}
body[data-role=gm] .icon-btn:hover{background:#2a2a2a;color:#eee}
body[data-role=gm] :is(input,textarea,select){background:#0d0d0d;border-color:#3a3a3a;color:#ddd}
body[data-role=gm] .compose textarea{background:#0b0b0b}
body[data-role=gm] .timer{background:transparent;border:0;box-shadow:none;color:#ddd}
body[data-role=gm] :is(.timer-head,.timer-label,.timer-delta){color:#999}
body[data-role=gm] .timer-value{color:#ddd}
body[data-role=gm] .bar{background:#333}
body[data-role=gm] .bar span{background:#aaa}
body[data-role=gm] .token{background:#161616}
body[data-role=gm] .token-label{background:#111d;color:#ddd}
body[data-role=gm] .asset-card img{background:#0b0b0b}
body[data-role=gm] :is(.asset-card,.file-label,.profile-preview,.attributes){border-color:#383838}
body[data-role=gm] .asset-card{background:#181818;color:#bbb}
body[data-role=gm] .signal-wheel{background:#151515f5;border-color:#555}
body[data-role=gm] .wheel-center{background:#0b0b0b;border-color:#444;color:#aaa}
body[data-role=gm] .wheel-item{color:#bbb}
body[data-role=gm] .wheel-item.active{background:#ccc;color:#111}
body[data-role=gm] #toast{background:#ddd;color:#111}
body[data-role=gm] .lobby{background:#080808}
body[data-role=gm] .lobby-card{background:#151515;border-color:#3a3a3a}

/* Small nonmodal panels leave the map and its controls usable. */
body[data-role=gm] .popover-layer{position:fixed;top:74px;right:12px;z-index:100;width:min(350px,calc(100vw - 24px));pointer-events:none}
body[data-role=gm] .popover-layer.expanded{width:min(420px,calc(100vw - 24px))}
body[data-role=gm] .dialog,body[data-role=gm] .dialog.wide{width:100%;max-height:min(560px,calc(100dvh - 100px));background:#151515;border:1px solid #404040;border-radius:8px;box-shadow:0 10px 36px #0008;pointer-events:auto}
body[data-role=gm] .dialog-header{padding:9px 12px;border-color:#303030}
body[data-role=gm] .dialog-header h2{font-size:13px;margin:0}
body[data-role=gm] .dialog-header .icon-btn{width:26px;height:26px}
body[data-role=gm] .dialog-body{padding:12px;min-height:0;overscroll-behavior:contain}
body[data-role=gm] .dialog-footer{padding:9px 12px;border-color:#303030;flex-wrap:wrap;gap:6px}
body[data-role=gm] .dialog .field{margin-bottom:10px;min-width:0}
body[data-role=gm] .dialog .field label{font-size:11px;margin-bottom:4px}
body[data-role=gm] .dialog :is(input,select,textarea){max-width:100%;min-width:0;font-size:12px}
body[data-role=gm] .dialog .field textarea.code{min-height:160px;max-height:280px}
body[data-role=gm] .dialog .help{padding:8px 10px;font-size:11px;line-height:1.5}
body[data-role=gm] .dialog p{margin-top:0}
body[data-role=gm] .dialog .big-time{font-size:32px;padding:4px}
body[data-role=gm] .dialog .spacer{height:10px}
body[data-role=gm] .dialog .room-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
body[data-role=gm] .dialog .room-toggle{padding:10px 4px;font-size:12px}
body[data-role=gm] .dialog .asset-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
body[data-role=gm] .dialog .asset-card img{height:90px}
body[data-role=gm] .popover-layer.play-action{top:auto;bottom:40px;right:calc(var(--gm-sidebar-width) + 12px);width:min(320px,calc(100vw - var(--gm-sidebar-width) - 24px))}
body[data-role=gm] .volume-row{display:grid;grid-template-columns:1fr 36px 28px;align-items:center;gap:6px}
body[data-role=gm] .volume-value{font-size:11px;text-align:right;color:#aaa}
body[data-role=gm] .sound-details{border-block:1px solid #303030;margin:12px 0;padding:9px 0}
body[data-role=gm] .sound-details summary{font-size:12px;color:#bbb;cursor:pointer}
body[data-role=gm] .sound-details[open] summary{margin-bottom:12px}
body[data-role=gm] .demo-links{display:flex;flex-direction:column;gap:6px;font-size:10px;border-top:1px solid #333;padding-top:10px;margin-top:10px}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 10px}
.form-grid .stamp-position-action{display:flex;align-items:flex-end;padding-bottom:1px}
.stamp-position-action .btn{width:100%;font-size:10px;justify-content:center;padding:8px 4px}
.session-preferences{border-bottom:1px solid #333;margin-bottom:12px;padding-bottom:4px}
.setting-toggle{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:7px 0;cursor:pointer;color:#ddd;font-size:12px}
.setting-toggle small{display:block;font-size:10px;color:#888;line-height:1.5;margin-top:3px}
.setting-toggle input[type=checkbox]{width:16px;height:16px;flex:0 0 16px;accent-color:#ccc}

/* Two compact rows per stamp, with a single-line memo when present. */
body[data-role=gm] .timeline{padding:10px}
body[data-role=gm] .timeline-controls{gap:4px;margin-bottom:7px}
body[data-role=gm] .timeline-controls .btn{padding:6px 9px;font-size:11px}
body[data-role=gm] .timeline-controls .icon-btn{width:28px;height:28px}
.timeline-count{margin-left:auto;font-size:10px;color:#777}
.timeline-hint{font-size:10px;color:#888;line-height:1.5;margin-bottom:9px}
body[data-role=gm] .timeline-item.compact-stamp{padding:7px 8px;margin-bottom:5px;border-left-width:2px;background:#181818;border-radius:0 4px 4px 0}
body[data-role=gm] .timeline-item.compact-stamp.current{background:#242424;border-left-color:#eee}
body[data-role=gm] .timeline-item.stamp-manual{border-left-color:#bbb}
body[data-role=gm] .timeline-item.stamp-auto{border-left-color:#6d8592}
.stamp-main,.stamp-sub{display:flex;align-items:center;gap:8px;min-width:0}
.stamp-sub{margin-top:2px;justify-content:space-between}
body[data-role=gm] .compact-stamp .stamp-time{padding:0;color:#999;font-size:10px;white-space:nowrap}
.stamp-time b{font:600 12px var(--font);font-variant-numeric:tabular-nums;color:#ddd;margin-left:4px}
.stamp-person{font-size:11px;color:#ccc;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}
body[data-role=gm] .compact-stamp .stamp-kind{margin:0;gap:3px;color:#929292;font-size:9px;white-space:nowrap}
.compact-stamp .stamp-kind svg{width:10px;height:10px}
.stamp-location{font-size:10px;color:#858585;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.stamp-actions{display:flex;gap:1px;flex-shrink:0}
body[data-role=gm] .compact-stamp .stamp-actions .icon-btn{padding:3px;width:23px;height:23px;color:#929292}
.stamp-actions svg{width:12px;height:12px}
body[data-role=gm] .compact-stamp .stamp-note{font-size:10px;color:#aaa;line-height:1.5;margin:2px 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media(min-width:1600px){body[data-role=gm]{--gm-sidebar-width:380px}}
@media(max-width:1100px){body[data-role=gm]{--gm-sidebar-width:300px}}
@media(max-width:800px){body[data-role=gm] .popover-layer{top:72px;right:10px;width:min(350px,calc(100vw - 20px))}body[data-role=gm] .popover-layer.expanded{width:min(400px,calc(100vw - 20px))}body[data-role=gm] .popover-layer.play-action{top:auto;bottom:40px;right:10px;width:min(320px,calc(100vw - 20px))}}

/* Map stack: artwork → history → concealed-room masks → live tokens. */
.map-frame{isolation:isolate}
.map-base,.room-image{z-index:0}
.token.ghost{z-index:1}
.ghost-mask{position:absolute;z-index:2;background:#080808;pointer-events:none}
.ghost-mask.gm-mask{background:#080808c9}
.layer-image{z-index:3}
.token:not(.ghost){z-index:4}
.map-blind{position:absolute;inset:0;background:#000;z-index:8;touch-action:none}
.blind-notice{position:absolute;left:20px;top:44px;z-index:10;background:#111e;border:1px solid #777;border-radius:5px;color:#ddd;padding:8px 10px;font-size:11px;pointer-events:none}
body[data-role=gm] .top-actions{gap:3px}
body[data-role=gm] .top-actions .btn{padding:8px 9px}
body[data-role=gm] .scene-actions{gap:6px}
body[data-role=gm] .popover-layer{max-width:calc(100vw - 20px)}
body[data-role=gm] .dialog{max-height:min(560px,calc(100dvh - 20px))}
.stamp-group{padding:10px!important;margin-bottom:7px!important;border:1px solid #303030!important;border-left:3px solid #444!important;border-radius:6px;background:#161616}
.stamp-group.live-time{background:#242424;border-left-color:#e3d7ac!important}
.stamp-group.current{outline:1px solid #8b8b8b;outline-offset:-1px}
.stamp-group .stamp-main{display:flex;align-items:center;gap:8px}
.stamp-group .stamp-time{padding:2px 0;font-size:11px;white-space:nowrap}
.stamp-group .stamp-time b{font-size:14px;margin-left:4px}
.stamp-group .stamp-kind{margin-left:auto;font-size:9px;color:#999}
.timeline-live-label{display:none;font-size:9px;color:#e3d7ac;white-space:nowrap}
.live-time .timeline-live-label{display:inline}
.stamp-members{display:flex;flex-wrap:wrap;gap:5px 10px;margin:8px 0 5px;font-size:10px;color:#aaa}
.stamp-members span:before{content:"";display:inline-block;width:5px;height:5px;background:var(--color);border-radius:50%;margin-right:4px}
.stamp-group-actions{display:flex;justify-content:flex-end;gap:4px}
.stamp-group-actions .btn{font-size:10px;padding:4px 6px;gap:4px}
.stamp-group-actions svg{width:13px;height:13px}
.stamp-detail-row{border-bottom:1px solid #333;padding:10px 0}
.stamp-detail-row strong{font-size:12px;font-weight:500}
.stamp-detail-row small{display:block;color:#999;font-size:10px;margin-top:4px}
.stamp-detail-row p{font-size:11px;color:#aaa;white-space:pre-wrap;overflow-wrap:anywhere;margin:6px 0}
.stamp-detail-row .stamp-actions{display:flex;justify-content:flex-end;align-items:center;margin-top:4px}
.stamp-detail-row .btn{font-size:10px;padding:5px 8px}
.bgm-channel{border:1px solid #333;background:#111;padding:10px;border-radius:6px;margin:10px 0}
.bgm-channel h3{font-size:12px;font-weight:500;margin:0 0 8px;display:flex;justify-content:space-between}
.bgm-channel h3 small{font-size:10px;color:#999}
.bgm-channel select{width:100%;margin-bottom:8px}
.bgm-channel .btn{font-size:11px;padding:6px 8px}
.bgm-volume{display:flex;align-items:center;gap:12px;font-size:10px;color:#aaa;margin-top:10px}
.bgm-volume input{flex:1;min-width:0}
@media(max-width:1100px){body[data-role=gm] .topbar{gap:8px;padding-inline:12px}body[data-role=gm] .session-meta{display:none}body[data-role=gm] .brand{min-width:100px}body[data-role=gm] .top-actions .btn{font-size:11px;padding:7px}}

/* The room preview stays translucent; the ghost plane has a hard exclusion clip. */
.ghost-clip-defs{position:absolute;width:0;height:0;pointer-events:none;overflow:hidden}
.ghost-clip-defs rect{fill:#fff;stroke:none}
.ghost-layer{position:absolute;inset:0;z-index:1;clip-path:url(#ghost-visibility-clip);pointer-events:none}
/* GM only: past tokens under a still-closed cover, drawn over the cover (z 2) and under live tokens (z 4), dimmer than open ones. */
.ghost-layer.covered-ghosts{clip-path:none;z-index:3;opacity:.7}
body[data-role=gm] .ghost-layer .token.ghost{pointer-events:auto;cursor:pointer}
body[data-role=gm] .ghost-layer .token.ghost:hover{outline:1px solid #ddd;outline-offset:3px}
.manager-tabs{display:flex;gap:6px;margin-bottom:10px}
.manager-tabs .btn{flex:1}
.managed-row{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid #333}
.managed-row>div:first-child{min-width:0;flex:1}
.managed-row strong{display:block;font-size:12px;font-weight:500;overflow-wrap:anywhere}
.managed-row small{display:block;font-size:10px;color:#999;margin-top:5px;line-height:1.5}
.managed-row .btn{font-size:10px;padding:6px 8px;white-space:nowrap}
.managed-row .wrap{gap:4px;justify-content:flex-end}
.placement-notice{position:absolute;top:76px;left:20px;z-index:12;background:#171717f0;color:#ddd;border:1px solid #777;padding:7px 10px;border-radius:6px;font-size:12px;display:flex;gap:10px;align-items:center}
.placement-notice .btn{font-size:10px;padding:5px}
.stamp-detail-row .stamp-actions{flex-wrap:wrap}
body[data-role=gm] .scene-actions{flex-wrap:wrap;justify-content:flex-end}

.session-row{border:1px solid #343434;border-radius:7px;padding:11px;margin:10px 0;background:#101010}
.session-row-title{display:flex;justify-content:space-between;gap:8px;align-items:center;margin-bottom:6px}
.session-row-title strong{font-size:13px;font-weight:500;overflow-wrap:anywhere}
.session-row>code,.session-id{display:block;font-size:10px;overflow-wrap:anywhere;color:#999;user-select:all}
.session-row .hint{margin:8px 0;line-height:1.6}
.session-row .wrap{gap:5px}
.session-row .btn{font-size:11px;padding:6px 9px}
.legacy-session{border-top:1px solid #333;padding-top:12px;margin-top:16px}
.legacy-session summary{cursor:pointer;color:#aaa;font-size:12px;margin-bottom:10px}
body[data-role=gm] .lobby-card{max-height:calc(100dvh - 32px);overflow:auto;padding:28px;scrollbar-width:thin}

/* Current resources stay inline in the sheet; no editor dialog. */
.vital-value{display:flex;align-items:center;justify-content:space-between;gap:5px;min-height:38px}
.vital-value>span{white-space:nowrap;text-align:center}
.vital .vital-step{width:28px;height:30px;flex:none;display:grid;place-items:center;border:1px solid #3c3c3c;border-radius:5px;background:#242424;color:#eee;font-size:20px;line-height:1;padding:0;touch-action:manipulation}
.vital .vital-step:hover:not(:disabled){background:#383838;border-color:#777}
.vital .vital-step:disabled{opacity:.25}
.vital-value small{margin-left:3px}

/* Subtitles remain above a PC blind and do not intercept scene pings. */
.subtitle{z-index:9;pointer-events:none}
.cutscene img{user-select:none}
.cutscene .ping-layer{z-index:1}
/* Compact two-dimensional timeline: fixed axes, independent scroll. */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.sidebar-content.timeline-content{overflow:hidden;display:flex;flex-direction:column}
body[data-role=gm] .timeline.timeline-sheet{padding:8px;display:flex;flex-direction:column;flex:1;min-height:0}
.timeline-sheet .timeline-controls{flex-shrink:0;display:flex;flex-wrap:wrap}
.timeline-sheet .timeline-hint{flex-shrink:0;margin-bottom:6px}
.timeline-scroll{flex:1;min-height:0;overflow:auto;border:1px solid #333;border-radius:4px;scrollbar-width:thin;scrollbar-color:#555 #111;overscroll-behavior:contain}
.timeline-table{border-collapse:separate;border-spacing:0;width:100%;min-width:638px;table-layout:fixed;font-variant-numeric:tabular-nums;font-size:10px}
.timeline-table th,.timeline-table td{border-right:1px solid #303030;border-bottom:1px solid #303030;height:43px;padding:0;vertical-align:middle}
.timeline-table thead th{position:sticky;top:0;z-index:3;height:30px;background:#202020;color:#bbb;font-weight:600;text-align:center}
.timeline-table thead th:first-child{left:0;z-index:4;width:50px}
.timeline-table tbody th{position:sticky;left:0;z-index:2;background:#191919;color:#999;text-align:center;font-weight:400}
.timeline-table .active-cycle{color:#eee;box-shadow:inset 0 2px #bcbcbc}
.timeline-table .future-cycle{color:#444;background:#101010}
.timeline-table .timeline-blank{color:#343434;text-align:center}
.timeline-table .clock-row>th{color:#fff;background:#38332a;box-shadow:inset 3px 0 #d9c297}
.timeline-table .clock-row>.timeline-blank{box-shadow:inset 0 1px #555044}
.timeline-cell{position:relative;background:#181818}
.timeline-cell.live-time{background:#29271f;box-shadow:inset 0 2px #bca574}
.timeline-cell.current{outline:1px solid #eee;outline-offset:-2px}
.timeline-cell-view{width:100%;height:100%;min-height:42px;padding:6px 19px 6px 6px;text-align:left;border:0;background:none;display:flex;flex-direction:column;justify-content:center;gap:5px;color:#ddd}
.timeline-cell-view:hover{background:#ffffff0a}
.timeline-cell-view strong{font-size:10px;font-weight:550;white-space:nowrap}
.timeline-cell-view small{font-size:8px;font-weight:400;color:#999;margin-left:2px}
.timeline-dots{display:flex;align-items:center;gap:3px;min-height:5px}
.timeline-dots i{width:5px;height:5px;border-radius:50%;background:var(--color);flex:none}
.auto-cell .timeline-dots i{background:transparent;border:1px solid var(--color)}
.timeline-dots em{font-size:7px;font-style:normal;color:#9cbaa2;white-space:nowrap}
.timeline-cell-settings{position:absolute;right:1px;top:2px;border:0;background:none;padding:3px;width:20px;height:21px;color:#888;display:grid;place-items:center}
.timeline-cell-settings:hover{color:#fff;background:#444;border-radius:3px}
.timeline-cell-settings svg{width:12px;height:12px}

.test-grid{position:absolute;inset:0;background-image:linear-gradient(#ffffff55 1px,transparent 1px),linear-gradient(90deg,#ffffff55 1px,transparent 1px);background-size:5% 8.069%;pointer-events:none;display:grid;place-items:center}
.test-grid>span{font-size:clamp(24px,4vw,56px);font-weight:600;letter-spacing:.2em;color:#fff;text-shadow:0 2px 8px #000;user-select:none}
.floor-button[data-floor="test"]{font-size:10px}

.mobile-panel-controls,.touch-token-controls{display:none}
@media(max-width:900px){
 body{--chat-height:min(240px,max(168px,calc(var(--app-height,100dvh) * .28)))}
 body[data-chat-size=expanded]{--chat-height:min(440px,calc(var(--app-height,100dvh) * .60))}
 body[data-chat-size=collapsed]{--chat-height:44px}
 .pc-shell{position:fixed;top:var(--mobile-top,0px);left:0;right:0;height:var(--app-height,100dvh);min-height:0}
 .pc-shell .body-grid{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) calc(var(--chat-height) + env(safe-area-inset-bottom));min-height:0}
 .pc-shell .workspace{min-height:0;min-width:0;grid-template-rows:minmax(0,1fr)}
 .pc-shell .sidebar,.pc-shell .sidebar:not(.mobile-open){position:relative;inset:auto;grid-column:1;grid-row:2;display:flex;width:100%;min-height:0;padding-bottom:env(safe-area-inset-bottom);border-left:0;border-top:1px solid #333;box-shadow:none;overflow:hidden}
 .pc-shell .sidebar-tabs{flex:none;height:44px;min-height:44px;padding:0 6px}
 .pc-shell .tab{padding:0 10px;font-size:12px}
 .pc-shell .sidebar-tools{gap:0}
 .pc-shell .sidebar-tools .icon-btn{height:40px;width:36px}
 .mobile-panel-controls{display:flex;align-items:center;gap:2px;margin-left:auto;flex:none}
 .mobile-panel-controls button{border:0;background:transparent;min-width:34px;height:40px;padding:0 5px;color:#bbb;font-size:11px;touch-action:manipulation}
 .mobile-panel-controls button:first-child{font-size:23px}
 .sidebar-content{overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
 .sidebar .compose{display:grid;grid-template-columns:minmax(0,1fr) 38px;grid-template-rows:28px 38px;gap:3px 6px;flex:none;padding:5px 8px 7px}
 .sidebar .compose-toolbar{grid-column:1 / -1;margin:0;min-height:0;gap:2px}
 .sidebar .compose-toolbar .icon-btn{height:28px;width:36px}
 .sidebar .compose textarea{grid-row:2;grid-column:1;width:100%;height:38px;min-height:38px;max-height:38px;padding:8px;font-size:16px;line-height:20px;resize:none}
 .sidebar .compose-bottom{grid-row:2;grid-column:2;margin:0;padding:0;display:flex;align-items:center}
 .sidebar .compose-bottom small{display:none}
 .sidebar .compose .send{height:38px;width:38px;padding:8px}
 .sidebar .message{padding:7px 10px;gap:8px}
 .sidebar .message .portrait{width:26px;height:26px;flex-basis:26px}
 .sidebar .message-text{font-size:12px;line-height:1.45}
 body[data-chat-size=collapsed] .sidebar-content,body[data-chat-size=collapsed] .compose{display:none}
 .pc-shell .map-frame{width:min(calc(100vw - 16px),calc((var(--app-height,100dvh) - var(--chat-height) - env(safe-area-inset-bottom) - 16px) * 1.6138));max-height:none;max-width:none}
 .touch-token-controls{position:absolute;display:flex;align-items:center;gap:5px;left:50%;bottom:8px;transform:translateX(-50%);z-index:11;border:1px solid #363636;border-radius:9px;background:#111e;padding:3px;touch-action:manipulation}
 .touch-token-controls>button{width:46px;height:44px;border:0;background:#222;border-radius:6px;color:#eee;font-size:22px;display:flex;align-items:center;justify-content:center;gap:3px;touch-action:manipulation}
 .touch-token-controls small{font-size:10px;color:#999}
 .touch-token-controls>span{min-width:70px;max-width:120px;text-align:center;display:grid;gap:2px;padding:0 5px}
 .touch-token-controls strong{font-size:10px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .touch-token-controls output{font-size:11px;color:#aaa;font-variant-numeric:tabular-nums}
 .pc-shell .subtitle{font-size:16px;line-height:1.6;bottom:12px;left:6%;right:6%}
 body[data-role=pc] .popover-layer,body[data-role=pc] .popover-layer.play-action{top:auto;right:8px;bottom:calc(100dvh - var(--mobile-top,0px) - var(--app-height,100dvh) + var(--chat-height) + env(safe-area-inset-bottom) + 8px);width:min(352px,calc(100vw - 16px))}
 body[data-role=pc] .dialog,body[data-role=pc] .dialog.wide,body[data-role=pc] .popover-layer.play-action .dialog{max-height:max(120px,calc(var(--app-height,100dvh) - var(--chat-height) - 24px))}
 body[data-role=pc] input,body[data-role=pc] textarea,body[data-role=pc] select{font-size:16px}
 body[data-role=gm] .body-grid{grid-template-columns:45px minmax(0,1fr)}
 body[data-role=gm] .sidebar-tabs{flex:none;min-height:44px;height:44px}
 body[data-role=gm] .sidebar{position:fixed;top:auto;left:0;right:0;bottom:0;width:100%;height:calc(var(--chat-height) + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);border-top:1px solid #444;z-index:30}
 body[data-role=gm] .sidebar:not(.mobile-open){display:none}
 body[data-role=gm] .sidebar.mobile-open{display:flex}
 body[data-role=gm] .token-actions .icon-btn{min-width:44px;min-height:44px;touch-action:manipulation}
}
@media(max-width:900px) and (max-height:500px){
 body{--chat-height:142px}
 body[data-chat-size=expanded]{--chat-height:calc(var(--app-height,100dvh) * .60)}
 body[data-chat-size=collapsed]{--chat-height:44px}
 .pc-shell .timer-value{font-size:20px}
}

/* Scale the entire token, including its label and direction, in map space. */
.token{transform:translate(-50%,-50%) scale(var(--token-map-scale,1))}
.chat-resize-handle{display:none}
@media(max-width:900px){
 body[data-chat-size=custom]{--chat-height:var(--custom-chat-height,200px)}
 body[data-chat-size=collapsed]{--chat-height:60px}
 .chat-resize-handle{display:flex;align-items:center;justify-content:center;flex:0 0 16px;width:100%;height:16px;cursor:ns-resize;touch-action:none;user-select:none;background:#111;position:relative;z-index:2}
 .chat-resize-handle span{display:block;width:42px;height:4px;border-radius:3px;background:#666;pointer-events:none}
 .chat-resize-handle:hover span,.chat-resize-handle:focus-visible span,.resizing-chat .chat-resize-handle span{background:#ddd}
 .chat-resize-handle:focus-visible{outline:1px solid #999;outline-offset:-2px}
 body.resizing-chat{cursor:ns-resize;user-select:none}
 .resizing-chat .sidebar{transition:none}
}

/* Direct gestures keep the subtitle area free of fixed rotation controls. */
.stage{touch-action:none;-webkit-touch-callout:none;user-select:none}
.stage img{-webkit-user-drag:none;-webkit-touch-callout:none}
.token.rotating,.pc-shell .token.rotating{outline-color:#70e4ef}
.cutscene{overflow:hidden;touch-action:none}
.cutscene img{transform-origin:center;will-change:transform}
@media(max-width:900px){.token-actions{display:none!important}}

/* Move any panel by its title; controls and scrolling remain independent. */
.dialog-header{cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none}
.dragging-popup,.dragging-popup .dialog-header{cursor:grabbing;user-select:none}
body[data-role] .popover-layer.compact-signal{width:min(264px,calc(100vw - 16px))}
body[data-role] .compact-signal .dialog-header{padding:5px 8px}
body[data-role] .compact-signal .dialog-header h2{font-size:12px}
body[data-role] .compact-signal .dialog-body{padding:8px}
.signal-input-row{display:flex;gap:5px;align-items:center}
.signal-input-row input{min-width:0;flex:1;padding:7px 8px}
.signal-input-row button{flex:0 0 32px}

/* One direct hand-up control centered above the chat input, with no launcher. */
.sidebar .compose-toolbar{display:grid;grid-template-columns:minmax(0,1fr) 36px minmax(0,1fr);align-items:center;gap:6px}
/* Typing indicator: takes the place of the "Enter 전송" hint under the input, so it covers neither chat nor input.
   Where that hint is hidden (narrow screens) it becomes its own line under the input, only while someone types. */
.compose{position:relative}
.typing-indicator{position:absolute;left:15px;bottom:12px;height:30px;max-width:calc(100% - 70px);display:flex;align-items:center;pointer-events:none;overflow:hidden;white-space:nowrap;font-size:10px;color:#c2bca2;opacity:0;transition:opacity .15s}
.typing-indicator.visible{opacity:1}
.compose:has(.typing-indicator.visible) .compose-bottom small{visibility:hidden}
@media(max-width:900px){
 .sidebar .typing-indicator{position:static;grid-column:1 / -1;height:auto;max-width:none;font-size:11px;padding:1px 2px 0;display:none}
 .sidebar .typing-indicator.visible{display:flex}
}
/* Jump-to-latest button: bottom-right corner of the chat log, only while scrolled up. */
.chat-jump{position:absolute;right:14px;bottom:100%;margin-bottom:10px;z-index:3;width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:#262c29;border:1px solid #4a534c;color:var(--gold);box-shadow:0 4px 14px #0008;opacity:0;visibility:hidden;transform:translateY(4px);transition:opacity .15s,transform .15s,visibility .15s}
.chat-jump.visible{opacity:1;visibility:visible;transform:none}
.chat-jump:hover{background:#323a35}
.typing-dots{display:inline-flex;gap:2px;margin-right:6px;vertical-align:middle}
.typing-dots i{width:3px;height:3px;border-radius:50%;background:var(--gold);animation:typing-dot 1s infinite}
.typing-dots i:nth-child(2){animation-delay:.15s}.typing-dots i:nth-child(3){animation-delay:.3s}
@keyframes typing-dot{0%,60%,100%{opacity:.35;transform:none}30%{opacity:1;transform:translateY(-2px)}}
.compose-speaker{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.compose-speaker select{width:100%;min-width:0}
.compose-tools{display:flex;align-items:center;justify-content:flex-end;min-width:0;gap:2px}
.sidebar .compose-toolbar .compose-handup{justify-self:center;width:36px;height:28px;touch-action:none;user-select:none;-webkit-touch-callout:none}
.compose-handup svg{pointer-events:none}

/* Mobile PC chat: one tab row (tabs · hand-up · tools) and a single-line composer. */
.mobile-only{display:none}
@media(max-width:900px){
 .pc-shell .sidebar-tabs{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:4px}
 .pc-shell .sidebar-tools{justify-self:end;min-width:0}
 .pc-shell .sidebar-tools .icon-btn{width:34px}
 .pc-shell .mobile-panel-controls button{min-width:30px}
 .pc-shell span.mobile-only{display:contents}
 .pc-shell .tab-handup{display:flex;align-items:center;justify-content:center;justify-self:center;width:48px;height:34px;border:1px solid #3a3a3a;border-radius:17px;background:#1b1b1b;color:#ddd;touch-action:none;user-select:none;-webkit-touch-callout:none}
 .pc-shell .tab-handup:active,.pc-shell .tab-handup:focus-visible{border-color:#888;background:#262626}
 .pc-shell .sidebar .compose-toolbar{display:none}
 .pc-shell .sidebar .compose{grid-template-rows:38px;padding-top:7px}
 .pc-shell .sidebar .compose textarea,.pc-shell .sidebar .compose-bottom{grid-row:1}
}

/* Dice roll: the total shuffles with a tumbling die, then lands and reveals the success level. */
.roll-total{display:flex;align-items:center;gap:8px}
.roll-value{display:inline-block;font-variant-numeric:tabular-nums;transform-origin:left center}
.roll-die{display:none;width:20px;height:20px;color:#9a9a9a}
.roll-die svg{width:100%;height:100%}
.roll-result.rolling .roll-die{display:inline-flex;animation:roll-tumble .42s linear infinite}
.roll-result.rolling .roll-value{opacity:.7}
.roll-result.rolling .roll-level{visibility:hidden}
.roll-result.rolling{animation:roll-shake .16s linear infinite}
.roll-result.landed .roll-value{animation:roll-land .45s cubic-bezier(.2,1.5,.4,1)}
.roll-result.landed .roll-level{animation:roll-level-in .45s ease-out}
@keyframes roll-tumble{0%{transform:rotate(0) translateY(0)}25%{transform:rotate(90deg) translateY(-4px)}50%{transform:rotate(180deg) translateY(0)}75%{transform:rotate(270deg) translateY(-4px)}100%{transform:rotate(360deg) translateY(0)}}
@keyframes roll-shake{0%,100%{transform:translateX(0)}25%{transform:translateX(-1px)}75%{transform:translateX(1px)}}
@keyframes roll-land{0%{transform:scale(1.3);opacity:.6}100%{transform:scale(1);opacity:1}}
@keyframes roll-level-in{0%{opacity:0;transform:translateY(-3px)}100%{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){.roll-result,.roll-result *{animation:none!important}}

/* Voice/BGM toggle shows its on state; luck label rolls a luck check. */
.icon-btn.audio-on{color:#8fd3c4}
.icon-btn[data-action=enable-audio]:not(.audio-on){opacity:.75}
.vital-roll{display:flex;align-items:center;gap:5px;border:0;background:none;padding:0;color:#8e9e88;font-size:9px;letter-spacing:1px;cursor:pointer}
.pc-shell .vital-roll,body[data-role=gm] .vital-roll{color:#999}
.vital-roll svg{width:12px;height:12px}
.vital-roll:hover,.vital-roll:focus-visible{color:#e5e5e5}

/* Character sheet readability: larger numbers, 7th-ed half/fifth values, and a searchable two-column skill list. */
.vital label,.vital-roll{font-size:11px}
.vital b{font-size:26px}
.vital-value small{font-size:12px}
.attribute{padding:9px 2px 8px}
.attribute small{font-size:10px;margin-bottom:3px}
.attribute small i{font:10px var(--font);font-style:normal;opacity:.7}
.attribute b{display:block;font:22px Georgia,serif;line-height:1.15}
.attribute em{display:block;font:10px monospace;font-style:normal;color:#808080;margin-top:2px}
.skill-tools{position:sticky;top:-1px;z-index:2;display:flex;gap:6px;padding:6px 0 8px;background:#111}
.skill-tools input{flex:1;min-width:0;height:34px;padding:0 10px;border:1px solid #333;border-radius:6px;background:#0b0b0b;color:#e5e5e5}
.skill-tools select{flex:none;height:34px;padding:0 6px;border:1px solid #333;border-radius:6px;background:#0b0b0b;color:#ccc}
.skills-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));column-gap:14px}
.skill-row{display:flex;align-items:center;min-width:0;border-bottom:1px solid #292929}
.skill-row[hidden]{display:none}
.skill-row .skill,.pc-shell .skill-row .skill{flex:1;min-width:0;border:0;padding:9px 2px;gap:6px}
.skill-row .skill span{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.skill-row .skill b{font:18px Georgia,serif;color:#ddd}
.skill-row.strong .skill b{color:var(--gold2)}
.skill-row .skill small{font-size:10px;color:#808080;white-space:nowrap}
.skill-pin{flex:none;width:26px;height:34px;border:0;background:none;padding:0;color:#3d3d3d;font-size:13px}
.skill-pin:hover,.skill-pin:focus-visible{color:#999}
.skill-pin.on{color:var(--gold2)}
.skill-group-label{margin:10px 0 0;font-size:10px;letter-spacing:1px;color:#8a8a8a}
.skills-list.pinned{margin-bottom:4px}
.skill-empty{padding:18px 0;text-align:center;color:#777}
.vital-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.vital,.pc-shell .vital{min-width:0;padding:10px 8px}
.vital-value{gap:3px}
.vital-value>span{min-width:0;overflow:hidden;text-overflow:ellipsis}
.vital .vital-step{width:26px}
.character-panel{container-type:inline-size}
.vital-value>span{overflow:visible}
@container (max-width:330px){.vital-grid{grid-template-columns:minmax(0,1fr)}.vital{display:grid;grid-template-columns:78px 1fr;align-items:center;column-gap:10px}.vital .vital-value{min-height:34px}.vital .bar{grid-column:1 / -1}}

/* Skill-check outcome: a colored edge on the roll bubble (green pass / red fail), stronger for critical and fumble. */
.sidebar .roll-result.roll-pass{border-left:4px solid #5fae7a;background:linear-gradient(90deg,#5fae7a26,transparent 55%),#1a1a1a}
.sidebar .roll-result.roll-fail{border-left:4px solid #c9574d;background:linear-gradient(90deg,#c9574d26,transparent 55%),#1a1a1a}
.sidebar .roll-result.roll-critical{border-left-width:7px;box-shadow:inset 0 0 0 1px #5fae7a66}
.sidebar .roll-result.roll-fumble{border-left-width:7px;box-shadow:inset 0 0 0 1px #c9574d66}
.sidebar .roll-pass .roll-level{color:#8fd19e;font-weight:600}
.sidebar .roll-fail .roll-level{color:#e58a80;font-weight:600}
.sidebar :is(.roll-critical,.roll-fumble) .roll-level{font-size:12px}

/* SAN and luck: the current value itself is the roll button (large touch target). */
.vital .vital-roll{flex:1;min-width:0;height:40px;display:flex;align-items:center;justify-content:center;gap:3px;padding:0 4px;border:1px dashed #444;border-radius:6px;background:#141414;color:inherit;font-size:inherit;letter-spacing:0;touch-action:manipulation}
.vital .vital-roll:hover,.vital .vital-roll:focus-visible{border-color:#888;background:#1f1f1f}
.vital .vital-roll:active{background:#2a2a2a}
.vital .vital-roll small{margin-left:2px}
.vital-dice{display:inline-flex;vertical-align:-2px;margin-left:4px;opacity:.7}
.vital-dice svg{width:12px;height:12px}

/* Notes tab: shared memo cards and handouts. */
.notes-panel{display:flex;flex-direction:column;gap:10px;padding:10px 12px 16px}
.notes-switch{position:sticky;top:-1px;z-index:2;display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;margin:-10px -12px 0;background:#111;border-bottom:1px solid #262626}
.notes-switch button{position:relative;height:34px;border:0;border-radius:6px;background:transparent;color:#999;font-size:12px}
.notes-switch button.active{background:#222;color:#eee}
.notes-switch small{color:#777;margin-left:2px}
.notes-switch .alert-count{position:absolute;top:3px;right:8px}
.note-compose{display:grid;gap:6px}
.note-compose textarea,.note-card textarea,.handout-text-input{width:100%;resize:vertical;padding:8px 10px;border:1px solid #333;border-radius:6px;background:#0b0b0b;color:#e5e5e5;font:13px/1.5 var(--font)}
.note-compose .btn{justify-self:end}
.note-list,.handout-list{display:flex;flex-direction:column;gap:8px}
.note-card{border:1px solid #2c2c2c;border-left:3px solid var(--color);border-radius:6px;background:#171717;padding:8px 10px}
.note-card header{display:flex;justify-content:space-between;gap:8px;font-size:11px;color:#999;margin-bottom:5px}
.note-author{color:#ddd;font-weight:600}
.note-body{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.55;color:#ddd}
.note-actions{display:flex;justify-content:flex-end;gap:4px;margin-top:6px}
.note-link{border:0;background:none;padding:4px 6px;color:#888;font-size:11px}
.note-link:hover,.note-link:focus-visible{color:#eee}
.note-link.danger:hover{color:#e58a80}
.handout-card{display:flex;align-items:center;gap:10px;width:100%;padding:8px;border:1px solid #2c2c2c;border-radius:6px;background:#171717;color:inherit;text-align:left}
.handout-card.gm{flex-direction:column;align-items:stretch}
.handout-open{display:flex;align-items:center;gap:10px;border:0;background:none;padding:0;color:inherit;text-align:left}
.handout-thumb{flex:none;width:56px;height:56px;border-radius:4px;overflow:hidden;background:#0b0b0b;display:grid;place-items:center;color:#666}
.handout-thumb img{width:100%;height:100%;object-fit:cover}
.handout-thumb svg{width:22px;height:22px}
.handout-meta{display:grid;gap:3px;min-width:0}
.handout-meta b{font-weight:600;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.handout-meta small{color:#888;font-size:11px}
.handout-gm-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.handout-gm-head p{margin:0;font-size:11px}
.handout-recipients{display:flex;flex-wrap:wrap;gap:5px}
.recipient-chip{height:28px;padding:0 10px;border:1px solid #3a3a3a;border-radius:14px;background:#111;color:#999;font-size:11px}
.recipient-chip.on{border-color:var(--color);background:color-mix(in srgb,var(--color) 22%,#111);color:#eee}
.recipient-chip.all{border-style:dashed}
.handout-image{display:block;max-width:100%;max-height:60vh;margin:0 auto;border-radius:4px;cursor:zoom-in}
.handout-image.zoomed{position:fixed;inset:0;z-index:1000;width:100vw;height:100dvh;max-height:none;margin:0;border-radius:0;object-fit:contain;background:#000e;cursor:zoom-out}
.handout-text{white-space:pre-wrap;overflow-wrap:anywhere;margin-top:10px;font-size:14px;line-height:1.7;color:#ddd}
.handout-picker{display:grid;grid-template-columns:repeat(auto-fill,minmax(84px,1fr));gap:6px;max-height:220px;overflow:auto;margin-bottom:8px}
.pick-card{position:relative;display:grid;gap:3px;padding:4px;border:1px solid #333;border-radius:5px;cursor:pointer;font-size:10px;color:#aaa}
.pick-card input{position:absolute;opacity:0;pointer-events:none}
.pick-card img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:3px}
.pick-card span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pick-card.none{place-items:center;min-height:84px}
.pick-card:has(input:checked){border-color:var(--gold2);box-shadow:0 0 0 1px var(--gold2)}
.dialog textarea#handout-body{width:100%;resize:vertical;padding:8px;border:1px solid #333;border-radius:6px;background:#0b0b0b;color:#e5e5e5}
@media(max-width:900px){.pc-shell .tab{padding:0 7px}}

/* GM token controls anchored under the selected token (positioned by positionTokenActions). */
.token-actions.anchored{bottom:auto;transform:none;box-shadow:0 4px 14px #000a}
/* Selected token not on this floor: keep the controls at the top centre, clear of subtitles at the bottom. */
.token-actions:not(.anchored){top:14px;bottom:auto}

/* Layered map: open doors/numbers sit under covers; covers are black masks (GM: translucent); locked doors above. */
.layer-image.under-cover{z-index:0}
.area-cover{position:absolute;z-index:2;pointer-events:none;user-select:none}
.area-cover.gm-mask{opacity:.72}
.openable-hint{position:absolute;z-index:3;pointer-events:none;border:2px dashed #7fd19a;border-radius:4px;box-shadow:inset 0 0 0 1px #0006}
.openable-hint em{position:absolute;left:6px;top:6px;padding:2px 6px;border-radius:3px;background:#1c3a25e6;color:#bdf0cb;font:600 calc(11px / var(--zoom-scale,1)) var(--font);font-style:normal;white-space:nowrap}
/* GM reveal dialog */
.reveal-heading{margin:16px 0 6px;font-size:11px;letter-spacing:1px;color:#999;font-weight:600}
.openable-badge,.openable-key{font-size:10px;color:#9fe0b0;border:1px dashed #7fd19a;border-radius:3px;padding:1px 5px;font-weight:500}

/* Trailer: full-screen over map and chat for everyone. */
.video-overlay{position:fixed;inset:0;z-index:5000;display:grid;place-items:center;background:#000;height:100dvh}
.video-overlay video{width:100%;height:100%;object-fit:contain;background:#000}
.video-unblock{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);padding:14px 22px;border:1px solid #fff6;border-radius:28px;background:#000c;color:#fff;font-size:16px}
.video-controls{position:absolute;top:12px;right:12px;display:flex;flex-wrap:wrap;gap:6px;opacity:.35;transition:opacity .2s}
.video-overlay:hover .video-controls,.video-controls:focus-within{opacity:1}
.video-controls .btn{background:#111d;border-color:#444;color:#ddd}
.video-library{display:grid;gap:6px;margin:6px 0 12px}
.video-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px;border:1px solid #333;border-radius:6px}
.video-row span{display:flex;align-items:center;gap:6px}
.video-row small{color:#888}
.video-row svg{width:14px;height:14px}

/* Countdown sign-holder: x drifts linearly while y rises fast and falls (a parabola), tilting back on the way down. */
#countdown-layer{position:fixed;right:12px;bottom:0;width:190px;height:min(70vh,420px);overflow:hidden;pointer-events:none;z-index:4500}
.count-jump{position:absolute;right:20px;bottom:0;width:150px;animation:count-x 1s linear both;animation-delay:var(--delay,0ms)}
.count-rise{transform-origin:50% 100%;animation:count-y 1s both;animation-delay:var(--delay,0ms)}
.count-rise img{display:block;width:100%;height:auto;filter:drop-shadow(0 6px 10px #0009)}
@keyframes count-x{from{transform:translateX(18px)}to{transform:translateX(-26px)}}
@keyframes count-y{
 0%{transform:translateY(105%) rotate(-8deg);animation-timing-function:cubic-bezier(.15,.75,.35,1)}
 48%{transform:translateY(-22%) rotate(2deg);animation-timing-function:cubic-bezier(.6,0,.85,.35)}
 100%{transform:translateY(105%) rotate(18deg)}}
@media(max-width:900px){.count-jump{width:112px;right:8px}#countdown-layer{width:140px}}
@media(prefers-reduced-motion:reduce){.count-jump,.count-rise{animation:none}.count-rise{transform:none}}
/* Seam-free map pieces: one native-resolution canvas scaled with the map frame. */
.map-canvas{position:absolute;inset:0;width:100%;height:100%;z-index:0;pointer-events:none;user-select:none}

/* Black map frame replaces the all-black shell image; the chat log stays laid out as before. */
#map:not(.test-map){background:#000}
#chat-log{display:contents}
.chat-more{display:block;width:calc(100% - 24px);margin:8px 12px;padding:8px;border:1px solid #333;border-radius:6px;background:#161616;color:#aaa;font-size:12px}

/* Split view: scene and live map share the stage like divided viewports; the map keeps its aspect inside its half. */
.stage.split{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:minmax(0,1fr);place-items:center;container-type:size}
.stage.split>.map-frame{grid-column:2;grid-row:1}
.stage.split .map-frame,.pc-shell .stage.split .map-frame{width:min(calc(50cqw - 24px),calc((100cqh - 24px) * 1.6138));max-width:none;max-height:none}
.stage.split>.cutscene{inset:0 50% 0 0;border-right:1px solid #2c2c2c}
.stage.split>.subtitle,.pc-shell .stage.split>.subtitle{left:3%;right:53%}
@media(max-width:900px){
 .stage.split{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) minmax(0,1fr)}
 .stage.split>.map-frame{grid-column:1;grid-row:2}
 .stage.split .map-frame,.pc-shell .stage.split .map-frame{width:min(calc(100cqw - 16px),calc((50cqh - 16px) * 1.6138))}
 .stage.split>.cutscene{inset:0 0 50% 0;border-right:0;border-bottom:1px solid #2c2c2c}
 .stage.split>.subtitle,.pc-shell .stage.split>.subtitle{left:4%;right:4%;bottom:calc(50% + 8px)}
}

/* Investigator smartphone: peeks from the bottom edge beside the chat, rises on hover, and stays above everything during the call. */
#phone-layer{position:fixed;width:192px;height:372px;overflow:hidden;pointer-events:none;z-index:60}
#phone-layer.calling{z-index:6000}
.phone{position:absolute;left:12px;bottom:0;width:168px;height:348px;pointer-events:auto;cursor:pointer;outline:0;transform:translateY(calc(100% - 34px));transition:transform .38s cubic-bezier(.2,.8,.25,1)}
.phone.up,.phone:focus-visible,.phone:has(:focus-visible){transform:translateY(-12px)}
@media(hover:hover){.phone:not(.nohover):hover{transform:translateY(-12px)}}
#phone-layer.calling .phone{transform:translateY(-12px);cursor:default}
body[data-role=pc] #phone-layer.calling .phone{pointer-events:none}
.phone-body{position:relative;height:100%;display:flex;flex-direction:column;padding:8px 8px 10px;background:#0c0c0e;border:2px solid #3a3a40;border-radius:26px;box-shadow:0 10px 34px #000c,inset 0 0 0 1px #000;user-select:none}
.phone-speaker{width:42px;height:4px;margin:0 auto 5px;border-radius:3px;background:#2c2c31;flex:none}
.phone-status{display:flex;align-items:center;gap:5px;height:16px;padding:0 6px;font-size:10px;color:#c9c9c9;flex:none}
.phone-status b{font-weight:600}.phone-status em{margin-left:auto;font-style:normal}
.phone-out{color:#d98b82}
.phone-signal{display:inline-flex;align-items:flex-end;gap:1.5px;height:10px}
.phone-signal i{width:3px;background:#d6d6d6;border-radius:1px}
.phone-signal i:nth-child(1){height:3px}.phone-signal i:nth-child(2){height:5px}.phone-signal i:nth-child(3){height:7px}.phone-signal i:nth-child(4){height:10px}
.phone-signal.off i{background:#4b4b4f}
.phone-screen{position:relative;flex:1;min-height:0;margin-top:5px;overflow:hidden;border-radius:16px;background:linear-gradient(170deg,#23262c,#121317 70%);color:#eee}
.phone-lock{display:flex;flex-direction:column;align-items:center;padding-top:44px;gap:6px;text-align:center}
.phone-lock strong{font-size:40px;font-weight:300;letter-spacing:.5px;font-variant-numeric:tabular-nums}
.phone-lock span{font-size:11px;color:#b9b9b9}
.phone-call{position:relative;height:100%;display:flex;flex-direction:column;align-items:center;padding-top:44px;gap:6px;text-align:center}
.phone-call small{font-size:10px;color:#aaa;font-variant-numeric:tabular-nums}
.phone-call strong{font-size:24px;font-weight:500}
.phone-call span{font-size:10px;color:#999}
.phone-call-keys{position:absolute;left:0;right:0;bottom:20px;display:flex;justify-content:space-around}
.phone-call-keys i{width:36px;height:36px;border-radius:50%}
.phone-call-keys .decline{background:#a9483f}.phone-call-keys .accept{background:#4d8a5c;animation:phone-pulse 1.2s infinite}
.phone-static{position:absolute;inset:-40px;opacity:.28;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.95' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");animation:phone-static .35s steps(5) infinite}
.phone-dead{position:absolute;inset:0;background:linear-gradient(155deg,#101114 0,#050506 45%,#020203 100%)}
.phone-controls{display:flex;flex-direction:column;gap:5px;margin-top:7px;flex:none}
.phone-control{padding:6px 4px;border:1px solid #47474d;border-radius:8px;background:#1b1b1f;color:#ddd;font-size:11px}
.phone-control:hover{background:#29292e}.phone-control.gold{border-color:#c7ab7c;color:#e1c596}
.phone.shaking .phone-body{animation:phone-shake .7s linear infinite}
@keyframes phone-shake{0%,58%{transform:translate(0)}2%,10%,18%,26%,34%,42%,50%{transform:translate(-2px,1px) rotate(-.7deg)}6%,14%,22%,30%,38%,46%,54%{transform:translate(2px,-1px) rotate(.7deg)}100%{transform:translate(0)}}
@keyframes phone-pulse{50%{box-shadow:0 0 0 7px #4d8a5c44}}
@keyframes phone-static{to{transform:translate(38px,-26px)}}
@media(prefers-reduced-motion:reduce){.phone.shaking .phone-body,.phone-static,.phone-call-keys .accept{animation:none}}
/* Everything except the phone fades to black for players; the GM keeps the controls. */
body{transition:background-color 1.2s}
#app,#overlay,#toast,#countdown-layer{transition:opacity 1.2s}
body.phone-fading,body.phone-dark{background:#000}
body.phone-fading{transition:background-color var(--phone-fade-ms,6000ms) linear}
body.phone-fading :is(#app,#overlay,#toast,#countdown-layer),body.phone-dark :is(#app,#overlay,#toast,#countdown-layer){opacity:0;pointer-events:none}
body.phone-fading :is(#app,#overlay,#toast,#countdown-layer){transition:opacity var(--phone-fade-ms,6000ms) linear}
@media(max-width:900px){#phone-layer{width:150px;height:324px}.phone{left:6px;width:138px;height:300px}.phone-lock,.phone-call{padding-top:30px}.phone-lock strong{font-size:32px}.phone-lock span{font-size:10px}.phone-call strong{font-size:20px}}

/* Background image download progress, centred at the top of the stage. */
#load-progress{position:fixed;transform:translateX(-50%);z-index:55;display:flex;align-items:center;gap:8px;padding:5px 10px;border:1px solid #3a3a3a;border-radius:999px;background:#111e;color:#bbb;font-size:11px;white-space:nowrap;font-variant-numeric:tabular-nums;pointer-events:none;opacity:0;transition:opacity .3s}
#load-progress.show{opacity:1}
#load-progress i{display:block;width:64px;height:3px;border-radius:2px;background:#333;overflow:hidden}
#load-progress b{display:block;height:100%;width:0;background:#c7ab7c;transition:width .15s linear}
body.phone-fading #load-progress,body.phone-dark #load-progress{opacity:0}
/* A fixed track keeps a tall image inside its circle: an auto track would grow to the image's natural height. */
.token,.portrait{grid-template:minmax(0,1fr)/minmax(0,1fr)}
.token img,.portrait img{display:block;min-width:0;min-height:0}
.audio-row .portrait{flex:none}

/* Combat: turn order across the top of the stage, and a ring on whoever is acting. */
.combat-strip{position:absolute;top:10px;left:50%;transform:translateX(-50%);z-index:11;display:flex;align-items:center;gap:6px;max-width:calc(100% - 370px);padding:4px 6px;background:#111e;border:1px solid #3a3a3a;border-radius:10px}
.pc-shell .combat-strip{max-width:calc(100% - 180px)}
.combat-round{flex:none;padding:0 6px;font-size:11px;color:#e1c596;white-space:nowrap}
.combat-order{display:flex;gap:4px;min-width:0;overflow-x:auto;scrollbar-width:none}
.combat-chip{flex:none;display:flex;align-items:center;gap:5px;padding:2px 8px 2px 2px;border:1px solid transparent;border-radius:999px;background:transparent;color:#aaa;font-size:11px;white-space:nowrap}
button.combat-chip:hover{background:#ffffff14}
.combat-chip .portrait,.pc-shell .combat-chip .portrait{width:24px;height:24px;flex:0 0 24px;font-size:9px}
.combat-chip.current{border-color:#e1c596;background:#e1c59622;color:#fff}
.combat-chip.down{opacity:.45;text-decoration:line-through}
.combat-chip.hidden-npc{border-style:dashed;border-color:#555}
.combat-strip .icon-btn{flex:none;width:26px;height:26px}
.token.acting{box-shadow:0 0 0 3px #e1c596,0 0 16px 5px #e1c59699;z-index:5}
.combat-rows{display:flex;flex-direction:column;gap:6px}
.combat-row{display:flex;align-items:center;gap:8px;padding:6px;border:1px solid #333;border-radius:8px}
.combat-row.current{border-color:#e1c596}
.combat-row.down{opacity:.55}
.combat-row>span:not(.portrait){flex:1;min-width:0;display:flex;flex-direction:column}
.combat-row small{color:#8a8a8a;font-size:10px}
.combat-row input[type=number]{width:58px}
.combat-row .btn{padding:5px 8px}
.combat-row .portrait{flex:none}
@media(max-width:900px){.combat-strip,.pc-shell .combat-strip{top:34px;max-width:calc(100% - 12px)}.combat-chip:not(.current) span:not(.portrait){display:none}.combat-chip{padding:2px}.combat-chip.current{padding-right:8px}}

/* Blind fade: same black and layer as the blind itself, so the swap at the end cannot be seen. */
.blind-fade{position:absolute;inset:0;z-index:8;background:#000;pointer-events:none;animation-timing-function:ease-in-out;animation-fill-mode:both}
/* Resting opacity is the fade's end state, so with animations off (Windows "animation effects" off ->
   prefers-reduced-motion) a finished fade-in never leaves a black sheet over the map. */
.blind-fade.out{animation-name:blind-fade-out;opacity:1}
.blind-fade.in{animation-name:blind-fade-in;opacity:0}
@keyframes blind-fade-out{from{opacity:0}to{opacity:1}}
@keyframes blind-fade-in{from{opacity:1}to{opacity:0}}

/* Token names: short and see-through by default, the full name on hover, selection, drag, a tap or the acting turn. */
.token-label,.pc-shell .token-label,body[data-role=gm] .token-label{background:#1118;color:#ddd;text-shadow:0 1px 2px #000;pointer-events:none}
.token-label .label-full{display:none}
.token:is(:hover,:focus-visible,.selected,.rotating,.acting,.peek) .token-label{background:#111e;z-index:6}
.token:is(:hover,:focus-visible,.selected,.rotating,.acting,.peek) .label-short{display:none}
.token:is(:hover,:focus-visible,.selected,.rotating,.acting,.peek) .label-full{display:inline}
.token:not(.ghost):is(:hover,.selected){z-index:6}

/* GM warning: the floor being viewed has no token on it. */
.empty-floor-notice{position:absolute;left:25px;bottom:44px;z-index:8;color:#e0635a;font-size:13px;font-weight:600;text-shadow:0 1px 3px #000;pointer-events:none}
.elevator-floors{display:flex;flex-direction:column;gap:6px}
.elevator-floors .btn{justify-content:space-between;width:100%}
.elevator-floors small{color:#8f8f8f;font-size:10px}
.elevator-floors .gold small{color:inherit}
.npc-layer .token{pointer-events:auto}
/* Corridor doors share the map canvas's box and scale, so they line up with the covers pixel for pixel. */
.shaft-canvas{position:absolute;inset:0;width:100%;height:100%;z-index:0;pointer-events:none}
/* Map reveal panel: a small copy of the map. Covered areas look as they do on the GM's map, revealed ones show bright. */
body[data-role=gm] .popover-layer.expanded:has(.reveal-map){width:min(780px,calc(100vw - 24px))}
.reveal-tools{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:8px}
.reveal-floor{font-size:14px;font-weight:600;color:#ddd;display:flex;align-items:baseline;gap:8px}
.reveal-floor small{font-size:11px;font-weight:400;color:#8a8a8a}
.reveal-map{position:relative;aspect-ratio:3060/1705;background:#000;border:1px solid #2a2a2a;border-radius:6px;overflow:hidden;container-type:inline-size;user-select:none}
.reveal-area{position:absolute;padding:0;border:0;outline:1px solid #ffffff1c;outline-offset:-1px;background:linear-gradient(#000000c4,#000000c4),var(--crop) center/100% 100% no-repeat #000;color:#9a9a9a;display:grid;place-items:center;overflow:hidden;cursor:pointer}
.reveal-area span{font-size:clamp(7px,1.35cqw,11px);line-height:1.1;padding:1px 3px;border-radius:3px;pointer-events:none;word-break:keep-all;text-align:center}
.reveal-area:hover{outline:1px solid #e1c596;outline-offset:-1px;z-index:1}
.reveal-area:focus-visible{outline:2px solid #e1c596;outline-offset:-2px;z-index:1}
.reveal-area.on{background:var(--crop) center/100% 100% no-repeat #fff;color:#fff}
.reveal-area.on span{background:#111c}
.reveal-openable{position:absolute;border:2px dashed #7fd19a;border-radius:3px;pointer-events:none;z-index:2}
.reveal-room-toggle{position:absolute;transform:translate(-50%,-50%);z-index:3;min-width:clamp(26px,5.4cqw,42px);height:clamp(16px,3cqw,22px);padding:0 4px;border:1px solid #555;border-radius:999px;background:#141414;color:#ccc;font-size:clamp(9px,1.5cqw,12px);font-weight:700;cursor:pointer}
.reveal-room-toggle:hover{border-color:#e1c596}
.reveal-room-toggle.some{border-color:#c7ab7c;color:#e1c596}
.reveal-room-toggle.on{background:#e8e8e8;border-color:#fff;color:#111}
.reveal-door{position:absolute;transform:translate(-50%,-50%);z-index:4;min-width:clamp(22px,4.6cqw,36px);height:clamp(12px,2.1cqw,16px);padding:0 2px;border:1px solid #666;border-radius:3px;background:#222;color:#bbb;font-size:clamp(7px,1.15cqw,10px);line-height:1;cursor:pointer}
.reveal-door:hover{filter:brightness(1.3)}
.reveal-door.open{background:#23402d;border-color:#6fbf8a;color:#c8f1d4}
.reveal-door.locked{background:#4a2723;border-color:#c97b73;color:#f3cbc6}
.reveal-legend{display:flex;flex-wrap:wrap;gap:4px 14px;margin-top:8px;font-size:10px;color:#8a8a8a}
.reveal-legend span{display:inline-flex;align-items:center;gap:5px}
.reveal-legend .key{display:inline-grid;place-items:center}
.reveal-legend .key.area{width:14px;height:10px;background:#3a3a3a;outline:1px solid #666}
.reveal-legend .key.room{padding:0 5px;border:1px solid #555;border-radius:999px;background:#141414;color:#ccc;font-size:9px}
.reveal-legend .key.door{width:16px;height:9px;border:1px solid #6fbf8a;border-radius:2px;background:#23402d}
.reveal-legend .key.openable{width:14px;height:10px;border:1px dashed #7fd19a}
.reveal-groups{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:0 16px}
.reveal-groups .btn{padding:5px 9px;font-size:11px}

/* One-touch sound effects tab. */
.sfx-panel{padding:10px 12px}
.sfx-head{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.sfx-preview{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:#bbb;cursor:pointer}
.sfx-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(92px,1fr));gap:6px}
.sfx-btn{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;min-height:44px;padding:5px 4px;border:1px solid #3a3a3a;border-radius:7px;background:#1a1a1a;color:#ddd;font-size:12px;line-height:1.2;cursor:pointer}
.sfx-btn:hover{background:#262626;border-color:#777}
.sfx-btn:active{transform:translateY(1px);background:#333}

/* Cutscene library: the image now on screen. */
body[data-role=gm] .asset-card.active{border-color:var(--gold2);color:var(--gold2)}

/* Scenario voice progress (GM): a bar in the voice dialog and a thin line under the top-bar button. */
[data-voice-progress][hidden]{display:none}
.voice-progress{margin:10px 0;padding:8px 10px;border:1px solid #333;border-radius:6px;background:#141414}
.voice-progress-head{display:flex;justify-content:space-between;gap:8px;font-size:12px;color:#ccc;margin-bottom:6px}
.voice-progress-head span:last-child{font-variant-numeric:tabular-nums;color:var(--gold2)}
.voice-progress-bar{height:6px;border-radius:3px;background:#2a2a2a;overflow:hidden}
.voice-progress-bar i,.voice-line i{display:block;height:100%;width:var(--pct,0%);background:var(--gold2)}
.voice-btn{position:relative}
.voice-line{position:absolute;left:8px;right:8px;bottom:2px;height:2px;border-radius:1px;background:#3a3a3a;overflow:hidden}

/* Split view: the scene half slides in from the left when it appears or changes image. */
@keyframes split-scene-in{from{transform:translateX(-100%)}to{transform:none}}
.stage.split>.cutscene{animation:split-scene-in .45s cubic-bezier(.2,.8,.2,1)}
@media (prefers-reduced-motion:reduce){.stage.split>.cutscene{animation:none}}

/* Character memo under the sheet (backstory, belongings); public to everyone. */
.character-memo{margin-top:14px}
.character-memo textarea{width:100%;resize:vertical;min-height:96px;padding:8px 10px;border:1px solid #333;border-radius:6px;background:#0b0b0b;color:#e5e5e5;font:13px/1.55 var(--font)}
.character-memo-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:6px}
.character-memo-foot .muted{font-size:11px}
.character-memo-text{white-space:pre-wrap;margin:0;padding:8px 10px;border:1px solid #2c2c2c;border-radius:6px;background:#141414;font-size:13px;line-height:1.55;color:#ddd}

/* Past records shown to players are grey, so they never read as someone standing there now.
   The GM sees the same grey on the records that are published. */
body:not([data-role=gm]) .token.ghost,.token.ghost.published{filter:grayscale(1) brightness(.85)}

/* Staged effects over the stage (fire, smoke, bulb flicker, cycle blackout, ending). The container makes no
   stacking context, so each layer sits against the cutscene (7) and subtitles (9) on its own z-index. The GM sees them dimmed. */
.stage-fx{position:absolute;inset:0;pointer-events:none}
.stage-fx>*{position:absolute;inset:0;pointer-events:none}
body[data-role=gm] .stage-fx{opacity:.5}
.fx-blackout{z-index:12;background:#000}
.fx-ending{z-index:11;background:#000;display:grid;place-items:center;padding:24px}
.fx-news{max-width:min(720px,90%);width:100%;border-top:2px solid #b3261e;padding-top:12px}
.fx-news small{color:#e0574f;letter-spacing:.3em;font-size:11px;font-weight:700}
.fx-headline{margin:10px 0 0;color:#eee;font-size:clamp(16px,2.6vw,26px);line-height:1.5;font-weight:600;min-height:1.5em}
.fx-headline::after{content:'▌';color:#aaa;margin-left:2px;animation:fx-caret 1s steps(1) infinite}
.fx-headline.done::after{animation-duration:1.2s}
@keyframes fx-caret{50%{opacity:0}}
.fx-heat{z-index:6;opacity:0;background:radial-gradient(ellipse at 50% 50%,transparent 42%,#ff4a1a55 72%,#a01000bb 100%);animation:fx-heat-pulse 2.4s ease-in-out infinite}
@keyframes fx-heat-pulse{50%{filter:brightness(1.4)}}
.fx-smoke{z-index:6;opacity:0;overflow:hidden;background:#211e1ccc}
.fx-smoke i{position:absolute;inset:-25%;background:radial-gradient(circle at 30% 40%,#4a4541 0,transparent 42%),radial-gradient(circle at 72% 62%,#3b3734 0,transparent 48%),radial-gradient(circle at 52% 18%,#56504b 0,transparent 38%);filter:blur(28px);animation:fx-smoke-drift 18s ease-in-out infinite alternate}
.fx-smoke i+i{animation-duration:27s;animation-direction:alternate-reverse;opacity:.8}
@keyframes fx-smoke-drift{from{transform:translate(-6%,3%) scale(1)}to{transform:translate(6%,-4%) scale(1.15)}}
/* One cycle every 15 s; each dip keeps its old length (about 70 ms), only the gaps between them grew. */
.fx-flicker{z-index:6;background:#000;opacity:0;animation:fx-flicker 15s steps(1) infinite}
@keyframes fx-flicker{0%,100%{opacity:0}5.35%{opacity:.15}5.84%{opacity:0}6.33%{opacity:.22}6.81%{opacity:0}22.87%{opacity:.1}23.36%{opacity:0}34.55%{opacity:.28}34.94%{opacity:.05}35.28%{opacity:.2}35.77%{opacity:0}}
.fx-burst{z-index:6;background:#000;animation:fx-burst 1.6s linear both}
@keyframes fx-burst{0%{opacity:0}6%{opacity:.85}10%{opacity:.1}16%{opacity:.9}22%{opacity:.3}30%,55%{opacity:.95}60%{opacity:.2}66%{opacity:.7}75%,100%{opacity:0}}
.fx-fire{position:absolute;z-index:3;pointer-events:none;mix-blend-mode:screen}
.fx-fire i{position:absolute;inset:10%;border-radius:50%;background:radial-gradient(circle,#ffb347cc 0,#ff6a1a88 35%,#c0200033 60%,transparent 72%);animation:fx-flame 1.3s ease-in-out infinite alternate}
.fx-fire i:nth-child(2){inset:20% 5% 0 25%;animation-duration:.9s;animation-delay:-.4s}
.fx-fire i:nth-child(3){inset:0 25% 15% 5%;animation-duration:1.7s;animation-delay:-.8s}
@keyframes fx-flame{from{transform:scale(.92);opacity:.75}to{transform:scale(1.08);opacity:1}}
.stage.fx-shake{animation:fx-shake .5s cubic-bezier(.36,.07,.19,.97)}
@keyframes fx-shake{10%,90%{transform:translate(-2px,0)}20%,80%{transform:translate(4px,1px)}30%,50%,70%{transform:translate(-7px,-1px)}40%,60%{transform:translate(7px,1px)}}
@media (prefers-reduced-motion:reduce){.stage.fx-shake{animation:none}.fx-smoke i{animation:none}}
.fx-section+.fx-section{margin-top:14px}
.fx-status{margin:6px 0;font-size:12px;color:var(--gold2);font-variant-numeric:tabular-nums}
