:root {
  --navy-950: #04122d;
  --navy-900: #061942;
  --navy-800: #09275c;
  --navy-100: #e9eff9;
  --ink: #0b1735;
  --muted: #62708a;
  --gold: #e7a51e;
  --gold-soft: #fff0c5;
  --line: #dee6f2;
  --surface: #ffffff;
  --surface-soft: #f6f8fc;
  --green: #128a54;
  --red: #d83b3b;
  --shadow: 0 18px 55px rgba(4, 18, 45, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface-soft);
  font-family: "Aptos", "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  min-height: 82px;
  padding: 12px 48px;
  color: white;
  background: rgba(4, 18, 45, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand,
footer div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img,
footer img {
  width: 56px;
}

.brand strong,
footer strong {
  display: block;
  font-size: 18px;
}

.brand small,
footer small {
  color: var(--gold);
  font-weight: 800;
}

nav {
  display: flex;
  justify-content: center;
  gap: 30px;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

#voteButton,
#voteDialog button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 22px;
  color: var(--navy-950);
  background: linear-gradient(135deg, #f8c75a, #df9e17);
  cursor: pointer;
  font-weight: 900;
}

main {
  width: min(1440px, 100%);
  margin: 0 auto;
}

.hero {
  min-height: 310px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  align-items: center;
  gap: 36px;
  padding: 44px 48px;
  color: white;
  background:
    linear-gradient(90deg, rgba(4, 18, 45, 0.96), rgba(9, 39, 92, 0.86)),
    repeating-linear-gradient(135deg, rgba(231, 165, 30, 0.16) 0 1px, transparent 1px 24px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 820px;
  margin: 0;
  font-family: Georgia, serif;
  font-size: 72px;
  line-height: 1.02;
}

.hero-copy p:last-child {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
}

.countdown-card {
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(4, 18, 45, 0.74);
  box-shadow: var(--shadow);
}

.countdown-card p {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 900;
  text-transform: uppercase;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
}

.countdown-grid strong {
  color: var(--gold);
  font-size: 44px;
}

.countdown-grid span {
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  text-transform: uppercase;
}

.countdown-card small {
  display: block;
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 18px 48px 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stats-strip article {
  min-height: 110px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 20px 24px;
  border-right: 1px solid var(--line);
}

.stats-strip article:last-child {
  border-right: 0;
}

.stats-strip span,
.stats-strip small {
  color: var(--muted);
}

.stats-strip span {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.stats-strip strong {
  font-size: 28px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(340px, 0.8fr);
  gap: 16px;
  padding: 0 48px 28px;
}

.side-stack {
  display: grid;
  gap: 16px;
}

.panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 12px 36px rgba(6, 25, 66, 0.05);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  margin-bottom: 12px;
}

.panel h2 {
  margin: 0;
  font-size: 20px;
}

#connectionStatus {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

#connectionStatus.live {
  color: var(--green);
}

.leaderboard {
  display: grid;
}

.leader-row {
  display: grid;
  grid-template-columns: 42px 1.3fr minmax(130px, 1fr) 90px 80px;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.rank {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--navy-900);
  font-weight: 900;
}

.rank.top {
  color: var(--navy-950);
  background: var(--gold);
}

.person {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: var(--navy-800);
  font-weight: 900;
}

.person strong {
  display: block;
  overflow-wrap: anywhere;
}

.person small,
.about-copy {
  color: var(--muted);
}

.bar {
  height: 8px;
  border-radius: 999px;
  background: #e9edf5;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--navy-900);
}

canvas {
  width: 100%;
  min-height: 220px;
}

.how-card ol {
  margin: 0;
  padding-left: 22px;
  line-height: 1.9;
}

.how-card li::marker {
  color: var(--gold);
  font-weight: 900;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 48px;
  color: white;
  background: var(--navy-950);
}

footer p {
  color: rgba(255, 255, 255, 0.7);
}

.empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
}

#voteDialog {
  width: min(420px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

#voteDialog::backdrop {
  background: rgba(4, 18, 45, 0.72);
}

#voteDialog form {
  display: grid;
  gap: 12px;
  padding: 24px;
}

#voteDialog h2,
#voteDialog p {
  margin: 0;
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr auto;
    padding: 12px 20px;
  }

  nav {
    display: none;
  }

  .hero,
  .content-grid,
  .stats-strip {
    margin-left: 0;
    margin-right: 0;
  }

  .hero,
  .content-grid {
    grid-template-columns: 1fr;
    padding-left: 20px;
    padding-right: 20px;
  }

  .hero h1 {
    font-size: 56px;
  }

  .stats-strip {
    grid-template-columns: 1fr 1fr;
    margin: 16px 20px;
  }

  .stats-strip article:nth-child(2) {
    border-right: 0;
  }
}

@media (max-width: 640px) {
  .site-header {
    grid-template-columns: 1fr;
  }

  #voteButton {
    width: 100%;
  }

  .hero h1 {
    font-size: 40px;
  }

  .countdown-grid strong {
    font-size: 32px;
  }

  .stats-strip,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .stats-strip article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .stats-strip article:last-child {
    border-bottom: 0;
  }

  .leader-row {
    grid-template-columns: 42px 1fr;
    gap: 8px;
  }

  .leader-row .bar,
  .leader-row > strong,
  .leader-row > span:last-child {
    grid-column: 2;
  }

  footer {
    align-items: start;
    flex-direction: column;
    padding: 24px 20px;
  }
}
