/* Aether Chronicles player guide. Gold on night, matching the game:
   Cinzel for headings and card names, Inter for reading text.
   Served at paledust.com/aether/ and aetherchronicles.paledust.com/.
   House rule (paledust): no em or en dashes in copy. */

:root {
  --bg:        #07080f;
  --bg-2:      #0c0f1d;
  --panel:     #11142a;
  --panel-2:   #171b36;
  --line:      #262b4a;
  --line-2:    #39406a;
  --gold:      #c9a84c;
  --gold-2:    #e9d08b;
  --gold-dim:  rgba(201, 168, 76, 0.16);
  --ink:       #ede7d8;
  --ink-2:     #c2baa8;
  --ink-mute:  #8a8372;
  --violet:    #8b5cf6;
  --violet-2:  #6d28d9;

  --fire:   #e8613f;
  --water:  #3f95e8;
  --earth:  #b98d4f;
  --wind:   #4fcfa6;
  --light:  #f1d36a;
  --shadow: #a07ae0;

  --common:    #a3abb5;
  --uncommon:  #5fbf74;
  --rare:      #4d94ea;
  --epic:      #ad63e6;
  --legendary: #eca83c;
  --mythic:    #ee4f86;

  --f-display: 'Cinzel', 'Times New Roman', serif;
  --f-body:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono:    'JetBrains Mono', ui-monospace, monospace;

  --max-w:   1340px;
  --read-w:  760px;
  --pad:     clamp(16px, 4vw, 40px);
  --rad:     10px;
  --rad-sm:  6px;
  --ease:    cubic-bezier(0.2, 0.8, 0.2, 1);
  --header-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(139, 92, 246, 0.10), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(201, 168, 76, 0.07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink-2);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-2); text-decoration: none; }
a:hover { color: #fff3c8; text-decoration: underline; text-underline-offset: 3px; }
strong { color: var(--ink); font-weight: 600; }
em { color: var(--ink); }
code, kbd {
  font-family: var(--f-mono);
  font-size: 0.86em;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--gold-2);
}
::selection { background: rgba(201, 168, 76, 0.35); color: #fff; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 3px; }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--gold); color: #120d00; padding: 8px 14px; border-radius: 6px; font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* ── HEADER ────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; gap: 20px;
  padding: 0 var(--pad);
  background: rgba(7, 8, 15, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand img { height: 38px; width: auto; }
.brand-tag {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-mute); border-left: 1px solid var(--line-2); padding-left: 12px; line-height: 1.2;
}
.top-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; flex-wrap: nowrap; }
.top-nav a {
  font-size: 13.5px; color: var(--ink-2); padding: 7px 11px; border-radius: 6px; white-space: nowrap;
}
.top-nav a:hover { background: var(--panel); color: var(--ink); text-decoration: none; }
.top-nav a[aria-current="page"], .top-nav a.is-section { color: var(--gold-2); background: var(--gold-dim); }
.play-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(180deg, #8f63f8, #6a2fd8);
  color: #fff !important; font-weight: 600; font-size: 13.5px;
  padding: 8px 14px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 4px 18px rgba(124, 58, 237, 0.35), inset 0 1px 0 rgba(255,255,255,0.2);
}
.play-btn:hover { text-decoration: none; filter: brightness(1.1); }
.menu-btn {
  display: none; margin-left: auto; background: var(--panel); border: 1px solid var(--line-2);
  color: var(--ink); border-radius: 8px; padding: 8px 12px; font: inherit; font-size: 14px; cursor: pointer;
}

/* ── LAYOUT ────────────────────────────────────────────────── */
.page { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--pad); }
.doc {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 200px;
  gap: 44px;
  padding: 36px 0 80px;
  align-items: start;
}
.doc.wide-doc { grid-template-columns: 230px minmax(0, 1fr); }
.doc.solo { grid-template-columns: minmax(0, 1fr); }
.side-nav, .toc { position: sticky; top: calc(var(--header-h) + 24px); max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; }
.side-nav h2, .toc h2 {
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-mute); margin-bottom: 10px; font-weight: 500;
}
.side-nav ol, .toc ol { list-style: none; }
.side-nav li a {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; border-radius: 6px; font-size: 14px; color: var(--ink-2);
}
.side-nav li a img { width: 20px; height: 20px; opacity: 0.85; }
.side-nav li a:hover { background: var(--panel); text-decoration: none; color: var(--ink); }
.side-nav li a[aria-current="page"] { background: var(--gold-dim); color: var(--gold-2); }
.toc li a { display: block; font-size: 13px; color: var(--ink-mute); padding: 4px 0 4px 12px; border-left: 1px solid var(--line); }
.toc li.lvl-3 a { padding-left: 24px; font-size: 12.5px; }
.toc li a:hover { color: var(--ink); text-decoration: none; }
.toc li a.is-active { color: var(--gold-2); border-left-color: var(--gold); }

.content { min-width: 0; max-width: var(--read-w); }
.content.wide { max-width: none; }
.crumbs { font-size: 12.5px; color: var(--ink-mute); margin-bottom: 14px; font-family: var(--f-mono); letter-spacing: 0.05em; }
.crumbs a { color: var(--ink-mute); }
.eyebrow {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold);
  margin-bottom: 8px;
}
.content h1 {
  font-family: var(--f-display); font-weight: 600; color: var(--ink);
  font-size: clamp(30px, 4.4vw, 46px); line-height: 1.12; letter-spacing: 0.01em; margin-bottom: 14px;
}
.lede { font-size: 18px; color: var(--ink-2); margin-bottom: 30px; line-height: 1.65; }
.content h2 {
  font-family: var(--f-display); font-weight: 600; color: var(--gold-2);
  font-size: clamp(23px, 2.6vw, 29px); line-height: 1.25; margin: 52px 0 14px; padding-top: 18px;
  border-top: 1px solid var(--line);
}
.content h2:first-of-type { border-top: none; padding-top: 0; }
.content h3 { font-family: var(--f-display); color: var(--ink); font-size: 19px; font-weight: 600; margin: 30px 0 10px; }
.content h4 { color: var(--ink); font-size: 15.5px; font-weight: 600; margin: 22px 0 8px; }
.content p { margin-bottom: 16px; }
.content ul, .content ol { margin: 0 0 18px 22px; }
.content li { margin-bottom: 6px; }
.content li::marker { color: var(--gold); }
.content hr { border: none; border-top: 1px solid var(--line); margin: 36px 0; }
.anchor { color: var(--line-2); margin-left: 8px; font-size: 0.7em; opacity: 0; transition: opacity 0.2s; }
h2:hover .anchor, h3:hover .anchor { opacity: 1; }

/* ── COMPONENTS ────────────────────────────────────────────── */
.callout {
  border: 1px solid var(--line-2); border-left: 3px solid var(--gold);
  background: linear-gradient(90deg, rgba(201,168,76,0.08), rgba(17,20,42,0.6));
  border-radius: var(--rad-sm); padding: 14px 18px; margin: 20px 0;
}
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout .callout-title {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 4px; display: block;
}
.callout.tip { border-left-color: var(--wind); background: linear-gradient(90deg, rgba(79,207,166,0.08), rgba(17,20,42,0.6)); }
.callout.tip .callout-title { color: var(--wind); }
.callout.warn { border-left-color: var(--fire); background: linear-gradient(90deg, rgba(232,97,63,0.09), rgba(17,20,42,0.6)); }
.callout.warn .callout-title { color: var(--fire); }
.callout.lore { border-left-color: var(--shadow); background: linear-gradient(90deg, rgba(160,122,224,0.09), rgba(17,20,42,0.6)); font-style: italic; }
.callout.lore .callout-title { color: var(--shadow); font-style: normal; }

figure.shot { margin: 24px 0 28px; }
figure.shot img, figure.shot a.zoom {
  border-radius: var(--rad); border: 1px solid var(--line-2);
  box-shadow: 0 18px 50px rgba(0,0,0,0.5);
}
figure.shot a.zoom { display: block; overflow: hidden; cursor: zoom-in; }
figure.shot a.zoom img { border: none; border-radius: 0; box-shadow: none; transition: transform 0.4s var(--ease); }
figure.shot a.zoom:hover img { transform: scale(1.015); }
figure.shot figcaption { font-size: 13.5px; color: var(--ink-mute); margin-top: 10px; line-height: 1.55; }
figure.shot.phone { max-width: 320px; }
.shot-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 16px; margin: 22px 0; }
.shot-row figure.shot { margin: 0; }

.table-wrap { overflow-x: auto; margin: 18px 0 24px; border: 1px solid var(--line); border-radius: var(--rad-sm); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--panel); color: var(--ink); font-weight: 600; font-size: 13px; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover td { background: rgba(255,255,255,0.015); }

.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink); white-space: nowrap;
  vertical-align: 1px; background: var(--panel);
}
.pill img { width: 16px; height: 16px; }
.el-fire { color: var(--fire); } .el-water { color: var(--water); } .el-earth { color: var(--earth); }
.el-wind { color: var(--wind); } .el-light { color: var(--light); } .el-shadow { color: var(--shadow); }
.r-common { color: var(--common); } .r-uncommon { color: var(--uncommon); } .r-rare { color: var(--rare); }
.r-epic { color: var(--epic); } .r-legendary { color: var(--legendary); } .r-mythic { color: var(--mythic); }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 20px 0 28px; }
.tile {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--rad); padding: 16px 16px 14px;
  position: relative;
}
.tile h3, .tile h4 { margin: 0 0 6px !important; font-size: 16.5px; display: flex; align-items: center; gap: 10px; }
.tile p { font-size: 14px; margin-bottom: 8px; }
.tile p:last-child { margin-bottom: 0; }
.tile .icon { width: 40px; height: 40px; flex-shrink: 0; }
.tile .meta { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-mute); }
a.tile { display: block; color: inherit; transition: border-color 0.25s, transform 0.25s var(--ease), box-shadow 0.25s; }
a.tile:hover { border-color: var(--gold); text-decoration: none; transform: translateY(-2px); box-shadow: 0 12px 34px rgba(0,0,0,0.45); }
a.tile h3 { color: var(--gold-2); }

.kw-list { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 18px 0 28px; }
.kw {
  display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: start;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--rad); padding: 14px 16px;
}
.kw img { width: 56px; height: 56px; }
.kw h3 { margin: 0 0 4px !important; font-size: 18px; }
.kw p { margin-bottom: 6px; font-size: 14.5px; }
.kw .examples { font-size: 13px; color: var(--ink-mute); }
.kw .count { font-family: var(--f-mono); font-size: 11px; color: var(--ink-mute); margin-left: 8px; letter-spacing: 0.06em; }

.steps { counter-reset: step; list-style: none; margin: 18px 0 26px !important; }
.steps > li {
  counter-increment: step; position: relative; padding: 2px 0 14px 46px; margin: 0 !important;
}
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--f-display); font-weight: 700; font-size: 14px; color: #1a1300;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
}
.steps > li::after { content: ""; position: absolute; left: 14.5px; top: 34px; bottom: 2px; width: 1px; background: var(--line-2); }
.steps > li:last-child::after { display: none; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 20px 0 28px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--rad); padding: 14px 16px;
}
.stat b { display: block; font-family: var(--f-display); font-size: 28px; color: var(--gold-2); line-height: 1.1; }
.stat span { font-size: 13px; color: var(--ink-mute); }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 15px;
  border: 1px solid transparent; transition: filter 0.2s, transform 0.2s var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #1a1300 !important; box-shadow: 0 8px 26px rgba(201,168,76,0.28); }
.btn-violet { background: linear-gradient(180deg, #9467fa, #6a2fd8); color: #fff !important; box-shadow: 0 8px 26px rgba(124,58,237,0.35); }
.btn-ghost { border-color: var(--line-2); color: var(--ink) !important; background: rgba(17,20,42,0.6); }
.btn-ghost:hover { border-color: var(--gold); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.pager a {
  display: block; border: 1px solid var(--line); border-radius: var(--rad); padding: 14px 18px; background: var(--panel);
}
.pager a:hover { border-color: var(--gold); text-decoration: none; }
.pager small { display: block; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-mute); }
.pager span { font-family: var(--f-display); color: var(--gold-2); font-size: 17px; }
.pager .next { text-align: right; grid-column: 2; }

/* Element wheel (How to Play) */
.wheel { display: grid; grid-template-columns: minmax(0, 340px) 1fr; gap: 28px; align-items: center; margin: 22px 0 28px; }
.wheel svg { width: 100%; height: auto; }

/* ── HOME ──────────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  border-bottom: 1px solid var(--line);
  min-height: min(78vh, 720px);
  display: grid; align-items: end;
}
.hero-bg { position: absolute; inset: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; filter: saturate(1.05); }
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(7,8,15,0.25) 0%, rgba(7,8,15,0.35) 45%, rgba(7,8,15,0.96) 100%),
    radial-gradient(ellipse at center, transparent 40%, rgba(7,8,15,0.6) 100%);
}
.hero-inner { position: relative; max-width: var(--max-w); margin: 0 auto; width: 100%; padding: 120px var(--pad) 64px; }
.hero h1 {
  font-family: var(--f-display); color: var(--ink); font-weight: 700;
  font-size: clamp(36px, 6vw, 68px); line-height: 1.05; letter-spacing: 0.01em; max-width: 14ch;
  text-shadow: 0 4px 30px rgba(0,0,0,0.6);
}
.hero h1 em { font-style: normal; color: var(--gold-2); }
.hero p { font-size: clamp(16px, 1.6vw, 19px); max-width: 60ch; margin: 18px 0 26px; color: var(--ink); text-shadow: 0 2px 16px rgba(0,0,0,0.7); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 34px; font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
.hero-facts b { color: var(--gold-2); font-weight: 500; }

.home-section { padding: 64px 0 8px; }
.home-section > h2 {
  font-family: var(--f-display); color: var(--ink); font-size: clamp(26px, 3.2vw, 36px); font-weight: 600; margin-bottom: 8px;
}
.home-section > p.sub { color: var(--ink-2); max-width: 70ch; margin-bottom: 24px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.home-grid a.tile { padding: 0; overflow: hidden; }
.home-grid a.tile .tile-img { aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.home-grid a.tile .tile-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.home-grid a.tile:hover .tile-img img { transform: scale(1.04); }
.home-grid a.tile .tile-body { padding: 14px 16px 16px; }
.home-grid a.tile .tile-body p { color: var(--ink-2); }
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; align-items: center; }
.split p { margin-bottom: 14px; }

/* ── CARD DATABASE ─────────────────────────────────────────── */
.db-controls {
  position: sticky; top: var(--header-h); z-index: 20;
  background: rgba(7, 8, 15, 0.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); padding: 14px 0; margin-bottom: 18px;
}
.db-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.db-row + .db-row { margin-top: 10px; }
.db-search {
  flex: 1 1 260px; min-width: 0;
  background: var(--panel); border: 1px solid var(--line-2); color: var(--ink);
  border-radius: 999px; padding: 10px 16px; font: inherit; font-size: 15px;
}
.db-search::placeholder { color: var(--ink-mute); }
.db-select {
  background: var(--panel); border: 1px solid var(--line-2); color: var(--ink);
  border-radius: 999px; padding: 9px 14px; font: inherit; font-size: 14px; cursor: pointer; max-width: 100%;
}
.chip {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none;
  background: var(--panel); border: 1px solid var(--line-2); color: var(--ink-2);
  border-radius: 999px; padding: 6px 12px 6px 8px; font: inherit; font-size: 13px;
}
.chip img { width: 20px; height: 20px; }
.chip[aria-pressed="true"] { border-color: var(--gold); color: var(--ink); background: var(--gold-dim); }
.db-count { font-family: var(--f-mono); font-size: 12px; color: var(--ink-mute); letter-spacing: 0.06em; margin-left: auto; }
.db-reset { background: none; border: none; color: var(--gold-2); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.db-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; padding-bottom: 60px; }
.gcard {
  position: relative; aspect-ratio: 5 / 7; border-radius: 12px; overflow: hidden; cursor: pointer;
  background: #0b0d18; border: 2px solid var(--rc, var(--line-2));
  box-shadow: 0 10px 26px rgba(0,0,0,0.45), 0 0 0 1px rgba(0,0,0,0.6) inset;
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
  text-align: left; padding: 0; font: inherit; color: inherit; display: block; width: 100%;
}
.gcard:hover, .gcard:focus-visible { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(0,0,0,0.6), 0 0 18px color-mix(in srgb, var(--rc) 45%, transparent); }
.gcard .art { position: absolute; inset: 0 0 34% 0; }
.gcard .art img { width: 100%; height: 100%; object-fit: cover; }
.gcard .art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, #0b0d18 100%); }
.gcard .cost {
  position: absolute; top: 7px; left: 7px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--f-display); font-weight: 700; font-size: 15px; color: #1a1300;
  background: radial-gradient(circle at 35% 30%, #fff3c4, var(--gold) 60%, #7a5d18);
  box-shadow: 0 2px 6px rgba(0,0,0,0.6);
}
.gcard .elem { position: absolute; top: 7px; right: 7px; width: 26px; height: 26px; z-index: 2; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.7)); }
.gcard .info { position: absolute; left: 0; right: 0; bottom: 0; height: 36%; padding: 6px 9px 8px; display: flex; flex-direction: column; }
.gcard .name {
  font-family: var(--f-display); font-weight: 700; color: var(--ink); font-size: 12.5px; line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.gcard .type { font-size: 10.5px; color: var(--ink-mute); text-transform: capitalize; margin-top: 2px; }
.gcard .stats { margin-top: auto; display: flex; gap: 8px; font-family: var(--f-mono); font-size: 12px; font-weight: 600; }
.gcard .stats span { display: inline-flex; align-items: center; gap: 3px; }
.gcard .stats .a { color: #ff8a6b; } .gcard .stats .d { color: #84b8ff; } .gcard .stats .h { color: #8fe39b; }
.db-empty { text-align: center; padding: 60px 0; color: var(--ink-mute); }
.db-more { display: block; margin: 0 auto 60px; }

dialog.card-modal {
  margin: auto; inset: 0;
  border: 1px solid var(--line-2); border-radius: 16px; padding: 0; background: var(--bg-2); color: var(--ink-2);
  width: min(860px, calc(100vw - 24px)); max-height: calc(100vh - 24px);
  box-shadow: 0 30px 90px rgba(0,0,0,0.7);
}
dialog.card-modal::backdrop { background: rgba(3, 4, 10, 0.78); backdrop-filter: blur(4px); }
.cm-body { display: grid; grid-template-columns: minmax(0, 340px) 1fr; gap: 26px; padding: 24px; }
.cm-art { border-radius: 12px; overflow: hidden; border: 2px solid var(--rc, var(--line-2)); aspect-ratio: 3 / 4; background: #000; }
.cm-art img { width: 100%; height: 100%; object-fit: cover; }
.cm-info h2 { font-family: var(--f-display); color: var(--ink); font-size: 26px; line-height: 1.2; margin-bottom: 8px; }
.cm-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.cm-stats { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.cm-stats div { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; text-align: center; min-width: 70px; }
.cm-stats b { display: block; font-family: var(--f-display); font-size: 22px; color: var(--ink); }
.cm-stats small { font-size: 11px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.1em; }
.cm-text { font-size: 15.5px; line-height: 1.65; color: var(--ink); margin-bottom: 16px; white-space: pre-line; }
.cm-kws { display: grid; gap: 8px; }
.cm-kws div { display: grid; grid-template-columns: 30px 1fr; gap: 10px; font-size: 13.5px; align-items: start; }
.cm-kws img { width: 30px; height: 30px; }
.cm-close {
  position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%;
  background: var(--panel-2); border: 1px solid var(--line-2); color: var(--ink); font-size: 20px; cursor: pointer; line-height: 1;
}

/* Lightbox for screenshots */
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(3,4,10,0.92); display: none;
  align-items: center; justify-content: center; padding: 20px; cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 30px 90px rgba(0,0,0,0.8); }

/* ── FOOTER ────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); background: rgba(7,8,15,0.7); padding: 40px var(--pad) 46px; }
.footer-inner { max-width: var(--max-w); margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.footer-inner h3 { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-mute); font-weight: 500; margin-bottom: 10px; }
.footer-inner ul { list-style: none; }
.footer-inner li { margin-bottom: 5px; font-size: 14px; }
.footer-inner li a { color: var(--ink-2); }
.footer-brand img { height: 44px; width: auto; margin-bottom: 10px; }
.footer-brand p { font-size: 13.5px; color: var(--ink-mute); max-width: 36ch; }
.footer-legal { max-width: var(--max-w); margin: 26px auto 0; font-size: 12.5px; color: var(--ink-mute); display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .doc { grid-template-columns: 210px minmax(0, 1fr); }
  .toc { display: none; }
  .top-nav a.opt { display: none; }
}
@media (max-width: 900px) {
  .top-nav { display: none; }
  .menu-btn { display: inline-flex; }
  .site-header .play-btn { display: none; }
  .doc, .doc.wide-doc { grid-template-columns: minmax(0, 1fr); padding-top: 22px; gap: 0; }
  .db-controls { position: static; padding: 4px 0 14px; }
  .db-row .db-select { flex: 1 1 calc(50% - 5px); min-width: 0; }
  .db-search { flex-basis: 100%; }
  #db-els { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 4px; scrollbar-width: none; }
  .db-count { margin-left: 0; }
  .side-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0; z-index: 45; max-height: none;
    background: rgba(7, 8, 15, 0.98); padding: 20px var(--pad) 40px; display: none;
  }
  body.nav-open .side-nav { display: block; }
  body.nav-open { overflow: hidden; }
  .side-nav li a { font-size: 16px; padding: 10px 10px; }
  .split, .wheel { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .cm-body { grid-template-columns: 1fr; padding: 18px; }
  .cm-art { max-width: 300px; margin: 0 auto; width: 100%; }
}
@media (max-width: 560px) {
  body { font-size: 15.5px; }
  .brand-tag { display: none; }
  .brand img { height: 32px; }
  .db-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .gcard .name { font-size: 11.5px; }
  .kw { grid-template-columns: 44px 1fr; gap: 12px; padding: 12px; }
  .kw img { width: 44px; height: 44px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
  .footer-inner { grid-template-columns: 1fr; }
  .hero-inner { padding-top: 90px; padding-bottom: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* Glossary */
.glossary { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; margin: 18px 0 28px; border: 1px solid var(--line); border-radius: var(--rad); overflow: hidden; }
.glossary dt, .glossary dd { padding: 11px 16px; border-top: 1px solid var(--line); font-size: 14.5px; }
.glossary dt:first-of-type, .glossary dt:first-of-type + dd { border-top: none; }
.glossary dt { font-weight: 600; color: var(--gold-2); background: var(--panel); }
.glossary dd { color: var(--ink-2); }
@media (max-width: 560px) {
  .glossary { grid-template-columns: 1fr; }
  .glossary dd { border-top: none; padding-top: 0; background: var(--panel); }
}

/* Best Decks (builds) */
.build-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 22px 0 10px; }
.build-index .tile p { font-size: 13.5px; margin: 6px 0 0; }
.build { margin-top: 18px; }
.build-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.build-pitch { font-size: 17px; color: var(--ink); }
.build-stats { margin: 16px 0 18px; }
.deck-code { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; margin: 6px 0 6px; }
.deck-code code { flex: 1 1 260px; min-width: 0; overflow-x: auto; white-space: nowrap; padding: 10px 12px; font-size: 12.5px; border-radius: 8px; border: 1px solid var(--line-2); background: #0a0c18; scrollbar-width: thin; }
.deck-code .btn { white-space: nowrap; }
.deck-code-help { font-size: 13.5px; color: var(--ink-mute); }
.build-body { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 26px; margin: 18px 0 8px; align-items: start; }
.build-list h4, .build-side h4 { margin: 14px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-mute); font-weight: 600; }
.build-list h4:first-child, .build-side h4:first-child { margin-top: 0; }
.deck-list { list-style: none; margin: 0 0 6px !important; display: grid; gap: 4px; }
.deck-list li {
  display: grid; grid-template-columns: 26px 24px 34px minmax(0, 1fr) auto; gap: 8px; align-items: center; margin: 0 !important;
  padding: 4px 10px 4px 6px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--rc);
}
.deck-list li img, .deck-list .noart { width: 34px; height: 34px; border-radius: 5px; object-fit: cover; background: #000; }
.deck-list .dl-n { font-family: var(--f-mono); font-weight: 600; color: var(--gold-2); text-align: right; }
.deck-list .dl-c { font-family: var(--f-mono); font-size: 12px; font-weight: 700; color: #cfe1ff; background: #1b2a55; border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; }
.deck-list a { color: var(--ink); font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-list a:hover { color: var(--gold-2); }
.deck-list .dl-s { font-family: var(--f-mono); font-size: 12px; color: var(--ink-mute); }
.curve { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; height: 120px; align-items: end; padding: 10px; border: 1px solid var(--line); border-radius: var(--rad); background: var(--panel); }
.cv-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 3px; }
.cv-bar { width: 100%; min-height: 2px; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, var(--gold-2), var(--gold)); }
.cv-n { font-family: var(--f-mono); font-size: 11px; color: var(--ink-2); }
.cv-c { font-family: var(--f-mono); font-size: 11px; color: var(--ink-mute); }
.key-cards { margin-left: 18px !important; font-size: 14px; }
.build-matchups { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.build-matchups .table-wrap { margin: 0; }
.build + .build { border-top: 1px solid var(--line); padding-top: 12px; }
@media (max-width: 900px) {
  .build-body { grid-template-columns: 1fr; }
  .build-matchups { grid-template-columns: 1fr; }
}
