:root {
  color-scheme: dark;
  --bg: #080a0a;
  --surface: #101313;
  --surface-2: #151919;
  --line: #252b29;
  --muted: #87908d;
  --text: #f2f4ef;
  --acid: #c7ff36;
  --acid-soft: rgba(199, 255, 54, 0.12);
  --orange: #ff7138;
  --gold: #ffcb45;
  --silver: #b8c2c3;
  --bronze: #d68b5e;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 82% 8%, rgba(199, 255, 54, 0.075), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

a { color: inherit; }

.topbar {
  height: 82px;
  padding: 0 clamp(20px, 5vw, 80px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border: 1px solid #3a413f;
  display: grid;
  place-items: center;
  font: 800 21px/1 var(--mono);
  transform: rotate(-3deg);
}

.brand-mark span { color: var(--acid); }
.brand strong { display: block; font-size: 15px; letter-spacing: 0.14em; }
.brand small { color: var(--muted); font: 10px/1.5 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; }

.connection {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font: 11px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.connection-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(255, 203, 69, 0.1);
}

.connection.live .connection-dot {
  background: var(--acid);
  box-shadow: 0 0 0 4px var(--acid-soft), 0 0 18px rgba(199, 255, 54, 0.45);
  animation: pulse 2s infinite;
}

.connection.error .connection-dot { background: var(--orange); box-shadow: 0 0 0 4px rgba(255, 113, 56, 0.12); }

main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

.hero {
  position: relative;
  padding: clamp(80px, 11vw, 150px) 0 clamp(74px, 9vw, 120px);
  border-bottom: 1px solid var(--line);
}

.hero::after {
  content: "SCHOOL / SCORE";
  position: absolute;
  top: 48px;
  right: 0;
  color: #1b201f;
  font: 900 clamp(35px, 7.5vw, 112px)/1 var(--mono);
  letter-spacing: -0.08em;
  z-index: -1;
  white-space: nowrap;
}

.eyebrow, .section-index {
  color: var(--acid);
  font: 700 11px/1 var(--mono);
  letter-spacing: 0.14em;
}

.eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.eyebrow span { width: 30px; height: 1px; background: var(--acid); }

h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(48px, 8vw, 108px);
  line-height: 0.9;
  letter-spacing: -0.065em;
  text-transform: uppercase;
}

h1 em { color: var(--acid); font-style: normal; }

.hero-copy {
  max-width: 570px;
  margin: 34px 0 0;
  color: #a7afac;
  font-size: clamp(15px, 1.8vw, 19px);
  line-height: 1.65;
}

.event-clock {
  position: absolute;
  right: 0;
  bottom: 120px;
  min-width: 250px;
  padding: 18px 20px;
  border-left: 2px solid var(--acid);
  background: rgba(199, 255, 54, 0.045);
}

.clock-label { display: block; margin-bottom: 8px; color: var(--muted); font: 10px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.12em; }
.event-clock strong { font: 700 24px/1 var(--mono); letter-spacing: 0.03em; }

.stats {
  display: flex;
  gap: clamp(28px, 6vw, 78px);
  margin: 64px 0 0;
}

.stats div { display: flex; flex-direction: column; }
.stats dt { font: 700 clamp(22px, 3vw, 32px)/1 var(--mono); }
.stats dd { order: -1; margin: 0 0 9px; color: var(--muted); font: 10px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.09em; }

.alert {
  margin: 0 0 18px;
  padding: 13px 16px;
  border: 1px solid rgba(255, 113, 56, 0.35);
  background: rgba(255, 113, 56, 0.08);
  color: #ffc2aa;
  font: 12px/1.5 var(--mono);
}

.hidden { display: none !important; }

.ranking-section { padding: 36px 0 60px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 24px;
}

h2 { margin: 0; font-size: clamp(30px, 4vw, 46px); letter-spacing: -0.04em; }

.search {
  width: min(330px, 100%);
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
}

.search:focus-within { border-color: #58625e; }
.search svg { width: 17px; fill: none; stroke: var(--muted); stroke-width: 1.7; }
.search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: 12px var(--mono); }
.search input::placeholder { color: #606865; }

.podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 12px;
  margin: 0 0 34px;
}

.podium-card {
  position: relative;
  min-height: 238px;
  padding: 28px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, #151918, #0e1111);
  overflow: hidden;
}

.podium-card::after {
  content: attr(data-rank);
  position: absolute;
  right: -8px;
  bottom: -31px;
  color: rgba(255,255,255,0.035);
  font: 900 145px/1 var(--mono);
}

.podium-card.rank-1 { min-height: 268px; border-color: rgba(199, 255, 54, 0.38); background: linear-gradient(145deg, rgba(199,255,54,0.11), #101412 58%); order: 2; }
.podium-card.rank-2 { order: 1; }
.podium-card.rank-3 { order: 3; }
.podium-rank { color: var(--muted); font: 700 11px/1 var(--mono); }
.rank-1 .podium-rank { color: var(--acid); }
.rank-2 .podium-rank { color: var(--silver); }
.rank-3 .podium-rank { color: var(--bronze); }
.podium-school { position: relative; z-index: 1; margin: 36px 0 8px; max-width: 90%; font-size: clamp(17px, 2vw, 24px); line-height: 1.2; letter-spacing: -0.025em; }
.podium-team { position: relative; z-index: 1; color: var(--muted); font: 11px/1.4 var(--mono); }
.podium-score { position: absolute; z-index: 1; left: 28px; bottom: 27px; font: 800 clamp(25px, 3vw, 36px)/1 var(--mono); }
.podium-score small { color: var(--muted); font-size: 10px; font-weight: 500; text-transform: uppercase; }

.table-wrap { border: 1px solid var(--line); overflow-x: auto; background: rgba(16, 19, 19, 0.65); }
table { width: 100%; border-collapse: collapse; }
th { color: var(--muted); font: 600 10px/1 var(--mono); text-align: left; text-transform: uppercase; letter-spacing: 0.09em; }
thead th { height: 52px; padding: 0 20px; border-bottom: 1px solid var(--line); }
tbody td { height: 76px; padding: 13px 20px; border-bottom: 1px solid #1d2221; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background 140ms ease; }
tbody tr:hover { background: rgba(199, 255, 54, 0.035); }
.rank-cell { width: 90px; color: #727b78; font: 700 16px var(--mono); }
.rank-cell strong { color: var(--text); }
.school-cell { min-width: 270px; font-weight: 650; letter-spacing: -0.01em; }
.team-cell { min-width: 190px; color: #a5adaa; font: 12px var(--mono); }
.score-col { text-align: right; }
td.score-col { color: var(--acid); font: 800 19px var(--mono); }
.trend-col { width: 115px; text-align: center; }
.trend { display: inline-flex; min-width: 38px; justify-content: center; padding: 5px 7px; background: #1b201f; color: var(--muted); font: 10px var(--mono); }
.trend.up { color: var(--acid); background: var(--acid-soft); }
.trend.down { color: #ff9471; background: rgba(255, 113, 56, 0.1); }

.empty { padding: 80px 20px; border: 1px solid var(--line); text-align: center; background: var(--surface); }
.empty-icon { display: block; color: var(--acid); font: 700 28px var(--mono); }
.empty h3 { margin: 20px 0 8px; font-size: 22px; }
.empty p { margin: 0; color: var(--muted); font-size: 14px; }

.update-line { display: flex; justify-content: space-between; gap: 20px; margin-top: 15px; color: #626b68; font: 10px/1.5 var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.update-line span:first-child { display: flex; align-items: center; gap: 7px; }
.update-line i { width: 5px; height: 5px; border-radius: 50%; background: var(--acid); }

footer {
  width: min(1180px, calc(100% - 40px));
  min-height: 94px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #5c6562;
  font: 10px var(--mono);
  letter-spacing: .08em;
}

footer a { text-decoration: none; }
footer a:hover { color: var(--acid); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes pulse { 50% { opacity: .55; } }

@media (max-width: 800px) {
  .event-clock { position: static; width: fit-content; margin-top: 34px; }
  .hero { padding-bottom: 70px; }
  .stats { margin-top: 46px; }
  .section-head { align-items: stretch; flex-direction: column; margin-bottom: 18px; }
  .search { width: 100%; }
  .podium { grid-template-columns: 1fr; align-items: stretch; }
  .podium-card, .podium-card.rank-1 { min-height: 210px; order: initial; }
  .podium-card.rank-1 { order: 1; }
  .podium-card.rank-2 { order: 2; }
  .podium-card.rank-3 { order: 3; }
  .trend-col { display: none; }
}

@media (max-width: 560px) {
  .topbar { height: 70px; padding: 0 20px; }
  .connection #connection-text { display: none; }
  main { width: min(100% - 28px, 1180px); }
  h1 { font-size: clamp(43px, 14vw, 65px); }
  .hero-copy { font-size: 15px; }
  .stats { justify-content: space-between; gap: 10px; }
  .stats dt { font-size: 20px; }
  .stats dd { max-width: 80px; line-height: 1.35; }
  .ranking-section { padding-top: 24px; }
  .podium-card { padding: 23px; }
  .podium-score { left: 23px; bottom: 23px; }
  thead th { padding: 0 14px; }
  tbody td { padding: 12px 14px; }
  .rank-cell { width: 58px; }
  .school-cell { min-width: 210px; }
  .team-cell { min-width: 150px; }
  .update-line { flex-direction: column; gap: 7px; }
  footer { width: calc(100% - 28px); flex-direction: column; align-items: flex-start; justify-content: center; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
