/* ============================================================================
   FogWalk — landing styles
   Design system distilled from the app's own tokens (lib/theme/app_tokens.dart,
   loot_visuals.dart, game_icons.dart). Liquid-glass chrome, systemGreen accent.
   Dark-first (fog reads dramatic on night), fully responsive, Safari-safe.
   ============================================================================ */

/* ----------------------------------------------------------------- tokens -- */
:root {
  /* systemGreen accent (app: light #34C759 / dark #30D158). Landing is dark-first. */
  --accent: #30D158;
  --accent-strong: #34C759;
  --accent-deep: #1FA24B;          /* app icon gradient / splash */
  --accent-ink: #0a3d1c;
  /* accent tuned for TEXT (bright green fails contrast on light bg) */
  --accent-text: #30D158;

  /* rarity (loot_visuals.dart, dark tones) */
  --common: #8E8E93;
  --rare: #0A84FF;
  --epic: #BF5AF2;
  --legendary: #FFD60A;

  /* game glyph palette (game_icons.dart) */
  --g-yellow: #FFCB3D;
  --g-orange: #FF9F1C;
  --g-red: #FF4D3D;
  --g-green: #3ED26B;
  --g-blue: #3B9EFF;
  --g-indigo: #5B6BEF;
  --g-teal: #35C7D6;
  --g-steel: #8492AD;
  --g-steel-dark: #5A6784;
  --g-wood: #C08A4E;
  --g-paper: #F7F1E6;

  /* coin gold */
  --coin: #FFCC00;
  --gold-light: #FFE8A3;
  --gold-mid: #F4B740;
  --gold-dark: #C6871F;

  /* surfaces — night palette */
  --bg: #05070a;
  --bg-2: #0a0e14;
  --ink: #f4f7f6;
  --ink-2: rgba(235, 240, 238, 0.68);
  --ink-3: rgba(235, 240, 238, 0.54);
  --hairline: rgba(255, 255, 255, 0.10);

  /* fog painted onto the hero canvas — the app's own fog colours
     (fog_layer.dart: dark #0A101A, light #263242 — always dark over the map) */
  --fog: rgba(10, 16, 26, 0.93);

  /* liquid glass (see .glass) — glass is ALWAYS dark slate, in BOTH themes
     (mirrors the app: dark chrome floats over the light map for contrast).
     Content painted on glass therefore always uses the fixed light inks. */
  --glass-fill: rgba(20, 26, 33, 0.55);
  --glass-fill-solid: rgba(18, 23, 30, 0.92);
  --glass-stroke: rgba(255, 255, 255, 0.14);
  --glass-top: rgba(255, 255, 255, 0.22);
  --glass-ink: #f2f5f4;
  --glass-ink-2: rgba(235, 240, 238, 0.68);
  --glass-hairline: rgba(255, 255, 255, 0.10);

  /* the FULL glass.css --glass-shadow stack (glass-demo.html): diagonal
     blicks + dark lips + bottom reflection + two outer drops */
  --glass-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    inset 1.8px 3px 0px -2px rgba(255, 255, 255, 0.27),
    inset -2px -2px 0px -2px rgba(255, 255, 255, 0.24),
    inset -3px -8px 1px -6px rgba(255, 255, 255, 0.18),
    inset -0.3px -1px 4px 0px rgba(0, 0, 0, 0.24),
    inset -1.5px 2.5px 0px -2px rgba(0, 0, 0, 0.4),
    inset 0px 3px 4px -2px rgba(0, 0, 0, 0.4),
    inset 2px -6.5px 1px -4px rgba(0, 0, 0, 0.2),
    0px 1px 5px 0px rgba(0, 0, 0, 0.2),
    0px 6px 16px 0px rgba(0, 0, 0, 0.16);

  /* radii — continuous-corner scale (app AppRadius) */
  --r-button: 14px;
  --r-card: 20px;
  --r-lg: 28px;
  --r-xl: 34px;
  --r-pill: 999px;

  /* type */
  --font-display: "Clash Display", "SF Pro Display", -apple-system,
    BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Menlo",
    "Cascadia Code", monospace;

  /* rhythm */
  --gutter: clamp(20px, 5vw, 40px);
  --section-y: clamp(72px, 12vh, 148px);
  --maxw: 1200px;

  --shadow-glass: 0 1px 0 rgba(255, 255, 255, 0.10) inset,
    0 18px 50px -18px rgba(0, 0, 0, 0.7);

  color-scheme: dark;
}

/* RU locale: Clash Display has no Cyrillic — swap the display face for
   Unbounded (the closest free match in poster-grotesque personality).
   Unbounded runs wider than Clash, so headings get a slight size/tracking
   compensation to keep the same visual scale. */
html[lang="ru"] {
  --font-display: "Unbounded", "SF Pro Display", -apple-system,
    BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
html[lang="ru"] h1,
html[lang="ru"] h2,
html[lang="ru"] h3 { letter-spacing: -0.01em; }
html[lang="ru"] .hero-title { font-size: clamp(1.9rem, 3.7vw, 4.4rem); }
html[lang="ru"] .section-head h2 { font-size: clamp(1.55rem, 2.35vw, 2.8rem); }
html[lang="ru"] .cta h2 { font-size: clamp(1.7rem, 3vw, 3.6rem); }

/* ------------------------------------------------------------------ reset -- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;   /* fallback for Safari < 16 which lacks `clip` */
  overflow-x: clip;
  scrollbar-width: none;           /* hide the page scrollbar (still scrollable) */
  background: var(--bg);           /* base under the fixed depth layer */
  /* kill the grey/blue flash Chrome & mobile Safari paint on every tap */
  -webkit-tap-highlight-color: transparent;
}

/* First load: keep the page hidden until the display fonts are ready, then
   fade it in — no flash-of-unstyled-text, no jump when Clash/Unbounded swap.
   The `fonts-loading` class is only ever added by the inline <head> script,
   so with JS off the page stays visible. */
html.fonts-loading body { opacity: 0; }
html.fonts-ready body { opacity: 1; transition: opacity 0.45s ease; }
/* Boot splash: while the font gate holds the page hidden, a fixed overlay
   shows the brand droplet on the page background instead of a blank field
   (the first-visit "grey second"). Pure CSS + a data-URI SVG — it paints on
   the very first frame, needs no JS, and CROSSFADES out (opacity 1→0) at the
   exact moment the body fades in. With JS off `fonts-loading` never exists,
   so the overlay stays invisible. pointer-events:none → never blocks input. */
html::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  background: var(--bg)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 7 L64.16 30.2 A26 26 0 1 1 35.84 30.2 Z' fill='%2330D158' stroke='%23fff' stroke-width='5.5' stroke-linejoin='round'/%3E%3Cellipse cx='42' cy='45' rx='8.5' ry='7' fill='%23fff' fill-opacity='.42'/%3E%3C/svg%3E")
    center / 76px no-repeat;
  opacity: 0;
  transition: opacity 0.45s ease;
}
html.fonts-loading::after { opacity: 1; transition: none; }
@media (prefers-reduced-motion: reduce) {
  html.fonts-ready body { transition: none; }
  html::after { transition: none; }
}
html::-webkit-scrollbar { width: 0; height: 0; }

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

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background: transparent;         /* the fixed depth layer shows through */
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;             /* never let wide art scroll the page sideways */
  overflow-x: clip;
}

/* Static depth background (the app's AppDepthBackground): a diagonal wash +
   soft NEUTRAL blobs (steel/white — never green) so the glass panes have
   tonal variation to frost against and the page never reads as a flat
   black/white sheet. One fixed compositor layer — zero scroll cost. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(56% 44% at 84% 10%, rgba(148, 170, 200, 0.10), transparent 70%),
    radial-gradient(48% 40% at 8% 34%, rgba(255, 255, 255, 0.05), transparent 70%),
    radial-gradient(60% 48% at 76% 88%, rgba(120, 150, 185, 0.08), transparent 70%),
    linear-gradient(165deg, #0c1118 0%, #05070a 52%, #090d13 100%);
}

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

a { color: inherit; text-decoration: none; }

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

/* faster, cleaner taps — no 300ms delay, no double-tap zoom on controls */
a, button, .store-badge, .loot-card, .lang-toggle { touch-action: manipulation; }
.loot-card, .lang-toggle, .btn { -webkit-user-select: none; user-select: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }

::selection {
  background: color-mix(in srgb, var(--accent) 40%, transparent);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* --------------------------------------------------------------- layout --- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  /* honor iPhone notch/rounded corners in landscape (viewport-fit=cover) */
  padding-inline: max(var(--gutter), env(safe-area-inset-left))
    max(var(--gutter), env(safe-area-inset-right));
}

.section { padding-block: var(--section-y); position: relative; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent-text);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin: 0 0 1.1rem;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.section-head { max-width: 640px; margin-bottom: clamp(36px, 6vw, 64px); }
/* Display type scales with the viewport all the way to ~1920px (the clamp
   caps used to kick in at ~1130px, so a 1366px laptop got the same pixel
   sizes as a 4K monitor and the page read as "zoomed in" with the hero
   overflowing the first screen). */
.section-head h2 {
  font-size: clamp(1.8rem, 2.85vw, 3.4rem);
}
.section-head p {
  margin-top: 1.1rem;
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  color: var(--ink-2);
  max-width: 52ch;
}

/* ---------------------------------------------------------- liquid glass -- */
/* ONE glass — every panel looks exactly like the header: the same translucent
   slate fill + live backdrop blur + specular top rim. The page background is
   a STATIC depth gradient (nothing ever scrolls beneath a pane), so the blur
   stays affordable. No-backdrop browsers fall back to the dense solid fill. */
.glass {
  position: relative;
  background: var(--glass-fill-solid);
  border-radius: var(--r-card);
  /* the glass-demo shadow pile — what makes the pane read as thick glass */
  box-shadow: var(--glass-shadow);
  isolation: isolate;
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .glass {
    background: var(--glass-fill);
    /* demo values; literal px in the -webkit- line FIRST (Safari drops var()) */
    -webkit-backdrop-filter: blur(12px) saturate(1.4);
    backdrop-filter: blur(12px) saturate(1.4);
  }
}
.glass::after {
  /* baked "light enters from above" top gradient */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 255, 255, 0) 55%
  );
  pointer-events: none;
  z-index: 1;
}
.glass > * { position: relative; z-index: 3; }

.glass-pill { border-radius: var(--r-pill); }

/* interactive glass — quiet lift, keeping the full glass stack */
.glass-hover { transition: box-shadow 0.28s ease, transform 0.28s ease; }
.glass-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--glass-shadow), 0 22px 50px -18px rgba(0, 0, 0, 0.55);
}

/* ------------------------------------------------------------- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  height: 52px;
  padding-inline: 26px;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  transition: transform 0.18s ease, box-shadow 0.25s ease, background 0.25s ease;
  will-change: transform;
}
.btn:active { transform: scale(0.97); }

/* flat accent pane (the app's tinted-glass control: solid colour + top light) */
.btn-accent {
  color: #04140a;
  background: var(--accent-strong);
  box-shadow: 0 8px 22px -10px rgba(0, 0, 0, 0.55),
    0 1px 0 rgba(255, 255, 255, 0.35) inset;
}
.btn-accent:hover {
  box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.6),
    0 1px 0 rgba(255, 255, 255, 0.35) inset;
}

.btn-ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 1px var(--hairline) inset;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }

/* store badge — outlined "ghost glass" (matches .btn-ghost / .lang-toggle),
   not the heavy black App Store block. Translucent slate fill + hairline,
   store logo and light text on top. */
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  height: 56px;
  padding-inline: 20px 22px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 1px var(--glass-stroke) inset,
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 12px 28px -18px rgba(0, 0, 0, 0.7);
  transition: transform 0.18s ease, background 0.22s ease, box-shadow 0.25s ease;
}
.store-badge:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2) inset,
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 18px 34px -18px rgba(0, 0, 0, 0.75);
}
.store-badge svg { width: 26px; height: 26px; flex: none; }
.store-badge span { color: var(--glass-ink); }
.store-badge .b-sub { display: block; font-size: 0.62rem; letter-spacing: 0.06em; color: var(--glass-ink-2); text-transform: uppercase; white-space: nowrap; }
.store-badge .b-main { display: block; font-size: 1.1rem; font-weight: 600; line-height: 1.05; letter-spacing: -0.01em; white-space: nowrap; }

/* reveal-on-scroll baseline (JS adds .in) */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* -------------------------------------------------------------- icons ----- */
.ico { width: 28px; height: 28px; color: var(--ink); }
.ico.sm { width: 20px; height: 20px; }
.ico.lg { width: 46px; height: 46px; }
.ico.xl { width: 72px; height: 72px; }

/* coin glyph (CoinPainter port) */
.coin-mini, .coin {
  --s: 20px;
  width: var(--s); height: var(--s);
  border-radius: 50%;
  flex: none;
  background:
    radial-gradient(circle at 34% 32%, #fff6cf 0 12%, transparent 26%),
    radial-gradient(circle at 50% 50%, #ffd84a 0 52%, #f0b81f 60%, #c6871f 100%);
  box-shadow: inset 0 0 0 2px rgba(198, 135, 31, 0.55),
    inset 0 0 0 3.5px rgba(255, 240, 170, 0.35), 0 1px 2px rgba(0, 0, 0, 0.35);
  position: relative;
}
.coin-mini::after, .coin::after {
  content: "★";
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: calc(var(--s) * 0.5);
  color: rgba(150, 96, 12, 0.6);
  line-height: 1;
}

/* chest (loot_visuals paintChest port) — one markup, tinted per [data-rarity] */
.chest {
  --tint: var(--common);
  --tint-hi: var(--tint); /* fallback before color-mix (Safari < 16.2) */
  --tint-hi: color-mix(in srgb, var(--tint) 78%, #fff);
  --tint-lo: var(--tint);
  --tint-lo: color-mix(in srgb, var(--tint) 78%, #000);
  /* standing-open lid inner face (darker toward the hinge, per the app) */
  --tint-int1: var(--tint-lo);
  --tint-int1: color-mix(in srgb, var(--tint) 58%, #000);
  --tint-int2: var(--tint-lo);
  --tint-int2: color-mix(in srgb, var(--tint) 36%, #000);
  position: relative;
  width: var(--cs, 120px);
  aspect-ratio: 1;
}
.chest[data-rarity="common"]    { --tint: #9a9aa1; }
.chest[data-rarity="rare"]      { --tint: var(--rare); }
.chest[data-rarity="epic"]      { --tint: var(--epic); }
.chest[data-rarity="legendary"] { --tint: #FF9F1C; }
.chest-mini { --cs: 30px; display: inline-block; width: 30px; aspect-ratio: 1; }
.chest-svg { width: 100%; height: 100%; overflow: visible; }
/* Two-phase open, mirroring the app's chest painter: the closed dome first
   FOLDS back around its rear hinge to edge-on (scaleY → 0), then the lid's
   INNER face RISES from behind the body and stands open (dark interior, gold
   band along the top rim). Interior glow + coin follow. Closing reverses. */
.chest-lid {
  transform-origin: 60px 60px;              /* rear hinge */
  transition: transform 0.18s cubic-bezier(0.45, 0, 0.8, 0.45) 0.15s;
}
.chest-lid-open {
  transform-origin: 60px 60px;
  transform: scaleY(0);
  transition: transform 0.16s cubic-bezier(0.4, 0, 0.9, 0.6) 0s;
}
.chest-interior { opacity: 0; transition: opacity 0.28s ease 0s; }
.chest-coin {
  opacity: 0;
  transform: translateY(10px) scale(0.5);
  transform-origin: 60px 52px;
  transition: transform 0.4s cubic-bezier(0.34, 1.5, 0.5, 1) 0s, opacity 0.25s ease 0s;
}
.loot-card.open .chest-lid { transform: scaleY(0.05); transition-delay: 0s; }
.loot-card.open .chest-lid-open {
  transform: scaleY(1);
  transition: transform 0.26s cubic-bezier(0.2, 0.75, 0.3, 1.08) 0.16s;
}
.loot-card.open .chest-interior { opacity: 1; transition-delay: 0.18s; }
.loot-card.open .chest-coin {
  opacity: 1;
  transform: translateY(-6px) scale(1);
  transition-delay: 0.34s;
}
@media (hover: hover) {
  .loot-card:hover .chest-lid { transform: scaleY(0.05); transition-delay: 0s; }
  .loot-card:hover .chest-lid-open {
    transform: scaleY(1);
    transition: transform 0.26s cubic-bezier(0.2, 0.75, 0.3, 1.08) 0.16s;
  }
  .loot-card:hover .chest-interior { opacity: 1; transition-delay: 0.18s; }
  .loot-card:hover .chest-coin {
    opacity: 1;
    transform: translateY(-6px) scale(1);
    transition-delay: 0.34s;
  }
}
@media (prefers-reduced-motion: reduce) {
  .chest-lid, .chest-lid-open, .chest-coin, .chest-interior, .m-chest { transition: none; }
}

/* ---------------------------------------------------------------- nav ----- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  padding: calc(14px + env(safe-area-inset-top)) var(--gutter) 14px;
  display: flex;
  justify-content: center;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav.hidden { transform: translateY(-130%); }
.nav-inner {
  width: min(100%, var(--maxw));
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 8px 8px 18px;
  height: 60px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 11px;
  overflow: hidden;
  box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.5);
}
.brand-img { width: 100%; height: 100%; display: block; object-fit: cover; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.24rem;
  letter-spacing: -0.02em;
  color: var(--glass-ink);
}
.nav-links {
  display: flex;
  gap: 26px;
  margin-left: auto;
  font-size: 0.94rem;
  color: var(--glass-ink-2);
}
.nav-links a { transition: color 0.2s ease; }
.nav-links a:hover { color: var(--glass-ink); }
.nav-cta { height: 44px; padding-inline: 20px; font-size: 0.94rem; }
.lang-toggle {
  min-width: 44px; height: 44px;
  padding-inline: 12px;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--glass-ink-2);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px var(--glass-hairline);
  transition: color 0.2s ease, background 0.2s ease;
}
.lang-toggle:hover { color: var(--glass-ink); background: rgba(255, 255, 255, 0.12); }

/* --------------------------------------------------------------- hero ----- */
.hero {
  position: relative;
  min-height: 100vh;    /* fallback for Safari < 15.4 (no svh) */
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
}
.hero-stage { position: absolute; inset: 0; z-index: 0; }
.hero-map {
  position: absolute; inset: 0;
  background: #d7e4ec;             /* Voyager water tone while the image loads */
}
.hero-map .map-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
/* game layer ABOVE the fog canvas (same z, later in DOM ⇒ paints on top) —
   like the app: chests and the puck render over the FogLayer, so chests are
   visible out in the fog and get "picked up" when you clear the ground */
.hero-play {
  position: absolute; inset: 0;
  z-index: 2;
  pointer-events: none;
}
.m-chest {
  position: absolute;
  --cs: 36px; width: 36px;
  transform: translate(-50%, -70%);
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.3));
  transition: transform 0.16s ease, opacity 0.16s ease;
}
/* the marker pops out the instant the flight flourish takes over */
.m-chest.collected {
  transform: translate(-50%, -70%) scale(1.3);
  opacity: 0;
}
/* the player puck IS the cursor on the hero: JS drives translate + rotate so
   the nose points where the pointer is heading (margin centres the box on the
   coordinate, so rotation spins in place) */
.hero-puck {
  position: absolute; left: 0; top: 0;
  width: 38px; height: 38px;
  margin: -19px 0 0 -19px;
  will-change: transform;
}
.m-arrow {
  position: relative;
  display: block;
  width: 38px; height: 38px;
  color: var(--accent-strong);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
}
.hero-puck .m-arrow { width: 100%; height: 100%; }
/* pickup flourish — port of the app's chest_pickup.dart flight (JS drives
   translate/scale/opacity along the bezier) */
.chest-fly {
  position: absolute; left: 0; top: 0;
  --cs: 52px; width: 52px;
  margin: -26px 0 0 -26px;
  opacity: 0;
  will-change: transform, opacity;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.3));
}
.hero-fog {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  /* pan-y: vertical swipes still scroll the page (never trap the user on the
     hero); horizontal drags & taps reveal fog. */
  touch-action: pan-y;
  z-index: 2;
  cursor: none;   /* the player puck replaces the pointer over the fog */
}
/* The hero copy lives on a dark GLASS panel (contrast is guaranteed whatever
   the fog/map state); the scrim only adds gentle depth at the edges. */
.hero-scrim {
  position: absolute; inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    radial-gradient(90% 70% at 50% 38%, transparent 48%, rgba(5, 8, 12, 0.30) 100%),
    linear-gradient(to top, rgba(5, 8, 12, 0.55) 0%, rgba(5, 8, 12, 0.22) 22%, transparent 46%);
}
.hero-panel {
  display: inline-block;
  max-width: 660px;
  padding: clamp(24px, 4vw, 40px) clamp(22px, 4vw, 44px) clamp(24px, 4vw, 38px);
  border-radius: var(--r-xl);
}
.hero-content {
  position: relative;
  z-index: 4;
  padding-bottom: clamp(40px, 9vh, 96px);
  padding-top: clamp(96px, 14vh, 150px);
  pointer-events: none;          /* let the fog canvas below receive the sweep */
  color: #f4f7f6;                /* always light — the hero backdrop is always dark fog */
}
.hero .eyebrow { color: #30D158; }
.hero-title { color: #fff; }
.hero-content a,
.hero-content button { pointer-events: auto; }
.hero-title {
  font-size: clamp(2.4rem, 5vw, 6rem);
  font-weight: 700;
  max-width: 15ch;
  margin: 0.2em 0 0;
}
.accent-word {
  position: relative;
  color: var(--accent);
}
.hero-sub {
  margin-top: 1.4rem;
  max-width: 46ch;
  font-size: clamp(1.02rem, 1.7vw, 1.24rem);
  color: rgba(238, 243, 241, 0.74);
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 2rem;
}
.hero-hint {
  position: absolute;
  left: 50%; bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 8px 16px;
  border-radius: var(--r-pill);
  color: rgba(238, 243, 241, 0.75);   /* hero is always dark — fixed light text */
  background: rgba(10, 14, 20, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.hero-hint.gone { opacity: 0; pointer-events: none; }
.hint-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.8s ease-in-out infinite;
}
.hint-touch { display: none; }
@media (pointer: coarse) {
  .hint-desktop { display: none; }
  .hint-touch { display: inline; }
}
/* short / landscape viewports: keep the hint clear of the CTA badges */
@media (max-height: 620px) { .hero-hint { display: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ------------------------------------------------------------ marquee ----- */
.marquee {
  border-block: 1px solid var(--hairline);
  padding-block: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.015);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee var(--mq-d, 32s) linear infinite;
  will-change: transform;
}
/* one content set; JS clones it (to an even count ≥ 2× viewport) so the
   -50% loop always lands on a set boundary — seamless at every width */
.marquee-set {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  padding-right: 28px;
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--ink-2);
}
.marquee-set i { color: var(--accent); font-style: normal; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  .hint-dot { animation: none; }
}

/* --------------------------------------------------------------- steps ---- */
.steps {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(3, 1fr);
}
.step {
  padding: 30px 26px 28px;
  border-radius: var(--r-lg);
}
.step-n {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #30D158;                /* on dark glass — fixed */
  letter-spacing: 0.1em;
}
/* bare glyphs, no tiles — the app never puts icons on a backing plate */
.step-ico { margin: 14px 0 16px; }
.step-ico .ico { width: 44px; height: 44px; }
.step h3 { font-size: 1.5rem; margin-bottom: 8px; color: var(--glass-ink); }
.step p { color: var(--glass-ink-2); font-size: 0.98rem; }
.step-ico .chest-mini { --cs: 44px; width: 44px; }

/* ------------------------------------------------------------ showcase ---- */
.showcase-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(30px, 6vw, 80px);
  align-items: center;
}
.showcase-copy h2 { font-size: clamp(1.7rem, 2.5vw, 3rem); }
.showcase-copy > p { margin-top: 1.1rem; color: var(--ink-2); max-width: 46ch; font-size: 1.08rem; }
.ticks { list-style: none; margin: 1.8rem 0 0; padding: 0; display: grid; gap: 12px; }
.ticks li {
  position: relative;
  padding-left: 30px;
  color: var(--ink);
  font-size: 1rem;
}
.ticks li::before {
  content: "";
  position: absolute; left: 0; top: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
}
.ticks li::after {
  content: "";
  position: absolute; left: 6px; top: 8px;
  width: 6px; height: 3px;
  border-left: 2px solid #04140a; border-bottom: 2px solid #04140a;
  transform: rotate(-45deg);
}
.showcase-stats {
  display: flex;
  gap: 30px;
  margin-top: 2.4rem;
  flex-wrap: wrap;
}
.showcase-stats b {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent-text);
}
.showcase-stats span { display: block; color: var(--ink-2); font-size: 0.86rem; margin-top: 4px; }

/* phone mockup */
.phone-wrap { position: relative; display: grid; place-items: center; }
.phone {
  position: relative;
  z-index: 1;
  width: min(320px, 78vw);
  aspect-ratio: 320 / 660;
  border-radius: 46px;
  padding: 11px;
  background: linear-gradient(160deg, #23262c, #0c0d10);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.9),
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.14),
    inset 0 2px 2px rgba(255, 255, 255, 0.2);
}
.phone-screen {
  position: relative;
  height: 100%;
  border-radius: 36px;
  overflow: hidden;
  background: #0a0e14;
}
.phone-map {
  position: absolute; inset: 0;
  background: #d7e4ec url("assets/map-phone.jpg") center / cover no-repeat;
}
/* the app's fog (always dark) with a WALKED CORRIDOR cleared out of it —
   an SVG alpha mask: soft-edged path ending in the player's reveal blob */
.phone-fog {
  position: absolute; inset: 0;
  z-index: 3;
  background: rgba(16, 24, 36, 0.9);
  pointer-events: none;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 640' preserveAspectRatio='none'%3E%3Cdefs%3E%3Cfilter id='b' x='-40%25' y='-40%25' width='180%25' height='180%25'%3E%3CfeGaussianBlur stdDeviation='8'/%3E%3C/filter%3E%3Cmask id='m'%3E%3Crect width='320' height='640' fill='white'/%3E%3Cg filter='url(%23b)'%3E%3Cpath d='M70 660 C 105 570, 118 505, 142 455 S 170 350, 160 292' stroke='black' stroke-width='60' stroke-linecap='round' fill='none'/%3E%3Ccircle cx='160' cy='282' r='48' fill='black'/%3E%3C/g%3E%3C/mask%3E%3C/defs%3E%3Crect width='320' height='640' fill='white' mask='url(%23m)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 640' preserveAspectRatio='none'%3E%3Cdefs%3E%3Cfilter id='b' x='-40%25' y='-40%25' width='180%25' height='180%25'%3E%3CfeGaussianBlur stdDeviation='8'/%3E%3C/filter%3E%3Cmask id='m'%3E%3Crect width='320' height='640' fill='white'/%3E%3Cg filter='url(%23b)'%3E%3Cpath d='M70 660 C 105 570, 118 505, 142 455 S 170 350, 160 292' stroke='black' stroke-width='60' stroke-linecap='round' fill='none'/%3E%3Ccircle cx='160' cy='282' r='48' fill='black'/%3E%3C/g%3E%3C/mask%3E%3C/defs%3E%3Crect width='320' height='640' fill='white' mask='url(%23m)'/%3E%3C/svg%3E");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}
/* game layer inside the phone — chests + puck sit ABOVE the fog (z > 3),
   exactly like the app, where markers render on top of the FogLayer */
.p-chest {
  position: absolute;
  --cs: 26px; width: 26px;
  transform: translate(-50%, -60%);
  z-index: 4;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
}
.p-puck {
  position: absolute; left: 50%; top: 44%;
  transform: translate(-50%, -50%);
  display: grid; place-items: center;
  z-index: 4;
}
.p-arrow {
  position: relative;
  width: 26px; height: 26px;
  color: var(--accent-strong);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}
.p-status {
  position: absolute; top: 0; left: 0; right: 0;
  height: 40px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  font-size: 0.72rem; font-weight: 600;
  color: #fff; z-index: 5;
}
.p-status .p-dot { width: 26px; height: 12px; border-radius: 3px; background: rgba(255,255,255,0.5); }
/* Top HUD — one row like the real screen: streak · chests (prominent) · area */
.p-hud {
  position: absolute; top: 46px; left: 10px; right: 10px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; z-index: 5;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px 7px 9px;
  border-radius: var(--r-pill);
  font-weight: 700; font-size: 0.86rem;
  color: #fff;
}
.chip .chest-mini { --cs: 18px; width: 18px; }
/* the chest counter pill is "prominent" (accent-tinted) in the app —
   image layer only, so the shared glass fill + blur stay underneath */
.chip-chest {
  background-image:
    linear-gradient(180deg, rgba(52, 199, 89, 0.32), rgba(52, 199, 89, 0.16));
}
.p-side {
  position: absolute; right: 12px; bottom: 92px;
  display: grid; gap: 10px; z-index: 5;
}
.p-round {
  width: 46px; height: 46px;
  border-radius: 16px;
  display: grid; place-items: center;
}
.p-nav {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  height: 60px;
  display: flex;
  padding: 6px;
  z-index: 5;
}
.p-tab {
  flex: 1;
  display: grid; place-items: center; gap: 2px;
  border-radius: var(--r-pill);
  font-size: 0.6rem;
  color: var(--ink-3);
}
.p-tab i { font-style: normal; }
/* Bottom-nav tab icons read larger, matching the real app's tab bar. */
.p-tab .ico { width: 26px; height: 26px; }
.p-tab.active {
  color: var(--accent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 26%, transparent), color-mix(in srgb, var(--accent) 12%, transparent));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
}

/* ---------------------------------------------------------------- loot ---- */
.loot-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.loot-card {
  --tint: var(--common);
  padding: 26px 22px 24px;
  border-radius: var(--r-lg);
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  /* FLAT rarity tint over the shared glass fill (the app's tinted-tile
     recipe — LootVisuals.tile(): colour at fixed alpha, no glows). Only the
     IMAGE layer is set so .glass keeps its translucent fill + backdrop blur. */
  background-image:
    linear-gradient(0deg, color-mix(in srgb, var(--tint) 16%, transparent),
      color-mix(in srgb, var(--tint) 16%, transparent));
  transition: transform 0.3s cubic-bezier(0.22,1,0.36,1), box-shadow 0.3s ease;
}
.loot-card[data-rarity="rare"]      { --tint: var(--rare); }
.loot-card[data-rarity="epic"]      { --tint: var(--epic); }
.loot-card[data-rarity="legendary"] { --tint: #FF9F1C; }
.loot-card:hover, .loot-card.open {
  transform: translateY(-6px);
  box-shadow: var(--glass-shadow),
    inset 0 0 0 1px color-mix(in srgb, var(--tint) 45%, transparent),
    0 30px 60px -24px rgba(0, 0, 0, 0.7);
}
.loot-chest {
  height: 128px;
  display: grid; place-items: center;
  margin-bottom: 12px;
}
.loot-chest .chest { --cs: 118px; }
.loot-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.28rem;
  /* card glass is always dark → tint toward white reads in both themes */
  color: color-mix(in srgb, var(--tint) 60%, #fff);
}
.loot-meta { margin-top: 8px; display: grid; gap: 5px; font-size: 0.86rem; color: var(--glass-ink-2); }
.loot-coins { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; color: var(--glass-ink); }
.loot-coins .coin-mini { --s: 15px; }
.loot-odds { font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.08em; color: color-mix(in srgb, var(--tint) 70%, #fff); }
.loot-hint {
  margin-top: 40px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}
/* coin burst particles */
.spark {
  position: absolute;
  width: 9px; height: 9px; border-radius: 50%;
  left: 50%; top: 42%;
  pointer-events: none;
  background: radial-gradient(circle at 40% 35%, #fff2b0, #f3b91f 60%, #c6871f);
  animation: spark var(--d, 700ms) cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
@keyframes spark {
  0% { transform: translate(-50%, -50%) scale(0.4); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1); opacity: 0; }
}

/* -------------------------------------------------------------- power ----- */
.power-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.pcard { padding: 28px 26px; border-radius: var(--r-lg); }
.pcard-ico { margin-bottom: 16px; }   /* bare glyph — no backing tile */
.pcard h3 { font-size: 1.34rem; margin-bottom: 8px; color: var(--glass-ink); }
.pcard p { color: var(--glass-ink-2); font-size: 0.97rem; }

/* ------------------------------------------------------------ features ---- */
.feat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.feat {
  padding: 28px 26px;
  border-radius: var(--r-card);
}
.feat h3 { font-size: 1.18rem; margin-bottom: 8px; color: var(--glass-ink); }
.feat h3::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px; margin-right: 9px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
}
.feat p { color: var(--glass-ink-2); font-size: 0.96rem; }

/* ---------------------------------------------------------------- cta ----- */
.cta {
  position: relative;
  text-align: center;
  overflow: hidden;
  border-top: 1px solid var(--hairline);
}
.cta-fog {
  position: absolute; inset: 0;
  z-index: 0;
  background:
    radial-gradient(60% 80% at 50% 120%, rgba(255, 255, 255, 0.05), transparent 70%),
    radial-gradient(50% 60% at 50% -10%, rgba(255, 255, 255, 0.04), transparent 70%);
  pointer-events: none;
}
.cta-inner { position: relative; z-index: 1; display: grid; justify-items: center; }
.cta-mark {
  width: 108px; height: 108px;
  display: grid; place-items: center;
  border-radius: 30px;
  overflow: hidden;
  margin-bottom: 26px;
  background: linear-gradient(160deg, #2ee06a, var(--accent-deep));
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.4);
}
.cta-mark .ico { color: #fff; }
.cta-mark-img { width: 100%; height: 100%; display: block; object-fit: cover; }
.cta h2 { font-size: clamp(2rem, 3.7vw, 4.4rem); }
.cta > .wrap > p, .cta-inner p { margin: 1.2rem 0 2rem; color: var(--ink-2); font-size: 1.14rem; max-width: 44ch; }
.cta .hero-cta { justify-content: center; }

/* -------------------------------------------------------------- footer ---- */
.footer {
  border-top: 1px solid var(--hairline);
  padding-top: 46px;
  padding-bottom: calc(46px + env(safe-area-inset-bottom));
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px 40px;
  justify-content: space-between;
}
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand .brand-mark { width: 42px; height: 42px; border-radius: 13px; }
.footer-brand .ico { width: 24px; height: 24px; }
.footer-brand b { display: block; font-family: var(--font-display); font-size: 1.1rem; }
.footer-brand span { color: var(--ink-2); font-size: 0.9rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 22px; color: var(--ink-2); font-size: 0.94rem; }
.footer-links a {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 4px 2px;   /* comfortable tap target */
}
.footer-links a:hover { color: var(--ink); }
.footer-legal { color: var(--ink-2); font-size: 0.86rem; width: 100%; }

/* =========================================================== RESPONSIVE === */
/* Short viewports (768p laptops, small browser windows): compact the hero so
   the panel + store badges always fit inside the first screen. */
@media (min-width: 561px) and (max-height: 820px) {
  .hero-content { padding-top: 88px; padding-bottom: clamp(20px, 4vh, 44px); }
  .hero-panel { padding: 20px 30px 24px; }
  .hero-title { font-size: clamp(2.1rem, 4.1vw, 4.4rem); }
  html[lang="ru"] .hero-title { font-size: clamp(1.7rem, 3vw, 3.3rem); }
  .hero-sub { margin-top: 1rem; }
  .hero-cta { margin-top: 1.5rem; }
}
@media (max-width: 940px) {
  .nav-links { display: none; }
  /* nav-links carried the right-anchor; with it hidden, pin the controls right */
  .lang-toggle { margin-left: auto; }
  .showcase-grid { grid-template-columns: 1fr; }
  .phone-wrap { order: -1; }
  .steps { grid-template-columns: 1fr; }
  .loot-grid { grid-template-columns: repeat(2, 1fr); }
  .power-grid { grid-template-columns: repeat(2, 1fr); }
  .feat-grid { grid-template-columns: 1fr 1fr; }

  /* Perf: a dozen live-blurred panes (loot/power/feature/step cards) is the
     main scroll-jank source on phones. Drop the backdrop blur on content
     panes here and fall back to the solid fill — exactly what the app ships
     to no-blur devices. Only the nav + hero (.glass-live) keep the blur, so
     at most two blurred layers composite per frame. The loot rarity tint
     (a background-IMAGE) survives; only the fill colour is overridden. */
  .glass:not(.glass-live) {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background-color: var(--glass-fill-solid);
  }
}
@media (max-width: 560px) {
  /* tighter rhythm — desktop-scale section gaps read as huge voids on 375px */
  :root { --gutter: 18px; --section-y: clamp(44px, 7vh, 64px); }
  .section-head { margin-bottom: 26px; }
  .section-head p { margin-top: 0.8rem; }
  .nav { padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 10px; }
  .nav-cta { display: none; }
  .nav-inner { padding-right: 18px; }
  /* hero: centre the panel instead of pinning it to the bottom */
  .hero { align-items: center; }
  .hero-content { padding-top: 92px; padding-bottom: 72px; }
  .hero-panel { padding: 22px 18px 20px; }
  .hero-title { font-size: clamp(2.2rem, 11vw, 3.2rem); }
  /* store badges stack full-width — side-by-side they broke the labels */
  .hero-cta { flex-direction: column; align-items: stretch; gap: 10px; }
  .store-badge { flex: none; justify-content: center; }
  .loot-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .loot-card { padding: 22px 14px 20px; }
  .loot-chest .chest { --cs: 92px; }
  .loot-chest { height: 100px; }
  /* keep long rarity names ("Легендарный") on one line inside the narrow
     2-up card down to 360px; break-word is a last-resort safety net */
  .loot-name { font-size: 1.06rem; overflow-wrap: break-word; }
  html[lang="ru"] .loot-name { font-size: 0.82rem; letter-spacing: -0.03em; }
  .power-grid { grid-template-columns: 1fr; }
  .feat-grid { grid-template-columns: 1fr; }
  .showcase-stats { gap: 20px; margin-top: 1.6rem; }
}

