/* ============================================================
   REPLAY SCOPE — "BROADCAST HUD" theme
   Steel command-deck · angular cuts · team-color data language
   ============================================================ */
:root {
  /* ---- Steel command-deck surfaces (OKLCH, tinted toward CT hue) ---- */
  --bg:        oklch(0.146 0.011 248);
  --bg-2:      oklch(0.172 0.013 248);
  --panel:     oklch(0.199 0.014 249);
  --panel-2:   oklch(0.240 0.016 250);
  --panel-3:   oklch(0.288 0.018 250);
  --border:    oklch(0.320 0.018 250);
  --border-2:  oklch(0.410 0.024 251);
  --text:      oklch(0.967 0.005 250);
  --text-dim:  oklch(0.800 0.013 250);
  --muted:     oklch(0.628 0.017 251);

  /* ---- Team colors = brand AND data language ---- */
  --ct:        oklch(0.685 0.092 245);   /* hard, desaturated steel-blue */
  --ct-dk:     oklch(0.545 0.090 245);
  --ct-soft:   oklch(0.685 0.092 245 / .15);
  --t:         oklch(0.802 0.135 79);     /* tournament gold */
  --t-dk:      oklch(0.690 0.125 76);
  --t-soft:    oklch(0.802 0.135 79 / .15);

  --primary:   var(--ct);     /* cool structural accent: active / info / focus */
  --accent:    var(--t);      /* warm highlight: CTAs, live actions, hot values */
  --accent-ink: oklch(0.235 0.045 72);
  --accent-soft: var(--t-soft);

  --green:     oklch(0.770 0.150 152);
  --green-soft: oklch(0.770 0.150 152 / .15);
  --red:       oklch(0.645 0.190 25);
  --red-soft:  oklch(0.645 0.190 25 / .15);

  --shadow:    0 20px 50px oklch(0.09 0.02 250 / .62);

  --radius:    3px;
  --radius-sm: 2px;
  --radius-xs: 2px;
  --cut: 8px;                  /* chamfer depth for HUD fills */
  --chamfer: polygon(var(--cut) 0, 100% 0, 100% 100%, 0 100%, 0 var(--cut));
  --chamfer-2: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));

  /* ---- 4pt spacing scale ---- */
  --space-xs: 4px; --space-sm: 8px; --space-md: 12px; --space-lg: 16px;
  --space-xl: 24px; --space-2xl: 32px; --space-3xl: 48px;

  --display: 'Chakra Petch', 'Archivo', system-ui, sans-serif;
  --sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;

  /* ---- Motion ---- */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --tf: .12s; --tm: .22s; --ts: .4s;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  background:
    radial-gradient(120% 80% at 50% -10%, oklch(0.22 0.02 250 / .5), transparent 60%),
    var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv01';
  overflow: hidden;
  user-select: none;
}
.mono, code, [class*="-val"], [class*="score"], [class*="-count"] { font-variant-numeric: tabular-nums; }

:focus-visible { outline: 2px solid var(--ct); outline-offset: 1px; border-radius: 1px; }
::selection { background: var(--t-soft); color: var(--text); }
#app { display: flex; flex-direction: column; height: 100vh; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: oklch(0.48 0.03 250); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
code { font-family: var(--mono); background: var(--panel-3); padding: 1px 6px; border-radius: 2px; font-size: .85em; color: var(--ct); }

/* HUD section eyebrow: condensed uppercase + leading tick */
.hud-kicker { font-family: var(--display); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.4px; color: var(--muted); }

/* ---- Motion primitives ---- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sweep { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes kf-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
@keyframes pulse-live { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  padding: 9px 15px; border-radius: var(--radius);
  border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text);
  cursor: pointer; transition: background var(--tf), border-color var(--tf), transform .06s var(--ease), color var(--tf);
}
.btn:hover { background: var(--panel-3); border-color: var(--border-2); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent); border-color: transparent; color: var(--accent-ink); font-weight: 700;
  clip-path: var(--chamfer);
}
.btn-primary:hover { background: var(--accent); filter: brightness(1.07); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-soft); border-color: oklch(0.645 0.19 25 / .4); }

/* ---------------- Top bar ---------------- */
.topbar {
  display: flex; align-items: center; gap: 22px;
  height: 54px; padding: 0 18px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--bg-2), oklch(0.16 0.012 248));
  border-bottom: 1px solid var(--border);
  position: relative; z-index: 30;
}
.topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--ct-soft) 30%, var(--t-soft) 70%, transparent); }
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; color: var(--t); }
.brand-mark { color: var(--t); filter: drop-shadow(0 0 6px oklch(0.80 0.135 79 / .25)); }
.brand-name { font-family: var(--display); font-size: 16px; color: var(--text); font-weight: 500; letter-spacing: .4px; text-transform: uppercase; }
.brand-name strong { font-weight: 700; }

.match-tabs { display: flex; gap: 2px; background: var(--panel); padding: 3px; border-radius: var(--radius); border: 1px solid var(--border); }
.tab {
  font-family: var(--display); font-size: 12.5px; font-weight: 600; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .6px;
  padding: 7px 14px; border: none; background: transparent; border-radius: var(--radius-sm); cursor: pointer;
  transition: background var(--tf), color var(--tf);
}
.tab:hover { color: var(--text); background: var(--panel-2); }
.tab.active { background: var(--ct-dk); color: oklch(0.98 0.01 250); clip-path: var(--chamfer); }

.match-head { display: flex; align-items: center; gap: 10px; margin-left: auto; font-family: var(--display); }
.mh-team { font-weight: 700; font-size: 14px; letter-spacing: .4px; text-transform: uppercase; }
.mh-a { color: var(--ct); }
.mh-b { color: var(--t); }
.mh-score { font-family: var(--mono); font-weight: 700; font-size: 16px; background: var(--bg); padding: 4px 13px; border-radius: 0; clip-path: var(--chamfer-2); border: 1px solid var(--border-2); letter-spacing: 1px; }
.mh-map { font-family: var(--mono); color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; }
.topbar-actions { margin-left: 12px; }
.match-head[hidden] + .topbar-actions { margin-left: auto; }

/* ---------------- Main / views ---------------- */
.body-row { flex: 1; min-height: 0; display: flex; }
#main { flex: 1; min-width: 0; min-height: 0; position: relative; }

/* Secondary nav sidebar (match views): match info on top, vertical tabs below. */
.match-sidebar { flex: 0 0 192px; display: flex; flex-direction: column; gap: 14px; padding: 16px 12px;
  background: var(--bg-2); border-right: 1px solid var(--border); overflow-y: auto; }
.match-sidebar .match-head { display: flex; flex-direction: column; gap: 8px; align-items: stretch; margin: 0; padding: 2px 4px 14px; border-bottom: 1px solid var(--border); }
/* one row per team: name on the left, that team's score boxed on the right */
.match-sidebar .mh-teams { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.mh-teamrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mh-teamrow .mh-team { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mh-teamrow .mh-score { font-size: 14px; padding: 2px 9px; min-width: 32px; text-align: center; }
.mh-teamrow .mh-score.mh-a { color: var(--ct); }
.mh-teamrow .mh-score.mh-b { color: var(--t); }
.match-sidebar .match-tabs { display: flex; flex-direction: column; gap: 2px; background: none; border: none; padding: 0; border-radius: 0; }
.match-sidebar .tab { width: 100%; justify-content: flex-start; text-align: left; padding: 9px 12px; border-radius: var(--radius-sm); }
.match-sidebar .tab.active { clip-path: none; background: var(--ct-soft); color: var(--ct); box-shadow: inset 3px 0 0 var(--ct); }
.view { position: absolute; inset: 0; }
.view:not([hidden]) { animation: fade var(--tm) var(--ease); }
.view[hidden] { display: none; }

/* ---------------- Library ---------------- */
.view-library { overflow-y: auto; }
.library-inner { max-width: 1280px; margin: 0 auto; padding: 28px 28px 60px; }
.lib-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.lib-header h1 { font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }
.dropzone {
  border: 1px dashed var(--border-2); border-radius: var(--radius);
  padding: 26px; text-align: center; color: var(--text-dim);
  background: var(--bg-2);
  transition: border-color var(--tm), background var(--tm); margin-bottom: 26px;
}
.dropzone svg { color: var(--muted); margin-bottom: 8px; }
.dropzone.drag { border-color: var(--t); background: var(--t-soft); }
.dropzone.drag svg { color: var(--t); }
.dropzone p { margin: 2px 0; }
/* slim, single-line drop bar once the library is populated */
.dropzone.compact { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 11px 18px; margin-bottom: 18px; }
.dropzone.compact svg { width: 20px; height: 20px; margin-bottom: 0; flex-shrink: 0; }
.dropzone.compact p:last-child { display: none; }

/* library sort/filter toolbar */
.lib-toolbar { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.lib-field { display: flex; flex-direction: column; gap: 4px; }
.lib-flabel { font-family: var(--display); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.lib-select, .lib-search { font-family: var(--sans); font-size: 13px; background: var(--panel-2); border: 1px solid var(--border-2); color: var(--text); border-radius: var(--radius); padding: 7px 10px; }
.lib-select { appearance: none; -webkit-appearance: none; padding-right: 26px; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%237b8499' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>"); background-repeat: no-repeat; background-position: right 9px center; }
.lib-select:hover { border-color: var(--ct); }
.lib-search { min-width: 220px; flex: 1; max-width: 320px; }
.lib-search::placeholder { color: var(--muted); }
.lib-clear { align-self: flex-end; padding: 7px 14px; }

/* in-app modal (replaces window.prompt/confirm, which Electron doesn't support) */
.modal-overlay { position: fixed; inset: 0; z-index: 280; background: oklch(0.06 0.01 248 / .62); display: flex; align-items: center; justify-content: center; animation: fade .14s var(--ease); }
.modal-card { width: 380px; max-width: calc(100vw - 32px); background: var(--panel); border: 1px solid var(--border-2); clip-path: var(--chamfer-2); padding: 22px 24px; box-shadow: var(--shadow); animation: rise var(--tm) var(--ease); }
.modal-title { font-family: var(--display); font-size: 16px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 12px; }
.modal-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.modal-msg { color: var(--text-dim); font-size: 14px; line-height: 1.55; margin-bottom: 16px; }
.modal-input { width: 100%; font-family: var(--sans); font-size: 14px; background: var(--panel-2); border: 1px solid var(--border-2); color: var(--text); border-radius: var(--radius); padding: 9px 11px; }
.modal-input:focus { border-color: var(--t); outline: none; }
.modal-list { display: flex; flex-direction: column; gap: 4px; max-height: 280px; overflow-y: auto; margin-bottom: 12px; }
.modal-choice { text-align: left; font-family: var(--sans); font-size: 13.5px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); padding: 9px 12px; cursor: pointer; transition: background var(--tf), border-color var(--tf); }
.modal-choice:hover { background: var(--panel-3); border-color: var(--ct); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* Manage teams (merge org name variants) */
.tm-pick-row { display: flex; align-items: center; gap: 6px; }
.tm-pick-row select { flex: 1; min-width: 0; }
.tm-manage-btn { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  background: var(--panel-2); border: 1px solid var(--border-2); color: var(--muted); cursor: pointer; border-radius: var(--radius-sm);
  transition: background var(--tf), color var(--tf), border-color var(--tf); }
.tm-manage-btn:hover { background: var(--panel-3); color: var(--text); border-color: var(--ct); }
.tm-card { width: 460px; max-height: 80vh; overflow-y: auto; }
.tm-sub { font-family: var(--display); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 16px 0 8px; }
.tm-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--panel-2); border: 1px solid var(--border); margin-bottom: 5px; font-size: 13px; }
.tm-row.tm-suggest { border-color: var(--t); background: var(--t-soft, oklch(0.7 0.12 60 / .1)); }
.tm-row-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tm-note { color: var(--muted); font-size: 11.5px; }
.tm-btn { flex: 0 0 auto; padding: 5px 12px; font-size: 12px; }
.tm-merge-row { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.tm-select { flex: 1; min-width: 0; font-size: 12.5px; background: var(--panel-2); border: 1px solid var(--border-2); color: var(--text); padding: 6px 8px; border-radius: var(--radius-sm); }
.tm-arrow { color: var(--muted); }

.demo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.demo-card {
  background: var(--panel); border: 1px solid var(--border);
  overflow: hidden; transition: border-color var(--tm), transform var(--tf) var(--ease), box-shadow var(--tm);
  cursor: pointer; display: flex; flex-direction: column; position: relative;
  clip-path: var(--chamfer-2);
}
.demo-card:hover { border-color: var(--ct); transform: translateY(-3px); box-shadow: var(--shadow); }
.dc-thumb { position: relative; aspect-ratio: 16/9; background: oklch(0.13 0.01 248) center/cover no-repeat; border-bottom: 1px solid var(--border); }
.dc-thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, oklch(0.10 0.01 248 / .1), oklch(0.10 0.01 248 / .88)); }
.dc-map { position: absolute; left: 12px; bottom: 10px; z-index: 2; font-family: var(--display); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 1.6px; color: var(--text); text-shadow: 0 1px 4px #000; }
.dc-score { position: absolute; right: 12px; bottom: 8px; z-index: 2; font-family: var(--mono); font-weight: 700; font-size: 18px; text-shadow: 0 1px 6px #000; }
.dc-score .sa { color: var(--ct); } .dc-score .sb { color: var(--t); } .dc-score .sep { color: var(--muted); margin: 0 4px; }
.dc-body { padding: 13px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.dc-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-meta { display: flex; gap: 14px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dc-meta .ico { display: inline-flex; align-items: center; gap: 5px; }
.dc-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }
.dc-actions .btn-primary { flex: 1; justify-content: center; padding: 7px 10px; }
.dc-actions .dc-icon { flex: 0 0 auto; width: 36px; padding: 7px; justify-content: center; color: var(--muted); }
.dc-actions .dc-icon:hover { color: var(--text); }
.dc-actions .dc-del:hover { color: var(--red); border-color: var(--red); background: var(--red-soft); }
.dc-status { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-dim); }
.dc-status .progress { flex: 1; }
.badge { font-family: var(--display); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; padding: 3px 8px; clip-path: var(--chamfer); }
.badge.ready { background: var(--green-soft); color: var(--green); }
.badge.parsing { background: var(--ct-soft); color: var(--ct); }
.badge.error { background: var(--red-soft); color: var(--red); }
.badge.pending { background: var(--panel-3); color: var(--muted); }

.empty-state { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty-state svg { opacity: .25; margin-bottom: 14px; }

/* ---------------- Progress ---------------- */
.progress { height: 5px; background: var(--panel-3); border-radius: 0; overflow: hidden; }
.progress-bar { height: 100%; width: 0%; background: var(--ct); transition: width var(--ts) var(--ease); }

/* ---------------- Panels ---------------- */
.panel { background: var(--panel); border: 1px solid var(--border); }
.panel-title { font-family: var(--display); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-dim); padding: 12px 14px 8px; }

/* ---------------- Replay layout ---------------- */
.view-replay { display: grid; grid-template-columns: 252px minmax(0, 1fr) 290px; grid-template-rows: minmax(0, 1fr); height: 100%; gap: 0; }
.players-panel { border: none; overflow-y: auto; padding: 8px; background: var(--bg-2); border-right: 1px solid var(--border); }
.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.map-wrap { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 16px; }
#radarCanvas { background: transparent; }
/* HUD corner brackets on the radar */
.map-wrap::before, .map-wrap::after { content: ''; position: absolute; width: 20px; height: 20px; pointer-events: none; }
.map-wrap::before { top: 16px; left: 16px; border-top: 2px solid var(--t); border-left: 2px solid var(--t); }
.map-wrap::after { bottom: 16px; right: 16px; border-bottom: 2px solid var(--t); border-right: 2px solid var(--t); }
.map-overlay { position: absolute; top: 26px; left: 26px; font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); pointer-events: none; }
#radarCanvas { cursor: crosshair; touch-action: none; }
/* telestrator overlay — marker colors + clear, top-right of the radar */
.tele-bar { position: absolute; bottom: 14px; right: 14px; display: flex; align-items: center; gap: 6px; padding: 5px 7px; background: oklch(0.16 0.012 248 / .82); border: 1px solid var(--border); border-radius: 999px; backdrop-filter: blur(6px); z-index: 6; }
.tele-ic { display: inline-flex; color: var(--muted); margin: 0 1px 0 2px; }
.tele-sw { width: 15px; height: 15px; border-radius: 50%; background: var(--sw); border: 1.5px solid transparent; cursor: pointer; padding: 0; transition: transform var(--tf), border-color var(--tf); }
.tele-sw:hover { transform: scale(1.12); }
.tele-sw.on { border-color: #fff; box-shadow: 0 0 0 1px oklch(0.16 0.012 248), 0 0 7px var(--sw); }
.tele-clear { margin-left: 2px; padding: 3px 9px; font-family: var(--display); font-size: 10px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-dim); background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; cursor: pointer; }
.tele-clear:hover { color: var(--text); border-color: var(--border-2); }
.side-panel { border: none; border-left: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; background: var(--bg-2); }

/* player rows */
.team-group { margin-bottom: 10px; }
.team-label { display: flex; justify-content: space-between; align-items: center; font-family: var(--display); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; padding: 6px 8px; }
.team-label.ct { color: var(--ct); }
.team-label.t { color: var(--t); }
.team-label .tg-score { font-family: var(--mono); font-size: 13px; }
.player-row {
  display: flex; flex-direction: column; gap: 4px; padding: 7px 9px 8px; border-radius: var(--radius); cursor: pointer;
  transition: background var(--tf), border-color var(--tf); position: relative; margin-bottom: 2px;
  border: 1px solid transparent;
}
.player-row:hover { background: var(--panel-2); }
.player-row.selected { background: var(--panel-2); border-color: var(--t); }
.player-row.dead { opacity: .5; }
.player-row.dead .pr-guns { opacity: .35; filter: grayscale(1); }
.pr-main { display: flex; align-items: center; gap: 9px; }
.pr-dot { width: 10px; height: 10px; flex-shrink: 0; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.pr-name { font-weight: 600; font-size: 13px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* live loadout row: money + weapon silhouettes */
.pr-loadout { display: flex; align-items: center; gap: 8px; padding-left: 19px; min-height: 16px; }
.pr-money { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--t); min-width: 42px; }
.pr-guns { display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; }
.wic { height: 13px; width: auto; max-width: 40px; object-fit: contain; flex-shrink: 0;
  filter: brightness(0) invert(1); opacity: .82; }
.wic-svg { display: inline-flex; align-items: center; color: #fff; opacity: .82; }
.wic-svg svg { height: 13px; width: 13px; }
.pr-kd { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.pr-hp { width: 38px; text-align: right; font-family: var(--mono); font-size: 12px; font-weight: 600; }
.pr-hpbar { position: absolute; left: 9px; right: 9px; bottom: 2px; height: 2px; background: var(--panel-3); overflow: hidden; }
.pr-hpbar i { display: block; height: 100%; background: var(--green); transition: width .15s linear; }

/* round info + killfeed */
.round-info { padding: 16px; border-bottom: 1px solid var(--border); }
.ri-round { font-family: var(--display); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1.2px; }
.ri-title { font-family: var(--display); font-size: 18px; font-weight: 700; margin: 3px 0 10px; text-transform: uppercase; }
.ri-stat { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; }
.ri-stat span:last-child { font-family: var(--mono); color: var(--text-dim); }
.killfeed-wrap { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.killfeed { overflow-y: auto; padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.kf-item { display: flex; align-items: center; gap: 7px; font-size: 12.5px; padding: 7px 9px; background: var(--panel); border: 1px solid var(--border); animation: kf-in .25s var(--ease); }
.kf-name { font-weight: 600; }
.kf-name.ct { color: var(--ct); } .kf-name.t { color: var(--t); }
.kf-weapon { color: var(--muted); font-family: var(--mono); font-size: 11px; margin: 0 2px; }
.kf-wic { height: 15px; width: auto; max-width: 48px; object-fit: contain; filter: brightness(0) invert(1); opacity: .9; }
.kf-hs.wic-svg { color: var(--t); opacity: 1; }
.kf-hs.wic-svg svg { height: 13px; width: 13px; }

/* ---------------- Controls ---------------- */
.controls { flex-shrink: 0; background: var(--bg-2); border-top: 1px solid var(--border); padding: 10px 16px 14px; }
/* overflow hidden — paging is driven by the ‹ › arrows (programmatic scrollLeft still works) */
.rounds-strip { display: flex; gap: 3px; margin-bottom: 12px; overflow-x: hidden; scrollbar-width: none; }
.rounds-strip::-webkit-scrollbar { display: none; }
.round-chip {
  flex-shrink: 0; min-width: 27px; height: 30px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text-dim); font-family: var(--mono); font-size: 11px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center; position: relative; transition: transform .1s var(--ease), border-color var(--tf), background var(--tf);
}
.round-chip:hover { transform: translateY(-2px); border-color: var(--border-2); }
.round-chip.win-a { box-shadow: inset 0 -3px 0 var(--ct); }
.round-chip.win-b { box-shadow: inset 0 -3px 0 var(--t); }
.round-chip.active { background: var(--panel-3); border-color: var(--t); color: var(--text); }
.round-chip .pin { position: absolute; top: -3px; right: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--t); }

.transport { display: flex; align-items: center; gap: 10px; }

/* ============================================================
   REPLAY — broadcast HUD layout: radar centered, scoreboard top,
   team panels in the bottom corners, kill feed top-right.
   ============================================================ */
.bc-stage { grid-column: 1 / -1; grid-row: 1; position: relative; min-width: 0; min-height: 0; overflow: hidden; background: var(--bg); }
/* map label, top-left (where the minimap used to be) */
/* Radar blends into the stage — no framing brackets or border around it. */
.bc-stage .map-wrap::before, .bc-stage .map-wrap::after { content: none; }
.bc-stage .map-overlay { position: absolute; top: 14px; left: 18px; z-index: 5; font-family: var(--mono); font-size: 12px; letter-spacing: 1.5px; }
/* radar: a centred square so the kill feed/draw tool sit in its own corners; gutters hold the panels */
.bc-stage .map-wrap { position: absolute; top: 62px; bottom: 96px; left: 50%; transform: translateX(-50%); aspect-ratio: 1; width: auto; max-width: calc(100% - 552px); padding: 10px; }

/* top-center scoreboard */
.bc-score { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 6; display: flex; align-items: stretch; min-height: 44px; background: none; border: none; }
.bcs-team { display: flex; align-items: center; flex: 0 0 158px; padding: 0 14px; overflow: hidden; font-family: var(--display); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }
.bcs-a { justify-content: flex-end; } .bcs-b { justify-content: flex-start; }
.bcs-name { color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bcs-name.ct { color: var(--ct); } .bcs-name.t { color: var(--t); }
.bcs-logo { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; background: var(--panel-3); color: var(--text); clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px); }
.bcs-logo.ct { background: var(--ct); color: oklch(0.18 0.04 250); } .bcs-logo.t { background: var(--t); color: oklch(0.24 0.05 70); }
.bcs-num { display: flex; align-items: center; padding: 0 7px; font-family: var(--mono); font-weight: 700; font-size: 21px; }
.bcs-num.ct { color: var(--ct); } .bcs-num.t { color: var(--t); }
.bcs-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 4px 16px; min-width: 110px; background: var(--panel); border: 1px solid var(--border); clip-path: var(--chamfer-2); }
.bcs-round { font-family: var(--display); font-weight: 600; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.bcs-timer { font-family: var(--mono); font-weight: 700; font-size: 15px; transition: color var(--tf); }
/* bomb state is shown on the timer itself: flashing red while live, green on defuse, red on detonate */
.bcs-timer.plant { color: var(--red); animation: bcs-flash .9s ease-in-out infinite; }
.bcs-timer.def { color: var(--green); }
.bcs-timer.det { color: var(--red); }
@keyframes bcs-flash { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* kill feed — inside the radar's top-right corner (transient; rows fade via inline opacity) */
.bc-killfeed { position: absolute; top: 13px; right: 13px; z-index: 6; width: auto; max-width: 260px; padding: 0; overflow: visible; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.bc-killfeed .kf-item { padding: 3px 8px; font-size: 12px; background: oklch(0.1 0.01 248 / .82); }

/* team panels — bottom corners, their bottom aligned with the radar's bottom (clears the notepad FAB) */
.bc-stage .bc-team { position: absolute; bottom: 96px; width: 252px; z-index: 4; display: flex; flex-direction: column; gap: 5px; }
.bc-stage .bc-team-a { left: 14px; } .bc-stage .bc-team-b { right: 14px; }

/* player cards (broadcast) — these hold most of the info, so give them room */
.bc-team .player-row { flex-direction: row; align-items: stretch; gap: 0; padding: 0; margin: 0; border: 1px solid var(--border); border-radius: 2px; background: var(--panel); overflow: hidden; min-height: 47px; }
.bc-team .player-row:hover { background: var(--panel-2); }
.bc-team .player-row.selected { border-color: var(--t); }
.bc-team .pr-dot { display: none; }
.bc-team .pr-rank { flex: 0 0 24px; display: flex; align-items: center; justify-content: center; background: var(--panel-3); font-family: var(--mono); font-weight: 700; font-size: 13px; color: oklch(0.16 0.03 250); }
.bc-team .pr-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 6px 11px; }
.bc-team .pr-main { gap: 8px; }
.bc-team .pr-name { font-size: 13.5px; }
.bc-team .pr-kd { font-size: 12px; }
.bc-team .pr-hp { width: 36px; font-size: 15px; font-weight: 700; }
.bc-team .pr-loadout { padding-left: 0; gap: 7px; min-height: 0; }
.bc-team .pr-money { min-width: 0; font-size: 12px; color: var(--green); }
.bc-team .pr-guns { margin-left: auto; }
.bc-team .pr-guns .wic, .bc-team .pr-guns .wic-svg svg { height: 15px; }
.bc-team .pr-hpbar { left: 0; right: 0; bottom: 0; height: 3px; background: oklch(0.12 0.01 248); }
/* mirror the right team: HP reads inner, rank tab on the outer edge */
.bc-team-b .player-row { flex-direction: row-reverse; }
.bc-team-b .pr-main, .bc-team-b .pr-loadout { flex-direction: row-reverse; }
.bc-team-b .pr-name { text-align: right; }
.bc-team-b .pr-guns { margin-left: 0; margin-right: auto; }

/* controls + round selector below the radar — kept narrow so the eye doesn't travel far */
.bc-stage .bc-controls { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); width: min(782px, 96%); z-index: 5; background: transparent; border-top: none; padding: 0; }
.bc-controls .rounds-strip { margin-bottom: 10px; }

@media (max-width: 1180px) {
  .bc-stage .bc-team { width: 196px; }
  .bc-stage .map-wrap { max-width: calc(100% - 440px); }
}
@media (max-width: 960px) {
  .bc-stage .bc-team { width: 150px; }
  .bc-stage .map-wrap { max-width: calc(100% - 340px); }
}

.ctl {
  width: 38px; height: 38px; border: 1px solid var(--border-2); background: var(--panel-2);
  color: var(--text); font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background var(--tf), border-color var(--tf), color var(--tf); flex-shrink: 0; border-radius: var(--radius);
}
.ctl:hover { background: var(--panel-3); }
.ctl-play { width: 44px; height: 44px; font-size: 16px; background: var(--accent); border-color: transparent; color: var(--accent-ink); clip-path: var(--chamfer); }
.ctl-play:hover { filter: brightness(1.08); background: var(--accent); }
.ctl-toggle { width: auto; padding: 0 12px; font-family: var(--display); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.ctl-toggle.active { color: var(--ct); border-color: var(--ct); background: var(--ct-soft); }

.timeline { position: relative; flex: 1; height: 38px; display: flex; align-items: center; }
.timeline .tl-fill { position: absolute; left: 0; height: 4px; background: var(--t); pointer-events: none; z-index: 1; }
.tl-markers { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
/* event icons: T above the centerline, CT below, colored by side */
.tl-mark { position: absolute; transform: translateX(-50%); display: flex; line-height: 0; }
.tl-mark.above { bottom: calc(50% + 3px); }
.tl-mark.below { top: calc(50% + 3px); }
.tl-mark.t { color: var(--t); }
.tl-mark.ct { color: var(--ct); }
.tl-mark .tl-ic-mask { display: block; width: 16px; height: 16px; background: currentColor; }
.tl-mark .wic, .tl-mark .wic-svg { filter: none; opacity: 1; color: inherit; }
.tl-mark .wic-svg svg { width: 16px; height: 16px; }
#tlRange { -webkit-appearance: none; appearance: none; width: 100%; height: 38px; background: transparent; position: relative; z-index: 3; cursor: pointer; }
#tlRange::-webkit-slider-runnable-track { height: 4px; background: var(--panel-3); }
#tlRange::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 4px; height: 18px; background: var(--text); margin-top: -7px; box-shadow: 0 0 0 1px var(--bg-2); cursor: grab; }
.clock { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--text-dim); min-width: 44px; text-align: center; }
/* Speed control is a compact dropdown to save bar space; height matches the .ctl toggles beside it. */
.speed-sel {
  height: 38px; padding: 0 26px 0 11px; border: 1px solid var(--border-2); background: var(--panel-2);
  color: var(--text); font-family: var(--mono); font-size: 12px; font-weight: 600; cursor: pointer;
  border-radius: var(--radius); flex-shrink: 0; -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238b96a8' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
  transition: background-color var(--tf), border-color var(--tf);
}
.speed-sel:hover { background-color: var(--panel-3); }
.speed-sel:focus-visible { outline: none; border-color: var(--ct); }
.speed-sel option { background: var(--panel-2); color: var(--text); }

/* segmented speed buttons (still used by the Anti-Strat replay controls) */
.speed { display: flex; gap: 2px; background: var(--panel); border-radius: var(--radius); padding: 3px; border: 1px solid var(--border); }
.speed-btn { font-family: var(--mono); font-size: 11px; font-weight: 600; padding: 5px 8px; border: none; background: transparent; color: var(--muted); border-radius: var(--radius-sm); cursor: pointer; transition: background var(--tf), color var(--tf); }
.speed-btn:hover { color: var(--text); }
.speed-btn.active { background: var(--ct-dk); color: oklch(0.98 0.01 250); }

/* ---------------- Scoreboard ---------------- */
.view-scoreboard, .view-rounds { overflow-y: auto; }
.scoreboard-inner, .rounds-inner { max-width: 1200px; margin: 0 auto; padding: 26px 26px 60px; }
.sb-team { margin-bottom: 24px; }
.sb-team-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.sb-team-head .dot { width: 12px; height: 12px; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.sb-team-head h2 { font-family: var(--display); font-size: 18px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.sb-team-head .tscore { margin-left: auto; font-family: var(--mono); font-size: 22px; font-weight: 700; }
.sb-table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); overflow: hidden; }
.sb-table th, .sb-table td { padding: 11px 12px; text-align: right; font-family: var(--mono); font-size: 13px; }
.sb-table th { font-family: var(--display); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border-2); cursor: pointer; user-select: none; }
.sb-table th:first-child, .sb-table td:first-child { text-align: left; }
.sb-table tbody tr { border-bottom: 1px solid var(--border); transition: background var(--tf); }
.sb-table tbody tr:last-child { border-bottom: none; }
.sb-table tbody tr:hover { background: var(--panel-2); }
.sb-player { display: flex; align-items: center; gap: 9px; font-family: var(--sans); font-weight: 600; }
.sb-rating { font-weight: 700; }
.rating-hi { color: var(--green); } .rating-lo { color: var(--red); }
.sb-table td.pos { color: var(--text); } .sb-table td.neg { color: var(--red); }

.team-compare { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 24px 0; background: var(--panel); border: 1px solid var(--border); padding: 18px 20px; }
.tc-row { display: grid; grid-template-columns: 60px 1fr 60px; align-items: center; gap: 12px; }
.tc-row .lbl { text-align: center; font-family: var(--display); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); grid-column: 2; }
.tc-bar { display: flex; height: 22px; overflow: hidden; background: var(--panel-3); }
.tc-bar .a { background: var(--ct); } .tc-bar .b { background: var(--t); }
.tc-val { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.tc-val.a { color: var(--ct); text-align: right; } .tc-val.b { color: var(--t); }

/* ---------------- Rounds view ---------------- */
.rounds-inner h1, .scoreboard-inner > h1, .analytics-inner > h1 { font-family: var(--display); font-size: 22px; margin-bottom: 18px; text-transform: uppercase; letter-spacing: .4px; }
.round-tl { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; }
.rt-cell { width: 42px; height: 56px; border: 1px solid var(--border); background: var(--panel); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; transition: transform .1s var(--ease), border-color var(--tf); }
.rt-cell:hover { transform: translateY(-2px); border-color: var(--border-2); }
.rt-cell.a { box-shadow: inset 0 -3px 0 var(--ct); } .rt-cell.b { box-shadow: inset 0 -3px 0 var(--t); }
.rt-num { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.rt-icon { display: inline-flex; align-items: center; justify-content: center; height: 18px; }
.rt-icon .wic { height: 17px; max-width: 52px; opacity: .92; }
.rt-icon .wic-svg { color: var(--text); opacity: .92; }
.rt-icon .wic-svg svg { height: 16px; width: 16px; }
.rt-ico { width: 18px; height: 18px; }
.round-list { display: flex; flex-direction: column; gap: 6px; }
.round-line { display: grid; grid-template-columns: 50px 90px 1fr 120px; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--border); padding: 11px 16px; cursor: pointer; transition: border-color var(--tf), background var(--tf), transform var(--tf) var(--ease); }
.round-line:hover { border-color: var(--ct); background: var(--panel-2); transform: translateX(2px); }
.rl-num { font-family: var(--mono); font-weight: 700; font-size: 15px; }
.rl-score { font-family: var(--mono); font-size: 14px; }
.rl-score .a { color: var(--ct); } .rl-score .b { color: var(--t); }
.rl-reason { color: var(--text-dim); font-size: 13px; }
.rl-win { font-family: var(--display); font-weight: 700; font-size: 12px; text-align: right; text-transform: uppercase; letter-spacing: .5px; }
.rl-win.a { color: var(--ct); } .rl-win.b { color: var(--t); }

/* ---------------- Overlay ---------------- */
.overlay { position: fixed; inset: 0; background: oklch(0.10 0.01 248 / .82); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; z-index: 100; }
.overlay[hidden] { display: none; }
.overlay-card { background: var(--panel); border: 1px solid var(--border-2); padding: 34px 40px; text-align: center; width: 380px; box-shadow: var(--shadow); clip-path: var(--chamfer-2); animation: rise var(--tm) var(--ease); }
.overlay-card h3 { font-family: var(--display); margin: 16px 0 4px; font-size: 17px; text-transform: uppercase; letter-spacing: .5px; }
.overlay-card .progress { margin-top: 18px; }
.spinner { width: 40px; height: 40px; border: 2px solid var(--panel-3); border-top-color: var(--t); border-radius: 50%; margin: 0 auto; animation: spin 0.8s linear infinite; }

/* ============================================================
   Primary nav, folders, dashboard, analytics
   ============================================================ */
.primary-nav { display: flex; gap: 3px; background: var(--panel); padding: 3px; border-radius: var(--radius); border: 1px solid var(--border); }
.primary-nav .tab { display: inline-flex; align-items: center; gap: 7px; }
.primary-nav .tab svg { opacity: .8; }
.primary-nav .tab.active svg { opacity: 1; }

/* global folder-scope switcher (topbar) */
.scope-pick { position: relative; margin-left: auto; }
.scope-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px;
  background: var(--panel-2); border: 1px solid var(--border-2); color: var(--text-dim);
  font-family: var(--display); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  cursor: pointer; clip-path: var(--chamfer); max-width: 240px;
  transition: background var(--tf), color var(--tf), border-color var(--tf);
}
.scope-chip:hover { color: var(--text); border-color: var(--ct); }
.scope-chip.scoped { background: var(--t); color: var(--accent-ink); border-color: transparent; }
.scope-ic, .scope-chev { display: inline-flex; flex-shrink: 0; }
.scope-chev { opacity: .65; }
.scope-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scope-count { font-family: var(--mono); font-size: 11px; font-weight: 500; padding: 1px 6px; border-radius: 2px;
  background: color-mix(in oklch, currentColor 16%, transparent); }
.scope-menu { position: absolute; top: calc(100% + 7px); right: 0; min-width: 210px; max-height: 60vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border-2); box-shadow: var(--shadow); z-index: 60; padding: 5px; animation: rise var(--ts) var(--ease); }
.scope-item { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 8px 10px;
  background: transparent; border: none; color: var(--text-dim); font-size: 13px; cursor: pointer; transition: background var(--tf), color var(--tf); }
.scope-item:hover { background: var(--panel-2); color: var(--text); }
.scope-item.active { color: var(--t); }
.scope-item.active .si-count { color: var(--t); }
.si-ic { width: 15px; display: inline-flex; color: var(--muted); flex-shrink: 0; }
.si-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.si-count { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.scope-empty { padding: 8px 10px; color: var(--muted); font-size: 12px; line-height: 1.5; max-width: 200px; }

/* ---- Library + folder rail ---- */
.view-library { display: flex; }
.folder-rail { width: 208px; flex-shrink: 0; border-right: 1px solid var(--border); background: var(--bg-2); padding: 16px 10px; overflow-y: auto; }
.fr-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 8px; }
.fr-head span { font-family: var(--display); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); }
.fr-add { width: 24px; height: 24px; border-radius: var(--radius); border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text-dim); cursor: pointer; font-size: 15px; line-height: 1; display: flex; align-items: center; justify-content: center; transition: background var(--tf), color var(--tf); }
.fr-add:hover { background: var(--panel-3); color: var(--text); }
.folder-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--radius); cursor: pointer; font-size: 13px; color: var(--text-dim); transition: background var(--tf), color var(--tf); position: relative; border: 1px solid transparent; }
.folder-item:hover { background: var(--panel-2); color: var(--text); }
.folder-item.active { background: var(--panel-2); color: var(--text); border-color: var(--border-2); }
.folder-item.active::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; background: var(--t); }
.folder-item.droptarget { background: var(--t-soft); border-color: var(--t); }
.folder-item .fi-count { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.folder-item .fi-del { opacity: 0; font-size: 13px; color: var(--muted); padding: 0 2px; }
.folder-item:hover .fi-del { opacity: 1; }
.folder-item .fi-del:hover { color: var(--red); }
.view-library .library-inner { flex: 1; overflow-y: auto; max-width: none; }
.demo-card { cursor: grab; }

/* ---- Shared analytics primitives ---- */
.seg { display: inline-flex; gap: 2px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 3px; }
.seg button { font-family: var(--display); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 6px 14px; border: none; background: transparent; border-radius: var(--radius-sm); cursor: pointer; transition: background var(--tf), color var(--tf); }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--ct-dk); color: oklch(0.98 0.01 250); clip-path: var(--chamfer); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat-card { background: var(--panel); border: 1px solid var(--border); padding: 14px 16px; position: relative; clip-path: var(--chamfer-2); transition: border-color var(--tm), transform var(--tf) var(--ease); }
.stat-card:hover { border-color: var(--border-2); transform: translateY(-2px); }
.stat-card .sc-label { font-family: var(--display); font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 600; }
.stat-card .sc-value { font-family: var(--mono); font-size: 26px; font-weight: 700; margin-top: 4px; letter-spacing: -.5px; }
.stat-card .sc-sub { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.sc-value.good { color: var(--green); } .sc-value.bad { color: var(--red); } .sc-value.hl { color: var(--t); }

.a-grid { display: grid; gap: 14px; margin-bottom: 16px; }
.a-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.a-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 1100px) { .a-grid.cols-2, .a-grid.cols-3 { grid-template-columns: 1fr; } }
.a-panel { background: var(--panel); border: 1px solid var(--border); padding: 15px 17px; position: relative; }
.a-panel > h3 { font-family: var(--display); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); margin-bottom: 13px; display: flex; align-items: center; justify-content: space-between; padding-left: 11px; }
.a-panel > h3::before { content: ''; position: absolute; left: 0; top: 1px; width: 3px; height: 13px; background: var(--t); clip-path: polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%); }
.a-panel > h3 .h-note { font-family: var(--mono); font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); font-size: 11px; }

/* heatmap controls — styled map dropdown + CT/T toggle in the panel header */
.heat-controls { display: flex; align-items: center; gap: 8px; }
.heat-mapsel { font-family: var(--sans); font-size: 12px; background: var(--panel-2); border: 1px solid var(--border-2); color: var(--text); border-radius: var(--radius); padding: 5px 26px 5px 10px; cursor: pointer; text-transform: none; letter-spacing: 0; font-weight: 500;
  appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%237b8499' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>"); background-repeat: no-repeat; background-position: right 9px center; }
.heat-mapsel:hover { border-color: var(--ct); }
.heatside-seg { padding: 2px; }
.heatside-seg button { padding: 5px 11px; font-size: 11px; }
.heatside-seg .hs-CT.active { background: var(--ct); color: oklch(0.16 0.03 250); }
.heatside-seg .hs-T.active { background: var(--t); color: var(--accent-ink); }

.bar-row { display: grid; grid-template-columns: 112px 1fr 54px; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.bar-row .bl { color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 16px; background: var(--panel-3); overflow: hidden; }
.bar-fill { height: 100%; background: var(--ct); transition: width var(--ts) var(--ease); transform-origin: left; }
.bar-fill.t { background: var(--t); }
.bar-fill.win { background: var(--green); }
.bar-fill.warn { background: var(--t); }
.bar-val { text-align: right; font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--text); }

.kv-list { display: flex; flex-direction: column; gap: 0; }
.kv { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--text-dim); } .kv .v { font-family: var(--mono); font-weight: 600; }

/* heatmap */
.heat-wrap { position: relative; width: 100%; max-width: 460px; margin: 0 auto; aspect-ratio: 1; }
.heat-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; border: 1px solid var(--border-2); }
.heat-legend { display: flex; gap: 14px; justify-content: center; margin-top: 10px; font-size: 12px; color: var(--text-dim); }
.heat-legend i { display: inline-block; width: 9px; height: 9px; margin-right: 5px; vertical-align: middle; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }

/* zone good/bad chips */
.zone-list { display: flex; flex-direction: column; gap: 5px; }
.zone-row { display: flex; gap: 9px; align-items: center; padding: 7px 10px; background: var(--panel-2); font-size: 13px; }
.zone-row .z-name { font-weight: 600; }
.zone-row .z-map { font-family: var(--display); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--border-2); padding: 1px 5px; border-radius: var(--radius-sm); white-space: nowrap; }
.zone-row .z-kd { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-left: auto; }
.zone-row .z-diff { font-family: var(--mono); font-weight: 700; width: 36px; text-align: right; }
.z-diff.pos { color: var(--green); } .z-diff.neg { color: var(--red); }

/* dashboard header */
.dash-inner, .analytics-inner { max-width: 1280px; margin: 0 auto; padding: 24px 26px 70px; overflow-y: auto; height: 100%; }
.dash-head { display: flex; align-items: center; gap: 16px; margin-bottom: 6px; flex-wrap: wrap; }
.dash-head h1 { font-family: var(--display); font-size: 24px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.dash-sub { color: var(--muted); margin-bottom: 18px; }
.player-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.player-pick input, .player-pick select { font-family: var(--sans); font-size: 13px; background: var(--panel-2); border: 1px solid var(--border-2); color: var(--text); border-radius: var(--radius); padding: 8px 12px; transition: border-color var(--tf); }
.player-pick select { appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer; max-width: 280px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%237b8499' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; }
.player-pick input { width: 200px; }
.player-pick input::placeholder { color: var(--muted); }
.player-pick input:hover, .player-pick select:hover { border-color: var(--ct); }
.player-pick input:focus, .player-pick select:focus { border-color: var(--ct); outline: none; }
.tracked-banner { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--border); padding: 13px 16px; margin-bottom: 20px; clip-path: var(--chamfer-2); }
.tracked-banner .tb-name { font-family: var(--display); font-weight: 700; font-size: 16px; text-transform: uppercase; }
.tracked-banner .tb-meta { color: var(--muted); font-size: 13px; }

.a-section-title { font-family: var(--display); font-size: 14px; font-weight: 700; margin: 24px 0 12px; display: flex; align-items: center; gap: 9px; text-transform: uppercase; letter-spacing: .6px; }
.a-section-title svg { color: var(--t); }
.entity-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; transition: background var(--tf), transform var(--tf) var(--ease); border-radius: var(--radius); }
.entity-row:hover { background: var(--panel-2); transform: translateX(2px); }
.entity-row .er-rank { font-family: var(--mono); color: var(--muted); width: 22px; }
.entity-row .er-name { font-weight: 600; flex: 1; }
.entity-row .er-stat { font-family: var(--mono); font-size: 12.5px; color: var(--text-dim); }
.empty-dash { text-align: center; padding: 80px 20px; color: var(--muted); }

/* ============================================================
   ANTI-STRAT
   ============================================================ */
/* no wrapper padding — the sidebar sits flush to the page edges like the 2D-replay .match-sidebar;
   the main column carries its own breathing room (see .as2-main) */
.antistrat-inner { max-width: none; margin: 0; padding: 0; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.antistrat-inner > .dash-head { flex: 0 0 auto; }
.antistrat-inner > .dash-sub { flex: 0 0 auto; margin-bottom: 14px; }

/* command-deck: radar pinned left, setup + intel tabs in a self-scrolling right rail */
.as-deck { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(440px, 1fr) minmax(384px, 452px); gap: 18px; }
.as-radar-col { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.as-rail { display: flex; flex-direction: column; min-height: 0; gap: 10px; }
.as-rail > .as-setupboard { flex: 0 1 auto; min-height: 132px; max-height: 44%; overflow-y: auto; padding-right: 2px; }
.as-rail > .as-layers { flex: 0 0 auto; margin-top: 0; }
.as-rail > .as-subnav { flex: 0 0 auto; }
.as-panescroll { flex: 1 1 auto; min-height: 180px; overflow-y: auto; padding-right: 4px; padding-bottom: 12px; }
.as-setup { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.as-setup .as-layers { margin-top: 0; }
/* legacy fallbacks (stacked) for very narrow widths */
@media (max-width: 1080px) {
  .antistrat-inner { overflow-y: auto; display: block; padding: 12px; }
  .as-deck { display: block; }
  .as-panescroll { overflow: visible; }
}

/* sub-tab navigation that swaps the lower intel in place (kills scrolling) */
.as-subnav { display: flex; gap: 3px; margin: 0; background: var(--panel); border: 1px solid var(--border); padding: 4px; clip-path: var(--chamfer-2); }
.as-subtab { font-family: var(--display); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); background: transparent; border: none; padding: 8px 16px; cursor: pointer; transition: background var(--tf), color var(--tf); border-radius: var(--radius-sm); display: inline-flex; align-items: center; gap: 7px; }
.as-subtab:hover { color: var(--text); background: var(--panel-2); }
.as-subtab.active { background: var(--ct-dk); color: oklch(0.98 0.01 250); clip-path: var(--chamfer); }
.as-subtab .as-subtab-n { font-family: var(--mono); font-size: 11px; opacity: .7; }
.as-tabpane { animation: rise var(--tm) var(--ease); }
.as-tabpane[hidden] { display: none; }
.as-playbook-row { } /* playbook lives inside a pane now */
.as-sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 720px) { .as-sections { grid-template-columns: 1fr; } }
.as-intel { display: flex; flex-direction: column; gap: 14px; }
.as-intel .a-panel,
.as-setup .a-panel,
.as-sections .a-panel,
.as-playbook-row .a-panel,
.as-radar-col #asTimingWrap .a-panel { padding: 14px 16px; }

.as-stage { background: var(--panel); border: 1px solid var(--border); padding: 12px; position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.as-stage::before, .as-stage::after { content: ''; position: absolute; width: 16px; height: 16px; pointer-events: none; z-index: 2; }
.as-stage::before { top: 8px; left: 8px; border-top: 2px solid var(--t); border-left: 2px solid var(--t); }
.as-stage::after { bottom: 8px; right: 8px; border-bottom: 2px solid var(--t); border-right: 2px solid var(--t); }
.as-canvas { width: auto; height: auto; max-width: min(760px, 100%); max-height: 100%; aspect-ratio: 1 / 1; display: block; background: oklch(0.10 0.008 248); cursor: crosshair; }
.as-areabar { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 10px; border-top: 1px solid var(--border); }
.as-areabar-lbl { font-size: 11.5px; color: var(--muted); }
.as-areabar .as-evclear { opacity: 1; }   /* keep Clear fully visible even though it has no .on state */
.as-areabar-count { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--accent-ink); background: var(--t); padding: 2px 8px; clip-path: var(--chamfer); }
.as-evchip { font-size: 11.5px; font-weight: 600; color: var(--text-dim); background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 9px; cursor: pointer; transition: background var(--tf), color var(--tf), border-color var(--tf); }
.as-evchip:hover { color: var(--text); border-color: var(--border-2); }
.as-evchip.active { background: var(--t); color: var(--accent-ink); border-color: transparent; }
.as-areasel { font-size: 11.5px; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 9px; cursor: pointer; }
.as-areasel:hover, .as-areasel:focus { border-color: var(--ct); outline: none; }
.as-areatime { width: 48px; font-family: var(--mono); font-size: 11px; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 7px; }
.as-areatime:focus { border-color: var(--ct); outline: none; }
.as-evclear { color: var(--muted); }
.as-evclear:hover { color: var(--red); border-color: var(--red); }

/* movement timeline */
.rot-lane { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 8px; margin-bottom: 6px; }
.rot-name { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rot-dot { width: 9px; height: 9px; flex-shrink: 0; clip-path: polygon(50% 0,100% 50%,50% 100%,0 50%); }
.rot-track { display: flex; height: 22px; overflow: hidden; background: var(--panel-3); border: 1px solid var(--border); }
.rot-seg { display: flex; align-items: center; min-width: 0; transition: filter var(--tf); }
.rot-seg:hover { filter: brightness(1.4); }
.rot-seg-btn { cursor: pointer; }
.rot-seg-btn:hover { filter: brightness(1.6); }
.rot-seg-btn:active { filter: brightness(2); }
.rot-seg-z { font-size: 9.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.rot-axis { display: flex; justify-content: space-between; margin: 5px 0 0 84px; font-size: 9.5px; color: var(--muted); font-family: var(--mono); }

/* signature lineups */
.lu-row { display: flex; align-items: center; gap: 9px; padding: 7px 9px; cursor: pointer; border: 1px solid transparent; transition: background var(--tf), border-color var(--tf); }
.lu-row:hover { background: var(--panel-2); }
.lu-row.active { background: var(--panel-2); border-color: var(--t); }
.lu-dot { width: 10px; height: 10px; flex-shrink: 0; clip-path: polygon(50% 0,100% 50%,50% 100%,0 50%); }
.lu-name { width: 100%; font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: var(--radius); padding: 2px 5px; }
.lu-name:hover { border-color: var(--border); }
.lu-name:focus { background: var(--panel); border-color: var(--border-2); outline: none; }
.lu-sub { font-size: 11px; color: var(--muted); padding: 0 5px; margin-top: 1px; }
.lu-count { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--text-dim); flex-shrink: 0; }
.lu-buckets { padding: 2px 6px 10px 24px; }

.as-layers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.as-layer { display: inline-flex; align-items: center; gap: 6px; font-family: var(--display); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 11px; cursor: pointer; transition: background var(--tf), color var(--tf), border-color var(--tf), opacity var(--tf); }
.as-layer i { width: 8px; height: 8px; clip-path: polygon(50% 0,100% 50%,50% 100%,0 50%); }
.as-layer.on { color: var(--text); border-color: var(--border-2); background: var(--panel-3); }
.as-layer:not(.on) { opacity: .5; }

.as-strat { display: flex; align-items: center; gap: 10px; padding: 9px 11px; cursor: pointer; transition: background var(--tf), border-color var(--tf); border: 1px solid transparent; }
.as-strat:hover { background: var(--panel-2); }
.as-strat.active { background: var(--panel-2); border-color: var(--t); }
.ss-label { font-weight: 600; font-size: 13px; }
.ss-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.ss-count { margin-left: auto; font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--text-dim); white-space: nowrap; }
.panel-sub { font-family: var(--display); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 600; margin: 4px 0 8px; }
.awp-tag { font-family: var(--display); font-size: 9px; font-weight: 700; letter-spacing: .5px; background: var(--green-soft); color: var(--green); padding: 2px 5px; }

/* anti-strat replay playbar */
.as-replaybar { margin-top: 12px; background: var(--panel); border: 1px solid var(--border); padding: 11px 13px; }
.as-transport { display: flex; align-items: center; gap: 11px; }
.as-range { -webkit-appearance: none; appearance: none; flex: 1; height: 30px; background: transparent; cursor: pointer; }
.as-range::-webkit-slider-runnable-track { height: 4px; background: var(--panel-3); }
.as-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 4px; height: 16px; background: var(--text); margin-top: -6px; box-shadow: 0 0 0 1px var(--bg); }
.as-players { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.as-pchip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text); background: var(--panel-2); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 5px 10px; cursor: pointer; transition: opacity var(--tf); }
.as-pchip i { width: 9px; height: 9px; clip-path: polygon(50% 0,100% 50%,50% 100%,0 50%); }
.as-pchip.off { opacity: .42; text-decoration: line-through; }

/* game-plan playbook rows */
.as-plan { display: flex; align-items: flex-start; gap: 10px; padding: 10px 11px; cursor: pointer; transition: background var(--tf), border-color var(--tf); border: 1px solid transparent; }
.as-plan:hover { background: var(--panel-2); }
.as-plan.active { background: var(--panel-2); border-color: var(--t); }
.as-counter { font-size: 11.5px; color: var(--text-dim); margin-top: 6px; line-height: 1.4; }
.outcome-bar { display: flex; height: 5px; overflow: hidden; margin: 7px 0 2px; background: var(--panel-3); }
.ob-seg { display: block; min-width: 2px; }
.as-watch { width: 26px; height: 22px; border: 1px solid var(--border-2); background: var(--panel-2); color: var(--ct); font-size: 10px; cursor: pointer; padding: 0; transition: background var(--tf), color var(--tf), border-color var(--tf); }
.as-watch:hover { background: var(--t); color: var(--accent-ink); border-color: transparent; }
.timing-canvas { width: 100%; height: auto; display: block; border: 1px solid var(--border); margin-bottom: 8px; }
.buy-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 9px; }
.buy-chip { font-family: var(--display); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 10px; cursor: pointer; transition: background var(--tf), color var(--tf); }
.buy-chip:hover { color: var(--text); }
.buy-chip.active { background: var(--ct-dk); color: oklch(0.98 0.01 250); border-color: transparent; }
.tendency { display: flex; gap: 8px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.tendency:last-child { border-bottom: none; }
.tendency-buy { flex-shrink: 0; font-family: var(--display); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--accent-ink); background: var(--t); padding: 2px 7px; clip-path: var(--chamfer); }
.tendency-text { color: var(--text-dim); }
.tendency-text b { color: var(--text); }

/* team comparison rows (match analytics) */
.cmp-row { display: grid; grid-template-columns: 52px 1fr 52px; align-items: center; gap: 10px; margin-bottom: 11px; }
.cmp-mid { display: flex; flex-direction: column; gap: 4px; }
.cmp-label { text-align: center; font-size: 11px; color: var(--text-dim); letter-spacing: .2px; }
.cmp-val { font-family: var(--mono); font-size: 12.5px; font-weight: 600; }
.cmp-val.a { color: var(--ct); text-align: right; }
.cmp-val.b { color: var(--t); }

/* setup-board role cards */
.role-card { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border: 1px solid transparent; cursor: pointer; transition: background var(--tf), border-color var(--tf); }
.role-card:hover { background: var(--panel-2); }
.role-card.active { background: var(--panel-2); border-color: var(--t); }
.role-dot { flex-shrink: 0; width: 11px; height: 11px; margin-top: 3px; clip-path: polygon(50% 0,100% 50%,50% 100%,0 50%); }
.role-top { display: flex; align-items: center; gap: 8px; }
.role-name { font-size: 13px; font-weight: 600; color: var(--text); }
.role-badge { font-family: var(--display); font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; border: 1px solid; border-radius: var(--radius-sm); padding: 1px 6px; }
.role-zone { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.role-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.4; }

/* utility tells (if X -> Y) */
.tell-card { border: 1px solid var(--border-2); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 7px; background: var(--panel-2); position: relative; transition: border-color var(--tf); }
.tell-card:hover { border-color: var(--t); }
.tell-main { display: flex; align-items: center; gap: 8px; font-size: 13px; flex-wrap: wrap; }
.tell-cond { font-weight: 600; color: var(--text); }
.tell-arrow { color: var(--t); font-weight: 700; }
.tell-predict { font-weight: 700; color: var(--t); }
.tell-detail { font-size: 11.5px; color: var(--text-dim); }
.tell-meta { font-size: 11px; color: var(--muted); margin-top: 6px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tell-card-btn { cursor: pointer; }
.tell-card-btn:hover { border-color: var(--t); background: var(--panel-3); }
.tell-card-btn:active { transform: scale(.99); }

.recent-tag { font-family: var(--display); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--green); background: var(--green-soft); padding: 1px 5px; vertical-align: middle; }

.scout-btn { font-family: var(--display); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; background: var(--t); color: var(--accent-ink); border: none; padding: 8px 15px; cursor: pointer; transition: filter var(--tf); clip-path: var(--chamfer); }
.scout-btn:hover { filter: brightness(1.07); }

/* scout report — hidden on screen, isolated for print / printToPDF. Dark "Broadcast HUD" branding. */
#scoutReportPrint { display: none; }
@media print {
  body > *:not(#scoutReportPrint) { display: none !important; }
  body { background: var(--bg) !important; }
  #scoutReportPrint {
    display: block !important; position: static; background: var(--bg); color: var(--text-dim);
    font-family: var(--sans); font-size: 11.5px; line-height: 1.5;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  /* cover */
  #scoutReportPrint .sr-cover { border-bottom: 2px solid var(--border-2); padding-bottom: 16px; margin-bottom: 18px; }
  #scoutReportPrint .sr-cover-top { display: flex; align-items: center; gap: 14px; }
  #scoutReportPrint .sr-mark { display: inline-flex; color: var(--ct); }
  #scoutReportPrint .sr-mark svg { width: 40px; height: 40px; }
  #scoutReportPrint .sr-kicker { font-family: var(--display); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.8px; color: var(--muted); margin-bottom: 2px; }
  #scoutReportPrint .sr-title { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: .3px; color: var(--text); text-transform: uppercase; }
  #scoutReportPrint .sr-cover-map { font-family: var(--mono); font-size: 13px; color: var(--text-dim); margin: 9px 0 14px; letter-spacing: 1px; }
  #scoutReportPrint .sr-cover-stats { display: flex; gap: 12px; }
  #scoutReportPrint .sr-cstat { flex: 1; background: var(--panel); border: 1px solid var(--border); padding: 12px 14px; }
  #scoutReportPrint .sr-cstat-side { font-family: var(--display); font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--muted); }
  #scoutReportPrint .sr-cstat.ct .sr-cstat-side { color: var(--ct); }
  #scoutReportPrint .sr-cstat.t .sr-cstat-side { color: var(--t); }
  #scoutReportPrint .sr-cstat-val { font-family: var(--mono); font-size: 26px; font-weight: 700; color: var(--text); margin: 3px 0 1px; }
  #scoutReportPrint .sr-cstat-lbl { font-size: 10px; color: var(--muted); }
  /* section headers */
  #scoutReportPrint .sr-h1 { font-family: var(--display); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text); border-bottom: 1px solid var(--border-2); margin: 16px 0 10px; padding-bottom: 5px; }
  #scoutReportPrint .sr-side.ct .sr-h1 { border-color: var(--ct); }
  #scoutReportPrint .sr-side.t .sr-h1 { border-color: var(--t); }
  #scoutReportPrint .sr-sub2 { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin: -5px 0 12px; }
  /* game plan boxes */
  #scoutReportPrint .sr-plan-box { background: var(--panel); border: 1px solid var(--border); padding: 12px 15px; margin-bottom: 10px; }
  #scoutReportPrint .sr-plan-side { font-family: var(--display); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--t); margin-bottom: 7px; }
  #scoutReportPrint .sr-plan-list, #scoutReportPrint .sr-list { margin: 0 0 8px; padding-left: 18px; }
  #scoutReportPrint .sr-plan-list li { margin-bottom: 6px; font-size: 12px; line-height: 1.45; color: var(--text); }
  #scoutReportPrint .sr-block-h { font-family: var(--display); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 14px 0 6px; }
  #scoutReportPrint .sr-side { page-break-before: always; }
  #scoutReportPrint .sr-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; margin-bottom: 4px; }
  #scoutReportPrint .sr-radar { width: 300px; border: 1px solid var(--border); display: block; }
  #scoutReportPrint .sr-cap { font-size: 9.5px; color: var(--muted); margin-top: 5px; text-align: center; }
  #scoutReportPrint .sr-players { display: flex; flex-direction: column; gap: 5px; }
  #scoutReportPrint .sr-player { display: grid; grid-template-columns: 66px 1fr; align-items: baseline; gap: 9px; font-size: 12px; border-bottom: 1px solid var(--border); padding-bottom: 5px; }
  #scoutReportPrint .sr-prole { font-family: var(--display); font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--bg); background: var(--text-dim); padding: 2px 5px; text-align: center; }
  #scoutReportPrint .sr-pname { font-weight: 600; color: var(--text); }
  #scoutReportPrint .sr-pwhere { grid-column: 2; color: var(--muted); font-size: 11px; }
  #scoutReportPrint .sr-counter { color: var(--ct); }
  #scoutReportPrint .sr-list { font-size: 12px; }
  #scoutReportPrint .sr-list li { margin-bottom: 5px; line-height: 1.45; color: var(--text-dim); }
  #scoutReportPrint .sr-list b, #scoutReportPrint .sr-plan-list b { color: var(--text); }
  /* economy table */
  #scoutReportPrint .sr-econ { width: 100%; border-collapse: collapse; margin: 4px 0 8px; }
  #scoutReportPrint .sr-econ th { text-align: left; font-family: var(--display); font-size: 9px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 4px 8px; border-bottom: 1px solid var(--border-2); }
  #scoutReportPrint .sr-econ td { padding: 5px 8px; border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
  #scoutReportPrint .sr-foot { margin-top: 18px; font-size: 9px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 6px; font-family: var(--mono); letter-spacing: .3px; }
}

/* account / Steam sign-in (topbar) */
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.auth-area { position: relative; display: flex; align-items: center; }
.steam-btn { display: inline-flex; align-items: center; gap: 7px; }
.steam-btn .steam-ic { display: inline-flex; color: var(--ct); }
.steam-btn.loading { opacity: .6; pointer-events: none; }
.auth-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid var(--border-2); color: var(--text); border-radius: var(--radius); padding: 4px 12px 4px 4px; cursor: pointer; font-weight: 600; font-size: 13px; transition: background var(--tf), border-color var(--tf); }
.auth-chip:hover { background: var(--panel-3); border-color: var(--border-2); }
.auth-av { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.auth-av-ph { display: inline-flex; align-items: center; justify-content: center; background: var(--ct-dk); color: #fff; font-size: 12px; font-weight: 700; }
.auth-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-pro { font-family: var(--display); font-size: 9px; font-weight: 700; letter-spacing: .5px; color: var(--accent-ink); background: var(--t); padding: 2px 6px; }
.auth-menu { position: absolute; top: calc(100% + 6px); right: 0; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 5px; min-width: 140px; z-index: 50; box-shadow: var(--shadow); }
.auth-menu-item { width: 100%; text-align: left; background: transparent; border: none; color: var(--text); font-size: 13px; font-weight: 500; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.auth-menu-item:hover { background: var(--panel-3); }

/* map veto board (team dashboard) */
.veto-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.veto-table th { text-align: left; font-family: var(--display); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); padding: 4px 10px; border-bottom: 1px solid var(--border-2); }
.veto-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); }
.veto-map { font-family: var(--display); font-weight: 700; text-transform: uppercase; }
.veto-dim { color: var(--text-dim); font-family: var(--mono); font-size: 12px; }
.veto-win { display: flex; align-items: center; gap: 9px; min-width: 150px; }
.veto-winbar { flex: 1; height: 6px; background: var(--panel-3); overflow: hidden; }
.veto-winbar i { display: block; height: 100%; }
.veto-win b { font-family: var(--mono); font-size: 12px; min-width: 34px; }
.veto-tag { font-family: var(--display); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; padding: 3px 8px; color: var(--muted); background: var(--panel-3); }
.veto-tag.ban { color: var(--red); background: var(--red-soft); }
.veto-tag.target { color: var(--green); background: var(--green-soft); }

/* skill profile (player dashboard) */
.skill-wrap { display: grid; grid-template-columns: 230px 1fr; gap: 22px; align-items: center; }
@media (max-width: 760px) { .skill-wrap { grid-template-columns: 1fr; } }
.spider { display: flex; justify-content: center; }
.skill-bars { display: flex; flex-direction: column; gap: 9px; }

/* Pro paywall (Anti-Strat) */
.paywall-wrap { display: flex; justify-content: center; padding: 48px 20px; }
.paywall { width: 100%; max-width: 460px; background: var(--panel); border: 1px solid var(--border-2); padding: 32px 30px; text-align: center; clip-path: var(--chamfer-2); }
.paywall-badge { display: inline-block; font-family: var(--display); font-size: 11px; font-weight: 700; letter-spacing: 1.4px; color: var(--accent-ink); background: var(--t); padding: 3px 11px; margin-bottom: 14px; clip-path: var(--chamfer); }
.paywall h1 { font-family: var(--display); font-size: 22px; font-weight: 700; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
.paywall-sub { color: var(--text-dim); font-size: 14px; margin-bottom: 20px; }
.paywall-list { list-style: none; text-align: left; margin: 0 auto 22px; max-width: 320px; display: flex; flex-direction: column; gap: 9px; }
.paywall-list li { font-size: 13px; color: var(--text); padding-left: 26px; position: relative; }
.paywall-list li::before { content: ''; position: absolute; left: 4px; top: 6px; width: 9px; height: 5px; border-left: 2px solid var(--t); border-bottom: 2px solid var(--t); transform: rotate(-45deg); }
.paywall-price { font-family: var(--mono); font-size: 26px; font-weight: 700; margin-bottom: 18px; }
.paywall-cta { width: 100%; justify-content: center; font-size: 15px; padding: 12px; }
.paywall-note { color: var(--muted); font-size: 13px; margin-top: 6px; }
.paywall-cfg { color: var(--t); font-size: 12px; margin-top: 12px; line-height: 1.5; }

/* ============================================================
   MOTION — entrance choreography + micro-interactions
   ============================================================ */
/* Hero: staggered "boot-up" reveal of primary content on each view/tab load */
:where(.demo-grid, .stat-grid, .a-grid, .as-sections) > *,
:where(.dash-inner, .analytics-inner) .entity-row { animation: rise var(--tm) var(--ease) both; }
:where(.demo-grid, .stat-grid, .a-grid, .as-sections) > *:nth-child(1) { animation-delay: .03s; }
:where(.demo-grid, .stat-grid, .a-grid, .as-sections) > *:nth-child(2) { animation-delay: .07s; }
:where(.demo-grid, .stat-grid, .a-grid, .as-sections) > *:nth-child(3) { animation-delay: .11s; }
:where(.demo-grid, .stat-grid, .a-grid, .as-sections) > *:nth-child(4) { animation-delay: .15s; }
:where(.demo-grid, .stat-grid, .a-grid, .as-sections) > *:nth-child(5) { animation-delay: .19s; }
:where(.demo-grid, .stat-grid, .a-grid, .as-sections) > *:nth-child(6) { animation-delay: .23s; }
:where(.demo-grid, .stat-grid, .a-grid, .as-sections) > *:nth-child(n+7) { animation-delay: .27s; }

/* Data reveal: bars wipe in from their origin once on render (width transition still handles live changes) */
.bar-fill, .veto-winbar i, .tc-bar > span, .outcome-bar .ob-seg, .ob-seg { animation: sweep var(--ts) var(--ease-expo) both; }

/* Press feedback (snappy, GPU-only) */
.btn:active, .ctl:active, .seg button:active, .tab:active, .as-subtab:active,
.buy-chip:active, .as-layer:active, .scout-btn:active, .round-chip:active, .as-pchip:active { transform: scale(.96); }
.btn-primary:hover, .scout-btn:hover { transform: translateY(-1px); }
.btn-primary:active, .scout-btn:active { transform: translateY(0) scale(.97); }

/* Live cue: the play control breathes while engaged */
.ctl-play:hover { transform: scale(1.05); }

/* ---------------- Highlights ---------------- */
.view-highlights { overflow: auto; }
.highlights-inner { max-width: 1100px; margin: 0 auto; padding: var(--space-2xl) var(--space-xl) var(--space-3xl); }
.hl-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-lg); margin-bottom: var(--space-xl); }
.hl-head h1 { font-size: 26px; }
.hl-head .muted { font-size: 13px; margin-top: 2px; }
.hl-pickwrap { display: flex; flex-direction: column; gap: 4px; }
.hl-pickwrap .lib-flabel { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.hl-picker { min-width: 240px; }

/* share card */
.hl-share { margin-bottom: var(--space-2xl); }
.hl-canvas { display: block; width: 100%; max-width: 720px; height: auto; border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); }
.hl-actions { display: flex; align-items: center; gap: var(--space-sm); margin-top: var(--space-md); }
.hl-note { font-size: 12px; }

/* reel */
.hl-reel { display: flex; flex-direction: column; gap: var(--space-sm); }
.hl-card { display: grid; grid-template-columns: 34px 1fr auto auto; align-items: center; gap: var(--space-lg);
  background: var(--panel); border: 1px solid var(--border); padding: 12px 16px;
  clip-path: var(--chamfer); transition: border-color var(--tf), transform var(--tf) var(--ease), background var(--tf); }
.hl-card:hover { border-color: var(--border-2); background: var(--panel-2); transform: translateX(2px); }
.hl-rank { font-family: var(--mono); font-size: 18px; font-weight: 700; color: var(--muted); text-align: center; }
.hl-card.ct .hl-rank { color: var(--ct); } .hl-card.t .hl-rank { color: var(--t); }
.hl-main { min-width: 0; }
.hl-titleline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hl-title { font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: .4px; text-transform: uppercase; }
.hl-tag { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .5px; color: var(--accent);
  background: var(--accent-soft); padding: 2px 6px; border-radius: var(--radius-xs); }
.hl-detail { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; }
.hl-meta { display: flex; align-items: center; gap: 12px; }
.hl-weapon { display: inline-flex; align-items: center; min-width: 44px; justify-content: flex-end; }
.hl-weapon .hl-wic { height: 16px; max-width: 52px; }
.hl-round { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--muted); min-width: 34px; text-align: right; }
.hl-watch { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; font-size: 12px; }
.hl-play { display: inline-flex; }
.hl-empty { background: var(--panel); border: 1px solid var(--border); padding: var(--space-2xl); text-align: center; clip-path: var(--chamfer); }
.hl-empty p { margin: 2px 0; }

/* ---------------- Settings dialog ---------------- */
.auth-menu-sep { height: 1px; background: var(--border); margin: 4px 0; }
.set-card { width: min(460px, 92vw); }
.set-acct { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md) 0; }
.set-av { width: 46px; height: 46px; border-radius: var(--radius); object-fit: cover; flex-shrink: 0; }
.set-av.auth-av-ph { display: inline-flex; align-items: center; justify-content: center; background: var(--panel-3);
  font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--text); }
.set-acct-info { min-width: 0; }
.set-name { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; font-size: 17px; }
.set-tier { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .5px; color: var(--muted);
  background: var(--panel-3); padding: 2px 6px; border-radius: var(--radius-xs); }
.set-id { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.set-id code { font-family: var(--mono); font-size: 12px; color: var(--text-dim); }
.set-copy { font-family: var(--sans); font-size: 11px; color: var(--muted); background: none; border: 1px solid var(--border);
  padding: 2px 7px; border-radius: var(--radius-xs); cursor: pointer; transition: border-color var(--tf), color var(--tf); }
.set-copy:hover { border-color: var(--border-2); color: var(--text); }
.set-keyrow { display: flex; gap: var(--space-sm); }
.set-keyrow .modal-input { flex: 1; }
.set-hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.set-sep { height: 1px; background: var(--border); margin: var(--space-md) 0; }
.set-sub { font-family: var(--display); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); margin-bottom: 6px; }
.set-privacy p { font-size: 12.5px; color: var(--text-dim); line-height: 1.55; margin-bottom: 6px; }
.set-actions { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.set-actions .btn-primary { margin-left: auto; }
.set-link { display: inline-block; margin-top: 8px; background: none; border: none; padding: 0; cursor: pointer;
  font-family: var(--sans); font-size: 12px; color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.set-link:hover { color: var(--text); }

/* CS2 match auto-grab settings */
.set-valve .modal-label { margin-top: 12px; }
.set-valve .modal-label:first-of-type { margin-top: 0; }
.set-valve-actions { margin-top: 10px; }
.set-valve-status { min-height: 16px; }
.set-valve-status .set-link { margin-top: 0; }
/* discovered share-code list */
.vm-card { width: min(520px, 92vw); display: flex; flex-direction: column; gap: 12px; }
.vm-list { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.vm-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.vm-n { flex: 0 0 auto; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.vm-code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm-copy { flex: 0 0 auto; padding: 3px 10px; }

/* first-run sign-in nudge */
.nudge-card { width: min(420px, 92vw); text-align: center; }
.nudge-ic { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin: 4px auto 10px;
  color: var(--primary); background: var(--ct-soft); border-radius: 50%; }
.nudge-ic svg { width: 24px; height: 24px; }
.nudge-card .modal-msg { margin-bottom: var(--space-lg); }
.nudge-card .modal-actions { justify-content: center; }
.nudge-go { display: inline-flex; align-items: center; gap: 7px; }

/* privacy policy */
.privacy-card { width: min(560px, 94vw); }
.privacy-body { max-height: 56vh; overflow-y: auto; padding: 4px 2px 2px; margin: 6px 0 var(--space-md); }
.privacy-body .set-sub { margin: var(--space-md) 0 4px; }
.privacy-body .set-sub:first-child { margin-top: 0; }
.privacy-body p { font-size: 13px; color: var(--text-dim); line-height: 1.6; }

/* ---------------- Dashboard combined side toggle ---------------- */
.side-region-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md);
  margin: var(--space-xl) 0 var(--space-md); }
.srh-toggle { display: flex; align-items: center; gap: 8px; }
.srh-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.side-toggle .hs-CT.active { color: var(--ct); }
.side-toggle .hs-T.active { color: var(--t); }
.side-fade { animation: sideFade .28s var(--ease) both; }
@keyframes sideFade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* My-best-moments "view all" */
.hl-viewall { width: 100%; margin-top: 10px; justify-content: center; gap: 6px; }
.hl-va-arrow { display: inline-flex; transition: transform var(--tf); }
.hl-viewall:hover .hl-va-arrow { transform: translateX(3px); }

/* ---------------- Highlights gallery page ---------------- */
.hl-page-head { display: flex; align-items: center; gap: var(--space-lg); margin-bottom: var(--space-xl); }
.hl-back { gap: 5px; }
.hl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.hl-gcard .dc-thumb { background: #0c1018; }
.hl-thumb-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hl-thumb-badge { position: absolute; left: 12px; top: 10px; z-index: 2; font-family: var(--display); font-weight: 700;
  font-size: 11px; letter-spacing: .6px; text-transform: uppercase; padding: 3px 8px; border-radius: var(--radius-xs);
  background: oklch(0.16 0.01 248 / .82); color: var(--text); }
.hl-thumb-badge.ct { color: var(--ct); } .hl-thumb-badge.t { color: var(--t); }
.hl-gcard .dc-actions .hl-share-btn { flex: 0 0 auto; width: 42px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px); z-index: 200;
  background: var(--panel-2); border: 1px solid var(--border-2); color: var(--text); font-size: 13px; font-weight: 500;
  padding: 10px 16px; border-radius: var(--radius); box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* ============================================================
   TACTICS BOARD
   ============================================================ */
.view-board { overflow: hidden; }
.board-inner { display: flex; flex-direction: column; height: 100%; min-height: 0; padding: var(--space-lg) var(--space-xl) var(--space-lg); gap: var(--space-md); animation: fade var(--tm) var(--ease); }

/* ---- toolbar ---- */
.board-toolbar { display: flex; align-items: center; gap: var(--space-md); flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px var(--space-md); }
.board-tb-group { display: flex; align-items: center; gap: 8px; }
.board-tb-label { font-family: var(--display); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.board-tb-sep { width: 1px; align-self: stretch; background: var(--border); margin: 2px 2px; }
.board-tb-spacer { flex: 1 1 auto; }
.board-map-sel { min-width: 120px; }

.board-tools { display: inline-flex; gap: 4px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 3px; }
.board-tool { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 30px;
  border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--text-dim);
  cursor: pointer; transition: background var(--tf), color var(--tf), border-color var(--tf); }
.board-tool svg { width: 18px; height: 18px; }
.board-tool:hover { background: var(--panel-2); color: var(--text); }
.board-tool.active { background: var(--ct-soft); border-color: oklch(0.685 0.092 245 / .45); color: var(--ct); }

.board-swatches { display: inline-flex; gap: 5px; }
.board-swatch { width: 22px; height: 22px; border-radius: 50%; background: var(--sw); border: 2px solid var(--border-2);
  cursor: pointer; padding: 0; transition: transform var(--tf), border-color var(--tf); }
.board-swatch:hover { transform: scale(1.12); }
.board-swatch.active { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--sw); }
.board-widths { display: inline-flex; gap: 3px; margin-left: 4px; }
.board-width { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 26px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); cursor: pointer; }
.board-width i { display: block; width: 16px; background: var(--text-dim); border-radius: 4px; }
.board-width:hover { border-color: var(--border-2); }
.board-width.active { border-color: var(--ct); }
.board-width.active i { background: var(--ct); }

.board-act { padding: 7px 11px; font-size: 12px; }
.board-act svg { opacity: .85; }
.board-act:disabled { opacity: .4; cursor: default; pointer-events: none; }

/* ---- main split ---- */
.board-main { display: flex; gap: var(--space-lg); flex: 1 1 auto; min-height: 0; }

/* ---- palette ---- */
.board-palette { width: 210px; flex: 0 0 210px; display: flex; flex-direction: column; gap: var(--space-lg);
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--space-md); overflow-y: auto; }
.bp-sec { display: flex; flex-direction: column; gap: 10px; }
.bp-title { font-family: var(--display); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--muted); padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.bp-row { display: flex; flex-direction: column; gap: 6px; }
.bp-rowlabel { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.bp-rowlabel.ct { color: var(--ct); } .bp-rowlabel.t { color: var(--t); }
.bp-chips { display: flex; flex-wrap: wrap; gap: 7px; }

.bp-chip { cursor: grab; padding: 0; border: none; background: none; touch-action: none; }
.bp-chip:active { cursor: grabbing; }
.bp-nades { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 10px; }

/* player add/remove control (replaces numbered chips) */
.bp-prow { gap: 7px; }
.bp-pctrl { display: flex; align-items: center; gap: 8px; }
.bp-pbtn { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text); border-radius: var(--radius);
  font-size: 18px; line-height: 1; cursor: pointer; transition: background var(--tf), color var(--tf), border-color var(--tf); }
.bp-pbtn:hover { background: var(--panel-3); border-color: var(--ct); }
.bp-pbtn:disabled { opacity: .4; cursor: default; }
.bp-pcount { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--text-dim); min-width: 32px; text-align: center; }
.bp-nadewrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bp-nadelabel { font-size: 10px; color: var(--muted); font-weight: 600; }
.bp-hint { font-size: 11px; line-height: 1.5; color: var(--muted); margin-top: auto; }

/* ---- token visuals (shared by palette chips, ghosts, board tokens) ---- */
.bt { display: inline-flex; align-items: center; justify-content: center; user-select: none; }
.bt-player { width: 30px; height: 30px; border-radius: 50%; border: 2px solid; font-family: var(--mono); font-weight: 700; font-size: 13px; }
.bt-player.ct { background: oklch(0.685 0.092 245 / .9); border-color: #cfe2ff; color: #08111f; }
.bt-player.t { background: oklch(0.802 0.135 79 / .92); border-color: #fff0cf; color: #211603; }
.bt-num { line-height: 1; }
.bt-nade { width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--panel-3); border: 1px solid var(--border-2); }
.bt-nade .bt-ic { width: 22px; height: 22px; }
.bt-bomb, .bt.bomb { width: 30px; height: 30px; border-radius: var(--radius-sm); background: var(--red); border: 2px solid #ffd0d0; }
.bt-c4 { font-family: var(--mono); font-weight: 700; font-size: 10px; color: #fff; letter-spacing: .5px; }
.bp-chip.bomb { margin-left: 2px; }

/* ---- stage ---- */
.board-stage-wrap { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px;
  background-image: radial-gradient(oklch(0.30 0.02 250 / .4) 1px, transparent 1px); background-size: 22px 22px; }
.board-stage { position: relative; border: 1px solid var(--border-2); border-radius: 2px; overflow: hidden;
  box-shadow: var(--shadow); background: #0a0e16; }
.board-map { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.board-canvas { position: absolute; inset: 0; z-index: 2; touch-action: none; }
.board-tokens { position: absolute; inset: 0; z-index: 3; }
.board-stage[data-tool="select"] .board-canvas { pointer-events: none; }
.board-stage.drawing .board-tokens { pointer-events: none; }
.board-stage[data-tool="brush"], .board-stage[data-tool="line"], .board-stage[data-tool="arrow"] { cursor: crosshair; }
.board-stage[data-tool="eraser"] { cursor: cell; }

/* tokens on the board */
.board-tokens .bt { position: absolute; transform: translate(-50%, -50%); cursor: grab;
  box-shadow: 0 2px 6px oklch(0.09 0.02 250 / .55); transition: box-shadow var(--tf); }
.board-stage[data-tool="select"] .board-tokens .bt:hover { box-shadow: 0 0 0 2px var(--text), 0 2px 8px oklch(0.09 0.02 250 / .6); }
.board-tokens .bt:active { cursor: grabbing; }
.board-tokens .bt.sel { box-shadow: 0 0 0 2px var(--accent), 0 2px 8px oklch(0.09 0.02 250 / .6); }

/* drag ghost follows the cursor */
.board-ghost { position: fixed; z-index: 300; transform: translate(-50%, -50%); pointer-events: none; opacity: .92;
  box-shadow: 0 4px 14px oklch(0.09 0.02 250 / .7); }

/* empty-state hint */
.board-hint { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center; padding: 24px; pointer-events: none; }
.board-hint strong { font-family: var(--display); font-size: 18px; letter-spacing: .5px; color: var(--text-dim); }
.board-hint span { font-size: 12px; color: var(--muted); max-width: 320px; line-height: 1.6; }

/* ============================================================
   FACEIT IMPORT
   ============================================================ */
.lib-add-actions { display: flex; align-items: center; gap: 10px; }
#faceitBtn svg { color: oklch(0.72 0.17 45); }            /* FACEIT orange accent */
#faceitBtn:hover { border-color: oklch(0.72 0.17 45 / .5); }

.fc-card { width: min(580px, 92vw); max-height: 82vh; display: flex; flex-direction: column; gap: var(--space-md); }
.fc-head { display: flex; align-items: flex-start; gap: 12px; }
.fc-mark { display: inline-flex; color: oklch(0.72 0.17 45); margin-top: 2px; }
.fc-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.fc-body { display: flex; flex-direction: column; gap: var(--space-md); min-height: 0; }
.fc-loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 0; }
.fc-loading .spinner { width: 30px; height: 30px; }
.fc-empty, .fc-error, .fc-up { font-size: 13px; color: var(--text-dim); line-height: 1.6; }
.fc-error { color: var(--red); }

.fc-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; max-height: 52vh; padding-right: 4px; }
.fc-row { display: grid; grid-template-columns: 70px 1fr auto auto; align-items: center; gap: 12px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; transition: opacity var(--tm); }
.fc-row.imported { opacity: .55; }
.fc-thumb { width: 70px; height: 44px; border-radius: var(--radius-sm); background: #0c1018 center/cover; position: relative; border: 1px solid var(--border); }
.fc-map { position: absolute; left: 4px; bottom: 3px; font-family: var(--display); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; padding: 1px 4px; border-radius: 2px; background: oklch(0.14 0.01 248 / .8); }
.fc-row-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.fc-teams { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-teams .vs { color: var(--muted); font-weight: 500; font-size: 11px; }
.fc-teams .mine { color: var(--accent); }
.fc-meta { display: flex; gap: 10px; font-size: 11px; }
.fc-comp { color: var(--text-dim); }
.fc-score { font-family: var(--mono); font-weight: 700; font-size: 14px; }
.fc-score .sa { color: var(--ct); } .fc-score .sb { color: var(--t); }
.fc-imp { padding: 6px 14px; font-size: 12px; min-width: 78px; justify-content: center; }
.fc-imp.ok { color: var(--green); border-color: oklch(0.77 0.15 152 / .4); }
.fc-imp.fail { color: var(--red); }
.fc-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 6px; border-top: 1px solid var(--border); }
.fc-actions-r { display: flex; gap: 8px; }
.fc-nick { display: flex; flex-direction: column; gap: 7px; }
.fc-nick-row { display: flex; gap: 8px; }
.fc-nick-row .modal-input { flex: 1; }

/* ============================================================
   NOTEPAD WIDGET
   ============================================================ */
/* Notepad launcher — same chamfered T-colored pill as the Chain Demos button, with a pencil + label */
.np-fab { position: fixed; right: 22px; bottom: 22px; z-index: 250; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 9px 15px; font-family: var(--display); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  background: var(--t); color: var(--accent-ink); border: 1px solid transparent; clip-path: var(--chamfer-2);
  box-shadow: 0 8px 22px oklch(0.09 0.02 250 / .55); transition: transform var(--tf), filter var(--tf); }
.np-fab svg { width: 16px; height: 16px; }
.np-fab:hover { transform: translateY(-2px); filter: brightness(1.07); }
.np-fab.active { background: var(--panel-2); color: var(--text); border-color: var(--border-2); }
.np-fab-dot { position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--ct); border: 2px solid var(--bg); }

.np-panel { position: fixed; right: 22px; bottom: 88px; z-index: 250; width: 384px; height: min(560px, calc(100vh - 130px));
  display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border-2); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; opacity: 0; transform: translateY(12px) scale(.98); pointer-events: none;
  transition: opacity var(--tm) var(--ease), transform var(--tm) var(--ease); }
.np-panel.open { opacity: 1; transform: none; pointer-events: auto; }

.np-head { display: flex; align-items: center; gap: 8px; padding: 9px 10px 9px 12px; border-bottom: 1px solid var(--border);
  background: linear-gradient(var(--panel-2), var(--panel)); }
.np-head-l { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.np-head-r { display: flex; gap: 4px; }
.np-kind { flex: 0 0 auto; font-family: var(--display); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px;
  padding: 3px 7px; border-radius: var(--radius-xs); background: var(--panel-3); color: var(--muted); }
.np-kind-demo { color: var(--ct); background: var(--ct-soft); }
.np-kind-team { color: var(--t); background: var(--t-soft); }
.np-kind-note { color: var(--text-dim); }
.np-title-input { flex: 1; min-width: 0; background: transparent; border: none; color: var(--text); font-family: var(--display);
  font-size: 14px; font-weight: 600; padding: 2px 4px; border-radius: 2px; }
.np-title-input:focus { outline: none; background: var(--bg-2); }
.np-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 26px; padding: 0;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--text-dim); cursor: pointer; transition: background var(--tf), color var(--tf); }
.np-icon-btn:hover { background: var(--panel-3); color: var(--text); }
.np-icon-btn.active { background: var(--ct-soft); color: var(--ct); }

.np-toolbar { display: flex; align-items: center; gap: 3px; padding: 6px 10px; border-bottom: 1px solid var(--border); background: var(--bg-2); }
.np-tool { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 26px; padding: 0;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--text-dim); cursor: pointer;
  font-family: var(--sans); font-size: 14px; transition: background var(--tf), color var(--tf); }
.np-tool:hover { background: var(--panel-3); color: var(--text); }
.np-tool.np-b { font-weight: 800; } .np-tool.np-i { font-style: italic; font-family: Georgia, serif; } .np-tool.np-u { text-decoration: underline; }
.np-tsep { width: 1px; height: 18px; background: var(--border); margin: 0 3px; }

.np-editor { flex: 1; overflow-y: auto; padding: 14px 16px; font-size: 13px; line-height: 1.65; color: var(--text); outline: none; user-select: text; }
.np-editor:empty::before { content: attr(data-ph); color: var(--muted); }
.np-editor h3 { font-family: var(--display); font-size: 15px; margin: 10px 0 4px; color: var(--text); }
.np-editor ul, .np-editor ol { margin: 6px 0 6px 22px; } .np-editor li { margin: 2px 0; }
.np-editor:focus { outline: none; }

.np-files { position: absolute; left: 0; right: 0; top: 86px; bottom: 0; z-index: 4; background: var(--panel); border-top: 1px solid var(--border);
  overflow-y: auto; padding: 8px; animation: fade var(--tf) var(--ease); }
.np-files-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 8px; }
.np-files-head span { font-family: var(--display); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.np-file-new { background: transparent; border: 1px solid var(--border-2); border-radius: var(--radius-sm); color: var(--accent); font-weight: 600; font-size: 12px; padding: 4px 9px; cursor: pointer; }
.np-file-new:hover { background: var(--accent-soft); }
.np-files-empty { font-size: 12px; color: var(--muted); padding: 14px 8px; line-height: 1.6; }
.np-file { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: transparent; border: 1px solid transparent;
  border-radius: var(--radius-sm); padding: 8px 9px; cursor: pointer; color: var(--text); transition: background var(--tf); }
.np-file:hover { background: var(--panel-2); }
.np-file.current { background: var(--panel-2); border-color: var(--border); }
.np-file-kind { flex: 0 0 auto; font-family: var(--display); font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; padding: 2px 5px; border-radius: 2px; background: var(--panel-3); color: var(--muted); }
.np-file-main { min-width: 0; flex: 1; }
.np-file-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-file-prev { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-file-del { flex: 0 0 auto; display: inline-flex; color: var(--muted); opacity: 0; padding: 3px; border-radius: 2px; transition: opacity var(--tf), color var(--tf), background var(--tf); }
.np-file:hover .np-file-del { opacity: 1; }
.np-file-del:hover { color: var(--red); background: var(--red-soft); }

/* round-aware notes: "Round N" insert button + round headings + outline panel */
.np-round-btn { margin-left: auto; display: inline-flex; align-items: center; height: 26px; padding: 0 10px; font-family: var(--display);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; background: var(--ct-soft); color: var(--ct);
  border: 1px solid var(--ct); border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; transition: filter var(--tf); }
.np-round-btn:hover { filter: brightness(1.12); }
.np-round-btn:disabled { opacity: .45; cursor: default; }
.np-editor h3.np-round { font-family: var(--mono); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: var(--ct); margin: 14px 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.np-editor h3.np-round:first-child { margin-top: 0; }

.np-outline { position: absolute; left: 0; right: 0; top: 86px; bottom: 0; z-index: 4; background: var(--panel); border-top: 1px solid var(--border);
  overflow-y: auto; padding: 8px; animation: fade var(--tf) var(--ease); }
.np-outline-item { display: block; width: 100%; text-align: left; background: transparent; border: 1px solid transparent;
  border-left: 2px solid var(--border-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 7px 10px; margin: 1px 0;
  cursor: pointer; color: var(--text-dim); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background var(--tf), color var(--tf); }
.np-outline-item:hover { background: var(--panel-2); color: var(--text); }
.np-outline-item.is-round { border-left-color: var(--ct); color: var(--text); font-weight: 600; }

/* ============================================================
   BOARD v2 — bigger palette, circle players, real utility markers, text, util colour
   ============================================================ */
.bp-chip { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  padding: 8px 10px; border: 1px solid transparent; border-radius: var(--radius); background: transparent; cursor: grab; touch-action: none; }
.bp-chip:hover { background: var(--panel-2); border-color: var(--border); }
.bp-chip:active { cursor: grabbing; }
.bp-chip-label { font-size: 11px; font-weight: 600; color: var(--text-dim); }
.bp-chips { gap: 8px; }
.bp-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bp-utilteam { display: flex; align-items: center; gap: 5px; }
.bp-ut-label { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.bp-ut-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-2); background: var(--utc); cursor: pointer; padding: 0; }
.bp-ut-dot.nat { background: repeating-conic-gradient(var(--muted) 0 25%, transparent 0 50%) 50%/7px 7px, var(--panel-3); }
.bp-ut-dot.active { border-color: var(--text); box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px var(--utc); }
.bp-nades { grid-template-columns: repeat(2, 1fr); gap: 10px 8px; }
.bp-nadewrap { display: flex; }
.bp-nadewrap .bp-chip { flex: 1; }

/* bigger radar-style player discs */
.bt-player { width: 36px; height: 36px; font-size: 15px; }
.bt-bomb, .bt.bomb { width: 34px; height: 34px; }
/* utility now renders as its real marker on a transparent canvas (no square chip) */
.bt-nade { width: auto; height: auto; background: none; border: none; }
.bt-nade-canvas { display: block; }
.board-tokens .bt-nade { box-shadow: none; }
.board-tokens .bt-nade:hover { box-shadow: none; }
.board-stage[data-tool="select"] .board-tokens .bt-nade:hover canvas { filter: drop-shadow(0 0 0 2px var(--text)); }
.board-tokens .bt-nade.sel canvas { filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 50%; }

/* text tokens */
.board-tokens .bt-text { box-shadow: none; }
.board-tokens .bt-text:hover { box-shadow: none; }
.bt-text { position: absolute; transform: translate(-50%, -50%); cursor: grab; }
.bt-text-in { font-family: var(--display); font-weight: 700; white-space: nowrap; padding: 2px 5px; outline: none;
  text-shadow: 0 1px 3px rgba(0,0,0,.75), 0 0 2px rgba(0,0,0,.6); }
.bt-text.sel .bt-text-in { box-shadow: 0 0 0 2px var(--accent); border-radius: 3px; }
.bt-text-in[contenteditable="true"] { cursor: text; background: oklch(0.10 0.01 248 / .6); border-radius: 3px; }

/* ============================================================
   CONTEXT MENU
   ============================================================ */
.ctx-menu { position: fixed; z-index: 400; min-width: 190px; background: var(--panel-2); border: 1px solid var(--border-2);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 5px; animation: fade .1s var(--ease); }
.ctx-item { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: transparent; border: none;
  color: var(--text); font-family: var(--sans); font-size: 13px; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.ctx-item:hover { background: var(--panel-3); }
.ctx-item.danger { color: var(--red); }
.ctx-item.danger:hover { background: var(--red-soft); }
.ctx-ic { display: inline-flex; color: var(--muted); }
.ctx-item.danger .ctx-ic { color: var(--red); }
.ctx-sep { height: 1px; background: var(--border); margin: 4px 4px; }

/* ============================================================
   NOTE EDITOR (semi-fullscreen)
   ============================================================ */
.ne-card { width: min(880px, 88vw); height: min(680px, 84vh); display: flex; flex-direction: column; padding: 0; overflow: hidden; gap: 0; }
.ne-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border); background: var(--panel-2); }
.ne-title { font-family: var(--display); font-size: 18px; }
.ne-title-input { flex: 1; background: transparent; border: none; color: var(--text); font-family: var(--display); font-size: 19px; font-weight: 600; padding: 4px 6px; border-radius: 2px; }
.ne-title-input:focus { outline: none; background: var(--bg-2); }
.ne-head-r { display: flex; align-items: center; gap: 10px; }
.ne-saved { font-size: 11px; color: var(--green); min-width: 34px; }
.ne-toolbar { display: flex; align-items: center; gap: 3px; padding: 8px 14px; border-bottom: 1px solid var(--border); background: var(--bg-2); }
.ne-tool { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 28px; padding: 0; background: transparent;
  border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--text-dim); cursor: pointer; font-size: 15px; }
.ne-tool:hover { background: var(--panel-3); color: var(--text); }
.ne-tool.ne-b { font-weight: 800; } .ne-tool.ne-i { font-style: italic; font-family: Georgia, serif; } .ne-tool.ne-u { text-decoration: underline; }
.ne-tsep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.ne-editor { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 14px; line-height: 1.7; color: var(--text); outline: none; user-select: text; }
.ne-editor:empty::before { content: attr(data-ph); color: var(--muted); }
.ne-editor h2 { font-family: var(--display); font-size: 19px; margin: 14px 0 6px; }
.ne-editor ul, .ne-editor ol { margin: 8px 0 8px 24px; } .ne-editor li { margin: 3px 0; }

/* ============================================================
   STRATBOOK
   ============================================================ */
.view-stratbook { overflow: hidden; }
.stratbook-inner { display: flex; height: 100%; min-height: 0; animation: fade var(--tm) var(--ease); }
.sb-rail { width: 204px; flex: 0 0 204px; border-right: 1px solid var(--border); padding: var(--space-lg) var(--space-md); overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.sb-rail-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 11px; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--text-dim); cursor: pointer; font-size: 13px; font-weight: 600; text-align: left; }
.sb-rail-item:hover { background: var(--panel-2); color: var(--text); }
.sb-rail-item.active { background: var(--ct-soft); color: var(--ct); border-color: oklch(0.685 0.092 245 / .4); }
.sb-rail-count { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.sb-main { flex: 1; min-width: 0; overflow-y: auto; padding: var(--space-xl); }
.sb-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: var(--space-xl); }
.sb-header h1 { font-family: var(--display); font-size: 26px; letter-spacing: .3px; }

.sb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.sb-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; transition: border-color var(--tf), transform .08s var(--ease); }
.sb-card:hover { border-color: var(--border-2); transform: translateY(-2px); }
.sb-card-thumb { height: 132px; background: #0c1018 center/cover no-repeat; position: relative; }
.sb-card-thumb.empty { display: flex; align-items: center; justify-content: center; color: var(--border-2); }
.sb-card-map { position: absolute; left: 8px; bottom: 7px; font-family: var(--display); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; padding: 2px 6px; border-radius: 2px; background: oklch(0.14 0.01 248 / .82); }
.sb-card-side { font-family: var(--display); font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 2px; }
.sb-card-side.ct { color: var(--ct); background: var(--ct-soft); } .sb-card-side.t { color: var(--t); background: var(--t-soft); }
.sb-card-thumb .sb-card-side { position: absolute; right: 8px; top: 7px; }
.sb-card-body { padding: 11px 12px; display: flex; flex-direction: column; gap: 7px; }
.sb-card-title { font-weight: 600; font-size: 14px; }
.sb-card-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.sb-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--text-dim); background: var(--panel-3); padding: 2px 7px; border-radius: 10px; }
.sb-chip.muted { color: var(--muted); }
.sb-chip-ic { display: inline-flex; } .sb-chip-ic svg { width: 13px; height: 13px; }
.sb-card-meta { font-size: 11px; }

.sb-empty { grid-column: 1 / -1; text-align: center; padding: 64px 20px; color: var(--muted); }
.sb-empty-mark { color: var(--border-2); margin-bottom: 14px; } .sb-empty-mark svg { width: 42px; height: 42px; }
.sb-empty h3 { font-family: var(--display); color: var(--text-dim); margin-bottom: 8px; }
.sb-empty p { max-width: 440px; margin: 0 auto; line-height: 1.6; font-size: 13px; }

/* ---- strat detail (one play on one map) ---- */
/* direct child of the flex .stratbook-inner — must claim the full width + own its scroll (like .sb-main) */
.sb-detail { flex: 1; min-width: 0; height: 100%; overflow-y: auto; padding: var(--space-xl); display: flex; flex-direction: column; gap: var(--space-xl); }

/* header band — carries the map's identity via its radar, faint behind the title */
.sb-dh { position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); padding: var(--space-lg) var(--space-xl) var(--space-xl); }
.sb-dh.has-radar::before { content: ''; position: absolute; inset: 0; background-image: var(--sb-radar); background-size: cover; background-position: center; opacity: .07; pointer-events: none; }
.sb-dh::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, oklch(0.199 0.014 249 / .55)); pointer-events: none; }
.sb-dh-bar, .sb-dh-body { position: relative; z-index: 1; }
.sb-dh-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: var(--space-lg); }
.sb-dh-actions { display: flex; gap: 8px; }
.sb-dh-del { width: 34px; padding: 0; }
.sb-dh-del svg { width: 15px; height: 15px; }
.sb-back { gap: 5px; }
.sb-d-title { display: block; width: 100%; background: transparent; border: none; border-bottom: 1px solid transparent; color: var(--text); font-family: var(--display); font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; letter-spacing: .2px; padding: 2px 2px 5px; }
.sb-d-title:focus { outline: none; border-bottom-color: var(--t); }
.sb-d-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sb-d-map { font-family: var(--display); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; padding: 3px 9px; border-radius: 2px; background: var(--accent-soft); color: var(--accent); }
.sb-d-count, .sb-d-when { font-size: 12px; color: var(--muted); }
.sb-d-when::before { content: '·'; margin-right: 8px; color: var(--border-2); }

/* sections */
.sb-d-body { display: flex; flex-direction: column; gap: var(--space-2xl); }
.sb-sec-head { display: flex; align-items: center; gap: 10px; margin-bottom: var(--space-md); }
.sb-sec-head h2 { font-family: var(--display); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.4px; color: var(--text-dim); }
.sb-sec-n { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.sb-sec-head::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* media tiles (rounds + boards) — uniform 16:10, actions reveal on hover */
.sb-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--space-md); }
.sb-tile { display: flex; flex-direction: column; gap: 7px; }
.sb-tile-thumb { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius); border: 1px solid var(--border); background: #0c1018 center/cover no-repeat; cursor: zoom-in; overflow: hidden; transition: border-color var(--tf); }
.sb-tile-thumb:hover { border-color: var(--border-2); }
.sb-tile-thumb.is-round { cursor: pointer; }
.sb-tile-play { position: absolute; inset: 0; margin: auto; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: oklch(0.12 0.01 248 / .72); color: #fff; opacity: 0; transform: scale(.85); transition: opacity var(--tf), transform var(--tf); pointer-events: none; }
.sb-tile-play svg { width: 18px; height: 18px; margin-left: 2px; }
.sb-tile-thumb.is-round:hover .sb-tile-play { opacity: 1; transform: none; }
.sb-tile-badge { position: absolute; left: 7px; top: 7px; display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; padding: 3px 7px; border-radius: 2px; background: oklch(0.12 0.01 248 / .82); color: var(--text-dim); }
.sb-tile-badge .sb-chip-ic svg { width: 12px; height: 12px; }
.sb-tile-badge.k-note { color: var(--ct); } .sb-tile-badge.k-board { color: var(--t); } .sb-tile-badge.k-round { color: var(--green); }
.sb-tile-ov { position: absolute; right: 7px; bottom: 7px; opacity: 0; transform: translateY(4px); transition: opacity var(--tf), transform var(--tf); }
.sb-tile-thumb:hover .sb-tile-ov { opacity: 1; transform: none; }
.sb-tile-cap { font-size: 13px; font-weight: 600; color: var(--text-dim); padding: 0 1px; }

/* note cards */
.sb-notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: var(--space-md); }
.sb-note { display: flex; flex-direction: column; gap: 8px; min-height: 124px; padding: 13px 14px; text-align: left; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: border-color var(--tf), transform .08s var(--ease); font: inherit; color: inherit; }
.sb-note:hover { border-color: var(--border-2); transform: translateY(-2px); }
.sb-note-h { display: flex; align-items: center; gap: 7px; }
.sb-note-ic { display: inline-flex; color: var(--ct); }
.sb-note-ic svg { width: 15px; height: 15px; }
.sb-note-t { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-note-del { flex: 0 0 auto; display: inline-flex; padding: 2px; color: var(--muted); background: none; border: none; cursor: pointer; opacity: 0; transition: opacity var(--tf), color var(--tf); }
.sb-note:hover .sb-note-del { opacity: 1; }
.sb-note-del:hover { color: var(--red); }
.sb-note-body { font-size: 12.5px; color: var(--muted); line-height: 1.55; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.sb-note-add { align-items: center; justify-content: center; flex-direction: row; gap: 7px; color: var(--text-dim); font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: .3px; border-style: dashed; background: transparent; }
.sb-note-add:hover { color: var(--text); border-color: var(--accent); transform: none; }
.sb-note-add-ic { display: inline-flex; }

/* detail empty state */
.sb-d-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 56px 24px; border: 1px dashed var(--border); border-radius: var(--radius); }
.sb-d-empty-ic { color: var(--border-2); }
.sb-d-empty-ic svg { width: 40px; height: 40px; }
.sb-d-empty h3 { font-family: var(--display); font-size: 17px; }
.sb-d-empty p { max-width: 46ch; font-size: 13px; color: var(--muted); line-height: 1.6; }
.sb-d-empty .btn { margin-top: 6px; }
.sb-item-actions { display: flex; gap: 6px; }
.sb-iact { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 28px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel-2); color: var(--text-dim); cursor: pointer; }
.sb-iact:hover { color: var(--text); border-color: var(--border-2); }
.sb-iact.danger:hover { color: var(--red); border-color: oklch(0.645 0.19 25 / .4); }

/* save picker */
.sbs-card { width: min(520px, 92vw); display: flex; flex-direction: column; gap: 14px; }
.sbs-top { display: flex; gap: 14px; }
.sbs-preview { width: 124px; height: 80px; flex: 0 0 124px; border-radius: var(--radius-sm); background: #0c1018 center/cover no-repeat; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.sbs-newcol { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.sbs-newrow { display: flex; gap: 8px; } .sbs-newrow .modal-input { flex: 1; min-width: 0; } .sbs-newrow .lib-select { flex: 0 0 124px; }
.sbs-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.sbs-or::before, .sbs-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.sbs-existing { display: flex; flex-direction: column; gap: 6px; max-height: 232px; overflow-y: auto; }
.sbs-strat { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; color: var(--text); text-align: left; }
.sbs-strat:hover { border-color: var(--ct); background: var(--panel-3); }
.sbs-strat-title { font-weight: 600; }

/* lightbox */
.sb-lightbox .sb-lb-inner { display: flex; flex-direction: column; gap: 10px; max-width: 92vw; max-height: 90vh; }
.sb-lb-img { max-width: 92vw; max-height: 80vh; border-radius: var(--radius); border: 1px solid var(--border-2); box-shadow: var(--shadow); }
.sb-lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sb-lb-title { font-weight: 600; }
.sb-lb-actions { display: flex; gap: 8px; }

/* ============================================================
   Anti-Strat v2 — Library-demo-styled sidebar + viewer-style radar
   ============================================================ */
.as2-stage { flex: 1; min-height: 0; display: flex; gap: 12px; }

/* left sidebar — reuses .match-sidebar look: selectors (top, divider) → nav tabs → Scout report (bottom) */
.as2-side { flex: 0 0 192px; gap: 14px; }
.as2-side .match-head { gap: 9px; }
.as2-side select { width: 100%; font-family: var(--sans); font-size: 13px; background: var(--panel-2); border: 1px solid var(--border-2); color: var(--text);
  border-radius: var(--radius); padding: 8px 28px 8px 11px; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b8499' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 9px center; transition: border-color var(--tf); }
.as2-side select:hover, .as2-side select:focus { border-color: var(--ct); outline: none; }
.as2-sideseg { display: flex; width: 100%; }
.as2-sideseg button { flex: 1; }
.as2-tabs { margin-top: 2px; }
.as2-scout { margin-top: auto; width: 100%; justify-content: center; }

/* pop-out (right of the sidebar, resizable) */
.as2-pop { flex: 0 0 auto; width: 380px; min-width: 0; display: none; flex-direction: column; position: relative;
  background: var(--panel); border: 1px solid var(--border); }
.as2-pop.open { display: flex; }
.as2-pophead { display: flex; align-items: center; justify-content: space-between; padding: 9px 13px; border-bottom: 1px solid var(--border);
  font-family: var(--display); text-transform: uppercase; letter-spacing: .6px; font-size: 12px; font-weight: 700; color: var(--text); flex: 0 0 auto; }
.as2-popclose { background: none; border: none; color: var(--muted); font-size: 19px; line-height: 1; cursor: pointer; padding: 0 2px; }
.as2-popclose:hover { color: var(--text); }
.as2-popbody { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 11px; }
.as2-popresize { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: ew-resize; z-index: 3; }
.as2-popresize:hover { background: var(--t); opacity: .45; }

/* main column: filters (top) · radar + player column (body) · transport (bottom) */
.as2-main { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 12px 0; }
.as2-top { flex: 0 0 auto; display: flex; align-items: center; }
.as2-top .as-layers { margin-top: 0; }
.as2-body { flex: 1 1 auto; min-height: 0; display: flex; gap: 12px; }

.as2-map { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; position: relative; }
/* transparent canvas so the processed radar blends into the page, exactly like the 2D replay viewer */
.as2-map .as-canvas { max-width: min(760px, 100%); max-height: 100%; cursor: default; background: transparent; }

/* player select — vertical column pinned top-right */
.as2-players { flex: 0 0 auto; align-self: flex-start; display: flex; flex-direction: column; gap: 6px; width: 168px; }
.as2-pcard { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; transition: background var(--tf), border-color var(--tf); }
.as2-pcard:hover { background: var(--panel-2); }
.as2-pcard.active { border-color: var(--t); background: var(--panel-2); }
.as2-pdot { width: 10px; height: 10px; border-radius: 2px; flex: 0 0 auto; }
.as2-pmeta { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.as2-pname { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.as2-prole { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }

/* replay bar: no panel background/border, shrunk to ~50% width (matches the Library transport feel) */
.as2-controls { flex: 0 0 auto; margin: 0 auto; width: 50%; min-width: 320px; background: none; border: none; padding: 0; }
.as2-status { font-size: 11.5px; color: var(--muted); margin-bottom: 7px; text-align: center; }
.as2-status a { color: var(--ct); text-decoration: none; }
.as2-status a:hover { text-decoration: underline; }

@media (max-width: 1180px) {
  .as2-players { width: 138px; }
  .as2-controls { width: 72%; }
}

/* ============================================================
   Chain Demos — continuous multi-demo replay
   ============================================================ */
.ms-chain { width: 100%; justify-content: center; text-align: center;
  background: var(--panel-2); color: var(--text-dim); border: 1px solid var(--border-2); clip-path: var(--chamfer-2); }
.ms-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.ms-chain:hover { filter: none; background: var(--panel-3); color: var(--text); }
.ms-chain.on { background: var(--t); color: var(--accent-ink); border-color: transparent; }
.ms-chain.on:hover { filter: brightness(1.07); background: var(--t); color: var(--accent-ink); }

/* round strip + pagination arrows */
.rounds-strip-wrap { display: flex; align-items: center; gap: 5px; margin-bottom: 10px; }
.rounds-strip-wrap .rounds-strip { margin-bottom: 0; flex: 1 1 auto; min-width: 0; }
.rs-arrow { flex: 0 0 auto; width: 22px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text-dim); cursor: pointer; border-radius: var(--radius-sm);
  font-size: 15px; line-height: 1; transition: background var(--tf), color var(--tf), opacity var(--tf); }
.rs-arrow:hover:not(:disabled) { background: var(--panel-3); color: var(--text); }
.rs-arrow:disabled { opacity: .28; cursor: default; }

/* chained-strip: divider between demos + muted chips for the non-loaded demos */
.rc-sep { flex: 0 0 auto; align-self: center; width: 1px; height: 20px; background: var(--border-2); margin: 0 5px; }
.round-chip.rc-other { color: var(--muted); }
.round-chip.rc-other:hover { color: var(--text); }

/* T/CT side selector — active color follows the side (was always CT-blue) */
.as2-sideseg button.seg-t.active { background: var(--t); color: var(--accent-ink); }
.as2-sideseg button.seg-ct.active { background: var(--ct-dk); color: oklch(0.98 0.01 250); }

/* telestrator bar is draggable by its pen-icon handle */
.tele-grab { cursor: grab; touch-action: none; }
.tele-grab:active { cursor: grabbing; }

/* Playbook → per-round accordion (under a selected plan) */
.plan-acc { margin: -2px 0 8px; padding: 5px 0 5px 8px; border-left: 2px solid var(--t); display: flex; flex-direction: column; gap: 3px; }
.plan-acc-head { font-size: 10.5px; color: var(--muted); margin-bottom: 2px; }
.plan-acc-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; background: var(--panel); transition: background var(--tf), border-color var(--tf); }
.plan-acc-row:hover { background: var(--panel-2); }
.plan-acc-row.active { border-color: var(--t); background: var(--panel-2); }
.pa-round { font-family: var(--mono); font-weight: 700; font-size: 11px; color: var(--text); min-width: 30px; }
.pa-vs { flex: 1; min-width: 0; font-size: 11.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa-out { font-size: 10px; text-transform: uppercase; letter-spacing: .4px; flex: 0 0 auto; }
.pa-out.won { color: var(--green); }
.pa-out.lost { color: var(--muted); }

/* Unified Replay page — Match | Anti-Strat mode toggle (top of either sidebar) */
.replay-modeseg { display: flex; width: 100%; margin-bottom: 12px; }
.replay-modeseg button { flex: 1; }
.replay-modeseg button.seg-anti.active { background: var(--accent); color: var(--accent-ink); }

/* "Open full demo" cross-link button in the playbook round accordion */
.pa-open { flex: 0 0 auto; width: 22px; height: 20px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-dim); cursor: pointer;
  font-size: 12px; line-height: 1; transition: background var(--tf), color var(--tf), border-color var(--tf); }
.pa-open:hover { background: var(--ct-soft); border-color: var(--ct); color: var(--ct); }

/* mode toggle bar shown above the Anti-Strat paywall / empty states */
.as2-modebar { max-width: 280px; margin-bottom: 4px; }
