/* ERA XI component pass: approved four-theme system and live-game workspaces. */
:root[data-theme=touchline]{color-scheme:dark;--theme-bg:#151b1f;--theme-panel:#1c2429;--theme-panel-raised:#252f35;--theme-line:#35434a;--theme-line-soft:#2c383e;--theme-text:#edf3f1;--theme-muted:#abbcbf;--theme-faint:#82969b;--theme-accent:#88d4be;--theme-accent-deep:#568d7d;--theme-accent-ink:#142720;--theme-red:#e9a296;--theme-glow:#4d8f7a25;--theme-pitch-a:#19372f;--theme-pitch-b:#21453a;--theme-pitch-line:#78a393}
:root[data-theme=journal]{color-scheme:light;--theme-bg:#f0efe8;--theme-panel:#faf9f4;--theme-panel-raised:#e9e9df;--theme-line:#ccd1c6;--theme-line-soft:#e0e2d8;--theme-text:#1d332b;--theme-muted:#52665b;--theme-faint:#718078;--theme-accent:#23634f;--theme-accent-deep:#8fa896;--theme-accent-ink:#fffdf4;--theme-red:#b1493f;--theme-glow:#91ab9526;--theme-pitch-a:#d6e1cf;--theme-pitch-b:#c7d7c5;--theme-pitch-line:#78957d}
:root[data-theme=matchday]{color-scheme:dark;--theme-bg:#0b1425;--theme-panel:#111f34;--theme-panel-raised:#1a2d45;--theme-line:#32465f;--theme-line-soft:#24374e;--theme-text:#f1f6ff;--theme-muted:#b5c5dd;--theme-faint:#90a5c2;--theme-accent:#a2caff;--theme-accent-deep:#5c84b5;--theme-accent-ink:#10223d;--theme-red:#f1a49d;--theme-glow:#4d83c52c;--theme-pitch-a:#153237;--theme-pitch-b:#1d4144;--theme-pitch-line:#719a9b}
:root[data-theme=gold]{color-scheme:dark;--theme-bg:#07111b;--theme-panel:#0e1923;--theme-panel-raised:#172630;--theme-line:#354753;--theme-line-soft:#293b46;--theme-text:#eeece5;--theme-muted:#a0b1b8;--theme-faint:#7f95a0;--theme-accent:#cfba7a;--theme-accent-deep:#8d7849;--theme-accent-ink:#151b20;--theme-red:#eda393;--theme-glow:#b49b5d20;--theme-pitch-a:#21462e;--theme-pitch-b:#295035;--theme-pitch-line:#a8b58c}
:root{--bg:var(--theme-bg);--panel:var(--theme-panel);--panel2:var(--theme-panel-raised);--text:var(--theme-text);--muted:var(--theme-muted);--line:var(--theme-line);--mint:var(--theme-accent);--gold:var(--theme-accent);--red:var(--theme-red)}
body{background:var(--theme-bg);color:var(--theme-text)}
.game-shell{--ink:var(--theme-text);--muted:var(--theme-muted);--gold:var(--theme-accent);--edge:var(--theme-line);font-size:14px;color:var(--theme-text);background:var(--theme-bg)}
.game-shell>.content{background:radial-gradient(ellipse at 60% -25%,var(--theme-glow),transparent 70%),var(--theme-bg)}
.game-shell .sidebar{background:linear-gradient(180deg,var(--theme-panel),var(--theme-bg));border-color:var(--theme-line)}
.game-shell .topbar,.game-shell .game-status{background:var(--theme-panel);border-color:var(--theme-line);color:var(--theme-text)}
.game-shell .club-id,.game-shell .page-title,.game-shell .section-heading{border-color:var(--theme-line-soft)}
.game-shell .nav-link{font-size:13px;color:var(--theme-muted)}
.game-shell .nav-link:hover{background:var(--theme-panel-raised);color:var(--theme-text)}
.game-shell .nav-link[aria-current]{background:var(--theme-glow);border-left-color:var(--theme-accent);color:var(--theme-accent)}
.game-shell .nav-link[aria-current] .nav-icon,.game-shell .money,.game-shell .text-btn{color:var(--theme-accent)}
.game-shell .hud-location>span,.game-shell .hud-location>b,.game-shell .meta b{color:var(--theme-text)}
.game-shell .page-title h1{font-size:28px;color:var(--theme-text)}
.game-shell .page-title p{font-size:13px;color:var(--theme-muted)}
.game-shell :is(.btn,input,select){font-size:13px;background:var(--theme-panel-raised);border-color:var(--theme-line);color:var(--theme-text)}
.game-shell .btn:hover:not(:disabled){background:var(--theme-glow);border-color:var(--theme-accent);color:var(--theme-text)}
.game-shell .btn.primary{background:var(--theme-accent);border-color:var(--theme-accent);color:var(--theme-accent-ink);box-shadow:none}
.game-shell .segmented button{background:var(--theme-panel-raised);border-color:var(--theme-line);color:var(--theme-muted)}
.game-shell :is(.segmented button.active,.market-tabs>button.active){background:var(--theme-accent)!important;border-color:var(--theme-accent)!important;color:var(--theme-accent-ink)!important}
.game-shell :is(.panel,.squad-list,.squad-detail,.market-board,.market-guide,.scout-directory,.scout-report,.league-board,.league-side,.finance-ledger,.academy-candidates,.academy-developed,.club-access-board,.facility-board,.match-stage,.match-fixture-rail,.tactic-main,.tactic-roster-panel,.tactic-settings){background:var(--theme-panel);border-color:var(--theme-line);color:var(--theme-text);box-shadow:none}
.game-shell table{font-size:13px;color:var(--theme-text)}
.game-shell table th{font-size:13px;background:var(--theme-panel-raised);border-color:var(--theme-line);color:var(--theme-muted)}
.game-shell table td{font-size:13px;border-color:var(--theme-line-soft)}
.game-shell tbody tr:nth-child(even){background:color-mix(in srgb,var(--theme-panel-raised) 28%,transparent)}
.game-shell tbody tr:hover{background:var(--theme-glow)}
.game-shell .hud-tool{border-color:var(--theme-line);color:var(--theme-muted)}
.game-shell .theme-tool{display:inline-flex;width:auto;min-width:82px;align-items:center;justify-content:center;gap:7px;padding-inline:9px;background:var(--theme-panel-raised)}
.game-shell .theme-tool>span{font-size:13px;white-space:nowrap}
.game-shell :is(button,a,input,select):focus-visible{outline-color:var(--theme-accent)}

/* The journal theme keeps the same information architecture in a light club-book treatment. */
:root[data-theme=journal] .game-shell :is(.roster-summary,.filters,.list-footer,.lineup-editor-summary,.tactic-column-head,.broadcast-score,.replay-match-desk){background:var(--theme-panel-raised);color:var(--theme-text);border-color:var(--theme-line)}
:root[data-theme=journal] .game-shell :is(.squad-profile,.news-feature,.manager-brief>a,.fixture-choice,.home-fixture,.command-standing,.command-fixture){color:var(--theme-text);border-color:var(--theme-line-soft)}
:root[data-theme=journal] .game-shell :is(.page-title h1,.section-heading h2,.tactic-column-head h2,.lineup-editor-heading h3,.lineup-editor-row strong){color:var(--theme-text)}
:root[data-theme=journal] .game-shell .era-tactic-pitch{box-shadow:inset 0 0 70px #54705f18}
:root[data-theme=journal] .game-shell .pitch-name,:root[data-theme=journal] .game-shell .role-select{background:#f7f6efeb;color:#1d332b;border-color:#78957d}
:root[data-theme=journal] .game-shell .pitch-profile{background:linear-gradient(0deg,#f7f6efcc,transparent 72%)}
:root[data-theme=journal] dialog::backdrop{background:#1d332b66}

/* Theme chooser from the approved component study. */
dialog.theme-dialog{width:min(940px,calc(100vw - 36px));max-height:min(780px,calc(100dvh - 36px));padding:0;border:1px solid var(--theme-line);border-radius:4px;background:var(--theme-panel);color:var(--theme-text);box-shadow:0 22px 90px #0008}
.theme-dialog-card{display:flex;flex-direction:column;min-height:0}
.theme-dialog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;padding:24px 26px 20px;border-bottom:1px solid var(--theme-line)}
.theme-dialog-head small{display:block;margin-bottom:7px;font-size:13px;letter-spacing:1.2px;color:var(--theme-accent)}
.theme-dialog-head h2{font-size:27px;letter-spacing:-.8px}.theme-dialog-head p{margin-top:8px;font-size:13px;color:var(--theme-muted)}
.theme-dialog-close{width:38px;height:38px;padding:0;border:1px solid var(--theme-line);border-radius:2px;background:var(--theme-panel-raised);color:var(--theme-text);font-size:23px}
.theme-choice-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0;padding:24px 26px 28px;border:0}
.theme-choice-grid>legend{padding:0 0 14px;font-size:13px;font-weight:700;color:var(--theme-text)}
.theme-choice{display:grid;grid-template-rows:118px auto auto auto;gap:6px;min-width:0;padding:11px;border:1px solid var(--theme-line);background:var(--theme-bg);cursor:pointer}
.theme-choice:hover,.theme-choice.is-active{border-color:var(--theme-accent);box-shadow:inset 0 0 0 1px var(--theme-accent)}
.theme-choice>input{position:absolute;opacity:0;pointer-events:none}.theme-choice>strong{display:flex;align-items:center;justify-content:space-between;font-size:14px}.theme-choice>strong i{display:none;color:var(--theme-accent);font-style:normal}.theme-choice.is-active>strong i{display:block}
.theme-choice>span:not(.theme-preview){font-size:13px;color:var(--theme-muted)}.theme-choice>small{font-size:13px;line-height:1.5;color:var(--theme-faint)}
.theme-preview{position:relative;overflow:hidden;background:var(--sample-bg);border:1px solid color-mix(in srgb,var(--sample-accent) 40%,transparent)}
.theme-preview:before{content:'';position:absolute;inset:0 auto 0 0;width:25%;background:var(--sample-surface)}
.theme-preview i,.theme-preview b,.theme-preview em{position:absolute;display:block;background:var(--sample-surface);border:1px solid color-mix(in srgb,var(--sample-accent) 35%,transparent)}
.theme-preview i{left:31%;right:6%;top:12%;height:16%}.theme-preview b{left:31%;width:40%;top:35%;bottom:8%}.theme-preview em{right:6%;width:17%;top:35%;bottom:8%;border-top:3px solid var(--sample-accent)}
.theme-dialog-foot{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:16px 26px;border-top:1px solid var(--theme-line);background:var(--theme-panel-raised)}
.theme-dialog-foot p{font-size:13px;color:var(--theme-muted)}.theme-dialog-foot .btn{min-width:110px}

/* One-screen tactical workstation: pitch, live lineup desk, team instructions. */
.game-shell .era-tactics{display:grid;grid-template-columns:minmax(340px,.95fr) minmax(300px,.78fr) minmax(310px,.8fr);gap:12px;min-height:0;overflow:hidden;background:transparent}
.game-shell .tactic-main,.game-shell .tactic-roster-panel,.game-shell .tactic-settings{min-width:0;min-height:0;border:1px solid var(--theme-line);border-top:2px solid var(--theme-accent);background:var(--theme-panel)}
.game-shell .tactic-main{position:relative;display:flex;flex-direction:column;padding:0;background:linear-gradient(color-mix(in srgb,var(--theme-panel) 90%,transparent),color-mix(in srgb,var(--theme-bg) 93%,transparent)),url('/assets/game/stadium-lights.webp') center top/cover}
.game-shell .tactics-toolbar{display:flex;align-items:center;gap:7px;min-height:49px;margin:0;padding:8px;border-bottom:1px solid var(--theme-line-soft);background:var(--theme-panel)}
.game-shell .tactics-toolbar .segmented{margin:0}.game-shell .tactics-toolbar select,.game-shell .tactics-toolbar button{min-height:33px;padding:6px 8px;font-size:13px}.game-shell .pitch-help{margin-left:auto;font-size:13px;line-height:1.4;color:var(--theme-muted)}
.game-shell .era-tactic-pitch{position:relative;flex:1;width:100%;height:auto;min-height:560px;max-height:none;aspect-ratio:68/105;container-type:size;overflow:hidden;background:radial-gradient(ellipse at 50% 42%,var(--theme-glow),transparent 70%),repeating-linear-gradient(0deg,var(--theme-pitch-a) 0 10%,var(--theme-pitch-b) 10% 20%);border:0;box-shadow:inset 0 0 85px #03120b66}
.game-shell .pitch-lines{border-color:var(--theme-pitch-line)}.game-shell .pitch-lines:before{background:var(--theme-pitch-line)}.game-shell .pitch-lines :is(.center-circle,.penalty-area,.penalty-area:before){border-color:var(--theme-pitch-line)}
.game-shell .era-tactic-player{--face:clamp(28px,5.2cqh,52px);width:22cqw;max-width:92px}
.game-shell .pitch-profile{height:var(--face)}.game-shell .pitch-name{height:24px;line-height:22px;padding-inline:4px;font-size:clamp(9px,2.7cqw,12px);cursor:default;background:color-mix(in srgb,var(--theme-panel) 94%,transparent);border-color:var(--theme-line);color:var(--theme-text)}
.game-shell .pitch-name:after{content:none}.game-shell .pitch-name b{font-size:13px;color:var(--theme-accent)}
.game-shell .era-tactic-player .role-select{height:23px;min-height:23px;padding:2px 3px;font-size:clamp(8px,2.3cqw,10px);background:color-mix(in srgb,var(--theme-panel) 94%,transparent);border-color:var(--theme-line);color:var(--theme-muted)}
.game-shell .pitch-position,.game-shell .pitch-rating{color:var(--theme-accent)}.game-shell .pitch-condition i{background:var(--theme-accent)}
.game-shell .tactic-roster-panel,.game-shell .tactic-settings{display:flex;flex-direction:column;overflow:hidden}
.game-shell .tactic-column-head{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:61px;padding:12px 14px;border-bottom:1px solid var(--theme-line);background:var(--theme-panel-raised);flex-shrink:0}
.game-shell .tactic-column-head small{display:block;margin-bottom:4px;font-size:13px;letter-spacing:1px;color:var(--theme-accent)}
.game-shell .tactic-column-head h2{font-size:18px;font-weight:650;color:var(--theme-text)}
.game-shell .tactic-column-head>a,.game-shell .tactic-column-head>span{font-size:13px;color:var(--theme-accent);white-space:nowrap}
.game-shell .lineup-editor-scroll,.game-shell .tactic-settings-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--theme-accent-deep) var(--theme-panel)}
.game-shell .lineup-editor-section{padding:12px 11px 3px}.game-shell .lineup-editor-section+.lineup-editor-section{padding-top:18px;border-top:1px solid var(--theme-line)}
.game-shell .lineup-editor-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}.game-shell .lineup-editor-heading h3{font-size:13px;color:var(--theme-text)}.game-shell .lineup-editor-heading span{font-size:13px;color:var(--theme-muted)}
.game-shell .lineup-editor{display:grid}.game-shell .lineup-editor-row{display:grid;grid-template-columns:27px 30px minmax(0,1fr) 30px;gap:7px;align-items:center;min-height:49px;padding:4px 2px;border-bottom:1px solid var(--theme-line-soft);cursor:pointer}
.game-shell .lineup-editor-row:hover{background:var(--theme-glow)}.game-shell .lineup-editor-row.has-alert{box-shadow:inset 2px 0 var(--theme-red)}
.game-shell .lineup-position{font:13px var(--game-display);color:var(--theme-accent);text-align:center}.game-shell .lineup-editor-row .bench-face,.game-shell .lineup-face-empty{width:30px;height:36px;display:grid;place-items:center;overflow:hidden;background:var(--theme-panel-raised);color:var(--theme-muted)}
.game-shell .lineup-player-select{display:grid;min-width:0;gap:2px}.game-shell .lineup-player-select select{width:100%;min-height:27px;padding:3px 23px 3px 6px;border:0;background:transparent;font-size:13px;font-weight:600;color:var(--theme-text);text-overflow:ellipsis}.game-shell .lineup-player-select small{padding-left:6px;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--theme-muted)}
.game-shell .lineup-editor-row>strong{font:15px var(--game-display);text-align:center;color:var(--theme-accent)}
.game-shell .lineup-editor-summary{display:grid;grid-template-columns:1fr 1fr;gap:8px 15px;padding:12px 14px;border-top:1px solid var(--theme-line);background:var(--theme-panel-raised);flex-shrink:0}.game-shell .lineup-editor-summary>div{display:flex;align-items:end;justify-content:space-between}.game-shell .lineup-editor-summary span{font-size:13px;color:var(--theme-muted)}.game-shell .lineup-editor-summary b{font:21px var(--game-display);color:var(--theme-accent)}.game-shell .lineup-editor-summary b small{font-size:13px}.game-shell .lineup-editor-summary p{grid-column:1/-1;margin:0;font-size:13px;color:var(--theme-muted)}.game-shell .lineup-editor-summary p.has-alert{color:var(--theme-red)}
.game-shell .tactic-settings{padding:0;background:var(--theme-panel)}.game-shell .tactic-settings-scroll{padding:12px 14px 16px}.game-shell .tactic-settings .form-label{margin:0 0 15px;font-size:13px;color:var(--theme-muted)}.game-shell .tactic-settings .form-label select{margin-top:6px;width:100%;min-height:37px;font-size:13px}
.game-shell .tactic-settings .instruction-board{display:block;min-height:auto;margin:0 0 15px}.game-shell .instruction-board h3{display:flex;align-items:center;justify-content:space-between;margin:0 0 7px;font-size:13px;color:var(--theme-text)}.game-shell .instruction-board h3 small{font-size:13px;font-weight:600;color:var(--theme-accent)}
.game-shell .instruction-board>.tactic-range{display:grid;grid-template-columns:82px minmax(0,1fr) 30px;gap:9px;align-items:center;min-height:36px;padding:7px 0;border-bottom:1px solid var(--theme-line-soft);font-size:13px;color:var(--theme-muted)}
.game-shell .tactic-range input{width:100%;height:4px;padding:0;accent-color:var(--theme-accent);cursor:pointer}.game-shell .tactic-range b{font:13px var(--game-display);color:var(--theme-accent);text-align:right}
.game-shell .tactic-detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:14px 0;border-block:1px solid var(--theme-line)}.game-shell .tactic-detail{display:grid;gap:6px;font-size:13px;color:var(--theme-muted)}.game-shell .tactic-detail select{width:100%;min-height:35px;padding:6px 8px!important;background:var(--theme-panel-raised);border-color:var(--theme-line)}
.game-shell .tactic-engine-note{margin:14px 0 0;padding:11px 12px;border-left:3px solid var(--theme-accent);background:var(--theme-glow);color:var(--theme-muted);font-size:13px;line-height:1.7}.game-shell .tactic-engine-note b{display:block;margin-bottom:3px;color:var(--theme-accent);font-size:13px}.game-shell .tactic-settings .tactic-note{font-size:13px;line-height:1.7;color:var(--theme-muted)}

.game-shell .match-stage{min-height:0;overflow:hidden}
.game-shell .match-replay-view{display:grid;grid-template-columns:minmax(0,1fr) clamp(300px,23vw,360px);align-items:stretch;flex:1;height:auto;min-height:0;overflow:hidden;background:#071218}
.game-shell .match-replay-view .broadcast-pitch{display:grid;grid-template-rows:auto minmax(0,1fr) auto;min-width:0;min-height:0;overflow:hidden;padding:8px 10px;background:linear-gradient(180deg,#071218,#09171d)}
.game-shell .replay-field{position:relative;height:auto;min-height:260px;overflow:hidden;background:#09291f}
.game-shell .replay-field .replay-canvas{display:block;width:100%;height:100%;min-height:0;max-height:none;aspect-ratio:auto;margin:0;object-fit:contain}
.game-shell .replay-match-desk{display:flex;flex-direction:column;min-height:0;overflow:hidden}
.game-shell .replay-highlight-list{flex:1;min-height:0;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#8f7b4d #0a171d}
.game-shell .replay-highlight-list::-webkit-scrollbar{width:7px}.game-shell .replay-highlight-list::-webkit-scrollbar-thumb{background:#8f7b4d}.game-shell .replay-highlight-list::-webkit-scrollbar-track{background:#0a171d}
.game-shell .goal-celebration{position:absolute;z-index:5;top:14%;left:50%;display:grid;justify-items:center;min-width:190px;padding:14px 24px 16px;transform:translateX(-50%);background:linear-gradient(100deg,#071217eb,#12282ce8);border-block:1px solid #dcc47d99;box-shadow:0 14px 38px #000a;color:#f3e8c8;pointer-events:none;animation:goal-reveal .35s ease-out}
.game-shell .goal-celebration[hidden]{display:none}
.game-shell .goal-celebration span{font:700 24px var(--game-display);letter-spacing:8px;color:#e0c477}
.game-shell .goal-celebration strong{margin-top:6px;font-size:14px}.game-shell .goal-celebration small{margin-top:3px;color:#9fb2b4;font-size:13px}
@keyframes goal-reveal{from{opacity:0;transform:translate(-50%,-9px)}to{opacity:1;transform:translate(-50%,0)}}

@media(max-width:1450px){.game-shell .era-tactics{grid-template-columns:minmax(320px,1fr) minmax(285px,.78fr) minmax(295px,.8fr);gap:9px}.game-shell .pitch-help{display:none}.game-shell .theme-tool{min-width:34px}.game-shell .theme-tool>span{display:none}}
@media(min-width:901px) and (max-width:1190px){.game-shell .era-tactics{grid-template-columns:minmax(320px,1fr) 280px 290px;gap:8px}.game-shell .lineup-player-select select{font-size:13px}.game-shell .tactic-settings-scroll{padding-inline:11px}}
@media(min-width:901px) and (max-height:820px){.game-shell .era-tactics{grid-template-columns:minmax(320px,1fr) minmax(280px,.78fr) minmax(290px,.8fr);gap:8px}.game-shell .era-tactic-pitch{min-height:500px}.game-shell .lineup-editor-row{min-height:44px}.game-shell .tactic-column-head{min-height:52px;padding-block:8px}.game-shell .tactic-settings-scroll{padding-block:9px}.game-shell .instruction-board>.tactic-range{min-height:31px;padding-block:5px}}
@media(max-width:900px){
 .game-shell .theme-tool{display:inline-flex;min-width:34px}.game-shell .theme-tool>span{display:none}
 .game-shell .era-tactics{display:grid;grid-template-columns:1fr;overflow:visible}.game-shell .tactic-main{min-height:620px}.game-shell .tactic-roster-panel{min-height:660px}.game-shell .tactic-settings{min-height:620px;overflow:hidden}
 .theme-choice-grid{grid-template-columns:1fr 1fr}.theme-dialog-head{padding:20px}.theme-choice-grid{padding:20px}.theme-dialog-foot{padding:14px 20px}
 .game-shell .match-replay-view{grid-template-columns:1fr;grid-template-rows:minmax(420px,62vh) minmax(320px,46vh);overflow:auto}
 .game-shell .replay-match-desk{min-height:320px}.game-shell .replay-highlight-list{max-height:none}
}
@media(max-width:560px){.theme-choice-grid{grid-template-columns:1fr}.theme-preview{height:105px}.theme-dialog-foot{align-items:stretch;flex-direction:column}.theme-dialog-foot .btn{width:100%}}
@media(prefers-reduced-motion:reduce){.game-shell .goal-celebration{animation:none}*{scroll-behavior:auto!important}}
