* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-0: #060b1d;
  --bg-1: #0a1128;
  --panel: #0e1a3a;
  --panel-2: #122148;
  --panel-3: #16295a;
  --border: #23386e;
  --border-soft: #1b2c58;
  --text: #eef2fb;
  --muted: #8fa3cc;
  --blue: #4d8dff;
  --purple: #8b7bff;
  --green: #35c26e;
  --gold-1: #f9d976;
  --gold-2: #c99a2e;
}

html {
  background: var(--bg-0);
}

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(77, 141, 255, 0.14), transparent),
    linear-gradient(180deg, var(--bg-1), var(--bg-0) 70%);
  color: var(--text);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}

/* ---------- Header ---------- */

.lb-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.title-block h1 {
  font-size: clamp(1.9rem, 4.5vw, 3.2rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.05;
}

.t-plain {
  color: var(--text);
}

.t-gold {
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tm {
  font-size: 0.4em;
  vertical-align: super;
  color: var(--gold-2);
}

.tagline {
  margin-top: 0.4rem;
  font-size: clamp(0.75rem, 1.6vw, 0.95rem);
  text-transform: uppercase;
  letter-spacing: 0.35em;
  color: var(--muted);
}

.standings {
  margin-top: 1.1rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text);
}

.standings .sep,
.method-row .sep {
  color: var(--border);
  margin: 0 0.6rem;
}

.standings #week-of {
  color: var(--muted);
}

/* ---------- Stat cards ---------- */

.stat-cards {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.3rem;
  min-width: 220px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(77, 141, 255, 0.12);
  border: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-body .s-label {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.stat-body .s-value {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.15;
}

.stat-body .s-delta {
  font-size: 0.72rem;
  color: var(--green);
  font-weight: 700;
}

/* ---------- Board / table ---------- */

.board {
  background: linear-gradient(180deg, rgba(18, 33, 72, 0.6), rgba(10, 17, 40, 0.9));
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

thead th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(14, 26, 58, 0.7);
  white-space: nowrap;
}

.info {
  color: var(--blue);
  cursor: help;
  font-style: normal;
}

tbody td {
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}

tbody tr {
  cursor: pointer;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: rgba(77, 141, 255, 0.06);
}

.col-rank { width: 5rem; }
.col-eng, .col-slop { text-align: right; }

/* Rank medals */
.rank-badge {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.05rem;
  color: #1a1405;
}

.rank-badge.gold {
  background: radial-gradient(circle at 35% 30%, #ffe9a8, #f2c94c 55%, #b8860b);
  box-shadow: 0 0 0 3px rgba(242, 201, 76, 0.25), 0 0 18px rgba(242, 201, 76, 0.35);
}

.rank-badge.silver {
  background: radial-gradient(circle at 35% 30%, #ffffff, #cfd6e4 55%, #8a94a8);
  box-shadow: 0 0 0 3px rgba(207, 214, 228, 0.2);
  color: #1c2230;
}

.rank-badge.bronze {
  background: radial-gradient(circle at 35% 30%, #f0c39a, #d1935a 55%, #8c5a2b);
  box-shadow: 0 0 0 3px rgba(209, 147, 90, 0.2);
  color: #2b1a08;
}

.rank-plain {
  width: 42px;
  text-align: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text);
}

/* Poster */
.poster {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 15rem;
}

.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
  border: 2px solid var(--border);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.poster .p-name {
  font-weight: 700;
  font-size: 0.98rem;
  white-space: nowrap;
}

.poster .p-sub {
  font-size: 0.72rem;
  color: var(--muted);
  max-width: 15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Post preview */
.preview-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  max-width: 21rem;
  font-size: 0.85rem;
  color: var(--text);
}

.plus-btn {
  flex-shrink: 0;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--panel-3);
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.plus-btn:hover {
  color: var(--text);
  border-color: var(--blue);
}

/* Engagement */
.eng-cell {
  text-align: right;
  white-space: nowrap;
}

.eng-value {
  font-size: 1.25rem;
  font-weight: 800;
  margin-right: 0.4rem;
}

.bars {
  display: inline-block;
  vertical-align: -2px;
}

/* Slop index */
.slop-cell {
  text-align: right;
  white-space: nowrap;
}

.slop-value {
  font-size: 1.25rem;
  font-weight: 800;
  margin-left: 0.4rem;
}

.gauge {
  vertical-align: -3px;
}

tbody tr:hover .plus-btn {
  color: var(--text);
  border-color: var(--blue);
}

/* Methodology row */
.method-row {
  padding: 0.9rem 1.25rem;
  border-top: 1px solid var(--border);
  background: rgba(14, 26, 58, 0.7);
  font-size: 0.76rem;
  color: var(--muted);
}

.method-row strong {
  color: var(--text);
  margin-right: 0.35rem;
}

.method-row .info {
  margin-right: 0.5rem;
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 1.75rem;
  text-align: center;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-footer .disclaimer {
  display: block;
  margin-top: 0.6rem;
  text-transform: none;
  letter-spacing: normal;
  font-style: italic;
  font-size: 0.74rem;
  color: rgba(143, 163, 204, 0.75);
}

/* ---------- Exhibit modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 16, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 1rem;
  overflow-y: auto;
  z-index: 50;
}

/* The fix for the phantom "search bar": an explicit display on the backdrop
   overrides the hidden attribute's default display:none, so it must be
   restated here with priority. */
.modal-backdrop[hidden] {
  display: none !important;
}

.modal {
  position: relative;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  border-radius: 14px;
  max-width: 640px;
  width: 100%;
  padding: 2rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.modal-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  background: var(--panel-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text);
  border-color: var(--blue);
}

.exhibit-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--gold-1);
  margin-bottom: 1rem;
}

/* Fake social post card */
.post-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-1);
  padding: 1.25rem;
}

.post-head {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.post-author .a-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.post-author .a-headline {
  color: var(--muted);
  font-size: 0.75rem;
}

.post-author .a-meta {
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 0.1rem;
}

.post-body p {
  margin-bottom: 0.9rem;
  font-size: 0.95rem;
  white-space: pre-line;
}

.post-body p:last-child {
  margin-bottom: 0;
}

.post-body mark {
  background: rgba(139, 123, 255, 0.16);
  color: var(--text);
  border-bottom: 2px solid var(--purple);
  padding: 0.05em 0.15em;
  border-radius: 3px;
}

.note-ref {
  color: var(--purple);
  font-weight: 700;
  font-size: 0.7em;
  vertical-align: super;
  margin-left: 0.15em;
}

.post-engagement {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-soft);
  color: var(--muted);
  font-size: 0.78rem;
}

/* Judge's notes */
.notes-section {
  margin-top: 1.5rem;
}

.notes-kicker {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold-1);
  margin-bottom: 0.25rem;
}

.notes-section h4 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}

.notes-list {
  list-style: none;
  counter-reset: note;
}

.notes-list li {
  counter-increment: note;
  position: relative;
  padding: 0.6rem 0 0.6rem 2.2rem;
  border-bottom: 1px dashed var(--border-soft);
  font-size: 0.88rem;
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
}

.notes-list li:last-child {
  border-bottom: none;
}

.notes-list li::before {
  content: counter(note);
  position: absolute;
  left: 0;
  top: 0.7rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 1px solid var(--purple);
  color: var(--purple);
  font-size: 0.72rem;
  font-style: normal;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
}

.analysis-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.25rem;
}

.chip {
  font-size: 0.72rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  white-space: nowrap;
}

.original-link {
  display: block;
  margin-top: 1.25rem;
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  .lb-head {
    flex-direction: column;
  }

  .stat-cards {
    width: 100%;
  }

  .stat-card {
    flex: 1;
    min-width: 160px;
  }
}
