/* ════════════════════════════════════════════════════════
   RFM Tournament Hub — Collins Aerospace internal styling
   Tokens derived from the Collins Aerospace design system
   (RTX black / white / Red 186 #C81126 + cool grays)
   ════════════════════════════════════════════════════════ */

:root {
  /* type */
  --t-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --t-sans: 'Barlow', 'Helvetica Neue', Arial, sans-serif;
  --t-body: 'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;
  --t-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* brand constants (theme-independent) */
  --t-red: #C81126;
  --t-red-dark: #9e0d1e;
  --t-header: #000000;
  --t-header-ink: #ffffff;

  /* light theme */
  --t-bg: #f4f4f3;
  --t-surface: #ffffff;
  --t-surface2: #fafafa;
  --t-ink: #0d0d0d;
  --t-ink2: #444444;
  --t-ink3: #63666a;
  --t-line: #d9d9d6;
  --t-line-soft: #ebebeb;
  --t-red-tint: #f9e3e6;
  --t-ok: #1a6e38;
  --t-ok-tint: #d4eddf;
  --t-warn: #9a5e00;
  --t-warn-tint: #fff1cc;
  --t-info: #527d92;
  --t-info-tint: #ddeef5;
  --t-shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.05);
  --t-shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05);
  --t-shadow-lg: 0 10px 28px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.08);

  --t-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --t-bg: #0f0f0f;
  --t-surface: #1a1a1a;
  --t-surface2: #161616;
  --t-ink: #f5f5f5;
  --t-ink2: #c8c8c6;
  --t-ink3: #8d8f93;
  --t-line: #2e2e2e;
  --t-line-soft: #242424;
  --t-red-tint: rgba(200,17,38,0.16);
  --t-ok: #4cba74;
  --t-ok-tint: rgba(31,144,72,0.16);
  --t-warn: #e09b2d;
  --t-warn-tint: rgba(201,124,0,0.14);
  --t-info: #7ba7bc;
  --t-info-tint: rgba(123,167,188,0.14);
  --t-shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --t-shadow-md: 0 4px 12px rgba(0,0,0,0.5);
  --t-shadow-lg: 0 10px 28px rgba(0,0,0,0.6);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; }
body {
  min-height: 100%;
  background: var(--t-bg);
  color: var(--t-ink);
  font-family: var(--t-body);
  font-size: 15px;
  line-height: 1.5;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--t-line); border-radius: 4px; }

button { font-family: var(--t-sans); cursor: pointer; }
input, select, textarea { font-family: var(--t-body); }

/* ── Header ─────────────────────────────────────────── */
.hdr {
  background: var(--t-header);
  color: var(--t-header-ink);
  position: sticky;
  top: 0;
  z-index: 50;
}
.hdr-row {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
  padding: 0 20px;
  max-width: 1280px;
  margin: 0 auto;
}
/* Collins Aerospace logo — larger */
.hdr-logo { height: 36px; filter: brightness(0) invert(1); display: block; }
.hdr-divider { width: 1px; height: 28px; background: rgba(255,255,255,0.22); }
.hdr-title {
  font-family: var(--t-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hdr-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.seg {
  display: flex;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 3px;
  overflow: hidden;
}
.seg button {
  background: none;
  border: none;
  color: rgba(255,255,255,0.55);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 5px 10px;
  transition: all 150ms var(--t-ease);
}
.seg button.on { background: var(--t-red); color: #fff; }

.icon-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 3px;
  color: rgba(255,255,255,0.75);
  width: 30px;
  height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms var(--t-ease);
}
.icon-btn:hover { border-color: rgba(255,255,255,0.55); color: #fff; }
.icon-btn.alert { border-color: var(--t-red); color: #ff8d9b; }

/* ── Tabs ───────────────────────────────────────────── */
.tabs-wrap { background: var(--t-header); border-bottom: 3px solid var(--t-red); }
.tabs {
  display: flex;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 12px 14px;
  white-space: nowrap;
  transition: color 150ms var(--t-ease);
}
.tabs button:hover { color: rgba(255,255,255,0.85); }
.tabs button.on { color: #fff; border-bottom-color: #fff; }
.tabs button.admin-tab { color: #ff8d9b; }
.tabs button.admin-tab.on { color: #fff; }

/* secondary sub-nav (inside a section) */
.subtabs-wrap { background: var(--t-surface); border-bottom: 1px solid var(--t-line); }
.subtabs {
  display: flex;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.subtabs::-webkit-scrollbar { display: none; }
.subtabs button {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--t-ink3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 11px 13px;
  white-space: nowrap;
  transition: color 150ms var(--t-ease);
}
.subtabs button:hover { color: var(--t-ink); }
.subtabs button.on { color: var(--t-red); border-bottom-color: var(--t-red); }
[data-theme="dark"] .subtabs button.on { color: #ff8d9b; }

/* ── Layout ─────────────────────────────────────────── */
.page { max-width: 1280px; margin: 0 auto; padding: 24px 20px 64px; }
.grid { display: grid; gap: 16px; }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .cols-4 { grid-template-columns: repeat(2, 1fr); } .cols-3 { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .cols-2 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .cols-4 { grid-template-columns: 1fr 1fr; } }

.section-label {
  font-family: var(--t-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--t-ink3);
  margin: 28px 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::before { content: ''; width: 3px; height: 13px; background: var(--t-red); border-radius: 1px; flex-shrink: 0; }
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--t-line-soft); }
.page > .section-label:first-child { margin-top: 0; }

.page-title {
  font-family: var(--t-display);
  font-size: 34px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
}
.page-sub { color: var(--t-ink3); font-size: 14px; margin-top: 2px; }

/* ── Cards ──────────────────────────────────────────── */
.card {
  background: var(--t-surface);
  border: 1px solid var(--t-line);
  border-radius: 4px;
  box-shadow: var(--t-shadow-sm);
}
.card-pad { padding: 16px 18px; }

.stat {
  background: var(--t-surface);
  border: 1px solid var(--t-line);
  border-top: 3px solid var(--t-ink);
  border-radius: 3px;
  padding: 14px 16px;
}
.stat.red { border-top-color: var(--t-red); }
.stat.ok { border-top-color: var(--t-ok); }
.stat.warn { border-top-color: var(--t-warn); }
.stat.info { border-top-color: var(--t-info); }
.stat .k {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--t-sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--t-ink3);
  margin-bottom: 6px;
}
.stat .v {
  font-family: var(--t-display);
  font-size: 38px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
.stat .s { font-size: 12px; color: var(--t-ink3); margin-top: 5px; }

/* ── Badges ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--t-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 2px;
  white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--t-ok-tint); color: var(--t-ok); }
.badge.red { background: var(--t-red-tint); color: var(--t-red); }
[data-theme="dark"] .badge.red { color: #ff8d9b; }
.badge.warn { background: var(--t-warn-tint); color: var(--t-warn); }
.badge.info { background: var(--t-info-tint); color: var(--t-info); }
.badge.neutral { background: var(--t-line-soft); color: var(--t-ink3); }
.badge.published { background: var(--t-ok-tint); color: var(--t-ok); }
.badge.draft { background: var(--t-warn-tint); color: var(--t-warn); }
.badge.live .dot { animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

/* ── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 3px;
  padding: 9px 16px;
  border: 1px solid transparent;
  transition: all 150ms var(--t-ease);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--t-red); color: #fff; }
.btn-primary:hover { background: var(--t-red-dark); }
.btn-guest { background: var(--t-header); color: #fff; border-color: var(--t-header); }
.btn-guest:hover { background: #2b2b2b; border-color: #2b2b2b; }
.btn-dark { background: var(--t-ink); color: var(--t-bg); }
.btn-dark:hover { opacity: 0.85; }
.btn-ghost { background: none; border-color: var(--t-line); color: var(--t-ink2); }
.btn-ghost:hover { border-color: var(--t-ink3); color: var(--t-ink); }
.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-danger-ghost { background: none; border-color: var(--t-red); color: var(--t-red); }
.btn-danger-ghost:hover { background: var(--t-red-tint); }

/* ── Tables ─────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  font-family: var(--t-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--t-ink3);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--t-line);
  background: var(--t-surface2);
  white-space: nowrap;
}
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--t-line-soft); }
.tbl tr:last-child td { border-bottom: none; }
.tbl td.num, .tbl th.num { text-align: right; font-family: var(--t-mono); font-size: 12.5px; }
.tbl tr.dim td { color: var(--t-ink3); }
.tbl .team-cell { font-weight: 600; font-family: var(--t-sans); }

/* ── Match cards ────────────────────────────────────── */
.match {
  background: var(--t-surface);
  border: 1px solid var(--t-line);
  border-radius: 4px;
  overflow: hidden;
}
.match-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--t-line-soft);
  background: var(--t-surface2);
  font-family: var(--t-sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--t-ink3);
}
.match-meta .mid { font-family: var(--t-mono); font-weight: 400; letter-spacing: 0; text-transform: none; white-space: nowrap; }
.match-meta > span:first-child { white-space: nowrap; }
.match-meta .spacer { flex: 1; }
.match-body { padding: 6px 0; }
.match-team {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  font-family: var(--t-sans);
  font-size: 14.5px;
  font-weight: 500;
}
.match-team .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-team .sc {
  font-family: var(--t-mono);
  font-size: 15px;
  font-weight: 600;
  min-width: 26px;
  text-align: center;
  background: var(--t-line-soft);
  border-radius: 2px;
  padding: 1px 4px;
}
.match-team .pens { font-family: var(--t-mono); font-size: 11px; color: var(--t-ink3); }
.match-team.winner { font-weight: 700; }
.match-team.winner .sc { background: var(--t-red); color: #fff; }
.match-team.loser { color: var(--t-ink3); }
.match-team.tbd { color: var(--t-ink3); font-style: italic; font-weight: 400; }
.match-foot {
  padding: 6px 14px 10px;
  font-size: 12px;
  color: var(--t-ink3);
  border-top: 1px dashed var(--t-line-soft);
  margin-top: 4px;
}

/* ── Bracket ────────────────────────────────────────── */
.bracket-scroller { overflow-x: auto; padding-bottom: 12px; }
.bracket { display: flex; min-width: max-content; }
.b-round { display: flex; flex-direction: column; width: 280px; }
.b-round-title {
  font-family: var(--t-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--t-ink3);
  text-align: center;
  padding: 0 28px 14px 0;
}
.b-col { display: flex; flex-direction: column; flex: 1; }
.b-slot { flex: 1; display: flex; align-items: center; position: relative; padding-right: 28px; min-height: 104px; }
.b-slot .match { flex: 1; box-shadow: none; }
/* connectors */
.b-slot.has-next::before {
  content: '';
  position: absolute;
  right: 14px;
  width: 14px;
  height: 2px;
  background: var(--t-line);
  top: calc(50% - 1px);
}
.b-slot.has-next.top::after,
.b-slot.has-next.bottom::after {
  content: '';
  position: absolute;
  right: 12px;
  width: 2px;
  background: var(--t-line);
}
.b-slot.has-next.top::after { top: 50%; bottom: 0; }
.b-slot.has-next.bottom::after { top: 0; bottom: 50%; }
.b-slot.from-prev .match::before { display: none; }
.b-round + .b-round .b-slot { position: relative; }
.b-round + .b-round .b-slot .stub {
  position: absolute;
  left: -14px;
  width: 14px;
  height: 2px;
  background: var(--t-line);
  top: calc(50% - 1px);
}
.b-champ {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 220px;
}
.champ-card {
  border: 1px solid var(--t-red);
  border-top: 3px solid var(--t-red);
  border-radius: 4px;
  background: var(--t-surface);
  padding: 18px 16px;
  text-align: center;
}
.champ-card .k { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--t-red); font-family: var(--t-sans); }
[data-theme="dark"] .champ-card .k { color: #ff8d9b; }
.champ-card .v { font-family: var(--t-display); font-size: 26px; font-weight: 700; text-transform: uppercase; margin-top: 6px; line-height: 1.1; }
.champ-card .v.tbd { color: var(--t-ink3); font-size: 18px; }

/* ── Hero (overview) ────────────────────────────────── */
.hero {
  background: linear-gradient(148deg, #000000 0%, #0e0003 38%, #1e0008 65%, #C81126 180%);
  border-radius: 4px;
  color: #fff;
  padding: 32px 30px 28px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(200,17,38,0.22) 0%, transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(100deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 56px);
  pointer-events: none;
}
.hero .k {
  font-family: var(--t-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}
.hero h1 {
  font-family: var(--t-display);
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.05;
  margin: 6px 0 8px;
}
.hero .accent { color: var(--t-red); filter: brightness(1.6); }
.hero .sub { color: rgba(255,255,255,0.65); font-size: 14.5px; max-width: 60ch; }
.hero .meta-row { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 20px; position: relative; z-index: 1; }
.hero .meta-row .item .mk { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.45); font-family: var(--t-sans); white-space: nowrap; }
.hero .meta-row .item .mv { font-family: var(--t-sans); font-size: 15px; font-weight: 600; margin-top: 2px; }

/* ── Next match panel ───────────────────────────────── */
.next-match {
  border-left: 3px solid var(--t-red);
}
.versus {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 18px 10px;
}
.versus .side { text-align: center; min-width: 0; }
.versus .side .tn { font-family: var(--t-display); font-size: 24px; font-weight: 700; text-transform: uppercase; line-height: 1.1; }
.versus .side .tr { font-size: 11px; color: var(--t-ink3); text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--t-sans); font-weight: 600; margin-top: 3px; }
.versus .vs {
  font-family: var(--t-display);
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  background: var(--t-red);
  border-radius: 3px;
  padding: 6px 10px;
  text-transform: uppercase;
}

/* ── Timeline / round list ──────────────────────────── */
.round-block { margin-bottom: 26px; }
.round-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.round-head h3 {
  font-family: var(--t-display);
  font-size: 22px;
  font-weight: 700;
  text-transform: uppercase;
}
.round-head .cnt { font-size: 12px; color: var(--t-ink3); font-family: var(--t-mono); }

/* clickable match cards */
.match[data-nav] { cursor: pointer; transition: box-shadow 150ms var(--t-ease), border-color 150ms var(--t-ease); }
.match[data-nav]:hover { border-color: var(--t-ink3); box-shadow: var(--t-shadow-md); }

/* ── Featured event (home) ──────────────────────────── */
.featured {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  overflow: hidden;
  border-left: 3px solid var(--t-red);
}
.featured-info { padding: 22px 24px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.featured-title { font-family: var(--t-display); font-size: 30px; font-weight: 700; text-transform: uppercase; line-height: 1.05; }
.featured-next { border-top: 1px dashed var(--t-line); padding-top: 10px; margin-top: 6px; width: 100%; }
.featured-next .fk { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--t-ink3); font-family: var(--t-sans); }
.featured-next .fv { font-family: var(--t-sans); font-weight: 700; font-size: 16px; margin-top: 3px; }
.featured-next .fv span { color: var(--t-ink3); font-weight: 400; }
.featured-next .fd { font-size: 12.5px; color: var(--t-ink3); margin-top: 2px; }
.featured-media { min-height: 100%; }
@media (max-width: 820px) { .featured { grid-template-columns: 1fr; } .featured-media { min-height: 200px; } }

/* ── Photo grids ────────────────────────────────────── */
.photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 900px) { .photo-grid { grid-template-columns: repeat(2, 1fr); } }
image-slot { display: block; background: var(--t-line-soft); border-radius: 4px; }

/* ── Team tiles ─────────────────────────────────────── */
.team-tile { padding: 16px; cursor: pointer; transition: box-shadow 150ms var(--t-ease), border-color 150ms var(--t-ease); }
.team-tile:hover { border-color: var(--t-ink3); box-shadow: var(--t-shadow-md); }
.team-tile .tt-mono {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--t-header); color: #fff;
  font-family: var(--t-display); font-weight: 700; font-size: 16px;
  border-radius: 3px; border-bottom: 3px solid var(--t-red);
  margin-bottom: 10px;
}
.team-tile .tt-name { font-family: var(--t-sans); font-weight: 700; font-size: 15px; }
.team-tile .tt-rec { font-family: var(--t-mono); font-size: 11.5px; color: var(--t-ink3); margin-top: 3px; }

/* ── Roster ─────────────────────────────────────────── */
.player-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--t-line-soft);
}
.player-row:last-child { border-bottom: none; }
.player-row .pr-name { flex: 1; font-family: var(--t-sans); font-weight: 600; font-size: 14px; }

/* ── Big scoreboard ─────────────────────────────────── */
.big-score {
  font-family: var(--t-display);
  font-size: 46px;
  font-weight: 700;
  text-align: center;
  line-height: 1;
  white-space: nowrap;
}
.big-score span { color: var(--t-ink3); padding: 0 6px; }
.big-score .bs-pens { font-family: var(--t-sans); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--t-ink3); margin-top: 6px; }

/* clickable team name links */
[data-nav].team-link { cursor: pointer; }
[data-nav].team-link:hover { color: var(--t-red); text-decoration: underline; }

/* ── Eliminated ─────────────────────────────────────── */
.elim-card { display: flex; align-items: center; gap: 14px; padding: 13px 16px; }
.elim-card .x {
  width: 34px;
  height: 34px;
  border-radius: 3px;
  background: var(--t-red-tint);
  color: var(--t-red);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
[data-theme="dark"] .elim-card .x { color: #ff8d9b; }
.elim-card .who { flex: 1; min-width: 0; }
.elim-card .who .nm { font-family: var(--t-sans); font-weight: 700; font-size: 15px; }
.elim-card .who .by { font-size: 12.5px; color: var(--t-ink3); margin-top: 1px; }
.elim-card .rd { font-family: var(--t-mono); font-size: 11px; color: var(--t-ink3); text-align: right; white-space: nowrap; }

/* ── Events ─────────────────────────────────────────── */
.event-card {
  display: flex;
  gap: 16px;
  padding: 16px 18px;
  align-items: flex-start;
  transition: transform 0.15s var(--t-ease), box-shadow 0.15s var(--t-ease);
  border-left: 3px solid var(--t-line);
}
.event-card:hover { transform: translateY(-2px); box-shadow: var(--t-shadow-md); border-left-color: var(--t-red); }
.event-date {
  flex-shrink: 0;
  width: 56px;
  text-align: center;
  border: 1px solid var(--t-line);
  border-top: 3px solid var(--t-red);
  border-radius: 3px;
  padding: 6px 4px 8px;
  background: var(--t-surface2);
}
.event-date .d { font-family: var(--t-display); font-size: 24px; font-weight: 700; line-height: 1; }
.event-date .m { font-family: var(--t-sans); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--t-ink3); margin-top: 2px; }
.event-info { flex: 1; min-width: 0; }
.event-info .et { font-family: var(--t-sans); font-weight: 700; font-size: 15.5px; }
.event-info .ed { font-size: 13.5px; color: var(--t-ink2); margin-top: 3px; }
.event-info .em { font-size: 12px; color: var(--t-ink3); margin-top: 6px; display: flex; gap: 14px; flex-wrap: wrap; }

/* ── Forms ──────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
  font-family: var(--t-sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t-ink3);
}
.field input, .field select, .field textarea {
  background: var(--t-surface);
  border: 1px solid var(--t-line);
  border-radius: 3px;
  color: var(--t-ink);
  font-size: 14px;
  padding: 8px 10px;
  transition: border-color 150ms var(--t-ease);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--t-red);
}
.reset-link-input {
  width: min(420px, 48vw);
  border: 1px solid var(--t-line);
  border-radius: 3px;
  background: var(--t-surface2);
  color: var(--t-ink2);
  font-family: var(--t-mono);
  font-size: 11px;
  padding: 6px 8px;
}
.score-in {
  width: 52px;
  text-align: center;
  font-family: var(--t-mono) !important;
  font-size: 16px !important;
}
.form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.form-row .field { flex: 1; min-width: 130px; }
.form-msg { font-size: 13px; margin-top: 8px; }
.form-msg.err { color: var(--t-red); }
.form-msg.ok { color: var(--t-ok); }

/* ── Login overlay ──────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  background: var(--t-surface);
  border: 1px solid var(--t-line);
  border-top: 3px solid var(--t-red);
  border-radius: 4px;
  box-shadow: var(--t-shadow-lg);
  width: 100%;
  max-width: 400px;
  padding: 26px 26px 22px;
}
.modal h2 { font-family: var(--t-display); font-size: 24px; font-weight: 700; text-transform: uppercase; }
.modal .sub { font-size: 13px; color: var(--t-ink3); margin: 4px 0 18px; }

/* ── Admin ──────────────────────────────────────────── */
.admin-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--t-red-tint);
  border: 1px solid var(--t-red);
  border-radius: 3px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--t-sans);
  color: var(--t-red);
  margin-bottom: 20px;
}
[data-theme="dark"] .admin-banner { color: #ff8d9b; }
.admin-banner .spacer { flex: 1; }
.admin-match { padding: 14px 16px; }
.admin-match .top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.admin-match .top .ttl { font-family: var(--t-sans); font-weight: 700; font-size: 14.5px; flex: 1; min-width: 200px; }
.scorer-row { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.scorer-row input { flex: 1; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--t-line-soft);
  border-radius: 999px;
  font-size: 12px;
  padding: 3px 10px;
  margin: 3px 4px 0 0;
  font-family: var(--t-sans);
}
.chip button { background: none; border: none; color: var(--t-ink3); font-size: 13px; line-height: 1; padding: 0; }
.chip button:hover { color: var(--t-red); }

/* ── Rules ──────────────────────────────────────────── */
.rules h3 { font-family: var(--t-display); font-size: 21px; text-transform: uppercase; font-weight: 700; margin: 22px 0 8px; }
.rules h3:first-child { margin-top: 0; }
.rules p, .rules li { font-size: 14.5px; color: var(--t-ink2); }
.rules ul, .rules ol { padding-left: 22px; margin: 6px 0; }
.rules li { margin: 4px 0; }

/* ── Footer ─────────────────────────────────────────── */
.foot {
  border-top: 1px solid var(--t-line);
  padding: 18px 20px 26px;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--t-ink3);
  font-size: 12px;
}
.foot .spacer { flex: 1; }
.foot button.linklike {
  background: none;
  border: none;
  color: var(--t-ink3);
  font-size: 12px;
  text-decoration: underline;
  padding: 0;
}
.foot button.linklike:hover { color: var(--t-red); }

/* ── User chip in header ────────────────────────────── */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-family: var(--t-sans);
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 3px;
  padding: 4px 9px;
  white-space: nowrap;
}
@media (max-width: 640px) { .user-chip { display: none; } }

/* ── Misc ───────────────────────────────────────────── */
.empty {
  text-align: center;
  color: var(--t-ink3);
  padding: 36px 20px;
  font-size: 14px;
}
.fade-in { animation: none; }

@media (max-width: 720px) {
  .hdr-row { padding: 0 14px; gap: 10px; height: 56px; }
  .hdr-logo { height: 28px; }
  .hdr-title { font-size: 14px; }
  .page { padding: 18px 14px 56px; }
  .versus .side .tn { font-size: 19px; }
}

/* ── Password show/hide + strength ─────────────────── */
.pass-wrap { position: relative; display: block; }
.pass-wrap input[type="password"],
.pass-wrap input[type="text"] { padding-right: 42px; width: 100%; }
.pass-eye {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--t-ink3); cursor: pointer;
  padding: 4px; display: flex; align-items: center; line-height: 1;
}
.pass-eye:hover { color: var(--t-ink); }
.pass-strength { margin-top: 8px; }
.pass-strength-bar { height: 3px; background: var(--t-line); border-radius: 2px; overflow: hidden; }
.pass-strength-fill { height: 100%; width: 0; border-radius: 2px; transition: width 200ms, background-color 200ms; }
.pass-strength-fill.s1 { width: 25%; background: var(--t-red); }
.pass-strength-fill.s2 { width: 50%; background: var(--t-warn); }
.pass-strength-fill.s3 { width: 75%; background: var(--t-info); }
.pass-strength-fill.s4 { width: 100%; background: var(--t-ok); }
.pass-strength-lbl { font-size: 11px; font-weight: 600; margin-top: 5px; }
.pass-strength-hints { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 5px; }
.pass-hint { font-size: 10.5px; display: flex; align-items: center; gap: 3px; color: var(--t-ink3); }
.pass-hint.ok { color: var(--t-ok); }

/* ── Link-style button ──────────────────────────────── */
.link-btn {
  background: none; border: none; padding: 0;
  color: var(--t-info); font-size: 12.5px; cursor: pointer;
  text-decoration: underline; font-family: var(--t-body);
}
.link-btn:hover { color: var(--t-red); }

/* ── Auth controls (lang/theme on login page) ────────── */
.auth-controls {
  display: flex; justify-content: flex-end; align-items: center;
  gap: 8px; margin-bottom: 24px;
}
.auth-controls .seg { border-color: var(--t-line); }
.auth-controls .seg button { color: var(--t-ink2); font-size: 11px; padding: 4px 9px; }
.auth-controls .seg button.on { background: var(--t-red); color: #fff; }
.icon-btn-sm {
  background: none; border: 1px solid var(--t-line); border-radius: 3px;
  color: var(--t-ink2); width: 28px; height: 26px; display: inline-flex;
  align-items: center; justify-content: center; cursor: pointer;
  transition: all 150ms var(--t-ease);
}
.icon-btn-sm:hover { background: var(--t-surface2); color: var(--t-ink); }

/* ── Group stage styles ─────────────────────────────── */
.advancing-row td { background: rgba(26,110,56,0.06); }
[data-theme="dark"] .advancing-row td { background: rgba(76,186,116,0.08); }
.advancing-row td:first-child { color: var(--t-ok); font-weight: 700; }
.group-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 24px 0 10px;
}
.group-lbl {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--t-display); font-size: 18px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.group-advance-note {
  font-size: 12px; color: var(--t-ok); font-weight: 600;
  background: var(--t-ok-tint); padding: 3px 10px; border-radius: 3px;
}
.format-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--t-info-tint); color: var(--t-info);
  font-size: 10px; font-weight: 700; font-family: var(--t-sans);
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 2px; margin-left: 8px;
}

/* ── Event template picker ─────────────────────────── */
.tpl-section-lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--t-ink3); margin-bottom: 8px; }
.tpl-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tpl-card { display: flex; align-items: center; gap: 7px; padding: 7px 13px; background: var(--t-surface); border: 1.5px solid var(--t-line); border-radius: 6px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--t-ink2); transition: border-color 120ms var(--t-ease), color 120ms var(--t-ease), background 120ms var(--t-ease); user-select: none; }
.tpl-card:hover { border-color: var(--t-red); color: var(--t-red); background: var(--t-red-tint); }
.tpl-card.active { border-color: var(--t-red); color: var(--t-red); background: var(--t-red-tint); }
.tpl-emoji { font-size: 17px; line-height: 1; }

/* ── Invite panel ──────────────────────────────────── */
.invite-link-row { display: flex; align-items: center; gap: 8px; }
.invite-link-input { flex: 1; font-family: var(--t-mono); font-size: 11.5px; background: var(--t-bg); border: 1px solid var(--t-line); border-radius: 3px; padding: 6px 10px; color: var(--t-ink2); min-width: 0; }
.role-pill { display: inline-block; padding: 2px 8px; border-radius: 2px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.role-pill.super_admin { background: var(--t-red-tint); color: var(--t-red); }
.role-pill.events_manager { background: var(--t-info-tint); color: var(--t-info); }
.role-pill.employee { background: var(--t-line-soft); color: var(--t-ink3); }
.role-select { font-size: 12.5px; padding: 3px 6px; border: 1px solid var(--t-line); border-radius: 3px; background: var(--t-surface); color: var(--t-ink); cursor: pointer; }

/* ── Auth wall ─────────────────────────────────────── */
.auth-wall {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #0a0a0a;
}
.auth-wall.single-auth {
  grid-template-columns: minmax(280px, 560px);
  justify-content: center;
  align-items: center;
  padding: 24px;
}
.auth-wall.single-auth .auth-form-side {
  min-height: auto;
  max-height: none;
  width: 100%;
  border-radius: 4px;
}
.auth-brand {
  background: linear-gradient(148deg, #0d0002 0%, #1a0005 50%, #C81126 180%);
  padding: 64px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.auth-brand::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(100deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 56px);
  pointer-events: none;
}
.auth-brand > * {
  position: relative;
  z-index: 1;
}
.auth-brand-title {
  font-family: var(--t-display);
  font-size: clamp(30px, 4.3vw, 48px);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.05;
  margin-bottom: 16px;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 2px 18px rgba(0,0,0,0.45);
}
.auth-brand-title .accent {
  color: #ff1f3a;
}
.auth-form-side {
  background: var(--t-surface);
  padding: 64px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-height: 100vh;
  overflow-y: auto;
}
.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--t-line);
  margin-bottom: 28px;
}
.auth-tabs button {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-family: var(--t-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--t-ink3);
  padding: 10px 18px 12px 0;
  cursor: pointer;
  margin-right: 16px;
  transition: color 150ms var(--t-ease);
}
.auth-tabs button.on { color: var(--t-red); border-bottom-color: var(--t-red); }
[data-theme="dark"] .auth-form-side { background: #111; }
.auth-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px;
  font-size: 11.5px;
  font-family: var(--t-sans);
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  padding: 5px 12px;
}
@media (max-width: 820px) {
  .auth-wall { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-form-side { padding: 40px 28px; min-height: 100vh; max-height: none; justify-content: flex-start; padding-top: 56px; }
}

/* ── Event cards ────────────────────────────────────── */
.ev-card {
  background: var(--t-surface);
  border: 1px solid var(--t-line);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 180ms var(--t-ease), border-color 180ms var(--t-ease), transform 180ms var(--t-ease);
}
.ev-card:hover { box-shadow: var(--t-shadow-md); border-color: var(--t-ink3); transform: translateY(-2px); }
.ev-card.featured-card .ev-card-cover { height: 220px; }
.ev-card.pinned { border-top: 3px solid var(--t-red); }
.ev-card-cover { height: 150px; position: relative; }
.ev-card-cover-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.55) 100%);
}
.ev-card-cover-badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.ev-card-body { padding: 14px 16px 16px; }
.ev-card-title { font-family: var(--t-sans); font-weight: 700; font-size: 16px; line-height: 1.25; margin-bottom: 6px; }
.ev-card-meta { font-size: 12.5px; color: var(--t-ink3); display: flex; align-items: center; gap: 5px; margin-top: 3px; }

/* ── Event detail ────────────────────────────────────── */
.ev-detail-header { margin-bottom: 4px; }
.ev-detail-meta {
  font-size: 14px; color: var(--t-ink3);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.ev-detail-desc { color: var(--t-ink2); font-size: 15px; margin: 8px 0 14px; max-width: 72ch; line-height: 1.65; }
.ev-detail-content { margin-top: 8px; }
.ev-staff-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 10px 0 4px; margin-top: 6px;
  border-top: 1px dashed var(--t-line);
}

/* event-level sub-tabs */
.ev-subtabs-wrap {
  display: flex; align-items: center;
  background: var(--t-surface2);
  border-bottom: 1px solid var(--t-line);
  border-top: 1px solid var(--t-line-soft);
  margin: 12px -20px 20px;
}
.ev-subtabs {
  display: flex; overflow-x: auto; scrollbar-width: none;
  padding: 0 20px; flex: 1;
}
.ev-subtabs-wrap .format-badge { margin-right: 16px; white-space: nowrap; flex-shrink: 0; }
.ev-subtabs::-webkit-scrollbar { display: none; }
.ev-subtabs button {
  background: none; border: none;
  border-bottom: 2px solid transparent;
  color: var(--t-ink3);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 11px 13px; white-space: nowrap;
  transition: color 150ms var(--t-ease);
}
.ev-subtabs button:hover { color: var(--t-ink); }
.ev-subtabs button.on { color: var(--t-red); border-bottom-color: var(--t-red); }
[data-theme="dark"] .ev-subtabs button.on { color: #ff8d9b; }

/* ── Gallery grid ────────────────────────────────────── */
.gal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px; margin-top: 4px;
}
@media (max-width: 900px) { .gal-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 540px) { .gal-grid { grid-template-columns: repeat(2, 1fr); } }
.gal-item {
  position: relative; border-radius: 4px;
  overflow: hidden; background: var(--t-line-soft);
  aspect-ratio: 1; cursor: pointer;
}
.gal-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 250ms var(--t-ease); }
.gal-item:hover img { transform: scale(1.04); }
.gal-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
  opacity: 0; transition: opacity 200ms var(--t-ease);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 10px;
}
.gal-item:hover .gal-overlay { opacity: 1; }
.gal-caption { font-size: 11px; color: rgba(255,255,255,0.85); font-family: var(--t-sans); flex: 1; }
.gal-btns { display: flex; gap: 6px; justify-content: flex-end; }
.gal-btn {
  background: rgba(0,0,0,0.55); border: 1px solid rgba(255,255,255,0.25);
  border-radius: 3px; color: rgba(255,255,255,0.9);
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 150ms var(--t-ease);
}
.gal-btn:hover { background: rgba(0,0,0,0.8); }
.gal-btn.danger:hover { background: var(--t-red); border-color: var(--t-red); }
.gal-add-slot {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border: 2px dashed var(--t-line); border-radius: 4px;
  color: var(--t-ink3); font-family: var(--t-sans); font-size: 12px;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  cursor: pointer; transition: all 150ms var(--t-ease); aspect-ratio: 1;
}
.gal-add-slot:hover { border-color: var(--t-ink3); color: var(--t-ink); background: var(--t-surface2); }
.gal-upload-label { cursor: pointer; }
