/* ============================================================
   EVER AFTER GAMES — "Once upon a game"
   Two worlds: dark = cyberpunk neon night
               light = fairytale dawn (Rapunzel's tower, briar roses)
   Design from the Claude Design handoff (2026-06-12).
   ============================================================ */

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

html { scroll-behavior: smooth; }

:root {
  --motion: 0.7;
  --glow: 0.6;
  --font-ui: "Sora", system-ui, sans-serif;
}

/* ---------------- DARK · NEON NIGHT ---------------- */
[data-theme="dark"] {
  color-scheme: dark;
  --font-display: "Chakra Petch", sans-serif;
  --font-kicker: "Chakra Petch", monospace;
  --display-weight: 700;
  --display-tracking: 0em;
  --display-case: uppercase;
  --display-lh: 0.98;
  --kicker-tracking: 0.26em;
  --kicker-case: uppercase;

  --bg: #08060f;
  --bg-2: #0e0a1e;
  --ink: #efeaff;
  --muted: #9d94c6;
  --line: rgba(155, 135, 255, 0.16);
  --line-strong: rgba(155, 135, 255, 0.34);
  --surface: rgba(155, 135, 255, 0.06);

  --acc: var(--neon, #00ff85);
  --acc-soft: rgba(0, 255, 133, 0.45);
  --acc2: #45e3ff;
  --acc2-soft: rgba(69, 227, 255, 0.4);
  --btn-ink: #0b0716;
  --btn-r: 10px;
  --tag-r: 6px;

  --nav-bg: rgba(8, 6, 15, 0.7);
  --marquee-bg: rgba(14, 10, 30, 0.6);
  --footer-bg: var(--bg-2);

  --card-r: 16px;
  --card-bg: linear-gradient(160deg, #151031, #0c081c 65%);
  --card-line: rgba(155, 135, 255, 0.25);
  --card-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.9);
  --card-shadow-hover: 0 24px 70px -24px rgba(0, 0, 0, 0.9),
                       0 0 calc(60px * var(--glow, 0.6)) var(--acc-soft);
  --shine: rgba(255, 255, 255, 0.1);

  --logo-fx: drop-shadow(0 0 calc(26px * var(--glow, 0.6)) rgba(0, 255, 133, 0.45));
  --logo-fx-hover: drop-shadow(0 0 calc(42px * var(--glow, 0.6)) rgba(69, 227, 255, 0.55));

  --sign-fill: linear-gradient(100deg, var(--acc), var(--acc2));

  /* ---- Legacy token bridge (old dark-fantasy components) ---- */
  --bg-0: #08060f;
  --bg-1: #0b0816;
  --bg-3: #151031;
  --bg-4: #1e1840;
  --line-1: rgba(155, 135, 255, 0.16);
  --line-2: rgba(155, 135, 255, 0.34);
  --line-soft: rgba(155, 135, 255, 0.08);
  --ink-0: #f6f2ff;
  --ink-1: #efeaff;
  --ink-2: #cfc7ef;
  --ink-3: #9d94c6;
  --ink-4: #7d74a8;
  --ink-5: #564e7e;
  --crimson: #00ff85;
  --crimson-hi: #4dffa3;
  --crimson-dim: #00a857;
  --crimson-glow: rgba(0, 255, 133, 0.45);
  --ember: #ffb86b;
  --ember-glow: rgba(255, 184, 107, 0.4);
  --gold: #45e3ff;
  --gold-hi: #7cecff;
  --gold-dim: rgba(69, 227, 255, 0.45);
  --rare-common: #9d94c6;
  --rare-rare: #4fa3d1;
  --rare-epic: #a266d9;
  --rare-legendary: #45e3ff;
  --online: #4fd18a;
  --away: #e6bd63;
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px;
  --f-display: var(--font-display);
  --f-ui: var(--font-ui);
  --f-mono: "Chakra Petch", ui-monospace, monospace;
  --btn-grad: linear-gradient(180deg, #4dffa3, #00ff85);
}

/* ---------------- LIGHT · FAIRYTALE DAWN ---------------- */
[data-theme="light"] {
  color-scheme: light;
  --font-display: "Cormorant Garamond", serif;
  --font-kicker: "Cormorant Garamond", serif;
  --display-weight: 600;
  --display-tracking: -0.01em;
  --display-case: none;
  --display-lh: 1.12;
  --kicker-tracking: 0.14em;
  --kicker-case: uppercase;

  --bg: #f9f1e5;
  --bg-2: #f3e6d8;
  --ink: #43304a;
  --muted: #8b7191;
  --line: rgba(110, 70, 110, 0.16);
  --line-strong: rgba(110, 70, 110, 0.32);
  --surface: rgba(255, 255, 255, 0.55);

  --acc: #a84390;
  --acc-soft: rgba(168, 67, 144, 0.35);
  --acc2: #b8862e;
  --acc2-soft: rgba(184, 134, 46, 0.45);
  --btn-ink: #fffaf2;
  --btn-r: 999px;
  --tag-r: 999px;

  --nav-bg: rgba(249, 241, 229, 0.72);
  --marquee-bg: rgba(255, 250, 242, 0.6);
  --footer-bg: var(--bg-2);

  --card-r: 26px;
  --card-bg: linear-gradient(165deg, #fffdf8, #fdf3e4);
  --card-line: rgba(184, 134, 46, 0.35);
  --card-shadow: 0 30px 60px -34px rgba(110, 60, 90, 0.35);
  --card-shadow-hover: 0 36px 70px -30px rgba(110, 60, 90, 0.45);
  --shine: rgba(255, 240, 200, 0.55);

  --logo-fx: drop-shadow(0 18px 30px rgba(168, 67, 144, 0.28));
  --logo-fx-hover: drop-shadow(0 22px 38px rgba(168, 67, 144, 0.4));

  --sign-fill: linear-gradient(100deg, #a84390, #b8862e);

  /* ---- Legacy token bridge ---- */
  --bg-0: #f9f1e5;
  --bg-1: #f9f1e5;
  --bg-3: #fffdf8;
  --bg-4: #f3e6d8;
  --line-1: rgba(110, 70, 110, 0.16);
  --line-2: rgba(110, 70, 110, 0.32);
  --line-soft: rgba(110, 70, 110, 0.08);
  --ink-0: #392641;
  --ink-1: #43304a;
  --ink-2: #5d4668;
  --ink-3: #8b7191;
  --ink-4: #9c84a2;
  --ink-5: #b3a0b8;
  --crimson: #a84390;
  --crimson-hi: #c0529f;
  --crimson-dim: #7e3070;
  --crimson-glow: rgba(168, 67, 144, 0.3);
  --ember: #c97b2d;
  --ember-glow: rgba(201, 123, 45, 0.3);
  --gold: #b8862e;
  --gold-hi: #d9a849;
  --gold-dim: rgba(184, 134, 46, 0.45);
  --rare-common: #8b7191;
  --rare-rare: #3f7fae;
  --rare-epic: #8a5fc0;
  --rare-legendary: #b8862e;
  --online: #3d9e6c;
  --away: #b8862e;
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px;
  --f-display: var(--font-display);
  --f-ui: var(--font-ui);
  --f-mono: "Cormorant Garamond", serif;
  --btn-grad: linear-gradient(180deg, #c0529f, #a84390);
}

/* Theme-scoped visibility */
[data-theme="dark"] .light-only { display: none !important; }
[data-theme="light"] .dark-only { display: none !important; }

/* ============================================================ BASE */

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

img { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--acc); color: var(--btn-ink); }

/* View-transition: JS drives the circular reveal */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

/* ---------- FX canvas ---------- */
#fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 60;
}

/* ---------- Layout helpers ---------- */
.container {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

section { position: relative; }

.kicker {
  font-family: var(--font-kicker);
  font-size: 14px;
  letter-spacing: var(--kicker-tracking);
  text-transform: var(--kicker-case);
  color: var(--acc);
  margin: 0 0 14px;
  font-weight: 600;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 5.4vw, 64px);
  font-weight: var(--display-weight);
  line-height: 1.05;
  letter-spacing: var(--display-tracking);
  text-transform: var(--display-case);
  margin: 0 0 18px;
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: 20px;
  letter-spacing: var(--display-tracking);
  text-transform: var(--display-case);
}

.brand .brand-star { color: var(--acc); }

.brand .brand-logo {
  height: 26px;
  width: auto;
  align-self: center;
  transform: translateY(1px);
}

.brand .brand-sub {
  font-family: var(--font-kicker);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* On desktop the links sit directly in the nav flex row; on phones this
   wrapper becomes a scroller (see the 760px block at the end of the file). */
.nav-scroll { display: contents; }

.nav-links a, .nav-links button.nav-link {
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover, .nav-links button.nav-link:hover { color: var(--ink); background: var(--surface); }

.nav-links a.active, .nav-links button.nav-link.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.3s, border-color 0.3s;
}

.theme-toggle:hover {
  transform: rotate(20deg) scale(1.08);
  border-color: var(--acc);
  box-shadow: 0 0 calc(24px * var(--glow, 0.6)) var(--acc-soft);
}

.theme-toggle:active { transform: scale(0.92); }
.theme-toggle svg { width: 20px; height: 20px; }

.nav-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.3s, box-shadow 0.3s;
}

.nav-avatar:hover {
  transform: scale(1.08);
  border-color: var(--acc);
  box-shadow: 0 0 calc(20px * var(--glow, 0.6)) var(--acc-soft);
}

.nav-avatar svg { width: 19px; height: 19px; }
.nav-avatar img { width: 100%; height: 100%; object-fit: cover; }
.nav-avatar .avatar-initial {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: 17px;
  color: var(--acc2);
}

/* ---------- Cart pill ---------- */
.cart-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-kicker);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: border-color 0.25s, box-shadow 0.3s, transform 0.18s;
}

.cart-pill:hover {
  border-color: var(--acc);
  box-shadow: 0 0 calc(20px * var(--glow, 0.6)) var(--acc-soft);
}

.cart-pill svg { width: 16px; height: 16px; }

.cart-pill .cart-count {
  min-width: 21px; height: 21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--acc);
  color: var(--btn-ink);
  font-size: 12px;
  padding: 0 5px;
}

.cart-pill.bump { animation: cart-bump 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes cart-bump { 35% { transform: scale(1.18); } }

/* ---------- Hero (landing) ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 140px 24px 100px;
  position: relative;
  overflow: hidden;
}

.hero-inner { position: relative; z-index: 5; width: min(1000px, 100%); }

.hero-eyebrow {
  font-family: var(--font-kicker);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: var(--kicker-tracking);
  text-transform: var(--kicker-case);
  color: var(--muted);
  margin: 0 0 26px;
}

.hero-eyebrow .tick, .kicker .tick { color: var(--acc); }

.hero-title {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(52px, 11vw, 150px);
  line-height: var(--display-lh, 1.02);
  letter-spacing: var(--display-tracking);
  text-transform: var(--display-case);
  margin: 0;
  text-wrap: balance;
}

/* No nowrap: the second sentence has to be free to wrap on narrow screens. */
.hero-title .fancy { position: relative; display: inline; }

.hero-sub {
  max-width: 560px;
  /* Sits directly under the slogan, clear of the drawn flourish in light mode. */
  margin: 40px auto 0;
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--muted);
  text-wrap: pretty;
}

.hero-ctas {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 44px;
}

.flourish {
  display: block;
  width: min(340px, 60%);
  margin: 18px auto 0;
  color: var(--acc2);
}

.flourish path {
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: draw-in 1.6s 0.5s cubic-bezier(0.6, 0, 0.2, 1) forwards;
}

@keyframes draw-in { to { stroke-dashoffset: 0; } }

.scroll-hint {
  position: absolute;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  font-family: var(--font-kicker);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.scroll-hint::after {
  content: "";
  width: 1px; height: 34px;
  background: linear-gradient(to bottom, var(--acc), transparent);
}

/* ---------- Buttons (new design system) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 17px 30px;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  text-decoration: none;
  border-radius: var(--btn-r);
  border: 1px solid transparent;
  cursor: pointer;
  position: relative;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s, background 0.3s;
}

.btn:hover { transform: translateY(-3px); }
.btn:active { transform: translateY(0) scale(0.96); }

.btn-primary {
  background: var(--acc);
  color: var(--btn-ink);
  box-shadow: 0 8px 30px -8px var(--acc-soft), 0 0 calc(36px * var(--glow, 0.6)) var(--acc-soft);
}

.btn-primary:hover {
  box-shadow: 0 14px 40px -8px var(--acc-soft), 0 0 calc(56px * var(--glow, 0.6)) var(--acc-soft);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-ghost:hover { border-color: var(--acc); color: var(--acc); }

.btn-gold {
  background: var(--acc2);
  color: var(--btn-ink);
  box-shadow: 0 8px 24px -8px var(--acc2-soft);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn-outline:hover { border-color: var(--acc); color: var(--acc); }

.btn .btn-glyph { color: var(--btn-glyph, currentColor); }
.btn-sm { padding: 11px 18px; font-size: 14px; }

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  border-block: 1px solid var(--line);
  padding: 16px 0;
  background: var(--marquee-bg);
}

.marquee-track {
  display: flex;
  gap: 56px;
  width: max-content;
  animation: marq var(--marq-dur, 28s) linear infinite;
  font-family: var(--font-kicker);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.marquee-track .m-star { color: var(--acc); }
@keyframes marq { to { transform: translateX(-50%); } }

/* ---------- Featured game ---------- */
#games { padding: 130px 0 90px; }

.featured {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  margin-top: 56px;
}

.page-section .featured { margin-top: 0; }

.game-card {
  position: relative;
  border-radius: var(--card-r);
  border: 1px solid var(--card-line);
  background: var(--card-bg);
  padding: clamp(28px, 4vw, 52px);
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.4s;
  will-change: transform;
}

.game-card:hover { box-shadow: var(--card-shadow-hover); }

.game-card img.game-logo {
  width: 100%;
  max-width: 460px;
  margin-inline: auto;
  filter: var(--logo-fx);
  transition: filter 0.4s;
}

.game-card:hover img.game-logo { filter: var(--logo-fx-hover); }

.game-card.dha-feature-card {
  aspect-ratio: 1024 / 500;
  overflow: hidden;
  padding: 0;
}

.game-card img.dha-feature-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.4s;
}

.game-card:hover img.dha-feature-art {
  filter: brightness(1.04) saturate(1.08);
}

.tilt { transform-style: preserve-3d; }

.tilt::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(460px circle at var(--mx, 50%) var(--my, 50%),
              var(--shine), transparent 42%);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}

.tilt:hover::after { opacity: 1; }

.game-info .status-pill, .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-kicker);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--acc2);
  border: 1px solid var(--acc2-soft);
  border-radius: 999px;
  padding: 7px 16px;
  margin-bottom: 22px;
}

.status-pill .pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--acc2);
  box-shadow: 0 0 10px var(--acc2);
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse { 50% { opacity: 0.25; } }

.game-title {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.04;
  letter-spacing: var(--display-tracking);
  text-transform: var(--display-case);
  margin: 0 0 16px;
}

.game-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.game-tags li {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--tag-r);
  padding: 5px 13px;
  background: var(--surface);
}

.game-desc { color: var(--muted); max-width: 46ch; text-wrap: pretty; margin: 0 0 32px; }

/* ---------- Next tale / workbench slot ---------- */
.next-tale {
  margin-top: 90px;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--card-r);
  padding: clamp(24px, 3.5vw, 44px);
  background: var(--surface);
}

.next-tale h3 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(26px, 2.8vw, 36px);
  letter-spacing: var(--display-tracking);
  text-transform: var(--display-case);
  margin: 0 0 12px;
}

.next-tale p { color: var(--muted); margin: 0; max-width: 52ch; text-wrap: pretty; }

.art-slot {
  width: 100%;
  height: 250px;
  border-radius: 18px;
  border: 1px dashed var(--line-strong);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  color: var(--acc);
  overflow: hidden;
}
.art-slot img { width: 100%; height: 100%; object-fit: cover; }
/* A slot holding real art needs no dashed "art goes here" outline. */
.art-slot.has-art { border-style: solid; border-color: var(--line); }

/* ---------- Studio ---------- */
#studio { padding: 110px 0 130px; }

.studio-inner {
  max-width: 720px;
  margin-inline: auto;
  text-align: center;
}

.studio-inner p {
  font-size: clamp(18px, 2vw, 22px);
  color: var(--muted);
  text-wrap: pretty;
  margin: 0 0 36px;
}

/* Sister-brand links inside the studio blurb. */
.studio-inner p a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--acc-soft);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.studio-inner p a:hover,
.studio-inner p a:focus-visible {
  color: var(--acc);
  border-bottom-color: var(--acc);
}

/* ---------- Footer ---------- */
footer.site-footer {
  border-top: 1px solid var(--line);
  padding: 90px 0 48px;
  text-align: center;
  background: var(--footer-bg);
  position: relative;
  overflow: hidden;
}

.footer-sign {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(56px, 9vw, 120px);
  letter-spacing: var(--display-tracking);
  text-transform: var(--display-case);
  line-height: 1;
  margin: 0 0 28px;
  background: var(--sign-fill);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.footer-network {
  margin-top: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 14px;
}

.footer-network a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-network a:hover { color: var(--acc); }
.footer-network .m-star { color: var(--acc); font-size: 10px; }

.footer-meta {
  margin-top: 40px;
  font-size: 13.5px;
  color: var(--muted);
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-meta a { color: inherit; text-decoration: none; }
.footer-meta a:hover { color: var(--acc); }

/* ---------- Page hero (subpages) ---------- */
.page-hero {
  position: relative;
  overflow: hidden;
  padding: 172px 0 64px;
}

.page-hero .container { position: relative; z-index: 2; }

.page-title {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(52px, 8vw, 104px);
  line-height: var(--display-lh, 1.02);
  letter-spacing: var(--display-tracking);
  text-transform: var(--display-case);
  margin: 0;
}

.page-sub {
  margin: 16px 0 0;
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--muted);
  max-width: 52ch;
  text-wrap: pretty;
}

[data-theme="dark"] .page-hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--acc) 35%, var(--acc2) 65%, transparent);
  filter: blur(0.5px);
  box-shadow: 0 0 calc(30px * var(--glow, 0.6)) var(--acc-soft);
}

[data-theme="light"] .page-hero::before {
  content: "";
  position: absolute;
  top: -140px; right: -120px;
  width: 560px; height: 560px;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 219, 153, 0.8), rgba(255, 219, 153, 0) 62%);
}

.page-section { padding: 64px 0 90px; }
.page-section + .page-section { padding-top: 0; }

.section-sub {
  margin: 0 0 8px;
  color: var(--muted);
  max-width: 60ch;
}

/* ---------- Catalogue grid (Games page) ---------- */
.tales-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 28px;
  margin-top: 44px;
}

.tale-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--card-line);
  border-radius: var(--card-r);
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: box-shadow 0.4s;
}

.tale-card:hover { box-shadow: var(--card-shadow-hover); }

.tale-card .tale-art {
  height: 170px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.tale-card .tale-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }

.tale-name {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: var(--display-tracking);
  text-transform: var(--display-case);
  margin: 0;
}

.tale-line { margin: 0; font-size: 14px; color: var(--muted); text-wrap: pretty; }

.tale-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-kicker);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--acc2);
}

.tale-badge {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 2;
  font-family: var(--font-kicker);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--nav-bg);
  border: 1px solid var(--acc2-soft);
  color: var(--acc2);
  backdrop-filter: blur(6px);
}

/* ---------- Filter chips (new pages) ---------- */
.chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 36px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: all 0.2s;
}

.chip:hover { border-color: var(--line-strong); color: var(--ink); }

.chip.active {
  background: var(--acc);
  border-color: var(--acc);
  color: var(--btn-ink);
}

/* ---------- Shop (Tabletop page) ---------- */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 28px;
  margin-top: 44px;
}

.shop-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 1px solid var(--card-line);
  border-radius: var(--card-r);
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  padding: 20px;
  cursor: pointer;
  transition: box-shadow 0.4s;
}

.shop-card:hover { box-shadow: var(--card-shadow-hover); }

.shop-card .shop-art {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  position: relative;
}

.shop-kicker {
  font-family: var(--font-kicker);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.shop-name {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: var(--display-tracking);
  text-transform: var(--display-case);
  margin: 0;
}

.shop-blurb { margin: 0; font-size: 14.5px; color: var(--muted); text-wrap: pretty; }

.shop-row {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 6px;
}

.price {
  font-family: var(--font-kicker);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.04em;
  color: var(--acc2);
}

.shop-note {
  margin: 36px 0 0;
  font-size: 13.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.shop-note .m-star { color: var(--acc); }

.stock-pill {
  font-family: var(--font-kicker);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  background: var(--surface);
}
.stock-pill.in { color: var(--online); border-color: var(--online); }
.stock-pill.pre { color: var(--acc2); border-color: var(--acc2-soft); }

/* ---------- War table (Warhammer corner on Tabletop) ---------- */
.wt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
  margin-top: 40px;
}

.wt-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
  border: 1px solid var(--card-line);
  border-radius: var(--card-r);
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  padding: clamp(20px, 2.6vw, 30px);
  cursor: pointer;
  color: var(--ink);
  font-family: var(--font-ui);
  transition: box-shadow 0.4s, transform 0.25s;
}

.wt-card:hover { box-shadow: var(--card-shadow-hover); transform: translateY(-4px); }

.wt-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--acc2);
  border: 1px solid var(--acc2-soft);
  background: var(--surface);
}

.wt-icon svg { width: 22px; height: 22px; }

.wt-card h3 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: 23px;
  letter-spacing: var(--display-tracking);
  text-transform: var(--display-case);
  margin: 0;
}

.wt-card p { margin: 0; font-size: 14px; color: var(--muted); text-wrap: pretty; }

.wt-go {
  margin-top: auto;
  font-family: var(--font-kicker);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--acc);
}

/* ---------- Tutorials rail (Tabletop) ---------- */
.tut-rail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
  margin-top: 36px;
}

.tut-card {
  border: 1px solid var(--card-line);
  border-radius: var(--card-r);
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.4s;
}

.tut-card:hover { box-shadow: var(--card-shadow-hover); }

.tut-card .tut-thumb { position: relative; height: 130px; border-bottom: 1px solid var(--line); }

.tut-card .tut-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--acc);
  color: var(--btn-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 calc(22px * var(--glow, 0.6)) var(--acc-soft);
}

.tut-card .tut-dur {
  position: absolute;
  bottom: 8px; right: 8px;
  font-family: var(--font-kicker);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(0,0,0,0.65);
  color: #fff;
}

.tut-card h4 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: var(--display-tracking);
  text-transform: var(--display-case);
  margin: 0;
  padding: 14px 16px 16px;
}

/* ---------- Library ---------- */
.lib-row {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: clamp(26px, 4vw, 52px);
  align-items: center;
  border: 1px solid var(--card-line);
  border-radius: var(--card-r);
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  padding: clamp(22px, 3vw, 40px);
  transition: box-shadow 0.4s;
}

.lib-row + .lib-row { margin-top: 28px; }
.lib-row:hover { box-shadow: var(--card-shadow-hover); }

.lib-cover {
  border-radius: calc(var(--card-r) - 6px);
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  height: 210px;
  position: relative;
  cursor: pointer;
}

.lib-title {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: var(--display-tracking);
  text-transform: var(--display-case);
  margin: 0 0 6px;
}

.lib-line { margin: 0 0 22px; color: var(--muted); font-size: 15px; }

.lib-bars { display: flex; flex-direction: column; gap: 16px; margin-bottom: 28px; }

.bar-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-kicker);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}

.bar-label .bar-val { color: var(--acc2); }

.bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}

.bar .bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--acc), var(--acc2));
  box-shadow: 0 0 calc(14px * var(--glow, 0.6)) var(--acc-soft);
  transform-origin: left;
}

@media (prefers-reduced-motion: no-preference) {
  .bar .bar-fill { animation: bar-grow 1.2s 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
}

@keyframes bar-grow { from { transform: scaleX(0); } }

.lib-shelf-gap {
  margin-top: 36px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--card-r);
  background: var(--surface);
  padding: clamp(28px, 4vw, 44px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.lib-shelf-gap h3 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(22px, 2.6vw, 30px);
  letter-spacing: var(--display-tracking);
  text-transform: var(--display-case);
  margin: 0 0 6px;
}

.lib-shelf-gap p { margin: 0; color: var(--muted); }

/* ---------- Segmented control (Library tabs) ---------- */
.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px;
  gap: 5px;
  max-width: 560px;
  margin-top: 36px;
}

.seg-item {
  background: none;
  border: 0;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}

.seg-item.active {
  background: var(--acc);
  color: var(--btn-ink);
}

/* ---------- Profile ---------- */
.profile-head {
  display: flex;
  align-items: center;
  gap: clamp(26px, 4vw, 48px);
  flex-wrap: wrap;
}

.profile-avatar {
  width: 148px; height: 148px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: 56px;
  color: var(--acc2);
  box-shadow: 0 0 calc(34px * var(--glow, 0.6)) var(--acc-soft);
}

.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

.profile-handle { margin: 10px 0 0; color: var(--muted); font-size: 16px; }
.profile-handle .at { color: var(--acc); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 20px;
  margin-top: 8px;
}

.stat-card {
  border: 1px solid var(--card-line);
  border-radius: var(--card-r);
  background: var(--card-bg);
  padding: 24px 22px 20px;
  box-shadow: var(--card-shadow);
}

.stat-num {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(34px, 3.6vw, 46px);
  letter-spacing: var(--display-tracking);
  line-height: 1;
  background: var(--sign-fill);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-name {
  margin-top: 10px;
  font-family: var(--font-kicker);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.account-row {
  margin-top: 56px;
  border: 1px solid var(--line);
  border-radius: var(--card-r);
  background: var(--surface);
  padding: 22px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.account-row .acct-mail { font-size: 15.5px; }
.account-row .acct-mail span { color: var(--muted); margin-right: 10px; }

/* ---------- LitCoin banner ---------- */
.litcoin-row {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--acc2-soft);
  border-radius: var(--card-r);
  background: var(--surface);
  padding: 22px 26px;
  text-decoration: none;
  flex-wrap: wrap;
  transition: box-shadow 0.3s;
}

.litcoin-row:hover { box-shadow: 0 0 calc(30px * var(--glow, 0.6)) var(--acc2-soft); }

.litcoin-coin {
  width: 46px; height: 46px;
  flex: none;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f0d27a, #c8a24b 55%, #8a6a22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  color: #2a1f06;
  font-size: 19px;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.5);
}

.litcoin-row h4 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: 21px;
  letter-spacing: var(--display-tracking);
  text-transform: var(--display-case);
  margin: 0 0 4px;
}

.litcoin-row p { margin: 0; font-size: 14px; color: var(--muted); }
.litcoin-row .grow { flex: 1; min-width: 220px; }

/* ================= DARK decorations ================= */

[data-theme="dark"] body {
  background:
    radial-gradient(1100px 600px at 75% -10%, rgba(98, 60, 220, 0.22), transparent 65%),
    radial-gradient(900px 500px at 10% 30%, rgba(0, 255, 133, 0.08), transparent 60%),
    var(--bg);
}

.grid-floor {
  position: absolute;
  left: -20%; right: -20%; bottom: 0;
  height: 42%;
  pointer-events: none;
  background:
    repeating-linear-gradient(to top, rgba(69, 227, 255, 0.28) 0 1.5px, transparent 1.5px 46px),
    repeating-linear-gradient(to right, rgba(0, 255, 133, 0.22) 0 1.5px, transparent 1.5px 64px);
  transform: perspective(520px) rotateX(62deg);
  transform-origin: 50% 100%;
  mask-image: linear-gradient(to top, rgba(0,0,0,0.9) 20%, transparent 95%);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.9) 20%, transparent 95%);
}

.horizon {
  position: absolute;
  /* Sits where the grid floor visually vanishes. The floor is rotated in 3D so
     it paints far lower than its box, and at 34% this line cut straight through
     the hero sub-heading. Keep it below the text. */
  left: 0; right: 0; bottom: 13%;
  height: 2px;
  pointer-events: none;
  background: linear-gradient(to right, transparent, var(--acc) 30%, var(--acc2) 70%, transparent);
  filter: blur(1px);
  box-shadow: 0 0 calc(40px * var(--glow, 0.6)) var(--acc-soft);
}

.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px);
  mix-blend-mode: overlay;
}

[data-theme="dark"] .hero-title .fancy {
  background: linear-gradient(95deg, var(--acc) 20%, var(--acc2) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 calc(22px * var(--glow, 0.6)) var(--acc-soft));
}

@media (prefers-reduced-motion: no-preference) {
  [data-theme="dark"] .hero-title .fancy::before,
  [data-theme="dark"] .hero-title .fancy::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    background: inherit;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    clip-path: inset(0 0 100% 0);
    pointer-events: none;
  }
  [data-theme="dark"] .hero-title .fancy::before { animation: glitch-a 4.2s steps(1) infinite; }
  [data-theme="dark"] .hero-title .fancy::after { animation: glitch-b 4.2s 0.12s steps(1) infinite; }
}

@keyframes glitch-a {
  0%, 88%, 100% { clip-path: inset(0 0 100% 0); transform: none; }
  89% { clip-path: inset(8% 0 56% 0); transform: translate(-7px, 0); }
  91% { clip-path: inset(58% 0 10% 0); transform: translate(6px, 0); }
  93% { clip-path: inset(30% 0 44% 0); transform: translate(-4px, 0); }
}

@keyframes glitch-b {
  0%, 88%, 100% { clip-path: inset(0 0 100% 0); transform: none; }
  90% { clip-path: inset(64% 0 4% 0); transform: translate(8px, 0); }
  92% { clip-path: inset(12% 0 70% 0); transform: translate(-6px, 0); }
  94% { clip-path: inset(40% 0 32% 0); transform: translate(5px, 0); }
}

/* ================= LIGHT decorations ================= */

[data-theme="light"] body {
  background:
    radial-gradient(1200px 700px at 70% -16%, rgba(255, 214, 170, 0.75), transparent 60%),
    radial-gradient(900px 600px at 8% 8%, rgba(226, 200, 240, 0.6), transparent 55%),
    var(--bg);
}

.sun {
  position: absolute;
  top: 12%; left: 50%;
  width: 520px; height: 520px;
  transform: translateX(-50%);
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 219, 153, 0.85), rgba(255, 219, 153, 0) 65%);
}

.tower {
  position: absolute;
  right: 4%;
  bottom: 0;
  width: clamp(120px, 16vw, 220px);
  pointer-events: none;
  opacity: 0.85;
}

.vine {
  position: absolute;
  width: clamp(180px, 24vw, 340px);
  pointer-events: none;
  color: #6e8a5e;
  opacity: 0.7;
}

.vine-tl { top: 64px; left: -24px; }
.vine-br { bottom: -16px; left: 2%; transform: scaleX(-1) rotate(-12deg); }

.vine .vine-stem {
  stroke-dasharray: 700;
  stroke-dashoffset: 700;
  animation: draw-in 2.4s 0.3s cubic-bezier(0.5, 0, 0.2, 1) forwards;
}

.vine .vine-bit {
  opacity: 0;
  animation: bit-in 0.8s 1.6s ease forwards;
}

@keyframes bit-in { to { opacity: 1; } }

[data-theme="light"] .hero-title .fancy {
  font-style: italic;
  background: linear-gradient(100deg, #b8862e 10%, #d4498f 45%, #8a5fc0 75%, #b8862e 110%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@media (prefers-reduced-motion: no-preference) {
  [data-theme="light"] .hero-title .fancy { animation: shimmer 7s ease-in-out infinite; }
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 0; }
  50% { background-position: 100% 0; }
}

/* ---------- Reveal on scroll ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    transition: opacity 0.8s cubic-bezier(0.2, 0.6, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.6, 0.2, 1);
  }
  .reveal.pending {
    opacity: 0;
    transform: translateY(26px);
  }
}

/* ============================================================
   LEGACY COMPONENT BRIDGE
   Old app screens (game/product detail, cart, auth, search,
   army builder, Warhammer hub, events, tutorials, stores) keep
   their class names; these rules re-skin them with the new
   theme tokens so they work in both worlds.
   ============================================================ */

.legacy {
  max-width: 820px;
  margin-inline: auto;
  padding: 96px 0 90px;
  position: relative;
  min-height: 80vh;
}

.legacy .h-display {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  color: var(--ink-0);
  text-transform: var(--display-case);
  line-height: 1.08;
}

.h-display {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  color: var(--ink-0);
  text-transform: var(--display-case);
  line-height: 1.08;
}

.h-section {
  font-family: var(--font-kicker);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--ink-1);
}

.h-section .ornament {
  display: inline-block;
  width: 18px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--acc2));
  vertical-align: middle;
  margin-right: 10px;
}

.h-section .ornament-r {
  display: inline-block;
  width: 18px; height: 1px;
  background: linear-gradient(90deg, var(--acc2), transparent);
  vertical-align: middle;
  margin-left: 10px;
}

.eyebrow {
  font-family: var(--font-kicker);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.meta { color: var(--ink-4); font-size: 12px; }
.body-text { color: var(--ink-3); font-size: 14px; line-height: 1.5; }

/* Legacy buttons keep their compact uppercase styling */
.legacy .btn, .modal-fix .btn {
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 12px;
  border-radius: var(--btn-r);
  padding: 14px 18px;
}

.icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-1);
  cursor: pointer;
  backdrop-filter: blur(12px);
}
.icon-btn:hover { background: var(--bg-4); }
.icon-btn svg { width: 18px; height: 18px; stroke-width: 1.8; }

/* Legacy chips (old screens use them densely) */
.legacy .chip { font-size: 11px; padding: 7px 12px; }
.legacy .chip.active {
  background: var(--acc);
  border-color: var(--acc);
  color: var(--btn-ink);
  box-shadow: none;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-line);
  border-radius: var(--r-md);
  overflow: hidden;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 4px;
  border: 1px solid currentColor;
}
.badge-gold { color: var(--acc2); background: var(--surface); }
.badge-crimson { color: var(--acc); background: var(--surface); }
.badge-new { color: var(--ember); background: var(--surface); }
.badge-stock-in { color: var(--online); background: var(--surface); }
.badge-stock-low { color: var(--away); background: var(--surface); }
.badge-stock-pre { color: var(--acc2); background: var(--surface); }

.rarity-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.xp-track {
  height: 4px;
  background: var(--bg-4);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--acc), var(--acc2));
  box-shadow: 0 0 8px var(--acc-soft);
}
.xp-fill-gold { background: linear-gradient(90deg, var(--acc2), var(--gold-hi)); }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 20px 12px;
}
.section-head .right {
  color: var(--ink-4);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  cursor: pointer;
}

.h-scroll {
  display: flex;
  gap: 12px;
  padding: 0 20px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.h-scroll::-webkit-scrollbar { display: none; }

.stars {
  display: inline-flex;
  gap: 1px;
  color: var(--acc2);
  font-size: 11px;
  letter-spacing: 1px;
}

.filigree {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  color: var(--acc2);
  opacity: 0.65;
}
.filigree::before, .filigree::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--acc2-soft), transparent);
}

/* Old floating TopBar becomes a static right-aligned row */
.legacy .top-actions-float {
  position: static;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 20px 14px;
}

.detail-hero {
  position: relative;
  height: 460px;
  overflow: hidden;
  border-radius: var(--card-r);
  border: 1px solid var(--line);
}
.detail-hero-cover {
  height: auto;
  aspect-ratio: 1024 / 500;
}
.detail-hero .grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, var(--hero-grad-mid, rgba(8,6,15,0.7)) 70%, var(--bg) 100%);
  z-index: 2;
}
[data-theme="light"] .detail-hero .grad {
  background: linear-gradient(180deg, transparent 30%, rgba(249,241,229,0.7) 70%, var(--bg) 100%);
}
.detail-hero .top-grad {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 120px;
  background: linear-gradient(180deg, rgba(0,0,0,0.5), transparent);
  z-index: 2;
}
[data-theme="light"] .detail-hero .top-grad { background: none; }

.legacy .segmented { border-radius: var(--r-sm); padding: 4px; gap: 4px; margin: 0 20px; max-width: none; }
.legacy .seg-item {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 4px;
}
.legacy .seg-item.active { background: var(--acc); color: var(--btn-ink); box-shadow: none; }

.avatar-frame { position: relative; width: 96px; height: 96px; }
.avatar-frame .ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, var(--acc) 0%, var(--acc-soft) 25%, var(--acc2) 50%, var(--acc-soft) 75%, var(--acc) 100%);
  padding: 2px;
}
.avatar-frame .inner {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: var(--bg-2);
  overflow: hidden;
  border: 2px solid var(--bg-1);
}

.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; }
.spacer { flex: 1; }

.tap { cursor: pointer; transition: transform 80ms, opacity 80ms; }
.tap:active { transform: scale(0.985); opacity: 0.9; }

@keyframes screenIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.screen-in { position: relative; animation: screenIn 220ms ease-out; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sub-header {
  position: sticky;
  top: 86px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  z-index: 9;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.5; }
}
.live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--acc);
  display: inline-block;
  animation: pulseDot 1.6s ease-in-out infinite;
}
.online-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--online);
  border: 2px solid var(--bg-2);
  display: inline-block;
}

/* Army builder bits */
.ab-select {
  background: var(--bg-3);
  color: var(--ink-1);
  border: 1px solid var(--line-1);
  border-radius: 6px;
  padding: 9px 12px;
  font-family: var(--f-ui);
  font-size: 12px;
  letter-spacing: 0.02em;
  -webkit-appearance: none;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-4) 50%), linear-gradient(135deg, var(--ink-4) 50%, transparent 50%);
  background-position: calc(100% - 16px) center, calc(100% - 11px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}
.ab-pill {
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 4px; padding: 3px 7px; cursor: pointer;
}
.ab-pill-on { color: var(--acc2); border-color: var(--acc2-soft); background: var(--surface); }
.ab-pill-gold { color: var(--acc2); border-color: var(--acc2-soft); background: var(--surface); cursor: default; }
.ab-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line-1); border-radius: 8px;
  padding: 9px 12px; margin-bottom: 10px;
}
.ab-search input { flex: 1; background: none; border: 0; outline: none; color: var(--ink-0); font-size: 13px; font-family: var(--f-ui); }
.ab-sheet {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(6, 4, 12, 0.6); backdrop-filter: blur(3px);
  display: flex; flex-direction: column; justify-content: flex-end;
  animation: screenIn 160ms ease-out;
}
[data-theme="light"] .ab-sheet { background: rgba(70, 50, 70, 0.35); }
.ab-sheet-panel {
  background: var(--bg-1); border-top: 1px solid var(--line-2);
  border-radius: 16px 16px 0 0; padding: 16px 18px 20px;
  max-height: 82%; display: flex; flex-direction: column;
  box-shadow: 0 -16px 40px -10px rgba(0,0,0,0.4);
  max-width: 820px;
  width: 100%;
  margin-inline: auto;
}
.ab-sheet-scroll { overflow-y: auto; scrollbar-width: none; }
.ab-sheet-scroll::-webkit-scrollbar { display: none; }

/* Old screens that set inner scroll areas now just flow with the page */
.legacy .screen-scroll { overflow: visible; padding-bottom: 0; }

/* Modal anchor for root-level overlays (beta gate) */
.modal-fix { position: fixed; inset: 0; z-index: 200; }
.modal-fix > div { position: absolute; inset: 0; }

/* Toast */
.app-toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  max-width: 80%;
  padding: 12px 22px;
  border-radius: 999px;
  z-index: 220;
  background: var(--card-bg);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  box-shadow: var(--card-shadow-hover);
  backdrop-filter: blur(12px);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Play Hub full-bleed frame */
.playhub-wrap {
  position: fixed;
  top: 81px; left: 0; right: 0; bottom: 0;
  z-index: 10;
  background: var(--bg);
}
.playhub-wrap iframe { width: 100%; height: 100%; border: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .featured { grid-template-columns: 1fr; }
  .next-tale { grid-template-columns: 1fr; }
  .lib-row { grid-template-columns: 1fr; }
  .lib-cover { max-width: 320px; }
}

@media (max-width: 760px) {
  .nav { padding: 12px 14px; gap: 10px; }
  .brand > span:not(.brand-star) { display: none; }
  .brand { font-size: 18px; gap: 6px; }
  .brand .brand-logo { height: 22px; }
  .nav-links { gap: 2px; }
  .nav-links a, .nav-links button.nav-link { font-size: 13px; padding: 8px 9px; }
  /* Five destinations don't fit a phone once "Little Tales" joined them, so
     the links scroll while the cart / avatar / theme controls stay put. */
  .nav-links .nav-link { flex: 0 0 auto; }
  .nav-scroll {
    display: flex;
    align-items: center;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
  }
  .nav-scroll::-webkit-scrollbar { display: none; }
  .theme-toggle, .nav-avatar { width: 38px; height: 38px; }
  .cart-pill { padding: 7px 11px; }
  .cart-pill .cart-label { display: none; }
  .hero { padding-top: 110px; }
  .page-hero { padding: 134px 0 48px; }
  .playhub-wrap { top: 63px; }
  .sub-header { top: 64px; }
}

/* =====================================================================
   FROM LITFIC — provenance for adaptations.
   Delivered began as a short story on LitFic, and we say so wherever the
   game appears: a stamped pill on the card, a byline in the copy. Styled
   as ink on paper rather than as a store badge, so it reads as a credit.
   ===================================================================== */
.litfic-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-kicker);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--nav-bg);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  text-decoration: none;
  backdrop-filter: blur(6px);
  transition: border-color 0.25s, color 0.25s, transform 0.25s;
}

.litfic-tag:hover {
  border-color: var(--gold);
  color: var(--gold-hi);
  transform: translateY(-1px);
}

.litfic-tag-mark { font-size: 12px; line-height: 1; transform: translateY(-0.5px); }

/* Standalone (not pinned to a card corner) it sits in the flow of copy. */
.next-tale .litfic-tag,
.game-info .litfic-tag { margin-bottom: 16px; }

.litfic-note {
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--muted);
  text-wrap: pretty;
}

.litfic-note a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid var(--gold-dim);
  white-space: nowrap;
}

.litfic-note a:hover { color: var(--gold-hi); border-bottom-color: var(--gold); }

/* =====================================================================
   THE REAL SHOP — the address block on the landing page.
   ===================================================================== */
.shop-address {
  margin: 22px 0 0;
  padding-left: 16px;
  border-left: 2px solid var(--gold-dim);
  font-style: normal;
  line-height: 1.7;
  color: var(--muted);
}

.shop-address strong { color: var(--ink, inherit); font-weight: 600; }

/* =====================================================================
   LITTLE TALES — the corner for the smallest players. Warmer and roomier
   than the rest of the site; play buttons sit together under the grid.
   ===================================================================== */
/* The Play button lives inside its own card. margin-top:auto keeps every
   button on the same line across the row however long the blurb runs. */
.tale-card .tale-play {
  margin-top: auto;
  align-self: stretch;
  justify-content: center;
  text-align: center;
}

.little-tales .tale-card .tale-art { height: 200px; }
.little-tales .page-title { text-wrap: balance; }

@media (max-width: 760px) {
  .shop-address { font-size: 15px; }
}

/* GG Engine capability points on the landing page. */
.gg-points {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}
.gg-points li {
  position: relative;
  padding-left: 26px;
  color: var(--muted);
  line-height: 1.55;
}
.gg-points li::before {
  content: "✦";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--acc);
}
.gg-points strong { color: var(--ink); }

/* ---------- Avatar picker (Profile) ---------- */
.profile-avatar-btn {
  position: relative;
  cursor: pointer;
  padding: 0;
}
.profile-avatar-btn .avatar-edit-tag {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-family: var(--f-ui, inherit);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}
.profile-avatar-btn:hover .avatar-edit-tag,
.profile-avatar-btn:focus-visible .avatar-edit-tag { opacity: 1; }

.avatar-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(4, 2, 12, 0.66);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.avatar-modal {
  width: 100%;
  max-width: 540px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 26px;
  color: var(--ink-1);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-top: 18px;
}
@media (max-width: 560px) {
  .avatar-grid { grid-template-columns: repeat(4, 1fr); }
}
.avatar-choice {
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  padding: 0;
  border: 2px solid var(--line-1);
  background: var(--bg-1);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.avatar-choice:hover { transform: scale(1.06); border-color: var(--line-2); }
.avatar-choice.selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
.avatar-choice img { width: 100%; height: 100%; display: block; object-fit: cover; }
.avatar-scope {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-2);
  cursor: pointer;
}
.avatar-scope input { margin-top: 2px; accent-color: var(--gold); }
.avatar-shared-link {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 6px 0;
  background: none;
  border: 0;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-align: center;
}
.avatar-shared-link:hover { color: var(--gold-hi); }
