/* ============================================================
   Zen Unscramble — landing site
   Deep cosmic-forest night · glass · gold dust · the snap
   ============================================================ */

:root {
  --bg-0: #070312;
  --bg-1: #0d0724;
  --bg-2: #041018;
  --ink: #f2ecff;
  --ink-muted: #a89ec4;
  --ink-faint: #8d84ad; /* AA on the glass panels — #6f6590 measured 3.0-3.8:1 */
  --gold: #ffd98a;
  --gold-deep: #f5a95c;
  --violet: #b490ff;
  --teal: #7fd8c9;
  --rose: #ff9db8;
  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(255, 255, 255, 0.09);
  --edge: rgba(255, 255, 255, 0.13);
  --edge-soft: rgba(255, 255, 255, 0.08);
  --font-display: "Cinzel", "Georgia", serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 22px;
  --shadow: 0 24px 60px rgba(2, 0, 12, 0.55);
  --maxw: 1160px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  font-family: var(--font-body);
  background: var(--bg-0);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(255, 217, 138, 0.35); }

/* ---------------- Sky / backdrop ---------------- */

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 90% at 80% -10%, #1b0f3f 0%, transparent 55%),
    radial-gradient(110% 80% at 10% 0%, #0e2a33 0%, transparent 50%),
    radial-gradient(140% 120% at 50% 120%, #120b2e 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 55%, var(--bg-2) 100%);
  overflow: hidden;
}

.aurora {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  mix-blend-mode: screen;
  animation: drift-aurora 26s ease-in-out infinite alternate;
}
.aurora-a { top: -25vmax; left: -12vmax; background: radial-gradient(circle, #4a2d9b 0%, transparent 62%); }
.aurora-b { top: -18vmax; right: -18vmax; background: radial-gradient(circle, #0f5f63 0%, transparent 60%); animation-delay: -9s; animation-duration: 31s; }
.aurora-c { bottom: -30vmax; left: 22vw; background: radial-gradient(circle, #7a3d78 0%, transparent 65%); opacity: 0.22; animation-delay: -17s; animation-duration: 37s; }

@keyframes drift-aurora {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(6vmax, 4vmax, 0) scale(1.15); }
}

#dust { position: absolute; inset: 0; width: 100%; height: 100%; }

.forest {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  width: 100%;
  height: clamp(90px, 16vh, 220px);
  opacity: 0.9;
}

/* ---------------- Glass primitive ---------------- */

.glass {
  background: linear-gradient(160deg, var(--glass-strong), var(--glass));
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

/* ---------------- Nav ---------------- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  transition: background 0.35s ease, box-shadow 0.35s ease, backdrop-filter 0.35s ease;
}
.nav.scrolled {
  background: rgba(9, 4, 24, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.fox-mark { display: inline-flex; width: 36px; height: 36px; filter: drop-shadow(0 0 12px rgba(233, 108, 74, 0.45)); }
.fox-mark svg,
.fox-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.nav-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: linear-gradient(100deg, var(--gold), #fff2d4 50%, var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 30px); }
.nav-links a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}
.nav-links a:hover { color: var(--gold); text-shadow: 0 0 18px rgba(255, 217, 138, 0.6); }
.nav-links a.nav-cta {
  color: #14092b;
  background: linear-gradient(120deg, var(--gold), var(--gold-deep));
  padding: 9px 18px;
  border-radius: 999px;
  box-shadow: 0 0 22px rgba(255, 195, 110, 0.35);
}
.nav-links a.nav-cta:hover { text-shadow: none; box-shadow: 0 0 34px rgba(255, 195, 110, 0.6); }

.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: var(--glass);
  border: 1px solid var(--edge);
  border-radius: 12px;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
}
.nav-burger span { display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--gold); transition: transform 0.3s ease, opacity 0.3s ease; }
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------------- Buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 14px 26px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, background 0.25s ease;
  will-change: transform;
}
.btn:active { transform: scale(0.97); }
.btn-gold {
  color: #14092b;
  background: linear-gradient(120deg, var(--gold) 0%, var(--gold-deep) 100%);
  box-shadow: 0 0 28px rgba(255, 195, 110, 0.4), 0 10px 26px rgba(0, 0, 0, 0.35);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 0 44px rgba(255, 195, 110, 0.65), 0 14px 30px rgba(0, 0, 0, 0.4); }
.btn-ghost {
  color: var(--ink);
  background: var(--glass);
  border: 1px solid var(--edge);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover { transform: translateY(-2px); border-color: rgba(255, 217, 138, 0.5); box-shadow: 0 0 26px rgba(255, 217, 138, 0.18); }
.btn-small { padding: 11px 20px; font-size: 13.5px; }
.btn-disabled { opacity: 0.55; cursor: default; pointer-events: none; }

/* ---------------- Hero ---------------- */

.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(110px, 16vh, 170px) clamp(18px, 4vw, 40px) clamp(40px, 7vh, 80px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
/* The board carries an explicit pixel width, and a grid item defaults to
   min-width:auto — without this it widens its own column and blows the page
   out sideways instead of shrinking the tiles. */
.hero > * { min-width: 0; }

.eyebrow {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 0 22px rgba(255, 217, 138, 0.55);
  margin-bottom: 18px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(40px, 5.6vw, 72px);
  line-height: 1.04;
  letter-spacing: 0.02em;
  background: linear-gradient(165deg, #fff6df 8%, var(--gold) 45%, var(--gold-deep) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 34px rgba(255, 200, 120, 0.28));
  margin-bottom: 22px;
}

.hero-sub {
  font-size: clamp(15.5px, 1.6vw, 18px);
  color: var(--ink-muted);
  max-width: 46ch;
  margin-bottom: 30px;
}
.hero-sub strong { color: var(--gold); font-weight: 800; }

.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.hero-badges { font-size: 13px; color: var(--ink-faint); letter-spacing: 0.02em; }

/* ---------------- Daily challenge panel ---------------- */

.daily-wrap { position: relative; }

.daily {
  position: relative;
  padding: clamp(22px, 3vw, 32px);
  border-radius: 28px;
  overflow: hidden;
}
.daily::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 29px;
  padding: 1px;
  background: linear-gradient(140deg, rgba(255, 217, 138, 0.55), rgba(180, 144, 255, 0.25) 40%, transparent 70%, rgba(127, 216, 201, 0.35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.daily-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}
.daily-title {
  font-family: var(--font-display);
  font-size: clamp(21px, 2.4vw, 27px);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.daily-sub { font-size: 12.5px; color: var(--ink-faint); margin-bottom: 20px; }

/* ============================================================
   THE BOARD — the app's own play surface, ported 1:1.

   Midnight theme (src/theme/themes.ts), candy tiles derived from its
   accent (paletteFor), stencil letters (StencilFace), one row of
   absolutely-positioned tiles you DRAG to rearrange (LetterTile).
   Numbers straight from the app: LAYOUT.gap 12 / maxTile 74 / minTile 44,
   soft shape radius 0.26×, letter 0.42×, stencil cutout 0.62×,
   pick-up scale 1.12 with a -10 lift, spring damping 18 / stiffness 180.
   ============================================================ */

.zen-midnight {
  --zbg-0: #0d1126;
  --zbg-1: #131a40;
  --zbg-2: #111838;
  --zcard-border: #2d3564;
  --zaccent: #6f8cff;
  --ztext: #ebeeff;
  --zmuted: #8289b0;
  --zlock: #14324a;
  --zlock-text: #6fe0c0;
  --zlock-border: #2a6b70;
  background: linear-gradient(180deg, var(--zbg-0) 0%, var(--zbg-1) 58%, var(--zbg-2) 100%);
  border: 1px solid var(--zcard-border);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
/* The card's edge-light follows the theme accent, not the site's gold. */
.zen-midnight::before {
  background: linear-gradient(140deg, rgba(111, 140, 255, 0.6), rgba(111, 224, 192, 0.22) 45%, transparent 72%, rgba(111, 140, 255, 0.35));
}
.zen-midnight .daily-eyebrow { color: var(--zaccent); }
.zen-midnight .daily-title { color: var(--ztext); }
.zen-midnight .daily-sub,
.zen-midnight .daily-msg { color: var(--zmuted); }
.zen-midnight .daily-msg.glow { color: var(--zlock-text); text-shadow: 0 0 18px rgba(111, 224, 192, 0.5); }
.zen-midnight .result-word {
  background: linear-gradient(120deg, #ffffff, var(--zlock-text) 55%, var(--zaccent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 26px rgba(111, 140, 255, 0.5));
}
.zen-midnight .result-meaning { color: var(--zmuted); }
.zen-midnight .result-stats { color: var(--zlock-text); }
.zen-midnight .result-note { color: var(--zmuted); }

/* --ts (tile size) and --tg (gap) are set by JS from the word length. */
.daily-board { --ts: 60px; --tg: 12px; }

.zen-instruct {
  text-align: center;
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--zmuted);
  margin-bottom: 16px;
}

.zboard {
  position: relative;
  height: var(--ts);
  margin: 0 auto 20px;
  /* pan-y keeps vertical page scrolling alive while horizontal drags reorder. */
  touch-action: pan-y;
}

.ztile {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--ts);
  height: var(--ts);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
  border-radius: calc(var(--ts) * 0.26);
  /* The app's resting depth — one fixed shadow, never animated. */
  box-shadow: 0 6px 6px rgba(0, 0, 0, 0.3);
  transition: translate 0.34s cubic-bezier(0.22, 1.15, 0.36, 1),
              transform 0.34s cubic-bezier(0.22, 1.15, 0.36, 1);
  will-change: translate;
}
.ztile svg { display: block; width: 100%; height: 100%; }
.ztile.dragging { transition: none; cursor: grabbing; z-index: 100; }
.ztile:focus-visible { outline: 2px solid var(--zlock-text); outline-offset: 3px; }

/* Locked (Place) and marked (Check) wear the theme's locked colours and a
   plain letter — the app drops the stencil cutout for these. */
.ztile.zlocked {
  background: var(--zlock);
  border: 1px solid var(--zlock-border);
  color: var(--zlock-text);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: calc(var(--ts) * 0.42);
  letter-spacing: 0.5px;
  box-shadow: 0 6px 6px rgba(0, 0, 0, 0.3), 0 0 18px rgba(111, 224, 192, 0.18);
}
.ztile.pinned { cursor: default; }

.ztile.win {
  animation: ztile-pop 0.55s cubic-bezier(0.22, 1.4, 0.36, 1) both;
  box-shadow: 0 6px 6px rgba(0, 0, 0, 0.3), 0 0 30px rgba(111, 140, 255, 0.7);
}
/* Scale/rotate only — the tile's position lives in `translate`, so the pop
   composes with it instead of having to restate it. */
@keyframes ztile-pop {
  0% { scale: 1; rotate: 0deg; }
  45% { scale: 1.18; rotate: -3deg; }
  100% { scale: 1; rotate: 0deg; }
}

.daily-msg { text-align: center; font-size: 13px; min-height: 20px; color: var(--ink-muted); margin-bottom: 14px; }
.daily-msg.glow { color: var(--gold); text-shadow: 0 0 16px rgba(255, 217, 138, 0.5); }

/* Board action pills. Named `zpu`, not `pu` — `.pu` is already the How-to-Play
   power-up chip, and one class doing both jobs made each fight the other. */
.daily-tools { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; }
.zpu {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ztext, var(--ink-muted));
  background: rgba(111, 140, 255, 0.1);
  border: 1px solid var(--zcard-border, var(--edge-soft));
  border-radius: 999px;
  padding: 11px 17px;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease, background 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
.zpu:hover {
  background: rgba(111, 140, 255, 0.18);
  border-color: var(--zaccent);
  box-shadow: 0 0 18px rgba(111, 140, 255, 0.25);
  transform: translateY(-1px);
}
.zpu:disabled { opacity: 0.4; cursor: default; transform: none; box-shadow: none; }
.zpu-glyph {
  /* System font — Manrope has no glyph for ⟲ and shows tofu on Android. */
  font-family: system-ui, -apple-system, "Segoe UI Symbol", sans-serif;
  font-size: 14px;
  color: var(--zaccent);
}

.daily-clue {
  margin-top: 14px;
  text-align: center;
  font-size: 13.5px;
  color: var(--teal);
  font-style: italic;
}

/* Result state */
.daily-result { text-align: center; padding-top: 6px; }
.result-word {
  font-family: var(--font-display);
  font-size: clamp(30px, 5vw, 40px);
  font-weight: 900;
  letter-spacing: 0.22em;
  background: linear-gradient(120deg, #fff6df, var(--gold) 60%, var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 26px rgba(255, 205, 125, 0.45));
  margin-bottom: 8px;
}
.result-meaning { color: var(--ink-muted); font-size: 14.5px; max-width: 40ch; margin: 0 auto 16px; }
.result-stats { font-size: 14px; font-weight: 700; color: var(--gold); margin-bottom: 18px; }
.result-dot { color: var(--ink-faint); margin: 0 8px; }
.result-ctas { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.result-note { font-size: 12px; color: var(--ink-faint); }
.result-note strong { color: var(--ink-muted); }

.daily-foot {
  text-align: center;
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 14px;
  letter-spacing: 0.03em;
}

/* Sparkle particles on win */
.sparkle {
  position: fixed;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 90;
  animation: sparkle-fly 0.9s cubic-bezier(0.2, 0.7, 0.4, 1) forwards;
}
@keyframes sparkle-fly {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--sx), var(--sy)) scale(0); opacity: 0; }
}

/* ---------------- Stat ribbon ---------------- */

.ribbon {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 8px clamp(18px, 4vw, 40px) 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(20px, 5vw, 70px);
}
.ribbon-item { text-align: center; }
.ribbon-item strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 26px rgba(255, 217, 138, 0.4);
  line-height: 1.1;
}
.ribbon-item span { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-faint); }

/* ---------------- Sections ---------------- */

.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(64px, 10vh, 110px) clamp(18px, 4vw, 40px) 0;
}

.section-eyebrow {
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--violet);
  text-shadow: 0 0 20px rgba(180, 144, 255, 0.5);
  margin-bottom: 12px;
}
.section-title {
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(28px, 4.4vw, 46px);
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 16px;
}
.section-sub {
  text-align: center;
  color: var(--ink-muted);
  max-width: 62ch;
  margin: 0 auto 46px;
  font-size: 15.5px;
}

/* ---------------- Mode cards (3D) ---------------- */

.modes-grid {
  margin-top: 42px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  perspective: 1200px;
}
.mode-card {
  position: relative;
  padding: 26px 24px 24px;
  transform-style: preserve-3d;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease;
  overflow: hidden;
}
.mode-card::after {
  /* glare sweep driven by JS via --mx / --my */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.1), transparent 45%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.mode-card:hover { border-color: color-mix(in srgb, var(--glow) 55%, transparent); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), 0 0 42px color-mix(in srgb, var(--glow) 22%, transparent); }
.mode-card:hover::after { opacity: 1; }

.mode-glyph {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 27px;
  margin-bottom: 16px;
  background: color-mix(in srgb, var(--glow) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--glow) 32%, transparent);
  color: var(--glow);
  text-shadow: 0 0 18px color-mix(in srgb, var(--glow) 75%, transparent);
  transform: translateZ(34px);
}
.mode-card h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 5px;
  transform: translateZ(26px);
}
.mode-tag {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--glow);
  margin-bottom: 12px;
  transform: translateZ(20px);
}
.mode-body { font-size: 14px; color: var(--ink-muted); margin-bottom: 14px; transform: translateZ(14px); }
.mode-chip {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--edge-soft);
  border-radius: 999px;
  padding: 6px 12px;
  transform: translateZ(14px);
}
.mode-list { list-style: none; font-size: 13.5px; color: var(--ink-muted); display: grid; gap: 8px; transform: translateZ(14px); }
.mode-list strong { color: var(--ink); }
.mode-wide { grid-column: 1 / -1; }
@media (min-width: 861px) {
  .mode-wide { display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 26px; padding: 24px 30px; }
  .mode-wide .mode-glyph { margin-bottom: 0; }
  .mode-wide h3 { grid-column: 2; margin-bottom: 2px; }
  .mode-wide .mode-tag { grid-column: 2; margin-bottom: 6px; }
  .mode-wide .mode-body { grid-column: 2; margin-bottom: 0; }
  .mode-wide .mode-chip { grid-column: 3; grid-row: 1 / span 3; align-self: center; }
}

/* ---------------- Lore ---------------- */

.lore { text-align: center; }
.lore-fox { display: flex; justify-content: center; margin-bottom: 18px; }
.lore-fox img,
.lore-fox svg {
  width: clamp(84px, 12vw, 112px);
  height: auto;
  filter: drop-shadow(0 0 34px rgba(233, 108, 74, 0.5));
  animation: fox-float 5s ease-in-out infinite alternate;
}
@keyframes fox-float {
  from { transform: translateY(0); }
  to { transform: translateY(-10px); }
}
.lore-lead {
  max-width: 66ch;
  margin: 0 auto 44px;
  color: var(--ink-muted);
  font-size: clamp(15.5px, 1.7vw, 17.5px);
}
.lore-beats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-bottom: 26px;
  text-align: left;
}
.lore-beat { padding: 26px 24px; }
.lore-glyph { font-size: 30px; margin-bottom: 12px; filter: drop-shadow(0 0 16px rgba(255, 217, 138, 0.4)); }
.lore-beat h3 { font-family: var(--font-display); font-size: 19px; letter-spacing: 0.05em; margin-bottom: 8px; }
.lore-beat p { font-size: 14px; color: var(--ink-muted); }

.lore-ranks { padding: 24px 26px; }
.lore-ranks-title { font-size: 12px; font-weight: 800; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 12px; }
.lore-ranks-path { font-size: 15px; font-weight: 700; color: var(--ink-muted); line-height: 2; }
.rk { padding: 3px 12px; border-radius: 999px; border: 1px solid; margin: 0 2px; white-space: nowrap; }
.rk-bronze { color: #e0a878; border-color: rgba(224, 168, 120, 0.5); }
.rk-silver { color: #cfd6e4; border-color: rgba(207, 214, 228, 0.45); }
.rk-gold { color: var(--gold); border-color: rgba(255, 217, 138, 0.5); }
.rk-plat { color: #b8ecf0; border-color: rgba(184, 236, 240, 0.45); }
.rk-emerald { color: #8fe6b0; border-color: rgba(143, 230, 176, 0.5); }
.rk-diamond { color: #9fd0ff; border-color: rgba(159, 208, 255, 0.5); text-shadow: 0 0 14px rgba(159, 208, 255, 0.6); }
.rk-legend { display: block; margin-top: 8px; color: var(--gold); text-shadow: 0 0 18px rgba(255, 217, 138, 0.5); }

/* ---------------- Features ---------------- */

.features-grid {
  margin-top: 42px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.feature { padding: 24px 22px; transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s ease, box-shadow 0.3s ease; }
.feature:hover { transform: translateY(-6px); border-color: rgba(255, 217, 138, 0.4); box-shadow: 0 26px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 217, 138, 0.12); }
.f-ico { font-size: 26px; display: block; margin-bottom: 12px; filter: drop-shadow(0 0 14px rgba(255, 217, 138, 0.35)); }
.feature h3 { font-size: 15.5px; font-weight: 800; margin-bottom: 7px; letter-spacing: 0.01em; }
.feature p { font-size: 13px; color: var(--ink-muted); }

/* ---------------- Steps ---------------- */

.steps {
  margin-top: 42px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  counter-reset: step;
}
.step { position: relative; padding: 26px 22px 24px; }
.step-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: #14092b;
  background: linear-gradient(130deg, var(--gold), var(--gold-deep));
  box-shadow: 0 0 22px rgba(255, 195, 110, 0.4);
  margin-bottom: 14px;
}
.step h3 { font-size: 16px; font-weight: 800; margin-bottom: 7px; }
.step p { font-size: 13.5px; color: var(--ink-muted); }

/* ---------------- How to play ---------------- */

.htp { margin-top: 42px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 22px; }
.htp-rules { padding: 30px 28px; }
.htp-rules h3 { font-family: var(--font-display); font-size: 18px; letter-spacing: 0.05em; margin-bottom: 10px; }
.htp-rules h3:not(:first-child) { margin-top: 24px; }
.htp-rules p { font-size: 14px; color: var(--ink-muted); }
.pu-list { list-style: none; margin: 14px 0 0; display: grid; gap: 10px; font-size: 14px; color: var(--ink-muted); }
.pu-list li { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pu {
  display: inline-block;
  flex-shrink: 0;
  min-width: 108px;
  font-weight: 800;
  color: var(--gold);
  background: rgba(255, 217, 138, 0.08);
  border: 1px solid rgba(255, 217, 138, 0.25);
  border-radius: 999px;
  padding: 3px 12px;
  margin-right: 8px;
  text-align: center;
}
.htp-note { margin-top: 18px; font-size: 13px; color: var(--ink-faint); font-style: italic; }
.etiquette { list-style: none; display: grid; gap: 14px; font-size: 14px; color: var(--ink-muted); }
.etiquette strong { color: var(--gold); }

/* ---------------- FAQ ---------------- */

.faq-list { margin-top: 42px; max-width: 780px; margin-left: auto; margin-right: auto; display: grid; gap: 12px; }
.faq { padding: 0; overflow: hidden; }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 22px;
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  transition: color 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "✦";
  color: var(--gold);
  font-size: 14px;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), text-shadow 0.3s ease;
  flex-shrink: 0;
}
.faq[open] summary { color: var(--gold); }
.faq[open] summary::after { transform: rotate(135deg); text-shadow: 0 0 16px rgba(255, 217, 138, 0.7); }
.faq p { padding: 0 22px 20px; font-size: 14px; color: var(--ink-muted); }
.faq a { color: var(--teal); }

/* ---------------- Download ---------------- */

.dl { padding-bottom: clamp(70px, 12vh, 130px); }
.dl-card {
  text-align: center;
  padding: clamp(40px, 6vw, 64px) clamp(22px, 5vw, 60px);
  position: relative;
  overflow: hidden;
}
.dl-card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 50% 120%, rgba(255, 195, 110, 0.16), transparent 55%);
  pointer-events: none;
}
.dl-title { font-family: var(--font-display); font-size: clamp(28px, 4.4vw, 44px); font-weight: 700; margin-bottom: 10px; }
.dl-sub { color: var(--ink-muted); margin-bottom: 28px; font-size: 15.5px; }
.dl-ctas { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; position: relative; }

/* ---------------- Footer ---------------- */

.footer {
  border-top: 1px solid var(--edge-soft);
  background: rgba(4, 2, 12, 0.75);
  backdrop-filter: blur(14px);
  padding: 50px clamp(18px, 4vw, 40px) 26px;
}
.footer-grid {
  max-width: var(--maxw);
  margin: 0 auto 36px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 34px;
}
.footer-name { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 6px; }
.footer-tag { font-size: 13px; color: var(--ink-faint); margin-bottom: 12px; }
.footer-lockup {
  display: block;
  width: 108px;
  height: auto;
  filter: drop-shadow(0 0 18px rgba(233, 108, 74, 0.3));
}
.footer-col { display: grid; gap: 10px; align-content: start; }
.footer-col h4 { font-size: 12px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 4px; }
.footer-col a { color: var(--ink-muted); text-decoration: none; font-size: 14px; width: fit-content; padding: 5px 0; transition: color 0.25s ease, text-shadow 0.25s ease; }
.footer-col a:hover { color: var(--gold); text-shadow: 0 0 16px rgba(255, 217, 138, 0.5); }
.footer-fine { text-align: center; font-size: 12.5px; color: var(--ink-faint); }

/* ---------------- Legal / subpages ---------------- */

.page {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(120px, 18vh, 170px) clamp(18px, 4vw, 40px) clamp(70px, 10vh, 110px);
}
.page-card { padding: clamp(28px, 5vw, 48px); }
.page h1 { font-family: var(--font-display); font-size: clamp(28px, 4.5vw, 40px); font-weight: 700; margin-bottom: 8px; }
.page .page-updated { font-size: 13px; color: var(--ink-faint); margin-bottom: 28px; }
.page h2 { font-family: var(--font-display); font-size: 20px; letter-spacing: 0.04em; margin: 30px 0 10px; color: var(--gold); }
.page p, .page li { font-size: 14.5px; color: var(--ink-muted); }
.page ul { padding-left: 22px; margin: 10px 0; display: grid; gap: 8px; }
.page a { color: var(--teal); }
.page .page-back { display: inline-block; margin-bottom: 22px; color: var(--gold); text-decoration: none; font-weight: 700; font-size: 14px; }

/* ---------------- Reveal on scroll ---------------- */

.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------------- Responsive ---------------- */

@media (max-width: 1024px) {
  .modes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .features-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 104px; text-align: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-ctas { justify-content: center; }
  .daily-wrap { max-width: 560px; margin: 0 auto; width: 100%; }
  .htp { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  /* Phones: the animated backdrop makes every backdrop-filter surface re-blur
     each frame. Swap live blur for a near-opaque tint (reads the same on this
     dark scene) and let the aurora hold still. */
  .glass,
  .btn-ghost {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: linear-gradient(160deg, rgba(32, 23, 58, 0.88), rgba(15, 10, 32, 0.9));
  }
  .nav.scrolled {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(9, 4, 24, 0.94);
  }
  .footer { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(4, 2, 12, 0.94); }
  .aurora { animation: none; }
  .nav-links {
    position: fixed;
    top: 66px;
    right: 12px;
    left: 12px;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 4px;
    background: rgba(10, 5, 26, 0.92);
    border: 1px solid var(--edge);
    border-radius: 20px;
    padding: 14px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .nav-links a { padding: 11px; font-size: 15px; }
  .nav-links.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav-burger { display: flex; }
  .lore-beats { grid-template-columns: 1fr; }
  .mode-wide { grid-column: auto; }
}

@media (max-width: 420px) {
  /* Give the board back every pixel the chrome was taking — a 7-letter word
     on a 320px phone is the case that decides how big the tiles can be. */
  .hero { padding-left: 12px; padding-right: 12px; }
  .daily { padding: 18px 13px; }
  .daily-tools { gap: 7px; }
  .zpu { padding: 11px 13px; font-size: 12px; }
}

@media (max-width: 560px) {
  .modes-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .hero-title { font-size: clamp(40px, 12vw, 54px); }
  .btn { padding: 13px 20px; font-size: 14px; }
  .ribbon { gap: 22px; }
}

/* ---------------- Reduced motion ---------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .aurora, .lore-fox svg { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .ztile, .btn, .feature, .mode-card { transition: none; }
  .ztile.win { animation: none; }
  .sparkle { display: none; }
}
