/* ═══════════════════════════════════════════
   EOS Rowing · Results — aligned with EOS Timing MD3
   ═══════════════════════════════════════════ */

:root {
  /* Brand / primary */
  --accent:       #1565C0;
  --accent-2:     #1E88E5;
  --accent-dark:  #0D47A1;
  --g-brand:      linear-gradient(135deg, #1565C0 0%, #00658E 100%);

  /* Text */
  --ink:          #171C2C;
  --ink-2:        #42496A;
  --muted:        #42496A;
  --muted-2:      #737997;

  /* Surfaces — MD3 container hierarchy */
  --bg:           #F8F9FF;
  --surface:      #FFFFFF;
  --surface-2:    #F1F3FB;
  --surface-3:    #E9ECFA;

  /* Borders */
  --border:       rgba(195,199,219,.55);
  --border-solid: #C3C7DB;
  --divider:      rgba(195,199,219,.5);

  /* Elevation — MD3 */
  --sh-1: 0 1px 2px rgba(0,0,20,.08);
  --sh-2: 0 2px 6px rgba(0,0,20,.08),  0 1px 2px rgba(0,0,0,.05);
  --sh-3: 0 4px 12px rgba(0,0,20,.09), 0 2px 4px rgba(0,0,0,.05);
  --sh-glow: 0 2px 10px rgba(21,101,192,.15), 0 0 0 1px rgba(21,101,192,.15);

  /* Radius — MD3 scale */
  --r-sm:   4px;
  --r-md:   6px;
  --r-lg:   8px;
  --r-xl:   12px;
  --r-full: 9999px;

  /* Motion — MD3 decelerate */
  --ease:     cubic-bezier(.2, 0, 0, 1);
  --ease-out: cubic-bezier(.2, 0, 0, 1);
}

/* ── Reset ─────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ──────────────────────────── */
body {
  font-family: 'Roboto', system-ui, sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 25%, rgba(21,101,192,.06) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 75%, rgba(0,101,142,.05) 0%, transparent 55%);
  color: var(--ink);
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

main { flex: 1; }

/* ── Utility ───────────────────────── */
.hidden { display: none !important; }

/* ── Ambient page background (event cover photo) ── */
.page-bg-photo {
  position: fixed;
  inset: -10%;
  background-size: cover;
  background-position: center;
  filter: blur(70px);
  opacity: .1;
  z-index: -1;
  pointer-events: none;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ══════════════════════════════════════
   NAV
   ══════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-solid);
  box-shadow: var(--sh-1);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.site-logo img {
  height: 26px;
  width: auto;
  opacity: .9;
}
.logo-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .01em;
}

.header-spacer { flex: 1; }

.lang-switcher {
  display: flex;
  background: var(--surface-3);
  border: 1px solid var(--border-solid);
  border-radius: var(--r-full);
  padding: 3px;
  gap: 2px;
}
.lang-switcher a {
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .07em;
  padding: 4px 11px;
  border-radius: var(--r-full);
  transition: all .15s var(--ease);
}
.lang-switcher a:hover { color: var(--ink); background: var(--surface-2); }
.lang-switcher a.active {
  background: var(--accent);
  color: #fff;
}

/* ══════════════════════════════════════
   INDEX PAGE
   ══════════════════════════════════════ */

/* ── Hero ─────────────────────────── */
.index-hero {
  padding: 28px 0 4px;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow-brand { color: var(--accent); }
.eyebrow-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-2);
  opacity: .6;
}

/* ── Search bar ───────────────────── */
.search-wrap { margin-bottom: 20px; }

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--border-solid);
  border-radius: var(--r-full);
  box-shadow: var(--sh-1);
  padding: 0 18px;
  transition: border-color .2s, box-shadow .25s var(--ease-out);
}
.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: var(--sh-glow);
}
.search-bar svg { color: var(--muted-2); flex-shrink: 0; }
.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14.5px;
  color: var(--ink);
  padding: 13px 12px;
  font-family: inherit;
  caret-color: var(--accent);
}
.search-bar input::placeholder { color: var(--muted-2); }

/* ── Year groups ──────────────────── */
.events-list { display: flex; flex-direction: column; gap: 16px; }

.year-group { display: flex; flex-direction: column; gap: 5px; }

.year-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-radius: var(--r-lg);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background .15s var(--ease);
}
.year-header:hover { background: var(--surface-2); }
.year-label {
  font-size: 19px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.015em;
}
.year-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 9px;
  border-radius: var(--r-full);
}
.year-chevron {
  margin-left: auto;
  color: var(--muted);
  transition: transform .2s var(--ease-out);
}
.year-chevron.is-open { transform: rotate(180deg); }

.year-events {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 900px) {
  .year-events { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .year-events { grid-template-columns: 1fr; }
}

/* ── Event cards ──────────────────── */

.event-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--sh-1);
  overflow: hidden;
  transition:
    transform .22s var(--ease-out),
    box-shadow .25s var(--ease-out),
    border-color .2s;
}

.event-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-glow);
  border-color: rgba(21,101,192,.35);
}
.event-card:active { transform: translateY(-1px); box-shadow: var(--sh-2); }

/* ── Banner ────────────────────────── */
.event-banner {
  position: relative;
  height: 84px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.event-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,.22) 0%, transparent 55%);
}
.event-banner::before {
  content: '';
  position: absolute;
  right: -18px;
  bottom: -26px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.event-initials {
  position: relative;
  z-index: 1;
  font-size: 24px;
  font-weight: 800;
  color: rgba(255,255,255,.95);
  letter-spacing: -.02em;
  text-shadow: 0 1px 6px rgba(0,0,0,.25);
  pointer-events: none;
  user-select: none;
}

/* ── Banner with cover photo ───────── */
.event-banner.has-cover {
  background-size: cover;
  background-position: center;
}
.event-banner.has-cover::before { content: none; }
.event-banner.has-cover::after {
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.45) 100%);
}

.event-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 14px 16px 16px;
  min-width: 0;
}

.event-date {
  display: inline-flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border-solid);
  color: var(--muted);
  font-family: 'Roboto Mono', monospace;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--r-full);
  letter-spacing: .04em;
}
.event-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.event-cta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: auto;
  padding-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  opacity: .75;
  transition: opacity .2s, gap .2s var(--ease-out);
}
.event-cta svg {
  flex-shrink: 0;
  transform: translateX(-2px);
  transition: transform .25s var(--ease-out);
}
.event-card:hover .event-cta { opacity: 1; gap: 8px; }
.event-card:hover .event-cta svg { transform: none; }

/* ── Live indicator ────────────────── */
.event-banner .live-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
}
.live-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-full);
  background: #EF4444;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .07em;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(239,68,68,.4);
  animation: livePulse 1.6s ease-in-out infinite;
}
.live-badge-lg {
  font-size: 11px;
  padding: 3px 10px;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}

.no-events {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 36px 20px;
  color: var(--muted);
  font-size: 14px;
  background: var(--surface);
  border: 1.5px dashed var(--border-solid);
  border-radius: var(--r-lg);
}
.no-events svg { opacity: .5; flex-shrink: 0; }

/* ── Search result count ───────────────── */
.search-result-count {
  padding: 8px 4px;
  font-size: 12px;
  color: var(--muted-2);
  text-align: center;
}

/* ══════════════════════════════════════
   DETAILS PAGE
   ══════════════════════════════════════ */
.detail-top { padding-top: 36px; margin-bottom: 28px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 18px;
  opacity: .8;
  transition: opacity .15s;
}
.back-link:hover { opacity: 1; }

/* ── Hero banner (cover photo or brand gradient) ── */
.detail-hero {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  box-shadow: var(--sh-2);
  padding: 36px 26px 24px;
}
.detail-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8,12,24,.2) 0%, rgba(8,12,24,.7) 100%);
}

.detail-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.detail-hero .detail-name {
  background: none;
  color: #fff;
  -webkit-text-fill-color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.detail-hero .detail-date-tag {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.35);
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.detail-name {
  font-size: clamp(20px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--ink) 40%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.detail-date-tag {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border-solid);
  color: var(--muted);
  font-family: 'Roboto Mono', monospace;
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: var(--r-full);
  flex-shrink: 0;
  letter-spacing: .04em;
}

/* ── Section grid ─────────────────── */
.sections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding-bottom: 72px;
}
@media (max-width: 640px) {
  .sections-grid { grid-template-columns: 1fr; }
}
.results-full { grid-column: 1 / -1; }

/* ── Section card ─────────────────── */
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--sh-1);
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s;
}
.section-card:hover { box-shadow: var(--sh-2); }

/* Top accent bar — thin gradient stripe above header */
.section-card::before {
  content: '';
  display: block;
  height: 3px;
  flex-shrink: 0;
}
.section-card:has(.sh-primary)::before   { background: var(--g-brand); }
.section-card:has(.sh-secondary)::before { background: linear-gradient(90deg, #1976D2, #29B6F6); }
.section-card:has(.sh-results)::before   { background: linear-gradient(90deg, var(--accent), #00658E); }

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  background: var(--surface-2);
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
}
.sh-primary   { color: var(--accent); }
.sh-secondary { color: #0288D1; }
.sh-results   { color: var(--ink-2); }

.section-body { flex: 1; }

/* ── PDF items ────────────────────── */
.pdf-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  text-decoration: none;
  color: var(--ink-2);
  font-size: 13px;
  border-bottom: 1px solid var(--divider);
  transition: background .12s, color .12s;
  word-break: break-word;
}
.pdf-item:last-child { border-bottom: none; }
.pdf-item:hover {
  background: rgba(21,101,192,.05);
  color: var(--accent-dark);
}
.pdf-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  background: rgba(21,101,192,.1);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hint-text {
  padding: 24px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ── Results filter ───────────────── */
.results-filter {
  border-bottom: 1px solid var(--divider);
  background: var(--surface-2);
}

.chip-search-wrap {
  position: relative;
  padding: 12px 18px 8px;
}
.chip-search-wrap svg {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  pointer-events: none;
}
.chip-search-wrap input {
  width: 100%;
  padding: 8px 12px 8px 30px;
  border: 1px solid var(--border-solid);
  border-radius: var(--r-full);
  background: var(--surface);
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.chip-search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(21,101,192,.1);
}

/* ── Results 2-column layout ─────── */
.results-columns {
  display: grid;
  grid-template-columns: minmax(240px, 300px) 1fr;
  height: clamp(400px, 52vh, 560px);
}
.results-col-left {
  border-right: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}
.results-col-left .results-filter {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.results-col-right {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  overflow-y: auto;
}
@media (max-width: 700px) {
  .results-columns {
    grid-template-columns: 1fr;
    height: auto;
  }
  .results-col-left {
    border-right: none;
    border-bottom: 1px solid var(--divider);
    height: auto;
    max-height: 280px;
  }
  .results-col-right {
    height: auto;
    overflow-y: visible;
  }
}

/* ── Class list ───────────────────── */
.class-list-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 18px 5px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted-2);
  border-bottom: 1px solid var(--divider);
}
.class-name-hd  { flex: 1; }
.class-stages-hd{ flex-shrink: 0; }
.class-count-hd { min-width: 36px; text-align: right; flex-shrink: 0; }

.class-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.class-list::-webkit-scrollbar { width: 4px; }
.class-list::-webkit-scrollbar-track { background: transparent; }
.class-list::-webkit-scrollbar-thumb { background: var(--border-solid); border-radius: 2px; }

.class-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  cursor: pointer;
  border-bottom: 1px solid var(--divider);
  border-left: 3px solid transparent;
  transition: background .12s, border-color .15s;
  outline: none;
}
.class-row:last-child { border-bottom: none; }
.class-row:hover { background: rgba(21,101,192,.05); }
.class-row:focus-visible { background: rgba(21,101,192,.07); }
.class-row.active {
  background: rgba(21,101,192,.09);
  border-left-color: var(--accent);
}
.class-row.active .class-name { color: var(--ink); font-weight: 600; }

.class-num {
  font-family: 'Roboto Mono', monospace;
  font-size: 10px;
  color: var(--muted-2);
  min-width: 34px;
  flex-shrink: 0;
  letter-spacing: .02em;
}
.class-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.class-types {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
  align-items: center;
}
.class-type-tag {
  font-family: 'Roboto Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  color: #fff;
  letter-spacing: .04em;
  line-height: 1.5;
}
.type-tt      { background: #607D8C; }
.type-ko      { background: #C62828; }
.type-heat    { background: var(--accent); }
.type-rep     { background: #2E7D32; }
.type-quarter { background: #E65100; }
.type-semi    { background: #4527A0; }
.type-final   { background: #D97706; }
.type-other   { background: var(--muted); }

.class-count {
  font-family: 'Roboto Mono', monospace;
  font-size: 10px;
  color: var(--muted-2);
  min-width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* ── ETA stage filter tabs ────────── */
.eta-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--divider);
  background: var(--surface-2);
}
.eta-tab {
  display: inline-flex;
  align-items: center;
  padding: 4px 13px;
  border-radius: var(--r-full);
  border: 1px solid var(--border-solid);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s var(--ease);
  font-family: inherit;
}
.eta-tab:hover { border-color: var(--accent); color: var(--accent); }
.eta-tab.active { background: var(--g-brand); border-color: transparent; color: #fff; }
.eta-tab-heat.active    { background: var(--g-brand); }
.eta-tab-rep.active     { background: linear-gradient(135deg,#1B5E20,#43A047); }
.eta-tab-semi.active    { background: linear-gradient(135deg,#4527A0,#7B1FA2); }
.eta-tab-final.active   { background: linear-gradient(135deg,#D97706,#F59E0B); }
.eta-tab-tt.active      { background: linear-gradient(135deg,#546E7A,#78909C); }
.eta-tab-ko.active      { background: linear-gradient(135deg,#B71C1C,#EF5350); }
.eta-tab-quarter.active { background: linear-gradient(135deg,#C2410C,#EA580C); }

/* ── Race item as button ─────────── */
.race-item {
  cursor: pointer;
  border: none;
  text-align: left;
  width: 100%;
  background: transparent;
  font-family: inherit;
}

/* ── PDF items as buttons ─────────── */
.pdf-item {
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;
  font-family: inherit;
  width: 100%;
}

/* ── View toggle ──────────────────── */
.view-toggle {
  display: flex;
  gap: 2px;
  background: rgba(0,0,0,.06);
  border-radius: 5px;
  padding: 2px;
  flex-shrink: 0;
}
.view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border: none;
  background: transparent;
  border-radius: 3px;
  cursor: pointer;
  color: var(--muted);
  transition: all .15s var(--ease);
}
.view-btn.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0,0,0,.14);
}

/* ── Race groups ──────────────────── */
.race-group { border-bottom: 1px solid var(--divider); }
.race-group:last-child { border-bottom: none; }

.race-group-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted-2);
}
.race-group-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--divider);
}

.race-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  text-decoration: none;
  color: var(--ink-2);
  font-size: 13px;
  border-bottom: 1px solid rgba(0,0,0,.04);
  transition: background .12s;
  flex-wrap: wrap;
}
.race-item:last-child { border-bottom: none; }
.race-item:hover { background: rgba(21,101,192,.05); }
.race-open-icon {
  color: var(--accent);
  opacity: 0;
  transition: opacity .15s;
  flex-shrink: 0;
}
.race-item:hover .race-open-icon { opacity: 1; }

.race-eta {
  font-family: 'Roboto Mono', monospace;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  background: var(--g-brand);
  color: #fff;
  padding: 2px 8px;
  border-radius: var(--r-full);
  min-width: 34px;
  text-align: center;
  flex-shrink: 0;
}

.race-label { flex: 1; font-size: 13px; }

.race-meta {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  font-family: 'Roboto Mono', monospace;
  font-size: 11px;
  color: var(--muted-2);
}
.race-meta span {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: 4px;
}

/* Loading */
.loading-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  color: var(--muted);
  font-size: 13px;
}

/* ══════════════════════════════════════
   FOOTER
   ══════════════════════════════════════ */
.site-footer {
  background: var(--ink);
  /* Thin teal top rule */
  border-top: 1px solid rgba(21,101,192,.25);
  padding: 44px 28px;
  margin-top: 20px;
}
.footer-inner {
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
}
.footer-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-bottom: 18px;
}
.footer-e {
  height: 32px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: .55;
}
.footer-logo-divider {
  display: block;
  width: 1px;
  height: 30px;
  background: rgba(255,255,255,.2);
  flex-shrink: 0;
}
.footer-cor {
  height: 32px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: .55;
}
.footer-text {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 11.5px;
  line-height: 1.5;
}
.footer-sub  { color: rgba(255,255,255,.35); }
.footer-sep  { color: rgba(255,255,255,.18); }
.footer-copy { color: rgba(255,255,255,.2); }

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */
@media (max-width: 480px) {
  .container { padding: 0 18px; }
  .header-inner { padding: 0 18px; }
  .detail-head { flex-direction: column; gap: 8px; }
}

/* ══════════════════════════════════════
   BRACKET VIEW
   ══════════════════════════════════════ */
.bracket-view {
  padding: 16px 18px 20px;
  overflow: hidden;
}
.bracket-scroll {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 8px;
  align-items: flex-start;
  scroll-snap-type: x proximity;
}
.bracket-scroll::-webkit-scrollbar { height: 5px; }
.bracket-scroll::-webkit-scrollbar-track { background: var(--surface-2); border-radius: 3px; }
.bracket-scroll::-webkit-scrollbar-thumb { background: var(--border-solid); border-radius: 3px; }

.bracket-col {
  flex: 0 0 auto;
  min-width: 106px;
  scroll-snap-align: start;
}
.bracket-col-label {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--border-solid);
  margin-bottom: 8px;
  text-align: center;
}
.bracket-nodes {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bracket-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border-solid);
  background: var(--surface);
  cursor: pointer;
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out), border-color .15s;
  width: 100%;
  font-family: inherit;
}
.bracket-node:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-2);
  border-color: rgba(21,101,192,.4);
}
.bracket-node:active { transform: none; box-shadow: var(--sh-1); }

.bracket-eta {
  font-family: 'Roboto Mono', monospace;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: var(--r-full);
  background: var(--g-brand);
  color: #fff;
}
.bracket-racenum {
  font-size: 9.5px;
  color: var(--muted);
  font-family: 'Roboto Mono', monospace;
  letter-spacing: .02em;
}

/* Stage-specific bracket colors */
.bracket-tt     .bracket-eta { background: linear-gradient(135deg,#546E7A,#78909C); }
.bracket-ko     .bracket-eta { background: linear-gradient(135deg,#B71C1C,#EF5350); }
.bracket-heat   .bracket-eta { background: var(--g-brand); }
.bracket-rep    .bracket-eta { background: linear-gradient(135deg,#1B5E20,#43A047); }
.bracket-quarter .bracket-eta{ background: linear-gradient(135deg,#E65100,#FB8C00); }
.bracket-semi   .bracket-eta { background: linear-gradient(135deg,#4527A0,#7B1FA2); }
.bracket-final  .bracket-eta { background: linear-gradient(135deg,#F57F17,#F9A825); }

/* ══════════════════════════════════════
   PDF VIEWER MODAL
   ══════════════════════════════════════ */
.pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.pdf-modal.open { display: flex; }

.pdf-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5,10,18,.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.pdf-modal-panel {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.06);
  width: 100%;
  max-width: 920px;
  height: 90dvh;
  display: flex;
  flex-direction: column;
  animation: modalIn .22s var(--ease-out);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.pdf-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--divider);
  background: var(--surface-2);
  flex-shrink: 0;
}
.pdf-modal-title {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pdf-modal-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.pdf-modal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-solid);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: all .15s var(--ease);
  flex-shrink: 0;
}
.pdf-modal-btn:hover {
  background: rgba(21,101,192,.08);
  color: var(--accent);
  border-color: rgba(21,101,192,.35);
}
.pdf-modal-body {
  flex: 1;
  overflow: hidden;
  background: #555;
}
.pdf-modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
body.modal-open { overflow: hidden; }

/* ══════════════════════════════════════
   ALPINE UTILITIES
   ══════════════════════════════════════ */
[x-cloak] { display: none !important; }

/* ══════════════════════════════════════
   DARK MODE
   ══════════════════════════════════════ */
@media (prefers-color-scheme: dark) {
  :root {
    --ink:          #E2E6F8;
    --ink-2:        #C3C7DB;
    --muted:        #C3C7DB;
    --muted-2:      #8D91A7;
    --bg:           #111420;
    --surface:      #0C0F1A;
    --surface-2:    #171C2C;
    --surface-3:    #1E2335;
    --border:       rgba(67,71,106,.5);
    --border-solid: #43476A;
    --divider:      rgba(67,71,106,.4);
    --sh-1: 0 1px 3px rgba(0,0,0,.25);
    --sh-2: 0 2px 6px rgba(0,0,0,.25),  0 1px 2px rgba(0,0,0,.18);
    --sh-3: 0 4px 12px rgba(0,0,0,.3),  0 2px 4px rgba(0,0,0,.18);
    --sh-glow: 0 2px 10px rgba(160,196,255,.12), 0 0 0 1px rgba(160,196,255,.12);
  }

  body {
    background-image:
      radial-gradient(ellipse at 20% 25%, rgba(21,101,192,.08) 0%, transparent 55%),
      radial-gradient(ellipse at 80% 75%, rgba(0,101,142,.06) 0%, transparent 55%);
  }

  .detail-name {
    background: linear-gradient(135deg, var(--ink) 30%, #A0C4FF 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .site-footer { background: var(--surface); border-top-color: var(--border-solid); }

  .bracket-node:hover { border-color: rgba(160,196,255,.4); }

  .view-toggle { background: rgba(255,255,255,.06); }
  .view-btn.active { background: var(--surface-3); }
}
