:root {
  --bg: #070914;
  --card: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f7f8ff;
  --muted: #a0aec0;
  --accent: #7dd3fc;
  --discord: #5865F2;
  --yellow: #facc15;
  --win: #34d399;
  --yt: #fca5a5;
  --tt: #93c5fd;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: Inter, system-ui, sans-serif;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(88, 101, 242, 0.15), transparent),
    linear-gradient(180deg, #070914 0%, #0d1224 100%);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
.container { width: min(980px, 92%); margin: 0 auto; padding: 44px 0 80px; }
header { text-align: center; margin-bottom: 22px; }
.badge {
  display: inline-flex; gap: 8px; align-items: center;
  background: rgba(88,101,242,.15); border: 1px solid rgba(88,101,242,.3);
  color: #a5b4fc; padding: 6px 14px; border-radius: 999px; font-size: .85rem; font-weight: 500; margin-bottom: 16px;
}
h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; letter-spacing: -.04em; margin-bottom: 6px; }
.subtitle, .window, .note { color: var(--muted); }
.window { margin-top: 8px; font-size: .95rem; }
.window.utc { margin-top: 2px; font-size: .8rem; opacity: .8; }
.countdown { margin-top: 8px; font-family: "JetBrains Mono", monospace; font-weight: 700; color: var(--accent); font-size: 1.05rem; }
.time-bar {
  width: min(460px, 92%);
  height: 8px;
  margin: 10px auto 0;
  background: #12182b;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.time-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #5865F2, #38bdf8);
  box-shadow: 0 0 12px rgba(56, 189, 248, .35);
  transition: width .25s linear;
}
.time-bar[data-phase="before"] .time-bar-fill { width: 0 !important; }
.time-bar[data-phase="after"] .time-bar-fill { background: #64748b; box-shadow: none; }
.time-bar-meta {
  margin-top: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--muted);
}
.note { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin: 16px 0 20px; font-size: .92rem; }
.variant-label {
  margin: 8px 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a5b4fc;
  font-weight: 700;
}
.boards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 18px; margin-bottom: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.card h2 { font-size: 1.05rem; }
.win { background: rgba(52,211,153,.16); color: #6ee7b7; border-radius: 999px; padding: 3px 8px; font-size: 11px; font-weight: 700; }
.ranks { list-style: none; }
.ranks li { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; padding: 9px 4px; border-top: 1px solid var(--border); }
.ranks li.top { background: linear-gradient(90deg, rgba(125,211,252,.08), transparent); }
.num { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: #1a1f35; font-weight: 800; font-size: 13px; }
.ranks li:nth-child(1) .num { background: #facc15; color: #1a1300; }
.ranks li:nth-child(2) .num { background: #cbd5e1; color: #111827; }
.ranks li:nth-child(3) .num { background: #d97706; color: #1a0b00; }
.who { font-weight: 700; display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-text { min-width: 0; }
.who small { display: block; color: var(--muted); font-weight: 500; }
.pfp-wrap { position: relative; width: 32px; height: 32px; flex: 0 0 32px; }
.pfp-wrap:has(.sm) { width: 26px; height: 26px; flex-basis: 26px; }
.pfp, .pfp-fallback {
  width: 32px; height: 32px; border-radius: 50%;
  object-fit: cover; background: #3b4674; border: 1px solid var(--border);
}
.pfp.sm, .pfp-fallback.sm { width: 26px; height: 26px; }
.pfp {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; z-index: 1;
}
.pfp.on { opacity: 1; }
.pfp-fallback {
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800; color: #e2e8f0;
  position: absolute; inset: 0; z-index: 0;
}
.name-cell { display: flex; align-items: center; gap: 10px; }
.metric { font-family: "JetBrains Mono", monospace; font-weight: 700; color: var(--accent); }
.search { background: #0b1020; border: 1px solid var(--border); color: white; border-radius: 10px; padding: 7px 10px; font: inherit; width: min(220px, 100%); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--border); }
td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.pill { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 999px; margin: 0 4px 4px 0; background: #1a1f35; }
.pill.yt { color: var(--yt); background: rgba(252,165,165,.12); }
.pill.tt { color: var(--tt); background: rgba(147,197,253,.12); }
.pill.ok { color: #6ee7b7; background: rgba(52,211,153,.12); }
.pill.no { color: #c4b5fd; background: rgba(167,139,250,.12); }
.empty { color: var(--muted); text-align: center; padding: 16px; }
.links { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
.link { background: var(--card); border: 1px solid var(--border); padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: .88rem; }
.link:hover { border-color: rgba(125,211,252,.35); }
.link.dim { opacity: .55; }
footer { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 28px; }
.btn, button.btn {
  border: 1px solid var(--border); background: #151b30; color: white;
  padding: 8px 12px; border-radius: 10px; cursor: pointer; font: inherit;
}
.btn.primary { background: linear-gradient(135deg, #5865F2, #38bdf8); border: 0; font-weight: 700; }
.btn.danger { background: #3a1c22; color: #fecaca; }
.form-grid, .settings-grid { display: grid; gap: 10px; }
.form-grid label, .login label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 13px; }
input, select, textarea {
  background: #0b1020; border: 1px solid var(--border); color: white;
  border-radius: 10px; padding: 9px 10px; font: inherit; width: 100%;
}
.row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.creator-list { display: grid; gap: 8px; }
.creator-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 12px; }
.creator-row > div:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.check-line { flex-direction: row !important; align-items: center; gap: 8px !important; color: var(--muted); font-size: 13px; }
textarea { min-height: 110px; resize: vertical; }
@media (max-width: 800px) { .boards { grid-template-columns: 1fr; } }
.parse-log {
  margin: 0;
  max-height: 240px;
  overflow: auto;
  background: #070b16;
  border: 0;
  border-radius: 0 0 12px 12px;
  padding: 10px 12px 12px;
  color: #d1d5db;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  white-space: pre-wrap;
  line-height: 1.45;
}
.term-wrap {
  margin-top: 12px;
  border: 1px solid #1f2a44;
  border-radius: 12px;
  overflow: hidden;
  background: #070b16;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: #10182c;
  border-bottom: 1px solid #1f2a44;
  color: #94a3b8;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}
.term-dots { display: flex; gap: 5px; }
.term-dots i {
  width: 8px; height: 8px; border-radius: 50%; display: block;
}
.term-dots i:nth-child(1) { background: #f87171; }
.term-dots i:nth-child(2) { background: #fbbf24; }
.term-dots i:nth-child(3) { background: #34d399; }
.term-bar button {
  margin-left: auto;
  background: transparent;
  border: 1px solid #334155;
  color: #94a3b8;
  border-radius: 8px;
  padding: 2px 8px;
  font: inherit;
  cursor: pointer;
}
.term-line { display: grid; grid-template-columns: 72px 44px 1fr; gap: 8px; }
.term-time { color: #64748b; }
.term-lvl { text-transform: uppercase; font-size: 10px; letter-spacing: .06em; padding-top: 2px; }
.term-line.info .term-lvl { color: #7dd3fc; }
.term-line.ok .term-lvl { color: #34d399; }
.term-line.warn .term-lvl { color: #fbbf24; }
.term-line.err .term-lvl { color: #f87171; }
.term-line.ok .term-msg { color: #bbf7d0; }
.term-line.warn .term-msg { color: #fde68a; }
.term-line.err .term-msg { color: #fecaca; }


/* Historical leaderboard gets a simple way back to the BL:R hub.
   Event scoring, sorting, and admin panels remain untouched. */
.hub-backnav{
  display:flex;align-items:center;justify-content:center;gap:8px;
  flex-wrap:wrap;margin:-12px auto 29px;padding:10px;
  border:1px solid rgba(165,198,241,.15);border-radius:14px;
  background:rgba(19,32,55,.6);
}
.hub-backnav a{
  color:#b3c8e4;font-weight:750;font-size:12px;line-height:1.4;
  padding:8px 10px;border-radius:9px;border:1px solid rgba(154,197,250,.1);
}
.hub-backnav a:hover,.hub-backnav a:focus-visible{
  background:rgba(94,172,235,.14);color:#e8f7ff;
}
@media(max-width:580px){
  .hub-backnav{margin-top:-24px;gap:5px;padding:9px}
  .hub-backnav a{font-size:11px;padding:7px 8px}
}
