:root {
  color-scheme: dark;
  --bg: #030303;
  --ink: #fffaf0;
  --muted: #bdb6aa;
  --line: rgba(255, 250, 240, 0.14);
  --panel: rgba(12, 12, 12, 0.92);
  --gold: #d9ad49;
  --gold-glow: rgba(255, 128, 38, 0.42);
  --silver: #d9dde2;
  --silver-glow: rgba(135, 202, 255, 0.30);
  --bronze: #b97846;
  --bronze-glow: rgba(255, 88, 50, 0.24);
  --red: #c91725;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, sans-serif;
  background:
    linear-gradient(180deg, #070707 0%, #000 62%);
}

body.modal-open {
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

.rules-button {
  appearance: none;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font: 700 0.82rem/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, sans-serif;
  cursor: pointer;
  text-transform: uppercase;
}

.rules-button:hover,
.rules-button:focus-visible,
.modal-close:hover,
.modal-close:focus-visible {
  color: #f2d06a;
  outline: none;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.hero {
  min-height: 34vh;
  display: grid;
  grid-template-columns: minmax(190px, 310px) 1fr;
  align-items: center;
  gap: clamp(24px, 6vw, 72px);
  padding: 18px 0 30px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-x: hidden;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(14px);
}

.modal-backdrop[hidden] {
  display: none;
}

.rules-modal {
  width: min(540px, calc(100vw - 40px));
  max-height: min(680px, calc(100vh - 40px));
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  padding: 30px;
  border: 1px solid rgba(255, 250, 240, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 32%),
    rgba(12, 12, 12, 0.96);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.62);
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255, 250, 240, 0.20);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  font: 650 0.78rem/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, sans-serif;
  cursor: pointer;
}

.rules-modal h2 {
  margin-bottom: 18px;
  color: var(--ink);
  font-size: clamp(2rem, 7vw, 3.2rem);
  text-transform: none;
}

.rules-copy {
  display: grid;
  gap: 14px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.55;
}

.rules-copy p {
  margin: 0;
}

.hall-of-fame {
  display: grid;
  gap: 7px;
  margin: 4px 0;
}

.hall-of-fame h3 {
  margin: 0 0 2px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.host-frame {
  position: relative;
  width: min(100%, 300px);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.host-frame::before {
  content: none;
}

.host-frame::after {
  content: "";
  position: absolute;
  inset: 1%;
  border: 1px solid rgba(255, 250, 240, 0.28);
  border-radius: 50%;
  z-index: -1;
}

.host-frame img {
  width: 88%;
  height: 88%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #0d0d0d;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.68);
}

.title-lockup {
  max-width: 650px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: none;
  font-size: clamp(2.65rem, 6.7vw, 5.6rem);
  font-weight: 700;
  line-height: 0.96;
}

h1 span {
  display: block;
  white-space: nowrap;
}

.site-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  border-bottom: 1px solid var(--line);
}

.site-tab {
  appearance: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0 0 11px;
  margin-right: 18px;
  color: var(--muted);
  background: transparent;
  font: 750 0.82rem/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, sans-serif;
  text-transform: uppercase;
  cursor: pointer;
}

.site-tab.active,
.site-tab:hover,
.site-tab:focus-visible {
  color: var(--ink);
  border-bottom-color: #f2d06a;
  outline: none;
}

.content-panel {
  border-top: 0;
  padding-top: 8px;
}

.site-tabs + .content-panel {
  padding-top: 0;
}

.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;
}

.panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

h2 {
  color: #f2d06a;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.updated {
  margin: 0;
  color: var(--muted);
  font: 0.9rem/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, sans-serif;
  text-align: center;
}

.leaderboard {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.jury-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.stats-panel {
  border: 1px solid rgba(255, 250, 240, 0.14);
  background: rgba(12, 12, 12, 0.82);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7);
}

.stats-panel {
  min-height: 220px;
  padding: 18px;
}

.stats-panel h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1;
}

.panel-note,
.empty-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.renegades-list,
.prediction-cards {
  display: grid;
  gap: 8px;
}

.stats-panel .panel-note {
  margin-bottom: 14px;
}

.renegade-row {
  min-height: 42px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 250, 240, 0.10);
  background: rgba(255, 255, 255, 0.035);
}

.rank.mini {
  width: 26px;
  height: 26px;
  font-size: 0.75rem;
  color: #030303;
  background: #f2d06a;
}

.changes-page {
  max-width: 920px;
  margin: 0 auto;
}

.changes-description {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.changes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 0 16px;
}

.add-change-button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(242, 208, 106, 0.7);
  color: #f2d06a;
  background: transparent;
  font: 750 0.7rem/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, sans-serif;
  text-transform: uppercase;
  cursor: pointer;
}

.add-change-button:hover,
.add-change-button:focus-visible,
.post-button:hover,
.post-button:focus-visible {
  outline: none;
}

.add-change-button:hover,
.add-change-button:focus-visible {
  color: #030303;
  background: #f2d06a;
}

.post-button:hover,
.post-button:focus-visible {
  background: #ffe38a;
}

.changes-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.change-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 6px;
  border-bottom: 1px solid var(--line);
}

.change-date {
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, sans-serif;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.3;
  text-transform: none;
  white-space: nowrap;
}

.change-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.change-copy h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.change-meta {
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

.change-severity {
  text-transform: capitalize;
}

.changes-empty {
  padding: 30px 6px;
  border-bottom: 1px solid var(--line);
}

.change-modal {
  width: min(620px, calc(100vw - 40px));
  padding-top: 72px;
}

.change-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.change-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 700;
}

.change-form label span {
  font-size: 0.82rem;
}

.change-form label small {
  color: var(--muted);
  font-weight: 500;
}

.severity-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.severity-field legend {
  margin-bottom: 9px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
}

.severity-options {
  display: flex;
  gap: 8px;
}

.severity-options label {
  position: relative;
  display: block;
  cursor: pointer;
}

.severity-options input {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  overflow: hidden;
  clip-path: inset(50%);
  pointer-events: none;
}

.severity-options span {
  min-width: 72px;
  display: block;
  padding: 9px 14px;
  border: 1px solid rgba(255, 250, 240, 0.22);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.severity-options input:checked + span,
.severity-options input:focus-visible + span {
  border-color: rgba(242, 208, 106, 0.82);
  color: #f2d06a;
}

.change-form input,
.change-form textarea {
  width: 100%;
  border: 1px solid rgba(255, 250, 240, 0.18);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  font: 1rem/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, sans-serif;
}

.change-form input {
  height: 42px;
  padding: 0 11px;
}

.change-form textarea {
  min-height: 64px;
  padding: 10px 11px;
  overflow-wrap: anywhere;
  resize: vertical;
}

.change-form input:focus,
.change-form textarea:focus {
  border-color: rgba(242, 208, 106, 0.72);
  outline: none;
}

.post-button {
  justify-self: start;
  height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(242, 208, 106, 0.72);
  color: #030303;
  background: #f2d06a;
  font: 800 0.88rem/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, sans-serif;
  cursor: pointer;
}

.post-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.form-status {
  min-height: 1.2em;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.rules-page {
  max-width: 640px;
}

.rules-page h2 {
  margin-bottom: 18px;
  color: var(--ink);
  font-size: clamp(2rem, 7vw, 3.2rem);
  text-transform: none;
}

.entrant {
  --accent: rgba(255, 255, 255, 0.82);
  --glow: transparent;
  min-height: 54px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) minmax(66px, auto);
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 14%, transparent), transparent 52%),
    var(--panel);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.8), 0 12px 30px var(--glow);
}

.entrant.gold {
  --accent: var(--gold);
  --glow: var(--gold-glow);
}

.entrant.silver {
  --accent: var(--silver);
  --glow: var(--silver-glow);
}

.entrant.bronze {
  --accent: var(--bronze);
  --glow: var(--bronze-glow);
}

.rank {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #030303;
  background: var(--accent);
  border-radius: 50%;
  font: 800 0.9rem/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, sans-serif;
}

.plain .rank {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  font-weight: 520;
  line-height: 1;
}

.score {
  justify-self: end;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--accent);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, sans-serif;
  white-space: nowrap;
}

.score strong {
  font-size: clamp(1.25rem, 2.4vw, 1.85rem);
}

.score small {
  color: var(--muted);
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 22px, 520px);
    padding-top: 18px;
  }

  .rules-button {
    font-size: 0.82rem;
  }

  .rules-modal {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    padding: 26px 20px;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    justify-items: center;
    text-align: center;
    gap: 18px;
  }

  .host-frame {
    width: min(68vw, 250px);
  }

  h1 {
    margin: 0 auto;
    font-size: clamp(2.35rem, 10.5vw, 3.15rem);
  }

  .panel-head {
    display: flex;
  }

  .site-tabs {
    flex-wrap: nowrap;
    gap: 6px;
    overflow: hidden;
  }

  .site-tab {
    flex: 1 1 0;
    margin-right: 0;
    padding: 0 0 8px;
    font-size: 0.58rem;
    letter-spacing: 0;
    white-space: nowrap;
    text-align: center;
  }

  .jury-grid {
    grid-template-columns: 1fr;
  }

  .changes-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 2px 0 14px;
  }

  .add-change-button {
    margin-top: 1px;
  }

  .change-row {
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 10px;
    padding: 13px 0;
  }

  .change-meta {
    display: inline;
  }

  .change-copy {
    display: grid;
    gap: 5px;
  }

  .updated {
    margin-top: 18px;
  }

  .entrant {
    min-height: 54px;
    grid-template-columns: 38px minmax(0, 1fr) minmax(58px, auto);
    gap: 9px;
    padding: 8px 10px;
  }

  .rank {
    width: 32px;
    height: 32px;
  }
}
