/* Launch polish. Simple tactics mode (default): pitch + one quick-setup column; detailed editors are hidden, not removed. */
:root .game-shell .era-tactics.is-simple{grid-template-columns:minmax(360px,1fr) minmax(340px,440px)}
.era-tactics.is-simple .tactics-toolbar :is(.segmented,#formation,[data-action=auto-lineup],.position-edit-toggle),
.era-tactics.is-simple .era-tactic-player .role-select{display:none}
.era-tactics.is-simple .tactics-toolbar{min-height:0}

.tactic-mode button{min-width:78px}

.game-shell .tactic-simple{display:flex;flex-direction:column;overflow:hidden;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-simple-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:6px 14px 14px;scrollbar-width:thin;scrollbar-color:var(--theme-accent-deep) var(--theme-panel)}
.ts-step{padding:12px 0 14px;border-bottom:1px solid var(--theme-line-soft)}
.ts-step:last-child{border-bottom:0}
.ts-step h3{display:flex;align-items:center;gap:8px;margin:0 0 10px;font-size:14px;font-weight:650;color:var(--theme-text)}
.ts-step h3 i{display:grid;place-items:center;width:20px;height:20px;border-radius:50%;background:var(--theme-accent);color:var(--theme-accent-ink);font:700 11px/1 Arial,sans-serif;font-style:normal}
.ts-hint{margin:-4px 0 10px;font-size:12px;line-height:1.55;color:var(--theme-muted)}

.ts-formations{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.ts-formation,.ts-style{all:unset;box-sizing:border-box;cursor:pointer;border:1px solid var(--theme-line-soft);border-radius:8px;background:var(--theme-panel-raised);transition:border-color .15s,background-color .15s}
.ts-formation{display:grid;gap:2px;padding:8px 10px}
.ts-formation b{font:700 15px/1.2 Arial,sans-serif;color:var(--theme-text);letter-spacing:.5px}
.ts-formation small{font-size:11px;color:var(--theme-faint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ts-styles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.ts-style{display:grid;gap:4px;padding:9px 10px;align-content:start}
.ts-style-top{display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.ts-style-top b{font-size:13px;color:var(--theme-text);margin-right:auto}
.ts-style-top i{font-style:normal;font-size:10px;padding:1px 6px;border-radius:999px;background:var(--theme-line-soft);color:var(--theme-muted)}
.ts-style small{font-size:11.5px;line-height:1.45;color:var(--theme-muted)}
:is(.ts-formation,.ts-style):hover{border-color:color-mix(in srgb,var(--theme-accent) 55%,var(--theme-line-soft))}
:is(.ts-formation,.ts-style):focus-visible{outline:2px solid var(--theme-accent);outline-offset:2px}
:is(.ts-formation,.ts-style).on{border-color:var(--theme-accent);background:color-mix(in srgb,var(--theme-accent) 12%,var(--theme-panel-raised));box-shadow:inset 0 0 0 1px var(--theme-accent)}
:is(.ts-formation,.ts-style).on b{color:var(--theme-accent)}
.ts-style.on .ts-style-top i{background:color-mix(in srgb,var(--theme-accent) 22%,transparent);color:var(--theme-text)}

.ts-auto{width:100%;min-height:42px;margin-bottom:10px}
.ts-summary{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.ts-summary>div{display:grid;gap:2px;padding:8px 10px;border-radius:8px;background:var(--theme-panel-raised)}
.ts-summary span{font-size:11px;color:var(--theme-faint)}
.ts-summary b{font-size:20px;color:var(--theme-text);font-variant-numeric:tabular-nums}
.ts-summary b small{font-size:12px;color:var(--theme-muted)}
.ts-status{margin:8px 0 0;font-size:12px;color:var(--theme-muted)}
.ts-status.has-alert{color:var(--theme-red)}
.ts-foot{padding:10px 14px;border-top:1px solid var(--theme-line-soft);font-size:12px;line-height:1.55;color:var(--theme-muted)}
.ts-foot b{color:var(--theme-text);font-weight:600}
.ts-link{all:unset;cursor:pointer;color:var(--theme-accent);text-decoration:underline;text-underline-offset:2px}
.ts-link:focus-visible{outline:2px solid var(--theme-accent);outline-offset:2px}

@media (max-width:900px){
 :root .game-shell .era-tactics.is-simple{grid-template-columns:1fr;overflow:visible}
 .game-shell .tactic-simple{overflow:visible}
 .game-shell .tactic-simple-scroll{overflow:visible}
 .ts-formations{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:520px){.ts-styles{grid-template-columns:1fr}}

/* Phone top bar: keep the page name on one line and funds visible (they were hidden below 520px). */
@media (max-width:520px){
 :root .game-shell .topbar{gap:6px}
 :root .game-shell .hud-location{min-width:0;flex:1 1 auto}
 :root .game-shell .hud-location>svg{display:none}
 :root .game-shell .hud-location span{white-space:nowrap}
 :root .game-shell .guide-tool{font-size:0;width:30px;min-width:30px;height:30px;padding:0;justify-content:center;border-radius:50%}
 :root .game-shell .guide-tool::after{content:"?";font-size:14px;font-weight:700}
 :root .game-shell .hud-location span{flex:0 0 auto}
 :root .game-shell .topbar .meta .hud-funds .money{white-space:nowrap}
 :root .game-shell .topbar .meta{gap:4px}
 :root .game-shell .topbar .meta .hud-funds{display:flex;align-items:center}
 :root .game-shell .topbar .meta .hud-funds small{display:none}
 :root .game-shell .topbar .logout{white-space:nowrap;font-size:12px;padding:6px 8px}
}
/* Phone overflow found by a per-page scan: scout rows push the status pill off-screen, the finance ledger is wider than the screen. */
@media (max-width:520px){
 :root .game-shell .scout-row{grid-template-columns:minmax(0,1fr) auto auto;row-gap:4px}
 :root .game-shell .scout-row>.player-status{grid-column:1/-1;justify-self:start}
 :root .game-shell .finance-ledger{overflow-x:auto;max-width:100%}
}

/* Home: daily challenge shortcut inside 킥오프 준비. */
.command-challenge{all:unset;box-sizing:border-box;cursor:pointer;display:grid;grid-template-columns:1fr auto auto;align-items:center;gap:10px;margin-top:10px;padding:9px 12px;border-radius:8px;border:1px solid color-mix(in srgb,var(--theme-accent) 45%,var(--theme-line-soft));background:color-mix(in srgb,var(--theme-accent) 8%,transparent);transition:background-color .15s}
.command-challenge:hover{background:color-mix(in srgb,var(--theme-accent) 14%,transparent)}
.command-challenge:focus-visible{outline:2px solid var(--theme-accent);outline-offset:2px}
.command-challenge>span{display:grid;gap:1px;font-size:13px;font-weight:600;color:var(--theme-text)}
.command-challenge>span small{font-size:11px;font-weight:400;color:var(--theme-muted)}
.command-challenge>b{font-size:18px;color:var(--theme-accent);font-variant-numeric:tabular-nums}
.command-challenge>b small{font-size:12px;color:var(--theme-muted)}
.command-challenge>em{font-style:normal;font-size:12px;color:var(--theme-muted);font-variant-numeric:tabular-nums}
.command-challenge.done{border-color:var(--theme-line-soft);background:transparent}

/* Player records: season line, last five ratings, career totals (player-record.js). */
.record-block{display:grid;gap:10px;margin:12px 0;padding:12px;border:1px solid var(--theme-line-soft);border-radius:10px;background:var(--theme-panel-raised)}
.record-label{display:block;font-size:11px;letter-spacing:.3px;color:var(--theme-faint);margin-bottom:6px}
.record-cells{display:grid;grid-template-columns:repeat(auto-fit,minmax(52px,1fr));gap:6px}
.record-cells>span{display:grid;justify-items:center;gap:3px;font-size:11px;color:var(--theme-muted)}
.record-cells b{font-size:17px;color:var(--theme-text);font-variant-numeric:tabular-nums}
.record-cells b.mc-rating{font-size:14px;padding:3px 7px}
.record-cells b.mc-rating:not([class*=r-]){background:var(--theme-line-soft);color:var(--theme-muted)}
.record-form>div{display:flex;flex-wrap:wrap;gap:5px}
.form-chip{font-style:normal;min-width:36px;text-align:center;padding:3px 6px;border-radius:5px;font:800 12px/1.2 Arial,sans-serif;color:#0b1418;background:var(--mc-d,#8b98a0);font-variant-numeric:tabular-nums}
.form-chip.r-high{background:#4ec3e0}.form-chip.r-good{background:var(--mc-w,#5fcf8e)}.form-chip.r-mid{background:#d9c46a}.form-chip.r-low{background:var(--mc-l,#e07b6a)}
.form-empty{font-size:12px;color:var(--theme-faint)}
.record-career{margin:0;font-size:12px;color:var(--theme-muted)}
.record-block.compact{margin:10px 0}
.rating-none{color:var(--theme-faint)}

/* Match detail: the replay used to take whatever height was left in a non-scrolling page, which squeezed the
   pitch to ~190px on 768px-tall laptops (and the broadcast camera then zoomed into that strip).
   Give the field a height proportional to its width and let the page scroll instead. Fullscreen keeps its own layout. */
.game-shell[data-page=matches] #content:has(.md-detail){overflow-y:auto}
.game-shell[data-page=matches] :is(.md-detail,.mc-stage,.match-replay-view):not(:fullscreen){flex:none;height:auto;min-height:0;overflow:visible}
.game-shell[data-page=matches] .mc-stage .broadcast-pitch:not(:fullscreen){flex:none;height:auto;overflow:visible;grid-template-rows:auto auto auto auto}
/* The field keeps roughly the pitch proportions (a wide, short strip crops the field under the follow camera);
   it is capped so field + controls fit on screen once scrolled, and the playback bar sticks to the bottom. */
.game-shell[data-page=matches] .mc-stage .broadcast-pitch:not(:fullscreen) .replay-field{height:auto;aspect-ratio:2/1;min-height:260px;max-height:clamp(340px,calc(100vh - 420px),620px);justify-self:center;width:100%;max-width:calc(clamp(340px,100vh - 420px,620px) * 2)}
.game-shell[data-page=matches] .mc-stage .broadcast-pitch:not(:fullscreen) .replay-commentary{min-height:0;padding-block:8px}
.game-shell[data-page=matches] .mc-stage .broadcast-pitch:not(:fullscreen) .replay-control{position:sticky;bottom:0;z-index:6;background:var(--theme-panel);box-shadow:0 -8px 16px -10px #0008}
/* Shorter screens: compact match header. */
@media (max-height:900px){
 .game-shell[data-page=matches] .md-detail .mc-hero{padding-block:6px}
 .game-shell[data-page=matches] .md-detail .mc-hero .emblem-svg{width:44px;height:46px}
 .game-shell[data-page=matches] .md-detail .mc-hero .team-marker-legend{display:none}
 .game-shell[data-page=matches] .md-detail .mc-hero-score>strong{font-size:30px;padding-block:2px}
 .game-shell[data-page=matches]:has(.md-detail) .page-title{display:none}
}
