/* Landing page. Builds on the tokens and buttons in style.css. */

body.landing {
  height: auto;
  user-select: text;
  line-height: 1.55;
}
.landing a { color: inherit; }
.landing h1, .landing h2, .landing h3 { margin: 0; text-transform: none; letter-spacing: -0.01em; color: var(--text); }
.landing h2 { font-size: clamp(24px, 3.2vw, 34px); font-weight: 750; }
.landing h3 { font-size: 17px; }
.landing p { margin: 0; }

/* ---- Top bar ---- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: linear-gradient(rgba(15, 20, 24, 0.92), rgba(15, 20, 24, 0.6));
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 750; text-decoration: none; }
.topbar nav { display: flex; align-items: center; gap: clamp(10px, 2vw, 22px); font-size: 14px; }
.topbar nav a { text-decoration: none; color: var(--muted); }
.topbar nav a:hover { color: var(--text); }
.topbar nav .nav-play {
  color: var(--text);
  background: #1e6b8f;
  border: 1px solid #2a87b3;
  border-radius: 6px;
  padding: 5px 14px;
}
.topbar nav .nav-play:hover { background: #2380ab; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text);
  background: rgba(38, 50, 60, 0.85);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 18px;
  font-weight: 600;
}
.btn:hover { background: #2e3c48; }
.btn.primary { background: #1e6b8f; border-color: #2a87b3; }
.btn.primary:hover { background: #2380ab; }
.btn.big { padding: 13px 26px; font-size: 17px; }

/* ---- Hero with the live demo behind it ---- */
.hero {
  position: relative;
  min-height: min(92vh, 860px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 96px clamp(16px, 6vw, 80px) 40px;
}
#demo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(15, 20, 24, 0.94) 0%, rgba(15, 20, 24, 0.75) 40%, rgba(15, 20, 24, 0.25) 75%, rgba(15, 20, 24, 0.35) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(15, 20, 24, 0) 30%);
}
.hero-content { position: relative; max-width: 620px; display: flex; flex-direction: column; gap: 18px; }
.eyebrow { color: var(--accent); font-weight: 650; font-size: 14px; text-transform: uppercase; letter-spacing: 0.12em; }
.hero h1 { font-size: clamp(38px, 6vw, 68px); line-height: 1.04; font-weight: 800; }
.lead { font-size: clamp(16px, 1.6vw, 19px); color: #c5d1da; max-width: 520px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.fine { font-size: 13px; color: var(--muted); }
.landing .howto { align-self: flex-start; margin-top: -6px; color: var(--accent); font-size: 15px; text-underline-offset: 3px; }
.landing .howto:hover { color: var(--text); }
.topbar .lang-switch button { padding: 3px 8px; }

.hero-stats {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin-top: 48px;
}
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hero-stats span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }

/* ---- Sections ---- */
.landing main { max-width: 1120px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
.block { padding: 56px 0 8px; scroll-margin-top: 70px; }
.block-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 22px; }
.block-head p { color: var(--muted); max-width: 640px; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 16px;
}
.step {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.step p { color: var(--muted); font-size: 14px; }
.step-n {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(79, 195, 247, 0.15); color: var(--accent);
  font-weight: 700; font-size: 13px;
}

.tower-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tower-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tower-card canvas { width: 64px; height: 64px; }
.tower-card .row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tower-card .cost { color: var(--gold); font-size: 13px; font-variant-numeric: tabular-nums; }
.tower-card p { color: var(--muted); font-size: 13px; }

.enemy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.enemy {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 2px 10px;
  align-items: start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.enemy .dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; }
.enemy .name { font-weight: 650; display: flex; justify-content: space-between; gap: 8px; }
.enemy .wave { font-size: 11px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.enemy p { grid-column: 2; color: var(--muted); font-size: 13px; }
.enemy.boss { border-color: rgba(239, 83, 80, 0.45); }

.map-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.map-tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.map-tile canvas { width: 100%; aspect-ratio: 20 / 12; display: block; }
.map-tile div { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.map-tile p { font-size: 12px; color: var(--muted); }

#lb-maps { justify-content: flex-start; margin-bottom: 12px; }
.lb {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  max-width: 640px;
}
.lb table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.lb th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; padding: 6px 8px; }
.lb td { padding: 8px; border-top: 1px solid var(--line); }
.lb th:nth-child(n+3), .lb td:nth-child(n+3) { text-align: right; }
.lb td:first-child { color: var(--muted); width: 3em; }
.lb td.name { overflow-wrap: anywhere; }
.lb tr.top1 td:first-child { color: #ffd54f; font-weight: 700; }
.lb tr.top2 td:first-child { color: #cfd8dc; font-weight: 700; }
.lb tr.top3 td:first-child { color: #ffab91; font-weight: 700; }
#lb-status { padding: 10px 8px; }
#lb-status:empty { display: none; }

.final {
  margin: 72px 0 24px;
  padding: 48px 24px;
  text-align: center;
  border-radius: 16px;
  background: radial-gradient(ellipse at center, rgba(30, 107, 143, 0.35), rgba(22, 29, 35, 0.9) 70%);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.footer {
  display: flex;
  justify-content: space-between;
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 40px) 40px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 900px) {
  .tower-grid { grid-template-columns: repeat(2, 1fr); }
  .map-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .topbar nav a:not(.nav-play) { display: none; }
  .hero-shade {
    background: linear-gradient(0deg, var(--bg) 0%, rgba(15, 20, 24, 0.82) 45%, rgba(15, 20, 24, 0.6) 100%);
  }
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
