/* Dark, in the University of Cincinnati colours (uc.edu brand guide): UC Black and
   greys, UC Red only as a solid fill under white text (never red text on dark), Gettler
   Gold for chart bars. Blue and orange are still the two sides of a match, and
   green/amber/red are still status. */
@font-face {
  font-family: Bourgeois;
  src: url("Bourgeois-HeavyItalic.ttf") format("truetype");
  font-weight: normal; font-style: normal;
}
:root {
  --bg: #0a0a0a; --panel: #161616; --raised: #222222; --bar: #000000; --line: #333333; --line-soft: #262626;
  --text: #f3f3f3; --dim: #a7a5aa; --mute: #8e8c91;
  --red: #e00122; --red-dark: #b8011c; --maroon: #890519; --gold: #d1b179; --gold-dim: #6e6047;
  --blue: #1f5bd8; --blue-text: #7ea8ff; --orange: #bf4c0f; --orange-text: #ff9a62;
  --good: #4ade80; --bad: #f87171; --warn: #fbbf24;
  --font: Archivo, "Segoe UI", system-ui, sans-serif;
  --display: Bourgeois, Archivo, "Segoe UI", sans-serif;
  --r: 2px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 var(--font);
}
[hidden] { display: none !important; }
a { color: var(--text); text-decoration-color: var(--red); text-underline-offset: 3px; }
a:hover { color: #fff; }
small { font-size: 12px; }
.dim { color: var(--mute); }
.small { font-size: 12px; white-space: normal; }
.n0 { color: var(--blue-text); } .n1 { color: var(--orange-text); }
.center { text-align: center; }

/* ---- the bar across the top --------------------------------------------- */

header {
  display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap;
  min-height: 60px; padding: 0 24px; background: var(--bar); border-bottom: 1px solid var(--line);
}
.brand { background: var(--red); color: #fff; font: 22px/1 var(--display); padding: 6px 12px 4px; }
h1 { font-size: 14px; margin: 0; font-weight: 700; font-stretch: 115%; letter-spacing: .06em; text-transform: uppercase; color: var(--text); }
#status { display: inline-flex; align-items: center; gap: 8px; color: var(--mute); font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); flex: none; }
.dot.on { background: var(--good); }
nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
#tabs button, #tabs a {
  background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding: 14px 10px 11px; color: var(--dim);
  font: inherit; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer;
}
#tabs button:hover, #tabs a:hover { color: var(--text); background: none; }
#tabs button.on, #tabs a.on { color: #fff; background: none; border-bottom-color: var(--red); }
#logout { background: none; border-color: transparent; color: var(--mute); font-weight: 500; }
#logout:hover { color: var(--text); }
#public-link { color: var(--dim); font-weight: 500; text-decoration: none; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r); white-space: nowrap; }
#public-link:hover { color: var(--text); background: var(--raised); }
main { padding: 24px; max-width: 1480px; margin: 0 auto; }

/* Until someone logs in, the login form is the whole page. */
body.locked header, body.locked main { display: none; }
#login { max-width: 340px; margin: 14vh auto 0; display: flex; flex-direction: column; gap: 14px; padding: 0 16px; }
#login h1 { font-size: 20px; color: var(--text); font-weight: 600; }
#login label { display: flex; flex-direction: column; gap: 4px; color: var(--dim); font-size: 13px; }

/* ---- controls ------------------------------------------------------------ */

button, select, input[type=text], input[type=number], input[type=password], input[type=search], input[type=url] {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--r); padding: 6px 10px; font: inherit; min-height: 32px;
}
button { cursor: pointer; font-weight: 500; }
button:hover { border-color: #3a3b42; background: var(--raised); }
button.on { background: var(--text); color: var(--bar); border-color: var(--text); }
button.approve { background: var(--text); color: var(--bar); border-color: var(--text); }
button.approve:hover { background: #fff; }
button.reject { color: var(--bad); }
a.button { display: inline-flex; align-items: center; min-height: 32px; padding: 6px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); color: var(--text); font-weight: 500; text-decoration: none; }
a.button.approve { background: var(--text); color: var(--bar); border-color: var(--text); }
a.button.approve:hover { background: #fff; }
input[type=number] { width: 72px; }
input.key { width: 100%; font-family: Consolas, monospace; font-size: 12px; }
select:focus, input:focus, button:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

.seg { display: inline-flex; }
.seg button { border-radius: 0; margin-left: -1px; }
.seg button:first-child { border-radius: var(--r) 0 0 6px; margin-left: 0; }
.seg button:last-child { border-radius: 0 var(--r) var(--r) 0; }
.seg button small, .toggles button small, .subnav small { margin-left: 6px; color: var(--mute); font-weight: 500; }
.seg button.on small { color: #55565c; }
.toggles { display: inline-flex; gap: 4px; }
.toggles button { background: none; color: var(--mute); }
.toggles button.on { background: var(--raised); color: var(--text); border-color: #3a3b42; }
.toggles button.on small { color: var(--dim); }
.field { display: inline-flex; align-items: center; gap: 8px; color: var(--mute); font-size: 13px; }
.form .field { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.form .field input[type=text], .form .field input[type=password], .form .field select { width: 100%; }
.form { display: flex; flex-direction: column; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; }
.tools { display: flex; gap: 8px 10px; flex-wrap: wrap; align-items: center; }

/* ---- page structure ------------------------------------------------------ */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.ph { font: 44px/.95 var(--display); text-transform: uppercase; color: #fff; margin: 0; }
.ph-sub { color: var(--mute); font-size: 13px; margin-top: 4px; max-width: 720px; }
/* The description wraps rather than pushing the buttons to a new line, so they sit in the same place whichever view is open. */
.page-head > div:first-child { flex: 1 1 320px; min-width: 0; }
/* Buttons level with the title, so a description of one or two lines never moves them. */
.page-head.pinned-tools { align-items: flex-start; }
.page-head.pinned-tools > .tools { justify-content: flex-end; margin-top: 4px; }

section { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 16px 20px; margin-bottom: 16px; }
section.flush { padding: 4px 0 0; }
section.flush table.stat th:first-child, section.flush table.stat td:first-child { padding-left: 20px; }
section.flush table.stat th:last-child, section.flush table.stat td:last-child { padding-right: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 12px; }
h2 { font-size: 13px; color: #fff; margin: 0; font-weight: 700; font-stretch: 120%; letter-spacing: .12em; text-transform: uppercase; }
h3 { font-size: 16px; font-weight: 600; margin: 0; }
.hint { color: var(--mute); font-size: 13px; margin: 0 0 14px; }
.hint.ok { color: var(--good); }
.empty { color: var(--mute); }
.error { color: var(--bad); }
.warn { color: var(--warn); }
.error.banner { background: rgba(248,113,113,.08); border: 1px solid rgba(248,113,113,.3); border-radius: var(--r); padding: 8px 12px; margin: 0 0 16px; }
code { font-family: Consolas, monospace; font-size: 12px; color: var(--dim); }

.empty-state { text-align: center; padding: 48px 20px; }
.empty-state p { margin: 0; color: var(--mute); }
.empty-state .big { color: var(--text); font-size: 16px; font-weight: 600; margin-bottom: 6px; }

.cards2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; align-items: start; }
.cards2 > section { margin: 0; }

.pill { display: inline-block; font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: var(--r); background: var(--raised); color: var(--dim); white-space: nowrap; }
.pill.live { color: var(--good); background: rgba(74,222,128,.1); }
.pill.ok { color: var(--good); background: rgba(74,222,128,.1); }
.pill.warn { color: var(--warn); background: rgba(251,191,36,.1); }
.pill.bad { color: var(--bad); background: rgba(248,113,113,.1); }

.kind { font-size: 11px; font-weight: 600; border-radius: 4px; padding: 1px 6px; background: var(--raised); color: var(--dim); white-space: nowrap; }
.kind-lan { color: var(--good); }
.kind-private { color: var(--blue-text); }
.kind-ranked { color: var(--orange-text); }
.badge { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 6px; border-radius: var(--r);
         background: var(--red); color: #fff; font-size: 11px; font-weight: 700; text-align: center; }

/* ---- tables (they scroll inside their own box, never the page) ------------ */

.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: right; font-size: 12px; color: var(--mute); font-weight: 500; padding: 8px 10px; white-space: nowrap; }
td { text-align: right; padding: 8px 10px; border-top: 1px solid var(--line-soft); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
table.left th, table.left td { text-align: left; }
table.left td { vertical-align: middle; }
tr.muted td { opacity: .5; }

table.stat { table-layout: fixed; }
table.stat th { white-space: normal; vertical-align: bottom; line-height: 1.25; }
table.stat th:first-child { width: 210px; }
table.stat td:first-child, table.stat th:first-child { position: sticky; left: 0; background: var(--panel); z-index: 1; }
table.stat td:first-child { overflow: hidden; text-overflow: ellipsis; }
table.stat td:first-child small { color: var(--mute); }
table.log th:first-child { width: 260px; }
tr.group td { border-top: 0; padding-top: 18px; padding-bottom: 6px; text-align: left; }
tr.group .gname { font-weight: 600; font-size: 15px; }
tr.group small { color: var(--mute); margin-left: 10px; }
tr.team td { font-weight: 600; background: var(--raised); border-top: 1px solid var(--line); }
table.stat tr.team td:first-child { background: var(--raised); }
td.won { color: var(--good); } td.lost { color: var(--bad); }
a.plink { color: inherit; text-decoration: none; }
a.plink:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--red); }
optgroup { color: var(--mute); }

/* ---- live ------------------------------------------------------------------- */

.score-panel { padding: 0; overflow: hidden; }
.bug { display: grid; grid-template-columns: minmax(0, 1fr) 140px minmax(0, 1fr); min-height: 76px; }
.bug-side { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; color: #fff; min-width: 0; }
.bug-side.b { background: var(--blue); }
.bug-side.o { background: var(--orange); }
.bug-side b { font: 56px/.8 var(--display); }
.bug-name { font-size: 18px; font-weight: 800; font-stretch: 120%; letter-spacing: .05em; text-transform: uppercase; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bug-side.o .bug-name { text-align: right; }
.bug-mid { background: var(--bar); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.bug-clock { font: 32px/1 var(--display); }
.bug-mid span:last-child { color: var(--mute); font-size: 12px; }
.series-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 12px 20px; color: var(--dim); }
.series-strip .ss-label { color: var(--text); font-weight: 600; }
.series-strip b { color: var(--text); }
.chips { display: inline-flex; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--dim); }
.chips span { background: var(--raised); border-radius: 4px; padding: 1px 7px; }

.live-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.live-grid > * { margin: 0; }
@media (max-width: 1280px) { .live-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .live-grid .events { grid-column: 1 / -1; } }
@media (max-width: 820px) { .live-grid { grid-template-columns: 1fr; } }

.team-box { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; }
.team-box .tb-head { padding: 10px 16px; font-weight: 800; font-stretch: 120%; letter-spacing: .08em; text-transform: uppercase; border-top: 4px solid var(--mute); }
.team-box.t0 .tb-head { border-top-color: var(--blue); color: var(--blue-text); }
.team-box.t1 .tb-head { border-top-color: var(--orange); color: var(--orange-text); }
.team-box th:first-child, .team-box td:first-child { padding-left: 16px; }
.team-box th:last-child, .team-box td:last-child { padding-right: 16px; }
.team-box td:first-child { font-weight: 500; }
.boost { display: inline-flex; align-items: center; gap: 8px; }
.boost i { width: 48px; height: 5px; background: var(--raised); border-radius: 3px; overflow: hidden; display: block; }
.boost i b { display: block; height: 100%; background: var(--dim); }
.t0 .boost i b { background: var(--blue-text); } .t1 .boost i b { background: var(--orange-text); }

.events { padding: 14px 16px; }
#log { max-height: 520px; overflow-y: auto; }
#log div { padding: 6px 0; border-top: 1px solid var(--line-soft); font-size: 13px; display: flex; gap: 8px; align-items: baseline; }
#log div:first-child { border-top: 0; }
#log .ts { color: var(--mute); flex: none; font-size: 12px; }
#log .ev { color: var(--dim); font-weight: 600; flex: none; }
#log .ev-goal { color: var(--good); }
#log .ev-demolish, #log .ev-demolition { color: var(--orange-text); }

.picker button { white-space: nowrap; }

/* ---- queue -------------------------------------------------------------------- */

.qlist { padding: 0; overflow: hidden; }
.qrow { display: grid; grid-template-columns: 28px 64px minmax(200px, 2fr) 150px 140px minmax(90px, 1fr) 250px;
        align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line-soft); }
.qlist > :first-child .qrow, .qlist > .qrow:first-child { border-top: 0; }
.qrow.open { background: var(--raised); }
.qrow > .pill, .qrow > .kind { justify-self: start; }   /* size to the text, not the column */
.qmatch { display: flex; gap: 8px; align-items: baseline; min-width: 0; font-weight: 500; }
.qmatch span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qmatch .n0 { color: var(--blue-text); } .qmatch .n1 { color: var(--orange-text); }
.qmatch .qcount { color: var(--mute); font-weight: 400; flex: none; }
.qmatch .pill { flex: none; align-self: center; }
.qsenders { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrow > .dim { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notes { margin-top: -4px; }
.notes p { margin: 0 0 4px; color: var(--mute); font-size: 13px; }
.qactions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.xbtn { width: 28px; height: 28px; min-height: 28px; padding: 0; font-size: 16px; line-height: 1; color: var(--mute); transition: transform .15s; }
.qrow.open .xbtn { transform: rotate(90deg); }
.qdetail { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 4px 16px 16px 56px; background: var(--raised); }
.qdetail .team-box { background: var(--panel); }
.qsent { grid-column: 1 / -1; margin: 0; }
@media (max-width: 1000px) {
  .qrow { grid-template-columns: 28px minmax(0, 1fr) auto; }
  .qrow > .kind, .qrow > .dim, .qrow > .qsenders { display: none; }
  .qrow .pill { grid-column: 2; }
  .qdetail { grid-template-columns: 1fr; padding-left: 16px; }
}

/* ---- stats: one player ---------------------------------------------------------- */

.player-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.pname { font-size: 20px; }

/* ---- leaders ------------------------------------------------------------------- */

.leaders { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.leaders > div { background: var(--raised); border-radius: var(--r); padding: 12px 14px; }
.leaders h4 { margin: 0 0 8px; font-size: 12px; color: var(--mute); font-weight: 500; }
.leaders ol { margin: 0; padding: 0; list-style: none; }
.leaders li { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; color: var(--dim); font-size: 13px; }
.leaders li em { display: block; font-style: normal; color: var(--mute); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.leaders li span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaders li small { color: var(--mute); font-size: 11px; }
.leaders li:first-child { color: var(--text); font-size: 14px; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.leaders li:first-child b { font: 28px/1 var(--display); }
.leaders li:first-child span:first-child { font-weight: 600; }

/* ---- admin ------------------------------------------------------------------------ */

.admin { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; }
.subnav { display: flex; flex-direction: column; gap: 2px; margin: 0; position: sticky; top: 16px; }
.subnav button { background: none; border: 0; text-align: left; padding: 8px 12px; border-radius: var(--r); color: var(--dim); display: flex; justify-content: space-between; }
.subnav button:hover { background: var(--raised); color: var(--text); }
.subnav button.on { background: var(--raised); color: var(--text); }
.admin-title { margin: 2px 0 14px; font-size: 17px; }
@media (max-width: 820px) {
  .admin { grid-template-columns: 1fr; }
  .subnav { flex-direction: row; flex-wrap: wrap; position: static; }
}

.roster { padding: 14px 16px; }
.roster .team-name { font-weight: 600; flex: 1; min-width: 0; }
/* An in-game team's players, one per line: display name, account, team. */
.prow-list { display: flex; flex-direction: column; max-width: 860px; }
.prow { display: grid; grid-template-columns: minmax(160px, 240px) minmax(0, 1fr) minmax(150px, 220px); gap: 12px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line-soft); }
.prow.head { border-top: 0; padding: 2px 0 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--mute); }
.prow input, .prow select { width: 100%; min-width: 0; }
.prow .pacct { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .prow { grid-template-columns: 1fr; gap: 4px; } .prow.head { display: none; } }

label.file { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); padding: 6px 12px;
             color: var(--text); font-weight: 500; cursor: pointer; background: var(--panel); min-height: 32px; display: inline-flex; align-items: center; }
label.file:hover { background: var(--raised); }
label.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
td.actions { white-space: nowrap; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.update-bar { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin: 0 0 14px; font-size: 14px; }
tr.muted-row td:first-child { color: var(--dim); }
.check input[type=number] { width: 64px; margin: 0 2px; }

/* ---- public page (/stats) ---------------------------------------------------------- */

.roster-names { color: var(--mute); font-size: 12px; white-space: normal; }
.roster-names a { color: var(--dim); text-decoration: none; }
.roster-names a:hover { color: var(--text); text-decoration: underline; }
.controls { display: flex; gap: 10px 16px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.controls label { color: var(--mute); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.series { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.series b { font-size: 18px; font-weight: 600; }
.series .meta { color: var(--mute); font-size: 13px; }
.series-row { padding: 12px 0; border-top: 1px solid var(--line-soft); }
.series-row:first-of-type { border-top: 0; padding-top: 0; }
.series-row .chips { margin-top: 6px; }
body.public section > h2 { margin-bottom: 12px; }
body.public h3 { margin-bottom: 12px; display: flex; gap: 12px; align-items: baseline; }
body.public h3 small { color: var(--mute); font-weight: 400; }
.row { display: flex; gap: 8px 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.note { color: var(--mute); font-size: 13px; margin: 0 0 12px; }

/* ---- small screens ------------------------------------------------------------------ */

@media (max-width: 700px) {
  header { padding: 0 16px; } main { padding: 16px; }
  nav { margin-left: 0; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  section { padding: 14px 16px; }
  .bug { grid-template-columns: minmax(0, 1fr) 84px minmax(0, 1fr); min-height: 60px; }
  .bug-side { padding: 0 12px; } .bug-side b { font-size: 28px; } .bug-name { font-size: 14px; } .bug-clock { font-size: 18px; }
  .page-head { align-items: flex-start; }
}

/* ---- event: schedule, groups, bracket (public page) ---------------------------------- */

.logo { width: 22px; height: 22px; object-fit: contain; flex: none; vertical-align: middle; }
.logo.none { display: inline-block; border-radius: 4px; background: var(--raised); }
.logo.big { width: 72px; height: 72px; }
.pill.stream { background: rgba(145, 70, 255, .15); color: #c4a5ff; text-decoration: none; }
.pill.stream:hover { background: rgba(145, 70, 255, .3); }

.hero { padding: 20px 24px; }
.hero-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.hero-match { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; margin: 18px 0; }
.hero-team { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 18px; min-width: 0; }
.hero-score { font: 48px/1 var(--display); text-align: center; display: flex; flex-direction: column; align-items: center; }
.hero-score small { font-size: 13px; font-weight: 500; color: var(--mute); }
.watch { display: inline-block; padding: 8px 14px; border-radius: var(--r); background: #9146ff; color: #fff; font-weight: 600; text-decoration: none; }
.watch:hover { background: #7d2ff7; }

.slot { padding: 6px 0 10px; border-top: 1px solid var(--line-soft); }
.slot:first-of-type { border-top: 0; }
.slot-time { font-weight: 600; margin: 4px 0 2px; }
.mrow { display: grid; grid-template-columns: 120px minmax(0, 1fr) 64px minmax(0, 1fr) 150px; gap: 10px; align-items: center; padding: 6px 0; }
.mrow + .mrow { border-top: 1px solid var(--line-soft); }
.mwhen { color: var(--mute); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mteam { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.mrow .mteam.first { justify-content: flex-end; text-align: right; }
.mteam.tbd { color: var(--mute); }
.tname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tname .abbr { display: none; }
.mscore { text-align: center; font-weight: 700; }
.mscore.vs { color: var(--mute); font-weight: 500; }
.mscore.live { color: var(--good); }
.mmeta { display: flex; gap: 6px; justify-content: flex-end; }
.mrow.final .mteam { color: var(--dim); }
details summary { cursor: pointer; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary h2.inline { display: inline; }
details summary::after { content: '  ▾'; color: var(--mute); }
details[open] summary { margin-bottom: 8px; }

.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 560px), 1fr)); gap: 16px; }
.gmatches .tname .full { display: none; } .gmatches .tname .abbr { display: inline; }
.groups > section { margin: 0; border-top: 4px solid var(--red); }
.gtable th:nth-child(2), .gtable td:nth-child(2) { text-align: left; }
.gtable td:first-child { color: var(--mute); width: 24px; }
.gtable tr.adv td:first-child, table.gmini tr.adv td:first-child { background: var(--red); color: #fff; font-weight: 700; text-align: center; padding-left: 0; padding-right: 0; }
.gtable tr.adv.lower td:first-child, table.gmini tr.adv.lower td:first-child { background: var(--maroon); }
.group .note { margin: 8px 0 10px; }
.gmatches .mrow { grid-template-columns: 70px minmax(0, 1fr) 48px minmax(0, 1fr) 90px; font-size: 13px; }

.bracket { display: flex; gap: 20px; align-items: stretch; min-width: max-content; padding-bottom: 4px; }
.bround { display: flex; flex-direction: column; width: 220px; }
.bround-name { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.bround-name small { color: var(--mute); font-weight: 400; }
.bsets { display: flex; flex-direction: column; justify-content: space-around; gap: 12px; flex: 1; }
.bset { background: var(--raised); border-radius: var(--r); padding: 4px 0; position: relative; }
.bset { border: 1px solid transparent; }
.bset.live { border-color: rgba(74, 222, 128, .45); }
.bset .pill.stream { position: absolute; top: -9px; right: 8px; font-size: 11px; }
.bteam { display: grid; grid-template-columns: 22px minmax(0, 1fr) 24px; gap: 8px; align-items: center; padding: 5px 10px; }
.bteam b { text-align: right; }
.bteam.won { font-weight: 600; }
.bteam.won b { color: var(--good); }
.bteam.lost { color: var(--mute); }

@media (max-width: 760px) {
  .mrow { grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr); }
  .mrow .mwhen, .mrow .mmeta { grid-column: 1 / -1; }
  .mrow .mmeta { justify-content: flex-start; }
  .tname .full { display: none; } .tname .abbr { display: inline; }
  .groups { grid-template-columns: 1fr; }
  .hero-team { font-size: 14px; } .logo.big { width: 48px; height: 48px; } .hero-score { font-size: 26px; }
}

/* ---- admin event: groups and bracket boards with a set panel ------------- */

button.xs { min-height: 24px; padding: 1px 8px; font-size: 12px; }
.ev-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.ev-head .ev-status { justify-content: flex-end; }
.ev-sep { width: 1px; height: 18px; background: var(--line); }
/* Seating: the session buttons alone on the first line, everything that changes on the second. */
.seat-head { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.ev-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.ev-main { min-width: 0; }
.legend { display: flex; gap: 6px 18px; flex-wrap: wrap; font-size: 12px; color: var(--mute); margin-bottom: 12px; }
.mark { font-size: 11px; font-weight: 700; min-width: 14px; text-align: center; }
.m-ready { color: var(--good); } .m-done { color: var(--mute); } .m-live { color: var(--good); letter-spacing: .04em; }
.m-warn { color: var(--warn); } .m-bad { color: var(--bad); }

.gboard { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1250px) { .gboard { grid-template-columns: 1fr; } }

/* Event, Schedule view: running late, the public notice, and every group match's time. */
.sched-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; padding: 14px 16px; }
.sched-tool { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sched-tool .tools { margin-top: 4px; }
input.num { width: 70px; }
input.grow { flex: 1; min-width: 200px; }
table.sched-table td { vertical-align: middle; padding-top: 5px; padding-bottom: 5px; }
table.sched-table tr.on td { background: var(--raised); }
table.sched-table tr.sched-day td { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); padding-top: 14px; }
.sched-match { display: inline-flex; align-items: center; gap: 10px; }
.sched-match b { font-variant-numeric: tabular-nums; min-width: 28px; text-align: center; }
input.time { width: 112px; min-height: 28px; padding: 2px 6px; }
input.time.moved { border-color: rgba(251, 191, 36, .45); color: var(--warn); }
.gcard { margin: 0; }
table.gmini { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 12px; }
table.gmini td { padding: 4px 6px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
table.gmini td:first-child { width: 18px; }
table.gmini td:nth-child(n+3) { text-align: right; }
table.gmini tr.adv td:nth-child(2) { font-weight: 600; }
table.gmini tr:nth-child(3) td { border-bottom-color: var(--line); }
.gsets { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
button.gset { display: flex; align-items: center; gap: 8px; text-align: left; background: var(--raised); border: 1px solid transparent; font-size: 12px; min-height: 30px; padding: 4px 8px; }
.gset-teams { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stream-dot { color: var(--mute); font-size: 9px; }

.bboard .bcols { display: flex; gap: 12px; min-width: max-content; padding-bottom: 4px; }
.bcol { width: 140px; display: flex; flex-direction: column; }
.bcol-name { font-size: 12px; font-weight: 600; color: var(--dim); margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bcol-sets { display: flex; flex-direction: column; justify-content: space-around; gap: 10px; flex: 1; }
button.setcard { display: block; position: relative; width: 100%; padding: 4px 0; text-align: left; background: var(--raised); border: 1px solid transparent; font-weight: 400; }
.setcard .mark { position: absolute; top: -8px; right: 6px; background: var(--panel); border-radius: var(--r); padding: 0 5px; line-height: 16px; }
.setcard .mark:empty { display: none; }
.sc-team { display: flex; align-items: center; gap: 8px; padding: 3px 10px; font-size: 13px; }
.sc-team .logo { width: 18px; height: 18px; }
.sc-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-team.won { font-weight: 600; }
.sc-team.lost, .sc-team.tbd { color: var(--mute); }
table.gmini td:nth-child(2) { text-align: left; width: 100%; }

button.setcard:hover, button.gset:hover { background: #26272c; border-color: var(--line); }
button.setcard.live, button.gset.live { border-color: rgba(74, 222, 128, .45); }
button.setcard.on, button.gset.on { background: var(--raised); color: var(--text); border: 1px solid #fff; box-shadow: 0 0 0 1px #fff; }

.setpanel { position: sticky; top: 16px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.setpanel.empty { padding: 32px 18px; text-align: center; }
.setpanel .empty { margin: 0; }
.sp-match { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.sp-team { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: 13px; min-width: 0; }
.sp-team .logo.big { width: 56px; height: 56px; }
.sp-score { font: 32px/1 var(--display); white-space: nowrap; }
.sp-status { margin: 0; font-size: 13px; }
.sp-status.ok { color: var(--good); } .sp-status.warn { color: var(--warn); }
.sp-games { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.sp-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
select.sp-series { max-width: 190px; font-size: 12px; min-height: 26px; padding: 2px 6px; }
.sp-game { display: grid; grid-template-columns: 24px 44px 1fr auto; align-items: center; gap: 8px; font-size: 13px; }
select.sp-add { width: 100%; font-size: 12px; color: var(--dim); }
.sp-meta { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line-soft); padding-top: 12px; font-size: 13px; }
.sp-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sp-actions p { margin: 0; width: 100%; }
button:disabled { opacity: .45; cursor: default; }

@media (max-width: 1000px) {
  .ev-layout { grid-template-columns: 1fr; }
  .setpanel { position: static; }
}

/* ---- public front page: the bracket, small ------------------------------- */

.front-bracket { margin-bottom: 16px; }
.fb-head { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 2px 10px; }
.fb-head a { font-size: 13px; text-decoration: none; }
.front-bracket section.compact { padding: 12px 16px; margin-bottom: 10px; }
.front-bracket section.compact h2 { font-size: 12px; color: var(--mute); font-weight: 600; margin-bottom: 8px; }
.bracket.compact { gap: 12px; }
.bracket.compact .bround { width: 128px; }
.bracket.compact .bround-name { font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bracket.compact .bsets { gap: 8px; }
.bracket.compact .bteam { grid-template-columns: 16px minmax(0, 1fr) 16px; gap: 6px; padding: 2px 8px; font-size: 12px; }
.bracket.compact .bteam .logo { width: 16px; height: 16px; }
.bracket.compact .bset .pill.stream { font-size: 10px; padding: 0 6px; top: -8px; right: 4px; }

/* Equal-width digits only where numbers line up. In some fonts this setting also
   widens hyphens, so it stays off for names and sentences. */
table.stat td:not(:first-child), table.gtable td:nth-child(n+3), table.gmini td:nth-child(n+3), .mscore, .hero-score, .sp-score,
.bteam b, .sc-team b, .bug-clock, .bug-mid { font-variant-numeric: tabular-nums; }

/* ---- Teams and Games pages ------------------------------------------------ */

select.unset { color: var(--warn); border-color: rgba(251, 191, 36, .35); }
td.right { text-align: right; }
.reg-table tr.needs-link td:nth-child(2) b { color: var(--text); }
.reg-table select { max-width: 340px; }

/* Registered teams: cards in rows across the groups, so every row lines up; the link area sits at the bottom. */
.reg-groups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; align-items: stretch; }
.reg-group-name { font-size: 12px; font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: .06em; align-self: end; }
.reg-card { background: var(--raised); border: 1px solid transparent; border-left: 3px solid var(--line); border-radius: var(--r); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.reg-card.linked { border-left-color: var(--good); }
.reg-card.suggested { border-left-color: var(--gold); }
.reg-card.needs-link { border-left-color: var(--warn); }
.reg-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.reg-top .logo { width: 28px; height: 28px; }
.reg-name { min-width: 0; flex: 1; }
.reg-name b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reg-state { font-weight: 700; color: var(--good); }
.reg-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.reg-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--mute); }
.reg-label.warn { color: var(--warn); }
.reg-card select { width: 100%; background: var(--panel); font-size: 13px; }
.reg-card select.quiet { color: var(--mute); border-color: transparent; background: transparent; min-height: 26px; padding: 2px 4px; font-size: 12px; }
.reg-card select.quiet:hover, .reg-card select.quiet:focus { border-color: var(--line); color: var(--text); }
.reg-sug { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px;
           background: rgba(209, 177, 121, .08); border: 1px solid rgba(209, 177, 121, .3); border-radius: var(--r); padding: 6px 8px; }
.reg-sug-text { min-width: 0; }
.reg-sug-text .reg-label { color: var(--gold); display: block; }
.reg-sug-text b, .reg-sug-text .small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

table.roster-table td { vertical-align: middle; }
table.roster-table td.small { white-space: normal; color: var(--dim); min-width: 200px; }
table.roster-table input.team-name { font-weight: 600; width: 220px; background: transparent; border-color: transparent; }
table.roster-table input.team-name:hover, table.roster-table input.team-name:focus { border-color: var(--line); background: var(--panel); }
table.roster-table select { max-width: 280px; }
table.roster-table tr.open td { background: var(--raised); }
table.roster-table tr.roster-edit td { background: var(--raised); border-top: 0; padding: 4px 14px 14px; white-space: normal; }
td.nowrap { white-space: nowrap; }

.series-card { padding: 14px 20px 8px; }
.series-card.open { border-color: rgba(74, 222, 128, .25); }
.series-head { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(240px, 1.2fr) auto; gap: 10px 20px; align-items: center; margin-bottom: 6px; }
.series-name { display: flex; align-items: center; gap: 12px; }
.series-name input[type=text] { font-weight: 600; width: 160px; }
.series-name input[type=number] { width: 56px; }
.series-score { display: flex; align-items: center; gap: 10px; font-size: 15px; white-space: nowrap; overflow: hidden; }
.series-score b { font-size: 17px; font-variant-numeric: tabular-nums; }
.series-meta { display: flex; align-items: center; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
select.match-select { max-width: 360px; }
table.games-table td { padding-top: 6px; padding-bottom: 6px; }
table.games-table td:first-child { width: 110px; }
table.games-table select.move { max-width: 190px; font-size: 13px; min-height: 28px; padding: 2px 6px; }

.assign-ask { background: rgba(251, 191, 36, .06); border: 1px solid rgba(251, 191, 36, .3); border-radius: var(--r); padding: 12px 14px; margin: 8px 0 10px; }
.assign-ask p { margin: 0 0 8px; font-size: 13px; }
.assign-ask .tools button { white-space: normal; text-align: left; }
.setpanel .assign-ask { margin: 4px 0; }
@media (max-width: 600px) { .reg-groups { grid-template-columns: 1fr; } .reg-groups > * { order: var(--o1); } .reg-gap { display: none; } }

.ev-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

@media (min-width: 601px) and (max-width: 1000px) { .reg-groups > * { order: var(--o2); } }
@media (max-width: 1000px) {
  .reg-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .series-head { grid-template-columns: 1fr; }
  .series-meta { justify-content: flex-start; }
}

/* ---- public Stats page: at a glance, leaders, charts, players --------------- */

.logo.mid { width: 28px; height: 28px; }
.two { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; margin-bottom: 16px; }
.two > section { flex: 1 1 380px; min-width: 0; margin: 0; }
.two > section:first-child { flex: 999 1 640px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.section-head > a { font-size: 13px; text-decoration: none; }
.controls.tight { margin: 0; }
.controls input[type=search] { width: 170px; }
.legend-inline { display: inline-flex; gap: 14px; font-size: 12px; color: var(--dim); flex-wrap: wrap; }
.legend-inline > span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 12px; height: 8px; border-radius: 2px; }
.sw.for { background: var(--gold); }
.sw.against { background: var(--dim); }
.sw.line { width: 2px; height: 12px; background: var(--text); }

.bar { display: block; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 0; background: var(--gold); }
.bar.for, .bar.against { height: 10px; background: transparent; flex: 1; }
.bar.against > span { background: var(--dim); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; background: none; border: 0; padding: 0; }
.kpi { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 14px 18px; }
.kpi-label { color: var(--dim); font-size: 13px; font-weight: 500; }
.kpi-value { font: 40px/1.1 var(--display); color: #fff; font-variant-numeric: tabular-nums; }
.kpi-sub { color: var(--dim); font-size: 13px; }

.lead-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lead-card { background: var(--raised); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.lead-label { color: var(--dim); font-size: 13px; font-weight: 600; }
.lead-top { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.lead-top .logo { width: 40px; height: 40px; }
.lead-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lead-who b { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-who small { color: var(--dim); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-value { font: 40px/1 var(--display); color: #fff; font-variant-numeric: tabular-nums; }
.lead-top:hover b { text-decoration: underline; }
.lead-rest { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.lead-rest li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 13px; }
.lead-rest .logo { width: 18px; height: 18px; }
.lead-name { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lead-name a { color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-name a:hover { text-decoration: underline; }
.lead-rest b { font-variant-numeric: tabular-nums; min-width: 36px; text-align: right; }

.hl-wrap { display: flex; flex-direction: column; gap: 10px; }
.hl-wrap h2 { margin: 0 0 4px; }
.hl { background: var(--red); color: #fff; border-radius: var(--r); padding: 12px 16px; display: flex; align-items: center; gap: 14px; }
.hl-big { font: 36px/1 var(--display); min-width: 84px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hl-big small { font: 700 13px var(--font); color: #fff; }
.hl .dim { color: #fff; }

.boards { margin-bottom: 16px; }
.boards-title { font-size: 13px; color: var(--dim); margin: 6px 0 10px; }
.boards .leaders li span:first-child .bar { margin-top: 4px; }

.tb-rows { display: flex; flex-direction: column; gap: 10px; }
.tb-row { display: grid; grid-template-columns: 28px minmax(110px, 190px) 44px minmax(0, 1fr) 40px; gap: 12px; align-items: center; }
.tb-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-bars { display: flex; flex-direction: column; gap: 3px; }
.tb-bar { display: flex; align-items: center; gap: 8px; font-size: 12px; font-variant-numeric: tabular-nums; }
.tb-bar small { min-width: 18px; }
.tb-gd { text-align: right; font-variant-numeric: tabular-nums; }

.tm-wrap { display: flex; flex-direction: column; }
.tm-wrap h2 { margin: 0; }
.tm-wrap > p { margin: 2px 0 14px; }
.tm-chart { flex: 1; min-height: 220px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; align-items: stretch; }
.tm-col { display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 6px; text-align: center; min-width: 0; }
.tm-col b { font-size: 13px; font-variant-numeric: tabular-nums; }
.tm-bar { display: block; background: var(--gold-dim); }
.tm-bar.top { background: var(--gold); }
.tm-col small { color: var(--dim); font-size: 12px; line-height: 1.2; min-height: 30px; }

.pt-wrap { padding-left: 0; padding-right: 0; }
.pt-wrap > .section-head, .pt-wrap > h2.pad { padding: 0 20px; }
table.ptable { width: 100%; min-width: 900px; border-collapse: collapse; }
table.ptable td:not(.who) { font-variant-numeric: tabular-nums; }
table.ptable th { padding: 0 6px 6px; }
table.ptable th button { background: none; border: 0; padding: 4px; min-height: 0; color: var(--mute); font-size: 12px; font-weight: 500; white-space: nowrap; }
table.ptable th button:hover { color: var(--text); background: none; }
table.ptable th.sorted button { color: var(--text); font-weight: 600; }
table.ptable td { padding: 8px 10px; }
table.ptable .rank { text-align: left; color: var(--mute); padding-left: 20px; width: 40px; }
table.ptable .who { text-align: left; }
table.ptable td.who a { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
table.ptable td.who a:hover b { text-decoration: underline; }
table.ptable td.who small { color: var(--mute); font-size: 12px; }
table.ptable td:last-child, table.ptable th:last-child { padding-right: 20px; }
table.ptable td.sorted { font-weight: 600; }
.cell-bar { display: inline-flex; align-items: center; gap: 10px; justify-content: flex-end; }
.cell-bar .bar { width: 90px; height: 6px; }
table.ptable td.won { color: #fff; font-weight: 600; }
table.ptable td.lost { color: var(--dim); }

.p-head { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: center; }
.p-id { display: flex; align-items: center; gap: 18px; flex: 1 1 320px; min-width: 0; }
.p-name { font: 64px/.9 var(--display); letter-spacing: 0; margin: 0; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.badge-pill { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: var(--r); background: var(--raised); }
.badge-pill.hi { background: rgba(143, 176, 255, .14); color: #b9cdff; }
.p-tiles { flex: 2 1 560px; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.p-tiles .kpi { background: var(--raised); border: 0; padding: 12px 14px; }
.p-tiles .kpi-value { font-size: 32px; }
.p-tiles .kpi-sub, .p-tiles .kpi-label { font-size: 12px; }

.cmp-wrap h2, .form-wrap h2 { margin: 0; }
.cmp-wrap > p, .form-wrap > p { margin: 2px 0 14px; }
.cmp-rows { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.cmp-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) 54px; gap: 12px; align-items: center; font-size: 13px; }
.cmp-row b { text-align: right; font-variant-numeric: tabular-nums; font-size: 14px; }
.cmp-track { position: relative; height: 14px; background: var(--line-soft); }
.cmp-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--gold); }
.cmp-avg { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--text); }

.form-wrap { display: flex; flex-direction: column; }
.form-wrap .legend-inline { margin-bottom: 10px; }
.form-chart { flex: 1; min-height: 220px; display: flex; gap: 8px; align-items: stretch; }
.form-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; text-align: center; }
.form-col b { font-size: 12px; font-variant-numeric: tabular-nums; }
.form-bar { display: block; background: var(--dim); }
.form-bar.won { background: var(--gold); }
.form-col .logo { width: 20px; height: 20px; align-self: center; }
.form-col small { color: var(--dim); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 760px) {
  .lead-grid { grid-template-columns: 1fr; }
  .controls select { max-width: 100%; min-width: 0; }
  .controls label { max-width: 100%; }
  .kpi { padding: 12px 14px; }
  .tb-row { grid-template-columns: 24px minmax(0, 1fr) 40px; }
  .tb-row .tb-bars { grid-column: 1 / -1; }
  .tb-row .dim { display: none; }
  .tm-col small { font-size: 10px; }
  .kpi-value { font-size: 32px; }
}

.head-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.team-cell { display: inline-flex; align-items: center; gap: 10px; }

/* The event's outside links in the top bar: its logo and name, outlined in the site's colour. */
.event-links { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.event-links a { --brand: var(--line); display: inline-flex; align-items: center; gap: 7px; color: var(--text); text-decoration: none;
  font-size: 13px; font-weight: 600; padding: 3px 11px 3px 7px; border-radius: var(--r); white-space: nowrap;
  border: 2px solid color-mix(in srgb, var(--brand) 70%, transparent); background: transparent; }
.event-links a:hover { border-color: var(--brand); color: #fff; }
.event-links img { width: 20px; height: 20px; object-fit: contain; background: transparent; }
@media (max-width: 760px) { .event-links { width: 100%; order: 3; } .event-links a { font-size: 12px; } }

/* The admin bar holds more: keep it on one line at laptop widths. */
body:not(.public) header nav { gap: 0; }
body:not(.public) header #logout { padding-left: 8px; padding-right: 8px; }
body:not(.public) #tabs button { padding-left: 8px; padding-right: 8px; }
body:not(.public) header #logout { padding-left: 6px; padding-right: 6px; min-height: 0; }

/* ---- seating: the room, seat by seat (admin and public) ------------------------- */

.floor-wrap { padding: 16px 18px 18px; }
.floor-top { text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--mute);
  background: var(--raised); border-radius: var(--r); padding: 6px; margin-bottom: 16px; }
.islands { display: grid; gap: 18px; min-width: 680px; }
.island { display: flex; flex-direction: column; gap: 6px; }
.island-head { display: grid; grid-template-columns: 1fr 8px 1fr; gap: 6px; text-align: center; font-size: 12px; font-weight: 600; color: var(--dim); }
.seat-pair { display: grid; grid-template-columns: 1fr 8px 1fr; gap: 6px; }
.table-strip { background: #0b0c0e; border-radius: 2px; }
.floor-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; font-size: 12px; color: var(--mute); }
.floor-desk { background: var(--raised); border-radius: var(--r); padding: 4px 40px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: 11px; }

.seat { display: flex; flex-direction: column; gap: 1px; min-height: 62px; min-width: 0; padding: 6px 9px; border-radius: var(--r); text-align: left;
  border: 1px solid transparent; background: var(--raised); color: var(--text); font: inherit; font-weight: 400; }
button.seat { cursor: pointer; }
button.seat:hover { border-color: var(--line); background: var(--raised); }
.seat-top { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 600; color: var(--dim); }
.seat-team { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-team .logo { width: 18px; height: 18px; flex: none; }
/* Every seat the same height, whatever it holds, so switching sessions never moves the room. */
.seat { height: 66px; justify-content: space-between; }
.seat-team, .seat small { height: 18px; line-height: 18px; }
.seat small { font-size: 11px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat.empty { background: transparent; border: 1px dashed var(--line); color: var(--mute); }
.seat.empty .seat-team { color: var(--mute); font-weight: 400; }
.seat.station { background: rgba(161, 161, 170, .1); }
.seat.station .seat-team { font-size: 12px; display: block; }
.seat.g-A { background: rgba(240, 160, 112, .14); }
.seat.g-B { background: rgba(143, 176, 255, .14); }
.seat.g-C { background: rgba(74, 222, 128, .11); }
.seat.g-D { background: rgba(251, 191, 36, .11); }
.seat.nopc { border-color: rgba(251, 191, 36, .45); }
.seat.sel, button.seat.sel:hover { border: 2px solid #fff; padding: 5px 8px; }
.seat.faded { opacity: .28; }
.seat.found { border-color: var(--text); }

.sdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--mute); flex: none; }
.sdot.sending { background: var(--blue-text); }
.sdot.online { background: var(--good); }
.sdot.offline { background: var(--bad); }
.sdot.nopc { background: var(--warn); }
.sdot.empty { background: transparent; }

.seat-layout { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.seat-layout > .floor-wrap { flex: 999 1 760px; min-width: 0; margin: 0; }
.station-box { border-top: 1px solid var(--line, rgba(127,127,127,.25)); padding-top: 10px; margin-top: 10px; display: grid; gap: 6px; }
.station-box .logo { width: 18px; height: 18px; vertical-align: middle; }
.seat-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.seat-panel { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.seat-panel.empty { text-align: center; padding: 28px 18px; }
.seat-panel h2 { margin: 0; }
.sp-who { display: flex; align-items: center; gap: 12px; }
.field.stack { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.field.stack select { width: 100%; }
.sp-facts { margin: 0; display: grid; grid-template-columns: 84px 1fr; gap: 6px 10px; font-size: 13px; }
.sp-facts dt { color: var(--dim); }
.sp-facts dd { margin: 0; }
.att-list { display: flex; flex-direction: column; gap: 2px; }
button.att-row { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 6px 4px; text-align: left; font-size: 13px; min-height: 0; color: var(--text); font-weight: 400; }
button.att-row:hover { background: var(--raised); }
.unseated { display: flex; align-items: center; gap: 10px; font-size: 13px; flex-wrap: wrap; }
.unseated > span { flex: 1; min-width: 0; }

.seat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px 16px; }
button.seat-li { display: flex; align-items: center; gap: 10px; background: none; border: 1px solid transparent; border-radius: var(--r); padding: 6px 8px;
  text-align: left; color: var(--text); font-weight: 400; min-height: 0; }
button.seat-li:hover, button.seat-li.on { background: var(--raised); border-color: var(--line); }
.seat-li-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-li b { font-variant-numeric: tabular-nums; }

.att-group { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.att-group .sdot { margin-top: 6px; }
.att-seats { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.att-seats button.xs { min-width: 36px; }
/* The admin bar, laid out like the public one: name, event links and the PC count on the left,
   the tabs on the right, then Public and Log out. */
body:not(.public) header { gap: 6px 10px; padding-top: 6px; padding-bottom: 6px; }
#bar-right { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; margin-left: auto; }
body:not(.public) header nav { margin-left: 0; }
body:not(.public) #status { font-size: 12px; }
body:not(.public) .event-links { gap: 4px; flex-wrap: nowrap; }
body:not(.public) .event-links a { font-size: 12px; padding: 2px 8px 2px 5px; gap: 5px; }
body:not(.public) .event-links img { width: 17px; height: 17px; }
body:not(.public) #public-link { padding: 4px 8px; font-size: 13px; }
body:not(.public) #tabs button { padding-left: 7px; padding-right: 7px; }
@media (max-width: 760px) { #bar-right { flex-wrap: wrap; } }
@media (max-width: 760px) { .islands { min-width: 860px; } }

.bteam.tbd { color: var(--mute); font-style: italic; }
.sc-team.tbd .sc-name { font-style: italic; font-size: 12px; }

.reg-players { display: flex; flex-wrap: wrap; gap: 4px; }
.reg-player { font-size: 12px; padding: 1px 7px; border-radius: var(--r); background: var(--panel); color: var(--dim); white-space: nowrap; }
.reg-player.epic { color: var(--text); }
.reg-player.seen { color: var(--good); background: rgba(74, 222, 128, .08); }

/* Deleted: Undo at the bottom of the page. */
#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 12px;
         max-width: calc(100vw - 32px); background: var(--raised); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px 10px 16px;
         box-shadow: 0 8px 28px rgba(0, 0, 0, .45); font-size: 13px; }
#toast[hidden] { display: none; }
#toast .toast-x { background: transparent; border: 0; color: var(--mute); font-size: 18px; padding: 0 4px; min-height: 0; }

/* The organisers' notice on the public page. */
.notice { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; background: rgba(251, 191, 36, .08); border: 1px solid rgba(251, 191, 36, .3);
          border-radius: var(--r); padding: 10px 14px; margin-bottom: 16px; }
.notice b { color: var(--warn); text-transform: uppercase; font-size: 12px; letter-spacing: .06em; }
.notice span { flex: 1; min-width: 200px; }
.notice small { color: var(--mute); }

/* Signed-in devices (Admin -> Settings) and the sign-in form's "keep me signed in". */
.devices { display: flex; flex-direction: column; gap: 6px; }
.device { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r); background: var(--raised); }
.device-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.device-main .small { flex-basis: 100%; }
#login label.remember { flex-direction: row; align-items: flex-start; gap: 8px; flex-wrap: wrap; color: var(--dim); }
#login label.remember small { flex-basis: 100%; margin-left: 24px; color: var(--mute); }

/* Queue: a match that is most likely the real event match. */
.pill.likely { color: var(--good); background: rgba(74, 222, 128, .1); }

/* Alerts under the top bar: a match running late, a playing team's PC down. */
#alerts { display: flex; flex-wrap: wrap; gap: 6px 10px; padding: 8px 24px; background: rgba(251, 191, 36, .07); border-bottom: 1px solid rgba(251, 191, 36, .25); }
#alerts[hidden], body.locked #alerts { display: none; }
#alerts .alert { display: inline-flex; align-items: center; gap: 8px; background: transparent; border: 1px solid rgba(251, 191, 36, .3); border-radius: var(--r);
                 padding: 3px 10px; font-size: 13px; color: var(--text); min-height: 28px; }
#alerts .alert:hover { background: rgba(251, 191, 36, .1); }
#alerts .alert b { color: var(--warn); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
#alerts .alert.alert-seat b { color: var(--bad); }

/* Ping: the PC shows its seat on screen; the map ticks it off. */
.seat small.ping-seen { color: var(--good); font-weight: 600; }
.seat small.ping-wait { color: var(--warn); }
.seat small.pc-off { color: var(--bad); }
.pc-seat { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pc-seat .logo { width: 18px; height: 18px; }
.sp-facts dd .pill { margin-left: 6px; }
.ping-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---- Stats: leaders and every player in one table (dashboard/statstable.js, both sites) ---- */
.st-title { margin: 4px 0 16px; }
.st-title h1 { font: 44px/.95 var(--display); text-transform: uppercase; color: #fff; margin: 0; }
.st-title p { color: var(--mute); margin: 6px 0 0; font-size: 13px; }
.st-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.st-games, .st-controls .field { display: inline-flex; align-items: center; gap: 8px; color: var(--dim); font-size: 13px; }
.st-wrap { padding: 0; overflow: hidden; }
.st-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 20px; border-bottom: 1px solid var(--line-soft); }
.st-label { color: var(--dim); font-size: 13px; }
.st-key { display: inline-flex; align-items: center; gap: 6px; color: var(--dim); font-size: 12px; }
.st-key i { width: 10px; height: 10px; background: var(--gold); border-radius: 1px; }
.st-find { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; color: var(--dim); font-size: 13px; }
.st-find input { width: 210px; max-width: 50vw; }
table.st-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; min-width: 860px; }
.st-table th, .st-table td { padding: 9px 8px; white-space: nowrap; }
.st-table th:first-child, .st-table td:first-child { padding-left: 20px; }
.st-table th:last-child, .st-table td:last-child { padding-right: 20px; }
.st-table .num { text-align: right; }
.st-table th.st-rank, .st-table td.st-rank, .st-table th.st-who, .st-table td.st-who { text-align: left; }
.st-leaders th { background: var(--bar); vertical-align: bottom; padding-top: 14px; padding-bottom: 10px; font-weight: 400; }
.st-leaders-title { text-align: left; font-size: 12px; font-weight: 700 !important; font-stretch: 115%; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.st-lead-v { font: 22px/1 var(--display); color: #fff; }
.st-lead-n { font-size: 12px; color: var(--gold); margin-top: 4px; max-width: 110px; margin-left: auto; overflow: hidden; text-overflow: ellipsis; }
.st-cols th { font-size: 12px; color: var(--dim); font-weight: 600; border-bottom: 1px solid var(--line-soft); }
.st-cols th button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 2px 0 4px; min-height: 0; color: inherit; font: inherit; cursor: pointer; }
.st-cols th button:hover { color: #fff; }
.st-cols th.sorted button { color: #fff; font-weight: 700; border-bottom-color: var(--red); }
.st-table tbody tr { border-top: 1px solid var(--line-soft); }
.st-table tbody tr:hover td { background: var(--raised); }
.st-table td.st-rank { color: var(--mute); width: 40px; }
.st-team { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.st-team .logo { width: 24px; height: 24px; flex: none; }
.st-team small { color: var(--mute); font-size: 11px; }
.st-name { color: var(--text); font-weight: 600; text-decoration: none; }
.st-name:hover { text-decoration: underline; }
.st-table td.sorted { font-weight: 700; color: #fff; }
.st-hot { display: inline-block; min-width: 34px; padding: 1px 6px; border-radius: 2px; background: rgba(209, 177, 121, .18); color: #ecd9b4; font-weight: 700; }
.st-note { color: var(--mute); font-size: 12px; padding: 10px 20px 12px; margin: 0; border-top: 1px solid var(--line-soft); }
.st-empty { text-align: center; padding: 40px 20px; }
.st-empty .big { font-size: 17px; font-weight: 600; margin: 0 0 6px; }
@media (max-width: 640px) { .st-find { margin-left: 0; width: 100%; } .st-find input { flex: 1; width: auto; max-width: none; } }

/* The event so far, at the bottom of the public Schedule page. */
.so-far { margin-top: 28px; }
.so-far-title { font: 28px/1 var(--display); text-transform: uppercase; margin: 0; }

/* ---- Seating: a bigger map, easier to click ---- */
.islands { gap: 24px; min-width: 900px; }
.island { gap: 8px; }
.seat-pair { gap: 8px; grid-template-columns: 1fr 10px 1fr; }
.seat { height: 82px; padding: 8px 11px; }
.seat-top { font-size: 12px; }
.seat-team { font-size: 17px; height: 24px; line-height: 24px; }
.seat-team .logo { width: 22px; height: 22px; }
.seat small { font-size: 12px; }
.seat.station .seat-team { font-size: 13px; }
.seat-layout > .floor-wrap { flex: 999 1 900px; }
.seat-side { flex: 0 0 400px; max-width: 100%; }
/* The seating page uses the whole width: a bigger map and its panel side by side. */
main#seating { max-width: none; }
.seat-team span, .seat-team b { overflow: hidden; text-overflow: ellipsis; }
.floor-wrap.moving button.seat { cursor: crosshair; }
.floor-wrap.moving button.seat:hover { border: 2px solid #fff; padding: 7px 10px; }
.move-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; border: 1px solid #fff; border-radius: var(--r); background: var(--raised); }

/* ---- Schedule: times that fit the theme, lined up with the table ---- */
input.time { background: var(--raised); color: var(--text); border: 1px solid var(--line); color-scheme: dark; font-variant-numeric: tabular-nums; }
input.time:hover { border-color: var(--dim); }
table.sched-table th:first-child, table.sched-table td:first-child { padding-left: 20px; width: 140px; }
table.sched-table td:last-child, table.sched-table th:last-child { text-align: center; width: 80px; }

/* ---- Settings: two columns that each stack ---- */
.settings-cols { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.settings-col { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.settings-col > section { margin: 0; }

/* ---- Brackets (both sites): start.gg's set letter, the two teams split by a line, lines between rounds ---- */
[data-bracket] { position: relative; }
svg.blines { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; z-index: 0; }
svg.blines path { fill: none; stroke: var(--line); stroke-width: 2; }
.bboard .bcols { gap: 36px; }
.bracket { gap: 40px; }
.bcol, .bround { position: relative; z-index: 1; }
.bcol { width: 168px; }
button.setcard { display: flex; align-items: stretch; padding: 0; overflow: visible; }
.setcard .sc-id, .bset .bset-id { flex: none; width: 22px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
  color: var(--dim); background: var(--bar); border-right: 1px solid var(--line-soft); border-radius: var(--r) 0 0 var(--r); }
.setcard .sc-rows, .bset .bset-rows { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.setcard .sc-team { padding: 5px 9px; }
.setcard .sc-team + .sc-team, .bset .bteam + .bteam { border-top: 1px solid var(--line-soft); }
.setcard .sc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bset { display: flex; align-items: stretch; padding: 0; border: 1px solid var(--line-soft); }
.bset .pill.stream { z-index: 2; }
.bsection + .bsection, .bboard + .bboard { margin-top: 8px; }
.bsection h2, .bboard h2 { display: flex; align-items: center; gap: 10px; }
.st-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.full-schedule details > summary { cursor: pointer; }
.sp-facts dd select { width: 100%; max-width: 100%; min-width: 0; }
.sp-facts { grid-template-columns: 90px minmax(0, 1fr); }

/* Games: room for a series' name and the move menu */
.series-name input[type=text] { width: 260px; max-width: 100%; }
table.games-table select.move { max-width: 260px; width: 240px; }

.trash-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.trash-head .hint { margin: 0; }

/* ---- Public bracket: one board (upper over lower, the grand final on the right), the series panel ---- */
main#view.wide { max-width: none; }
.xb-wrap { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 20px 24px; overflow-x: auto; margin-bottom: 16px; }
.xb-board { position: relative; }
.xb-board svg { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.xb-board path { fill: none; stroke: #303034; stroke-width: 2; }
.xb-board path.done { stroke: #5c5b61; }
.xb-board path.xb-hot { stroke: var(--red); stroke-width: 2.5; }
.xb-head { position: absolute; font-size: 11px; font-weight: 600; color: var(--dim); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.xb-head small { color: var(--mute); font-weight: 500; text-transform: none; }
.xb-head.big { font-size: 12px; font-weight: 800; color: var(--text); letter-spacing: .12em; }
.xb-meta { position: absolute; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--mute);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xb-meta .live, .xb-p-now .live { color: #ff4d5e; }
.xb-meta .stream { color: #c4a5ff; }
.xb-meta .ready { color: var(--gold); }
.xb-set { position: absolute; display: flex; padding: 0; margin: 0; background: #161616; border: 1px solid #2c2c2c; border-radius: 3px; overflow: hidden;
  cursor: pointer; text-align: left; color: var(--text); font: inherit; min-height: 0; }
.xb-set:hover { border-color: #5c5b61; background: #1a1a1a; }
.xb-set.stream { border-color: #9146ff; box-shadow: 0 0 0 1px rgba(145, 70, 255, .35); }
.xb-set.live { border-color: var(--red); box-shadow: 0 0 0 1px rgba(224, 1, 34, .4); }
.xb-set.skip { opacity: .45; }
.xb-id { width: 20px; flex: none; background: #222; color: var(--dim); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.xb-rows { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.xb-team { flex: 1; display: flex; align-items: center; gap: 8px; padding-left: 8px; min-width: 0; transition: background .12s; }
.xb-team + .xb-team { border-top: 1px solid var(--line-soft); }
.xb-team .logo { width: 18px; height: 18px; }
.xb-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; font-weight: 600; }
.xb-name small { color: var(--mute); font-weight: 500; font-size: 11px; margin-left: 6px; }
.xb-team.tbd .xb-name { font-style: italic; color: var(--mute); font-weight: 400; font-size: 12px; }
.xb-team.lost .xb-name { color: var(--mute); }
.xb-team.won .xb-name { font-weight: 800; color: #fff; }
.xb-sc { width: 30px; align-self: stretch; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px;
  background: #1d1d1d; color: var(--mute); font-variant-numeric: tabular-nums; }
.xb-team.won .xb-sc { background: var(--red); color: #fff; }
.xb-set.live .xb-sc { background: #2a2a2a; color: var(--text); }
.xb-team.xb-hl { background: #3a0d15; }
.xb-board.narrow .xb-name small { display: none; }
/* Phones: round by round */
.xb-list { display: flex; flex-direction: column; gap: 18px; }
.xb-round { margin: 0; }
.xb-round h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); margin-bottom: 10px; }
.xb-round h2 small { color: var(--mute); font-weight: 600; }
.xb-item + .xb-item { margin-top: 12px; }
.xb-item .xb-meta, .xb-item .xb-set { position: static; }
.xb-item .xb-meta { margin-bottom: 4px; }
.xb-item .xb-set { width: 100%; height: 62px; }
/* Champions and final placements */
.xb-champ-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.xb-champ { flex: 999 1 480px; min-width: 0; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; border: 1px solid var(--gold-dim); margin: 0; padding: 28px; }
.xb-champ .logo.huge { width: 104px; height: 104px; }
.xb-kicker { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.xb-champ-name { font: 48px/1.05 var(--display); text-transform: uppercase; color: #fff; margin-top: 6px; }
.xb-champ p { margin: 10px 0 0; }
.xb-place-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); column-gap: 8px; }
.xb-places { flex: 1 1 560px; min-width: 0; margin: 0; padding: 14px 0 6px; }
.xb-places h2 { padding: 0 18px; }
.xb-place { display: flex; align-items: center; gap: 10px; padding: 6px 18px; border-top: 1px solid var(--line-soft); font-size: 13px; }
.xb-place .logo { width: 20px; height: 20px; }
.xb-rank { width: 68px; font-weight: 700; color: var(--dim); font-size: 12px; }
.xb-place.first { font-weight: 800; }
.xb-place.first .xb-rank { color: var(--gold); }
/* The series panel */
.xb-back { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .65); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; }
.xb-modal { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; width: 780px; max-width: 100%; padding: 20px 24px 24px; box-sizing: border-box; }
.xb-p-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.xb-p-meta { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--mute); margin-top: 4px; }
.xb-p-meta .live { color: #ff4d5e; }
.xb-p-meta .stream { color: #c4a5ff; }
.xb-p-meta .ready { color: var(--gold); }
.xb-close { background: none; border: 1px solid var(--line); color: var(--dim); font-size: 20px; line-height: 1; width: 36px; height: 36px; padding: 0; }
.xb-close:hover { color: var(--text); }
.xb-p-match { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; margin: 18px 0 8px; }
.xb-p-team { display: flex; align-items: center; gap: 12px; min-width: 0; }
.xb-p-team.right { flex-direction: row-reverse; text-align: right; }
.xb-p-team .logo.big { width: 56px; height: 56px; }
.xb-p-team b { display: block; font-size: 17px; }
.xb-p-team small { color: var(--mute); }
.xb-p-team.lost b { color: var(--mute); }
.xb-p-score { font: 40px/1 var(--display); color: #fff; white-space: nowrap; }
.xb-p-now { text-align: center; font-weight: 600; margin: 4px 0 0; }
.xb-p-watch { text-align: center; margin-top: 8px; }
.xb-p-games { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 12px; }
.xb-g { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 14px; min-width: 76px; background: var(--raised); border: 1px solid var(--line-soft); }
button.xb-g.on { background: #2a2a2a; color: var(--text); border-color: var(--text); }
.xb-g small { color: var(--mute); font-size: 11px; }
.xb-g span { font-size: 17px; font-variant-numeric: tabular-nums; color: var(--mute); }
.xb-g b.w { color: #fff; }
.xb-p-tabs { margin-bottom: 10px; flex-wrap: wrap; }
table.xb-p-table { width: 100%; }
table.xb-p-table th, table.xb-p-table td { text-align: right; padding: 6px 8px; font-variant-numeric: tabular-nums; }
table.xb-p-table .who { text-align: left; }
table.xb-p-table td.top { color: #fff; font-weight: 800; }
.xb-p-teamrow td { text-align: left !important; font-weight: 700; padding-top: 14px !important; border-bottom: 1px solid var(--line-soft); }
.xb-p-teamrow .logo { width: 18px; height: 18px; margin-right: 8px; }
.xb-p-teamrow small { color: var(--mute); font-weight: 500; }
@media (max-width: 600px) {
  .xb-p-score { font-size: 28px; }
  .xb-p-team .logo.big { width: 36px; height: 36px; }
  .xb-p-team b { font-size: 14px; }
  .xb-champ-name { font-size: 32px; }
  .xb-champ .logo.huge { width: 72px; height: 72px; }
}

/* Bigger cards, for the TVs; the board itself is zoomed to fit the page */
.xb-wrap { padding: 22px 26px; }
.xb-board .xb-team .logo { width: 22px; height: 22px; }
.xb-board .xb-name { font-size: 15px; }
.xb-board .xb-name small { font-size: 12px; }
.xb-board .xb-team.tbd .xb-name { font-size: 13px; }
.xb-board .xb-sc { width: 36px; font-size: 17px; }
.xb-board .xb-id { width: 22px; font-size: 12px; }
.xb-board .xb-meta { font-size: 11.5px; }
.xb-board .xb-head { font-size: 12px; }
.xb-board .xb-head.big { font-size: 13px; }
/* Live now: the series being played, above the bracket */
.xb-live { background: none; border: 0; padding: 0; margin-bottom: 16px; }
.xb-live h2 { display: flex; align-items: center; gap: 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; margin: 0 2px 10px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff4d5e; box-shadow: 0 0 0 3px rgba(255, 77, 94, .2); }
.xb-live-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.xb-now { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--red); border-radius: var(--r);
  text-align: left; color: var(--text); font: inherit; min-height: 0; margin: 0; }
button.xb-now { cursor: pointer; }
button.xb-now:hover { background: #1a1a1a; }
.xb-now.stream { box-shadow: 0 0 0 1px #9146ff; }
.xb-now-head { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--dim); }
.xb-now-head .stream { color: #c4a5ff; }
.xb-now-team { display: flex; align-items: center; gap: 10px; }
.xb-now-team .logo { width: 26px; height: 26px; }
.xb-now-team b { font-size: 16px; }
.xb-now-name { flex: 1; min-width: 0; color: var(--mute); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xb-now-sc { font: 26px/1 var(--display); color: #fff; min-width: 24px; text-align: right; }
.xb-now-game { font-size: 13px; font-weight: 600; border-top: 1px solid var(--line-soft); padding-top: 6px; font-variant-numeric: tabular-nums; }
.xb-now-game .live { color: #ff4d5e; }
/* The series panel: team totals, bars from each side in toward the middle (broadcast style) */
.xb-modal { width: 900px; }
.xb-cmp { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 18px; }
.xb-cmp-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) 84px minmax(0, 1fr) 52px; align-items: center; gap: 10px; }
.xb-cmp-v { font-size: 18px; color: var(--mute); font-variant-numeric: tabular-nums; }
.xb-cmp-row .xb-cmp-v:first-child { text-align: right; }
.xb-cmp-v.lead { color: #fff; }
.xb-cmp-label { text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.xb-cmp-bar { height: 10px; background: #222; border-radius: 2px; display: flex; overflow: hidden; }
.xb-cmp-bar.left { justify-content: flex-start; }
.xb-cmp-bar.right { justify-content: flex-end; }
.xb-cmp-bar i { display: block; height: 100%; background: #55545a; transition: width .3s; }
.xb-cmp-bar i.lead { background: var(--red); }
.xb-sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.xb-side { min-width: 0; background: #131313; border: 1px solid var(--line-soft); border-radius: var(--r); padding: 10px 12px; }
.xb-side.won { border-color: var(--red); }
.xb-side-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.xb-side-head .logo { width: 22px; height: 22px; }
.xb-side.right .xb-side-head { flex-direction: row-reverse; }
.xb-side-won { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: var(--red); color: #fff; padding: 1px 6px; border-radius: 2px; }
.xb-side.right .xb-side-won { margin-right: auto; }
.xb-side:not(.right) .xb-side-won { margin-left: auto; }
.xb-side table.xb-p-table th, .xb-side table.xb-p-table td { padding: 5px 6px; }
@media (max-width: 700px) {
  .xb-sides { grid-template-columns: minmax(0, 1fr); }
  .xb-cmp-row { grid-template-columns: 40px minmax(0, 1fr) 64px minmax(0, 1fr) 40px; gap: 6px; }
}

/* ---- Admin set panel: the lobby sent to the two teams' PCs ---- */
.lobby { border-top: 1px solid var(--line-soft); margin-top: 14px; padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.lb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lb-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
.lb-grid label, .lb-note { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--mute); min-width: 0; }
.lb-grid input, .lb-grid select { width: 100%; box-sizing: border-box; font-size: 14px; }
.lb-grid input { font-family: Consolas, monospace; font-size: 15px; letter-spacing: .04em; }
.lb-note textarea { width: 100%; box-sizing: border-box; resize: vertical; background: var(--raised); color: var(--text); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 8px; font: inherit; font-size: 13px; }
.lb-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.lb-teams { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lb-team { background: var(--raised); border-radius: var(--r); padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lb-team .pill { margin-left: 6px; }
.lb-team label.check.ok { color: var(--good); }
.lb-grid input { background: var(--raised); color: var(--text); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 8px; }

.scale-row { display: flex; align-items: center; gap: 12px; }
.scale-row input[type=range] { flex: 1; max-width: 260px; accent-color: var(--red); }
.scale-val { width: 48px; font-variant-numeric: tabular-nums; color: var(--dim); }

/* ---- Bracket, round 3: the upper/lower break, the hovered live set, bigger Live now, the broadcast-style series panel ---- */
.xb-divider { position: absolute; left: 0; height: 1px; background: var(--line); }
.xb-head.big { color: #fff; }
.xb-set.xb-focus { border-color: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }
.xb-live-row { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; }
.xb-now { gap: 10px; padding: 16px 18px; }
.xb-now-head { font-size: 12px; }
.xb-now-head .live { color: #ff4d5e; }
.xb-now-team { gap: 12px; }
.xb-now-team .logo { width: 36px; height: 36px; }
.xb-now-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.xb-now-who b { font-size: 18px; line-height: 1.1; }
.xb-now-name { font-size: 12.5px; }
.xb-now-sc { font: 40px/1 var(--display); min-width: 30px; }
.xb-now-team.behind .xb-now-sc, .xb-now-team.behind b { color: var(--dim); }
.xb-now-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line-soft); padding-top: 10px;
  font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.xb-now-foot .live { color: #ff4d5e; }
.xb-modal { width: 1060px; padding: 26px 32px 30px; }
.xb-kicker { font-size: 13px; }
.xb-p-team .logo.big { width: 72px; height: 72px; }
.xb-p-team b { font-size: 21px; }
.xb-p-team small { font-size: 13px; }
.xb-p-mid { display: flex; align-items: center; gap: 16px; }
.xb-p-score { font-size: 54px; }
.xb-p-boxes { display: flex; gap: 5px; }
.xb-p-boxes i { width: 16px; height: 16px; border: 2px solid #3a3a40; border-radius: 2px; box-sizing: border-box; }
.xb-p-boxes i.on { background: var(--red); border-color: var(--red); }
.xb-p-games { display: flex; flex-direction: column; gap: 6px; margin: 22px 0 18px; }
.xb-p-all { display: flex; justify-content: center; margin-bottom: 4px; }
.xb-p-game { display: grid; grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr); align-items: center; gap: 10px; }
.xb-p-game .left { display: flex; justify-content: flex-end; }
.xb-p-game .right { display: flex; justify-content: flex-start; }
.xb-p-gn { text-align: center; font-size: 12px; font-weight: 800; color: var(--dim); background: #222; border-radius: 3px; padding: 4px 0; }
.xb-p-gn.live { color: #fff; background: var(--red); }
button.xb-gc { display: inline-flex; align-items: center; gap: 6px; padding: 6px 16px; min-width: 120px; justify-content: center; background: var(--raised);
  border: 1px solid var(--line-soft); color: var(--mute); font-size: 18px; font-variant-numeric: tabular-nums; }
button.xb-gc b.w { color: #fff; }
button.xb-gc small { font-size: 11px; font-weight: 700; color: var(--gold); }
button.xb-gc.all { font-size: 13px; font-weight: 700; color: var(--dim); min-width: 0; }
button.xb-gc.on { background: #2a2a2a; border-color: var(--text); color: var(--text); }
.xb-p-game .left button.xb-gc { border-right: 3px solid var(--red); }
.xb-p-game .right button.xb-gc { border-left: 3px solid var(--red); }
.xb-cmp-v { font-size: 20px; }
.xb-cmp-label { font-size: 12px; }
.xb-side table.xb-p-table th, .xb-side table.xb-p-table td { font-size: 14px; padding: 6px 7px; }
@media (max-width: 700px) { .xb-p-score { font-size: 32px; } .xb-p-boxes i { width: 11px; height: 11px; } .xb-p-team .logo.big { width: 40px; height: 40px; } .xb-p-team b { font-size: 15px; } }

/* ---- Bracket board (both sites): upper and lower as two panels ---- */
.xb-boards { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.xb-boards .xb-wrap { margin: 0; }
.xb-side-title { font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #fff; margin: 0 0 14px; }
.xb-fit { overflow-x: auto; }
.xb-set.xb-sel { border-color: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, .3); }
.xb-set.xb-bad { border-color: var(--bad); }
.xb-set.xb-warn { border-color: var(--warn); }
.xb-meta .ok { color: var(--good); }
.xb-meta .bad { color: var(--bad); }
.xb-meta .warn { color: var(--warn); }
.xb-meta .dim { color: var(--mute); }
.ev-main .xb-wrap { padding: 16px 18px; }
.xb-board path.reset-link { stroke-dasharray: 4 4; }
#alerts .alert.alert-disk b { color: var(--bad); }

/* ---- Admin: Visitors ---- */
.vkpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.vkpi { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.vkpi b { font: 30px/1.1 var(--display); color: #fff; }
.vhours { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 4px; height: 150px; align-items: end; }
.vhour { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.vhour i { display: block; width: 100%; min-height: 2px; background: var(--red); border-radius: 2px 2px 0 0; }
.vhour span { font-size: 10px; color: var(--mute); height: 12px; }
.vtable tbody tr { cursor: pointer; }
.vtable tbody tr.on td { background: var(--raised); }
