/* ============================================================
   Veilforge — Design System
   Edit the CSS variables below to re-theme the whole site.
   ============================================================ */

:root {
  /* Core palette — cosmic eclipse (deep void + cyan/teal corona) */
  --bg:            #05060d;
  --bg-2:          #080b18;
  --surface:       #0e1526;
  --surface-2:     #131d33;
  --border:        #243651;
  --border-soft:   #18243d;

  /* Text */
  --text:          #eaf2ff;
  --text-muted:    #9fb2d4;
  --text-dim:      #62749b;

  /* Accents — veil cyan + astral blue (mirrors the logo & color key) */
  --veil:          #2fd9e6;   /* veil cyan (primary) */
  --veil-bright:   #74ecf4;
  --ember:         #3b74ff;   /* astral blue (secondary) */
  --ember-bright:  #76a4ff;
  --ember-deep:    #1d49c4;
  --teal:          #2fe0b0;

  /* Stat colors (card gallery) */
  --r-common:      #9aa5b1;
  --r-uncommon:    #3fb950;
  --r-rare:        #4493f8;
  --r-mythic:      #2fd9e6;
  --r-legendary:   #74ecf4;

  /* Effects */
  --glow-ember: 0 0 24px rgba(59, 116, 255, 0.40);
  --glow-veil:  0 0 26px rgba(47, 217, 230, 0.40);
  --shadow-lg:  0 24px 60px -20px rgba(0, 0, 0, 0.8);
  --shadow-md:  0 12px 30px -12px rgba(0, 0, 0, 0.7);

  /* Type */
  --font-display: 'Cinzel', 'Times New Roman', serif;
  --font-accent:  'Cormorant Garamond', Georgia, serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Layout */
  --maxw: 1180px;
  --radius: 14px;
  --radius-sm: 9px;
  --nav-h: 70px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Ambient background texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 620px at 78% -12%, rgba(47,217,230,0.14), transparent 60%),
    radial-gradient(820px 520px at 8% 108%, rgba(59,116,255,0.12), transparent 55%),
    radial-gradient(600px 600px at 50% 50%, rgba(47,224,176,0.05), transparent 70%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; }
.section-sm { padding: 56px 0; }

.eyebrow {
  font-family: var(--font-display);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ember);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 12px 0 16px;
  letter-spacing: 0.01em;
}

.section-intro {
  color: var(--text-muted);
  max-width: 620px;
  font-size: 1.05rem;
}

.center { text-align: center; }
.center .section-intro { margin-inline: auto; }

.gradient-text {
  background: linear-gradient(100deg, var(--ember-bright), var(--ember) 40%, var(--veil-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  overflow: hidden;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease, background .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
/* shine sweep */
.btn::after {
  content: "";
  position: absolute; top: 0; left: -120%;
  width: 70%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-18deg);
  transition: left .55s ease;
  pointer-events: none;
}
.btn:hover::after { left: 130%; }

.btn-primary {
  background: linear-gradient(110deg, var(--veil) 0%, var(--ember) 60%, var(--ember-deep) 100%);
  background-size: 180% 100%;
  background-position: 0% 0%;
  color: #04121e;
  font-weight: 700;
  box-shadow: 0 6px 20px -6px rgba(47,217,230,0.6), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease, background-position .4s ease;
}
.btn-primary:hover { transform: translateY(-2px); background-position: 100% 0%; box-shadow: 0 10px 30px -6px rgba(47,217,230,0.75), inset 0 1px 0 rgba(255,255,255,0.3); }

.btn-ghost {
  background: rgba(255,255,255,0.03);
  border-color: var(--border);
  color: var(--text);
  backdrop-filter: blur(4px);
}
.btn-ghost:hover { border-color: var(--veil); background: rgba(47,217,230,0.1); transform: translateY(-2px); box-shadow: 0 6px 22px -10px rgba(47,217,230,0.5); }

.btn-lg { padding: 16px 34px; font-size: 1.02rem; }

/* ---------- Navbar ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(12,10,18,0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--ember), var(--veil));
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: #120c1c;
  box-shadow: var(--glow-ember);
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.06em;
}

.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: ""; display: block; height: 2px; margin-top: 4px;
  background: linear-gradient(90deg, var(--ember), var(--veil));
  border-radius: 2px;
}
.nav-cta { margin-left: 10px; }
.nav-links a.btn-primary { color: #04121e; }
.nav-links a.btn-primary:hover { color: #04121e; background-color: transparent; }

.nav-toggle {
  display: none;
  background: none; border: none;
  width: 42px; height: 42px;
  border-radius: 8px;
  color: var(--text);
}
.nav-toggle:hover { background: rgba(255,255,255,0.05); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 120px 0 110px;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: 0.01em;
  margin: 18px 0;
}
.hero p.lead {
  font-size: 1.18rem;
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 32px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-stats {
  display: flex; gap: 36px; margin-top: 46px;
  border-top: 1px solid var(--border-soft);
  padding-top: 26px;
}
.hero-stats .num {
  font-family: var(--font-display);
  font-size: 1.9rem; font-weight: 700;
  color: var(--ember-bright);
}
.hero-stats .label { font-size: 0.82rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.12em; }

/* Hero art — fanned cards */
.hero-art { position: relative; height: 460px; display: grid; place-items: center; }
.card-fan { position: relative; width: 260px; height: 380px; }
.fan-card {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow-lg);
  transform-origin: bottom center;
  overflow: hidden;
}
.fan-card::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 50% 0%, rgba(47,217,230,0.18), transparent 60%);
}
.fan-card:nth-child(1) { transform: rotate(-16deg) translateX(-46px) translateY(10px); }
.fan-card:nth-child(2) { transform: rotate(0deg) translateY(-12px); z-index: 3; }
.fan-card:nth-child(3) { transform: rotate(16deg) translateX(46px) translateY(10px); }
.fan-card .glyph {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  font-family: var(--font-display); font-size: 3.4rem; color: var(--text-dim);
  opacity: 0.6;
}

/* ---------- Feature cards ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }

.feature {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 30px;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.feature:hover { transform: translateY(-4px); border-color: var(--border); box-shadow: var(--shadow-md); }
.feature .icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(47,217,230,0.12);
  border: 1px solid rgba(47,217,230,0.28);
  font-size: 1.5rem; margin-bottom: 18px;
}
.feature h3 { font-family: var(--font-display); font-size: 1.22rem; margin-bottom: 8px; }
.feature p { color: var(--text-muted); font-size: 0.98rem; }

/* ---------- Factions strip ---------- */
.factions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.faction {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 26px 22px;
  background: var(--surface);
  position: relative;
  overflow: hidden;
}
.faction .crest { font-size: 2rem; margin-bottom: 14px; }
.faction h4 { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 6px; }
.faction p { color: var(--text-muted); font-size: 0.9rem; }
.faction::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--accent, var(--ember));
}

/* ---------- CTA band ---------- */
.cta-band {
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(47,217,230,0.18), transparent 60%),
    linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 56px 40px;
  text-align: center;
}
.cta-band h2 { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 14px; }
.cta-band p { color: var(--text-muted); max-width: 560px; margin: 0 auto 28px; }

/* ---------- Rules page ---------- */
.rules-layout { display: grid; grid-template-columns: 240px 1fr; gap: 48px; align-items: start; }
.rules-toc {
  position: sticky; top: calc(var(--nav-h) + 24px);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--surface);
}
.rules-toc h4 { font-family: var(--font-display); font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 12px; }
.rules-toc a { display: block; padding: 7px 10px; border-radius: 7px; font-size: 0.92rem; color: var(--text-muted); }
.rules-toc a:hover { background: rgba(255,255,255,0.04); color: var(--text); }

.rule-block { margin-bottom: 48px; scroll-margin-top: calc(var(--nav-h) + 20px); }
.rule-block h2 {
  font-family: var(--font-display); font-size: 1.7rem; margin-bottom: 14px;
  display: flex; align-items: center; gap: 12px;
}
.rule-block h2 .step-no {
  width: 38px; height: 38px; flex: none; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--ember), var(--ember-deep));
  font-size: 1rem; color: #fff;
}
.rule-block h3 { font-family: var(--font-display); font-size: 1.15rem; margin: 22px 0 8px; color: var(--ember-bright); }
.rule-block p, .rule-block li { color: var(--text-muted); }
.rule-block ul, .rule-block ol { padding-left: 22px; margin: 10px 0; }
.rule-block li { margin-bottom: 8px; }

.callout {
  border-left: 3px solid var(--veil);
  background: rgba(47,217,230,0.07);
  padding: 16px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 20px 0;
  color: var(--text-muted);
}
.callout strong { color: var(--veil-bright); }

/* anatomy diagram */
.anatomy {
  display: grid; grid-template-columns: 300px 1fr; gap: 34px; align-items: start;
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 28px; margin-top: 16px;
}
.anatomy-img { width: 100%; max-width: 300px; border-radius: 14px; box-shadow: var(--shadow-lg); display: block; justify-self: center; }
.anatomy-card {
  aspect-ratio: 5/7;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  padding: 14px;
  display: flex; flex-direction: column;
  position: relative;
}
.anatomy-card .ac-top { display: flex; justify-content: space-between; font-family: var(--font-display); }
.anatomy-card .ac-cost { width: 30px; height: 30px; border-radius: 50%; background: var(--veil); color:#120c1c; display:grid; place-items:center; font-weight:700;}
.anatomy-card .ac-art { flex: 1; margin: 12px 0; border-radius: 8px; background: repeating-linear-gradient(45deg, rgba(255,255,255,0.03) 0 10px, transparent 10px 20px); border:1px dashed var(--border); display:grid; place-items:center; color: var(--text-dim); }
.anatomy-card .ac-stats { display: flex; justify-content: space-between; font-family: var(--font-display); font-weight: 700; }
.anatomy-list li { margin-bottom: 12px; color: var(--text-muted); }
.anatomy-list b { color: var(--text); }

/* ---------- Card gallery ---------- */
.gallery-controls {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: center;
  margin-bottom: 30px;
}
.search-wrap { position: relative; flex: 1; min-width: 220px; }
.search-wrap input {
  width: 100%; padding: 13px 16px 13px 42px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 0.97rem;
}
.search-wrap input:focus { outline: none; border-color: var(--veil); box-shadow: var(--glow-veil); }
.search-wrap .s-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-dim); }

.filter-group { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 9px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 0.86rem; font-weight: 500;
  transition: all .15s;
}
.chip:hover { color: var(--text); border-color: var(--veil); }
.chip.active { background: linear-gradient(100deg, var(--ember-deep), var(--ember)); color: #fff; border-color: transparent; }

.results-meta { color: var(--text-dim); font-size: 0.88rem; margin-bottom: 18px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 18px;
}

.game-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border-soft);
  background: var(--surface);
  transition: transform .18s ease, box-shadow .2s ease, border-color .2s ease;
}
.game-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--veil); }
.gc-img {
  width: 100%; aspect-ratio: 5/7; object-fit: cover; display: block;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
}
.gc-typebadge {
  position: absolute; top: 8px; right: 8px;
  font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700;
  padding: 4px 8px; border-radius: 6px;
  background: rgba(5,6,13,0.8); border: 1px solid var(--border); color: var(--veil-bright);
  backdrop-filter: blur(4px);
}
.gc-body { padding: 10px 12px 12px; }
.gc-name { font-family: var(--font-display); font-size: 0.9rem; line-height: 1.2; }
.gc-meta { font-size: 0.72rem; color: var(--text-dim); margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.gc-meta .dot { color: var(--border); }

.empty-state { text-align: center; padding: 80px 20px; color: var(--text-dim); grid-column: 1/-1; }

/* Card modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(5,4,9,0.78); backdrop-filter: blur(6px);
  display: none; place-items: center; padding: 24px;
}
.modal-overlay.open { display: grid; }
.modal {
  width: 100%; max-width: 740px;
  background: linear-gradient(170deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: pop .22s ease;
  display: grid; grid-template-columns: 300px 1fr;
  max-height: 90vh;
}
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-art { background: #05060d; display: grid; place-items: center; padding: 18px; }
.modal-art img { width: 100%; border-radius: 10px; box-shadow: var(--shadow-md); }
.modal-body { padding: 26px; overflow-y: auto; }
.modal-body h3 { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: 4px; line-height: 1.15; }
.modal-body .gc-type { font-size: 0.82rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; }
.modal-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.tag { font-size: 0.76rem; padding: 5px 11px; border-radius: 999px; background: rgba(47,217,230,0.08); border: 1px solid var(--border); color: var(--text-muted); }
.tag.stat { font-family: var(--font-display); font-weight: 700; color: var(--veil-bright); }
.modal-text { color: var(--text-muted); margin-bottom: 18px; white-space: pre-line; font-size: 0.95rem; }
.modal-flavor { font-family: var(--font-accent); font-style: italic; font-size: 1rem; color: var(--text-dim); border-top: 1px solid var(--border-soft); padding-top: 14px; }
@media (max-width: 680px) {
  .modal { grid-template-columns: 1fr; max-height: 92vh; overflow-y: auto; }
  .modal-art { padding: 18px 18px 0; }
  .modal-art img { max-width: 220px; margin: 0 auto; }
}

/* ---------- Store ---------- */
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.product {
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.product:hover { transform: translateY(-5px); border-color: var(--ember); box-shadow: var(--shadow-md); }
.product.featured { border-color: var(--ember); box-shadow: var(--glow-ember); }
.product-art {
  aspect-ratio: 4/3;
  background: linear-gradient(150deg, rgba(59,116,255,0.18), rgba(47,217,230,0.16));
  display: grid; place-items: center; font-size: 3.4rem;
  position: relative; overflow: hidden;
}
.product-art img { width: 100%; height: 100%; object-fit: contain; padding: 22px; }
.product-badge {
  position: absolute; top: 14px; right: 14px;
  background: linear-gradient(100deg, var(--ember-deep), var(--ember));
  color: #fff; font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 5px 12px; border-radius: 999px;
}
.product-body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.product-body h3 { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 6px; }
.product-body p { color: var(--text-muted); font-size: 0.94rem; flex: 1; margin-bottom: 18px; }
.product-foot { display: flex; align-items: center; justify-content: space-between; }
.price { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: var(--ember-bright); }
.price small { font-size: 0.8rem; color: var(--text-dim); font-weight: 400; }

.store-perks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 56px; }
.perk { text-align: center; padding: 20px; }
.perk .p-icon { font-size: 1.8rem; margin-bottom: 10px; }
.perk h4 { font-family: var(--font-display); font-size: 1rem; margin-bottom: 4px; }
.perk p { color: var(--text-muted); font-size: 0.86rem; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border-soft);
  background: var(--bg-2);
  padding: 56px 0 32px;
  margin-top: 40px;
}
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 36px; margin-bottom: 40px; }
.footer-grid h5 { font-family: var(--font-display); font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 14px; }
.footer-grid a { display: block; color: var(--text-muted); padding: 5px 0; font-size: 0.93rem; }
.footer-grid a:hover { color: var(--ember-bright); }
.footer .blurb { color: var(--text-muted); font-size: 0.93rem; max-width: 280px; margin-top: 12px; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 24px; border-top: 1px solid var(--border-soft); color: var(--text-dim); font-size: 0.86rem; flex-wrap: wrap; gap: 12px; }
.socials { display: flex; gap: 10px; }
.socials a { width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-muted); transition: all .15s; }
.socials a:hover { color: var(--ember-bright); border-color: var(--ember); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Page header (sub-pages) ---------- */
.page-head { padding: 70px 0 40px; text-align: center; }
.page-head h1 { font-family: var(--font-display); font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 12px; }
.page-head p { color: var(--text-muted); max-width: 560px; margin: 0 auto; }

/* ---------- Brand logo (replaces text mark) ---------- */
.brand-logo { display: block; width: auto; filter: drop-shadow(0 0 10px rgba(47,217,230,0.35)); }
.nav .brand-logo { height: 40px; }
.footer .brand-logo { height: 46px; margin-bottom: 4px; }

/* ---------- Hero (logo + portraits) ---------- */
.hero-logo { width: min(540px, 92%); height: auto; filter: drop-shadow(0 0 34px rgba(47,217,230,0.45)); }
.hero-portrait-stack { position: relative; height: 460px; display: grid; place-items: center; }
.hero-portrait-stack .portrait { position: absolute; width: 220px; box-shadow: var(--shadow-lg); }
.hero-portrait-stack .portrait:nth-child(1) { transform: rotate(-9deg) translateX(-120px) translateY(14px) scale(.9); z-index: 1; }
.hero-portrait-stack .portrait:nth-child(2) { transform: translateY(-10px); z-index: 3; }
.hero-portrait-stack .portrait:nth-child(3) { transform: rotate(9deg) translateX(120px) translateY(14px) scale(.9); z-index: 1; }

/* ---------- Set showcase ---------- */
.set-card {
  position: relative; border: 1px solid var(--border-soft); border-radius: var(--radius);
  overflow: hidden; background: linear-gradient(180deg, var(--surface), var(--bg-2));
  transition: transform .2s, border-color .2s, box-shadow .2s; display: flex; flex-direction: column;
}
.set-card:hover { transform: translateY(-5px); border-color: var(--veil); box-shadow: var(--shadow-md); }
.set-logo-wrap { aspect-ratio: 16/9; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.set-logo-wrap::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 42%, var(--set-glow, rgba(47,217,230,0.20)), transparent 70%); }
.set-logo-wrap img { max-height: 120px; width: auto; max-width: 92%; position: relative; z-index: 1; filter: drop-shadow(0 6px 18px rgba(0,0,0,0.55)); }
.set-body { padding: 4px 22px 0; }
.set-card h3 { font-family: var(--font-display); font-size: 1.25rem; margin-bottom: 6px; }
.set-card p { color: var(--text-muted); font-size: 0.92rem; }
.set-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding: 18px 22px 20px; }
.set-count { font-size: 0.8rem; color: var(--text-dim); }

/* ---------- Hero portraits (spotlight) ---------- */
.spotlight { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 44px; }
.portrait { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border-soft); position: relative; aspect-ratio: 3/4; background: var(--surface); }
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portrait .pcap { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 11px; background: linear-gradient(180deg, transparent, rgba(5,6,13,0.94)); font-family: var(--font-display); font-size: 0.85rem; line-height: 1.2; }
.portrait .pcap small { display: block; font-family: var(--font-body); font-size: 0.72rem; color: var(--veil-bright); margin-top: 2px; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .spotlight { grid-template-columns: repeat(2, 1fr); }
  .hero-portrait-stack { height: 380px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-art { height: 380px; }
  .grid-3, .factions, .product-grid, .store-perks { grid-template-columns: repeat(2, 1fr); }
  .rules-layout { grid-template-columns: 1fr; }
  .rules-toc { position: static; }
  .anatomy { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .section { padding: 64px 0; }
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg-2); border-bottom: 1px solid var(--border);
    padding: 12px; transform: translateY(-130%); transition: transform .25s ease;
    box-shadow: var(--shadow-lg);
  }
  .nav-links.open { transform: none; }
  .nav-links a { padding: 12px 14px; }
  .nav-cta { margin: 6px 0 0; }
  .nav-toggle { display: grid; place-items: center; }
  .grid-3, .factions, .product-grid, .store-perks, .grid-2 { grid-template-columns: 1fr; }
  .hero-stats { gap: 24px; flex-wrap: wrap; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   POLISH & MOTION
   ============================================================ */

/* ---- Global details ---- */
::selection { background: rgba(47,217,230,0.35); color: #fff; }
* { scrollbar-color: var(--veil) transparent; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--veil), var(--ember));
  border-radius: 99px; border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(var(--veil-bright), var(--veil)); }
:focus-visible { outline: 2px solid var(--veil); outline-offset: 3px; border-radius: 6px; }
a, button { -webkit-tap-highlight-color: transparent; }

/* ---- Cosmic canvas (starfield) ---- */
#cosmos { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .9; }

/* ---- Navbar: glow on scroll ---- */
.nav { transition: background .3s ease, box-shadow .3s ease, border-color .3s ease; }
.nav.scrolled {
  background: rgba(7,10,20,0.82);
  box-shadow: 0 10px 30px -16px rgba(0,0,0,0.9), 0 1px 0 rgba(47,217,230,0.15);
  border-bottom-color: rgba(47,217,230,0.18);
}
.brand:hover .brand-logo { filter: drop-shadow(0 0 14px rgba(47,217,230,0.7)); transition: filter .3s ease; }
.nav-links a { position: relative; }

/* ---- Hero ambiance ---- */
.hero { position: relative; isolation: isolate; }
.hero::after {
  content: ""; position: absolute; z-index: -1;
  top: 8%; left: 50%; width: 760px; height: 760px; transform: translateX(-50%);
  background: radial-gradient(circle, rgba(47,217,230,0.16), rgba(59,116,255,0.07) 38%, transparent 62%);
  filter: blur(8px);
  animation: aura 9s ease-in-out infinite;
}
@keyframes aura {
  0%,100% { opacity: .7; transform: translateX(-50%) scale(1); }
  50%     { opacity: 1;  transform: translateX(-50%) scale(1.08); }
}
.hero-logo { animation: logoFloat 7s ease-in-out infinite; }
@keyframes logoFloat {
  0%,100% { transform: translateY(0); filter: drop-shadow(0 0 26px rgba(47,217,230,0.4)); }
  50%     { transform: translateY(-8px); filter: drop-shadow(0 0 40px rgba(47,217,230,0.62)); }
}

/* ---- Floating hero portrait stack ---- */
.hero-portrait-stack .portrait { transition: transform .35s cubic-bezier(.34,1.56,.64,1), box-shadow .3s ease; }
.hero-portrait-stack .portrait:nth-child(1) { animation: floatA 6.5s ease-in-out infinite; }
.hero-portrait-stack .portrait:nth-child(2) { animation: floatB 7.5s ease-in-out infinite; }
.hero-portrait-stack .portrait:nth-child(3) { animation: floatA 8s ease-in-out infinite .4s; }
.hero-portrait-stack:hover .portrait:nth-child(2) { transform: translateY(-18px) scale(1.04); z-index: 4; box-shadow: 0 26px 50px -18px rgba(0,0,0,.85), var(--glow-veil); }
@keyframes floatA { 0%,100% { translate: 0 0; } 50% { translate: 0 -12px; } }
@keyframes floatB { 0%,100% { translate: 0 -10px; } 50% { translate: 0 4px; } }

/* ---- Portrait cards: zoom + glow ---- */
.portrait { transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease; }
.portrait img { transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.portrait:hover { border-color: var(--veil); box-shadow: 0 18px 40px -18px rgba(0,0,0,.8), 0 0 22px -8px rgba(47,217,230,.6); transform: translateY(-4px); }
.portrait:hover img { transform: scale(1.07); }
.portrait .pcap { transition: padding .3s ease; }

/* ---- Holographic card gallery ---- */
.card-grid { perspective: 1200px; }
.game-card {
  transform: rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)) translateY(var(--lift,0)) scale(var(--sc,1));
  transform-style: preserve-3d;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .25s ease, border-color .2s ease;
  will-change: transform;
}
.game-card.tilting { transition: box-shadow .25s ease, border-color .2s ease; }
.game-card:hover { --lift: -4px; --sc: 1.015; border-color: var(--veil);
  box-shadow: 0 22px 46px -18px rgba(0,0,0,.85), 0 0 26px -8px rgba(47,217,230,.55); }
.gc-img { transition: filter .3s ease; }
.game-card:hover .gc-img { filter: saturate(1.08) brightness(1.04); }
.gc-shine {
  position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit;
  background: radial-gradient(circle at var(--mx,50%) var(--my,0%), rgba(255,255,255,.3), rgba(255,255,255,0) 42%);
  opacity: 0; transition: opacity .3s ease; mix-blend-mode: screen;
}
.gc-holo {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, transparent 32%, rgba(47,217,230,.22) 44%, rgba(59,116,255,.16) 50%, rgba(47,224,176,.2) 56%, transparent 68%);
  background-size: 220% 220%;
  background-position: var(--hx,50%) var(--hy,50%);
  opacity: 0; transition: opacity .3s ease; mix-blend-mode: color-dodge;
}
.game-card:hover .gc-shine { opacity: 1; }
.game-card:hover .gc-holo { opacity: .65; }
.gc-typebadge { z-index: 4; }

/* ---- Staggered reveals ---- */
.reveal { transition: opacity .6s cubic-bezier(.2,.8,.2,1), transform .6s cubic-bezier(.2,.8,.2,1); }
.grid-3 > .reveal:nth-child(2), .product-grid > .reveal:nth-child(2) { transition-delay: .08s; }
.grid-3 > .reveal:nth-child(3), .product-grid > .reveal:nth-child(3) { transition-delay: .16s; }
.spotlight > *:nth-child(1) { transition-delay: 0s; }
.spotlight > *:nth-child(2) { transition-delay: .07s; }
.spotlight > *:nth-child(3) { transition-delay: .14s; }
.spotlight > *:nth-child(4) { transition-delay: .21s; }

/* ---- Section title flourish ---- */
.section-title { position: relative; }
.section-title::after {
  content: ""; display: block; width: 60px; height: 3px; margin-top: 16px; border-radius: 3px;
  background: linear-gradient(90deg, var(--veil), var(--ember));
  box-shadow: 0 0 12px rgba(47,217,230,.5);
}
.center .section-title::after { margin-left: auto; margin-right: auto; }

/* ---- Set cards: animated glow + logo lift ---- */
.set-card { transition: transform .3s cubic-bezier(.2,.8,.2,1), border-color .3s ease, box-shadow .3s ease; }
.set-card:hover { box-shadow: 0 26px 54px -22px rgba(0,0,0,.85), 0 0 28px -10px var(--set-glow, rgba(47,217,230,.4)); }
.set-logo-wrap img { transition: transform .4s cubic-bezier(.34,1.56,.64,1), filter .3s ease; }
.set-card:hover .set-logo-wrap img { transform: scale(1.06) translateY(-2px); filter: drop-shadow(0 10px 24px rgba(0,0,0,.6)); }
.set-logo-wrap::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 38%, var(--set-glow, rgba(47,217,230,.25)), transparent 60%);
  opacity: 0; transition: opacity .4s ease;
}
.set-card:hover .set-logo-wrap::after { opacity: .9; }

/* ---- Feature card hover spark ---- */
.feature { transition: transform .25s cubic-bezier(.2,.8,.2,1), border-color .25s ease, box-shadow .25s ease; }
.feature:hover .icon { box-shadow: 0 0 22px -4px rgba(47,217,230,.6); transform: translateY(-2px) rotate(-4deg); transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .3s ease; }
.feature .icon { transition: transform .3s ease, box-shadow .3s ease; }

/* ---- Chips & search refinements ---- */
.chip { transition: all .18s ease; }
.chip.active { box-shadow: 0 6px 18px -8px rgba(47,217,230,.7); }
.search-wrap input { transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }
.search-wrap input:focus { background: var(--surface-2); }

/* ---- Brand mark (numbered steps) glow ---- */
.brand-mark { transition: transform .25s ease, box-shadow .25s ease; }
li:hover > .brand-mark { transform: scale(1.08) rotate(-3deg); }

/* ---- 6-up hero spotlight (Settings page) ---- */
.spotlight.six { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 900px) { .spotlight.six { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .spotlight.six { grid-template-columns: repeat(2, 1fr); } }

/* ---- Scroll-to-top button ---- */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--veil), var(--ember));
  color: #04121e; font-size: 1.1rem; border: none;
  box-shadow: 0 10px 26px -8px rgba(47,217,230,.6);
  opacity: 0; transform: translateY(20px) scale(.8); pointer-events: none;
  transition: opacity .3s ease, transform .3s cubic-bezier(.34,1.56,.64,1);
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { transform: translateY(-3px) scale(1.06); }

/* ---- Store: setting sections + deck cards ---- */
.set-section { margin-bottom: 64px; }
.set-section-head { display: flex; align-items: center; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.set-section-head img { height: 66px; width: auto; filter: drop-shadow(0 0 16px var(--g, rgba(47,217,230,0.35))); }
.set-section-head .ssh-text h2 { font-family: var(--font-display); font-size: 1.55rem; line-height: 1.1; }
.set-section-head .ssh-text p { color: var(--text-muted); font-size: 0.9rem; margin-top: 2px; }

.deck-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.deck-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--border-soft); border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  transition: transform .25s cubic-bezier(.2,.8,.2,1), border-color .25s ease, box-shadow .25s ease;
}
.deck-card:hover { transform: translateY(-6px); border-color: var(--veil);
  box-shadow: 0 24px 48px -20px rgba(0,0,0,.85), 0 0 26px -10px var(--g, rgba(47,217,230,.45)); }
.deck-art { aspect-ratio: 4/3; position: relative; overflow: hidden; background: #05060d; }
.deck-art img { width: 100%; height: 100%; object-fit: cover; object-position: center top; transition: transform .45s ease; }
.deck-card:hover .deck-art img { transform: scale(1.06); }
.deck-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 52%, rgba(5,6,13,.82)); }
.deck-body { padding: 15px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.deck-tag { font-family: var(--font-display); font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--veil-bright); margin-bottom: 6px; }
.deck-card h4 { font-family: var(--font-display); font-size: 1.1rem; line-height: 1.15; margin-bottom: 8px; }
.deck-heroes { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; flex: 1; margin-bottom: 16px; }
.deck-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.deck-foot .price { font-size: 1.4rem; }
@media (max-width: 920px) { .deck-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .deck-grid { grid-template-columns: 1fr; } }

/* ---- Show full card art in portrait slots (home + settings) ---- */
.portrait.cardart { aspect-ratio: 600 / 848; background: #05060d; }
.portrait.cardart .pcap { display: none; }
.portrait.cardart img { object-fit: cover; }

/* ---- Store bundle: 4-deck preview per setting ---- */
.mini-decks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.mini { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--border-soft); aspect-ratio: 16/9; }
.mini img { width: 100%; height: 100%; object-fit: cover; object-position: center top; transition: transform .4s ease; }
.set-card:hover .mini img { transform: scale(1.05); }
.mini span { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 8px 6px; background: linear-gradient(180deg, transparent, rgba(5,6,13,.92)); font-size: 0.66rem; font-family: var(--font-display); line-height: 1.12; }

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .hero::after, .hero-logo, .hero-portrait-stack .portrait { animation: none !important; }
  #cosmos { display: none; }
}

/* ============================================================
   DECK BUILDER
   ============================================================ */
.db-layout { display: grid; grid-template-columns: 1fr 384px; gap: 26px; align-items: start; }

/* toolbar */
.db-toolbar { margin-bottom: 16px; }
.db-poolmeta { color: var(--text-dim); font-size: 0.82rem; margin: 6px 0 14px; }

/* card pool */
.db-pool { display: block; }
.db-pool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 12px; }
.db-pool-section { font-family: var(--font-display); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--veil-bright); margin: 24px 0 12px; display: flex; justify-content: space-between; align-items: baseline; }
.db-pool-section:first-child { margin-top: 4px; }
.db-pool-section span { color: var(--text-dim); font-family: var(--font-body); letter-spacing: 0; font-size: 0.8rem; }
.db-card {
  position: relative; border: 1px solid var(--border-soft); border-radius: 10px; overflow: hidden;
  cursor: pointer; background: var(--surface);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.db-card:hover { transform: translateY(-3px); border-color: var(--veil); box-shadow: 0 12px 26px -14px #000; }
.db-card.in { border-color: var(--veil); box-shadow: 0 0 0 1px var(--veil) inset; }
.db-card img { width: 100%; aspect-ratio: 5/7; object-fit: cover; display: block; }
.db-card .db-nm { font-size: 0.66rem; padding: 5px 7px 6px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-display); }
.db-cnt {
  position: absolute; top: 6px; left: 6px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px; background: linear-gradient(135deg, var(--veil), var(--ember));
  color: #04121e; font-weight: 700; font-size: 0.72rem; display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.55); z-index: 2;
}
.db-rm {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%;
  border: none; background: rgba(5,6,13,.82); color: #fff; font-size: 1rem; line-height: 1;
  cursor: pointer; opacity: 0; transition: opacity .15s ease; z-index: 2;
}
.db-card:hover .db-rm, .db-card.in .db-rm { opacity: 1; }
.db-rm:hover { background: #c0392b; }

/* deck panel */
.db-deck {
  position: sticky; top: calc(var(--nav-h) + 14px);
  border: 1px solid var(--border); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  padding: 20px; max-height: calc(100vh - var(--nav-h) - 28px); overflow-y: auto;
}
.db-deck h3 { font-family: var(--font-display); font-size: 1.2rem; }
.db-deck .db-setting { font-size: 0.78rem; color: var(--text-dim); margin-top: 2px; }
.db-summary { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.db-stat { font-size: 0.72rem; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--border); background: rgba(255,255,255,.03); color: var(--text-muted); white-space: nowrap; }
.db-stat.ok { color: #4ad06a; border-color: rgba(74,208,106,.4); background: rgba(74,208,106,.08); }
.db-stat.bad { color: #ff7a7a; border-color: rgba(255,122,122,.4); background: rgba(255,122,122,.08); }

.db-curve-wrap { background: rgba(255,255,255,.02); border: 1px solid var(--border-soft); border-radius: 10px; padding: 12px 12px 22px; margin-bottom: 18px; }
.db-curve-t { font-size: 0.68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 10px; }
.db-curve { display: flex; align-items: flex-end; gap: 5px; height: 60px; }
.db-curve .bar { flex: 1; background: linear-gradient(180deg, var(--veil), var(--ember)); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; opacity: .9; }
.db-curve .bar b { position: absolute; top: -15px; left: 0; right: 0; text-align: center; font-size: 0.58rem; color: var(--text-muted); font-weight: 600; }
.db-curve .bar span { position: absolute; bottom: -16px; left: 0; right: 0; text-align: center; font-size: 0.6rem; color: var(--text-dim); }

.db-section-t { font-family: var(--font-display); font-size: 0.76rem; letter-spacing: .1em; text-transform: uppercase; color: var(--veil-bright); margin: 16px 0 6px; display: flex; justify-content: space-between; align-items: baseline; }
.db-section-t span { color: var(--text-dim); font-family: var(--font-body); letter-spacing: 0; }
.db-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border-soft); }
.db-row .cost { font-size: 0.68rem; color: var(--veil-bright); width: 16px; text-align: center; flex: none; }
.db-row .nm { flex: 1; font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.db-row .nm.illegal { color: #ff7a7a; }
.db-ctrl { display: flex; align-items: center; gap: 5px; flex: none; }
.db-ctrl button { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; font-size: 0.9rem; line-height: 1; }
.db-ctrl button:hover { border-color: var(--veil); color: var(--veil-bright); }
.db-ctrl .q { min-width: 14px; text-align: center; font-weight: 700; font-size: 0.78rem; }
.db-empty { color: var(--text-dim); font-size: 0.8rem; padding: 6px 0 2px; }

.db-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.db-actions .btn { width: 100%; justify-content: center; padding: 11px 14px; font-size: 0.85rem; }
.db-actions .full { grid-column: 1 / -1; }

.db-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--surface-2); border: 1px solid var(--veil); color: var(--text);
  padding: 11px 20px; border-radius: 10px; opacity: 0; transition: all .25s ease;
  z-index: 250; box-shadow: var(--shadow-lg); pointer-events: none; font-size: 0.9rem;
}
.db-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 900px) {
  .db-layout { grid-template-columns: 1fr; }
  .db-deck { position: static; max-height: none; order: -1; }
}

/* ============================================================
   LORE — setting story + hero codex
   ============================================================ */
.setting-story { color: var(--text-muted); max-width: 760px; margin: 0 auto 18px; text-align: center; font-size: 1.05rem; line-height: 1.75; }

/* setting selector + hero grid */
.codex-tabs { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 6px; }
.codex-tab { padding: 11px 22px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-family: var(--font-display); font-size: 0.95rem; cursor: pointer; transition: color .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease; }
.codex-tab:hover { color: var(--text); border-color: var(--veil); transform: translateY(-2px); }
.codex-tab.active { background: linear-gradient(110deg, var(--veil), var(--ember)); color: #04121e; border-color: transparent; box-shadow: 0 6px 20px -8px rgba(47,217,230,.6); }

.codex-hint { text-align: center; color: var(--text-dim); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; margin: 14px 0 4px; }
.codex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; margin-top: 18px; }
.hero-pick { cursor: pointer; border: 1px solid var(--border-soft); border-radius: 12px; overflow: hidden; background: var(--surface); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.hero-pick:hover { transform: translateY(-5px); border-color: var(--accent, var(--veil)); box-shadow: 0 16px 34px -16px #000, 0 0 22px -10px var(--accent, rgba(47,217,230,.5)); }
.hero-pick img { width: 100%; aspect-ratio: 600/848; object-fit: cover; display: block; }
.hero-pick .hp-body { padding: 9px 11px 11px; }
.hero-pick .hp-name { font-family: var(--font-display); font-size: 0.85rem; line-height: 1.15; }
.hero-pick .hp-type { font-size: 0.66rem; color: var(--text-dim); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Settings: richer per-setting showcase ---- */
.codex-tab .tab-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: middle; box-shadow: 0 0 8px var(--accent); }
.codex-tab.active .tab-dot { box-shadow: none; }

.codex-anim { animation: codexIn .45s cubic-bezier(.2,.8,.2,1); }
@keyframes codexIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.setting-hero {
  position: relative; text-align: center; overflow: hidden;
  padding: 46px 24px 38px; border-radius: 18px; margin-bottom: 30px;
  border: 1px solid var(--border-soft);
  background:
    radial-gradient(78% 130% at 50% -18%, var(--glow), transparent 60%),
    linear-gradient(180deg, var(--surface), var(--bg-2));
}
.setting-hero-logo { width: auto; max-height: 140px; margin: 0 auto 16px; filter: drop-shadow(0 10px 28px rgba(0,0,0,.55)); }
.setting-tagline { font-family: var(--font-accent); font-style: italic; font-size: 1.25rem; color: var(--text); max-width: 620px; margin: 0 auto 24px; line-height: 1.4; }
.setting-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px 30px; margin: 0 auto 26px; max-width: 720px; }
.setting-stats > div { display: flex; flex-direction: column; min-width: 64px; }
.setting-stats b { font-family: var(--font-display); font-size: 1.55rem; line-height: 1; color: var(--accent); text-shadow: 0 0 16px color-mix(in srgb, var(--accent) 40%, transparent); }
.setting-stats span { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); margin-top: 6px; }

.setting-story-block { text-align: center; max-width: 780px; margin: 0 auto 26px; }
.setting-story-block .eyebrow { color: var(--accent); }
.setting-story-block .setting-story { margin-top: 12px; }

.codex-classes { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 820px; margin: 0 auto 8px; }
.codex-class { font-size: 0.72rem; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); background: rgba(255,255,255,0.03); color: var(--text-muted); }

.codex-section { margin-top: 34px; }
.codex-h { font-family: var(--font-display); font-size: 1.2rem; display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.codex-h::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--accent), transparent); opacity: .55; }
.codex-h em { font-style: normal; font-family: var(--font-body); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); font-weight: 400; }

.codex { display: grid; gap: 16px; margin-top: 6px; }
.codex-feature {
  display: grid; grid-template-columns: 290px 1fr; gap: 32px; align-items: center;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 28px;
}
.codex-art { width: 100%; max-width: 290px; aspect-ratio: 600/848; object-fit: cover; border-radius: 12px; box-shadow: var(--shadow-lg); justify-self: center; }
.codex-eyebrow { font-family: var(--font-display); letter-spacing: 0.2em; text-transform: uppercase; font-size: 0.7rem; color: var(--ember-bright); }
.codex-name { font-family: var(--font-display); font-size: 1.85rem; line-height: 1.1; margin: 6px 0 3px; }
.codex-cls { color: var(--veil-bright); font-size: 0.9rem; margin-bottom: 14px; }
.codex-story { color: var(--text-muted); line-height: 1.75; min-height: 5.4em; }
.codex-nav { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
.codex-nav button { width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 1.1rem; cursor: pointer; transition: transform .15s ease, border-color .15s ease, color .15s ease; }
.codex-nav button:hover { border-color: var(--veil); color: var(--veil-bright); transform: translateY(-2px); }
.codex-count { font-family: var(--font-display); color: var(--text-dim); font-size: 0.9rem; }
.codex-strip { display: flex; gap: 10px; overflow-x: auto; padding: 8px 2px 12px; }
.codex-thumb { flex: 0 0 auto; width: 74px; border: 2px solid transparent; border-radius: 9px; overflow: hidden; cursor: pointer; background: none; padding: 0; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.codex-thumb img { width: 100%; aspect-ratio: 600/848; object-fit: cover; display: block; }
.codex-thumb:hover { transform: translateY(-3px); }
.codex-thumb.active { border-color: var(--veil); box-shadow: 0 0 16px -4px var(--veil); }
@media (max-width: 720px) {
  .codex-feature { grid-template-columns: 1fr; gap: 20px; }
  .codex-art { max-width: 210px; }
  .codex-story { min-height: 0; }
}
