:root {
  color-scheme: dark;
  --background: #05070d;
  --surface: #0d1320;
  --surface-soft: #141d2e;
  --border: #253349;
  --text: #f8fbff;
  --muted: #98a6b8;
  --subtle: #65758b;
  --green: #14d99b;
  --cyan: #24ddf4;
  --amber: #ffc83d;
  --red: #ff6b6b;
  --max: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at 78% 16%, rgba(36, 221, 244, 0.14), transparent 30%),
    linear-gradient(180deg, #05070d 0%, #0b101b 56%, #05070d 100%);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
}

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

.site-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  left: 0;
  margin: 0 auto;
  max-width: var(--max);
  padding: 20px 24px;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 2;
}

.brand {
  align-items: center;
  display: flex;
  font-weight: 900;
  gap: 12px;
}

.brand img {
  height: 42px;
  width: 42px;
}

.brand span span {
  color: var(--green);
}

.nav {
  align-items: center;
  display: flex;
  gap: 18px;
}

.nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.hero {
  display: flex;
  min-height: 86vh;
  overflow: hidden;
  position: relative;
}

.hero::before {
  background-image: url("./assets/onetapworld-logo.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  content: "";
  inset: 8% -10% 0 42%;
  opacity: 0.2;
  position: absolute;
}

.hero-inner {
  align-self: flex-end;
  margin: 0 auto;
  max-width: var(--max);
  padding: 132px 24px 84px;
  position: relative;
  width: 100%;
  z-index: 1;
}

.kicker {
  color: var(--cyan);
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(52px, 9vw, 112px);
  line-height: 0.92;
  margin: 14px 0 22px;
  max-width: 840px;
}

h2 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
  margin: 12px 0 18px;
}

h3 {
  font-size: 24px;
  line-height: 1.1;
  margin: 4px 0 6px;
}

.lead {
  color: var(--muted);
  font-size: clamp(18px, 3vw, 24px);
  line-height: 1.4;
  margin: 0;
  max-width: 650px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
}

.button.primary {
  background: var(--green);
  border-color: var(--green);
  color: #000;
}

.button.secondary {
  background: var(--surface-soft);
  color: var(--text);
}

.button.compact {
  min-height: 44px;
  padding: 0 14px;
}

.section {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 68px 24px;
}

.section-inner {
  margin: 0 auto;
  max-width: var(--max);
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature {
  background: rgba(13, 19, 32, 0.78);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}

.feature strong {
  display: block;
  font-size: 18px;
  margin-bottom: 8px;
}

.feature p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.leaderboard-section {
  background:
    linear-gradient(180deg, rgba(20, 217, 155, 0.05), transparent 38%),
    #070a12;
}

.leaderboard-shell {
  display: grid;
  gap: 28px;
}

.leaderboard-head {
  align-items: end;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
}

.leaderboard-controls {
  display: grid;
  gap: 8px;
}

.control-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.search-row {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.search-row input {
  background: #080d17;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  min-height: 44px;
  min-width: 0;
  outline: none;
  padding: 0 14px;
}

.search-row input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(36, 221, 244, 0.16);
}

.leaderboard-stage {
  align-items: stretch;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) 380px;
}

.map-panel {
  background:
    linear-gradient(180deg, rgba(36, 221, 244, 0.08), transparent 60%),
    #09101b;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 520px;
  overflow: hidden;
  position: relative;
}

#world-map {
  display: block;
  height: 100%;
  min-height: 520px;
  width: 100%;
}

.map-sphere {
  fill: #081522;
}

.map-graticule {
  fill: none;
  stroke: rgba(152, 166, 184, 0.16);
  stroke-width: 0.7;
}

.country {
  cursor: pointer;
  fill: #17243a;
  outline: none;
  stroke: rgba(248, 251, 255, 0.22);
  stroke-width: 0.7;
  transition:
    fill 160ms ease,
    opacity 160ms ease,
    stroke 160ms ease;
}

.country:hover,
.country:focus {
  fill: #24ddf4;
  stroke: #f8fbff;
}

.country.is-selected {
  fill: #14d99b;
  stroke: #f8fbff;
  stroke-width: 1.6;
}

.country.is-muted {
  opacity: 0.34;
}

.country.is-unmapped {
  cursor: default;
  fill: #101827;
  opacity: 0.55;
}

.map-status {
  background: rgba(5, 7, 13, 0.78);
  border: 1px solid rgba(248, 251, 255, 0.1);
  border-radius: 8px;
  bottom: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  left: 16px;
  padding: 10px 12px;
  position: absolute;
}

.leaderboard-panel {
  background: #0b111d;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  min-height: 520px;
  min-width: 0;
  padding: 18px;
}

.country-summary {
  align-items: center;
  display: grid;
  gap: 14px;
  grid-template-columns: 58px minmax(0, 1fr);
}

.country-summary p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
}

.country-flag {
  align-items: center;
  aspect-ratio: 1;
  background: #111b2d;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--green);
  display: flex;
  font-size: 18px;
  font-weight: 900;
  justify-content: center;
  overflow: hidden;
}

.country-stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 18px 0;
}

.country-stats div {
  background: #080d17;
  border: 1px solid rgba(248, 251, 255, 0.08);
  border-radius: 8px;
  min-width: 0;
  padding: 12px;
}

.country-stats span {
  color: var(--subtle);
  display: block;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.country-stats strong {
  color: var(--text);
  display: block;
  font-size: 18px;
  line-height: 1.15;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.leaderboard-table {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.table-head {
  color: var(--subtle);
  display: grid;
  font-size: 11px;
  font-weight: 900;
  gap: 10px;
  grid-template-columns: 48px minmax(0, 1fr) 72px;
  padding: 0 8px 8px;
  text-transform: uppercase;
}

.table-head span:last-child {
  text-align: right;
}

.leaderboard-rows {
  display: grid;
  gap: 8px;
}

.leaderboard-row {
  align-items: center;
  background: #080d17;
  border: 1px solid rgba(248, 251, 255, 0.08);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 48px minmax(0, 1fr) 72px;
  min-height: 58px;
  padding: 10px 8px;
}

.leaderboard-row:first-child {
  border-color: rgba(255, 200, 61, 0.5);
}

.row-rank {
  color: var(--cyan);
  font-size: 16px;
  font-weight: 900;
}

.row-player {
  min-width: 0;
}

.row-player strong {
  display: block;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-player span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-score {
  text-align: right;
}

.row-score strong {
  display: block;
  font-size: 14px;
}

.row-score span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  margin-top: 2px;
}

.empty-state {
  border: 1px dashed rgba(248, 251, 255, 0.16);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  padding: 18px;
  text-align: center;
}

.split {
  align-items: center;
  display: grid;
  gap: 36px;
  grid-template-columns: 1fr 360px;
}

.score-card {
  aspect-ratio: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px;
}

.score-card img {
  height: 52px;
  width: 52px;
}

.score-card .raw {
  font-size: 44px;
  font-weight: 900;
  line-height: 1;
}

.score-card .percentile {
  color: var(--green);
  font-size: 26px;
  font-weight: 900;
}

.legal-page {
  margin: 0 auto;
  max-width: 860px;
  padding: 112px 24px 72px;
}

.legal-page h1 {
  font-size: clamp(38px, 7vw, 72px);
}

.legal-page h2 {
  font-size: 24px;
  margin-top: 38px;
}

.legal-page p,
.legal-page li {
  color: var(--muted);
  line-height: 1.65;
}

.legal-page ul {
  padding-left: 22px;
}

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--subtle);
  padding: 30px 24px;
}

.footer-inner {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: var(--max);
}

.footer-links {
  display: flex;
  gap: 18px;
}

@media (max-width: 760px) {
  .site-header {
    padding: 16px;
  }

  .brand span {
    display: none;
  }

  .nav {
    gap: 12px;
  }

  .hero {
    min-height: 82vh;
  }

  .hero::before {
    inset: 18% -20% 10% 10%;
    opacity: 0.16;
  }

  .hero-inner {
    padding: 112px 16px 56px;
  }

  .grid,
  .split,
  .leaderboard-head,
  .leaderboard-stage {
    grid-template-columns: 1fr;
  }

  .score-card {
    max-width: 360px;
  }

  .section {
    padding: 46px 16px;
  }

  .map-panel,
  #world-map,
  .leaderboard-panel {
    min-height: 420px;
  }

  .country-stats {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}
