/* ── Reset & Variables ──────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0a0a0f;
  --bg2:       #0f0f18;
  --surface:   #14141f;
  --border:    rgba(255,107,53,.15);
  --accent:    #ff6b35;
  --accent2:   #ffaa00;
  --text:      #e8e8f0;
  --muted:     #6b6b85;
  --font:      'Segoe UI', system-ui, sans-serif;
  --mono:      'Courier New', monospace;
  --radius:    8px;
  --radius-lg: 16px;
}

html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.6; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ── Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1.4rem; border-radius: var(--radius);
  font-weight: 600; font-size: .9rem; letter-spacing: .04em;
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--accent); color: #000;
  box-shadow: 0 0 20px rgba(255,107,53,.4);
}
.btn-primary:hover { box-shadow: 0 0 32px rgba(255,107,53,.7); filter: brightness(1.1); }
.btn-ghost {
  border: 1px solid rgba(255,107,53,.4); color: var(--accent);
}
.btn-ghost:hover { border-color: var(--accent); background: rgba(255,107,53,.08); }
.btn-lg { padding: .8rem 2rem; font-size: 1rem; }
.btn-xl { padding: 1rem 2.8rem; font-size: 1.1rem; }

/* ── Nav ────────────────────────────────────────────── */
#nav {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background .3s, border-color .3s;
}
#nav.scrolled {
  background: rgba(10,10,15,.92);
  backdrop-filter: blur(16px);
  border-color: var(--border);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 1.2rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-size: 1.3rem; font-weight: 900; letter-spacing: .12em;
  color: var(--accent); font-family: var(--mono);
}
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-link { color: var(--muted); font-size: .9rem; transition: color .2s; }
.nav-link:hover { color: var(--text); }

/* ── Hero ────────────────────────────────────────────── */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding-top: 80px;
}

/* city silhouette bg */
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 100%, rgba(255,107,53,.08) 0%, transparent 70%);
}
.city-silhouette {
  position: absolute; bottom: 0; left: 0; width: 100%;
  display: flex; align-items: flex-end; justify-content: center;
  gap: 8px; padding: 0 4vw;
}
.cs-bld {
  background: linear-gradient(to top, #1a0e08, #0d0710);
  border-radius: 4px 4px 0 0;
  position: relative;
  flex-shrink: 0;
}
.cs-bld::before { /* windows */
  content: '';
  position: absolute; inset: 8px 6px; bottom: 0;
  background-image:
    repeating-linear-gradient(transparent 0, transparent 6px, rgba(255,170,0,.12) 6px, rgba(255,170,0,.12) 7px),
    repeating-linear-gradient(90deg, transparent 0, transparent 8px, rgba(255,170,0,.12) 8px, rgba(255,170,0,.12) 9px);
}
.cs-b1 { width: 60px;  height: 180px; }
.cs-b2 { width: 90px;  height: 280px; }
.cs-b3 { width: 50px;  height: 140px; }
.cs-b4 { width: 120px; height: 350px; }
.cs-b5 { width: 70px;  height: 220px; }
.cs-b6 { width: 100px; height: 300px; }
.cs-b7 { width: 55px;  height: 160px; }
.cs-b4::after { /* antenna */
  content: '';
  position: absolute; top: -30px; left: 50%; transform: translateX(-50%);
  width: 3px; height: 30px;
  background: linear-gradient(var(--accent), transparent);
}

.grid-floor {
  position: absolute; bottom: 0; left: 0; width: 100%; height: 40%;
  background:
    linear-gradient(to top, var(--bg) 0%, transparent 100%),
    repeating-linear-gradient(90deg, rgba(255,107,53,.04) 0, rgba(255,107,53,.04) 1px, transparent 1px, transparent 60px),
    repeating-linear-gradient(0deg, rgba(255,107,53,.04) 0, rgba(255,107,53,.04) 1px, transparent 1px, transparent 60px);
  transform: perspective(400px) rotateX(60deg);
  transform-origin: center bottom;
}

.hero-content {
  position: relative; z-index: 1;
  text-align: center; padding: 0 2rem;
  max-width: 820px;
}

.hero-badge {
  display: inline-block;
  padding: .35rem 1rem; margin-bottom: 1.5rem;
  border: 1px solid rgba(255,107,53,.4);
  border-radius: 100px; font-size: .75rem;
  letter-spacing: .14em; color: var(--accent);
  font-family: var(--mono);
  background: rgba(255,107,53,.06);
}

.hero-title {
  font-size: clamp(2.8rem, 7vw, 6rem);
  font-weight: 900; line-height: 1.05;
  letter-spacing: -.02em;
  margin-bottom: 1.5rem;
}
.ht-line { display: block; }
.ht-accent { color: var(--accent); }

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--muted); max-width: 580px; margin: 0 auto 2.5rem;
}

.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 3rem; }

.hero-stats {
  display: flex; gap: 3rem; justify-content: center; flex-wrap: wrap;
}
.hs-item { text-align: center; }
.hs-num {
  display: block; font-size: 2rem; font-weight: 900;
  color: var(--accent); font-family: var(--mono);
  line-height: 1;
}
.hs-label { font-size: .75rem; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }

.hero-scroll {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  color: var(--muted); font-size: .7rem; letter-spacing: .14em;
}
.scroll-line {
  width: 1px; height: 40px;
  background: linear-gradient(var(--muted), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse { 0%,100%{opacity:.3} 50%{opacity:1} }

/* ── Sections ────────────────────────────────────────── */
.section { padding: 7rem 2rem; }
.section-dark { background: var(--bg2); }
.section-inner { max-width: 1100px; margin: 0 auto; }

.section-tag {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .2em;
  color: var(--accent); margin-bottom: 1rem;
  opacity: 0; transform: translateX(-20px);
  transition: opacity .7s, transform .7s;
}
.section-tag.visible { opacity: 1; transform: none; }

.section-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800; line-height: 1.1; margin-bottom: 3.5rem;
  opacity: 0; transform: translateY(30px);
  transition: opacity .8s, transform .8s;
}
.section-title.visible { opacity: 1; transform: none; }

/* ── Steps ───────────────────────────────────────────── */
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
.step-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem;
  opacity: 0; transform: translateY(30px);
  transition: opacity .7s, transform .7s, border-color .3s;
}
.step-card.visible { opacity: 1; transform: none; }
.step-card:hover { border-color: rgba(255,107,53,.4); }
.step-num {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .2em;
  color: var(--accent); margin-bottom: .75rem;
}
.step-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.step-card h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: .5rem; }
.step-card p { color: var(--muted); font-size: .95rem; }

/* ── Upgrades ────────────────────────────────────────── */
.upgrades-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
}
.upgrade-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  text-align: center;
  opacity: 0; transform: translateY(24px);
  transition: opacity .6s, transform .6s, border-color .3s, box-shadow .3s;
}
.upgrade-card.visible { opacity: 1; transform: none; }
.upgrade-card:hover {
  border-color: rgba(255,107,53,.5);
  box-shadow: 0 0 30px rgba(255,107,53,.1);
}
.uc-icon { font-size: 2.2rem; margin-bottom: .75rem; }
.uc-name { font-weight: 700; margin-bottom: .5rem; }
.uc-desc { font-size: .82rem; color: var(--muted); margin-bottom: .75rem; }
.uc-levels {
  font-family: var(--mono); font-size: .7rem;
  color: var(--accent); letter-spacing: .1em;
}

/* ── Leaderboard preview ─────────────────────────────── */
.leaderboard-preview {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  margin-bottom: 2rem;
}
.lb-loading { padding: 3rem; text-align: center; color: var(--muted); }
.lb-row {
  display: grid; grid-template-columns: 2.5rem 1fr auto;
  align-items: center; gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  transition: background .2s;
}
.lb-row:last-child { border-bottom: none; }
.lb-row:hover { background: rgba(255,107,53,.04); }
.lb-rank { font-family: var(--mono); font-size: .8rem; color: var(--muted); font-weight: 700; }
.lb-rank.top1 { color: #ffd700; }
.lb-rank.top2 { color: #c0c0c0; }
.lb-rank.top3 { color: #cd7f32; }
.lb-info { display: flex; flex-direction: column; }
.lb-name { font-weight: 600; font-size: .95rem; }
.lb-city { font-size: .8rem; color: var(--muted); }
.lb-pop { font-family: var(--mono); font-weight: 700; color: var(--accent); }
.lb-cta { text-align: center; }

/* ── CTA section ─────────────────────────────────────── */
.section-cta {
  text-align: center;
  background: radial-gradient(ellipse 60% 60% at 50% 50%, rgba(255,107,53,.07) 0%, transparent 70%);
}
.cta-title { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 900; margin-bottom: 1rem; }
.cta-sub { color: var(--muted); margin-bottom: 2.5rem; font-size: 1.05rem; }

/* ── Footer ──────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1.5rem;
}
.footer-logo { font-family: var(--mono); font-weight: 900; color: var(--accent); letter-spacing: .12em; }
.footer-links { display: flex; gap: 2rem; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-size: .85rem; transition: color .2s; }
.footer-links a:hover { color: var(--text); }
.footer-copy { color: var(--muted); font-size: .8rem; }

/* ── Auth Modal ──────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.modal.open { opacity: 1; pointer-events: all; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.75); backdrop-filter: blur(6px);
}
.modal-box {
  position: relative; z-index: 1;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2.5rem;
  width: 100%; max-width: 420px; text-align: center;
  transform: translateY(20px);
  transition: transform .3s;
}
.modal.open .modal-box { transform: none; }
.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: rgba(255,255,255,.05); color: var(--muted);
  font-size: 1rem; transition: background .2s, color .2s;
}
.modal-close:hover { background: rgba(255,107,53,.15); color: var(--text); }
.modal-logo { font-family: var(--mono); font-size: 1.4rem; font-weight: 900; color: var(--accent); letter-spacing: .12em; margin-bottom: 1.5rem; }
.modal-title { font-size: 1.4rem; font-weight: 800; margin-bottom: .5rem; }
.modal-sub { color: var(--muted); font-size: .9rem; margin-bottom: 1.5rem; }
.modal-ref-row { margin-top: 1.5rem; text-align: left; }
.ref-label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: .4rem; letter-spacing: .08em; }
.ref-input {
  width: 100%; padding: .65rem 1rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-family: var(--mono);
  font-size: .95rem; letter-spacing: .1em; text-transform: uppercase;
  transition: border-color .2s;
}
.ref-input:focus { outline: none; border-color: var(--accent); }
.modal-terms { font-size: .75rem; color: var(--muted); margin-top: 1.2rem; }
.modal-terms a { color: var(--accent); }

/* ── FAQ / Rules pages ───────────────────────────────── */
.page-hero { padding: 10rem 2rem 4rem; text-align: center; }
.page-hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 900; margin-bottom: 1rem; }
.page-hero p { color: var(--muted); max-width: 540px; margin: 0 auto; }
.page-content { max-width: 760px; margin: 0 auto; padding: 0 2rem 6rem; }

.faq-item { border-bottom: 1px solid var(--border); padding: 1.5rem 0; }
.faq-q { font-size: 1.05rem; font-weight: 700; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.faq-q::after { content: '+'; font-size: 1.3rem; color: var(--accent); transition: transform .2s; }
.faq-item.open .faq-q::after { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; color: var(--muted); font-size: .95rem; transition: max-height .3s; }
.faq-item.open .faq-a { max-height: 400px; padding-top: .75rem; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links .nav-link { display: none; }
  .hero-stats { gap: 1.5rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
