@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("/fonts/barlow-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("/fonts/barlow-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url("/fonts/barlow-700.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 800; font-display: swap; src: url("/fonts/barlow-800.woff2") format("woff2"); }

:root {
  --bg: #0f0f11; --sidebar: #131316; --panel: #18181b; --panel-2: #202024; --raise: #26262b;
  --edge: #2a2a30; --edge-strong: #3a3a42; --edge-hover: #4a4a53;
  --ink: #f4f4f5; --ink-2: #d4d4d8; --dim: #9b9ba4; --faint: #6b6b74;
  --accent: #dc1f32; --accent-hover: #f0303f; --accent-ink: #ffffff; --accent-soft: rgba(220, 31, 50, .14);
  --good: #22a861; --good-soft: rgba(34, 168, 97, .15); --bad: #dc1f32; --bad-ink: #ff9aa2;
  --warn: #f0a020; --warn-soft: rgba(240, 160, 32, .15); --info: #4c8dff; --info-soft: rgba(76, 141, 255, .15);
  --home-1: #1f4fd1; --home-ink: #fff; --away-1: #c81e1e; --away-ink: #fff;
  --radius: 10px; --radius-sm: 7px; --shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { background: var(--bg); color: var(--ink); font-family: "Barlow", system-ui, sans-serif; font-size: 15px; line-height: 1.4;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-hover); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 18px 12px;
  background: var(--sidebar); border-right: 1px solid var(--edge); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-size: 17px; font-weight: 800; letter-spacing: .01em; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; font-size: 14px; color: #fff; }
.brand small { display: block; font-size: 11px; font-weight: 700; color: var(--faint); letter-spacing: .12em; text-transform: uppercase; }
.nav-label { padding: 14px 10px 6px; font-size: 11px; font-weight: 800; color: var(--faint); letter-spacing: .14em; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--ink-2); font: inherit; font-weight: 600; cursor: pointer; text-align: left; justify-content: flex-start; }
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.nav-item:hover:not(:disabled) { background: var(--panel-2); color: var(--ink); text-decoration: none; border: 0; }
.nav-item.on { background: var(--accent-soft); color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); }
.nav-item.on svg { opacity: 1; color: var(--accent-hover); }
.nav-item .count { margin-left: auto; font-size: 12px; color: var(--faint); font-weight: 700; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--edge); padding-top: 12px; }
.content { min-width: 0; }
.page { padding: 28px 32px 48px; max-width: 1400px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 800; }
.page-head p { color: var(--dim); margin-top: 4px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .search { position: relative; flex: 1; min-width: 220px; max-width: 360px; }
.toolbar .search input { padding-left: 34px; }
.toolbar .search svg { position: absolute; left: 10px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--faint); }
.toolbar select { width: auto; min-width: 180px; }
.mobile-bar { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; left: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .sidebar { transform: none; box-shadow: var(--shadow); }
  .mobile-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 10px 16px;
    border-bottom: 1px solid var(--edge); background: var(--sidebar); }
  .mobile-bar #menu { padding: 9px; color: var(--ink); }
  .mobile-bar #menu svg { width: 20px; height: 20px; }
  .mobile-bar .who { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; min-width: 0; }
  .mobile-bar .who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; }
  .nav-backdrop { position: fixed; inset: 0; z-index: 39; background: rgba(0, 0, 0, .55); display: none; }
  .shell.nav-open .nav-backdrop { display: block; }
  .page { padding: 20px 16px 40px; }
}

/* ---------- top bar (scorer / controller) ---------- */
header.top { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--edge); background: var(--sidebar); flex-wrap: wrap; }
header.top h1 { font-size: 18px; font-weight: 800; letter-spacing: .01em; }
header.top .sub { color: var(--dim); font-weight: 600; }
header.top .spacer, .spacer { flex: 1; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 3px rgba(220, 31, 50, .2); }
.live-dot.on { background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.conn { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--dim); }
main { padding: 20px; max-width: 1280px; margin: 0 auto; }

/* ---------- buttons ---------- */
button, .btn { font: inherit; font-weight: 700; font-size: 14px; color: var(--ink); background: var(--panel-2); border: 1px solid var(--edge-strong);
  border-radius: var(--radius-sm); padding: 8px 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  user-select: none; -webkit-user-select: none; touch-action: manipulation; white-space: nowrap; line-height: 1.2; }
button svg, .btn svg { width: 16px; height: 16px; flex: none; }
button:hover:not(:disabled), .btn:hover { border-color: var(--edge-hover); background: var(--raise); text-decoration: none; }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .4; cursor: default; }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.primary:hover:not(:disabled), .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.ghost, .btn.ghost { background: none; border-color: transparent; color: var(--dim); }
button.ghost:hover:not(:disabled), .btn.ghost:hover { background: var(--panel-2); color: var(--ink); }
button.danger { background: none; border-color: rgba(220, 31, 50, .45); color: var(--bad-ink); }
button.danger:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--bad); }
button.on { background: var(--good); border-color: var(--good); color: #fff; }
button.sm, .btn.sm { padding: 5px 10px; font-size: 13px; }
button.icon { padding: 7px; }

/* ---------- forms ---------- */
input, select, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--edge-strong); border-radius: var(--radius-sm);
  padding: 8px 11px; width: 100%; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled, select:disabled { opacity: .6; }
input[type=color] { padding: 3px; height: 38px; cursor: pointer; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
label .hint { font-weight: 500; color: var(--faint); font-size: 12px; }
label.inline { flex-direction: row; align-items: center; gap: 9px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .wide { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.form-section { display: flex; flex-direction: column; gap: 14px; padding: 20px 0; border-top: 1px solid var(--edge); }
.form-section:first-child { border-top: 0; padding-top: 0; }
.form-section h3 { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.check-grid label { padding: 8px 10px; border: 1px solid var(--edge); border-radius: var(--radius-sm); background: var(--panel-2); cursor: pointer; }
.check-grid label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- surfaces ---------- */
.card { background: var(--panel); border: 1px solid var(--edge); border-radius: var(--radius); padding: 18px; }
.card h2, .section-title { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.muted { color: var(--dim); }
.errors { color: var(--bad-ink); font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--edge); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: 26px; font-weight: 800; }
.stat span { font-size: 12px; font-weight: 700; color: var(--dim); letter-spacing: .08em; text-transform: uppercase; }

/* ---------- tables ---------- */
.table-wrap { background: var(--panel); border: 1px solid var(--edge); border-radius: var(--radius); overflow: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--edge); vertical-align: middle; }
th { position: sticky; top: 0; background: var(--panel-2); color: var(--dim); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--panel-2); }
tr.selected td { background: var(--accent-soft); }
td.actions { text-align: right; white-space: nowrap; }
td.actions .row { justify-content: flex-end; flex-wrap: nowrap; gap: 6px; }
td .sub { display: block; font-size: 12px; color: var(--faint); margin-top: 2px; }
.num { text-align: right; }
.empty { padding: 48px 20px; text-align: center; color: var(--dim); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; }
.empty button { margin-top: 14px; }

/* ---------- badges, chips ---------- */
.chip { display: inline-block; width: 14px; height: 14px; border-radius: 4px; flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }
.team { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.team img { width: 30px; height: 30px; object-fit: contain; }
.versus { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.versus .v { color: var(--faint); font-weight: 700; font-size: 12px; }
.tag, .badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 99px; background: var(--raise); color: var(--ink-2); white-space: nowrap; }
.badge.live, .tag.live { background: var(--accent-soft); color: var(--bad-ink); }
.badge.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s infinite; }
.badge.done, .tag.done { background: var(--good-soft); color: #7fdcaa; }
.badge.info { background: var(--info-soft); color: #a8c6ff; }
.badge.warn { background: var(--warn-soft); color: #ffd08a; }
@keyframes pulse { 50% { opacity: .35; } }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--raise); flex: none; }
.avatar.cutout { object-fit: cover; object-position: center top; }
.player-hero { height: 260px; border-radius: var(--radius); display: flex; align-items: flex-end; justify-content: center; overflow: hidden; margin-bottom: 18px; }
.player-hero img { height: 250px; object-fit: contain; filter: drop-shadow(0 10px 20px rgba(0,0,0,.4)); }

/* ---------- drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer { position: fixed; z-index: 51; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); display: flex; flex-direction: column;
  background: var(--panel); border-left: 1px solid var(--edge); box-shadow: var(--shadow); transform: translateX(100%); transition: transform .24s cubic-bezier(.2, .8, .2, 1); }
.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
.drawer-open .drawer { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--edge); }
.drawer-head h2 { font-size: 19px; font-weight: 800; }
.drawer-head p { color: var(--dim); font-size: 13px; margin-top: 2px; }
.drawer-body { flex: 1; overflow: auto; padding: 20px 22px; }
.drawer-foot { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--edge); background: var(--panel-2); }
.drawer-foot .spacer { flex: 1; }

/* ---------- switches, tiles, segmented ---------- */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid var(--edge);
  border-radius: var(--radius-sm); background: var(--panel-2); cursor: pointer; width: 100%; font-weight: 600; color: var(--ink); white-space: normal; }
.switch .text { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; }
.switch .text small { font-size: 12px; color: var(--dim); font-weight: 500; }
.switch .knob { position: relative; width: 42px; height: 24px; border-radius: 99px; background: var(--edge-strong); flex: none; transition: background .15s; }
.switch .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch.is-on .knob { background: var(--accent); }
.switch.is-on .knob::after { transform: translateX(18px); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { position: relative; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 4px; min-height: 88px; padding: 12px 14px;
  text-align: left; background: var(--panel-2); border: 1px solid var(--edge-strong); white-space: normal; }
.tile svg { position: absolute; top: 12px; left: 14px; width: 20px; height: 20px; color: var(--dim); }
.tile b { font-size: 15px; }
.tile small { font-size: 12px; font-weight: 600; color: var(--dim); }
.tile.on-air { background: var(--accent-soft); border-color: var(--accent); }
.tile.on-air svg { color: var(--accent-hover); }
.tile.on-air::after { content: "ON AIR"; position: absolute; top: 10px; right: 10px; font-size: 10px; font-weight: 800; letter-spacing: .12em;
  padding: 2px 7px; border-radius: 99px; background: var(--accent); color: #fff; }
.segmented { display: inline-flex; padding: 3px; gap: 3px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--edge); }
.segmented button { border: 0; background: none; color: var(--dim); padding: 6px 12px; }
.segmented button.on { background: var(--raise); color: var(--ink); }
.segmented button:hover:not(:disabled) { border: 0; }

/* ---------- toast, dialog ---------- */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 40px); opacity: 0; background: var(--raise); border: 1px solid var(--edge-strong);
  padding: 10px 18px; border-radius: var(--radius-sm); font-weight: 700; transition: .2s; pointer-events: none; z-index: 99; box-shadow: var(--shadow); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.warn, #toast.error { border-color: var(--bad); color: var(--bad-ink); }
dialog { background: var(--panel); color: var(--ink); border: 1px solid var(--edge); border-radius: 12px; padding: 18px; min-width: 320px; max-width: 92vw; margin: auto; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog h3 { margin-bottom: 12px; }
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-height: 60vh; overflow: auto; }
.pick button { justify-content: flex-start; }
.pick button b { min-width: 28px; text-align: right; color: var(--accent-hover); }

/* ---------- digitazh ---------- */
:root { --dgt-1: #7621e3; --dgt-2: #8b7cf6; --dgt-3: #311e97; --dgt-line: linear-gradient(90deg, var(--dgt-1), var(--dgt-2) 55%, var(--dgt-3)); }
.powered { display: inline-flex; align-items: center; gap: 8px; color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; text-decoration: none; opacity: .85; transition: opacity .15s; }
.powered:hover { opacity: 1; text-decoration: none; }
.powered .lockup { display: inline-flex; align-items: center; gap: 1px; }
.powered .lockup .word { height: 15px; }
.powered .lockup .mark { height: 19px; }
.sidebar-foot .powered { padding: 10px 10px 2px; }
.sidebar::before, header.top::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--dgt-line); }
header.top { position: sticky; top: 0; z-index: 30; }
.login-foot { display: flex; justify-content: center; padding-top: 6px; }

.sidebar-foot .who { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; font-size: 14px; }
