/* omgcg.gg — Phase 1 stylesheet
 *
 * Tokens and component patterns per design-system.md. The platform is the
 * quiet vault — restrained motion, dark palette, Cinzel display for headings,
 * Inter for body, gold accents for emphasis.
 */

/* ============================================================
   TOKENS
   ============================================================ */

:root {
  /* Backgrounds — deep midnight purple register */
  --bg-deep: #0C0820;
  --bg-base: #14102A;
  --bg-elevated: #1A1432;
  --bg-elevated-alt: #0F0C24;
  --bg-input: #1E1838;

  /* Gold accents */
  --accent-gold: #E8B547;
  --accent-gold-dim: #C4953A;
  --accent-gold-deep: #A87E2C;

  /* Text — warm cream/lavender register */
  --text-primary: #F4EFE6;
  --text-body: #E8E2D0;
  --text-secondary: #C4B8E0;
  --text-muted: #9F8FE0;
  --text-faint: #8C7FB4;
  --text-disabled: #6B5F8C;

  /* Functional colors */
  --success: #4A7C3D;
  --success-text: #DCEFCB;
  --danger: #8B3A2F;
  --danger-text: #F4D4C8;
  --info: #4A8EC2;
  --info-text: #14102A;

  /* Borders / dividers (alpha on text-primary) */
  --border-subtle: rgba(244, 239, 230, 0.08);
  --border-rule: rgba(244, 239, 230, 0.12);
  --border-emphasis: rgba(244, 239, 230, 0.22);
  --border-gold: rgba(232, 181, 71, 0.40);

  /* Fonts */
  --font-display: 'Cinzel', 'DM Serif Display', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Menlo', 'Consolas', monospace;

  /* Layout */
  --page-padding-x: 32px;
  --section-padding-y: 56px;
  --content-max-width: 1280px;
}

/* ============================================================
   RESET + BASE
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }

body {
  background: var(--bg-base);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

p { line-height: 1.7; }

code, pre, .font-mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

a {
  color: var(--accent-gold);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--text-primary); }

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

ul, ol { list-style: none; }

/* Italic emphasis in display headings — gold per design-system.md */
h1 em, h2 em, h3 em {
  font-style: italic;
  color: var(--accent-gold);
  font-weight: 600;
}

/* ============================================================
   UTILITIES
   ============================================================ */

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

.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  padding: 12px 20px;
  background: var(--accent-gold);
  color: var(--bg-deep);
  font-weight: 600;
  z-index: 1000;
  border-radius: 0 0 4px 0;
}
.skip-link:focus { top: 0; color: var(--bg-deep); }

/* ============================================================
   NAV
   ============================================================ */

header[role="banner"] {
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border-rule);
  padding: 0 var(--page-padding-x);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 50px;
  height: 64px;
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.nav__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.nav__logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}
.nav__wordmark { line-height: 1; }
.nav__wordmark-dot { color: var(--accent-gold); }
.nav__brand:hover { color: var(--accent-gold); }

.nav__search {
  justify-self: end;
  width: 280px;
}

.nav__search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-rule);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 4px;
  outline: none;
  transition: border-color 0.15s ease;
}
.nav__search-input::placeholder { color: var(--text-faint); }
.nav__search-input:focus { border-color: var(--accent-gold); }

.nav__links {
  display: flex;
  gap: 28px;
  justify-self: start;
}

.nav__links a {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  position: relative;
  padding: 6px 0;
}
.nav__links a:hover { color: var(--accent-gold); }

.nav__links a.is-active {
  color: var(--accent-gold);
}
.nav__links a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -22px;
  height: 2px;
  background: var(--accent-gold);
  box-shadow: 0 0 12px rgba(232, 181, 71, 0.5);
}

/* ============================================================
   FOOTER
   ============================================================ */

footer[role="contentinfo"] {
  background: var(--bg-deep);
  border-top: 1px solid var(--border-rule);
  padding: 32px var(--page-padding-x);
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
  letter-spacing: 0.02em;
}

footer[role="contentinfo"] p { margin: 0; line-height: 1.6; }
footer[role="contentinfo"] a { color: var(--text-muted); }
footer[role="contentinfo"] a:hover { color: var(--accent-gold); }

/* ============================================================
   MAIN
   ============================================================ */

main { min-height: calc(100vh - 64px - 96px); }

/* ============================================================
   SECTION HEAD PATTERN
   Section number (Roman, gold italic Cinzel) + section title + optional
   see-all link, with bottom border.
   ============================================================ */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 14px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border-emphasis);
}

.section-head__left {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.section-head__numeral {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 28px;
  color: var(--accent-gold);
  line-height: 1;
}

.section-head__title {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.section-head__see-all {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.section-head__see-all:hover { color: var(--accent-gold); }

/* ============================================================
   PAGE: HOME
   ============================================================ */

.page-home .hero {
  position: relative;
  z-index: 10;
  background:
    radial-gradient(ellipse at center top, rgba(232, 181, 71, 0.08), transparent 60%),
    var(--bg-base);
  padding: 18px var(--page-padding-x) 54px;
  border-bottom: 1px solid var(--border-subtle);
}

.hero__inner {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__logo {
  width: 140px;
  height: auto;
  margin-bottom: 20px;
  filter: drop-shadow(0 8px 28px rgba(232, 181, 71, 0.18));
}

.page-home .hero__eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.30em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.page-home .hero__title {
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 1.1;
  margin: 0 0 28px;
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.hero__search {
  display: flex;
  gap: 0;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  border: 1px solid var(--border-rule);
  border-radius: 6px;
  background: var(--bg-input);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.hero__search:focus-within {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(232, 181, 71, 0.12);
}

.hero__search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 15px;
  padding: 14px 18px;
}
.hero__search-input::placeholder { color: var(--text-faint); }

.hero__search-submit {
  background: var(--accent-gold);
  color: var(--bg-deep);
  border: none;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0 24px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.hero__search-submit:hover { background: #F4C76A; }

.hero__hint {
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}
.hero__hint code {
  background: rgba(232, 181, 71, 0.08);
  color: var(--accent-gold);
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  margin: 0 2px;
}

/* Hero slide rotator ---------------------------------------------------- */
.hero-slides {
  display: grid;
  grid-template-areas: "slide";
  width: 100%;
  min-height: 220px;
}

.hero-slide {
  grid-area: slide;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 500ms ease;
}

.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.hero-slide__eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.30em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin: 0 0 14px;
}

.hero-slide__title {
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1.15;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  margin: 0 0 14px;
  max-width: 640px;
}

.hero-slide__body {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-body);
  margin: 0 0 18px;
  max-width: 540px;
}

.hero-slide__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: var(--accent-gold);
  color: var(--bg-deep);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 3px;
  transition: background 150ms ease;
}

.hero-slide__cta:hover { background: #F4C76A; }

.hero-slide__countdown {
  white-space: nowrap;
}

.hero-slide__countdown-rel {
  font-family: var(--font-body);
  font-size: 0.6em;
  font-weight: 400;
  font-style: italic;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: none;
  margin-left: 6px;
}

.hero-slides__dots {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
}

.hero-slides__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--accent-gold-dim);
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

.hero-slides__dot:hover {
  background: var(--accent-gold-dim);
}

.hero-slides__dot.is-active {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  transform: scale(1.15);
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide { transition: none; }
}

/* Search-keys popover (alt 2 homepage) ---------------------------------- */
.hero__hint--keys {
  position: relative;
  display: inline-flex;
  justify-content: center;
}
.search-keys__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid rgba(232, 181, 71, 0.25);
  color: var(--text-faint);
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.04em;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.search-keys__toggle:hover,
.search-keys__toggle[aria-expanded="true"] {
  border-color: rgba(232, 181, 71, 0.55);
  color: var(--accent-gold);
  background: rgba(232, 181, 71, 0.06);
}
.search-keys__toggle-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(232, 181, 71, 0.15);
  color: var(--accent-gold);
  font-weight: 700;
  font-size: 11px;
  line-height: 1;
}
.search-keys-popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, calc(100vw - 32px));
  background: var(--bg-elevated, #1c1c20);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  padding: 18px;
  z-index: 50;
  text-align: left;
}
.search-keys-popover[hidden] { display: none; }
.search-keys-popover__inner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
}
.search-keys-group__title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}
.search-keys-group__hint {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  opacity: 0.7;
  margin-left: 4px;
}
.search-keys-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.search-keys-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: 0;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}
.search-keys-item:hover,
.search-keys-item:focus-visible {
  background: rgba(232, 181, 71, 0.08);
  outline: none;
}
.search-keys-item code {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--accent-gold);
  background: rgba(232, 181, 71, 0.08);
  padding: 2px 6px;
  border-radius: 3px;
}
.search-keys-item span {
  font-size: 12px;
  color: var(--text-faint);
}
@media (max-width: 540px) {
  .search-keys-popover__inner {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.page-home .featured-set {
  background: var(--bg-elevated);
  padding: 20px var(--page-padding-x) 40px;
}

.featured-set__inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.page-home .featured-cards {
  padding: 20px var(--page-padding-x) 40px;
}

.featured-cards__inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.featured-cards__title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  margin: 0 0 20px;
}

.featured-set__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 14px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border-emphasis);
}

.featured-set__head-left {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.featured-set__numeral {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 32px;
  color: var(--accent-gold);
  line-height: 1;
}

.featured-set__title {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.featured-set__see-all {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.featured-set__see-all:hover { color: var(--accent-gold); }

.page-home .pantheon-callouts {
  background: var(--bg-base);
  padding: 0;
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.pantheon-callout {
  background: var(--bg-elevated-alt);
  padding: 48px 24px 40px;
  border-right: 1px solid var(--border-subtle);
  position: relative;
  text-align: center;
  overflow: hidden;
}
.pantheon-callout:last-child { border-right: none; }

.pantheon-callout::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center 35%, rgba(232, 181, 71, 0.06), transparent 60%);
  pointer-events: none;
}

.pantheon-callout__glyph {
  font-family: var(--font-display);
  font-size: 64px;
  line-height: 1;
  color: var(--accent-gold);
  opacity: 0.25;
  margin-bottom: 18px;
  display: block;
}

.pantheon-callout__name {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}

.pantheon-callout__count {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ============================================================
   PAGE: SET
   ============================================================ */

.page-set .set-header {
  background: var(--bg-elevated-alt);
  padding: 72px var(--page-padding-x) 56px;
  border-bottom: 1px solid var(--border-rule);
}

.set-header__inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.set-header__eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.30em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.page-set .set-header h1 {
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 1.0;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}

.set-header__description {
  color: var(--text-body);
  font-size: 16px;
  line-height: 1.7;
  max-width: 720px;
}

.set-filter-row {
  background: var(--bg-base);
  padding: 18px var(--page-padding-x);
  border-bottom: 1px solid var(--border-subtle);
}

.set-filter-row__inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.set-filter-row__count {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.page-set .card-grid-wrap {
  padding: 40px var(--page-padding-x) 80px;
  max-width: var(--content-max-width);
  margin: 0 auto;
}

/* ============================================================
   PAGE: TYPES
   ============================================================ */

.page-types .types-header {
  background: var(--bg-elevated-alt);
  padding: 72px var(--page-padding-x) 56px;
  border-bottom: 1px solid var(--border-rule);
}

.types-header__inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.types-header__eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.30em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.page-types .types-header h1 {
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 1.0;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}

.types-header__description {
  color: var(--text-body);
  font-size: 16px;
  line-height: 1.7;
  max-width: 720px;
}

.page-types .types-grid-wrap {
  padding: 40px var(--page-padding-x) 80px;
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.types-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.type-tile {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  border-top: 3px solid var(--type-color, var(--accent-gold-dim));
  padding: 18px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.type-tile__head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.type-tile__icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.type-tile__name {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  margin: 0;
  text-transform: capitalize;
}

.type-tile__matchups {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 12px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.type-tile__matchup {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: center;
  gap: 10px;
}

.type-tile__matchup-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
}

.type-tile__matchup--strong .type-tile__matchup-label { color: var(--accent-gold); }
.type-tile__matchup--weak   .type-tile__matchup-label { color: var(--text-muted); }

.type-tile__matchup-value {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  text-transform: capitalize;
}

.type-tile__matchup-value a {
  color: var(--text-primary);
  text-decoration: none;
}

.type-tile__matchup-value a:hover {
  color: var(--accent-gold);
}

.type-tile__matchup-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.type-tile__matchup-note {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 2px 8px;
  cursor: help;
}

.type-tile__matchup-empty {
  color: var(--text-muted);
}

.type-tile__cards-link {
  align-self: flex-start;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-gold);
  text-decoration: none;
}

.type-tile__cards-link:hover { color: var(--text-primary); }

/* ============================================================
   PAGE: CARDS (BROWSE ALL)
   ============================================================ */

.page-cards .cards-header {
  background: var(--bg-elevated-alt);
  padding: 56px var(--page-padding-x) 40px;
  border-bottom: 1px solid var(--border-rule);
}

.cards-header__inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.cards-header__eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.30em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.page-cards .cards-header h1 {
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 1.0;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  margin-bottom: 14px;
}

.cards-header__description {
  color: var(--text-body);
  font-size: 15px;
  line-height: 1.6;
  max-width: 680px;
}

.cards-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 32px var(--page-padding-x) 80px;
  align-items: start;
}

.cards-filters {
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 88px;
}

.cards-filter-group {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 14px 14px 12px;
}

.cards-filter-group__title {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
  margin: 0 0 10px;
}

.cards-filter-chips {
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.cards-filter-chips--inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
}

.cards-filter-chip {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid transparent;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.2;
}

.cards-filter-chip:hover {
  background: var(--bg-elevated-alt);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.cards-filter-chip__icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.cards-filter-chip__glyph {
  font-size: 16px;
  text-align: center;
  color: var(--accent-gold);
}

.cards-filter-chip__name {
  font-family: var(--font-display);
  text-transform: capitalize;
  letter-spacing: 0.02em;
}

.cards-filter-chip__count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
}

/* Inline chip (level/cost): no icon/glyph column, no count, more compact. */
.cards-filter-chips--inline .cards-filter-chip {
  grid-template-columns: auto;
  padding: 6px 12px;
  border: 1px solid var(--border-subtle);
  min-width: 38px;
  justify-items: center;
}

.cards-filter-chips--inline .cards-filter-chip__name {
  font-family: var(--font-mono);
  text-transform: none;
}

.cards-grid-main {
  min-width: 0;
}

.cards-grid-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.cards-grid-toolbar__count {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.page-cards .card-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* ============================================================
   PAGE: CARD DETAIL
   ============================================================ */

.page-card-detail .card-detail {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 40px;
  padding: 56px var(--page-padding-x) 80px;
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.card-detail__sidebar { position: relative; }

.card-detail__image-block {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 16px;
}

.card-detail__image-block img {
  width: 100%;
  border-radius: 4px;
  display: block;
}

.card-detail__main {
  display: flex;
  flex-direction: column;
  gap: 36px;
  min-width: 0;
}

.card-detail__identity { display: flex; flex-direction: column; gap: 8px; }

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

.card-detail__identity h1 {
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 1.0;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

.card-detail__subtitle {
  color: var(--text-secondary);
  font-size: 16px;
  font-style: italic;
}

/* --- Stat grid --- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border-rule);
  border: 1px solid var(--border-rule);
  border-radius: 4px;
  overflow: hidden;
}

.stat-grid__cell {
  background: var(--bg-elevated);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-grid__label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stat-grid__value {
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1;
  color: var(--accent-gold);
  letter-spacing: 0.02em;
}

.stat-grid__value--with-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Type icon — natural color, sized per usage */
.type-icon {
  display: inline-block;
  object-fit: contain;
}

.type-icon--inline {
  /* used inside stat-grid cells */
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.type-icon--pill {
  /* used inside type-matchup pills */
  width: 18px;
  height: 18px;
  margin-right: 4px;
  vertical-align: -4px;
}

/* --- Subsection heading --- */
.subsection-head {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: 10px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.skills-section h2,
.type-matchups-section h2,
.evolution-chain-section h2 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: 10px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

/* --- Skills --- */
.skill-block {
  background: rgba(74, 142, 194, 0.12);
  border-left: 3px solid var(--info);
  padding: 14px 18px;
  border-radius: 0 4px 4px 0;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.skill-block:last-child { margin-bottom: 0; }

.skill-trigger-pill {
  display: inline-flex;
  align-items: center;
  background: var(--info);
  color: var(--info-text);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  align-self: flex-start;
}

.skill-text {
  color: var(--text-body);
  font-size: 14px;
  line-height: 1.65;
}

/* --- Type matchups --- */
.type-matchups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.type-matchup {
  padding: 18px 18px 16px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.type-matchup h3 {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0;
}

.type-matchup--strong {
  background: rgba(74, 124, 61, 0.16);
  border: 1px solid rgba(74, 124, 61, 0.32);
}
.type-matchup--strong h3 { color: var(--success-text); }

.type-matchup--weak {
  background: rgba(139, 58, 47, 0.18);
  border: 1px solid rgba(139, 58, 47, 0.32);
}
.type-matchup--weak h3 { color: var(--danger-text); }

.type-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.06em;
  padding: 6px 12px 6px 8px;
  border-radius: 4px;
  background: rgba(20, 16, 42, 0.5);
  color: var(--text-primary);
  border: 1px solid var(--border-rule);
  align-self: flex-start;
}

/* --- Metadata footer --- */
.metadata {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-top: 24px;
  margin-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
}

.metadata > div { display: flex; flex-direction: column; gap: 4px; }

.metadata__artist a { color: var(--accent-gold); }
.metadata__artist a:hover { text-decoration: underline; }

.metadata__collection-label,
.metadata__set-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.metadata__collection-value {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-size: 13px;
}

.metadata__set-value {
  font-family: var(--font-display);
  color: var(--text-body);
  font-size: 14px;
  letter-spacing: 0.02em;
}

/* ============================================================
   CARD TILE
   ============================================================ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.card-tile {
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.card-tile:hover {
  border-color: var(--border-gold);
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 8px 24px rgba(232, 181, 71, 0.08);
  text-decoration: none;
}
.card-tile:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

.card-tile__image {
  position: relative;
  aspect-ratio: 5 / 7;
  overflow: hidden;
  background: var(--bg-elevated-alt);
}

.card-tile__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.card-tile:hover .card-tile__image img { transform: scale(1.03); }

.card-tile__level-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--accent-gold-dim);
  color: var(--bg-deep);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  letter-spacing: 0;
}

.card-tile__power-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--bg-deep);
  color: var(--accent-gold);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent-gold-dim);
  transform: rotate(45deg);
}
.card-tile__power-badge { line-height: 1; }

.card-tile__meta {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.card-tile__name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.card-tile__persona {
  font-size: 12px;
  color: var(--text-secondary);
  font-style: italic;
}

.card-tile__collection {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* ============================================================
   EVOLUTION CHAIN
   ============================================================ */

.evolution-chain {
  overflow-x: auto;
  padding: 4px 0 16px;
}

.evolution-chain__stages {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0;
}

.evolution-chain__stage {
  flex: 0 0 156px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  padding: 0 12px;
}

.evolution-chain__stage:not(:last-child)::after {
  content: "›";
  position: absolute;
  right: -8px;
  top: 40%;
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--accent-gold-deep);
  line-height: 1;
  z-index: 2;
}

.evolution-chain__stage[data-current="true"] .card-tile {
  border-color: var(--border-gold);
  box-shadow: 0 0 0 2px rgba(232, 181, 71, 0.18);
}

.evolution-chain__stage-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-gold);
  text-align: center;
}

.evolution-chain__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 5 / 7;
  background: var(--bg-elevated-alt);
  border: 1px dashed var(--border-subtle);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-disabled);
  text-align: center;
  padding: 8px;
  letter-spacing: 0.04em;
}

/* ============================================================
   PAGE: SEARCH
   ============================================================ */

.page-search .search-hero {
  background: var(--bg-elevated);
  padding: 48px var(--page-padding-x) 40px;
  border-bottom: 1px solid var(--border-rule);
}

.search-hero__inner {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.search-hero__eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.30em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.search-hero__title {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--text-primary);
  margin: 0 0 24px;
  letter-spacing: 0.02em;
}

.search-form {
  display: flex;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  border: 1px solid var(--border-rule);
  border-radius: 6px;
  background: var(--bg-input);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-form:focus-within {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(232, 181, 71, 0.12);
}

.search-form__input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 12px 16px;
}
.search-form__input::placeholder { color: var(--text-faint); }

.search-form__submit {
  background: var(--accent-gold);
  color: var(--bg-deep);
  border: none;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0 22px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.search-form__submit:hover { background: #F4C76A; }

.search-hero__hint {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-faint);
}
.search-hero__hint code {
  background: rgba(232, 181, 71, 0.08);
  color: var(--accent-gold);
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  margin: 0 2px;
  font-family: var(--font-mono);
}

.search-results-section {
  padding: 20px var(--page-padding-x) 80px;
}

.search-results-section__inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.search-results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.search-results-status {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin: 0;
  flex: 1;
  min-width: 0;
}

.view-toggle {
  display: inline-flex;
  border: 1px solid var(--border-rule);
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}
.view-toggle__btn {
  background: transparent;
  border: none;
  border-right: 1px solid var(--border-rule);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.view-toggle__btn:last-child { border-right: none; }
.view-toggle__btn:hover { color: var(--accent-gold); }
.view-toggle__btn--active {
  background: var(--accent-gold);
  color: var(--bg-deep);
}
.view-toggle__btn--active:hover { color: var(--bg-deep); }

/* Standard (default) grid on search: denser, more tiles per row, trimmed meta */
.card-grid--standard {
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.card-grid--standard .card-tile__name { font-size: 12px; }
.card-grid--standard .card-tile__persona { display: none; }
.card-grid--standard .card-tile__collection { font-size: 9px; }
.card-grid--standard .card-tile__level-badge {
  width: 22px;
  height: 22px;
  font-size: 10px;
}
.card-grid--standard .card-tile__power-badge {
  width: 20px;
  height: 20px;
  font-size: 10px;
  top: 10px;
  right: 10px;
}
.card-grid--standard .card-tile__meta { padding: 8px 10px 10px; gap: 1px; }

@media (max-width: 1024px) {
  .card-grid--standard { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 640px) {
  .card-grid--standard { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   HERO CARD-BACKS (used on the primary homepage and Homepage Alt 2)
   ============================================================ */

.page-home .hero {
  position: relative;
  overflow: hidden;
}

.page-home .hero__inner {
  position: relative;
  z-index: 2;
}

/* Hero backdrops: one layer per slide, fades in/out with the slide rotator.
 * Each backdrop is a full overlay containing its own flank art (cardbacks
 * or promo cards). The slide controller JS toggles `.is-active` keyed by
 * data-slide so the flanks swap in sync with the inner slide content. */
.hero__backdrops {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.hero__backdrop {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 500ms ease;
}

.hero__backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
  .hero__backdrop { transition: none; }
}

.hero__cardback {
  position: absolute;
  top: 50%;
  width: 220px;
  height: auto;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.6));
  z-index: 1;
}

.page-home-alt-2 .hero__wordmark-large {
  height: 130px;
  width: auto;
  margin-bottom: 24px;
  display: block;
  filter: drop-shadow(0 8px 28px rgba(0, 0, 0, 0.5));
}

/* Ancient Deities — 2-column layout: card grid on the left, synopsis on right */
.page-home .featured-set__split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 28px;
  align-items: start;
}

.page-home .featured-set__grid { min-width: 0; }

.page-home .card-grid--three-up {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* Featured-set marquee: cards are rendered twice; the track translates -50%
 * so the second copy seamlessly takes over from the first as it scrolls off.
 * Edge gradients fade the cards in/out at the window boundaries. */
.page-home .card-marquee {
  position: relative;
  overflow: hidden;
  mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 48px,
    #000 calc(100% - 48px),
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 48px,
    #000 calc(100% - 48px),
    transparent 100%
  );
}

.page-home .card-marquee__track {
  display: flex;
  gap: 16px;
  width: max-content;
  animation: card-marquee-scroll 80s linear infinite;
}

.page-home .card-marquee__track > .card-tile {
  flex: 0 0 200px;
  width: 200px;
}

.page-home .card-marquee:hover .card-marquee__track,
.page-home .card-marquee:focus-within .card-marquee__track {
  animation-play-state: paused;
}

@keyframes card-marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .page-home .card-marquee__track { animation: none; }
}

.page-home .featured-set__synopsis {
  background: var(--bg-elevated-alt);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-body);
}
.page-home .featured-set__synopsis-eyebrow {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin: 0;
}
.page-home .featured-set__synopsis-title {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: 0.02em;
  margin: 0 0 4px;
}
.page-home .featured-set__synopsis em {
  font-style: italic;
  color: var(--accent-gold);
}
.page-home .featured-set__synopsis p { margin: 0; }
.page-home .featured-set__synopsis-cta {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-gold);
}
.page-home .featured-set__synopsis-cta:hover { color: var(--text-primary); }

@media (max-width: 720px) {
  .page-home .featured-set__split {
    grid-template-columns: 1fr;
  }
  .page-home .card-grid--three-up { grid-template-columns: repeat(2, 1fr); }
}

/* Search button with embedded logo — light silver palette pulled from the
 * mandala logo's outer rim glow */
.hero__search-submit--logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px 0 8px;
  background: #D4E2EE;
  color: var(--bg-deep);
  border-top: 1px solid #9FB4C6;
  border-bottom: 1px solid #9FB4C6;
  border-right: 1px solid #9FB4C6;
  border-left: none;
  font-weight: 700;
}
.hero__search-submit--logo:hover {
  background: #E4EEF8;
  color: var(--bg-deep);
}
.hero__search-submit-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

/* Card-backs are positioned relative to the centered 760px hero__inner so
 * they always sit just outside the text column instead of clipping into it
 * at intermediate viewport widths. */
.hero__cardback--left {
  left: calc((100% - 760px) / 2 - 220px - 24px);
  transform: translateY(-50%) rotate(-8deg);
}

.hero__cardback--right {
  right: calc((100% - 760px) / 2 - 220px - 24px);
  transform: translateY(-50%) rotate(8deg);
}

/* Below ~1250px the calc above pushes the card-backs off-screen; hide them
 * entirely once they no longer fit alongside the hero content. */
@media (max-width: 1250px) {
  .hero__cardback { display: none; }
}

/* ============================================================
   VARIANT SWITCHER (homepage design comparison)
   ============================================================ */

.variant-switcher {
  position: fixed;
  top: 80px;
  right: 16px;
  background: rgba(12, 8, 32, 0.92);
  border: 1px solid var(--border-rule);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 11px;
  letter-spacing: 0.08em;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 4px;
  backdrop-filter: blur(8px);
}

.variant-switcher__label {
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  margin-bottom: 2px;
  font-size: 10px;
}

.variant-switcher a {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  padding: 2px 0;
}
.variant-switcher a:hover { color: var(--accent-gold); }

/* ============================================================
   PAGE: /cards — multi-column browse hub (formerly v3 Wowhead).
   The `.v3-*` class names are kept as internal hooks.
   ============================================================ */

.v3-ticker {
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border-rule);
  padding: 8px var(--page-padding-x);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
}
.v3-ticker__label {
  color: var(--accent-gold);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 10px;
}
.v3-ticker__sep { color: var(--text-disabled); }

.v3-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 24px var(--page-padding-x) 56px;
}

.v3-main { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

.v3-feature {
  display: grid;
  grid-template-columns: 220px 1fr;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
}
.v3-feature__art {
  background-size: cover;
  background-position: center top;
  min-height: 220px;
  border-right: 1px solid var(--border-subtle);
}
.v3-feature__body { padding: 18px 28px; display: flex; flex-direction: column; gap: 8px; }
.v3-feature__eyebrow {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-gold);
}
.v3-feature__title { font-family: var(--font-display); font-size: 24px; color: var(--text-primary); }
.v3-feature__lede { color: var(--text-body); font-size: 14px; line-height: 1.6; }
.v3-feature__cta {
  align-self: flex-start;
  color: var(--accent-gold);
  font-size: 12px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 4px;
}

.v3-block {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 18px 24px;
}
.v3-block__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-emphasis);
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.v3-block__title { font-family: var(--font-display); font-size: 18px; color: var(--text-primary); }
.v3-block__see-all { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
.v3-block__see-all:hover { color: var(--accent-gold); }

.v3-block .card-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }

.v3-feed { display: flex; flex-direction: column; gap: 0; }
.v3-feed__item { border-bottom: 1px solid var(--border-subtle); }
.v3-feed__item:last-child { border-bottom: none; }
.v3-feed__link {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 14px;
  align-items: center;
  padding: 10px 0;
  color: var(--text-body);
}
.v3-feed__link:hover { color: var(--text-primary); }
.v3-feed__thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  object-position: center 18%;
  border-radius: 4px;
  border: 1px solid var(--border-rule);
}
.v3-feed__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.v3-feed__name { font-family: var(--font-display); font-size: 14px; color: var(--text-primary); }
.v3-feed__meta { font-size: 11px; color: var(--text-secondary); }
.v3-feed__id { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); }

.v3-aside { display: flex; flex-direction: column; gap: 20px; }

.v3-widget {
  background: var(--bg-elevated-alt);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 18px 18px 16px;
}
.v3-widget__title {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-rule);
}
.v3-widget__search input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-rule);
  border-radius: 4px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
}
.v3-widget__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.v3-widget__chips a {
  background: var(--bg-input);
  border: 1px solid var(--border-rule);
  border-radius: 3px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text-body);
  font-family: var(--font-mono);
}
.v3-widget__chips a:hover { border-color: var(--accent-gold); color: var(--accent-gold); }

.v3-widget__types,
.v3-widget__pantheons { display: flex; flex-direction: column; gap: 4px; }
.v3-widget__types li a,
.v3-widget__pantheons li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 3px;
  color: var(--text-body);
  font-size: 12px;
}
.v3-widget__types li a:hover,
.v3-widget__pantheons li a:hover {
  background: rgba(232, 181, 71, 0.06);
  color: var(--text-primary);
}
.v3-widget__type-name,
.v3-widget__pantheon-name { font-family: var(--font-display); letter-spacing: 0.04em; }
.v3-widget__type-count,
.v3-widget__pantheon-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
}
.v3-widget__pantheon-glyph {
  font-family: var(--font-display);
  color: var(--accent-gold);
  margin-right: 8px;
}
.v3-widget__pantheons li a { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; }

.v3-widget--cta { background: rgba(74, 142, 194, 0.12); border-color: rgba(74, 142, 194, 0.3); }
.v3-widget--cta .v3-widget__title { color: var(--info); border-bottom-color: rgba(74, 142, 194, 0.3); }
.v3-widget__body { font-size: 12px; color: var(--text-body); line-height: 1.5; }

/* ============================================================
   HAMBURGER + MOBILE DRAWER (hidden at desktop, shown on mobile)
   ============================================================ */

.nav__hamburger {
  display: none;
  background: transparent;
  border: 1px solid var(--border-rule);
  border-radius: 4px;
  width: 40px;
  height: 40px;
  padding: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.nav__hamburger:hover {
  border-color: var(--accent-gold);
}
.nav__hamburger-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav__hamburger--open .nav__hamburger-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav__hamburger--open .nav__hamburger-bar:nth-child(2) {
  opacity: 0;
}
.nav__hamburger--open .nav__hamburger-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.nav__drawer {
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border-rule);
  padding: 16px var(--page-padding-x) 24px;
  z-index: 90;
}
/* Always hide above the hamburger breakpoint (defensive). */
@media (min-width: 1024px) {
  .nav__drawer { display: none; }
}
/* Tablet + mobile: browser-default [hidden] attribute hides it; JS toggles to show. */

.nav__drawer-search { margin-bottom: 16px; }
.nav__drawer-search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-rule);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 12px 16px;
  border-radius: 4px;
  outline: none;
}
.nav__drawer-search-input:focus { border-color: var(--accent-gold); }

.nav__drawer-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav__drawer-links li {
  display: block;
  border-bottom: 1px solid var(--border-subtle);
}
.nav__drawer-links li:last-child { border-bottom: none; }
.nav__drawer-links a {
  display: block;
  padding: 14px 8px;
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.nav__drawer-links a:hover,
.nav__drawer-links a.is-active {
  color: var(--accent-gold);
}

/* ============================================================
   RESPONSIVE — TABLET (<= 1023px) + MOBILE (<= 767px)
   ============================================================ */

/* ---------- TABLET: <= 1023px ---------- */
@media (max-width: 1023px) {
  :root {
    --page-padding-x: 24px;
  }

  /* Nav: hide desktop links + search; show hamburger. The 6-link nav + 280px
   * search field doesn't fit comfortably below ~1024px alongside the brand. */
  nav {
    grid-template-columns: auto 1fr auto;
    gap: 12px;
  }
  .nav__links { display: none; }
  .nav__search { display: none; }
  .nav__hamburger { display: inline-flex; justify-self: end; }

  /* /cards (Wowhead) layout: stack sidebar below main */
  .v3-layout {
    grid-template-columns: 1fr;
  }
  .v3-feature {
    grid-template-columns: 1fr;
  }
  .v3-feature__art {
    min-height: 180px;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
  .v3-block .card-grid { grid-template-columns: repeat(3, 1fr); }

  /* Set page card grid */
  .page-set .card-grid { grid-template-columns: repeat(3, 1fr); }

  /* /cards (browse) layout: stack sidebar below main, drop grid to 3 cols */
  .cards-layout { grid-template-columns: 1fr; gap: 24px; }
  .cards-filters { position: static; }
  .page-cards .card-grid { grid-template-columns: repeat(3, 1fr); }

  /* Homepage featured grid */
  .featured-set .card-grid { grid-template-columns: repeat(3, 1fr); }
  .page-home .card-grid--three-up { grid-template-columns: repeat(3, 1fr); }

  /* Featured-set 2-col split: tighten the synopsis column */
  .page-home .featured-set__split {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
  }

  /* Card detail two-column → tighten gap */
  .page-card-detail .card-detail {
    grid-template-columns: 280px 1fr;
    gap: 28px;
  }

  /* Pantheon callouts: 4 cols → 2x2 */
  .page-home .pantheon-callouts { grid-template-columns: repeat(2, 1fr); }
  .pantheon-callout:nth-child(2) { border-right: none; }

  /* Types grid: 4 cols → 3 cols */
  .types-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- MOBILE: <= 767px ---------- */
@media (max-width: 767px) {
  /* Hero collapse */
  .page-home .hero {
    padding: 28px var(--page-padding-x) 40px;
  }
  .hero__logo { width: 100px; }
  .page-home .hero__title { font-size: 28px; margin-bottom: 20px; }
  /* Keep input + button on one row at mobile; tighten the button so the
   * input still has room. Flex container stretches both to the same height. */
  .hero__search-input { padding: 12px 14px; font-size: 14px; }
  .hero__search-submit--logo {
    padding: 0 10px;
    gap: 0;
  }
  .hero__search-submit-logo { width: 32px; height: 32px; }
  .hero__search-submit--logo span { display: none; }
  .hero__hint { font-size: 11px; }

  /* Card backs hidden at mobile (already hidden at <=1250px) */
  .hero__cardback { display: none; }

  /* Featured-set 2-col split: stack vertically */
  .page-home .featured-set__split {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .page-home .card-grid--three-up { grid-template-columns: repeat(2, 1fr); }

  /* All card grids drop to 2-up on mobile */
  .featured-set .card-grid,
  .page-set .card-grid,
  .v3-block .card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  /* Pantheon callouts already 2x2 from tablet; tighten padding */
  .pantheon-callout { padding: 28px 16px 24px; }
  .pantheon-callout__glyph { font-size: 44px; }

  /* Set page header */
  .page-set .set-header { padding: 40px var(--page-padding-x) 32px; }
  .page-set .set-header h1 { font-size: 32px; }

  /* Card detail: stack image above content */
  .page-card-detail .card-detail {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 32px var(--page-padding-x) 56px;
  }
  .card-detail__sidebar { max-width: 360px; margin: 0 auto; }
  .card-detail__identity h1 { font-size: 32px; }

  /* Stat grid: 4 cols → 2x2 */
  .stat-grid { grid-template-columns: repeat(2, 1fr); }

  /* Type matchups: 2 cols → stack */
  .type-matchups { grid-template-columns: 1fr; }

  /* Evolution chain stages: horizontal scroll with smaller stage width */
  .evolution-chain__stage { flex: 0 0 130px; }

  /* Metadata footer: 3 cols → stack */
  .metadata { grid-template-columns: 1fr; gap: 18px; }

  /* Search page hero + results toolbar */
  .page-search .search-hero { padding: 32px var(--page-padding-x) 28px; }
  .search-hero__title { font-size: 26px; }
  /* Keep search form horizontal at mobile; hide "Search" label so the
   * logo-only button stays narrow and leaves room for the input. */
  .search-form__input { padding: 12px 14px; font-size: 14px; }
  .search-form__submit.hero__search-submit--logo {
    padding: 0 10px;
    gap: 0;
  }
  .search-form__submit .hero__search-submit-logo { width: 32px; height: 32px; }
  .search-form__submit span { display: none; }
  .search-results-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .view-toggle { align-self: flex-start; }
  .card-grid--standard { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  /* /cards (browse) page: drop to 2 cols, tighter header */
  .page-cards .card-grid { grid-template-columns: repeat(2, 1fr); }
  .page-cards .cards-header { padding: 40px var(--page-padding-x) 28px; }
  .page-cards .cards-header h1 { font-size: 28px; }
  .cards-filter-group { padding: 12px; }

  /* Types grid: 3 cols → 2 cols on mobile */
  .types-grid { grid-template-columns: repeat(2, 1fr); }
  .page-types .types-header { padding: 40px var(--page-padding-x) 32px; }
  .page-types .types-header h1 { font-size: 32px; }

  /* Footer tightening */
  footer[role="contentinfo"] { padding: 24px var(--page-padding-x); font-size: 11px; }

  /* Variant switcher: tuck out of the way (debug-only chrome) */
  .variant-switcher {
    top: 70px;
    right: 8px;
    padding: 6px 8px;
    font-size: 10px;
  }
}

/* ---------- SMALL MOBILE: <= 480px ---------- */
@media (max-width: 480px) {
  :root { --page-padding-x: 16px; }

  .nav__brand { font-size: 16px; }
  .nav__logo { width: 28px; height: 28px; }

  .page-home .hero__title { font-size: 24px; }
  .hero__logo { width: 88px; }

  .featured-set__title,
  .v3-feature__title {
    font-size: 18px;
  }

  /* Card grids drop to 1-up only when truly cramped */
  .page-set .card-grid,
  .featured-set .card-grid {
    grid-template-columns: 1fr;
  }
  .page-home .card-grid--three-up,
  .v3-block .card-grid,
  .card-grid--standard {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Pantheon callouts stack on tiny screens */
  .page-home .pantheon-callouts { grid-template-columns: 1fr; }
  .pantheon-callout { border-right: none; border-bottom: 1px solid var(--border-subtle); }

  /* Types grid: 2 cols → 1 col at smallest sizes */
  .types-grid { grid-template-columns: 1fr; }
}

/* Touch target floor (44px) on mobile interactive elements */
@media (max-width: 1023px) {
  .nav__drawer-links a,
  .card-tile,
  .view-toggle__btn,
  .hero__search-submit,
  .search-form__submit,
  .v2-search__submit,
  .v4-search__submit {
    min-height: 44px;
  }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .card-tile:hover { transform: none; }
  .card-tile:hover .card-tile__image img { transform: none; }
}

/* ============================================================
   DECKBUILDER
   Two-column layout: a sticky summary/roster sidebar on the left,
   a tabbed picker (beings / gems) on the right. All state is owned
   by /static/js/deckbuilder.js — CSS only handles selected / disabled
   visuals via aria-pressed and .is-selected.
   ============================================================ */

.page-deckbuilder main {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 24px var(--page-padding-x) 80px;
}

.deckbuilder__header {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  align-items: end;
  gap: 32px;
  padding-bottom: 20px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border-rule);
}

.deckbuilder__header-left { display: flex; flex-direction: column; gap: 6px; }
.deckbuilder__title {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}
.deckbuilder__sub {
  color: var(--text-muted);
  font-size: 14px;
  max-width: 56ch;
}

.deckbuilder__header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.deckbuilder__name-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 320px;
}
.deckbuilder__name-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.deckbuilder__name-input {
  background: var(--bg-input);
  border: 1px solid var(--border-rule);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 10px 14px;
  border-radius: 4px;
  outline: none;
  transition: border-color 0.15s ease;
}
.deckbuilder__name-input::placeholder { color: var(--text-faint); }
.deckbuilder__name-input:focus { border-color: var(--accent-gold); }

.deckbuilder__actions { display: flex; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 18px;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn--primary {
  background: var(--accent-gold);
  color: var(--bg-deep);
  border-color: var(--accent-gold);
}
.btn--primary:not([disabled]):hover { background: var(--accent-gold-dim); border-color: var(--accent-gold-dim); }
.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-rule);
}
.btn--ghost:not([disabled]):hover { color: var(--accent-gold); border-color: var(--border-gold); }

.deckbuilder__layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
  align-items: start;
}

/* ---------- summary / roster ---------- */

.deckbuilder__summary {
  position: sticky;
  top: 88px; /* below the sticky 64px header + a little air */
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: calc(100vh - 104px);
  overflow: auto;
}

.deck-counters { display: flex; flex-direction: column; gap: 12px; }

.deck-counter { display: flex; flex-direction: column; gap: 6px; }
.deck-counter__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.deck-counter__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.deck-counter__value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
}
.deck-counter__sub { color: var(--text-faint); font-size: 11px; }
.deck-counter__bar {
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
}
.deck-counter__fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent-gold);
  transition: width 0.18s ease;
}

.deckbuilder__status {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-elevated-alt);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 10px 12px;
  line-height: 1.4;
}
.deckbuilder__status--valid {
  color: var(--success-text);
  background: rgba(74, 124, 61, 0.15);
  border-color: rgba(74, 124, 61, 0.45);
}

.deckbuilder__roster-title,
.deckbuilder__roster-subtitle {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.deckbuilder__roster-subtitle { margin-top: 16px; font-size: 12px; }

.deckbuilder__roster-list { display: flex; flex-direction: column; gap: 6px; }
.deckbuilder__roster-empty {
  color: var(--text-faint);
  font-size: 12px;
  font-style: italic;
}

.roster-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  background: var(--bg-elevated-alt);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
}
.roster-row__images {
  display: flex;
  gap: 2px;
}
.roster-row__images img {
  width: 18px;
  height: 25px;
  object-fit: cover;
  border-radius: 2px;
  background: var(--bg-deep);
}
.roster-row--gem .roster-row__images img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}
.roster-row__meta { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.roster-row__name {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.roster-row__sub { font-size: 11px; color: var(--text-muted); }
.roster-row__remove {
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 18px;
  line-height: 1;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.roster-row__remove:hover { background: rgba(139, 58, 47, 0.25); color: var(--danger-text); }

/* ---------- picker ---------- */

.deckbuilder__picker { min-width: 0; }

.deckbuilder__tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-rule);
  margin-bottom: 24px;
}
.deckbuilder__tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 12px 18px;
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease;
}
.deckbuilder__tab:hover { color: var(--accent-gold); }
.deckbuilder__tab.is-active { color: var(--accent-gold); }
.deckbuilder__tab.is-active::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: -1px;
  height: 2px;
  background: var(--accent-gold);
  box-shadow: 0 0 12px rgba(232, 181, 71, 0.4);
}

.deckbuilder__panel { display: none; flex-direction: column; gap: 32px; }
.deckbuilder__panel.is-active { display: flex; }

.persona-group { display: flex; flex-direction: column; gap: 14px; }
.persona-group__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}
.persona-group__glyph {
  font-size: 20px;
  color: var(--accent-gold);
  line-height: 1;
}
.persona-group__title {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text-primary);
}
.persona-group__count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.persona-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.persona-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 12px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  color: var(--text-body);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.persona-card:hover:not([disabled]):not(.is-selected) {
  border-color: var(--border-gold);
  background: var(--bg-elevated-alt);
  transform: translateY(-1px);
}
.persona-card.is-selected {
  border-color: var(--accent-gold);
  background: rgba(232, 181, 71, 0.08);
}
.persona-card[disabled] { opacity: 0.4; cursor: not-allowed; }

.persona-card__images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.persona-card__level {
  position: relative;
  display: block;
}
.persona-card__img {
  width: 100%;
  aspect-ratio: 5 / 7;
  object-fit: cover;
  background: var(--bg-deep);
  border-radius: 3px;
  display: block;
}
.persona-card__power {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(12, 8, 32, 0.85);
  color: var(--accent-gold);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 3px;
  border: 1px solid var(--border-gold);
  pointer-events: none;
}

.persona-card__meta {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0 8px;
  align-items: center;
}
.persona-card__name {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  grid-column: 1;
}
.persona-card__subtitle {
  font-size: 11px;
  color: var(--text-muted);
  grid-column: 1;
  grid-row: 2;
}
.persona-card__type {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--bg-elevated-alt);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
}
.persona-card__type img {
  width: 18px;
  height: 18px;
  filter: brightness(0.95);
}

.persona-card__state {
  display: flex;
  justify-content: flex-end;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.persona-card__state-add { color: var(--accent-gold); }
.persona-card__state-remove { color: var(--danger-text); display: none; }
.persona-card.is-selected .persona-card__state-add { display: none; }
.persona-card.is-selected .persona-card__state-remove { display: inline; }

/* ---------- gems ---------- */

.gem-group { display: flex; flex-direction: column; gap: 12px; }
.gem-group__title {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--text-primary);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}
.gem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.gem-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 12px;
  text-align: center;
}
.gem-card__img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  background: var(--bg-deep);
  border-radius: 50%;
}
.gem-card__meta { display: flex; flex-direction: column; gap: 8px; align-items: center; width: 100%; }
.gem-card__rarity { font-size: 12px; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; }
.gem-card__counter {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gem-card__btn {
  background: var(--bg-input);
  border: 1px solid var(--border-rule);
  color: var(--text-primary);
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.gem-card__btn:hover:not([disabled]) { border-color: var(--accent-gold); color: var(--accent-gold); }
.gem-card__btn[disabled] { opacity: 0.35; cursor: not-allowed; }
.gem-card__count {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--text-primary);
  min-width: 1.5ch;
  text-align: center;
}

/* ============================================================
   CARD DETAIL — STACKED POWER SUBLINE
   Renders under the printed Power value on L2/L3 cards, showing the
   sum-of-stack effective combat power per Janak's 2026-06-02 ruling.
   ============================================================ */

.stat-grid__sub {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-gold);
  letter-spacing: 0.04em;
  cursor: help;
}

/* ============================================================
   ERROR PAGES (/404, /500)
   Themed: Shiva for 404 (Being Not Found), Kali for 500
   (Existential Error). Big code, persona art, body, CTAs.
   ============================================================ */

.page-error main {
  min-height: calc(100vh - 64px - 96px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px var(--page-padding-x);
}

.error-page__inner {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 56px;
  align-items: center;
  max-width: 1000px;
  width: 100%;
}

.error-page__art {
  position: relative;
}
.error-page__art img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5),
              0 0 24px rgba(232, 181, 71, 0.12);
}

.error-page__body { min-width: 0; }

.error-page__code {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(72px, 12vw, 128px);
  color: var(--accent-gold);
  line-height: 0.9;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  text-shadow: 0 0 32px rgba(232, 181, 71, 0.25);
}
.page-error--500 .error-page__code { color: var(--danger-text); text-shadow: 0 0 32px rgba(139, 58, 47, 0.35); }

.error-page__title {
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 36px);
  color: var(--text-primary);
  letter-spacing: 0.02em;
  margin-bottom: 16px;
  max-width: 22ch;
}

.error-page__lede {
  font-size: 17px;
  color: var(--text-body);
  margin-bottom: 12px;
  max-width: 50ch;
}

.error-page__body-text {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 28px;
  max-width: 56ch;
  line-height: 1.6;
}

.error-page__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .error-page__inner {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }
  .error-page__art {
    max-width: 240px;
    margin: 0 auto;
  }
  .error-page__title,
  .error-page__lede,
  .error-page__body-text {
    margin-left: auto;
    margin-right: auto;
  }
  .error-page__actions {
    justify-content: center;
  }
}

/* ============================================================
   ORGANIZED PLAY — empty state
   ============================================================ */

.op-event-empty {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 28px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* ============================================================
   STATIC CONTENT PAGES (/rules, /about, /organized-play)
   Shared header pattern. Each page extends with its own section
   classes below.
   ============================================================ */

.page-header {
  padding: 56px var(--page-padding-x) 32px;
  border-bottom: 1px solid var(--border-rule);
  margin-bottom: 48px;
}
.page-header__inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
}
.page-header__title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 48px);
  color: var(--text-primary);
  letter-spacing: 0.02em;
  margin: 8px 0 12px;
  max-width: 22ch;
}
.page-header__lede {
  color: var(--text-muted);
  font-size: 17px;
  max-width: 60ch;
  line-height: 1.5;
}

/* ---------- /rules ---------- */

.rules-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--page-padding-x) 80px;
  align-items: start;
}

.rules-toc {
  position: sticky;
  top: 88px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 20px;
  max-height: calc(100vh - 104px);
  overflow: auto;
}
.rules-toc__title {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--text-primary);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.rules-toc__list {
  list-style: none;
  counter-reset: rules-toc;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}
.rules-toc__list li { counter-increment: rules-toc; }
.rules-toc__list a {
  display: block;
  color: var(--text-muted);
  font-size: 13px;
  padding: 4px 0 4px 28px;
  position: relative;
  line-height: 1.3;
  transition: color 0.15s ease;
}
.rules-toc__list a::before {
  content: counter(rules-toc, upper-roman);
  position: absolute;
  left: 0;
  top: 4px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 12px;
  color: var(--accent-gold);
  width: 22px;
  text-align: right;
}
.rules-toc__list a:hover { color: var(--accent-gold); }
.rules-toc__hint {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-faint);
}
.rules-toc__hint strong { color: var(--text-primary); }

.rules-body { min-width: 0; }

.rules-section {
  padding-top: 8px;
  padding-bottom: 40px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
  scroll-margin-top: 80px;
}
.rules-section:last-child {
  border-bottom: none;
}

.rules-section__title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 28px);
  color: var(--text-primary);
  letter-spacing: 0.02em;
  margin-bottom: 14px;
}
.rules-section__numeral {
  font-style: italic;
  color: var(--accent-gold);
  font-size: 0.85em;
  font-weight: 400;
  min-width: 1.6em;
}
.rules-section__lede {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 18px;
}

.rules-section ul,
.rules-section ol {
  padding-left: 22px;
  margin-bottom: 8px;
  color: var(--text-body);
}
.rules-section li { margin: 6px 0; line-height: 1.6; }
.rules-section li > ul,
.rules-section li > ol {
  margin: 6px 0;
}
.rules-section strong { color: var(--text-primary); }
.rules-section em { color: var(--accent-gold); font-style: italic; }
.rules-section code {
  background: var(--bg-input);
  color: var(--text-primary);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.85em;
}
.rules-section a { color: var(--accent-gold); text-decoration: underline; text-decoration-color: rgba(232, 181, 71, 0.3); }
.rules-section a:hover { color: var(--text-primary); text-decoration-color: var(--accent-gold); }

.how-to-play {
  list-style: none;
  padding-left: 0;
  counter-reset: how;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.how-to-play li {
  counter-increment: how;
  position: relative;
  padding: 18px 18px 18px 56px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}
.how-to-play li::before {
  content: counter(how, decimal-leading-zero);
  position: absolute;
  top: 18px;
  left: 18px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  color: var(--accent-gold);
  line-height: 1;
}
.how-to-play__name {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.how-to-play li p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.rules-defs {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 18px;
  margin-top: 4px;
}
.rules-defs dt {
  font-family: var(--font-mono);
  color: var(--accent-gold);
  font-size: 13px;
  align-self: baseline;
}
.rules-defs dd {
  color: var(--text-body);
  font-size: 14px;
  margin: 0;
  align-self: baseline;
}

/* ---------- /about ---------- */

.about-story,
.about-pillars,
.about-creator,
.about-cta {
  padding: 0 var(--page-padding-x);
  margin-bottom: 64px;
}
.about-story__inner,
.about-pillars__inner,
.about-creator__inner,
.about-cta__inner {
  max-width: 880px;
  margin: 0 auto;
}

.about-section__title {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 28px);
  color: var(--text-primary);
  letter-spacing: 0.02em;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.about-story p {
  font-size: 16px;
  color: var(--text-body);
  line-height: 1.7;
  max-width: 70ch;
}

.about-pillars__list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
}
.about-pillar {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 20px;
  position: relative;
}
.about-pillar__numeral {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 28px;
  color: var(--accent-gold);
  display: block;
  line-height: 1;
  margin-bottom: 8px;
}
.about-pillar__name {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.about-pillar p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
}

.about-creator p {
  font-size: 16px;
  color: var(--text-body);
  line-height: 1.7;
  margin-bottom: 16px;
  max-width: 70ch;
}
.about-creator__roles {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 24px !important;
}
.about-creator__attribution {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--accent-gold);
  font-size: 15px;
  margin-top: 24px;
}

.about-cta {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding-top: 48px;
  padding-bottom: 48px;
  margin-bottom: 0;
  text-align: center;
}
.about-cta__eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.about-cta__title {
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 26px);
  color: var(--text-primary);
  margin-bottom: 24px;
  max-width: 32ch;
  margin-left: auto;
  margin-right: auto;
}
.about-cta__buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- /organized-play ---------- */

.op-events,
.op-prizes,
.op-discord {
  padding: 0 var(--page-padding-x);
  margin-bottom: 64px;
}
.op-events__inner,
.op-prizes__inner,
.op-discord__inner {
  max-width: 880px;
  margin: 0 auto;
}

.op-section__title {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.6vw, 24px);
  color: var(--text-primary);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.op-event-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.op-event {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 20px;
}
.op-event__date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated-alt);
  border: 1px solid var(--border-rule);
  border-radius: 6px;
  padding: 10px 12px;
}
.op-event__month {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--accent-gold);
  text-transform: uppercase;
}
.op-event__day {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--text-primary);
  line-height: 1;
  margin-top: 4px;
}
.op-event__name {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.op-event__name em {
  color: var(--accent-gold);
  font-style: italic;
}
.op-event__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.op-event__body p:last-child {
  color: var(--text-body);
  font-size: 14px;
  line-height: 1.5;
}

.op-prizes p {
  color: var(--text-body);
  font-size: 15px;
  line-height: 1.6;
  max-width: 60ch;
}

.op-discord {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 40px var(--page-padding-x);
  margin-bottom: 0;
}
.op-discord__inner { text-align: center; }
.op-discord p {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 20px;
  max-width: 56ch;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- responsive ---------- */

@media (max-width: 1023px) {
  .rules-layout { grid-template-columns: 1fr; }
  .rules-toc { position: static; max-height: none; }
  .op-event { grid-template-columns: 64px 1fr; gap: 16px; }
}

/* ============================================================
   PRINT (proxy print page)
   Screen view: stacked US Letter "sheets" with a shadow so you can
   preview before printing. Print view: clean cards-only, 3x3 grid,
   page-break-after between sheets.
   ============================================================ */

.page-print main {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 24px var(--page-padding-x) 48px;
}

.print-screen {
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-rule);
}

.print-toolbar {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.print-toolbar__back {
  font-size: 13px;
  color: var(--text-muted);
}
.print-toolbar__back:hover { color: var(--accent-gold); }
.print-toolbar__name {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text-primary);
}
.print-toolbar__counts {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}
.print-toolbar > .btn { margin-left: auto; }

.print-toolbar__hint {
  color: var(--text-muted);
  font-size: 13px;
  max-width: 70ch;
}

.print-empty {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
}
.print-empty a { color: var(--accent-gold); }

.print-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* A single physical page. Dimensions are real (in inches) so the screen
   preview matches what will print. */
.print-page {
  background: white;
  color: #222;
  width: 8.5in;
  height: 11in;
  padding: 0.25in 0.5in;
  display: grid;
  grid-template-columns: repeat(3, 2.5in);
  grid-template-rows: repeat(3, 3.5in);
  gap: 0;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  position: relative;
}

.print-card {
  width: 2.5in;
  height: 3.5in;
  overflow: hidden;
  background: #f4f4f4;
}
.print-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.print-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0.25in;
  font-family: var(--font-display);
  background: #e6e1d6;
  color: #2a2438;
  border: 1px dashed #b6ac90;
}
.print-card__placeholder-label {
  font-size: 13pt;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.print-card__placeholder-sub {
  font-size: 9pt;
  margin-top: 4px;
  color: #5a5168;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Gem placeholders tint by color so they're visually distinguishable
   even without art. Subtle — proxies should look intentional, not bright. */
.print-card__placeholder[data-color="red"]     { background: #f3d9d2; border-color: #b86354; color: #5b1e15; }
.print-card__placeholder[data-color="green"]   { background: #d8e6c8; border-color: #5d8043; color: #2a3a18; }
.print-card__placeholder[data-color="blue"]    { background: #cfd9ec; border-color: #4c6da3; color: #1c2b4a; }
.print-card__placeholder[data-color="rainbow"] { background: linear-gradient(135deg, #f3d9d2 0%, #d8e6c8 33%, #cfd9ec 66%, #ead7b6 100%); border-color: #8a7344; color: #2a2438; }

@media print {
  /* Strip everything that isn't a print page. */
  header[role="banner"],
  footer[role="contentinfo"],
  .print-screen,
  .skip-link { display: none !important; }

  html, body, main {
    background: white !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
  }
  .page-print main { padding: 0 !important; }

  @page {
    size: letter portrait;
    margin: 0;
  }

  .print-pages {
    display: block;
    gap: 0;
    padding: 0;
  }
  .print-page {
    box-shadow: none;
    width: 8.5in;
    height: 11in;
    padding: 0.25in 0.5in;
    margin: 0;
    page-break-after: always;
    break-after: page;
  }
  .print-page:last-child { page-break-after: auto; break-after: auto; }

  /* Force backgrounds and colors to print as styled (Chrome/Safari only
     honor color-adjust by default in dialog; this nudges them). */
  *, *::before, *::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* ---------- toast ---------- */

.deckbuilder__toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-elevated);
  border: 1px solid var(--border-gold);
  color: var(--text-primary);
  font-size: 13px;
  padding: 12px 20px;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 16px rgba(232, 181, 71, 0.15);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 200;
}
.deckbuilder__toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.deckbuilder__toast--error {
  border-color: var(--danger);
  color: var(--danger-text);
}

/* ---------- responsive ---------- */

@media (max-width: 1023px) {
  .deckbuilder__layout { grid-template-columns: 1fr; }
  .deckbuilder__summary { position: static; max-height: none; }
  .deckbuilder__header { grid-template-columns: 1fr; }
  .deckbuilder__header-right { align-items: stretch; }
  .deckbuilder__name-field { min-width: 0; }
}

/* Mobile-specific tightening: bump touch targets, tighten persona grid,
   compact the summary so the picker has more screen. */
@media (max-width: 640px) {
  .page-deckbuilder main {
    padding: 16px 12px 80px;
  }
  .deckbuilder__header {
    gap: 16px;
    margin-bottom: 20px;
  }
  .deckbuilder__title {
    font-size: 24px;
  }
  .deckbuilder__sub {
    font-size: 13px;
  }
  .deckbuilder__actions {
    flex-wrap: wrap;
  }
  .deckbuilder__actions .btn {
    flex: 1 0 auto;
    min-height: 44px;
  }

  .deckbuilder__summary {
    padding: 14px;
  }

  /* Persona grid: 2-up on phones; tighter card padding. */
  .persona-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .persona-card {
    padding: 10px;
    gap: 8px;
    /* Touch-target floor — the whole card is the tap target. */
    min-height: 44px;
  }
  .persona-card__name { font-size: 14px; }
  .persona-card__subtitle { font-size: 10px; }
  .persona-card__type { width: 24px; height: 24px; }
  .persona-card__type img { width: 16px; height: 16px; }

  /* Gem grid: 2-up; bigger +/- buttons. */
  .gem-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .gem-card { padding: 10px; }
  .gem-card__img { width: 64px; height: 64px; }
  .gem-card__btn {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }
  .gem-card__count {
    font-size: 18px;
    min-width: 2ch;
  }

  /* Roster rows: a bit roomier so the remove × is easy to hit. */
  .roster-row__remove {
    width: 32px;
    height: 32px;
    font-size: 20px;
  }
}

