:root {
  --bg: #141414;
  --panel: #1a1a1a;
  --panel-2: #232323;
  --line: #2b2b2b;
  --text: #ededed;
  --muted: #8d8d8d;
  --gold: #e8e8e8;   /* the single light accent (name kept from the old theme) */
  --red: #e8e8e8;
  --radius: 12px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; text-decoration: none; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 340px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: #161616; border-right: 1px solid #262626;
}
.sb-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; white-space: nowrap; }
.brand-mark { font-size: 22px; }
.brand-name span { color: var(--gold); }
.links { display: flex; gap: 12px; flex: none; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.links a:hover { color: var(--gold); }
.sb-scroll { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.sb-scroll > * { flex-shrink: 0; }
.sb-head { display: flex; justify-content: space-between; align-items: baseline; }
h1 { margin: 0; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; }
.sb-count { font-size: 12px; color: var(--muted); }
main { min-width: 0; padding: 16px 20px 32px; }

/* ---------- search + filters ---------- */
.search {
  width: 100%; background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; font-size: 14px;
}
.search:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
select {
  width: 100%; background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 10px; font-size: 13px;
}
.vs-row { display: flex; align-items: center; gap: 8px; }
.vs-row select { flex: 1; min-width: 0; }
.vs-mid { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }

.leader-picker { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; }
.lp { flex: none; width: 84px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 5px; color: var(--text); cursor: pointer; text-align: center; font: inherit; transition: .15s; }
.lp:hover { border-color: var(--gold); transform: translateY(-2px); }
.lp.active { border-color: var(--gold); background: var(--panel-2); box-shadow: 0 0 0 1px var(--gold); }
.lp-card { display: block; width: 100%; aspect-ratio: 5 / 7; object-fit: cover; border-radius: 6px; background: var(--panel-2); }
.lp-card.empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; border: 1px dashed var(--line); }
.lp-name { display: block; margin-top: 5px; font-size: 11px; font-weight: 700; line-height: 1.2; }
.lp-set { display: block; font-size: 10px; color: var(--muted); }

.sb-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.toggle input { position: absolute; opacity: 0; }
.track { width: 44px; height: 24px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px; position: relative; transition: .2s; }
.thumb { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: .2s; }
.toggle input:checked + .track { background: var(--gold); border-color: var(--gold); }
.toggle input:checked + .track .thumb { transform: translateX(20px); background: #1a1200; }
.toggle input:focus-visible + .track { outline: 2px solid var(--gold); outline-offset: 2px; }
.toggle b { color: var(--gold); }

.btn { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; font-size: 14px; cursor: pointer; transition: .15s; }
.btn:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.accent { background: var(--red); border-color: var(--red); font-weight: 700; }
.btn.accent:hover { border-color: #fff; }
.btn.small { padding: 7px 11px; font-size: 12px; }
.btn[hidden] { display: none; }

/* ---------- playlist ---------- */
.pl-group { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 10px; }
.pl-head { width: 100%; display: flex; align-items: center; gap: 8px; padding: 11px 12px; background: transparent; border: 0; color: var(--text); cursor: pointer; font: inherit; text-align: left; }
.pl-head:hover { background: var(--panel-2); }
.pl-country { font-size: 11px; font-weight: 700; color: var(--muted); }
.pl-name { flex: 1; font-weight: 800; font-size: 13px; line-height: 1.25; }
.pl-count { font-size: 11px; color: var(--muted); white-space: nowrap; }
.pl-chev { color: var(--muted); transition: transform .2s; }
.pl-group.open .pl-chev { transform: rotate(180deg); }
.pl-body { display: none; border-top: 1px solid var(--line); }
.pl-group.open .pl-body { display: block; }
.pl-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: transparent; border: 0; border-left: 3px solid transparent; border-bottom: 1px solid var(--line); color: var(--text); cursor: pointer; font: inherit; text-align: left; }
.pl-row:last-child { border-bottom: 0; }
.pl-row:hover { background: var(--panel-2); }
.pl-row.active { background: var(--panel-2); border-left-color: var(--gold); }
.pl-icons { display: flex; gap: 4px; flex: none; }
.pl-ico { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; object-position: top; background: var(--panel-2); border: 1px solid var(--line); }
.pl-ico.empty { display: inline-block; }
.pl-info { flex: 1; min-width: 0; }
.pl-info > span { display: block; }
.pl-main { font-weight: 700; font-size: 13px; line-height: 1.25; }
.pl-sub { font-size: 11px; color: var(--muted); }
.pl-now { flex: none; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
.pl-empty { color: var(--muted); font-size: 13px; text-align: center; margin: 8px 0; }
.sb-note { margin: 6px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 11px; line-height: 1.5; color: var(--muted); }

/* ---------- match bar ---------- */
.matchup { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px; margin-bottom: 12px; }
.side { display: flex; align-items: center; gap: 12px; min-width: 0; }
.side.right { justify-content: flex-end; text-align: right; }
.tb-ico { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; object-position: top; border: 1px solid var(--line); flex: none; background: var(--panel-2); }
.tb-ico.empty { display: inline-block; }
.side .name { font-size: 18px; font-weight: 800; line-height: 1.2; }
.side .leader { font-size: 12px; color: var(--muted); }
.mc { text-align: center; }
.mc-event { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.mc-round { font-size: 18px; font-weight: 800; text-transform: uppercase; }

/* ---------- video ---------- */
.stage { position: relative; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stage iframe, .stage > div { position: absolute; inset: 0; width: 100%; height: 100%; }
.placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; color: var(--muted); background: repeating-linear-gradient(45deg, #0d1830, #0d1830 12px, #101d38 12px, #101d38 24px); }
.placeholder[hidden] { display: none; }
.stage:fullscreen { border-radius: 0; }
.controls { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- event bar ---------- */
.event-bar { margin-top: 24px; }
.eb-title { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.eb-cards { display: flex; flex-wrap: wrap; gap: 12px; }
.eb-card { width: 210px; display: flex; flex-direction: column; gap: 2px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 10px 12px; color: var(--text); cursor: pointer; font: inherit; transition: .15s; }
.eb-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.eb-card.active { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.eb-card > span { display: block; padding: 0 4px; }
.eb-thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 8px; }
.eb-country { font-size: 15px; min-height: 22px; }
.eb-name { font-weight: 800; font-size: 15px; line-height: 1.25; }
.eb-sub { font-size: 12px; color: var(--muted); min-height: 16px; }
.eb-card > .eb-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.eb-badge { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border: 1px solid var(--gold); color: var(--gold); border-radius: 4px; padding: 2px 6px; }
.eb-count { font-size: 11px; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--gold); color: #1a1200; padding: 10px 16px; border-radius: 10px; font-weight: 600; opacity: 0; pointer-events: none; transition: .25s; z-index: 30; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- small screens: video first, panel below ---------- */
@media (max-width: 900px) {
  .app { display: flex; flex-direction: column; }
  main { order: 1; padding: 12px; }
  .sidebar { order: 2; position: static; height: auto; border-right: 0; border-top: 1px solid var(--line); }
  .sb-scroll { overflow: visible; }
  .matchup { grid-template-columns: 1fr; text-align: center; }
  .side, .side.right { justify-content: center; text-align: center; }
  .eb-card { width: calc(50% - 6px); }
}

/* ---------- landing view ---------- */
[hidden] { display: none !important; }
.sec-head { display: flex; justify-content: space-between; align-items: center; margin: 22px 0 10px; }
.sec-title { margin: 22px 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.sec-head .sec-title { margin: 0; }

.hero {
  position: relative; text-align: center; overflow: hidden; border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 20px 22px;
  background:
    radial-gradient(520px 260px at 18% 100%, rgba(229,72,77,.28), transparent 70%),
    radial-gradient(520px 260px at 82% 100%, rgba(75,110,255,.30), transparent 70%),
    var(--panel);
}
.hero-tag { position: absolute; top: 14px; left: 16px; background: var(--gold); color: #1a1200; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 4px 8px; border-radius: 4px; }
.hero-meta { position: absolute; top: 16px; right: 18px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hero-sides { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 30px; }
.hero-side { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.hero-card { width: min(190px, 30vw); aspect-ratio: 5 / 7; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.hero-card.empty { background: var(--panel-2); }
.hero-name { font-size: 26px; font-weight: 800; line-height: 1.1; margin-top: 10px; }
.hero-set { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.hero-vs { font-size: 44px; font-weight: 900; font-style: italic; }
.hero-btn { margin-top: 16px; padding: 11px 22px; font-size: 14px; }

.mg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.mg-card {
  display: flex; align-items: center; gap: 12px; text-align: left; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; color: var(--text); cursor: pointer; font: inherit; transition: .15s;
}
.mg-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.mg-meta { display: block; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat-num { font-size: 28px; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 900px) {
  .hero-name { font-size: 18px; }
  .hero-vs { font-size: 28px; }
  .hero-meta { position: static; display: block; margin: 40px 0 -18px; }
}

/* mock: leader strip under the event bar */
.leader-bar { margin-top: 24px; }
.leader-picker.wide { flex-wrap: wrap; overflow: visible; gap: 12px; padding: 0; }
.leader-picker.wide .lp { width: 118px; padding: 7px; }
.leader-picker.wide .lp-name { font-size: 12px; }
.leader-picker.wide .lp-set { font-size: 11px; }

/* ---- draw tool ---- */
.draw-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: none; z-index: 2; touch-action: none; cursor: crosshair; }
.stage.drawing .draw-canvas { display: block; }
.draw-bar { position: absolute; top: 12px; left: 10px; right: 10px; margin: 0 auto; width: fit-content; z-index: 3; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; padding: 8px 10px; background: rgba(11, 20, 36, .92); border: 1px solid var(--gold); border-radius: 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, .5); }
.draw-bar[hidden], .draw-hint[hidden] { display: none; }
.db { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-weight: 600; font-size: 13px; line-height: 1.2; font-family: inherit; cursor: pointer; }
.db:hover:not(:disabled) { border-color: var(--gold); }
.db:disabled { opacity: .4; cursor: not-allowed; }
.db.on { background: var(--gold); color: #1a1200; border-color: var(--gold); }
.db-dot { width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.db-dot.on { border-color: #fff; }
.db-sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.draw-hint { position: absolute; left: 14px; bottom: 12px; z-index: 3; padding: 6px 10px; border-radius: 8px; background: rgba(11, 20, 36, .85); color: var(--muted); font-size: 12px; font-weight: 600; pointer-events: none; }
#drawBtn.on { border-color: var(--gold); color: var(--gold); }
@media (max-width: 640px) { .draw-bar { top: 6px; padding: 6px; gap: 4px; } .db { padding: 5px 8px; font-size: 12px; } .draw-hint { display: none; } }

/* ================= Theme: quiet graphite (hairline panels, mono details) ================= */
body { font-size: 14px; }
.sb-top { border-bottom-color: #262626; }
.brand-name span { color: var(--text); font-weight: 500; }
.sb-head h1 { margin: 0; font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
.sb-count { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.sec-title, .eb-title { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; color: var(--text); }

/* fields + buttons */
.search, select, .btn, .db { background: #1c1c1c; border: 1px solid #2e2e2e; border-radius: 10px; color: #ddd; font-size: 13px; }
.search::placeholder { color: #777; }
.btn:hover:not(:disabled), .search:focus, select:focus { border-color: #555; background: #222; outline: none; }
.btn.accent { background: var(--text); border-color: var(--text); color: #111; font-weight: 600; }
.btn.accent:hover:not(:disabled) { background: #fff; border-color: #fff; }

/* panels */
.hero, .mg-card, .eb-card, .lp, .stat, .matchup, .sb-note, .pl-group, .pl-ev, .draw-bar { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: none; }
.hero { background: var(--panel); }
.hero-card, .eb-thumb { border-radius: 8px; }
.stage { border: 1px solid var(--line); border-radius: 12px; }
.lp.active, .eb-card.active, .pl-row.active { background: #222; border-color: #4a4a4a; box-shadow: none; }
.pl-row.active { border-left-color: var(--text); }
.lp:hover, .eb-card:hover, .mg-card:hover { border-color: #4a4a4a; }

/* chips + small mono details */
.hero-tag, .eb-badge, .pl-now { background: #262626; color: #bdbdbd; border: 1px solid #333; font-family: var(--mono); font-weight: 500; border-radius: 6px; }
.hero-meta, .hero-set, .mg-meta, .mc-event { color: var(--muted); font-family: var(--mono); }
.stat-num, .pl-sub, .eb-count { font-family: var(--mono); }
.stat-num { font-size: 34px; font-weight: 500; }

/* toggle + draw tool */
.toggle input:checked + .track { background: var(--text); border-color: var(--text); }
.toggle input:checked + .track .thumb { background: #111; }
.toggle b { color: var(--text); }
.draw-bar { background: rgba(20, 20, 20, .94); border-color: #4a4a4a; }
.db.on { background: var(--text); border-color: var(--text); color: #111; }

/* breadcrumb bar */
.crumbs { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.crumbs button { all: unset; cursor: pointer; }
.crumbs button:hover { color: var(--text); }
.crumbs .sep { opacity: .5; }
.crumbs .cur { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.crumbs .mid { overflow: hidden; text-overflow: ellipsis; }
