:root {
  --bg: #050506;
  --panel: rgba(12, 12, 14, 0.78);
  --panel-strong: rgba(10, 10, 12, 0.92);
  --text: #fff8f8;
  --muted: #b9b2b2;
  --soft: #7d7676;
  --line: rgba(255, 255, 255, 0.12);
  --red: #e00718;
  --red-dark: #79000a;
  --red-soft: rgba(224, 7, 24, 0.26);
  --white-soft: rgba(255, 255, 255, 0.78);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
}

button {
  font: inherit;
}

.site-shell {
  min-height: 100vh;
  overflow-x: hidden;
}

.hero {
  position: relative;
  min-height: 100svh;
  padding: 20px clamp(16px, 3vw, 42px) 30px;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}

.stadium-bg,
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.stadium-bg {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.66) 56%, rgba(0, 0, 0, 0.92)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.1) 48%, rgba(0, 0, 0, 0.72)),
    url("assets/stadium-night.png") center top / cover no-repeat;
  filter: saturate(1.12) contrast(1.12) brightness(1.08);
}

.hero-overlay {
  z-index: -1;
  background:
    radial-gradient(circle at 50% 38%, rgba(224, 7, 24, 0.24), transparent 44%),
    linear-gradient(90deg, rgba(224, 7, 24, 0.08), transparent 24%, transparent 76%, rgba(224, 7, 24, 0.08)),
    linear-gradient(180deg, rgba(5, 5, 6, 0.3), #050506 98%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  z-index: 2;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-mark {
  width: 12px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-bottom: 4px solid var(--red);
  display: inline-block;
}

.live-pill,
.pulse-key {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  border: 1px solid rgba(224, 7, 24, 0.44);
  background: rgba(0, 0, 0, 0.45);
  color: var(--white-soft);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.live-dot,
.pulse-key span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 6px rgba(224, 7, 24, 0.13);
  animation: beat 1.7s infinite;
}

.hero-grid {
  width: min(1180px, 100%);
  margin: 22px auto 0;
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  align-items: start;
  gap: 18px;
  padding: 8px 0 18px;
}

.witness-panel {
  width: min(920px, 100%);
  max-width: none;
  text-align: center;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 12px;
  color: #ffeff0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.witness-panel .eyebrow {
  margin-bottom: 10px;
  color: #ffdadc;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin: 0 auto 14px;
  max-width: 980px;
  font-size: clamp(46px, 7.1vw, 96px);
  line-height: 0.9;
  letter-spacing: 0;
  text-wrap: balance;
}

.subcopy {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  color: #d4cdcd;
  font-size: clamp(17px, 1.55vw, 22px);
  line-height: 1.42;
}

.action-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 22px 0 16px;
  text-align: center;
}

.country-picker {
  display: grid;
  gap: 8px;
  width: min(320px, 100%);
  color: var(--white-soft);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.country-picker select {
  width: 100%;
  min-height: 46px;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(45deg, transparent 50%, #fff8f8 50%) calc(100% - 18px) 19px / 6px 6px no-repeat,
    linear-gradient(135deg, #fff8f8 50%, transparent 50%) calc(100% - 13px) 19px / 6px 6px no-repeat,
    rgba(0, 0, 0, 0.5);
  color: var(--text);
  padding: 0 38px 0 13px;
  font: inherit;
  font-size: 14px;
  font-weight: 760;
  text-transform: none;
  outline: none;
}

.country-picker select:focus {
  border-color: rgba(255, 255, 255, 0.56);
  box-shadow: 0 0 0 3px rgba(224, 7, 24, 0.18);
}

.witness-button {
  min-width: 190px;
  min-height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ff1830, #a0000e);
  color: #ffffff;
  padding: 0 22px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 850;
  text-transform: uppercase;
  box-shadow: 0 18px 44px rgba(224, 7, 24, 0.3);
  transition:
    transform 160ms ease,
    filter 160ms ease,
    box-shadow 160ms ease;
}

.witness-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.witness-button:active {
  transform: translateY(0);
}

.witness-button.is-pressed {
  background: #ffffff;
  color: #09090a;
  box-shadow: 0 18px 44px rgba(255, 255, 255, 0.14);
  cursor: default;
}

.witness-id {
  color: var(--muted);
  min-height: 22px;
  font-size: 14px;
  width: 100%;
  text-align: center;
}

.email-form {
  width: min(430px, 100%);
  margin-top: 2px;
}

.email-label {
  display: block;
  margin-bottom: 8px;
  color: var(--white-soft);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.email-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.email-row input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.48);
  color: var(--text);
  padding: 0 13px;
  font: inherit;
  outline: none;
}

.email-row input:focus {
  border-color: rgba(255, 255, 255, 0.56);
  box-shadow: 0 0 0 3px rgba(224, 7, 24, 0.18);
}

.email-row button {
  min-height: 46px;
  border: 1px solid rgba(224, 7, 24, 0.56);
  border-radius: var(--radius);
  background: rgba(224, 7, 24, 0.2);
  color: var(--text);
  padding: 0 17px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.email-status {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--soft);
  font-size: 12px;
}

.share-panel {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(18px);
}

.share-panel[hidden] {
  display: none;
}

.share-dialog {
  position: relative;
  width: min(430px, 100%);
  max-height: min(760px, calc(100vh - 44px));
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 0%, rgba(224, 7, 24, 0.22), transparent 48%),
    rgba(8, 8, 10, 0.96);
  padding: 20px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.72);
}

.share-close {
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white-soft);
  padding: 0 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.share-title {
  margin: 12px 0 10px;
  color: var(--white-soft);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

#sharePreview {
  display: block;
  width: min(260px, 100%);
  margin: 0 auto 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.54);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.share-actions button {
  min-height: 38px;
  border: 1px solid rgba(224, 7, 24, 0.56);
  border-radius: var(--radius);
  background: rgba(224, 7, 24, 0.18);
  color: var(--text);
  padding: 0 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.share-actions button:hover,
.email-row button:hover {
  background: rgba(224, 7, 24, 0.3);
}

.share-status {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--soft);
  font-size: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 10px;
  max-width: 560px;
  margin: 0 auto;
}

.stat,
.map-panel,
.leaderboard,
.activity {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
}

.stat {
  border-radius: var(--radius);
  padding: 15px;
}

.stat-value {
  display: block;
  font-size: clamp(27px, 3vw, 42px);
  line-height: 1;
  font-weight: 880;
}

.stat-label {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  text-transform: uppercase;
}

.map-panel {
  border-radius: var(--radius);
  width: min(1120px, 100%);
  min-height: 440px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(12, 12, 14, 0.76), rgba(6, 6, 7, 0.9)),
    rgba(0, 0, 0, 0.54);
  box-shadow:
    0 36px 110px rgba(0, 0, 0, 0.62),
    0 0 90px rgba(224, 7, 24, 0.12);
}

.map-header,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.map-header h2,
.section-heading h2 {
  margin: 0;
  font-size: clamp(20px, 2vw, 30px);
  line-height: 1.08;
}

.map-header {
  align-items: center;
}

.map-wrap {
  position: relative;
  height: clamp(320px, 37vw, 470px);
  margin-top: 16px;
  border-radius: 6px;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 50% 42%, rgba(224, 7, 24, 0.12), transparent 58%),
    rgba(0, 0, 0, 0.34);
  background-size:
    42px 42px,
    42px 42px,
    auto,
    auto;
}

#worldMap {
  width: 100%;
  height: 100%;
  display: block;
}

.country {
  fill: rgba(255, 255, 255, 0.1);
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 0.45;
  transition:
    fill 180ms ease,
    opacity 180ms ease;
}

.country:hover {
  opacity: 0.92;
  stroke: rgba(255, 255, 255, 0.68);
}

.pulse-point {
  fill: #fff;
  stroke: var(--red);
  stroke-width: 2;
  filter: drop-shadow(0 0 10px rgba(224, 7, 24, 0.9));
  transform-origin: center;
  animation: pointPulse 1.9s infinite;
}

.pulse-point.user-country {
  fill: var(--red);
  stroke: #fff;
}

.map-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  font-weight: 760;
}

.map-loading.is-hidden {
  display: none;
}

.tooltip {
  position: fixed;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 14px));
  border: 1px solid var(--line);
  background: rgba(6, 6, 7, 0.94);
  border-radius: 6px;
  padding: 10px 12px;
  min-width: 150px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  transition: opacity 120ms ease;
}

.tooltip strong {
  display: block;
  font-size: 13px;
}

.tooltip span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-band {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(300px, 1.08fr);
  gap: 18px;
  padding: 18px clamp(16px, 3vw, 42px) 42px;
  background:
    linear-gradient(180deg, rgba(5, 5, 6, 0.72), #050506 34%),
    url("assets/stadium-night.png") center bottom / cover no-repeat;
}

.leaderboard,
.activity {
  border-radius: var(--radius);
  padding: 20px;
}

#leaderboardList,
#activityFeed {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}

#leaderboardList {
  display: grid;
  gap: 8px;
}

#leaderboardList li,
#activityFeed li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 42px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 14px;
}

#leaderboardList li.empty-row {
  grid-template-columns: 1fr;
  justify-items: center;
  min-height: 48px;
  text-align: center;
}

#leaderboardList li:first-child,
#activityFeed li:first-child {
  border-top: 0;
}

.rank {
  width: 28px;
  color: var(--red);
  font-weight: 850;
}

.country-name,
.activity-copy {
  color: var(--text);
  font-weight: 700;
}

.country-count {
  color: var(--white-soft);
  font-variant-numeric: tabular-nums;
}

#activityFeed {
  display: grid;
  gap: 0;
}

#activityFeed li {
  grid-template-columns: 9px 1fr auto;
}

.feed-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
}

.feed-time {
  color: var(--soft);
  font-size: 12px;
}

.page-pulse::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  border: 0 solid rgba(224, 7, 24, 0.34);
  animation: pagePulse 760ms ease-out;
  z-index: 20;
}

@keyframes beat {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.35);
  }
}

@keyframes pointPulse {
  0%,
  100% {
    r: 3.5;
    opacity: 0.74;
  }
  50% {
    r: 6.2;
    opacity: 1;
  }
}

@keyframes pagePulse {
  0% {
    border-width: 0;
    opacity: 1;
  }
  100% {
    border-width: 26px;
    opacity: 0;
  }
}

@media (max-width: 980px) {
  .hero {
    min-height: auto;
  }

  .hero-grid,
  .dashboard-band {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    margin: 28px auto 0;
  }

  .witness-panel {
    max-width: 780px;
  }

  .map-panel {
    min-height: 460px;
  }
}

@media (max-width: 620px) {
  .hero {
    padding-top: 18px;
  }

  .brand {
    font-size: 12px;
  }

  .hero-grid {
    padding-top: 18px;
  }

  h1 {
    font-size: clamp(40px, 13.2vw, 58px);
  }

  .stats-grid,
  .action-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .witness-button {
    width: 100%;
  }

  .email-row {
    grid-template-columns: 1fr;
  }

  .map-panel,
  .leaderboard,
  .activity {
    padding: 14px;
  }

  .map-header,
  .section-heading {
    display: block;
  }

  .pulse-key {
    margin-top: 12px;
  }

  .map-wrap {
    height: 318px;
  }

  .dashboard-band {
    padding-bottom: 24px;
  }
}
