:root {
  --bg: #04070c;
  --panel: rgba(9, 13, 20, 0.9);
  --panel-2: rgba(11, 16, 24, 0.86);
  --accent: #8ad8ff;
  --accent-2: #ff9f7a;
  --accent-3: #74f1d2;
  --text: #eef5ff;
  --muted: #abb8c8;
  --border: rgba(255,255,255,0.08);
  --pill: rgba(255, 255, 255, 0.06);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.58);
  --hero-img: radial-gradient(640px at 70% 36%, rgba(138, 216, 255, 0.16), transparent 60%);
  --glow-1: rgba(138, 216, 255, 0.22);
  --glow-2: rgba(255, 159, 122, 0.18);
  --glow-3: rgba(116, 241, 210, 0.16);
  font-family: "Space Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

body.theme-deep-space {
  --bg: #04070c;
  --panel: rgba(9, 13, 20, 0.9);
  --panel-2: rgba(11, 16, 24, 0.86);
  --accent: #8ad8ff;
  --accent-2: #ff9f7a;
  --accent-3: #74f1d2;
  --text: #eef5ff;
  --muted: #abb8c8;
  --border: rgba(255,255,255,0.08);
  --pill: rgba(255, 255, 255, 0.06);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.58);
  --hero-img: radial-gradient(640px at 70% 36%, rgba(138, 216, 255, 0.16), transparent 60%);
  --glow-1: rgba(138, 216, 255, 0.22);
  --glow-2: rgba(255, 159, 122, 0.18);
  --glow-3: rgba(116, 241, 210, 0.16);
}

body.theme-sunset {
  --bg: #080310;
  --panel: rgba(18, 10, 30, 0.92);
  --panel-2: rgba(20, 12, 34, 0.86);
  --accent: #ff9b73;
  --accent-2: #ff6ac1;
  --accent-3: #ffd56a;
  --text: #fff3e9;
  --muted: #c9b0ff;
  --border: rgba(255,255,255,0.10);
  --pill: rgba(255, 255, 255, 0.10);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.65);
  --hero-img: radial-gradient(640px at 70% 36%, rgba(255, 154, 118, 0.20), transparent 60%);
  --glow-1: rgba(255, 122, 60, 0.30);
  --glow-2: rgba(255, 105, 180, 0.26);
  --glow-3: rgba(92, 224, 255, 0.18);
}

body.theme-r0icemas {
  --bg: #020816;
  --panel: rgba(8, 16, 30, 0.92);
  --panel-2: rgba(8, 20, 40, 0.88);
  --accent: #7de0ff;
  --accent-2: #ff6a75;
  --accent-3: #7cffc7;
  --text: #e7f6ff;
  --muted: #b8d3ff;
  --border: rgba(255,255,255,0.10);
  --pill: rgba(6, 32, 60, 0.75);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.60);
  --hero-img: radial-gradient(640px at 70% 36%, rgba(124, 255, 214, 0.20), transparent 60%);
  --glow-1: rgba(124, 255, 214, 0.30);
  --glow-2: rgba(92, 224, 255, 0.26);
  --glow-3: rgba(255, 122, 60, 0.18);
}

body.theme-after-hours {
  --bg: #06070a;
  --panel: rgba(16, 16, 19, 0.92);
  --panel-2: rgba(19, 20, 24, 0.88);
  --accent: #f3d7b6;
  --accent-2: #c46a48;
  --accent-3: #7dc9bc;
  --text: #f8f4ef;
  --muted: #b8afa5;
  --border: rgba(255,255,255,0.10);
  --pill: rgba(243, 215, 182, 0.08);
  --shadow: 0 24px 68px rgba(0, 0, 0, 0.66);
  --hero-img: radial-gradient(640px at 70% 36%, rgba(243, 215, 182, 0.14), transparent 60%);
  --glow-1: rgba(196, 106, 72, 0.22);
  --glow-2: rgba(125, 201, 188, 0.18);
  --glow-3: rgba(243, 215, 182, 0.12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background-color 200ms ease, color 200ms ease;
}
html { scroll-behavior: smooth; }

.bg-grad {
  position: fixed;
  inset: 0;
  background: radial-gradient(900px at 18% 16%, var(--glow-1), transparent),
              radial-gradient(780px at 78% 18%, var(--glow-2), transparent),
              radial-gradient(680px at 70% 64%, var(--glow-3), transparent);
  filter: blur(34px);
  pointer-events: none;
  z-index: 0;
}
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,0.3), transparent 60%),
    radial-gradient(1.5px 1.5px at 70% 20%, rgba(124,255,178,0.45), transparent 60%),
    radial-gradient(1.8px 1.8px at 80% 70%, rgba(92,224,255,0.4), transparent 60%),
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 120px 120px, 120px 120px;
  opacity: 0.4;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.92), transparent 68%);
  pointer-events: none;
  z-index: 0;
}
.bg-stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1.2px 1.2px at 10% 15%, rgba(255,255,255,0.8), transparent 55%),
    radial-gradient(1.4px 1.4px at 32% 68%, rgba(124,255,178,0.8), transparent 55%),
    radial-gradient(1.1px 1.1px at 72% 24%, rgba(92,224,255,0.8), transparent 55%),
    radial-gradient(1.5px 1.5px at 84% 72%, rgba(255,255,255,0.75), transparent 55%),
    radial-gradient(1.3px 1.3px at 58% 48%, rgba(124,255,178,0.7), transparent 55%),
    radial-gradient(1px 1px at 44% 82%, rgba(255,255,255,0.7), transparent 55%);
  animation: twinkle 6s ease-in-out infinite alternate;
  opacity: 1;
}
.bg-stars::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.1px 1.1px at 26% 42%, rgba(255,255,255,0.6), transparent 55%),
    radial-gradient(1.4px 1.4px at 66% 14%, rgba(92,224,255,0.7), transparent 55%),
    radial-gradient(1.2px 1.2px at 18% 78%, rgba(124,255,178,0.7), transparent 55%),
    radial-gradient(1px 1px at 90% 38%, rgba(255,255,255,0.6), transparent 55%);
  opacity: 0.82;
  animation: twinkle 8s ease-in-out infinite alternate-reverse;
}
.bg-stars::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(520px at 68% 32%, rgba(124, 255, 178, 0.18), transparent 65%),
    radial-gradient(420px at 26% 64%, rgba(158, 124, 255, 0.18), transparent 60%),
    radial-gradient(360px at 52% 70%, rgba(92, 224, 255, 0.12), transparent 62%);
  filter: blur(8px);
  opacity: 0.9;
}

.bg-nebula {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px at 60% 40%, var(--glow-1), transparent 70%),
    radial-gradient(900px at 30% 70%, var(--glow-2), transparent 70%);
  opacity: 0.25;
  pointer-events: none;
  animation: nebulaMove 32s ease-in-out infinite alternate;
  z-index: 0;
}

.bg-hero-anim {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(1200px at 40% 30%, var(--glow-1), transparent 70%),
              radial-gradient(1000px at 72% 60%, var(--glow-2), transparent 70%);
  mix-blend-mode: screen;
  opacity: 0.32;
  animation: gradientSweep 22s ease-in-out infinite alternate;
  z-index: 0;
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 60%, rgba(0,0,0,0.35));
  z-index: 3;
}

.shell { width: min(1260px, 90vw); margin: 0 auto; position: relative; z-index: 1; }

@media (min-width: 1600px) {
  .shell { width: min(1400px, 84vw); }
}

.nav {
  position: sticky;
  top: 0;
  z-index: 5;
  width: min(1260px, 90vw);
  margin: 0 auto;
  padding: 18px 0;
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(180deg, rgba(8,12,18,0.94), rgba(8,12,18,0.72));
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 36px rgba(0,0,0,0.28);
  transition: background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease, color 200ms ease;
}
.brand { font-weight: 700; letter-spacing: 0.6px; font-size: 18px; }
.nav nav { display: flex; gap: 14px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
.nav a:hover { color: var(--text); }
.live-pill { background: rgba(116, 241, 210, 0.1); border-color: rgba(255,255,255,0.08); color: var(--text); box-shadow: 0 0 0 6px rgba(116,241,210,0.06); }
.live-pill {
  position: relative;
  box-shadow:
    0 0 0 6px rgba(116,241,210,0.06),
    0 0 18px rgba(116,241,210,0.26);
  animation: liveGlow 2.6s ease-in-out infinite;
}
.live-pill .live-label { margin-right: 4px; }

.live-strip {
  position: sticky;
  top: 72px;
  z-index: 4;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  width: min(1260px, 90vw);
  margin: 0 auto 8px auto;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(138,216,255,0.12), rgba(255,159,122,0.1));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 12px 36px rgba(0,0,0,0.32);
}
.live-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: #ff5f6d;
  box-shadow: 0 0 0 6px rgba(255,95,109,0.22), 0 0 18px rgba(255,95,109,0.6);
  animation: liveGlow 1.8s ease-in-out infinite;
}
.live-strip .strip-link {
  color: #03161c;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 14px 30px rgba(138,216,255,0.24);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.live-strip .strip-link:hover { transform: translateY(-2px) scale(1.02); }

.highlight { margin-top: 30px; }

.planet-teaser {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  align-items: center;
}

.teaser-frame {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: linear-gradient(145deg, var(--panel-2), var(--panel));
  min-height: 260px;
}

.teaser-placeholder {
  min-height: 280px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px 16px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.35;
  letter-spacing: 0.01em;
  background: linear-gradient(180deg, rgba(8, 14, 24, 0.88), rgba(8, 14, 24, 0.5));
}

.teaser-placeholder.is-hidden {
  display: none;
}

.teaser-frame iframe {
  width: 100%;
  height: 100%;
  min-height: 280px;
  border: 0;
  display: block;
}

.teaser-notes {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
  color: var(--muted);
}

.teaser-notes li {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 38px;
  padding: 120px 0 80px 0;
  align-items: center;
  position: relative;
  min-height: 78vh;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-img);
  background-size: cover;
  background-position: center;
  opacity: 0.14;
  filter: saturate(1.1);
  z-index: -2;
}
.hero::after {
  content: "";
  position: absolute;
  inset: -40px;
  background: radial-gradient(540px at 82% 34%, rgba(124, 255, 178, 0.2), transparent),
              radial-gradient(420px at 76% 62%, rgba(92, 224, 255, 0.14), transparent);
  opacity: 0.65;
  z-index: -1;
}
.hero-copy h1 { margin: 12px 0; font-size: clamp(42px, 6vw, 60px); line-height: 1.08; font-weight: 700; }
.hero-copy .lede { color: var(--muted); margin: 0 0 20px 0; font-size: 16px; line-height: 1.6; max-width: 54ch; }
.eyebrow { text-transform: uppercase; letter-spacing: 2.6px; color: var(--accent); font-weight: 700; font-size: 13px; margin: 0; }
.tag-rotator { color: var(--accent-2); font-weight: 700; }

.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
  cursor: pointer;
}
.btn.solid { background: linear-gradient(135deg, var(--accent), #4deaa0); color: #03161c; box-shadow: var(--shadow); }
.btn.ghost { background: rgba(255,255,255,0.04); color: var(--text); border-color: rgba(255,255,255,0.1); }
.btn:hover { transform: translateY(-2px) scale(1.03); }
.btn:active { transform: translateY(0); }
.btn.ghost:hover { border-color: rgba(255,255,255,0.25); }
.btn.solid:hover { box-shadow: 0 20px 40px rgba(124, 255, 178, 0.35); }

.btn:focus-visible,
.theme-dot:focus-visible,
.copy-url-btn:focus-visible,
.nav a:focus-visible,
.mobile-bottom-nav a:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.theme-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
}
.theme-dot {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 120ms ease;
}
.theme-dot .dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4);
}
.theme-dot--deep .dot { background: radial-gradient(circle at 30% 20%, #7de0ff, #05060b 70%); }
.theme-dot--sunset .dot { background: radial-gradient(circle at 30% 20%, #ff9b73, #080310 70%); }
.theme-dot--r0icemas .dot { background: radial-gradient(circle at 30% 20%, #7de0ff, #ff6a75 80%); }
.theme-dot--after-hours .dot { background: radial-gradient(circle at 30% 20%, #f3d7b6, #0a0908 78%); }
.theme-dot.is-active {
  border-color: var(--accent);
  background: rgba(255,255,255,0.10);
  color: var(--text);
  transform: translateY(-1px);
}
.theme-dot:active { transform: translateY(0); }

.hero-card, .card, .nav, .feature, .mobile-bottom-nav {
  transition: background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease, color 200ms ease, transform 140ms ease;
}

.referral-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  opacity: 0.9;
}

.referral-tools {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  display: grid;
  gap: 6px;
  max-width: 420px;
}

.referral-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#ref-tag-input {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.35);
  color: var(--text);
  font-size: 12px;
}

#ref-tag-input::placeholder { color: var(--muted); }

.referral-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.referral-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.referral-link-label {
  font-weight: 600;
  color: var(--muted);
}

#ref-link-display {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
}

.referral-count {
  font-size: 11px;
  color: var(--accent-3);
}

.referral-tools {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  display: grid;
  gap: 6px;
  max-width: 420px;
}

.referral-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#ref-tag-input {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.35);
  color: var(--text);
  font-size: 12px;
}

#ref-tag-input::placeholder { color: var(--muted); }

.referral-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.referral-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.referral-link-label {
  font-weight: 600;
  color: var(--muted);
}

#ref-link-display {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
}

.referral-count {
  font-size: 11px;
  color: var(--accent-3);
}

.copy-url-btn {
  margin-left: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 120ms ease;
}
.copy-url-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.28);
  color: var(--text);
  transform: translateY(-1px);
}
.copy-url-btn:active { transform: translateY(0); }
.copy-url-status {
  margin-left: 6px;
  font-size: 11px;
  color: var(--accent-3);
  opacity: 0;
  transition: opacity 140ms ease;
}
.copy-url-status.is-visible { opacity: 1; }

.hero-card {
  background: linear-gradient(145deg, rgba(9,13,21,0.78), rgba(8,12,19,0.72));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  animation: floatCard 10s ease-in-out infinite alternate;
  backdrop-filter: blur(14px);
  transition: background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease, color 200ms ease;
}
.hero-card::before {
  content: "";
  position: absolute;
  inset: -20px;
  background: radial-gradient(400px at 50% 50%, rgba(138,216,255,0.14), transparent 70%);
  z-index: -1;
  filter: blur(40px);
}
.pill {
  display: inline-flex;
  padding: 6px 10px;
  background: var(--pill);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 999px;
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0.3px;
  gap: 6px;
}
.pill.tiny { padding: 4px 8px; font-size: 11px; }

.hero-metric { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.metric-label { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.metric-value { font-size: 28px; font-weight: 700; letter-spacing: 0.5px; }

.spark {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.spark-value { font-weight: 700; color: var(--accent); }
.tiny { font-size: 12px; color: var(--muted); }
.milestone-line {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  color: var(--text);
}
.milestone-text { font-size: 13px; }
.hero-links { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-links a { color: var(--accent); font-weight: 600; text-decoration: none; font-size: 14px; }
.hero-links a:hover { text-decoration: underline; }
.sticker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(116,241,210,0.92), rgba(255,159,122,0.84));
  color: #0b0b0b;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-size: 12px;
  box-shadow: 0 12px 30px rgba(138, 216, 255, 0.2);
}

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 16px; }
.feature {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(13,18,32,0.9), rgba(9,12,22,0.92));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease, color 200ms ease, transform 140ms ease;
}
.feature-icon { width: 44px; height: 44px; border-radius: 14px; background: rgba(255,255,255,0.06); display: grid; place-items: center; font-size: 22px; }

.section { padding: 48px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.section h2 { margin: 6px 0 10px 0; font-size: 26px; }
.muted { color: var(--muted); }
.muted.small { font-size: 13px; }
.code, code { background: rgba(255,255,255,0.06); border-radius: 6px; padding: 2px 6px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 16px; }
.cards.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card {
  background: linear-gradient(145deg, rgba(14,18,30,0.92), rgba(8,12,20,0.85));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 20px;
  backdrop-filter: blur(10px);
  transition: transform 140ms ease, box-shadow 140ms ease, background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 48px rgba(0,0,0,0.45);
}
.card h3 { margin: 6px 0 8px 0; }
.card-label { color: var(--muted); margin: 0 0 6px 0; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.card-value { margin: 0; font-size: 28px; font-weight: 700; }
.card.stat { display: flex; flex-direction: column; gap: 4px; }

.cards.three { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.card.stat .card-label { letter-spacing: 0.4px; font-size: 13px; color: var(--muted); }
.card.stat .card-value { font-size: clamp(26px, 5vw, 36px); font-weight: 700; margin: 2px 0 6px; }

.live-list {
  margin-top: 22px;
  background: rgba(12,20,38,0.92);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.live-rows { list-style: none; margin: 10px 0 0 0; padding: 0; display: grid; gap: 8px; }
.live-rows li { padding: 12px; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06); border-radius: 12px; }
.live-rows .title { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.live-rows .meta { color: var(--muted); font-size: 12px; }
.live-rows strong { color: var(--text); }

.footer { border-top: 1px solid rgba(255,255,255,0.06); padding: 24px 0 40px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--text); }

.tags { display: flex; gap: 8px; flex-wrap: wrap; }

.timeline .section-head { margin-bottom: 4px; }
.steps { list-style: none; margin: 18px 0 0 0; padding: 0; display: grid; gap: 14px; }
.steps li { display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: start; padding: 12px 14px; background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: 12px; }
.step-dot { width: 18px; height: 18px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #ff6a75); box-shadow: 0 0 0 6px rgba(255,255,255,0.04); margin-top: 2px; }
.steps h4 { margin: 0 0 4px 0; }
.steps p { margin: 0; }

.globe-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.08), transparent 45%),
    radial-gradient(circle at 70% 60%, rgba(255,122,60,0.16), transparent 50%),
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 12px 12px, 12px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 10px;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
[data-animate] { animation: fadeUp 0.7s ease var(--delay, 0ms) both; }

@keyframes twinkle {
  from { opacity: 0.4; transform: scale(1); }
  to { opacity: 0.9; transform: scale(1.03); }
}

@keyframes floatCard {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

@keyframes nebulaMove {
  from { transform: translateY(0px) scale(1); }
  to { transform: translateY(18px) scale(1.03); }
}

@keyframes gradientSweep {
  from { transform: translateY(0); filter: hue-rotate(0deg); }
  to { transform: translateY(-10px); filter: hue-rotate(12deg); }
}

@keyframes liveGlow {
  0% { box-shadow: 0 0 0 6px rgba(124,255,178,0.08), 0 0 18px rgba(124,255,178,0.38); }
  50% { box-shadow: 0 0 0 6px rgba(124,255,178,0.14), 0 0 26px rgba(124,255,178,0.5); }
  100% { box-shadow: 0 0 0 6px rgba(124,255,178,0.08), 0 0 18px rgba(124,255,178,0.38); }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding: 64px 0 36px 0; }
  .nav { position: sticky; top: 0; }
  .nav nav { display: none; }
  .theme-switch { margin-left: 4px; gap: 4px; }
  .theme-dot .label { display: none; }
  .mobile-bottom-nav { display: flex; }
  main { padding-bottom: 86px; }
  .planet-teaser { grid-template-columns: 1fr; }
  .teaser-frame iframe { min-height: 240px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-card { animation: none; }
  .bg-stars { animation: none; }
  .bg-stars::after { animation: none; }
  .bg-nebula { animation: none; }
  .bg-hero-anim { animation: none; }
  .live-pill { animation: none; }
}

/* Mobile bottom nav */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 8;
  display: none;
  align-items: center;
  justify-content: space-around;
  gap: 4px;
  padding: 10px 12px;
  background: rgba(7, 9, 15, 0.82);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,0.06);
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}
.mobile-bottom-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  transition: color 120ms ease, background 120ms ease, transform 120ms ease;
}
.mobile-bottom-nav a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
  transform: translateY(-2px);
}
.mobile-bottom-nav .icon {
  font-size: 16px;
}

.civ-theme-switch,
.advent-theme-switch {
  margin-top: 8px;
}

/* Bot status pill */
.bot-status-wrap {
  display: flex;
  align-items: center;
  padding: 8px 0 0 0;
  gap: 10px;
}

.bot-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.35);
  font-size: 0.8rem;
  line-height: 1.2;
  backdrop-filter: blur(14px);
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

.bot-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4);
}

.bot-status-pill.is-online .bot-status-dot { background: #4ade80; }
.bot-status-pill.is-offline .bot-status-dot { background: #f97373; }
.bot-status-pill.is-unknown .bot-status-dot { background: var(--muted); }

.bot-status-label { white-space: nowrap; }

/* GameBot hero stats */
.bot-hero-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bot-hero-card .bot-status-pill {
  margin-top: 4px;
}

.bot-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.bot-stat dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.75;
  margin: 0 0 2px 0;
}

.bot-stat dd {
  margin: 0;
  font-weight: 500;
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .bot-stats {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* GameBot dashboard */
.bot-dashboard {
  padding-top: 24px;
}

.bot-summary-card {
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(18px);
  display: grid;
  gap: 10px;
}

.bot-summary-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.bot-summary-metric dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.75;
  margin: 0 0 2px 0;
}

.bot-summary-metric dd {
  margin: 0;
  font-weight: 500;
}

.leaderboard {
  margin-top: 24px;
}

.leaderboard-head,
.leaderboard-row {
  display: grid;
  grid-template-columns: 0.6fr 2fr 1fr 1fr 1fr;
  gap: 8px;
  align-items: center;
}

.leaderboard-head {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.75;
  padding: 6px 4px;
}

.leaderboard-row {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(14px);
  font-size: 0.9rem;
}

.leaderboard-empty {
  margin-top: 12px;
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Status / updated text */
.status-updated {
  font-size: 11px;
  color: var(--muted);
  opacity: 0.9;
  display: inline-block;
}

.status-updated:empty {
  display: none;
}

@media (max-width: 720px) {
  .leaderboard-head,
  .leaderboard-row {
    grid-template-columns: 0.7fr 2.3fr 1fr;
  }

  .leaderboard-head span:nth-child(4),
  .leaderboard-head span:nth-child(5),
  .leaderboard-row span:nth-child(4),
  .leaderboard-row span:nth-child(5) {
    display: none;
  }
}

/* Helper sections: start here / join flow / referral hint */
.bot-start-card,
.civ-join-card,
.advent-join-card {
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(18px);
  padding: 16px 18px;
}

.bot-start-list,
.civ-join-list,
.advent-join-list {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bot-ref-hint {
  margin-top: 6px;
}

@media (max-width: 640px) {
  .bot-start-card,
  .civ-join-card,
  .advent-join-card {
    padding: 14px 14px;
  }
}

/* Bot status pulse (online) */
@media (prefers-reduced-motion: no-preference) {
  .bot-status-pill.is-online {
    animation: bot-status-pulse 2.4s ease-in-out infinite;
  }

  @keyframes bot-status-pulse {
    0%, 100% {
      transform: translateZ(0) scale(1);
      box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.06);
    }
    50% {
      transform: translateZ(0) scale(1.03);
      box-shadow: 0 0 24px 0 rgba(255, 255, 255, 0.12);
    }
  }
}

/* Leaderboard scroll helper */
.leaderboard-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

/* Planet control bar */
.planet-ui {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(620px, 94vw);
  z-index: 6;
  pointer-events: none;
}

.planet-controls {
  pointer-events: auto;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(7, 9, 15, 0.78);
  backdrop-filter: blur(14px);
  padding: 12px 14px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.55);
  display: grid;
  gap: 10px;
  transition: border-color 200ms ease, background-color 200ms ease, box-shadow 240ms ease;
}

.planet-controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.planet-control-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 9px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.planet-control-btn .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.45);
}

.planet-control-btn:hover {
  border-color: rgba(255,255,255,0.16);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.planet-control-btn.is-active {
  border-color: rgba(124, 224, 255, 0.8);
  background: rgba(124, 224, 255, 0.12);
  color: #eaf9ff;
}

.planet-control-btn.is-active .dot {
  background: #7de0ff;
}

.planet-control-btn:focus-visible {
  outline: 2px solid rgba(124, 224, 255, 0.6);
  outline-offset: 2px;
}

.planet-control-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.planet-gravity-badge {
  margin-left: auto;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(15, 20, 32, 0.82);
  font-size: 0.78rem;
  color: var(--muted, #cfd5ff);
  white-space: nowrap;
}

.planet-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.45);
  flex: 0 0 auto;
}

.planet-controls.is-online .planet-status-dot { background: #4ade80; }
.planet-controls.is-offline .planet-status-dot { background: #f97373; }
.planet-controls.is-unknown .planet-status-dot { background: var(--muted); }
.planet-controls.is-online .planet-control-status { color: #d9ffe9; }
.planet-controls.is-online .planet-gravity-badge { border-color: rgba(124, 224, 255, 0.4); }

.planet-control-status .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 0.82rem;
}

@media (prefers-reduced-motion: no-preference) {
  .planet-controls.is-alive {
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.55), 0 0 0 0 rgba(124, 224, 255, 0.14);
    animation: planet-alive 3.2s ease-in-out infinite;
  }

  @keyframes planet-alive {
    0%, 100% {
      box-shadow: 0 20px 48px rgba(0, 0, 0, 0.55), 0 0 0 0 rgba(124, 224, 255, 0.10);
      transform: translateY(0);
    }
    50% {
      box-shadow: 0 24px 54px rgba(0, 0, 0, 0.6), 0 0 36px 0 rgba(124, 224, 255, 0.22);
      transform: translateY(-1px);
    }
  }
}

.planet-controls.is-perf {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.planet-controls.is-perf .planet-control-status {
  color: var(--muted);
}

.planet-controls.has-plates {
  border-color: rgba(252, 211, 77, 0.35);
}

.planet-home-card {
  position: fixed;
  left: 16px;
  bottom: 16px;
  max-width: 260px;
  z-index: 6;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(7, 9, 15, 0.86);
  backdrop-filter: blur(14px);
  color: var(--text);
  font-size: 0.85rem;
  box-shadow: 0 18px 46px rgba(0,0,0,0.55);
}

.planet-home-card[hidden] { display: none; }

.planet-home-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  gap: 8px;
}

.planet-home-type {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: capitalize;
  border: 1px solid rgba(255,255,255,0.18);
}

.planet-home-user {
  font-weight: 600;
  opacity: 0.9;
}

.planet-home-region {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.planet-home-stats .stat-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.planet-home-stats .stat-row span {
  flex: 0 0 52px;
  font-size: 0.78rem;
  color: var(--muted);
}

.planet-home-stats .bar {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}

.planet-home-stats .bar .fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7de0ff, #7bffb0);
  width: 0%;
}

.planet-home-footer {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: 8px;
}

.planet-home-nav {
  flex: 1;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: #eaf2ff;
  font-size: 0.78rem;
  padding: 5px 0;
  cursor: pointer;
}

.planet-debug-eco {
  position: fixed;
  left: 16px;
  top: 16px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  z-index: 8;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(10,12,18,0.86);
  backdrop-filter: blur(10px);
}
.planet-debug-eco[hidden] { display: none; }
.planet-debug-eco button {
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: #eaf2ff;
  font-size: 0.8rem;
  padding: 6px 10px;
  cursor: pointer;
}
.planet-debug-eco button:hover {
  background: rgba(255,255,255,0.1);
}

.planet-home-nav:hover {
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.07);
}

.planet-activity-line {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
  opacity: 0.9;
}

.planet-region-card {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: 220px;
  z-index: 6;
  padding: 10px 11px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(7,9,15,0.86);
  backdrop-filter: blur(14px);
  font-size: 0.8rem;
  color: var(--text);
  box-shadow: 0 18px 46px rgba(0,0,0,0.55);
}
.planet-region-card[hidden] { display:none; }
.planet-region-card .title { font-weight: 600; margin-bottom: 4px; }
.planet-region-card .subtitle { color: var(--muted); margin-bottom: 6px; }
.planet-region-card .stat-row {
  display:flex;
  align-items:center;
  gap:6px;
  font-size:0.78rem;
  margin-bottom:3px;
}
.planet-region-card .stat-row span {
  flex:0 0 62px;
  color: var(--muted);
}
.planet-region-card .bar {
  flex:1;
  height:4px;
  border-radius:999px;
  background:rgba(255,255,255,0.06);
  overflow:hidden;
}
.planet-region-card .bar .fill {
  height:100%;
  width:0%;
  border-radius:inherit;
  background:linear-gradient(90deg,#7de0ff,#7bffb0);
}

@media (max-width: 640px) {
  .planet-ui {
    bottom: 12px;
    width: min(540px, 96vw);
  }

  .planet-controls {
    padding: 10px 12px;
  }

  .planet-control-btn {
    flex: 1 1 44%;
    justify-content: center;
  }

  .planet-control-status {
    flex-wrap: wrap;
  }

  .planet-gravity-badge {
    margin-left: 0;
    margin-top: 4px;
    display: inline-flex;
  }

  .planet-home-card {
    left: 8px;
    bottom: 8px;
    max-width: 220px;
    padding: 10px 11px;
  }

  .planet-region-card {
    right: 8px;
    bottom: 8px;
    max-width: 200px;
  }
}

/* Planet house menu */
.planet-house-menu {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
}

.planet-house-btn {
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(12, 16, 24, 0.6);
  border: 1px solid rgba(255,255,255,0.1);
  color: #e8f0ff;
  backdrop-filter: blur(8px);
  cursor: pointer;
  font-weight: 600;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.planet-house-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.16);
  transform: translateY(-1px);
}

.planet-house-dropdown {
  display: none;
  position: absolute;
  top: 38px;
  right: 0;
  background: rgba(12, 16, 24, 0.72);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  padding: 6px;
  border: 1px solid rgba(255,255,255,0.08);
  min-width: 140px;
  box-shadow: 0 14px 32px rgba(0,0,0,0.45);
}

.planet-house-dropdown button {
  display: block;
  padding: 7px 10px;
  color: #e8f0ff;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  width: 100%;
  border-radius: 8px;
  transition: background-color 120ms ease;
}

.planet-house-dropdown button:hover {
  background: rgba(255,255,255,0.08);
}

/* Perf mode: mute heavy background animations */
body.perf-mode .bg-stars,
body.perf-mode .bg-stars::after,
body.perf-mode .bg-stars::before,
body.perf-mode .bg-nebula,
body.perf-mode .bg-hero-anim,
body.perf-mode [data-animate] {
  animation: none;
}

body.perf-mode .bg-stars { opacity: 0.55; }
body.perf-mode .bg-nebula,
body.perf-mode .bg-hero-anim { opacity: 0.25; }

body.perf-mode .planet-controls.is-alive {
  animation: none;
}

/* Live stream banner */
#live-banner {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: linear-gradient(90deg, rgba(220,38,38,.9), rgba(185,28,28,.9));
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .03em;
  text-align: center;
  padding: 8px 48px 8px 16px;
  box-shadow: 0 2px 16px rgba(220,38,38,.4);
  animation: bannerSlideIn .35s ease;
}
#live-banner.is-live { display: block; }
#live-banner a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
#live-banner-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,.7);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
#live-banner-close:hover { color: #fff; }
body.banner-open { padding-top: 36px; }
@keyframes bannerSlideIn {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
