:root {
  color-scheme: dark;
  --bg: #090c14;
  --bg-deep: #070a10;
  --surface: #111620;
  --surface-2: #0d111a;
  --surface-3: #1a2230;
  --border: #29313e;
  --border-soft: rgba(163, 183, 207, .08);
  --text: #edf0f5;
  --muted: #a3adbf;
  --dim: #8b96a9;
  --amber: #ffc04a;
  --amber-strong: #ffcf70;
  --amber-soft: rgba(255, 192, 74, .09);
  --pink: #d84f9f;
  --blue: #3aa8ff;
  --green: #69d9ad;
  --red: #ff3a4a;
  --orange: #ff9b1c;
  --display: "Chakra Petch", sans-serif;
  --body: "Manrope", sans-serif;
  --mono: "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; overflow-x: hidden; background: var(--bg); color: var(--text); font-family: var(--body); }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -3; background: radial-gradient(circle at 79% 3%, rgba(58,168,255,.08), transparent 31rem), radial-gradient(circle at 12% 18%, rgba(255,192,74,.055), transparent 27rem), linear-gradient(145deg, transparent 50%, rgba(216,79,159,.025)); }
.grid-field { position: fixed; inset: 0; z-index: -2; pointer-events: none; opacity: .55; background-image: linear-gradient(rgba(163,194,204,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(163,194,204,.025) 1px, transparent 1px); background-size: 28px 28px; mask-image: linear-gradient(to bottom, #000 0, transparent 72%); }
.scanline { position: fixed; left: 0; right: 0; top: -20%; height: 16%; z-index: 9; pointer-events: none; opacity: .035; background: linear-gradient(transparent, var(--amber), transparent); animation: scan 12s linear infinite; }

.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 0 clamp(1rem, 4vw, 4.5rem); position: sticky; top: 0; z-index: 8; border-bottom: 1px solid var(--border); background: rgba(9,12,20,.89); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: .7rem; color: var(--text); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; color: var(--amber); border: 1px solid rgba(255,192,74,.3); border-radius: 7px; background: var(--amber-soft); }
.brand-mark svg { width: 31px; height: 31px; }
.brand-copy { display: grid; line-height: 1; }
.brand-copy strong { font: 700 1rem var(--display); letter-spacing: -.02em; }
.brand-copy small { margin-top: .32rem; color: var(--muted); font: 500 .52rem var(--mono); letter-spacing: .19em; }
.brand-cursor { color: var(--amber); font: 600 1.2rem var(--mono); animation: blink 1.05s steps(1) infinite; }
.event-state { display: flex; align-items: center; gap: .65rem; padding: .52rem .75rem; border: 1px solid var(--border); border-radius: 4px; background: var(--surface-2); color: var(--muted); font: 600 .64rem var(--mono); letter-spacing: .12em; }
.state-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--dim); }
.event-state[data-state="live"] { color: var(--green); border-color: rgba(105,217,173,.24); background: rgba(105,217,173,.06); }
.event-state[data-state="live"] .state-dot { background: var(--green); box-shadow: 0 0 0 5px rgba(105,217,173,.08); animation: pulse 1.6s ease-out infinite; }
.event-state[data-state="stopped"] .state-dot { background: var(--red); }
.event-state[data-state="suspended"] .state-dot { background: var(--orange); }

main { width: min(1460px, calc(100% - clamp(2rem, 7vw, 8rem))); margin: 0 auto; padding-bottom: 5rem; }
.hero { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(420px, .88fr); gap: clamp(3rem, 7vw, 7rem); align-items: center; min-height: 520px; padding: 4rem 0; border-bottom: 1px solid var(--border); }
.eyebrow { margin: 0 0 1rem; color: var(--muted); font: 500 .64rem var(--mono); letter-spacing: .15em; }
.eyebrow span { margin-right: .65rem; color: var(--amber); }
h1, h2 { margin: 0; font-family: var(--display); }
h1 { max-width: 760px; font-size: clamp(3.5rem, 7.4vw, 7.6rem); line-height: .84; letter-spacing: -.07em; text-transform: uppercase; }
h1 em { color: var(--amber); font-style: normal; font-weight: 500; }
.lede { max-width: 540px; margin: 1.8rem 0 0; color: var(--muted); font-size: .95rem; line-height: 1.8; }
.round-console { position: relative; overflow: hidden; border: 1px solid rgba(163,183,207,.14); border-radius: 10px; background: linear-gradient(145deg, rgba(24,33,40,.93), rgba(12,19,25,.96)); box-shadow: 0 24px 80px rgba(0,0,0,.34); }
.round-console::before { content: ""; position: absolute; width: 45px; height: 2px; left: 1.5rem; top: 0; background: var(--amber); }
.console-head, .console-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.5rem; color: var(--muted); font: 500 .58rem var(--mono); letter-spacing: .1em; }
.console-head { border-bottom: 1px solid var(--border); }
.console-code { color: var(--dim); }
.round-readout { min-height: 245px; display: grid; grid-template-columns: 1fr 150px 1fr; align-items: center; gap: 1rem; padding: 2rem 1.5rem; background: linear-gradient(rgba(163,194,204,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(163,194,204,.035) 1px, transparent 1px); background-size: 28px 28px; }
.metric-label { display: block; color: var(--muted); font: 500 .56rem var(--mono); letter-spacing: .12em; }
.round-readout strong { display: block; margin-top: .65rem; font: 600 clamp(2.1rem, 4vw, 3.5rem) var(--display); letter-spacing: -.045em; }
.countdown-wrap { text-align: right; }
.radar { position: relative; width: 138px; height: 138px; margin: auto; border-radius: 50%; border: 1px dashed rgba(163,183,207,.25); }
.radar-ring { position: absolute; inset: 19px; border: 1px solid rgba(255,192,74,.22); border-radius: 50%; }
.radar-ring-b { inset: 42px; border-color: rgba(58,168,255,.26); }
.radar::before, .radar::after { content: ""; position: absolute; top: 50%; left: 10px; right: 10px; height: 1px; background: rgba(163,183,207,.12); }
.radar::after { transform: rotate(90deg); }
.radar-core { position: absolute; inset: 50% auto auto 50%; z-index: 2; transform: translate(-50%, -50%); color: var(--amber); font: 600 1rem var(--mono); }
.radar-sweep { position: absolute; width: 50%; height: 50%; top: 0; right: 0; transform-origin: 0 100%; border-left: 1px solid rgba(255,192,74,.5); background: linear-gradient(135deg, rgba(255,192,74,.14), transparent 65%); animation: sweep 5s linear infinite; }
.console-foot { border-top: 1px solid var(--border); background: rgba(0,0,0,.12); letter-spacing: 0; }
.console-foot span:first-child { display: flex; align-items: center; gap: .5rem; }
.console-foot i { width: 4px; height: 4px; border-radius: 50%; background: var(--amber); }

.overview { display: grid; grid-template-columns: .8fr .8fr 1fr 1.55fr; border-bottom: 1px solid var(--border); }
.overview-cell { min-height: 150px; padding: 1.55rem; border-right: 1px solid var(--border); }
.overview-cell:last-child { border-right: 0; }
.overview-cell strong { display: block; margin-top: .5rem; font: 600 2.1rem var(--display); }
.overview-cell small { color: var(--dim); font-size: .67rem; }
.accent-cell strong { color: var(--amber); }
.progress-cell { display: flex; flex-direction: column; justify-content: center; }
.progress-copy { display: flex; justify-content: space-between; gap: 1rem; }
.progress-track { height: 5px; margin-top: 1.1rem; overflow: hidden; background: var(--surface-3); }
.progress-track span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--amber), var(--pink)); transition: width .65s cubic-bezier(.22,1,.36,1); }

.standings, .services { padding-top: 4rem; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 1.4rem; }
.section-heading .eyebrow { margin-bottom: .6rem; }
h2 { font-size: clamp(1.7rem, 3vw, 2.8rem); letter-spacing: -.04em; }
.legend { display: flex; flex-wrap: wrap; gap: 1.25rem; color: var(--muted); font: 500 .55rem var(--mono); letter-spacing: .08em; }
.legend span { display: flex; align-items: center; gap: .4rem; }
.legend i { width: 6px; height: 6px; border-radius: 50%; }
.legend .offense { background: var(--pink); }.legend .defense { background: var(--blue); }.legend .sla { background: var(--green); }
.board-shell { overflow: hidden; border: 1px solid var(--border); border-radius: 9px; background: rgba(17,22,32,.77); box-shadow: 0 18px 55px rgba(0,0,0,.2); }
.board-grid { display: grid; grid-template-columns: 82px minmax(320px, 1.7fr) repeat(3, minmax(94px, .48fr)) minmax(120px, .58fr); align-items: center; }
.board-head { min-height: 55px; padding: 0 1.2rem; border-bottom: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font: 500 .55rem var(--mono); letter-spacing: .11em; }
.board-head span:nth-child(n+3) { text-align: right; }
.team-row { min-height: 104px; padding: .8rem 1.2rem; position: relative; border-bottom: 1px solid var(--border-soft); animation: enter .52s cubic-bezier(.22,1,.36,1) both; transition: background .2s ease; }
.team-row:last-child { border-bottom: 0; }
.team-row:hover { background: rgba(255,255,255,.018); }
.team-row.is-first::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; background: var(--amber); }
.rank span { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 7px; color: var(--muted); font: 600 .85rem var(--mono); }
.is-first .rank span { color: #171006; border-color: var(--amber); background: var(--amber); }
.team-cell { display: grid; grid-template-columns: 44px minmax(110px, auto) 1fr; align-items: center; gap: .85rem; min-width: 0; }
.team-avatar { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 8px; color: var(--amber); background: var(--surface-2); font: 600 .72rem var(--display); }
.team-copy { display: grid; gap: .25rem; min-width: 0; }
.team-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.team-copy small { color: var(--dim); font: 400 .55rem var(--mono); }
.service-pills { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem; padding: 0 1rem; }
.service-pill { display: inline-flex; align-items: center; gap: .35rem; max-width: 145px; padding: .3rem .45rem; border: 1px solid var(--border); border-radius: 4px; color: var(--muted); background: var(--surface-2); font: 500 .5rem var(--mono); }
.service-pill i { width: 5px; height: 5px; flex: 0 0 auto; border-radius: 50%; background: var(--dim); }
.service-pill.success { color: var(--green); border-color: rgba(105,217,173,.18); }.service-pill.success i { background: var(--green); }
.service-pill.fail { color: var(--red); border-color: rgba(255,58,74,.18); }.service-pill.fail i { background: var(--red); }
.service-pill.warn { color: var(--orange); border-color: rgba(255,155,28,.2); }.service-pill.warn i { background: var(--orange); }
.score { text-align: right; font: 500 .9rem var(--mono); font-variant-numeric: tabular-nums; }
.offense-score { color: #e58ec2; }.defense-score { color: #7cc8ff; }.sla-score { color: var(--green); }
.total-score { color: var(--text); font: 600 1.2rem var(--display); }
.is-first .total-score { color: var(--amber); }
.empty-state { min-height: 230px; display: grid; place-items: center; align-content: center; gap: .5rem; color: var(--muted); text-align: center; }
.empty-state strong { color: var(--text); font: 600 1rem var(--display); }
.empty-state small { font-size: .7rem; }
.loader { width: 28px; height: 28px; margin-bottom: .6rem; border: 2px solid var(--border); border-top-color: var(--amber); border-radius: 50%; animation: spin .9s linear infinite; }
.error-state { color: var(--red); }

.section-heading.compact { margin-bottom: 1.2rem; }
.service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .8rem; }
.service-card { position: relative; min-height: 155px; padding: 1.3rem; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: linear-gradient(145deg, rgba(255,255,255,.025), transparent), var(--surface); }
.service-card::after { content: attr(data-index); position: absolute; right: .9rem; top: .5rem; color: rgba(163,183,207,.06); font: 700 4.5rem var(--display); }
.service-card .service-name { position: relative; z-index: 1; display: flex; align-items: center; gap: .6rem; font: 600 1rem var(--display); }
.service-card .service-name i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(105,217,173,.07); }
.service-stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-top: 1.8rem; }
.service-stats div { display: grid; gap: .28rem; }
.service-stats strong { font: 600 1.1rem var(--mono); }
.service-stats span { color: var(--dim); font: 500 .5rem var(--mono); letter-spacing: .08em; }

footer { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem clamp(1rem, 4vw, 4.5rem); border-top: 1px solid var(--border); color: var(--dim); background: var(--bg-deep); font: 400 .62rem var(--mono); }
.prompt { color: var(--muted); }.prompt b { color: var(--amber); }.prompt i { color: var(--blue); font-style: normal; }.prompt u { display: inline-block; width: 6px; height: 1em; margin-left: 3px; vertical-align: text-bottom; background: var(--amber); animation: blink 1.05s steps(1) infinite; }

@keyframes scan { to { transform: translateY(850%); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 70%, 100% { box-shadow: 0 0 0 10px rgba(105,217,173,0); } }
@keyframes sweep { to { transform: rotate(360deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 1050px) {
  .hero { grid-template-columns: 1fr; gap: 2.5rem; }
  .overview { grid-template-columns: repeat(2, 1fr); }
  .overview-cell:nth-child(2) { border-right: 0; }
  .overview-cell:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .board-shell { overflow-x: auto; }
  .board-head, .team-row { min-width: 930px; }
}

@media (max-width: 650px) {
  .topbar { height: 68px; }.brand-copy small { display: none; }
  main { width: min(100% - 2rem, 1460px); }
  .hero { min-height: 0; padding: 3rem 0; }
  h1 { font-size: clamp(3.1rem, 18vw, 5.2rem); }
  .round-readout { min-height: 210px; grid-template-columns: 1fr 78px 1fr; padding-inline: 1rem; }
  .radar { width: 76px; height: 76px; }.radar-ring { inset: 11px; }.radar-ring-b { inset: 26px; }
  .overview { grid-template-columns: 1fr 1fr; }.overview-cell { min-height: 125px; padding: 1.2rem; }
  .progress-cell { grid-column: 1 / -1; border-top: 1px solid var(--border); }
  .section-heading { align-items: flex-start; flex-direction: column; }
  footer { align-items: flex-start; flex-direction: column; }
}

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

/* ===== compact header readout ===== */
.topbar-readout { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.4rem); }
.topbar-readout .readout { text-align: right; }
.topbar-readout .readout strong { display: block; margin-top: .15rem; color: var(--text); font: 600 1.3rem var(--display); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.topbar-readout .readout:first-child strong { color: var(--amber); }
.tick-bar { height: 3px; background: var(--panel-3); }
.tick-bar span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--amber), var(--pink)); transition: width .5s cubic-bezier(.22,1,.36,1); }
@media (max-width: 650px) { .topbar-readout .readout { display: none; } }

/* ===== progression chart ===== */
.progression { padding-top: 2.4rem; }
.chart-card { padding: 1.4rem 1.4rem 1rem; border: 1px solid var(--border); border-radius: 9px; background: rgba(17,22,32,.77); box-shadow: 0 18px 55px rgba(0,0,0,.2); }
#chart-svg { width: 100%; height: clamp(220px, 32vw, 320px); display: block; }
#chart-svg .grid { stroke: var(--soft-border); stroke-width: 1; }
#chart-svg .ytick, #chart-svg .xtick { fill: var(--dim); font: 500 11px var(--mono); text-anchor: end; }
#chart-svg .xtick { text-anchor: start; }
.chart-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.3rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--soft-border); }
.legend-item { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); font: 500 .7rem var(--body); }
.legend-item i { width: 20px; height: 3px; border-radius: 2px; }

/* ===== board toolbar / tick nav ===== */
.board-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.tick-nav { display: flex; align-items: center; gap: .4rem; }
.tick-nav .nav-label { margin-right: .35rem; color: var(--muted); font: 500 .6rem var(--mono); letter-spacing: .09em; text-transform: uppercase; }
.tick-nav strong { min-width: 96px; text-align: center; color: var(--amber); font: 600 .9rem var(--display); }
.tick-nav button { width: 30px; height: 30px; padding: 0; border: 1px solid var(--border); border-radius: 5px; color: var(--muted); background: var(--panel); font: 500 1rem var(--mono); cursor: pointer; transition: .15s ease; }
.tick-nav button:hover:not(:disabled) { color: var(--amber); border-color: rgba(255,192,74,.45); transform: translateY(-1px); }
.tick-nav button:disabled { opacity: .3; cursor: not-allowed; }
.status-legend { display: flex; flex-wrap: wrap; gap: 1.2rem; color: var(--muted); font: 500 .58rem var(--mono); letter-spacing: .06em; }
.status-legend span { display: inline-flex; align-items: center; gap: .4rem; }

/* ===== dense A/D table (ECSC shape) ===== */
.board-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 9px; background: rgba(17,22,32,.77); box-shadow: 0 18px 55px rgba(0,0,0,.2); }
.board-table { width: 100%; border-collapse: collapse; }
.board-table .spacer { width: 100%; padding: 0; border: 0; }
.board-table thead th { position: sticky; top: 0; z-index: 2; padding: .75rem .7rem; vertical-align: middle; background: var(--panel-2); border-bottom: 1px solid var(--border); color: var(--muted); font: 500 .56rem var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.board-table th.c-rank { width: 56px; text-align: center; }
.board-table th.c-team { width: 230px; text-align: left; }
.board-table th.c-sum { width: 164px; text-align: left; }
.svc-col { width: 296px; text-align: center; border-left: 1px solid var(--border); }
.svc-col .svc-name { color: var(--text); font: 600 .9rem var(--display); letter-spacing: 0; text-transform: none; }
.svc-col .svc-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem .7rem; margin-top: .3rem; color: var(--dim); font: 500 .54rem var(--mono); letter-spacing: 0; text-transform: none; }

.board-table tbody tr { border-bottom: 1px solid var(--soft-border); transition: background .18s ease; }
.board-table tbody tr:last-child { border-bottom: 0; }
.board-table tbody tr:hover { background: rgba(255,255,255,.016); }
.board-table tbody tr.is-first { background: rgba(255,192,74,.035); }
.board-table td { padding: .85rem .7rem; vertical-align: middle; }
td.c-rank { text-align: center; }
.rankbox { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 7px; color: var(--muted); font: 600 .82rem var(--mono); }
.is-first .rankbox { color: #171006; border-color: var(--amber); background: var(--amber); }
td.c-team { display: flex; align-items: center; gap: .6rem; }
.team-dot { width: 4px; height: 34px; border-radius: 2px; flex: 0 0 auto; }
.team-avatar { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border: 1px solid var(--border); border-radius: 8px; color: var(--tc, var(--amber)); background: var(--panel-2); font: 600 .68rem var(--display); }
.team-copy { display: grid; gap: .15rem; min-width: 0; }
.team-copy strong { font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-copy small { color: var(--dim); font: 400 .54rem var(--mono); }
.team-total { color: var(--text); font: 600 .78rem var(--mono); font-variant-numeric: tabular-nums; }
.is-first .team-total { color: var(--amber); }

.c-sum { white-space: nowrap; }
.metric-stack { display: inline-grid; gap: .36rem; }
.metric-stack .m, .svc-grid .m { display: inline-flex; align-items: baseline; gap: .36rem; font: 500 .76rem var(--mono); font-variant-numeric: tabular-nums; }
.m i { width: 1.25em; text-align: center; color: #9fb0c4; font-size: .95em; }
.m b { color: var(--text); font-weight: 600; }
.m small { color: var(--dim); font-size: .82em; }

.svc-cell { border-left: 1px solid var(--soft-border); text-align: center; }
.svc-grid { display: inline-grid; grid-template-columns: auto auto; gap: .42rem 1.6rem; align-items: center; text-align: left; }
.svc-grid .m { justify-self: start; }
.flag { justify-self: end; display: inline-flex; align-items: baseline; gap: .3rem; color: var(--muted); font: 500 .72rem var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.flag i { width: 1.2em; text-align: center; color: #9fb0c4; font-size: .95em; }
.flag b { color: var(--text); font-weight: 600; }
.flag small { color: var(--dim); font-size: .82em; }
.svc-status { justify-self: end; display: inline-flex; align-items: center; gap: .5rem; }
.info-i { color: var(--blue); font-size: .95em; cursor: help; }
.team-total i { color: var(--amber); font-size: .86em; margin-right: .25em; }
td.c-team { padding-left: 1rem; }

/* checker-detail popup — solid/opaque so it's readable over the table */
.info-pop { position: absolute; z-index: 60; min-width: 200px; max-width: 320px; border: 1px solid #2e3647; border-radius: 9px; background: #0c1017; box-shadow: 0 16px 48px rgba(0,0,0,.72); overflow: hidden; }
.info-pop-head { padding: .55rem .85rem; background: #161d29; border-bottom: 1px solid #2e3647; color: var(--text); font: 600 .72rem var(--mono); letter-spacing: .03em; }
.info-pop-head.success { color: var(--green); } .info-pop-head.warn { color: var(--orange); } .info-pop-head.fail { color: var(--red); }
.info-pop-body { padding: .8rem .85rem; text-align: center; background: #0c1017; color: var(--text); font: 500 .8rem var(--body); white-space: pre-wrap; word-break: break-word; }

/* navbar logo */
.brand-logo { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 10px; object-fit: cover; border: 1px solid var(--border); }

/* per-team scoreboard avatar: uploaded logo over an initials fallback */
.team-id-wrap { display: flex; align-items: center; gap: 10px; }
.team-ava { position: relative; width: 34px; height: 34px; flex: 0 0 auto; }
.team-logo-fallback, .team-logo-img {
  position: absolute; inset: 0; width: 100%; height: 100%; box-sizing: border-box;
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font: 700 .72rem var(--body); letter-spacing: .3px; color: #05060a;
  border: 1px solid var(--border);
}
.team-logo-img { object-fit: cover; background: #0b0b12; }

/* first-blood celebration -- ported 1:1 from the CTFd tv-scoreboard plugin */
#audio-enable-overlay {
  position: fixed; inset: 0;
  background: rgba(7, 9, 13, .92);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; cursor: pointer;
  transition: opacity .3s ease;
}
#audio-enable-overlay.hidden { opacity: 0; pointer-events: none; }
#audio-enable-overlay .message {
  width: min(560px, calc(100vw - 2rem));
  border-radius: 1rem;
  border: 1px solid rgba(255, 184, 0, .3);
  background: linear-gradient(170deg, #11132a, #0a0b1d);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .55), 0 0 24px rgba(255, 184, 0, .12);
  padding: 2.25rem 2rem; text-align: center; color: #ecefff;
}
#audio-enable-overlay .message h2 { font-family: "Chakra Petch", sans-serif; font-size: 2.1rem; margin: 0 0 .75rem; }
#audio-enable-overlay .message p { font-size: 1.05rem; color: #9aa3c4; margin: 0 0 1.75rem; }
#audio-enable-overlay .message button {
  font-size: 1.05rem; padding: .85rem 2.25rem; background: #ffb800; border: none;
  border-radius: .5rem; color: #06121a; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease;
}
#audio-enable-overlay .message button:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(255, 184, 0, .35); }

#firstblood-announcement {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 184, 0, .22), rgba(5, 4, 20, .92) 56%),
    rgba(5, 4, 20, .9);
  backdrop-filter: blur(4px);
  color: #ecefff; opacity: 0; pointer-events: none;
  transform: scale(1.03);
  transition: opacity .45s ease, transform .45s ease;
  z-index: 1050; overflow: hidden;
}
#firstblood-announcement::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(rgba(255, 184, 0, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 184, 0, .05) 1px, transparent 1px);
  background-size: 52px 52px; opacity: .4;
}
#firstblood-announcement.show { opacity: 1; transform: scale(1); }

.firstblood-intro {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .8rem; text-transform: uppercase; letter-spacing: .25em;
  font-family: "Chakra Petch", sans-serif; font-weight: 800;
  font-size: clamp(4rem, 9vw, 8rem); color: #fff;
  text-shadow: 0 0 22px rgba(255, 184, 0, .7), 0 0 40px rgba(216, 79, 159, .35), 0 .75rem 1.8rem rgba(0, 0, 0, .65);
  opacity: 0; pointer-events: none; transition: opacity .35s ease; z-index: 2;
}
.firstblood-intro.show { opacity: 1; }
.firstblood-intro.hide { opacity: 0; transition: opacity .3s ease; }
.firstblood-intro .word {
  position: relative; display: inline-block; opacity: 0;
  transform: translateY(34px) skewX(-10deg); will-change: transform, opacity, filter;
}
.firstblood-intro.show .word:first-child { animation: tv-intro-first .5s forwards ease-out, tv-fb-flicker .95s infinite step-end .5s; }
.firstblood-intro.show .word:last-child { animation: tv-intro-second .5s forwards ease-out .28s, tv-fb-flicker .95s infinite step-end .78s; }
.firstblood-intro .word::before, .firstblood-intro .word::after {
  content: attr(data-text); position: absolute; top: 0; left: 0;
  opacity: 0; pointer-events: none; mix-blend-mode: screen;
}
.firstblood-intro .word::before { color: rgba(255, 184, 0, .95); text-shadow: 0 0 16px rgba(255, 184, 0, .75); }
.firstblood-intro .word::after { color: rgba(216, 79, 159, .95); text-shadow: 0 0 16px rgba(216, 79, 159, .65); }
.firstblood-intro.show .word::before { animation: tv-fb-glitch-a .28s steps(2, end) infinite; opacity: .9; }
.firstblood-intro.show .word::after  { animation: tv-fb-glitch-b .24s steps(2, end) infinite; opacity: .9; }

.firstblood-banner {
  position: relative; display: inline-flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1.2rem;
  width: min(1200px, calc(100vw - 4rem)); padding: 2.4rem 3rem; border-radius: 0;
  clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 24px, 100% 100%, 24px 100%, 0 calc(100% - 24px));
  border: 1px solid rgba(255, 184, 0, .55);
  background: linear-gradient(160deg, rgba(17, 13, 44, .94), rgba(7, 6, 26, .98));
  box-shadow: 0 0 0 1px rgba(255, 184, 0, .18), 0 18px 42px rgba(0, 0, 0, .6), 0 0 36px rgba(255, 184, 0, .22);
  opacity: 0; transform: scale(.95);
  transition: opacity .35s ease, transform .35s ease; pointer-events: none; z-index: 3;
}
.firstblood-banner.revealed { opacity: 1; transform: scale(1); }
.firstblood-message {
  position: relative; z-index: 2; text-transform: uppercase; letter-spacing: .09em;
  font-weight: 800; font-family: "Chakra Petch", sans-serif;
  font-size: clamp(2rem, 4.4vw, 3.75rem); line-height: 1.28; text-align: center;
  color: #f4f8ff; text-shadow: 0 .35rem 1.2rem rgba(0, 0, 0, .55);
}
.firstblood-message .firstblood-team { color: #ffd23f; font-weight: 900; letter-spacing: .04em; text-shadow: 0 0 14px rgba(255, 184, 0, .55); }
.firstblood-message .firstblood-challenge { color: #d84f9f; font-weight: 900; letter-spacing: .04em; text-shadow: 0 0 14px rgba(216, 79, 159, .55); }

.blood-rain {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  overflow: hidden; opacity: 0; transition: opacity .5s ease; mix-blend-mode: screen;
}
.blood-rain.active { opacity: 1; }
.blood-drop {
  position: absolute; top: -24vh; font-size: var(--drop-size, 1.8rem);
  opacity: var(--drop-opacity, .9); filter: drop-shadow(0 0 8px rgba(255, 184, 0, .35));
  animation: tv-blood-fall var(--fall-duration, 2.8s) linear infinite;
  animation-delay: var(--fall-delay, 0s);
}
@keyframes tv-blood-fall {
  0%   { transform: translate3d(0, -15vh, 0) rotate(0) scale(.9); opacity: 0; }
  16%  { opacity: var(--drop-opacity, .9); }
  100% { transform: translate3d(var(--drift, 0), 115vh, 0) rotate(var(--spin, 220deg)) scale(1.06); opacity: 0; }
}
@keyframes tv-intro-first  { 0% { opacity: 0; transform: translateY(40px) skewX(-12deg); } 100% { opacity: 1; transform: translateY(0) skewX(0); } }
@keyframes tv-intro-second { 0% { opacity: 0; transform: translateY(40px) skewX(-12deg); } 100% { opacity: 1; transform: translateY(0) skewX(0); } }
@keyframes tv-fb-flicker { 0%, 8%, 13%, 19%, 100% { filter: brightness(1.05); } 7%, 12%, 18% { filter: brightness(1.9); } }
@keyframes tv-fb-glitch-a {
  0%   { transform: translate(0, 0); clip-path: inset(0 0 0 0); }
  20%  { transform: translate(-6px, -2px); clip-path: inset(8% 0 53% 0); }
  40%  { transform: translate(6px, 3px);   clip-path: inset(55% 0 16% 0); }
  60%  { transform: translate(-4px, 0);    clip-path: inset(24% 0 38% 0); }
  80%  { transform: translate(5px, -2px);  clip-path: inset(68% 0 7% 0); }
  100% { transform: translate(0, 0); clip-path: inset(0 0 0 0); }
}
@keyframes tv-fb-glitch-b {
  0%   { transform: translate(0, 0); clip-path: inset(0 0 0 0); }
  20%  { transform: translate(7px, 2px);   clip-path: inset(62% 0 9% 0); }
  40%  { transform: translate(-7px, -2px); clip-path: inset(10% 0 56% 0); }
  60%  { transform: translate(4px, 2px);   clip-path: inset(37% 0 28% 0); }
  80%  { transform: translate(-6px, 1px);  clip-path: inset(78% 0 2% 0); }
  100% { transform: translate(0, 0); clip-path: inset(0 0 0 0); }
}
.hist { display: inline-flex; gap: .2rem; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.dot.success { background: var(--green); } .dot.warn { background: var(--orange); } .dot.fail { background: var(--red); }
.badge { padding: .12rem .5rem; border: 1px solid var(--border); border-radius: 999px; font: 600 .54rem var(--mono); letter-spacing: .06em; }
.badge.success { color: #05231a; border-color: transparent; background: var(--green); }
.badge.warn { color: var(--orange); border-color: rgba(255,155,28,.3); background: rgba(255,155,28,.08); }
.badge.fail { color: var(--red); border-color: rgba(255,58,74,.3); background: rgba(255,58,74,.08); }

@media (max-width: 650px) {
  .board-toolbar { flex-direction: column; align-items: flex-start; }
}
