:root {
  --bg: #050b1f;
  --panel-line: rgba(39, 211, 255, 0.55);
  --text: #eaf6ff;
  --text-dim: #9fb6d9;
  --cyan: #27d3ff;
  --blue: #1b6bff;
  --amber: #ffb627;
  --coral: #ff5d5d;
  --teal: #3ed9b3;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 40px 16px 30px;
  text-align: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: url("assets/hero-1920.webp") center top / cover no-repeat, var(--bg);
  z-index: 0;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 11, 31, 0.15) 0%, rgba(5, 11, 31, 0) 40%, var(--bg) 100%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 940px;
  margin: 0 auto;
}

h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 4.8vw, 52px);
  line-height: 1.12;
  margin: 0 0 12px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6);
}

.grad {
  background: linear-gradient(90deg, #35e0ff, #2f8bff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-sub {
  margin: 0 auto 26px;
  max-width: 700px;
  font-size: clamp(14px, 2vw, 17px);
  line-height: 1.5;
  color: #d3e6ff;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7);
}

.total-box {
  max-width: 470px;
  margin: 0 auto;
  padding: 12px 18px 6px;
  border: 1.5px solid rgba(39, 211, 255, 0.75);
  border-radius: 18px;
  background: rgba(3, 10, 32, 0.8);
  box-shadow: 0 0 30px rgba(39, 211, 255, 0.35), inset 0 0 24px rgba(39, 211, 255, 0.1);
}

.total-label {
  margin: 0 0 2px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(14px, 2.2vw, 18px);
  font-weight: 500;
}

.count-number {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: clamp(26px, 7.4vw, 66px);
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: #eaffff;
  text-shadow: 0 0 10px rgba(39, 211, 255, 0.95), 0 0 28px rgba(39, 211, 255, 0.6);
  white-space: nowrap;
}

/* ---------- click button ---------- */
.counter-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 22px 0 18px;
}

.counter-wrap {
  position: relative;
  display: inline-block;
  padding: 18px;
}

.mute-btn {
  position: absolute;
  right: -6px;
  bottom: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(39, 211, 255, 0.4);
  background: rgba(3, 10, 32, 0.8);
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.mute-btn:hover { color: var(--text); }

.counter-button {
  position: relative;
  width: clamp(120px, 34vw, 158px);
  height: clamp(120px, 34vw, 158px);
  border-radius: 50%;
  border: 3px solid #36d9ff;
  background:
    radial-gradient(circle at 50% 32%, rgba(120, 200, 255, 0.55), transparent 55%),
    radial-gradient(circle at 50% 50%, #1f6cff, #0a2a9a 70%, #061a63);
  box-shadow:
    0 0 0 7px rgba(39, 211, 255, 0.12),
    0 0 38px rgba(39, 211, 255, 0.75),
    inset 0 0 26px rgba(150, 230, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  padding: 0;
  overflow: visible;
  transition: transform 0.08s ease;
}

.counter-button::before,
.counter-button::after {
  content: "";
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  border: 1.5px solid rgba(39, 211, 255, 0.55);
  pointer-events: none;
  animation: ringPulse 2.8s ease-out infinite;
}

.counter-button::after { animation-delay: 1.4s; }

@keyframes ringPulse {
  0% { transform: scale(0.92); opacity: 0.8; }
  100% { transform: scale(1.32); opacity: 0; }
}

.counter-button:active { transform: scale(0.96); }

.counter-button:disabled {
  cursor: default;
  opacity: 0.92;
}

.click-label {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(24px, 6.5vw, 34px);
  letter-spacing: 0.04em;
  text-shadow: 0 0 12px rgba(150, 230, 255, 0.9);
  pointer-events: none;
}

.counter-button.pulse { animation: pulse 0.32s ease; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(39, 211, 255, 0.7), 0 0 38px rgba(39, 211, 255, 0.75), inset 0 0 26px rgba(150, 230, 255, 0.4); }
  100% { box-shadow: 0 0 0 30px rgba(39, 211, 255, 0), 0 0 38px rgba(39, 211, 255, 0.75), inset 0 0 26px rgba(150, 230, 255, 0.4); }
}

.counter-button.golden-pulse { animation: goldenPulse 0.6s ease; }

@keyframes goldenPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.8); }
  60% { box-shadow: 0 0 0 36px rgba(255, 215, 0, 0); }
  100% { box-shadow: 0 0 0 36px rgba(255, 215, 0, 0); }
}

.golden-stat {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  margin: 0;
}

/* ---------- stat pills ---------- */
.pills {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 0;
}

.pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 30px;
  text-align: left;
}

.pill + .pill { border-left: 1px solid rgba(39, 211, 255, 0.35); }

.pill-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1.5px solid rgba(39, 211, 255, 0.8);
  color: var(--cyan);
  box-shadow: 0 0 14px rgba(39, 211, 255, 0.4), inset 0 0 10px rgba(39, 211, 255, 0.15);
  background: rgba(3, 10, 32, 0.6);
}

.pill-text { display: flex; flex-direction: column; line-height: 1.2; }
.pill-text strong { font-family: 'Space Grotesk', sans-serif; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pill-text span { font-size: 14px; color: #cfe3ff; }
.pill-text small { font-size: 11px; opacity: 0.75; }

/* ---------- layout + cards ---------- */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  border: 1.5px solid var(--panel-line);
  border-radius: 16px;
  padding: 18px 22px;
  background: linear-gradient(180deg, rgba(9, 24, 62, 0.88), rgba(4, 12, 36, 0.92));
  box-shadow: 0 0 22px rgba(39, 211, 255, 0.16), inset 0 0 22px rgba(39, 211, 255, 0.05);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.card-head h2, .promo h2 {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 21px;
  font-weight: 700;
}

.card-head p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-dim);
}

.card-ico { color: var(--cyan); display: inline-flex; flex: none; filter: drop-shadow(0 0 6px rgba(39, 211, 255, 0.6)); }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* milestone */
.ms-body {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
}

.gauge {
  height: 16px;
  border-radius: 999px;
  border: 1.5px solid rgba(39, 211, 255, 0.7);
  background: rgba(3, 10, 32, 0.8);
  overflow: hidden;
}

.gauge-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #12b8ff, #37e6ff);
  box-shadow: 0 0 14px rgba(39, 211, 255, 0.9);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.ms-labels {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

#milestoneNote { font-weight: 600; text-align: center; }

.ms-pct {
  min-width: 96px;
  text-align: center;
  padding: 10px 18px;
  border: 2px solid var(--cyan);
  border-radius: 12px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 16px rgba(39, 211, 255, 0.45), inset 0 0 12px rgba(39, 211, 255, 0.12);
}

/* top countries */
.tc-list, .live-list { list-style: none; margin: 0; padding: 0; }

/* Space reserved before live data arrives, so the cards don't grow and push
   the page down. Top Countries always ends up with at least one row; Live
   Clicks settles at six. */
.tc-list { min-height: 41px; }
.live-list { min-height: 250px; }

.tc-row {
  display: grid;
  grid-template-columns: 22px 30px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 15px;
}

.tc-rank { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.tc-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-count { font-variant-numeric: tabular-nums; font-weight: 600; }
.tc-empty { color: var(--text-dim); font-size: 14px; padding: 12px 2px; }

.flag {
  width: 28px;
  height: 21px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
  display: block;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.link-cyan { color: var(--cyan); text-decoration: none; font-size: 14px; font-weight: 500; }
.link-cyan:hover { text-decoration: underline; }

.share-btn {
  background: transparent;
  border: 1px solid rgba(39, 211, 255, 0.5);
  color: var(--cyan);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  margin-left: auto;
}

.share-btn:hover { background: rgba(39, 211, 255, 0.1); }

/* live clicks */
.live-row {
  display: grid;
  grid-template-columns: 8px 28px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
}

.live-row.enter { animation: liveIn 0.45s ease-out; }

@keyframes liveIn {
  0% { opacity: 0; transform: translateY(-10px); background: rgba(39, 211, 255, 0.18); }
  100% { opacity: 1; transform: none; background: transparent; }
}

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.live-text strong { font-weight: 700; }
.live-time { font-size: 12px; color: var(--text-dim); white-space: nowrap; }

/* how it works */
.steps {
  list-style: none;
  margin: 0;
  padding: 6px 0 4px;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 14px;
}

.step { display: flex; align-items: center; gap: 16px; }
.step h3 { margin: 0 0 4px; font-family: 'Space Grotesk', sans-serif; font-size: 18px; }
.step p { margin: 0; font-size: 14px; color: #cfe3ff; line-height: 1.4; }

.about-exp .ae-block { margin-bottom: 18px; }
.about-exp .ae-block:last-child { margin-bottom: 0; }
.about-exp h3 { margin: 0 0 6px; font-family: 'Space Grotesk', sans-serif; font-size: 18px; }
.about-exp p { margin: 0; font-size: 15px; color: #cfe3ff; line-height: 1.6; }

.step-ico {
  flex: none;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  color: var(--cyan);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 10, 32, 0.6);
  box-shadow: 0 0 20px rgba(39, 211, 255, 0.45), inset 0 0 16px rgba(39, 211, 255, 0.15);
}

.step-arrow {
  width: 56px;
  height: 0;
  border-top: 2px dotted rgba(39, 211, 255, 0.75);
  position: relative;
}

.step-arrow::after {
  content: "";
  position: absolute;
  right: -2px;
  top: -6px;
  border-left: 8px solid rgba(39, 211, 255, 0.85);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

/* ad slot: the section is only un-hidden by ad-slot.js when AD_SLOT is set */
.ad-section { min-height: 100px; text-align: center; }
.ad-label { margin: 0 0 6px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); }
.ad-section ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }

/* promo cards */
.promo {
  background:
    linear-gradient(90deg, rgba(4, 12, 36, 0.97) 42%, rgba(4, 12, 36, 0.45) 100%),
    url("assets/hero-960.webp") right center / cover no-repeat;
}

/* With the sponsor promo hidden (see sponsor-config.js) the remaining card takes the full row. */
.two-col.promos:has(> [hidden]) { grid-template-columns: 1fr; }

.promo-body { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.promo-title { display: flex; align-items: center; gap: 12px; }
.promo p { margin: 0; max-width: 320px; font-size: 14px; color: #cfe3ff; line-height: 1.45; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  padding: 10px 22px;
  border: 1.5px solid var(--cyan);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 0 14px rgba(39, 211, 255, 0.3), inset 0 0 10px rgba(39, 211, 255, 0.1);
  background: rgba(3, 10, 32, 0.5);
}

.btn-outline:hover { background: rgba(39, 211, 255, 0.14); }

/* ---------- sponsor slots (config-driven, see sponsor-config.js) ---------- */
.sponsor-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
}

.sponsor-slot .sponsor-tag {
  flex: none;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  opacity: 0.7;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 2px 5px;
}

.sponsor-slot .sponsor-logo { flex: none; width: 16px; height: 16px; border-radius: 4px; object-fit: contain; }
.sponsor-slot .sponsor-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sponsor-slot a.sponsor-link {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px dotted rgba(39, 211, 255, 0.5);
}

.sponsor-slot a.sponsor-link:hover { color: var(--cyan); }

.ms-partner-link { margin: 10px 0 0; font-size: 13px; text-align: right; }
.ms-partner-link a { color: var(--text-dim); text-decoration: none; }
.ms-partner-link a:hover { color: var(--cyan); }

.sponsor-slot--milestone { margin-top: 14px; padding-top: 12px; border-top: 1px dashed rgba(255, 255, 255, 0.12); }
.sponsor-slot--leaderboard { min-height: 26px; margin-bottom: 8px; padding-bottom: 10px; border-bottom: 1px dashed rgba(255, 255, 255, 0.12); }

/* ---------- click effects (JS-driven, kept from the previous design) ---------- */
.particle {
  position: absolute;
  pointer-events: none;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: #8beeff;
  text-shadow: 0 0 8px rgba(39, 211, 255, 0.8);
  animation: rise 0.75s ease-out forwards;
}

.particle.gold { color: #ffd700; font-size: 17px; text-shadow: 0 0 6px rgba(255, 215, 0, 0.7); }

@keyframes rise {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy, -70px)) scale(0.8); }
}

.combo-text {
  position: absolute;
  top: -6px;
  left: 50%;
  pointer-events: none;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: #ffd166;
  text-shadow: 0 0 8px rgba(255, 180, 60, 0.6);
  animation: comboRise 0.6s ease-out forwards;
  white-space: nowrap;
}

@keyframes comboRise {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.7); }
  25% { opacity: 1; transform: translate(-50%, -8px) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -46px) scale(1); }
}

.trail-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  pointer-events: none;
  animation: trailFade 0.5s ease-out forwards;
  transform: translate(-50%, -50%);
}

@keyframes trailFade {
  0% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.2); }
}

.confetti-piece {
  position: fixed;
  top: -12px;
  width: 8px;
  height: 14px;
  pointer-events: none;
  z-index: 500;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% { opacity: 1; transform: translate(0, 0) rotate(0deg); }
  100% { opacity: 0.9; transform: translate(var(--drift, 0px), 100vh) rotate(var(--spin, 360deg)); }
}

.milestone-banner {
  position: fixed;
  top: 84px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 501;
  background: rgba(4, 12, 36, 0.95);
  border: 1px solid rgba(39, 211, 255, 0.6);
  border-radius: 999px;
  padding: 12px 22px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  box-shadow: 0 0 24px rgba(39, 211, 255, 0.35);
  animation: bannerInOut 3s ease forwards;
  text-align: center;
  max-width: calc(100vw - 32px);
}

@keyframes bannerInOut {
  0% { opacity: 0; transform: translate(-50%, -12px); }
  12% { opacity: 1; transform: translate(-50%, 0); }
  85% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -12px); }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr; gap: 18px; }
  .step-arrow { display: none; }
}

@media (max-width: 820px) {
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .hero-bg { background-image: url("assets/hero-960.webp"), none; background-color: var(--bg); }
  .hero { padding-top: 28px; }
  .ms-body { grid-template-columns: 1fr; }
  .ms-pct { justify-self: start; }
  .card { padding: 16px; }
  .container { padding: 0 14px 8px; }
  .pill { padding: 2px 16px; }
  .pill-ico { width: 40px; height: 40px; }
  .pill-text strong { font-size: 20px; }
}

@media (max-width: 400px) {
  .pill { gap: 8px; padding: 2px 10px; }
  .step-ico { width: 64px; height: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  .counter-button::before,
  .counter-button::after,
  .counter-button.pulse,
  .counter-button.golden-pulse,
  .live-row.enter,
  .particle,
  .combo-text,
  .trail-dot,
  .confetti-piece,
  .milestone-banner {
    animation: none !important;
  }
}
