:root {
  --bg: #07090f;
  --panel: #0d111b;
  --line: rgba(255,255,255,.12);
  --text: #f5f7fb;
  --muted: #9da4b4;
  --accent: #ff2b2b;
  --accent-dark: #180000;
  --header-h: 76px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

button, a { font: inherit; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

.site-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0 clamp(20px, 4vw, 72px);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 10;
  background: rgba(7,9,15,.82);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .72rem;
  font-weight: 900;
  letter-spacing: -.04em;
  font-size: 1.15rem;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--accent-dark);
  background: var(--accent);
  transform: skewX(-8deg);
  font-size: .85rem;
}
.accent { color: var(--accent); }

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 44px);
  margin-left: auto;
  color: #c8cdd8;
  font-size: .83rem;
  text-transform: uppercase;
  letter-spacing: .13em;
}
.main-nav a { transition: color .2s ease; }
.main-nav a:hover { color: var(--accent); }

.header-cta {
  margin-left: clamp(6px, 2vw, 24px);
  padding: 11px 18px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .75rem;
  transition: .2s ease;
}
.header-cta:hover {
  color: var(--accent-dark);
  background: var(--accent);
}

.hero {
  min-height: calc(100svh - var(--header-h));
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(480px, 1.15fr);
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  padding: clamp(62px, 9vh, 116px) clamp(24px, 5vw, 86px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: 0 0 1.25rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .7rem;
  font-weight: 800;
}
.eyebrow > span {
  width: 28px;
  height: 2px;
  background: currentColor;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 1.6rem;
  max-width: 740px;
  font-size: clamp(3.7rem, 7.15vw, 7.4rem);
  line-height: .86;
  letter-spacing: -.075em;
  text-transform: uppercase;
}
h1 em {
  color: transparent;
  -webkit-text-stroke: 1px rgba(245,247,251,.48);
  font-style: normal;
}

.hero-lede {
  max-width: 570px;
  color: var(--muted);
  font-size: clamp(1rem, 1.25vw, 1.18rem);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-top: 1.5rem;
}
.primary-button {
  border: 0;
  min-width: 190px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--accent);
  color: var(--accent-dark);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .09em;
  font-size: .76rem;
  font-weight: 900;
  transition: transform .2s ease, box-shadow .2s ease;
}
.primary-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 45px rgba(255,43,43,.22);
}
.primary-button b { font-size: 1.15rem; }

.text-link {
  color: #d6dae4;
  font-size: .84rem;
  border-bottom: 1px solid rgba(255,255,255,.25);
  padding-bottom: 5px;
}
.text-link span { color: var(--accent); }

.stats {
  display: flex;
  gap: clamp(28px, 4vw, 62px);
  margin-top: clamp(44px, 8vh, 86px);
}
.stats div { display: flex; flex-direction: column; }
.stats strong {
  font-size: clamp(1.45rem, 2.3vw, 2.25rem);
  letter-spacing: -.05em;
}
.stats span {
  margin-top: 5px;
  color: #71798b;
  font-size: .65rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.stage-shell {
  min-height: 680px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 54% 48%, rgba(135,150,180,.055), transparent 34%),
    linear-gradient(135deg, #111624 0%, #090b12 70%);
  border-left: 1px solid var(--line);
}
.stage-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .26;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 62px 62px;
  mask-image: linear-gradient(to bottom, transparent, #000 25%, #000 72%, transparent);
}
.stage-shell::after {
  content: "TANK3D";
  position: absolute;
  right: -2vw;
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
  color: rgba(255,255,255,.025);
  font-size: clamp(7rem, 15vw, 15rem);
  font-weight: 950;
  letter-spacing: -.08em;
  pointer-events: none;
}

#webglStage {
  position: absolute;
  inset: 0;
  cursor: grab;
}
#webglStage:active { cursor: grabbing; }
#webglStage canvas { width: 100%; height: 100%; display: block; }

.stage-label {
  position: absolute;
  z-index: 3;
  left: clamp(18px, 3vw, 46px);
  top: clamp(20px, 4vw, 48px);
  pointer-events: none;
}
.stage-label > div {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: .64rem;
  letter-spacing: .17em;
  font-weight: 850;
}
.stage-label strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(1.3rem, 2.5vw, 2.6rem);
  letter-spacing: -.045em;
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(255,43,43,.14);
}

.speed-card {
  position: absolute;
  z-index: 3;
  right: clamp(18px, 3vw, 44px);
  bottom: clamp(24px, 5vw, 55px);
  padding: 16px 18px;
  min-width: 138px;
  background: rgba(7,9,15,.67);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.speed-card span {
  display: block;
  color: #8f97a8;
  font-size: .6rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.speed-card strong {
  font-size: 2.35rem;
  line-height: 1;
  letter-spacing: -.08em;
}
.speed-card small {
  color: var(--accent);
  margin-left: 5px;
  font-size: .55rem;
  letter-spacing: .12em;
}

.car-switcher {
  position: absolute;
  z-index: 4;
  left: clamp(18px, 3vw, 44px);
  bottom: clamp(24px, 5vw, 55px);
  display: flex;
  align-items: center;
  gap: 10px;
}
.car-dot {
  width: 27px;
  height: 3px;
  border: 0;
  padding: 0;
  background: rgba(255,255,255,.24);
  cursor: pointer;
  transition: background .2s ease, width .2s ease;
}
.car-dot.active {
  width: 46px;
  background: var(--accent);
}
.switch-note {
  margin-left: 5px;
  color: #6f7788;
  font-size: .61rem;
  text-transform: uppercase;
  letter-spacing: .11em;
}

.drag-hint {
  position: absolute;
  z-index: 3;
  right: clamp(18px, 3vw, 44px);
  top: clamp(26px, 4vw, 48px);
  color: #7f8798;
  font-size: .62rem;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.ticker {
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  color: #0c1000;
  background: var(--accent);
  padding: 13px 0;
}
.ticker > div {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 25px;
  animation: ticker 23s linear infinite;
  font-size: .72rem;
  font-weight: 950;
  letter-spacing: .12em;
}
.ticker i { font-style: normal; }
@keyframes ticker { to { transform: translateX(-50%); } }

.game-modes {
  padding: clamp(72px, 10vw, 140px) clamp(20px, 5vw, 80px);
}
.section-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 48px;
}
.section-intro h2 {
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 6.2rem);
  line-height: .88;
  letter-spacing: -.065em;
  text-transform: uppercase;
}

.mode-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  border: 1px solid var(--line);
}
.mode-card {
  min-height: 330px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
  background: #0a0d14;
  transition: transform .25s ease, background .25s ease;
}
.mode-card:last-child { border-right: 0; }
.mode-card:hover {
  transform: translateY(-7px);
  background: #111620;
}
.mode-card.featured {
  color: var(--accent-dark);
  background: var(--accent);
}
.mode-card p {
  font-size: .62rem;
  font-weight: 850;
  letter-spacing: .15em;
}
.mode-card h3 {
  margin: auto 0 22px;
  font-size: clamp(2rem, 4vw, 4.6rem);
  line-height: .91;
  letter-spacing: -.06em;
  text-transform: uppercase;
}
.mode-card span {
  color: #949cac;
  max-width: 310px;
  line-height: 1.55;
  font-size: .88rem;
}
.mode-card.featured span { color: rgba(16,21,0,.65); }

.launch-toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 120px);
  padding: 14px 20px;
  color: var(--accent-dark);
  background: var(--accent);
  font-weight: 800;
  font-size: .82rem;
  box-shadow: 0 15px 50px rgba(0,0,0,.4);
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.launch-toast.show { transform: translate(-50%, 0); }

@media (max-width: 980px) {
  .main-nav { display: none; }
  .header-cta { margin-left: auto; }
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-copy {
    min-height: 650px;
  }
  .stage-shell {
    min-height: 660px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .mode-grid { grid-template-columns: 1fr; }
  .mode-card {
    min-height: 260px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .mode-card:last-child { border-bottom: 0; }
}

@media (max-width: 620px) {
  :root { --header-h: 65px; }
  .site-header { padding: 0 18px; }
  .header-cta { padding: 9px 12px; }
  .hero-copy { min-height: 610px; }
  h1 { font-size: clamp(3.1rem, 15vw, 5rem); }
  .hero-actions { align-items: flex-start; flex-direction: column; }
  .stats { gap: 25px; }
  .stage-shell { min-height: 560px; }
  .switch-note, .drag-hint { display: none; }
  .speed-card { bottom: 22px; }
  .car-switcher { bottom: 30px; }
  .section-intro { align-items: start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker > div { animation: none; }
}

/* Tank3D.com armory adaptation */
.stage-shell::after { content: "TANK3D"; }
.car-switcher {
  max-width: min(58%, 590px);
  flex-wrap: wrap;
  gap: 7px 8px;
}
.car-dot {
  width: 16px;
  height: 3px;
}
.car-dot.active { width: 32px; }
.switch-note {
  flex-basis: 100%;
  margin: 3px 0 0;
}
@media (max-width: 620px) {
  .car-switcher { max-width: 62%; gap: 6px; }
  .car-dot { width: 12px; }
  .car-dot.active { width: 24px; }
}

.brand-domain { margin-left: .14em; color: #7f8798; font-size: .56em; letter-spacing: .04em; }
