/* The Dragon Codex — Basgiath archive aesthetic: obsidian, gold leaf, parchment, ink. */
:root {
  --obsidian: #0b0a0d;
  --ink: #141218;
  --ink-2: #1d1a22;
  --line: rgba(201, 162, 74, 0.28);
  --gold: #c9a24a;
  --gold-hi: #f3dc94;
  --gold-lo: #7d5c1e;
  --parchment: #e8dcc0;
  --parchment-2: #d9c9a3;
  --parchment-ink: #2a2118;
  --text: #e9e2d2;
  --muted: #a89f8c;
  --blood: #8b1e1e;
  --dragon: #1c1b21;
  --dragon-accent: #9fb4d8;
  --dragon-eye: #e8b84a;
  --radius: 14px;
  --serif: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --display: 'Cinzel', 'Trajan Pro', 'Times New Roman', serif;
  --gutter: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--dragon-accent) 14%, transparent), transparent 70%),
    radial-gradient(800px 500px at 100% 100%, rgba(139, 30, 30, 0.12), transparent 70%),
    var(--obsidian);
  color: var(--text);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.55;
  overflow-x: hidden;
}
img, canvas, svg { display: block; max-width: 100%; }
a { color: var(--gold-hi); }
a:focus-visible, button:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- gold leaf text ---------- */
.foil {
  background: linear-gradient(100deg, var(--gold-lo) 0%, var(--gold) 22%, var(--gold-hi) 40%, var(--gold) 55%, var(--gold-lo) 75%, var(--gold) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: foil 7s ease-in-out infinite;
}
@keyframes foil { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

h1, h2, h3, .display { font-family: var(--display); font-weight: 600; letter-spacing: 0.06em; line-height: 1.15; }
h2 { font-size: clamp(1.25rem, 4vw, 1.7rem); margin: 0 0 0.8rem; color: var(--gold); text-transform: uppercase; }
h2::after { content: ''; display: block; width: 72px; height: 1px; margin-top: 0.6rem; background: linear-gradient(90deg, var(--gold), transparent); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px var(--gutter);
  background: linear-gradient(rgba(11, 10, 13, 0.92), rgba(11, 10, 13, 0.75));
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  font-family: var(--display); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase;
}
.topbar a { text-decoration: none; color: var(--gold); }
.topbar .crumb { color: var(--muted); }
.topbar > * { white-space: nowrap; }
@media (max-width: 440px) { .topbar .crumb { display: none; } .spoiler-select > span { display: none; } }
.spoiler-select { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.spoiler-select select {
  background: var(--ink-2); color: var(--gold-hi); border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: 0.72rem; padding: 5px 6px; max-width: 42vw;
}

.wrap { max-width: 980px; margin: 0 auto; padding: 0 var(--gutter); }
section { padding: 36px 0; }

/* ---------- the card ---------- */
.card-stage { overflow-x: clip; perspective: 1400px; display: grid; place-items: center; padding: 28px 0 8px; position: relative; }
.aura { position: absolute; inset: -10% -20%; pointer-events: none; z-index: 0; }
.aura canvas { width: 100%; height: 100%; }
.card {
  position: relative; z-index: 1;
  width: min(84vw, 380px); aspect-ratio: 5 / 7.4;
  border: 0; padding: 0; background: none; color: inherit; font: inherit; text-align: inherit; cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.9s cubic-bezier(.2, .8, .2, 1);
  transform: rotateY(calc(var(--flip, 0) * 180deg)) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  -webkit-tap-highlight-color: transparent;
}
.card[aria-pressed='true'] { --flip: 1; }
.card.is-tilting { transition: transform 0.15s ease-out; }
.card__face {
  position: absolute; inset: 0; border-radius: var(--radius);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(201, 162, 74, 0.45), 0 0 50px color-mix(in srgb, var(--dragon-accent) 18%, transparent);
}
.card__front {
  background:
    radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--dragon-accent) 26%, transparent), transparent 60%),
    linear-gradient(170deg, #1a171f, #0a090c 70%);
  display: grid; grid-template-rows: auto 1fr auto;
}
.card__front::before, .card__back::before { /* double gold rule */
  content: ''; position: absolute; inset: 9px; border-radius: 9px; pointer-events: none; z-index: 3;
  border: 1px solid rgba(201, 162, 74, 0.7);
  box-shadow: inset 0 0 0 3px rgba(11, 10, 13, 0.9), inset 0 0 0 4px rgba(201, 162, 74, 0.35);
}
.card__corner { position: absolute; width: 34px; height: 34px; z-index: 4; color: var(--gold); }
.card__corner--tl { top: 4px; left: 4px; } .card__corner--tr { top: 4px; right: 4px; transform: scaleX(-1); }
.card__corner--bl { bottom: 4px; left: 4px; transform: scaleY(-1); } .card__corner--br { bottom: 4px; right: 4px; transform: scale(-1); }
.card__head { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px 0; font-family: var(--display); font-size: 0.72rem; letter-spacing: 0.2em; color: var(--gold); position: relative; z-index: 2; }
.card__breed { display: flex; align-items: center; gap: 6px; }
.card__breed svg { width: 22px; height: 22px; }
.card__art { position: relative; z-index: 1; min-height: 0; }
.card__art canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.card__foot { position: relative; z-index: 2; text-align: center; padding: 0 20px 26px; }
.card__name::after { display: none; }
.card__name { text-transform: none; font-family: var(--display); font-size: clamp(2rem, 9vw, 2.7rem); margin: 0; letter-spacing: 0.14em; line-height: 1; }
.card__epithet { margin: 6px 0 0; font-style: italic; color: var(--parchment-2); font-size: 1rem; }
.card__rider { margin: 6px 0 0; font-family: var(--display); font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.card__shine { position: absolute; inset: 0; z-index: 2; pointer-events: none; mix-blend-mode: soft-light;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 240, 200, 0.35) 48%, transparent 62%);
  background-size: 250% 250%; background-position: var(--shine-x, 100%) var(--shine-y, 0%); opacity: 0; transition: opacity 0.4s; }
.card.is-tilting .card__shine { opacity: 0.8; }

.card__back {
  transform: rotateY(180deg);
  background: radial-gradient(circle at 50% 0%, #f3ead4, var(--parchment) 45%, var(--parchment-2));
  color: var(--parchment-ink);
  padding: 30px 26px; display: flex; flex-direction: column;
}
.card__back h3 { margin: 0 0 4px; font-size: 1.3rem; text-align: center; letter-spacing: 0.16em; }
.card__back .sub { text-align: center; font-style: italic; margin: 0 0 12px; font-size: 0.95rem; }
.card__back dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; font-size: 0.95rem; }
.card__back dt { font-family: var(--display); font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase; color: #6b5432; padding-top: 4px; }
.card__back dd { margin: 0; }
.seal { margin: auto auto 0; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--dragon-accent) 40%, #b02a2a), #5a0d0d 75%);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35), inset 0 -3px 6px rgba(0, 0, 0, 0.4); color: rgba(255, 230, 200, 0.85); }
.seal svg { width: 34px; height: 34px; }
.hint { text-align: center; color: var(--muted); font-size: 0.9rem; margin: 18px 0 0; font-style: italic; }

/* ---------- parchment codex entry ---------- */
.parchment {
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.35), transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(120, 80, 30, 0.18), transparent 50%),
    linear-gradient(var(--parchment), var(--parchment-2));
  color: var(--parchment-ink);
  border-radius: 6px;
  padding: clamp(22px, 5vw, 44px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 0 60px rgba(90, 60, 20, 0.25);
  position: relative;
}
.parchment h2 { color: #5a3f17; }
.parchment h2::after { background: linear-gradient(90deg, #8a6a30, transparent); }
.parchment p { margin: 0 0 1em; }
.dropcap::first-letter { font-family: var(--display); float: left; font-size: 3.6em; line-height: 0.85; padding: 6px 8px 0 0; color: var(--blood); }
.scribe-note { font-size: 0.82rem; font-style: italic; color: #6b5432; border-top: 1px solid rgba(90, 60, 20, 0.3); padding-top: 10px; margin-top: 18px; }

/* ---------- bond ---------- */
.bond { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .bond { grid-template-columns: 1fr 1fr; } }
.tile { background: linear-gradient(160deg, var(--ink-2), var(--ink)); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.tile .k { font-family: var(--display); font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.tile .v { font-size: 1.4rem; color: var(--gold-hi); margin-top: 4px; }

/* ---------- ledger ---------- */
.ledger { width: 100%; border-collapse: collapse; font-size: 1rem; }
.ledger th, .ledger td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ledger th { font-family: var(--display); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); font-weight: 600; width: 34%; }
.cite { font-size: 0.7em; vertical-align: super; margin-left: 2px; text-decoration: none; color: var(--gold); }
.book-tag { display: inline-block; font-family: var(--display); font-size: 0.6rem; letter-spacing: 0.12em; border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; color: var(--muted); margin-left: 6px; vertical-align: middle; }

/* ---------- scenes ---------- */
.scene { margin: 0 0 34px; }
.scene h3 { font-size: 1.1rem; margin: 0 0 4px; color: var(--gold-hi); }
.scene .meta { color: var(--muted); font-size: 0.85rem; margin: 0 0 10px; font-family: var(--display); letter-spacing: 0.1em; }
.theater { position: relative; isolation: isolate; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #050407; aspect-ratio: 16 / 10; }
.theater canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* the poster shot's keyframe under the canvases: the scene shows before the cine layers decode (lazy, no JS needed) */
.theater__poster { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; pointer-events: none; } /* under every canvas (cine prepends its own) */
.theater canvas.cine { pointer-events: none; }
/* WebGL FX layer (fx.js): between the cine backdrop and the 2D stage overlay; premultiplied, so light adds */
.theater canvas.fxl { pointer-events: none; will-change: transform; }
.theater canvas.cine { will-change: transform; }
.theater__caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 16px 14px; min-height: 64px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  font-style: italic; font-size: clamp(0.95rem, 3.4vw, 1.1rem); text-align: center; color: #f2ead8; text-shadow: 0 1px 3px #000;
  transition: opacity 0.5s;
}
.theater__play {
  position: absolute; inset: 0; margin: auto; width: 74px; height: 74px; border-radius: 50%;
  border: 1px solid var(--gold); background: rgba(11, 10, 13, 0.65); color: var(--gold-hi); cursor: pointer;
  display: grid; place-items: center; backdrop-filter: blur(3px); transition: transform 0.2s, opacity 0.3s;
}
.theater__play:hover { transform: scale(1.06); }
.theater__play svg { width: 28px; height: 28px; margin-left: 4px; }
.theater.is-playing .theater__play { opacity: 0; pointer-events: none; }
.theater__progress { position: absolute; left: 0; top: 0; height: 2px; background: var(--gold); width: calc(var(--p, 0) * 100%); }
.scene .summary { margin: 12px 0 0; color: var(--text); }
.scene details { margin-top: 8px; color: var(--muted); font-size: 0.92rem; }
.scene details summary { cursor: pointer; font-family: var(--display); font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; }

/* ---------- quote ---------- */
.quote { margin: 0; text-align: center; padding: 20px 10px; }
.quote blockquote { margin: 0; font-size: clamp(1.4rem, 5vw, 2rem); font-style: italic; color: var(--parchment); }
.quote blockquote::before { content: '“'; color: var(--gold); } .quote blockquote::after { content: '”'; color: var(--gold); }
.quote figcaption { margin-top: 10px; color: var(--muted); font-family: var(--display); font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; }

/* ---------- spoilers ---------- */
.is-spoiler { position: relative; }
.is-spoiler > :not(.spoiler-veil) { filter: blur(9px); user-select: none; pointer-events: none; }
.spoiler-veil {
  position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; text-align: center; padding: 10px;
  background: rgba(11, 10, 13, 0.35); border-radius: 8px;
}
.spoiler-veil button { font: inherit; font-family: var(--display); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; background: var(--ink); color: var(--gold-hi); border: 1px solid var(--gold); border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.parchment .spoiler-veil { background: rgba(232, 220, 192, 0.35); }
/* on a card the veils sit in short rows and narrow stat cells: scale with the card and stay on one line, inside their block */
.tcg .spoiler-veil { padding: 0 1cqw; border-radius: 1cqw; }
.tcg .spoiler-veil button {
  max-width: 100%; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font-size: 2.3cqw; font-style: normal; line-height: 1.15; letter-spacing: 0.1em; padding: 0.6cqw 2.6cqw; border-width: 0.25cqw;
}
.tcg__flavor .spoiler-veil button { padding-block: 0.1cqw; } /* the one-line flavour row clips anything taller */

/* ---------- archives / pager / footer ---------- */
.archives ol { padding-left: 1.2em; color: var(--muted); font-size: 0.9rem; }
.archives a { word-break: break-word; }
.pager { display: flex; justify-content: space-between; gap: 12px; padding: 24px 0 40px; }
.pager a { flex: 1; text-decoration: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--ink); }
.pager a span { display: block; color: var(--muted); font-family: var(--display); font-size: 0.65rem; letter-spacing: 0.16em; text-transform: uppercase; }
.pager a strong { font-family: var(--display); color: var(--gold-hi); letter-spacing: 0.08em; }
.pager .next { text-align: right; }
footer.site { border-top: 1px solid var(--line); padding: 24px var(--gutter) 40px; color: var(--muted); font-size: 0.82rem; text-align: center; }
footer.site p { max-width: 640px; margin: 0.4em auto; }

/* ---------- index ---------- */
.masthead { text-align: center; padding: 56px var(--gutter) 10px; }
.masthead .sigil { width: 76px; height: 76px; margin: 0 auto 14px; color: var(--gold); }
.masthead h1 { font-size: clamp(2.2rem, 9vw, 4rem); margin: 0; }
.masthead p { color: var(--parchment-2); font-style: italic; margin: 10px auto 0; max-width: 560px; }
.dedication__signoff { display: block; margin-top: 10px; text-align: right; font-family: var(--display, serif); letter-spacing: .08em; color: var(--gold, #d4af37); }
.dedication { max-width: 560px; margin: 22px auto 0; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--parchment); font-style: italic; }
.deck { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 26px; padding: 30px 0 60px; margin: 0; list-style: none; }
.deck .card { width: 100%; }
.deck .card__name { font-size: clamp(1.6rem, 7vw, 2rem); }
.deck-item { display: flex; flex-direction: column; gap: 10px; }
.deck-item__body { display: flex; flex-direction: column; gap: 10px; }
.deck-item .enter { text-align: center; font-family: var(--display); font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; text-decoration: none; color: var(--gold); padding: 10px; border: 1px solid var(--line); border-radius: 999px; }
.deck-item .enter:hover { background: rgba(201, 162, 74, 0.08); }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.9s ease, transform 0.9s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .foil { animation: none; }
  .card { transition: none; }
}

/* ---------- gift card (one printable QR card → the landing) ---------- */
.gift-sheet { max-width: 520px; margin: 0 auto; padding: 24px var(--gutter) 60px; }
.gift-sheet__note { color: var(--muted); font-style: italic; text-align: center; }
.gift-card {
  position: relative; margin: 18px auto 0; width: min(100%, 92mm); padding: 26px 22px 22px; text-align: center; break-inside: avoid;
  border-radius: 16px; color: var(--parchment);
  background: radial-gradient(120% 70% at 50% 0%, rgba(201, 162, 74, 0.18), transparent 60%), linear-gradient(170deg, #1a1510, #0b0a0d);
  box-shadow: inset 0 0 0 1px rgba(201, 162, 74, 0.7), inset 0 0 0 6px rgba(11, 10, 13, 0.9), inset 0 0 0 7px rgba(201, 162, 74, 0.35);
}
.gift-card__sigil { width: 54px; height: 54px; margin: 0 auto 8px; color: var(--gold); }
.gift-card__eyebrow { margin: 0; font-family: var(--display); font-size: 0.66rem; letter-spacing: 0.34em; text-transform: uppercase; color: var(--muted); }
.gift-card h1 { margin: 4px 0 0; font-size: 1.7rem; color: var(--gold-hi); }
.gift-card__for { margin: 6px 0 0; font-style: italic; font-size: 1.15rem; }
.gift-card svg.qr { width: 100%; max-width: 200px; margin: 16px auto 10px; background: #f4ecd8; padding: 10px; border-radius: 10px; }
.gift-card__cta { margin: 0; font-family: var(--display); font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); }
@media print {
  body { background: #fff; color: #000; }
  .topbar, footer.site, .noprint { display: none !important; }
  .gift-card { -webkit-print-color-adjust: exact; print-color-adjust: exact; margin-top: 20mm; }
}

/* ---------- codex: progress, empty state, locked "???" slots (the edge writes the slot markup) ---------- */
.codex-progress { font-family: var(--display); font-style: normal !important; letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.82rem; color: var(--muted) !important; }
.codex-progress b { color: var(--gold-hi); font-weight: 600; }
.codex-empty { max-width: 520px; margin: 12px auto 0; text-align: center; font-style: italic; color: var(--parchment-2); }
.slot--locked {
  position: relative; container-type: inline-size; aspect-ratio: 63 / 88; width: 100%; border-radius: 14px; overflow: hidden;
  display: grid; place-items: center;
  background:
    radial-gradient(80% 55% at 50% 42%, rgba(201, 162, 74, 0.09), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.012) 0 6px, transparent 6px 12px),
    linear-gradient(165deg, #17131b, #08070a 72%);
  box-shadow: inset 0 0 0 1px rgba(201, 162, 74, 0.32), inset 0 0 0 7px rgba(8, 7, 10, 0.9), inset 0 0 0 8px rgba(201, 162, 74, 0.14), 0 16px 34px rgba(0, 0, 0, 0.5);
}
.slot--locked::before { /* the sigil, as a faint silhouette pressed into the card */
  content: ''; position: absolute; left: 50%; top: 42%; width: 62%; aspect-ratio: 1; translate: -50% -50%; opacity: 0.1;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80' fill='none' stroke='%23c9a24a' stroke-width='1.4'%3E%3Ccircle cx='40' cy='40' r='37'/%3E%3Ccircle cx='40' cy='40' r='31' opacity='.5'/%3E%3Cpath d='M40 12 L46 34 L68 40 L46 46 L40 68 L34 46 L12 40 L34 34Z' fill='%23c9a24a' fill-opacity='.3'/%3E%3Cpath d='M22 52 Q30 30 40 24 Q50 30 58 52 Q48 44 40 46 Q32 44 22 52Z' fill='%23c9a24a'/%3E%3C/svg%3E") center / contain no-repeat;
}
.slot--locked::after { /* a slow glint across the seal */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 40%, rgba(243, 220, 148, 0.07) 50%, transparent 60%) -100% 0 / 250% 100% no-repeat;
  animation: slot-glint 7s ease-in-out infinite;
}
@keyframes slot-glint { 0%, 60% { background-position: 150% 0; } 100% { background-position: -100% 0; } }
.slot__q { position: relative; font-family: var(--display); font-weight: 700; font-size: clamp(18px, 15cqw, 56px); letter-spacing: 0.12em; color: rgba(201, 162, 74, 0.42); text-shadow: 0 0 5cqw rgba(201, 162, 74, 0.25); translate: 0 -6%; }
.slot__num { position: absolute; left: 0; right: 0; bottom: 8cqw; text-align: center; font-family: var(--display); font-size: clamp(10px, 4.6cqw, 16px); letter-spacing: 0.16em; white-space: nowrap; color: rgba(168, 159, 140, 0.8); }
.deck-item--locked { opacity: 0.92; }
/* phones: locked slots tile three to a row like an album page; held cards take the full width */
@media (max-width: 599px) {
  .page-codex .deck { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 10px; }
  .page-codex .deck-item { grid-column: 1 / -1; }
  .page-codex .deck-item--locked { grid-column: auto; }
  .page-codex .slot--locked { border-radius: 10px; }
}
@media (prefers-reduced-motion: reduce) { .slot--locked::after { animation: none; } }

.parchment .epithet { margin: -0.4em 0 1.1em; font-style: italic; font-size: 1.05rem; color: #6b4c16; letter-spacing: 0.02em; }
.tcg__stats b { font-weight: 400; }
