:root {
  color-scheme: dark;
  --bg: #080b12;
  --panel: #101723;
  --panel-2: #151e2d;
  --text: #f7f8fb;
  --muted: #aab4c4;
  --orange: #ff7a18;
  --yellow: #ffca28;
  --line: rgba(255, 255, 255, 0.1);
}

* { box-sizing: border-box; }

html { overflow-x: clip; }

img { display: block; max-width: 100%; }

a, button, summary { -webkit-tap-highlight-color: transparent; }

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 4px;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  color: var(--text);
  background:
    radial-gradient(circle at 90% 0%, rgba(255, 122, 24, 0.22), transparent 32rem),
    radial-gradient(circle at 0% 30%, rgba(255, 202, 40, 0.08), transparent 28rem),
    var(--bg);
  font: 16px/1.65 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: #ffad5c; }
a:hover { color: var(--yellow); }

.shell { width: min(980px, calc(100% - 32px)); margin: 0 auto; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.tile {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  color: #16100b;
  background: linear-gradient(145deg, var(--yellow), var(--orange));
  box-shadow: 0 10px 30px rgba(255, 122, 24, 0.24);
  font-size: 13px;
  font-weight: 950;
}

nav { display: flex; flex-wrap: wrap; gap: 10px 18px; }
nav a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.hero { padding: 72px 0 48px; }
.eyebrow { color: var(--orange); text-transform: uppercase; letter-spacing: 0.15em; font-size: 12px; font-weight: 900; }
h1 { max-width: 760px; margin: 12px 0 16px; font-size: clamp(42px, 8vw, 84px); line-height: 0.98; letter-spacing: -0.055em; }
.hero p { max-width: 650px; color: var(--muted); font-size: clamp(18px, 2.4vw, 23px); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: var(--panel);
  text-decoration: none;
  font-weight: 850;
  transition: transform 160ms ease, border-color 160ms ease, color 160ms ease;
}
.button.primary { color: #190e05; border: 0; background: linear-gradient(135deg, var(--yellow), var(--orange)); }
.button:hover { color: var(--text); border-color: rgba(255, 202, 40, 0.42); transform: translateY(-1px); }
.button.primary:hover { color: #190e05; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 24px 0 72px; }
.card { padding: 24px; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(155deg, var(--panel-2), var(--panel)); }
.card h2 { margin: 0 0 8px; font-size: 19px; }
.card p { margin: 0; color: var(--muted); }
.card-link {
  display: inline-flex;
  margin-top: 14px;
  color: #ffc274;
  text-decoration: none;
  font-size: 14px;
  font-weight: 850;
}

.copy {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(28px, 7vw, 84px);
  align-items: start;
  padding: 24px 0 88px;
}
.copy h2 { margin: 10px 0 0; font-size: clamp(28px, 4vw, 42px); line-height: 1.1; letter-spacing: -0.03em; }
.copy p { margin: 0; color: var(--muted); font-size: 18px; }

.document { margin: 48px auto 88px; padding: clamp(24px, 5vw, 54px); border: 1px solid var(--line); border-radius: 28px; background: rgba(16, 23, 35, 0.93); }
.document h1 { font-size: clamp(36px, 6vw, 58px); }
.document h2 { margin-top: 38px; font-size: 24px; }
.document h3 { margin-top: 28px; }
.document p, .document li { color: #c5ccda; }
.document strong { color: var(--text); }
.meta { color: var(--muted); }
.language { margin: 48px 0 24px; padding-top: 36px; border-top: 1px solid var(--line); }
.friend-invite { max-width: 720px; text-align: center; }
.friend-invite h1 { margin-inline: auto; font-size: clamp(38px, 8vw, 68px); }
.friend-invite .actions { justify-content: center; }
.friend-invite button { font: inherit; cursor: pointer; }
.invite-code {
  width: fit-content;
  margin: 28px auto 12px;
  padding: 14px 22px;
  border: 2px solid var(--orange);
  border-radius: 16px;
  color: var(--yellow);
  background: #090b10;
  box-shadow: 0 0 26px rgba(255, 122, 24, 0.22);
  font: 950 clamp(30px, 8vw, 52px)/1 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  letter-spacing: 0.16em;
}

footer { padding: 30px 0 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 10px;
  color: #190e05;
  background: var(--yellow);
  font-weight: 900;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.nav-cta {
  padding: 6px 12px;
  border: 1px solid rgba(255, 173, 92, 0.45);
  border-radius: 999px;
  color: #ffd29d;
  background: rgba(255, 122, 24, 0.08);
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(300px, 0.84fr);
  gap: clamp(36px, 7vw, 78px);
  align-items: center;
  padding: 62px 0 54px;
}
.landing-hero h1 {
  max-width: 690px;
  margin: 14px 0 18px;
  font-size: clamp(44px, 7.2vw, 76px);
}
.landing-lead {
  max-width: 660px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(18px, 2.1vw, 22px);
}
.micro-copy { margin: 14px 0 0; color: var(--muted); font-size: 13px; }

.gameplay-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
  margin-block: 24px 72px;
  padding: clamp(22px, 4vw, 40px);
  border: 1px solid rgba(255, 202, 40, 0.22);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 122, 24, 0.08), var(--panel));
  scroll-margin-top: 20px;
}
.gameplay-copy h2 { margin: 14px 0; font-size: clamp(32px, 4.8vw, 52px); line-height: 1.07; letter-spacing: -0.04em; }
.gameplay-copy > p { color: var(--muted); }
.quick-start { display: grid; gap: 16px; margin: 26px 0 0; padding-left: 24px; }
.quick-start li::marker { color: var(--orange); font-weight: 900; }
.quick-start strong, .quick-start span { display: block; }
.quick-start span { color: var(--muted); font-size: 14px; }
.gameplay-preview { width: 100%; max-width: 320px; margin: 0; justify-self: center; }
.video-facade { aspect-ratio: 9 / 16; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: #000; }
.video-play { display: block; position: relative; height: 100%; color: var(--text); }
.video-play img { width: 100%; height: 100%; object-fit: contain; }
.video-play:focus-visible { outline-offset: -5px; }
.video-play-label { position: absolute; inset: auto 12px 14px; padding: 12px 8px; border-radius: 12px; color: #190e05; background: var(--yellow); text-align: center; font-size: 14px; font-weight: 900; box-shadow: 0 6px 30px #0009; }
.video-play-label span { margin-right: 6px; }
.video-facade iframe { display: block; width: 100%; height: 100%; border: 0; }
.gameplay-preview figcaption { margin-top: 12px; color: var(--muted); text-align: center; font-size: 12px; }
.gameplay-preview figcaption a { display: inline-block; padding: 4px; }

.app-preview {
  width: min(100%, 340px);
  margin: 0;
  justify-self: center;
  overflow: hidden;
  border: 1px solid rgba(255, 202, 40, 0.25);
  border-radius: 32px;
  background: #050608;
  box-shadow: 0 28px 74px rgba(0, 0, 0, 0.46), 0 0 44px rgba(255, 122, 24, 0.1);
}
.app-preview img { width: 100%; height: auto; }
.app-preview figcaption {
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--panel);
  text-align: center;
  font-size: 12px;
  font-weight: 750;
}

.puzzle-showcase {
  position: relative;
  padding: clamp(14px, 2.5vw, 22px);
  border: 1px solid rgba(255, 202, 40, 0.22);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255, 122, 24, 0.12), transparent 42%),
    rgba(16, 23, 35, 0.94);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.38);
  transform: rotate(1.4deg);
}
.puzzle-showcase::before {
  content: "";
  position: absolute;
  inset: -22px;
  z-index: -1;
  border-radius: 38px;
  background: radial-gradient(circle, rgba(255, 122, 24, 0.16), transparent 68%);
  filter: blur(8px);
}
.board-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font: 800 12px/1.3 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.board-label strong { color: var(--yellow); }
.board-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 8px;
  border-radius: 18px;
  background: #090d14;
}
.board-cell {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  color: #f9fbff;
  background: #182131;
  font: 900 clamp(13px, 2.3vw, 22px)/1 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
.board-cell.empty { color: transparent; background: #111925; }
.board-cell.n2 { background: #25334a; }
.board-cell.n4 { background: #30445f; }
.board-cell.n8 { background: #a94d1a; }
.board-cell.n16 { background: #d65d16; }
.board-cell.n32 { background: #e67a18; }
.board-cell.n64 { color: #201308; background: #ffad23; }
.board-cell.n128 { color: #201308; background: #ffd34f; font-size: clamp(11px, 2vw, 19px); }
.race-status {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  font: 800 12px/1.35 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
.race-status span:last-child { text-align: right; }
.race-status b { color: var(--orange); }

.proof-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 10px auto 88px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(16, 23, 35, 0.74);
}
.proof-strip div { padding: 19px 20px; border-right: 1px solid var(--line); }
.proof-strip div:last-child { border-right: 0; }
.proof-strip strong { display: block; color: var(--text); font-size: 16px; }
.proof-strip span { color: var(--muted); font-size: 13px; }

.landing-section { padding: 16px 0 88px; }
.section-heading { max-width: 720px; margin-bottom: 30px; }
.section-heading h2 {
  margin: 10px 0 12px;
  font-size: clamp(30px, 4.8vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}
.section-heading p { margin: 0; color: var(--muted); font-size: 18px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step {
  min-height: 230px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(155deg, var(--panel-2), var(--panel));
}
.step-number {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 34px;
  place-items: center;
  border-radius: 12px;
  color: #1a1008;
  background: linear-gradient(135deg, var(--yellow), var(--orange));
  font-weight: 950;
}
.step h3 { margin: 0 0 8px; font-size: 20px; }
.step p { margin: 0; color: var(--muted); }

.mode-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.mode-card {
  padding: clamp(22px, 4vw, 32px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(16, 23, 35, 0.83);
}
.mode-card.featured { border-color: rgba(255, 122, 24, 0.52); background: linear-gradient(145deg, rgba(255, 122, 24, 0.13), var(--panel)); }
.mode-meta { color: var(--orange); font-size: 12px; font-weight: 900; letter-spacing: 0.13em; text-transform: uppercase; }
.mode-card h3 { margin: 8px 0; font-size: 24px; }
.mode-card p { margin: 0; color: var(--muted); }
.mode-card ul { margin: 18px 0 0; padding-left: 20px; color: #cbd3df; }

.split-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 7vw, 76px);
  align-items: start;
  padding: clamp(26px, 5vw, 52px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 202, 40, 0.06), rgba(16, 23, 35, 0.92));
}
.split-panel h2 { margin: 10px 0 0; font-size: clamp(30px, 4vw, 44px); line-height: 1.08; }
.check-list { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; }
.check-list li { position: relative; padding-left: 32px; color: var(--muted); }
.check-list li::before {
  content: "✓";
  position: absolute;
  top: 0;
  left: 0;
  color: var(--yellow);
  font-weight: 950;
}
.check-list strong { display: block; color: var(--text); }

.tips-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.tip { padding: 24px; border-left: 3px solid var(--orange); border-radius: 0 18px 18px 0; background: rgba(16, 23, 35, 0.72); }
.tip h3 { margin: 0 0 7px; font-size: 19px; }
.tip p { margin: 0; color: var(--muted); }

.faq-list { display: grid; gap: 12px; max-width: 820px; }
.faq-list details { border: 1px solid var(--line); border-radius: 18px; background: rgba(16, 23, 35, 0.78); }
.faq-list summary { padding: 20px 52px 20px 22px; cursor: pointer; color: var(--text); font-weight: 850; }
.faq-list details p { margin: 0; padding: 0 22px 22px; color: var(--muted); }
.faq-list details[open] { border-color: rgba(255, 122, 24, 0.42); }

.cta-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  margin-bottom: 88px;
  padding: clamp(28px, 6vw, 54px);
  border: 1px solid rgba(255, 173, 92, 0.35);
  border-radius: 30px;
  background:
    radial-gradient(circle at 90% 20%, rgba(255, 202, 40, 0.18), transparent 18rem),
    linear-gradient(140deg, rgba(255, 122, 24, 0.15), var(--panel));
}
.cta-band h2 { margin: 8px 0 10px; font-size: clamp(30px, 4.5vw, 48px); line-height: 1.06; }
.cta-band p { max-width: 650px; margin: 0; color: var(--muted); }
.cta-band .actions { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
.footer-links a { color: var(--muted); text-decoration: none; }

.mobile-download-bar { display: none; }

@media (max-width: 760px) {
  header { align-items: center; flex-direction: row; flex-wrap: wrap; gap: 8px 14px; padding: 16px 0 12px; }
  header nav {
    width: 100%;
    flex-wrap: nowrap;
    gap: 16px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  header nav::-webkit-scrollbar { display: none; }
  header nav a { min-height: 36px; white-space: nowrap; }
  .grid { grid-template-columns: 1fr; }
  .copy { grid-template-columns: 1fr; }
  .hero { padding-top: 42px; }
  .landing-hero { grid-template-columns: 1fr; padding-top: 38px; }
  .gameplay-section { grid-template-columns: 1fr; }
  .gameplay-preview { grid-row: 1; }
  .app-preview { width: min(86vw, 330px); }
  .puzzle-showcase { width: min(100%, 430px); margin: 0 auto; transform: none; }
  .proof-strip { grid-template-columns: repeat(2, 1fr); }
  .proof-strip div:nth-child(2) { border-right: 0; }
  .proof-strip div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .steps, .mode-grid, .tips-grid { grid-template-columns: 1fr; }
  .step { min-height: 0; }
  .step-number { margin-bottom: 22px; }
  .split-panel, .cta-band { grid-template-columns: 1fr; }
  .cta-band .actions { margin-top: 4px; }
  .has-mobile-download { padding-bottom: 78px; }
  .mobile-download-bar {
    display: flex;
    position: fixed;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px;
    z-index: 90;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    color: #190e05;
    background: linear-gradient(135deg, var(--yellow), var(--orange));
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.48);
    text-decoration: none;
    font-weight: 900;
  }
  .mobile-download-bar:hover { color: #190e05; }
}

@media (max-width: 430px) {
  .shell { width: min(980px, calc(100% - 24px)); }
  nav { gap: 12px; }
  .proof-strip { grid-template-columns: 1fr; }
  .proof-strip div { border-right: 0; border-bottom: 1px solid var(--line); }
  .proof-strip div:last-child { border-bottom: 0; }
  .race-status { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
