/* LAST CITY — approved art direction. Single visual system shared across distinct role layouts.
   Decorative images contain no baked-in UI labels. No icon fonts or chess-piece placeholders. */
:root{
  --ink:#06131a;--ink2:#091b23;--panel:#071a21ee;--panel2:#0b232c;--panel3:#102b34;
  --gold:#f0c47d;--gold-high:#ffe2a9;--gold-deep:#95622c;--teal:#67dfd0;--teal-dark:#1c777c;
  --text:#f1f5f4;--sub:#b5cbd0;--muted:#809ca6;--line:#35515b;
  --cut:16px;--header-height:118px;--sidebar-width:226px;
  --title-font:Inter,'Segoe UI',Arial,sans-serif;
}
*{box-sizing:border-box}
html{min-width:300px;background:var(--ink)}
body{margin:0;color:var(--text);font-family:Inter,'Segoe UI',Arial,sans-serif;font-size:15px;line-height:1.42;background:#05141a;
  background-image:repeating-linear-gradient(127deg,transparent 0 130px,rgba(54,111,117,.028) 131px,transparent 133px),linear-gradient(140deg,#071d24,#031018 58%,#081923);min-height:100vh}
button,input,select{font:inherit}
button{cursor:pointer}
button:disabled{opacity:.4;cursor:not-allowed}
[hidden]{display:none!important}
.ui-icon{width:22px;height:22px;display:inline-block;vertical-align:middle;flex:none}
button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--gold-high);outline-offset:3px}

/* Access screen – the city is photographic atmosphere; the single form is live HTML. */
.login-screen{min-height:100vh;display:grid;place-items:center;padding:34px 16px;position:relative;isolation:isolate;background-image:radial-gradient(ellipse at center,rgba(4,20,26,.08) 0,rgba(4,16,22,.08) 40%,rgba(3,13,20,.15) 85%),url('/city-environment.jpg');background-size:cover;background-position:center}
.login-screen:before{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(90deg,rgba(0,5,8,.16),transparent 24%,rgba(1,13,18,.04) 80%,rgba(0,5,8,.10))}
.login-panel{position:relative;width:min(630px,94vw);padding:31px 51px 42px;text-align:center;background:linear-gradient(150deg,rgba(8,29,35,.985),rgba(3,17,24,.98) 78%);border:1px solid #bd8a46;clip-path:polygon(3.1% 0,96.9% 0,100% 3.2%,100% 96.7%,97% 100%,3% 100%,0 96.8%,0 3.2%);box-shadow:0 35px 80px rgba(0,0,0,.7),0 0 35px rgba(232,158,75,.1)}
.login-panel:before{content:"";position:absolute;inset:3px;pointer-events:none;border:1px solid rgba(48,140,143,.35);clip-path:polygon(3% 0,97% 0,100% 3%,100% 97%,97% 100%,3% 100%,0 97%,0 3%)}
.login-panel:after{content:"";position:absolute;pointer-events:none;left:32%;right:32%;bottom:0;height:4px;background:linear-gradient(90deg,transparent,#79ebd7,transparent);box-shadow:0 -2px 18px #66c4b4}
.login-mark{height:102px;display:flex;justify-content:center;align-items:center;margin-top:-5px}
.login-mark img{width:175px;height:99px;object-fit:contain;filter:drop-shadow(0 0 12px rgba(238,176,91,.28))}
.login-brand{font-size:40px;line-height:1.04;font-weight:750;letter-spacing:.12em;color:#f4ce91;text-shadow:0 0 19px rgba(245,173,75,.18)}
.login-brand span{font-size:48px}
.login-tagline{letter-spacing:.29em;color:#b1c9cf;font-size:11px;margin:13px 0 13px}
.login-rule{display:flex;align-items:center;gap:10px;color:var(--teal);margin:0 auto 22px;font-size:12px}
.login-rule:before,.login-rule:after{content:"";height:1px;flex:1;background:linear-gradient(90deg,transparent,rgba(93,192,190,.55))}
.login-rule:after{transform:rotate(180deg)}
.login-panel h1{font-size:29px;line-height:1.25;margin:0 0 10px;letter-spacing:-.025em}
.login-intro{margin:0 auto 28px;max-width:480px;color:#d6e2e2;font-size:15px}
.login-form{text-align:left;display:grid;gap:9px}
.login-form label{font-size:12px;color:#b7d6d9;margin:1px 0 -5px 6px}
.field-wrap{display:flex;align-items:center;height:56px;border:1px solid #5b9b9e;clip-path:polygon(11px 0,100% 0,100% calc(100% - 11px),calc(100% - 11px) 100%,0 100%,0 11px);background:linear-gradient(135deg,rgba(12,43,50,.95),rgba(4,28,35,.92));box-shadow:inset 0 0 20px rgba(52,159,163,.08)}
.field-wrap:focus-within{border-color:var(--gold);box-shadow:0 0 12px #c3924940}
.field-symbol{width:62px;flex:none;color:#d5e7e4;font-size:28px;text-align:center}
.field-wrap input{background:transparent;border:0;outline:0;color:var(--text);width:100%;height:100%;padding-right:12px;font-size:17px}
.field-wrap input::placeholder{color:#8da6aa}
.login-form select{width:100%;height:56px;background:#0c252d;color:#e4eeee;border:1px solid #59868c;padding:0 16px;clip-path:polygon(9px 0,100% 0,100% calc(100% - 9px),calc(100% - 9px) 100%,0 100%,0 9px)}
.button-gold{display:inline-flex;align-items:center;justify-content:center;gap:12px;border:1px solid #f9cd8c;color:#fff8e9;background:linear-gradient(180deg,#cc984e 0%,#996128 44%,#72471e 54%,#b87d38 97%,#f1c17a);text-shadow:0 1px #50351c;font-weight:700;box-shadow:inset 0 1px 0 #ffe0a8,0 0 15px rgba(229,158,67,.42),0 3px 15px #0009;transition:filter .15s ease,transform .15s ease;clip-path:polygon(11px 0,calc(100% - 11px) 0,100% 11px,100% calc(100% - 11px),calc(100% - 11px) 100%,11px 100%,0 calc(100% - 11px),0 11px)}
.button-gold:hover:not(:disabled){filter:brightness(1.16)}
.button-gold:active:not(:disabled){transform:translateY(1px)}
.login-submit{width:100%;min-height:62px;margin-top:19px;font-size:20px}
.login-submit span{font-size:27px;font-weight:400}
.login-footnote{border-top:1px solid rgba(106,182,182,.5);margin-top:30px;padding-top:22px;font-size:14px;color:#bacecf}
.login-error{color:#ffb38d;min-height:12px;margin:10px 0 0;font-size:13px}

/* Shared world frame. */
#game{min-height:100vh}
.game-header{height:var(--header-height);position:relative;display:flex;align-items:center;justify-content:space-between;padding:0 24px;overflow:hidden;border-bottom:1px solid #a67a3a;background:linear-gradient(90deg,rgba(4,16,23,.18) 0%,rgba(5,20,28,.57) 49%,rgba(3,16,21,.15) 100%),url('/city-header.jpg') center 43%/cover no-repeat}
.game-header:after{content:"";height:3px;position:absolute;inset:auto 0 0;background:linear-gradient(90deg,#dba45b,transparent 16%,#4de0d0 50%,transparent 82%,#e4ad5c);box-shadow:0 0 13px rgba(89,229,211,.6)}
.header-brand{z-index:1;display:flex;align-items:center;gap:9px;min-width:310px;background:linear-gradient(90deg,rgba(5,15,19,.76),rgba(5,16,22,.25) 95%,transparent);padding:8px 22px 7px 4px;clip-path:polygon(0 0,95% 0,100% 50%,95% 100%,0 100%)}
.header-seal{width:81px;height:67px;object-fit:contain;filter:drop-shadow(0 0 10px #e6a65a55)}
.header-brand-title strong{display:block;color:#f5d59e;font-size:25px;line-height:1.01;letter-spacing:.10em;text-shadow:0 1px 7px #000}
.header-brand-title span{display:block;margin-top:6px;font-size:9px;letter-spacing:.22em;color:#b6dadd}
.header-atmosphere{position:absolute;inset:0 20% 0 22%;background:radial-gradient(ellipse at center,rgba(3,13,17,.45),transparent 70%);pointer-events:none}
.header-status{position:relative;z-index:1;display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid #377e79;background:rgba(5,30,33,.92);clip-path:polygon(10px 0,calc(100% - 10px) 0,100% 10px,100% calc(100% - 10px),calc(100% - 10px) 100%,10px 100%,0 calc(100% - 10px),0 10px)}
.live-pulse{background:#3ee6b0;box-shadow:0 0 13px #3ee6b0;width:9px;height:9px;border-radius:50%}
.header-status #connection{font-weight:700;color:#7df2d1;font-size:12px;letter-spacing:.08em;white-space:nowrap}
.connection-lost .live-pulse{background:#e9a355;box-shadow:0 0 13px #e9a355}
.header-logout,.button-outline{border:1px solid #5dadaf;color:#e5f4f5;background:linear-gradient(180deg,#15343c,#0a232c);padding:9px 13px;transition:background .15s ease,box-shadow .15s}
#music-toggle[aria-pressed="true"]{color:var(--gold-high);border-color:var(--gold)}
.header-logout{font-size:12px;white-space:nowrap;border-color:#567780}
.button-outline:hover:not(:disabled),.header-logout:hover{background:#1c4a53;box-shadow:0 0 10px #5edbcb44}
.game-shell{display:grid;grid-template-columns:var(--sidebar-width) minmax(0,1fr);min-height:calc(100vh - var(--header-height))}
.sidebar{position:relative;display:flex;flex-direction:column;gap:10px;padding:21px 12px 12px;border-right:1px solid #976b37;background:linear-gradient(125deg,#071922f9 0%,#051219fb 62%,#0b2128);box-shadow:inset -3px 0 14px #0009}
.sidebar:before{content:"";position:absolute;left:8px;right:8px;top:5px;height:1px;background:linear-gradient(90deg,transparent,#e7b86f,transparent)}
.sidebar-heading{color:var(--gold);font-size:14px;letter-spacing:.09em;font-weight:800;line-height:1.3;padding:2px 10px 11px}
.navigation{display:grid;align-content:start;gap:6px}
.nav-link{border:1px solid transparent;color:#d1e2e4;background:transparent;min-height:53px;padding:10px 13px;display:flex;align-items:center;gap:13px;text-align:left;transition:all .13s ease;position:relative}
.nav-link .ui-icon{height:22px;width:22px}
.nav-link:hover{background:rgba(30,95,102,.3);color:#fff}
.nav-link.selected{background:linear-gradient(110deg,rgba(176,112,39,.94),rgba(70,42,17,.88));color:#ffecd0;border-color:#e3a961;box-shadow:inset 0 0 19px #d08d405a,0 0 17px #af6e2866;clip-path:polygon(9px 0,calc(100% - 9px) 0,100% 9px,100% calc(100% - 9px),calc(100% - 9px) 100%,9px 100%,0 calc(100% - 9px),0 9px)}
.nav-link.selected:after{content:"";position:absolute;right:0;top:calc(50% - 5px);height:10px;width:4px;background:#ffe5a0;box-shadow:0 0 9px #ffe4a0}
.nav-link span{font-size:14px;font-weight:550}
.sidebar-art{margin:auto -12px 0;min-height:170px;display:flex;align-items:center;justify-content:center;opacity:.38;background:linear-gradient(0deg,transparent,#13272b80),radial-gradient(circle at 50% 58%,#c7872536,transparent 52%)}
.sidebar-art img{width:120px;height:95px;object-fit:contain;filter:drop-shadow(0 0 16px #ffb952)}
.session-code{position:relative;border-top:1px solid #92652c;padding:16px 8px 9px;display:flex;flex-direction:column;gap:6px}
.session-code>span{letter-spacing:.13em;color:var(--gold);font-size:12px}
.session-code strong{font-size:25px;letter-spacing:.12em;color:#f3bb67}
.session-code button{align-self:flex-start;background:none;color:#8bd7d0;border:0;padding:0;text-decoration:underline;font-size:12px}
.main-screen{min-width:0;padding:16px 17px 17px;position:relative;background:linear-gradient(155deg,rgba(6,22,30,.84),rgba(3,13,20,.97) 70%),repeating-linear-gradient(135deg,#1130390e 0 1px,transparent 1px 100px)}
.screen-stack{display:flex;flex-direction:column;gap:15px;max-width:100%}
.panel{position:relative;isolation:isolate;border:1.5px solid transparent;min-width:0;clip-path:polygon(var(--cut) 0,calc(100% - var(--cut)) 0,100% var(--cut),100% calc(100% - var(--cut)),calc(100% - var(--cut)) 100%,var(--cut) 100%,0 calc(100% - var(--cut)),0 var(--cut));background:linear-gradient(145deg,rgba(8,27,35,.98),rgba(5,19,25,.985) 88%) padding-box,linear-gradient(130deg,#efb663 0%,#855329 17%,#366367 65%,#73d9d1 92%,#be874b) border-box;box-shadow:inset 0 0 18px #0009,0 0 0 1px #0004}
.panel:before{content:"";pointer-events:none;position:absolute;inset:0;background:linear-gradient(105deg,transparent 0 46%,rgba(100,201,199,.037) 48% 51%,transparent 53% 80%,rgba(125,192,182,.035) 82% 84%,transparent 88%),linear-gradient(90deg,rgba(255,201,115,.065),transparent 17%,transparent 85%,rgba(66,204,196,.05));z-index:-1}
.panel:after{content:"";pointer-events:none;position:absolute;left:22%;right:22%;top:0;height:2px;background:linear-gradient(90deg,transparent,#d8a255,transparent);box-shadow:0 0 11px #e5ad6477;opacity:.7}
.panel-heading{padding:13px 18px 12px;margin:0 0 14px;display:flex;align-items:center;gap:10px;border-bottom:1px solid #5b5b47;background:linear-gradient(110deg,rgba(194,129,56,.14),rgba(8,44,50,.16) 48%,rgba(76,169,169,.055));}
.panel-heading h3{margin:0;font-size:19px;font-weight:760;color:#f8f1e6}
.panel-heading-icon{display:grid;place-items:center;color:#e7b56a;filter:drop-shadow(0 0 5px #eebc7244)}
.panel-heading-icon svg{width:24px;height:24px}
.eyebrow{display:block;letter-spacing:.15em;color:#70d5d0;font-size:10px;font-weight:700}
.phase-banner{height:103px;display:grid;grid-template-columns:245px 1fr 305px;align-items:center;gap:25px;padding:16px 25px;background:linear-gradient(100deg,#0b1c24ed,#0b2429ee 65%,#091c25f4) padding-box,linear-gradient(90deg,#edb568,#3d8181,#d4a561) border-box}
.year-label{border-right:1px solid #456a70;padding-right:25px}
.year-title{display:block;font-size:29px;font-weight:750;color:#f7ebd4;letter-spacing:-.02em;white-space:nowrap}
.year-title em{font-style:normal;color:#eabb73}
.year-dots{display:flex;gap:14px;margin-top:10px;align-items:center}
.year-dot{display:block;width:17px;height:17px;border:1.5px solid #b18751;border-radius:50%;box-shadow:0 0 0 2px rgba(245,161,66,.05);position:relative}
.year-dot:not(:last-child):after{content:"";position:absolute;left:17px;top:7px;width:14px;height:1px;background:#987145}
.year-dot.current,.year-dot.past{background:#edb45b;box-shadow:0 0 12px #ffbd66}
.phase-description{display:flex;align-items:center;gap:17px}
.phase-symbol{display:grid;place-items:center;width:47px;height:47px;color:#bcdbdf}
.phase-symbol svg{width:43px;height:43px}
.phase-description small{font-size:11px;color:#9bbabf;letter-spacing:.06em;display:block}
.phase-description strong{font-size:25px;color:#fff1de}
.phase-identifier{border-left:1px solid #446369;padding-left:19px}
.phase-identifier span{display:block;font-size:12px;color:var(--gold);font-weight:760;letter-spacing:.08em}
.phase-identifier small{display:block;color:#9fb8bd;font-size:11px;margin-top:7px;line-height:1.4}
.metrics-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px}
.metric-card{min-height:124px;display:flex;gap:17px;align-items:center;padding:17px 21px}
.metric-icon{height:59px;width:58px;flex:none;border-radius:50%;display:grid;place-items:center;background:radial-gradient(circle,#12645e66,#071b22 80%);color:#72e3d5}
.metric-icon svg{height:40px;width:40px;filter:drop-shadow(0 0 7px #32c6b866)}
.metric-gold .metric-icon{color:#edbe72;background:radial-gradient(circle,#6b4c2855,#101b23 80%)}
.metric-content{flex:1;min-width:0}
.metric-label{font-size:14px;color:#d8e6e5;line-height:1.2}
.metric-value{font-size:32px;font-weight:760;letter-spacing:-.03em;color:#f9f4ee;margin:5px 0 9px;line-height:1.1}
.metric-value small{color:#b8ccd0;font-size:22px;font-weight:500}
.progress-rail{width:100%;height:11px;overflow:hidden;background:#152b34;position:relative;border:1px solid #22444c;box-shadow:inset 0 0 6px #000a}
.progress-fill{height:100%;display:block;background:linear-gradient(180deg,#a4f5e6,#39b7ac);box-shadow:0 0 14px #73ead6;position:relative;z-index:2;transition:width .22s}
.progress-fill.gold{background:linear-gradient(180deg,#ffe1a4,#bb8a3d)}
.progress-decoration{position:absolute;inset:0;z-index:3;pointer-events:none;background:repeating-linear-gradient(90deg,transparent 0 calc(10% - 3px),#091d23 calc(10% - 2px) 10%)}
.metric-ornament{height:11px;width:100%;background:repeating-linear-gradient(90deg,#24454c 0 calc(10% - 3px),#091d23 calc(10% - 2px) 10%)}
.host-main-columns{display:grid;grid-template-columns:minmax(0,1.34fr) minmax(365px,.98fr);gap:15px;min-height:420px}
.host-task-panel,.host-district-panel{min-height:420px;overflow:hidden}
.host-task-panel{background:linear-gradient(134deg,#09252cfa,#061820fa 70%) padding-box,linear-gradient(120deg,#f2bd69,#915f2f 60%,#69d5d0) border-box}
.council-task{display:grid;grid-template-columns:165px 1fr;gap:20px;padding:8px 22px 13px;align-items:center}
.council-art{width:165px;height:138px;object-fit:cover;border:1px solid #eab16a;box-shadow:inset 0 0 8px #000a,0 0 11px #aa763555;clip-path:polygon(12px 0,calc(100% - 12px) 0,100% 12px,100% calc(100% - 12px),calc(100% - 12px) 100%,12px 100%,0 calc(100% - 12px),0 12px)}
.council-task-copy h4{margin:7px 0 4px;font-size:19px;color:#f2deb7}
.council-task-copy p{margin:3px 0;color:#e2eceb;font-size:16px;max-width:780px;line-height:1.52}
.host-task-status{padding:0 22px 12px;display:flex;align-items:center;gap:16px}
.status-pill{display:inline-flex;align-items:center;gap:8px;min-height:32px;padding:5px 13px;border:1px solid #39b7b0;color:#97e7dd;font-size:13px;background:linear-gradient(90deg,#0f4042b5,#0b292e8c);border-radius:26px;white-space:nowrap}
.pill-dot{width:7px;height:7px;background:#49e6b8;box-shadow:0 0 7px #58dbc0;border-radius:50%}
.ready-count{color:#b2cdd0;font-size:13px}
.button-next{width:calc(100% - 44px);min-height:52px;margin:0 22px 14px;font-size:19px}
.button-next .ui-icon{width:20px;height:20px}
.host-advanced{display:grid;gap:8px;margin:0 22px 9px}
.host-advanced details{border:1px solid #29606a;background:#0b242b99;color:#c1d8d8;min-height:35px}
.host-advanced summary{padding:8px 12px;cursor:pointer;font-size:13px}
.host-advanced details>p{font-size:12px;color:#9db8be;padding:0 13px;margin:3px 0 7px}
.host-advanced button{margin:2px 9px 10px;font-size:12px}
.tech-buttons{display:flex;flex-wrap:wrap;gap:4px}
.host-district-panel .panel-heading{margin-bottom:9px}
.district-list{padding:0 12px 14px;display:grid;gap:9px}
.district-item{min-height:77px;display:flex;align-items:center;gap:14px;border:1px solid #315d67;background:linear-gradient(110deg,rgba(19,45,52,.92),rgba(7,29,37,.9));padding:7px 11px}
.district-badge{position:relative;width:50px;height:60px;flex:none;display:grid;place-items:center;clip-path:polygon(5% 0,95% 0,95% 69%,50% 100%,5% 69%);border:1px solid #e0ac70;background:linear-gradient(#7b3030,#2f1119);box-shadow:inset 0 0 14px #0e090a}
.district-badge:after{content:"";position:absolute;inset:3px;clip-path:inherit;border:1px solid #eab87571;pointer-events:none}
.badge-blue{background:linear-gradient(#0e6d94,#123049)}
.badge-green{background:linear-gradient(#1c825e,#12392d)}
.badge-amber{background:linear-gradient(#bc8b39,#4e3118)}
.badge-violet{background:linear-gradient(#65559c,#24203e)}
.district-seal{width:41px;height:34px;object-fit:contain;filter:drop-shadow(0 0 6px #eabd77)}
.district-item-text{min-width:0;flex:1;display:grid;gap:3px}
.district-item-text strong{font-size:17px;color:#f3cb89}
.district-item-text span{color:#b5c8cd;font-size:12px}
.district-button{white-space:nowrap;display:flex;gap:6px;align-items:center;font-size:12px;min-height:34px}
.district-button svg{width:17px;height:17px}
.events-panel{min-height:93px}
.events-panel .panel-heading{margin-bottom:5px;padding:8px 15px}
.events-list{padding:0 17px 10px}
.event-row{padding:6px 2px;color:#d0dfe1;display:flex;gap:17px;font-size:13px;border-bottom:1px solid #26444b}
.event-time{color:#e2ba7e;min-width:68px}
.empty-note{padding:0 16px 10px;color:#93aeb3}
.phase-timeline{min-height:61px;border:1px solid #6b5a3a;background:linear-gradient(90deg,#081c23,#0b252b);display:flex;align-items:center;padding:8px 11px;gap:8px;clip-path:polygon(10px 0,calc(100% - 10px) 0,100% 10px,100% calc(100% - 10px),calc(100% - 10px) 100%,10px 100%,0 calc(100% - 10px),0 10px)}
.timeline-caption{display:flex;align-items:center;gap:7px;color:#dec193;padding:0 15px 0 8px;font-size:12px;white-space:nowrap}
.timeline-caption svg{width:18px;height:18px;color:#d0a35e}
.timeline-step{min-height:40px;display:flex;align-items:center;justify-content:center;gap:8px;flex:1;border:1px solid #2b6669;color:#bfd2d2;font-size:13px;background:#102930}
.timeline-step.active{background:linear-gradient(135deg,#b17c38,#69451e);border-color:#efc076;box-shadow:0 0 13px #b7853d6b;color:#fff0d6}
.timeline-step.passed{border-color:#6f9d91;color:#8bdbc9}
.timeline-step svg{width:17px;height:17px}
.phase-timeline{min-height:0; padding-block:5px}
.timeline-step{display:grid; grid-template-columns:auto minmax(0,auto); justify-content:center; align-content:center; align-self:stretch; min-width:0; min-height:40px; gap:2px 6px; padding:3px 6px; text-align:center; line-height:1.2}
.phase-clock{grid-column:1/-1;justify-self:center;color:#ffe7ad;background:#382a1d;border-radius:4px;padding:2px 6px;font-weight:700;font-size:12px;font-variant-numeric:tabular-nums;white-space:nowrap}
.opening-room-copy{padding:4px 17px 14px}
.opening-room-copy h2{margin:0 0 6px;color:#ffe4ae;font-size:19px}
.opening-room-copy p{margin:4px 0;color:#cde4e2}
#player-review-progress{margin-bottom:10px}
.playing-challenge .phase-timeline{min-height:0; padding-block:3px; gap:5px}
.playing-challenge .timeline-step{min-height:26px}
.screen-footnote{font-size:11px;color:#7595a1;margin:0 3px;letter-spacing:.02em}
.subsection-heading{padding:17px 20px;display:flex;align-items:center;gap:20px;flex-wrap:wrap}
.subsection-heading h2{margin:5px 0;font-size:22px}
.subsection-heading .status-pill{margin-left:auto}
.district-overview{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}
.district-overview-card{padding:20px;display:flex;align-items:center;gap:15px;flex-wrap:wrap}
.district-overview-card h3{font-size:22px;margin:0;color:var(--gold)}
.district-overview-card p{flex:1;color:var(--sub)}
.district-overview-card .button-outline{display:flex;gap:7px;align-items:center}
.standalone-panel{min-height:400px;padding-bottom:22px}
.standalone-panel>p{margin:20px 25px}
.standalone-panel>.metrics-row{margin:20px}
.single-metric{display:grid;grid-template-columns:minmax(0,360px);margin:20px}
.room-preview{padding-bottom:25px}
.room-preview .video-stage{margin:0 18px}
.room-preview .room-topline{margin:0 18px 12px}
.info-note{display:flex;align-items:center;gap:12px;border:1px solid #2c7778;background:#153239a0;margin:15px 20px;padding:16px;color:#c6e6e3}
.info-note svg{width:19px;height:19px}

/* Player is deliberately not the host template. No list of other districts. */
.player-identity{min-height:90px;display:flex;align-items:center;justify-content:space-between;padding:13px 21px;gap:20px;background:linear-gradient(120deg,#071d24f9,#10262ce9 55%,#081c25f8) padding-box,linear-gradient(90deg,#ad8651,#5bc9c0,#ad8651) border-box}
.player-nameplate{display:flex;gap:13px;align-items:center}
.player-avatar{width:47px;height:47px;display:grid;place-items:center;border:1px solid #57999e;border-radius:50%;background:#0b2930;color:#b9dbdc}
.player-avatar svg{width:30px;height:30px}
.player-nameplate>div:not(.player-avatar):not(.district-badge){display:grid;gap:2px}
.player-nameplate strong{font-size:23px;font-weight:760;color:#f4e4c6;line-height:1.15}
.identity-divider{height:40px;width:1px;background:#7a7059;margin:0 10px}
.player-identity .district-badge{width:40px;height:49px}
.player-identity .district-seal{width:35px}
.player-stage-text{display:grid;text-align:right;gap:4px;border-left:1px solid #496b70;padding-left:28px}
.player-stage-text b{font-size:23px;color:#fff0d2}
.player-stage-text span{font-size:14px;color:#a9dad9}
.player-metrics .metric-card{min-height:109px}
.player-metrics .metric-value{font-size:30px}
.player-columns,.allocation-columns{display:grid;grid-template-columns:minmax(0,1.72fr) minmax(295px,.75fr);gap:15px;align-items:stretch}
.video-room-panel{padding-bottom:12px;min-height:440px}
.video-room-panel>.panel-heading{margin-bottom:8px}
.room-notice{padding:9px 15px;margin:0 15px 10px;background:linear-gradient(90deg,#0e4447,#0e2b35);border:1px solid #347e81;color:#caedeb;font-size:13px;display:flex;align-items:center;gap:10px}
.room-notice .ui-icon{width:16px;height:16px}
.room-topline{display:flex;align-items:center;justify-content:space-between;padding:5px 4px 12px;gap:12px}
.room-title h3{margin:3px 0 0;font-size:19px;color:#eee3d2}
.video-room-panel .room-topline{padding:5px 17px 11px}
.video-stage{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));grid-auto-rows:minmax(146px,1fr);gap:9px}
.video-room-panel .video-stage{margin:0 16px}
.video-tile{grid-column:span 2;position:relative;overflow:hidden;min-height:158px;border:1px solid #59818a;background:#0b242e url('/video-city.jpg') center center/cover no-repeat;box-shadow:inset 0 0 20px #000a,0 0 0 1px #04171c;clip-path:polygon(9px 0,calc(100% - 9px) 0,100% 9px,100% calc(100% - 9px),calc(100% - 9px) 100%,9px 100%,0 calc(100% - 9px),0 9px)}
.video-stage[data-capacity="5"] .video-tile:nth-child(4){grid-column:2/span 2}
.video-stage[data-capacity="5"] .video-tile:nth-child(5){grid-column:4/span 2}
.video-tile.me{border-color:#cda65d;box-shadow:inset 0 0 25px #000a,0 0 8px #d2aa505c}
.video-tile.is-empty{filter:saturate(.5) brightness(.82)}
.video-tile-shade{position:absolute;inset:0;background:linear-gradient(to bottom,rgba(7,24,29,.25),rgba(5,16,24,.08) 40%,rgba(5,15,21,.96)),radial-gradient(ellipse at 50% 40%,rgba(18,84,88,.2),rgba(7,21,26,.2) 65%)}
.video-silhouette{position:absolute;inset:25px 20% 40px;display:flex;align-items:center;justify-content:center;opacity:.6;color:#aed9d6;filter:drop-shadow(0 0 22px #5ac0be)}
.video-silhouette svg{width:84px;height:84px;stroke-width:.75}
.video-caption{position:absolute;bottom:0;left:0;right:0;padding:23px 12px 9px;background:linear-gradient(0deg,#06151beb,transparent)}
.video-caption strong{display:block;font-size:16px;color:#fff2da}
.video-caption small{color:#abc9cb;font-size:11px;display:flex;align-items:center;gap:5px;margin-top:2px}
.presence{width:6px;height:6px;border-radius:50%;background:#bd8155}
.presence.on{background:#49e0b5;box-shadow:0 0 7px #42d3b8}
.right-panels{display:grid;grid-template-rows:min-content minmax(0,1fr);gap:15px;min-width:0}
.council-panel{min-height:211px}
.council-copy{display:flex;align-items:center;gap:7px;padding:0 17px 17px;color:#e1ecea;font-size:15px;line-height:1.55}
.council-watermark{width:110px;height:95px;object-fit:contain;opacity:.46;filter:drop-shadow(0 0 7px #b9884888)}
.activity-panel{min-height:204px}
.activity-rows{display:grid;gap:1px;padding:0 14px 9px}
.activity-row{display:flex;gap:12px;align-items:center;padding:8px 7px;color:#c6d6d6;border-bottom:1px solid #23404a;font-size:13px}
.activity-row.current{background:linear-gradient(90deg,#1c3f48,#0b222b);color:#f4ddae}
.activity-marker{height:16px;width:16px;border:2px solid #6a8a91;border-radius:50%;flex:none}
.activity-row.current .activity-marker{border-color:#e8b867;background:#e8b867;box-shadow:0 0 8px #d6a75c}
.tiny-note{font-size:11px;line-height:1.4;color:#769ca5;margin:4px 21px 12px}
/* Allocation: full-focus personal panel, no video elements mounted in the DOM. */
.allocation-screen .player-identity{min-height:82px}
.allocation-columns{grid-template-columns:minmax(0,1.68fr) minmax(295px,.75fr)}
.allocation-panel{padding:20px 22px 22px;min-height:410px}
.allocation-title{display:flex;align-items:center;gap:15px;padding-bottom:13px}
.allocation-title>svg{width:51px;height:51px;color:#f6c57f;border:1px solid #c49c5e;border-radius:50%;padding:11px;filter:drop-shadow(0 0 9px #cd944e)}
.allocation-title h2{font-size:25px;margin:0 0 5px;color:#fff1dc}
.allocation-title p{margin:0;color:#bed1d3;font-size:14px}
.allocation-inner{display:grid;grid-template-columns:minmax(0,1fr) 190px;gap:16px;align-items:stretch}
.allocation-choices{display:grid;gap:9px}
.allocation-line{min-height:90px;display:flex;justify-content:space-between;align-items:center;gap:10px;border:1px solid #406e77;background:linear-gradient(135deg,#17323d,#0b2029);padding:15px 16px;clip-path:polygon(10px 0,100% 0,100% calc(100% - 10px),calc(100% - 10px) 100%,0 100%,0 10px)}
.allocation-label{display:flex;align-items:center;gap:13px}
.allocation-label>svg{height:36px;width:36px;color:#69dacf}
.allocation-line:nth-child(2) .allocation-label>svg{color:#efbd70}
.allocation-label strong{display:block;font-size:16px;color:#f2f2e6}
.allocation-label small{display:block;font-size:12px;color:#b3c6ca;margin-top:4px}
.allocation-counter{display:flex;align-items:center;gap:7px}
.allocation-counter button{width:38px;height:39px;border:1px solid #4f8490;background:linear-gradient(#223943,#101f28);color:#c5d7d9;font-size:24px}
.allocation-counter button:hover{color:var(--gold);border-color:#e2ad67}
.allocation-counter b{font-size:28px;min-width:34px;text-align:center;color:#fff}
.token-vault{border:1px solid #426c71;background:radial-gradient(ellipse at center,#143c45,#0a222b);display:flex;align-items:center;justify-content:center;flex-direction:column;padding:14px;gap:7px;clip-path:polygon(10px 0,100% 0,100% calc(100% - 10px),calc(100% - 10px) 100%,0 100%,0 10px)}
.vault-bolts{display:flex;gap:7px}
.vault-bolts span{height:55px;width:50px;display:grid;place-items:center;color:#ffd48b;background:#614018;border:2px solid #edb76c;clip-path:polygon(50% 0,88% 15%,100% 50%,88% 86%,50% 100%,12% 86%,0 50%,12% 15%);box-shadow:inset 0 0 13px #ebba7255}
.vault-bolts svg{width:30px;height:30px;fill:#f7c87744}
.token-vault small{color:#b5cccf;font-size:10px;letter-spacing:.10em}
.token-vault strong{font-size:43px;font-weight:760;color:#ffe0a6;line-height:1}
.token-vault p{font-size:12px;margin:0;color:#bed3d6}
.allocation-footer{display:flex;gap:18px;align-items:center;margin-top:20px}
.confirm-allocation{padding:13px 23px;min-height:55px;font-size:17px;white-space:nowrap;min-width:58%}
.confirm-allocation svg{width:21px;height:21px}
.allocation-footer p{display:flex;gap:7px;align-items:center;font-size:12px;color:#becbd0}
.allocation-footer p svg{width:20px;height:20px;flex:none}
.common-room{padding-bottom:20px}
.common-scene{position:relative;isolation:isolate;min-height:315px;padding:22px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;background:linear-gradient(#061922bb,#061922de),url('/host-panorama.jpg') center 52%/cover;text-align:center;margin:10px 20px;color:#c7e0df}
.common-scene .common-seal{width:180px;height:98px;object-fit:contain;filter:drop-shadow(0 0 8px #efa9448c)}
.common-scene p{max-width:570px;margin:0}
.recovery{min-height:360px;padding:50px;text-align:center}
.recovery svg{height:50px;width:50px;color:var(--gold)}
.toast{position:fixed;right:22px;bottom:20px;z-index:10;border:1px solid #67bfba;color:#d6efec;background:#0b3638;padding:14px 20px;box-shadow:0 0 20px #000a;font-size:14px;max-width:430px}
.toast.error{color:#ffd0bb;border-color:#c97a56;background:#3a261f}
/* Fallback layouts, including smaller screens and higher native browser zoom. */
@media (max-width:1250px){
  :root{--sidebar-width:195px;--header-height:100px}
  .header-brand{min-width:270px}.header-brand-title strong{font-size:22px}
  .phase-banner{grid-template-columns:170px 1fr 230px;gap:13px}
  .year-title{font-size:24px}.phase-description strong{font-size:20px}
  .host-main-columns{grid-template-columns:minmax(0,1.15fr) minmax(335px,.9fr)}
  .council-task{grid-template-columns:105px 1fr;gap:12px}.council-art{height:112px;width:105px}
  .district-button{font-size:11px}.district-badge{width:43px;height:51px}
  .player-columns,.allocation-columns{grid-template-columns:minmax(0,1.6fr) minmax(270px,.72fr)}
}
@media (max-width:900px){
  .game-shell{grid-template-columns:1fr}.sidebar{border-right:0;border-bottom:1px solid #98683a;padding:8px 10px}
  .sidebar-heading,.sidebar-art,.side-bottom,.session-code{display:none}
  .navigation{display:flex;gap:6px;overflow-x:auto}
  .nav-link{flex:none;min-height:42px;padding:8px 10px}.nav-link span{font-size:12px}
  .main-screen{padding:10px}.host-main-columns,.player-columns,.allocation-columns{grid-template-columns:1fr}
  .right-panels{grid-template-columns:1fr 1fr;grid-template-rows:auto}
  .phase-banner{grid-template-columns:150px 1fr;height:auto}.phase-identifier{display:none}
  .metrics-row{gap:8px}.metric-card{min-height:105px;padding:10px;gap:7px}.metric-icon{width:36px}.metric-icon svg{width:28px;height:28px}.metric-value{font-size:23px}
  .timeline-caption{display:none}.timeline-step{font-size:11px}
}
@media (max-width:600px){
  :root{--header-height:74px}
  .game-header{padding:0 10px}.header-brand{min-width:0}.header-seal{width:44px;height:44px}.header-brand-title strong{font-size:15px}.header-brand-title span{display:none}
  .header-status{padding:5px}.header-logout{font-size:10px;padding:6px}.header-status #connection{font-size:9px}
  .login-panel{padding:21px 22px 25px}.login-brand{font-size:27px}.login-brand span{font-size:32px}.login-tagline{font-size:8px}.login-panel h1{font-size:22px}.login-intro{font-size:12px}
  .screen-stack{gap:9px}.metrics-row{grid-template-columns:1fr}.metric-card{min-height:85px}
  .phase-banner{display:block;padding:15px}.year-label{border:0}.year-dots{display:none}.phase-description{margin-top:10px}
  .district-item{gap:7px}.district-badge{width:35px;height:42px}.district-button{padding:5px}.district-button svg{display:none}
  .player-identity{display:block}.player-stage-text{margin-top:10px;border:0;text-align:left;padding:0}.player-nameplate{flex-wrap:wrap}
  .right-panels{grid-template-columns:1fr}
  .video-stage{grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:140px}
  .video-stage[data-capacity] .video-tile:nth-child(n){grid-column:span 1}.video-stage[data-capacity="5"] .video-tile:nth-child(5){grid-column:1 / -1}
  .video-tile{min-height:140px}.video-caption strong{font-size:12px}.room-topline{flex-wrap:wrap}
  .allocation-inner{grid-template-columns:1fr}.allocation-footer{flex-wrap:wrap}.confirm-allocation{min-width:100%}
  .phase-timeline{flex-wrap:wrap}.timeline-step{min-width:40%;flex:1}.district-overview{grid-template-columns:1fr}
}
@media (prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important;animation:none!important}}
/* Raw counts must never masquerade as filled progress bars. */
.metric-ornament{height:2px;margin-top:16px;background:linear-gradient(90deg,rgba(96,173,174,.7),rgba(96,173,174,.08) 65%,transparent);}

/* Host dashboard */
.host-mode .game-header {
  height: clamp(112px, 10vw, 172px);
  justify-content: flex-end;
  background: linear-gradient(180deg, #06141a00 58%, #06141aca),
    url('/city-environment.jpg') center 44% / cover no-repeat;
}
.host-mode .header-brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  min-width: 0;
  padding: 0;
  gap: 14px;
  background: none;
  clip-path: none;
}
.host-mode .header-seal { width: 106px; height: 88px; }
.host-mode .header-brand-title strong { font-size: clamp(24px, 2.2vw, 42px); }
.host-mode .header-status { align-self: flex-end; margin-bottom: 14px; }
.host-mode .game-shell { min-height: calc(100vh - clamp(112px, 10vw, 172px)); }
.host-mode .sidebar {
  background: linear-gradient(180deg, #06141b 28%, #091d25cf 75%, #15262a),
    url('/city-environment.jpg') left bottom / auto 380px no-repeat;
}
.host-mode .sidebar-art { background: none; opacity: .58; }

.host-dashboard {
  gap: 12px;
}
.main-screen {
  --panel-surface: linear-gradient(145deg, #112d36, #071b24 64%, #0b2730);
}
.main-screen .panel { background: var(--panel-surface); }
.host-dashboard .host-task-panel {
  background: radial-gradient(ellipse at 0 20%, #70432142, transparent 56%), var(--panel-surface);
}
.host-phase {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 22px;
}
.host-phase h2 { margin: 0; font-size: clamp(20px, 1.5vw, 30px); color: #fff0d9; }
.host-phase h2 span, .host-phase > .ui-icon { color: #dfae66; }
.host-phase > .ui-icon { flex: none; }
.host-mode .main-screen .metric-card { min-height: 108px; }
.host-mode .main-screen .metric-value small { font-size: clamp(13px, 1.1vw, 20px); }
.host-dashboard .host-main-columns {
  min-height: 0;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 12px;
}
.host-dashboard .host-task-panel,
.host-dashboard .host-district-panel { min-height: 0; }
.main-screen .panel-heading {
  border-color: #a173485c;
  background: linear-gradient(100deg, #a87b383d, #20515e19 76%);
  margin-bottom: 8px;
}
.host-dashboard .council-task { grid-template-columns: clamp(100px, 12vw, 190px) minmax(0, 1fr); }
.host-dashboard .council-art { width: 100%; height: auto; aspect-ratio: 5 / 4; }
.host-dashboard .host-task-status { padding: 9px 0 0; flex-wrap: wrap; gap: 8px; }
.host-dashboard .host-task-panel > .info-note { margin: 0 22px 12px; }
.host-dashboard .button-next:not(:disabled) {
  background: linear-gradient(180deg, #9e611f, #713c13 55%, #a66625);
  border-color: #ffca77;
  color: #fff5df;
  box-shadow: inset 0 0 13px #ffb35a87, 0 0 9px #ffab4750;
}
.host-dashboard .button-next:hover:not(:disabled) { background: linear-gradient(180deg, #b87930, #91501b); }
.host-dashboard .host-advanced { margin-bottom: 16px; }
.host-dashboard .district-list { gap: 7px; }
.host-dashboard .district-item {
  min-height: 63px;
  gap: 10px;
  background: linear-gradient(105deg, #1c3a43, #0a242e 72%);
}
.host-dashboard .district-badge { width: 42px; height: 49px; }
.main-screen .events-panel .panel-heading { margin-bottom: 4px; }

@media (max-width: 1100px) {
  .host-dashboard .host-main-columns { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .host-mode .header-brand { position: relative; left: auto; transform: none; }
  .host-mode .game-header { justify-content: space-between; }
}
@media (max-width: 600px) {
  .host-mode .game-header { height: 84px; }
  .host-mode .header-brand { gap: 4px; }
  .host-mode .header-seal { width: 44px; height: 44px; }
  .host-mode .header-brand-title strong { font-size: 15px; }
  .host-mode .header-status { align-self: center; margin-bottom: 0; }
  .host-mode .game-shell { min-height: calc(100vh - 84px); }
  .host-phase { min-height: 58px; padding: 9px 14px; }
  .host-dashboard .metric-card { min-height: 76px; }
  .host-dashboard .council-task { padding-inline: 12px; grid-template-columns: minmax(62px, 23%) minmax(0, 1fr); }
  .host-dashboard .host-task-panel > .info-note { margin-inline: 12px; }
  .host-dashboard .button-next { width: calc(100% - 24px); margin-inline: 12px; font-size: 16px; }
}

@media (max-width: 900px) {
  .host-mode .game-shell { grid-template-columns: minmax(0, 1fr); }
  .host-mode .session-code {
    display: flex;
    flex-flow: row wrap;
    align-items: center;
    gap: 8px;
    padding: 6px 9px 2px;
  }
  .host-mode .session-code strong { font-size: 15px; }
  .host-mode .session-code button { align-self: center; }
}

/* Host emblems and illuminated chamfered frames */
.host-header-seal, .header-brand-title .host-header-tagline { display: none; }
.host-mode .header-brand-title .header-tagline { display: none; }
@media (min-width: 601px) {
  .host-mode .header-brand-title .host-header-tagline { display: block; }
}
:is(.host-mode, .player-mode) .header-seal:not(.host-header-seal) { display: none; }
:is(.host-mode, .player-mode) .host-header-seal {
  display: block;
  width: clamp(94px, 10vw, 164px);
  height: auto;
  filter: drop-shadow(0 0 1.5px #ffda86) drop-shadow(0 0 8px #efa9448c);
}
.host-city-panorama { display: none; }
.host-mode .game-header { background: #0a202b; }
.host-mode .host-city-panorama {
  display: block;
  width: max(100%, 540px);
  aspect-ratio: 3 / 1;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(90deg, transparent 19%, #081722ac 50%, transparent 78%),
    url('/host-panorama.jpg') center / cover no-repeat;
  pointer-events: none;
}
.host-city-panorama img {
  position: absolute;
  left: 6.1%;
  top: 40%;
  width: 2.55%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 3px #ffc35c8a);
}
.host-mode .game-header::after {
  height: 2px;
  background: linear-gradient(90deg, #c18747 0%, #fff1c4 10%, #a66e42 18%,
    #509697 39%, #cafff6 55%, #4e8d91 67%, #fbd490 89%, #ac643b 100%);
  box-shadow: 0 -1px 8px #ffd580a0, 0 0 16px #5ae1dc58;
}
.host-mode .sidebar-art { display: none; }
.host-mode .sidebar { background: linear-gradient(155deg, #0a212b, #07171e 58%, #10262a); }
.host-mode .session-code {
  margin-top: auto;
  padding: 15px 13px 13px;
  border: 0;
  position: relative;
  isolation: isolate;
  background: linear-gradient(145deg, #132830, #09191f 65%, #142c32);
}
:is(.host-mode, .player-mode) .district-badge {
  border: 0;
  box-shadow: inset 0 0 0 1px #ffca7b9e, inset 0 0 11px #100a08a0;
}
:is(.host-mode, .player-mode) .district-badge::after {
  inset: 0;
  border: 0;
  background: linear-gradient(160deg, #fbcb85, #996e3f 38%, #eeb673);
  clip-path: polygon(evenodd, 5% 0, 95% 0, 95% 69%, 50% 100%, 5% 69%, 5% 0,
    calc(5% + 1px) 1px, calc(5% + 1px) calc(69% - 1px), 50% calc(100% - 1.5px),
    calc(95% - 1px) calc(69% - 1px), calc(95% - 1px) 1px, calc(5% + 1px) 1px);
}
:is(.host-mode, .player-mode) .district-seal {
  display: block;
  width: 72%;
  height: 72%;
  transform: translateY(-7%);
  filter: drop-shadow(0 0 4px #f1b85bab);
}

.main-screen :is(.panel, .video-tile, .common-scene),
:is(.host-mode, .player-mode) .session-code {
  --frame-cut: 13px;
  --frame-inset: 1.5px;
  --corner-inset: calc(var(--frame-cut) + .6px);
  border: 0;
  clip-path: polygon(var(--frame-cut) 0, calc(100% - var(--frame-cut)) 0,
    100% var(--frame-cut), 100% calc(100% - var(--frame-cut)),
    calc(100% - var(--frame-cut)) 100%, var(--frame-cut) 100%,
    0 calc(100% - var(--frame-cut)), 0 var(--frame-cut));
}
.main-screen :is(.panel, .video-tile, .common-scene)::before,
:is(.host-mode, .player-mode) .session-code::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse at 19% 0, #fff4b8 0%, #ffc273 4%, transparent 24%),
    radial-gradient(ellipse at 52% 100%, #fff1bb 0%, #ffb85c 5%, transparent 23%),
    radial-gradient(ellipse at 89% 9%, #d8fffa 0%, #83e2df 6%, transparent 24%),
    linear-gradient(135deg, #ffce80, #9f7450 28%, #448485 57%, #8bd9d2 80%, #c79555);
  clip-path: polygon(evenodd,
    var(--frame-cut) 0, calc(100% - var(--frame-cut)) 0,
    100% var(--frame-cut), 100% calc(100% - var(--frame-cut)),
    calc(100% - var(--frame-cut)) 100%, var(--frame-cut) 100%,
    0 calc(100% - var(--frame-cut)), 0 var(--frame-cut), var(--frame-cut) 0,
    var(--corner-inset) var(--frame-inset),
    var(--frame-inset) var(--corner-inset),
    var(--frame-inset) calc(100% - var(--corner-inset)),
    var(--corner-inset) calc(100% - var(--frame-inset)),
    calc(100% - var(--corner-inset)) calc(100% - var(--frame-inset)),
    calc(100% - var(--frame-inset)) calc(100% - var(--corner-inset)),
    calc(100% - var(--frame-inset)) var(--corner-inset),
    calc(100% - var(--corner-inset)) var(--frame-inset),
    var(--corner-inset) var(--frame-inset));
}
.main-screen :is(.panel, .common-scene)::after,
:is(.host-mode, .player-mode) .session-code::after {
  content: "";
  position: absolute;
  inset: 0;
  height: auto;
  pointer-events: none;
  z-index: -1;
  opacity: 1;
  box-shadow: none;
  background: radial-gradient(ellipse 27% 15px at 19% 0, #f8ad497a, transparent 100%),
    radial-gradient(ellipse 22% 16px at 52% 100%, #f5a24575, transparent 100%),
    radial-gradient(ellipse 24% 18px at 89% 0, #65e1df53, transparent 100%);
}
.main-screen .video-tile {
  --frame-cut: 9px;
  --frame-inset: 1px;
  --corner-inset: calc(var(--frame-cut) + .4px);
  isolation: isolate;
}
.main-screen .video-tile:not(.me)::before { opacity: .68; }
.main-screen .button-outline {
  border-color: #52918f;
  color: #d7f4ed;
}
.main-screen :is(button, summary):focus-visible {
  outline: 2px solid #ffe0a4;
  outline-offset: -3px;
}
.host-dashboard .district-item {
  border-color: #527579;
  box-shadow: inset 0 0 9px #10272dad;
}
.host-dashboard .button-next:not(:disabled) {
  box-shadow: inset 0 1px 6px #fff0b4, inset 0 -2px 12px #ffc067, 0 0 11px #ffab4766;
}
@media (max-width: 600px) {
  :is(.host-mode, .player-mode) .host-header-seal { width: 51px; }
  .host-mode .session-code { padding: 7px 12px; }
}

/* Player cabinet */
.player-mode #game {
  position: relative;
  isolation: isolate;
  background: #06171f;
}
.player-mode #game::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: clamp(290px, 32vw, 440px);
  background: linear-gradient(180deg, #07151b31 24%, #06171f 100%),
    url('/host-panorama.jpg') center 50% / cover no-repeat;
}
.player-mode .game-header {
  background: linear-gradient(90deg, #07171e8a, transparent 48%, #07171e40);
}
.player-mode .game-header::after {
  background: linear-gradient(90deg, #ffc781, #4a8588 31%, #c8ffef 53%, #46928e 78%, #bb854c);
}
.player-mode .header-brand {
  background: linear-gradient(90deg, #091922f5 58%, #09192238);
  gap: 7px;
}
.player-mode .host-header-seal { width: clamp(65px, 8vw, 124px); }
.player-mode .main-screen { background: none; }
.player-mode .sidebar-art {
  background: linear-gradient(180deg, #071922 0%, transparent 68%),
    url('/city-skyline.jpg') center 58% / cover;
  opacity: .74;
}
.player-mode .sidebar-art img { display: none; }
.player-mode .session-code {
  margin-top: 5px;
  border-top: 0;
  padding: 12px;
  background: #0b232d;
}
.player-mode .player-identity {
  background: linear-gradient(90deg, #061a23f2 13%, #061c2488 53%, #061a23f2);
}
.player-mode .player-nameplate { min-width: 0; }
.player-mode .player-nameplate strong { overflow-wrap: anywhere; }
.player-mode .player-avatar { flex: none; }
.player-mode .player-stage-text { flex: none; }
.player-mode .metric-card,
.player-mode .video-room-panel,
.player-mode .right-panels > .panel {
  background: linear-gradient(145deg, #102c35f7, #061c25f7 78%);
}
.player-mode .metric-card { min-height: 96px; }
.player-mode .metric-value small { font-size: clamp(14px, 1.27vw, 22px); }
.player-mode .right-panels { grid-template-rows: min-content min-content; }
.player-mode .council-panel,
.player-mode .activity-panel { min-height: 0; }
.player-mode .activity-rows { padding-bottom: 14px; }
.player-mode .council-watermark { flex: 0 0 68px; width: 68px; height: 57px; }
.player-mode .room-notice .ui-icon { flex: none; }
.player-mode .allocation-panel {
  min-height: 0;
  background: radial-gradient(ellipse at 0 0, #59412163, transparent 45%),
    linear-gradient(145deg, #122d35, #061b24 68%);
}
.player-mode .allocation-title > svg { flex: none; }
.player-mode .allocation-inner { grid-template-columns: minmax(0, 1fr) minmax(116px, 23%); }
.player-mode .allocation-line, .player-mode .token-vault {
  clip-path: none;
  border: 1px solid #49757a;
  border-radius: 7px;
}
.player-mode .allocation-label > svg { flex: none; }
.player-mode .allocation-counter b { min-width: 1.25em; }
.player-mode .allocation-counter button:disabled { opacity: .42; }
.player-mode .confirm-allocation {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  background: linear-gradient(180deg, #a96924, #753d16 55%, #a3662c);
  border-color: #fed18a;
  color: #fff4df;
  box-shadow: inset 0 1px 6px #ffefb2, inset 0 -2px 12px #ffc067;
}
.player-mode .confirm-allocation:hover { background: linear-gradient(180deg, #bd8131, #8e5022); }

@media (max-width: 1200px) {
  .player-mode .allocation-columns { grid-template-columns: minmax(0, 1fr); }
  .player-mode .allocation-columns .right-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .player-mode .game-shell { grid-template-columns: minmax(0, 1fr); }
  .player-mode .session-code { display: flex; flex-flow: row wrap; align-items: center; gap: 8px; padding: 6px 10px; }
  .player-mode .session-code strong { font-size: 15px; }
  .player-mode .session-code button { align-self: center; }
}
@media (max-width: 600px) {
  .player-mode .host-header-seal { width: 48px; }
  .player-mode .header-brand { gap: 3px; padding: 0; clip-path: none; }
  .player-mode .player-identity { padding: 12px; }
  .player-mode .player-stage-text { margin-top: 8px; }
  .player-mode .allocation-panel { padding: 13px; }
  .player-mode .allocation-title h2 { font-size: 20px; }
  .player-mode .allocation-inner,
  .player-mode .allocation-columns .right-panels { grid-template-columns: minmax(0, 1fr); }
  .player-mode .allocation-line { padding: 9px; }
  .player-mode .allocation-counter { gap: 3px; }
  .player-mode .allocation-counter button { width: 34px; }
  .player-mode .confirm-allocation { flex-basis: 100%; }
}
.common-scene strong { color: #ffe0a8; font-size: 1.3em; }
.common-scene .common-voice-note { color: #a8c4c4; font-size: .88em; }
.common-room > .hall-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hall-results .metric-detail { margin: 0 0 8px; color: #f0cd93; font-size: 14px; }
.hall-results .metric-ornament { display: none; }
@media (max-width: 650px) {
  .common-room > .hall-results { grid-template-columns: minmax(0, 1fr); }
}

.opening-room h2 { margin: 0; color: #ffe4ad; font-size: clamp(23px,3vw,38px); line-height: 1.2; }
.host-opening-brief { color: #d4e7e6; padding: 0 12px 12px; font-size: 13px; }
.host-opening-brief > p { margin: 0 0 10px; }
.opening-stages {
  margin: 12px 0;
  padding-left: 22px;
  display: grid;
  gap: 8px;
}
.opening-stages li > strong, .opening-stages li > span { display: block; }
.opening-stages li > strong { color: #ffe0a8; margin-bottom: 3px; }
#rehearsal-badge { color: #ffe3a5; border: 1px solid #a88048; background: #523b25; padding: 4px 7px; font-size: 11px; }
.rehearsal-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: 10px 20px; color: #cbe0df; }
.team-management { padding: 0 14px 12px; }
.team-management p, .team-management h4 { margin: 5px 0 9px; }
.team-links { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.team-members { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,230px),1fr)); gap: 7px; }
.team-member { display: flex; justify-content: space-between; align-items: center; gap: 7px; padding: 7px; border: 1px solid #31545c; overflow-wrap: anywhere; }
.team-member select { max-width: 100%; background: #102931; color: #e5f4f5; border: 1px solid #59818a; padding: 5px; font: inherit; }

@media(min-width:901px) {
  .playing-challenge { --header-height:70px; }
  .playing-challenge .game-header .header-brand img { max-height:60px; }
  .playing-challenge .main-screen { padding-top:9px; }
  .playing-challenge .screen-stack { gap:8px; }
  .playing-challenge .player-identity { min-height:46px; padding:4px 12px; }
  .playing-challenge .player-identity .district-badge { width:28px; height:34px; }
  .playing-challenge .player-avatar { width:33px; height:33px; }
  .playing-challenge .player-stage-text b,.playing-challenge .player-nameplate strong { font-size:16px; }
  .playing-challenge .player-identity .eyebrow { font-size:9px; }
  .playing-challenge .media-panel { padding:5px 12px; margin-bottom:7px; display:flex; flex-wrap:wrap; align-items:center; gap:6px 14px; }
  .playing-challenge .media-panel[hidden] { display:none; }
  .playing-challenge .media-heading h2 { font-size:14px; }
  .playing-challenge .media-heading p { margin:2px 0; font-size:12px; }
  .playing-challenge .media-buttons button { min-height:28px; padding:3px 7px; }
}

/* The host can advance the phase while reviewing the hall or a district. */
#operation-bar { margin-bottom:10px; }
.host-mode #operation-bar { position:sticky; top:0; z-index:6; }
.operation-bar {
  min-height:48px; display:flex; align-items:center; justify-content:space-between;
  gap:7px 15px; padding:7px 11px;
  background:linear-gradient(110deg,#183539,#10232b 64%) !important;
}
.operation-heading { display:flex; flex-wrap:wrap; gap:4px 10px; align-items:baseline; }
.operation-heading strong { color:#ffe0aa; }
.operation-heading small { color:#b3d4d4; }
.operation-bar .button-next { width:auto; padding:5px 12px; margin:0; min-height:38px; }
.operation-bar .phase-clock { font-size:14px; font-variant-numeric:tabular-nums; }
#host-recovery-tools { margin-bottom:10px; }
.host-recovery { padding:8px 12px; }
.host-recovery summary,.allocation-context summary,.district-tactics summary { cursor:pointer; color:#aee8df; min-height:27px; padding-top:3px; }
.host-recovery ul { margin:5px 0; list-style:none; padding:0; }
.host-recovery li { display:flex; flex-wrap:wrap; align-items:center; gap:5px 8px; padding:5px 0; border-top:1px solid #386269; }
.host-recovery li>span { flex:1 1 170px; }
.host-recovery li small { display:block; color:#bbd7d7; overflow-wrap:anywhere; }
.host-recovery .button-outline { padding:5px 9px; min-height:34px; }
.host-recovery h3 { margin:9px 0 5px; font-size:14px; }
.trial-recovery-note { color:#ffe1a8; margin:0; }
.allocation-screen { width:min(100%,920px); margin-inline:auto; }
.allocation-options { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.allocation-options .allocation-option {
  min-height:78px; text-align:left; display:flex; gap:10px; align-items:center; padding:9px 12px;
  white-space:normal; border-radius:4px; line-height:1.25;
}
.allocation-option .ui-icon { flex:none; width:22px; height:22px; }
.allocation-option small { display:block; color:#b5d0d1; margin-top:4px; }
.allocation-options .allocation-option[aria-pressed="true"] {
  background:linear-gradient(110deg,#6d4d2b,#322b21); border-color:#f6c77f;
  color:#fff2d8; box-shadow:inset 0 0 0 1px #e5b366;
}
.allocation-options .allocation-option[aria-pressed="true"] small { color:#edd8b1; }
.allocation-screen .allocation-footer { margin-top:10px; gap:6px 12px; }
.allocation-screen .allocation-footer p { margin:0; }
.allocation-context { padding:8px 11px; }
.district-brief .district-tactics dl { margin-top:5px; }
@media(max-width:700px) {
  .host-mode .operation-bar { align-items:stretch; flex-direction:column; }
  .host-mode .operation-bar .button-next { min-height:36px; }
  .compact-player-phase .game-header { height:48px; }
  .compact-player-phase .game-header .header-brand img { max-height:40px; }
  .compact-player-phase .sidebar { padding:3px 6px; }
  .compact-player-phase .sidebar .navigation { gap:4px; }
  .compact-player-phase .nav-link { min-height:34px; padding:4px 6px; }
  .player-mode.compact-player-phase .sidebar .session-code { display:none; }
  .compact-player-phase .main-screen { padding-top:5px; }
  .compact-player-phase .player-operation { min-height:32px; padding:5px 9px; font-size:13px; }
  .compact-player-phase #operation-bar { margin-bottom:5px; }
  .compact-player-phase .discussion-room-layout { gap:7px; }
  .allocation-options { grid-template-columns:1fr; gap:5px; }
  .allocation-options .allocation-option { min-height:48px; padding:5px 9px; }
  .allocation-screen .allocation-title { padding-bottom:7px; gap:8px; }
  .allocation-screen .allocation-title >svg { width:32px; height:32px; padding:6px; }
}

.operation-bar .button-next { font-size:clamp(14px,1.25vw,18px); line-height:1.2; }
@media(max-width:900px) {
  .game-shell { grid-template-rows:auto minmax(0,1fr); }
}
@media(max-width:700px) {
  .game-header .header-status { gap:5px; }
  .game-header #rehearsal-badge { padding:3px 5px; }
  .host-mode .host-dashboard .phase-timeline { display:none; }
  .host-mode .host-dashboard .metrics-row { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .host-mode .host-dashboard .metric-card { min-height:72px; padding:7px; }
  .host-mode .host-dashboard .metric-card .metric-icon { display:none; }
  .host-mode .host-dashboard .metric-value { font-size:18px; overflow-wrap:anywhere; }
  .host-mode .host-dashboard .metric-value small { font-size:11px; white-space:normal; }
}
