/* =====================================================================
   ROOKSPELL — "Arcane Arcade" redesign
   Neon-arcade cabinet skin over the midnight-grimoire bones.
   Vanilla CSS, no build. Works from file://.
   ===================================================================== */

:root {
  --bg: #07060d;
  --bg-2: #0d0a18;
  --panel: #141021;
  --panel-2: #1b1530;
  --ink: #efe9ff;
  --muted: #9d93b8;
  --line: #2c2347;

  --gold: #ffd34d;
  --gold-deep: #f7ad3d;
  --purple: #b06eed;
  --purple-hot: #d39bff;
  --green: #66ff9e;

  /* Rarity colours mirror ROOKSPELL_RARITIES in cards-data.js */
  --r-common: #a3abb8;
  --r-uncommon: #66cc76;
  --r-rare: #529af5;
  --r-epic: #b06eed;
  --r-legendary: #f7ad3d;

  --font-display: "Jacquard 12", "Pixelify Sans", monospace;
  --font-pixel: "Pixelify Sans", monospace;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --glow-gold: 0 0 18px rgba(255, 211, 77, .45), 0 0 46px rgba(247, 173, 61, .22);
  --glow-purple: 0 0 18px rgba(176, 110, 237, .5), 0 0 46px rgba(176, 110, 237, .25);
  --radius: 4px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-pixel);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; image-rendering: pixelated; }
a { color: var(--gold); }
svg { width: 1.15em; height: 1.15em; vertical-align: -0.2em; }
.container { width: min(1120px, 92vw); margin-inline: auto; }

::selection { background: var(--purple); color: #0b0614; }

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

/* ---------- Accessibility helpers ---------- */
.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 200;
  background: var(--gold);
  color: #140d00;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: .6rem 1rem;
  border-radius: var(--radius);
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- Scroll progress ---------- */
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  z-index: 150;
  background: linear-gradient(90deg, var(--purple), var(--gold), var(--green));
  box-shadow: 0 0 12px rgba(255, 211, 77, .7);
}

/* ---------- Custom cursor glow (desktop only, enabled via JS) ---------- */
.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 340px; height: 340px;
  margin: -170px 0 0 -170px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle, rgba(176, 110, 237, .13) 0%, rgba(255, 211, 77, .05) 40%, transparent 70%);
  opacity: 0;
  transition: opacity .4s ease;
}
body.has-cursor .cursor-glow { opacity: 1; }

/* ---------- Animated background layers ---------- */
#embers {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.crt {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0 2px,
      rgba(0, 0, 0, .14) 2px 4px
    );
  mix-blend-mode: multiply;
}
.crt::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(3, 2, 8, .75) 100%);
}

main, .nav, .footer, .marquee { position: relative; z-index: 3; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  padding: .72rem 1.3rem;
  border-radius: var(--radius);
  border: 2px solid var(--line);
  color: var(--ink);
  background: var(--panel);
  cursor: pointer;
  position: relative;
  transition: transform .18s ease, box-shadow .25s ease, border-color .25s ease, background .25s ease;
  will-change: transform;
}
.btn--lg { padding: .95rem 1.7rem; font-size: 1.05rem; }
.btn--primary {
  background: linear-gradient(180deg, #ffe27a, var(--gold-deep));
  color: #241300;
  border-color: #ffec9e;
  box-shadow: var(--glow-gold), inset 0 -3px 0 rgba(120, 60, 0, .45);
  text-shadow: none;
}
.btn--primary:hover {
  box-shadow: 0 0 26px rgba(255, 211, 77, .75), 0 0 70px rgba(247, 173, 61, .35), inset 0 -3px 0 rgba(120, 60, 0, .45);
  transform: translateY(-2px);
}
.btn--ghost {
  background: rgba(27, 21, 48, .6);
  border-color: var(--purple);
  color: var(--purple-hot);
}
.btn--ghost:hover {
  box-shadow: var(--glow-purple);
  border-color: var(--purple-hot);
  transform: translateY(-2px);
}
.btn:active { transform: translateY(0) scale(.98); }

.wrap-cta { display: flex; flex-wrap: wrap; gap: .9rem; }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(7, 6, 13, .72);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.nav.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(7, 6, 13, .9);
  box-shadow: 0 6px 30px rgba(0, 0, 0, .5);
}
.nav__inner {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: .06em;
  color: var(--ink);
  text-decoration: none;
  text-shadow: 0 0 14px rgba(176, 110, 237, .5);
}
.brand b { color: var(--gold); font-weight: 400; text-shadow: 0 0 14px rgba(255, 211, 77, .6); }
.nav__links {
  display: flex;
  gap: 1.2rem;
  margin-left: auto;
}
.nav__links a {
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--muted);
  text-decoration: none;
  padding: .3rem .1rem;
  border-bottom: 2px solid transparent;
  transition: color .2s ease, border-color .2s ease, text-shadow .2s ease;
}
.nav__links a:hover,
.nav__links a.is-active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  text-shadow: 0 0 12px rgba(255, 211, 77, .6);
}
.nav__cta { padding: .5rem 1rem; font-size: .85rem; }
.nav__toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  width: 42px; height: 38px;
  cursor: pointer;
  position: relative;
}
.nav__toggle span,
.nav__toggle span::before,
.nav__toggle span::after {
  content: "";
  position: absolute;
  left: 9px; right: 9px;
  height: 2px;
  background: var(--gold);
  transition: transform .25s ease, opacity .2s ease;
}
.nav__toggle span { top: 50%; margin-top: -1px; }
.nav__toggle span::before { top: -7px; left: 0; right: 0; }
.nav__toggle span::after { top: 7px; left: 0; right: 0; }
.nav__toggle[aria-expanded="true"] span { background: transparent; }
.nav__toggle[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span::after { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  padding: 110px 0 70px;
  background:
    radial-gradient(ellipse 70% 45% at 70% 30%, rgba(176, 110, 237, .14), transparent 65%),
    radial-gradient(ellipse 55% 40% at 20% 75%, rgba(255, 211, 77, .08), transparent 60%);
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--green);
  text-decoration: none;
  border: 1px solid rgba(102, 255, 158, .4);
  border-radius: 999px;
  padding: .38rem .95rem;
  background: rgba(102, 255, 158, .06);
  box-shadow: 0 0 16px rgba(102, 255, 158, .15);
  margin-bottom: 1.2rem;
}
.hero__badge:hover { box-shadow: 0 0 24px rgba(102, 255, 158, .35); }
.hero__badge .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.8); }
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.6rem, 10vw, 7.2rem);
  line-height: .9;
  letter-spacing: .04em;
  margin-bottom: .4rem;
}
.glow-text {
  color: var(--gold);
  text-shadow:
    0 0 8px rgba(255, 211, 77, .8),
    0 0 28px rgba(247, 173, 61, .55),
    0 0 80px rgba(176, 110, 237, .5),
    4px 4px 0 #3a1d6e;
  animation: titleFlicker 5s linear infinite;
}
@keyframes titleFlicker {
  0%, 100% { opacity: 1; }
  3% { opacity: .86; }
  5% { opacity: 1; }
  42% { opacity: 1; }
  43% { opacity: .9; }
  44% { opacity: 1; }
  71% { opacity: 1; }
  72% { opacity: .82; }
  74% { opacity: 1; }
}
.hero__tagline {
  font-family: var(--font-pixel);
  font-size: clamp(1.2rem, 2.6vw, 1.6rem);
  color: var(--purple-hot);
  text-shadow: 0 0 16px rgba(176, 110, 237, .65);
  margin-bottom: 1.1rem;
}
.hero__lead {
  color: var(--muted);
  max-width: 46ch;
  margin-bottom: 1.6rem;
}
.hero__lead b { color: var(--ink); }
.hero__facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1.4rem;
  margin-top: 1.7rem;
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--muted);
}
.hero__facts svg { color: var(--gold); }

/* Key art frame */
.hero__art { perspective: 900px; }
.keyart-frame {
  position: relative;
  border: 3px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255, 211, 77, .15),
    0 0 40px rgba(176, 110, 237, .28),
    0 24px 70px rgba(0, 0, 0, .6);
  animation: heroFloat 6s ease-in-out infinite;
  transition: transform .3s ease, box-shadow .3s ease;
}
.keyart-frame:hover {
  box-shadow:
    0 0 0 1px rgba(255, 211, 77, .45),
    0 0 70px rgba(255, 211, 77, .35),
    0 0 120px rgba(176, 110, 237, .35),
    0 24px 70px rgba(0, 0, 0, .6);
}
@keyframes heroFloat {
  0%, 100% { transform: translateY(0) rotate3d(1, -1, 0, 2deg); }
  50% { transform: translateY(-14px) rotate3d(1, -1, 0, -2deg); }
}
.keyart-frame img { display: block; width: 100%; }
.keyart-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .08) 48%, transparent 62%);
  background-size: 250% 100%;
  animation: sheen 5.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes sheen {
  0%, 20% { background-position: 120% 0; }
  60%, 100% { background-position: -80% 0; }
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.scroll-hint__arrow {
  color: var(--gold);
  animation: bounceDown 1.6s ease-in-out infinite;
  text-shadow: 0 0 10px rgba(255, 211, 77, .7);
}
@keyframes bounceDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(7px); }
}

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  border-block: 2px solid var(--line);
  background: linear-gradient(90deg, rgba(176, 110, 237, .12), rgba(255, 211, 77, .1), rgba(102, 255, 158, .1));
  padding: .65rem 0;
}
.marquee__track {
  display: flex;
  white-space: nowrap;
  width: max-content;
  animation: marquee 22s linear infinite;
}
.marquee__track span {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: .18em;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(255, 211, 77, .55);
}
.marquee__track span:nth-child(even) {
  color: var(--purple-hot);
  text-shadow: 0 0 12px rgba(176, 110, 237, .55);
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- Sections ---------- */
.section { padding: clamp(4rem, 9vw, 7rem) 0; position: relative; }
.section-head { max-width: 640px; margin-bottom: clamp(2.2rem, 5vw, 3.4rem); }
.section-head.center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-mono);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--green);
  text-shadow: 0 0 12px rgba(102, 255, 158, .5);
  margin-bottom: .9rem;
}
.eyebrow::before { content: "//"; color: var(--purple); }
.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 5.4vw, 3.8rem);
  line-height: 1;
  letter-spacing: .03em;
  color: var(--ink);
  text-shadow: 0 0 24px rgba(176, 110, 237, .35);
  margin-bottom: 1rem;
}
.section-title--sm { font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
.section-lead { color: var(--muted); }
.section-lead b, .section-lead em { color: var(--ink); font-style: normal; }
.note {
  font-size: .85rem;
  color: var(--muted);
  font-family: var(--font-mono);
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}
.center { text-align: center; }

/* ---------- Panels & grids ---------- */
.panel {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 2px solid var(--line);
  border-radius: 6px;
  padding: 1.5rem;
  position: relative;
  transition: border-color .3s ease, box-shadow .3s ease, transform .3s ease;
}
.panel--pad { padding: clamp(1.5rem, 3.5vw, 2.4rem); }
.grid { display: grid; gap: 1.2rem; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }

/* ---------- The Loop ---------- */
.loop {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.loop-step { overflow: hidden; }
.loop-step:hover {
  border-color: var(--gold);
  box-shadow: var(--glow-gold);
  transform: translateY(-6px);
}
.loop-step__num {
  position: absolute;
  top: .2rem;
  right: .7rem;
  font-family: var(--font-display);
  font-size: 4.6rem;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--line);
  opacity: .9;
  pointer-events: none;
}
.loop-step:hover .loop-step__num { -webkit-text-stroke-color: var(--gold); }
.beat {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin-bottom: .9rem;
  padding: .25rem .7rem;
  border: 1px solid currentColor;
  border-radius: 2px;
}
.beat--gold { color: var(--gold); text-shadow: 0 0 10px rgba(255, 211, 77, .6); }
.beat--purple { color: var(--purple-hot); text-shadow: 0 0 10px rgba(176, 110, 237, .6); }
.beat--green { color: var(--green); text-shadow: 0 0 10px rgba(102, 255, 158, .6); }
.loop-step h3 {
  font-family: var(--font-pixel);
  font-size: 1.35rem;
  margin-bottom: .55rem;
}
.loop-step p { color: var(--muted); font-size: .95rem; }

/* ---------- Odds bars ---------- */
.odds {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: clamp(1.4rem, 4vw, 3rem);
  align-items: center;
  padding: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: 2.2rem;
}
.odds__head h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.9rem;
  color: var(--gold);
  text-shadow: 0 0 14px rgba(255, 211, 77, .45);
  margin-bottom: .5rem;
}
.odds__head .note { text-align: left; margin: 0; }
.odds__bars { display: grid; gap: .8rem; }
.odds-row {
  display: grid;
  grid-template-columns: 92px 1fr 58px;
  align-items: center;
  gap: .8rem;
  font-family: var(--font-mono);
  font-size: .8rem;
}
.odds-row__label { color: var(--oc); font-weight: 600; text-shadow: 0 0 10px color-mix(in srgb, var(--oc) 60%, transparent); }
.odds-row__track {
  height: 16px;
  background: rgba(0, 0, 0, .45);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.odds-row__fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--oc) 55%, transparent), var(--oc));
  box-shadow: 0 0 12px var(--oc);
  transition: width 1.1s cubic-bezier(.22, .8, .3, 1);
}
.odds-row__pct { text-align: right; color: var(--muted); }

/* ---------- Deck filter bar ---------- */
.deck-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
  margin-bottom: 1.8rem;
}
.chip {
  font-family: var(--font-mono);
  font-size: .82rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 3px;
  padding: .42rem .85rem;
  cursor: pointer;
  transition: all .2s ease;
}
.chip .count { opacity: .65; font-size: .75em; }
.chip:hover { border-color: var(--purple); color: var(--purple-hot); }
.chip.is-active {
  color: #140d00;
  background: var(--gold);
  border-color: #ffec9e;
  box-shadow: var(--glow-gold);
}
.chip[data-filter="common"].is-active { background: var(--r-common); border-color: #e3e8ef; box-shadow: 0 0 16px rgba(163, 171, 184, .5); }
.chip[data-filter="uncommon"].is-active { background: var(--r-uncommon); border-color: #b5f5c0; box-shadow: 0 0 16px rgba(102, 204, 118, .5); }
.chip[data-filter="rare"].is-active { background: var(--r-rare); border-color: #a8ccff; box-shadow: 0 0 16px rgba(82, 154, 245, .5); color: #061325; }
.chip[data-filter="epic"].is-active { background: var(--r-epic); border-color: #dcbaff; box-shadow: 0 0 16px rgba(176, 110, 237, .55); color: #1d0a33; }
.chip[data-filter="legendary"].is-active { background: var(--r-legendary); border-color: #ffdfa8; box-shadow: 0 0 16px rgba(247, 173, 61, .55); }
.deck-meter {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--muted);
}

/* ---------- Deck grid ---------- */
.deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 1rem;
  perspective: 1200px;
}
.spell-card {
  --rc: var(--r-common);
  background: linear-gradient(165deg, #1c1531 0%, #120d20 60%);
  border: 2px solid color-mix(in srgb, var(--rc) 55%, #000);
  border-radius: 6px;
  padding: .9rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  transform-style: preserve-3d;
  transition: box-shadow .25s ease, border-color .25s ease, opacity .4s ease, scale .4s ease;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  position: relative;
}
.spell-card[data-rarity="uncommon"] { --rc: var(--r-uncommon); }
.spell-card[data-rarity="rare"] { --rc: var(--r-rare); }
.spell-card[data-rarity="epic"] { --rc: var(--r-epic); }
.spell-card[data-rarity="legendary"] { --rc: var(--r-legendary); }
.spell-card:hover {
  border-color: var(--rc);
  box-shadow: 0 0 22px color-mix(in srgb, var(--rc) 45%, transparent),
              0 14px 34px rgba(0, 0, 0, .55);
  z-index: 2;
}
.spell-card.is-hidden { display: none; }
.spell-card__icon {
  width: 64px;
  height: 64px;
  margin-inline: auto;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--rc) 65%, transparent));
  transform: translateZ(30px);
}
.spell-card__name {
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: 1.02rem;
  text-align: center;
  color: var(--ink);
  transform: translateZ(22px);
}
.spell-card__rarity {
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  text-align: center;
  color: var(--rc);
  text-shadow: 0 0 10px color-mix(in srgb, var(--rc) 70%, transparent);
}
.spell-card__desc {
  font-size: .82rem;
  line-height: 1.45;
  color: var(--muted);
  transform: translateZ(12px);
}
.spell-card__cat {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: .68rem;
  color: color-mix(in srgb, var(--rc) 75%, var(--muted));
  border-top: 1px dashed var(--line);
  padding-top: .5rem;
}
.spell-card[data-rarity="legendary"]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background: linear-gradient(120deg, transparent 35%, rgba(255, 223, 168, .13) 50%, transparent 65%);
  background-size: 250% 100%;
  animation: sheen 4s ease-in-out infinite;
  pointer-events: none;
}

/* noscript deck */
.noscript-deck {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 6px;
  padding: 1.5rem;
}
.noscript-deck p { margin-bottom: 1rem; color: var(--muted); }
.noscript-deck ul { list-style: none; display: grid; gap: .45rem; font-size: .9rem; }
.noscript-deck b { color: var(--gold); }

/* ---------- Modes ---------- */
.mode-card { text-align: left; }
.mode-card:hover {
  border-color: var(--purple);
  box-shadow: var(--glow-purple);
  transform: translateY(-5px);
}
.mode-card .ico {
  display: inline-flex;
  padding: .6rem;
  border: 2px solid var(--line);
  border-radius: 6px;
  color: var(--gold);
  background: rgba(255, 211, 77, .06);
  box-shadow: inset 0 0 14px rgba(255, 211, 77, .08);
  margin-bottom: 1rem;
}
.mode-card .ico svg { width: 26px; height: 26px; }
.mode-card h3 { font-family: var(--font-pixel); font-size: 1.3rem; margin: .3rem 0 .5rem; }
.mode-card p { color: var(--muted); font-size: .95rem; }
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  padding: .2rem .6rem;
  border: 1px solid currentColor;
  border-radius: 2px;
  margin-left: .7rem;
  vertical-align: super;
}
.tag--gold { color: var(--gold); }
.tag--purple { color: var(--purple-hot); }
.tag--green { color: var(--green); }

/* ---------- Elo card ---------- */
.elo-card { text-align: center; }
.elo-num {
  font-family: var(--font-display);
  font-size: clamp(4rem, 9vw, 6.5rem);
  line-height: 1;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(255, 211, 77, .6), 0 0 60px rgba(247, 173, 61, .3);
}
.elo-tier {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--purple-hot);
  text-shadow: 0 0 12px rgba(176, 110, 237, .55);
  margin: .4rem 0 .6rem;
}
.elo-desc { color: var(--muted); max-width: 46ch; margin: 0 auto 1.4rem; font-size: .95rem; }
.slider {
  width: min(520px, 100%);
  appearance: none;
  height: 10px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--green), var(--gold), #ff5d5d);
  border: 1px solid var(--line);
  cursor: pointer;
}
.slider::-webkit-slider-thumb {
  appearance: none;
  width: 26px; height: 26px;
  border-radius: 3px;
  background: var(--gold);
  border: 2px solid #ffec9e;
  box-shadow: var(--glow-gold);
  cursor: grab;
}
.slider::-moz-range-thumb {
  width: 24px; height: 24px;
  border-radius: 3px;
  background: var(--gold);
  border: 2px solid #ffec9e;
  box-shadow: var(--glow-gold);
  cursor: grab;
}
.slider-scale {
  display: flex;
  justify-content: space-between;
  width: min(520px, 100%);
  margin: .55rem auto 0;
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted);
}

/* ---------- Variants ---------- */
.variants {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.variant { border-top: 3px solid var(--vc, var(--gold)); }
.variant:hover {
  box-shadow: 0 0 22px color-mix(in srgb, var(--vc) 40%, transparent);
  transform: translateY(-5px);
}
.variant h4 {
  font-family: var(--font-pixel);
  font-size: 1.15rem;
  color: var(--vc);
  text-shadow: 0 0 12px color-mix(in srgb, var(--vc) 55%, transparent);
  margin: .45rem 0;
}
.variant p { color: var(--muted); font-size: .88rem; }
.vtag {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Achievements ---------- */
.ach-row {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .9rem;
  margin-top: 1.2rem;
}
.ach-row li {
  width: 58px; height: 58px;
  border: 2px solid var(--line);
  border-radius: 4px;
  background: #0b0817;
  display: grid;
  place-items: center;
  transition: transform .2s ease, box-shadow .25s ease, border-color .25s ease;
}
.ach-row li:hover {
  transform: translateY(-5px) scale(1.1);
  border-color: var(--gold);
  box-shadow: var(--glow-gold);
}
.ach-row img { width: 46px; height: 46px; }

/* ---------- Glance / sysreq ---------- */
.glance {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .7rem 2rem;
  font-size: .95rem;
  color: var(--muted);
}
.glance b { color: var(--ink); }
.tick { color: var(--green); margin-right: .4rem; text-shadow: 0 0 10px rgba(102, 255, 158, .6); }
.sysreq {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-bottom: 1.6rem;
}
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table caption {
  font-family: var(--font-display);
  font-size: 1.6rem;
  text-align: left;
  color: var(--purple-hot);
  text-shadow: 0 0 12px rgba(176, 110, 237, .5);
  padding-bottom: .7rem;
}
.data-table th, .data-table td {
  text-align: left;
  padding: .5rem .6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.data-table th {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  width: 110px;
}
.data-table td { color: var(--muted); }
.data-table tr:last-child th, .data-table tr:last-child td { border-bottom: 0; }

/* ---------- FAQ ---------- */
.faq { max-width: 780px; margin-inline: auto; display: grid; gap: .8rem; }
.qa {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 2px solid var(--line);
  border-radius: 6px;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.qa[open] { border-color: var(--purple); box-shadow: var(--glow-purple); }
.qa summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  font-weight: 700;
  font-size: 1.02rem;
}
.qa summary::-webkit-details-marker { display: none; }
.q-ico {
  flex: none;
  color: var(--gold);
  transition: transform .3s ease;
}
.qa[open] .q-ico { transform: rotate(45deg); }
.qa__body {
  padding: 0 1.2rem 1.1rem;
  color: var(--muted);
  font-size: .95rem;
}
.qa__body p + p { margin-top: .6rem; }
.qa__body b { color: var(--ink); }

/* ---------- Final CTA ---------- */
.cta-final {
  text-align: center;
  background:
    radial-gradient(ellipse 60% 70% at 50% 40%, rgba(176, 110, 237, .16), transparent 70%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.4rem, 4vw, 3rem);
  box-shadow: 0 0 60px rgba(176, 110, 237, .15), inset 0 0 80px rgba(0, 0, 0, .35);
}
.cta-logo {
  width: min(560px, 88%);
  margin-bottom: 1.4rem;
  filter: drop-shadow(0 0 26px rgba(255, 211, 77, .3));
}
.cta-final p { color: var(--muted); max-width: 48ch; margin: 0 auto 1.8rem; }
.cta-final .wrap-cta { justify-content: center; }

/* ---------- Footer ---------- */
.footer {
  border-top: 2px solid var(--line);
  background: #050409;
  padding: 3rem 0 2rem;
}
.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.2rem;
}
.footer__brand p { color: var(--muted); font-size: .9rem; margin-top: .8rem; max-width: 34ch; }
.footer h2 {
  font-family: var(--font-mono);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .9rem;
}
.footer__grid > div:not(.footer__brand) a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  font-size: .92rem;
  padding: .22rem 0;
  transition: color .2s ease, text-shadow .2s ease;
}
.footer__grid a:hover { color: var(--gold); text-shadow: 0 0 10px rgba(255, 211, 77, .5); }
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 2rem;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 1.3rem;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--muted);
}

/* ---------- Reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .3, 1);
}
.reveal.is-in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .12s; }
.reveal.d2 { transition-delay: .24s; }
.reveal.d3 { transition-delay: .36s; }

/* Deck cards stagger in via JS-added transition-delay */
.spell-card.pre-in {
  opacity: 0;
  scale: .92;
}
.spell-card.is-in { opacity: 1; scale: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__art { order: -1; max-width: 560px; }
  .loop, .cols-3 { grid-template-columns: 1fr; }
  .cols-2, .sysreq, .glance { grid-template-columns: 1fr; }
  .variants { grid-template-columns: repeat(2, 1fr); }
  .odds { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav__links {
    position: fixed;
    top: 64px; right: 0;
    flex-direction: column;
    background: rgba(7, 6, 13, .97);
    border: 2px solid var(--line);
    border-right: 0;
    border-radius: 0 0 0 8px;
    padding: 1rem 1.6rem;
    gap: .9rem;
    transform: translateX(110%);
    transition: transform .3s ease;
  }
  .nav__links.is-open { transform: none; }
  .nav__toggle { display: block; }
  .nav__cta { display: none; }
  .variants { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .scroll-hint { display: none; }
  .deck-meter { width: 100%; margin-left: 0; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal, .spell-card.pre-in { opacity: 1; transform: none; scale: 1; }
  .marquee__track { animation: none; width: 100%; overflow: hidden; }
  #embers { display: none; }
  .cursor-glow { display: none; }
}
