/* ————————————————————————————————————————————————————————————
   The Arcanist's Rubric — primer site
   Grimoire field-manual: aubergine ink, rarity gold, engraved caps.
   ———————————————————————————————————————————————————————————— */
@import url('fonts/fonts.css');

:root {
  --ink: #14101c;
  --ink-2: #191323;
  --panel: #1d1728;
  --panel-2: #241c31;
  --line: #362b4c;
  --line-soft: #2a2138;
  --text: #e6dff0;
  --muted: #9c91b4;
  --faint: #6f6488;
  --brand: #a78bfa;
  --brand-deep: #6d28d9;
  --brand-ghost: rgba(167, 139, 250, .08);
  --gold: #d4b06a;
  --gold-dim: #9c8149;
  --gold-ghost: rgba(212, 176, 106, .07);
  --ember: #e0694e;
  --ember-ghost: rgba(224, 105, 78, .08);
  --display: 'Marcellus', 'Iowan Old Style', 'Palatino Linotype', Palatino, serif;
  --body: 'Spectral', Georgia, 'Times New Roman', serif;
  --ui: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 12px;
  --flightbar-h: 52px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: dark; }
.tray { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--brand); text-decoration-color: rgba(167,139,250,.4); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--brand); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 99; background: var(--panel-2); padding: 8px 14px; border-radius: 8px; }
::selection { background: rgba(109, 40, 217, .45); }

/* ————— WUBRG pips & mana symbols (mana-font, vendored) ————— */
.pips { display: inline-flex; gap: 5px; align-items: center; vertical-align: middle; }
.hero-chips .ms { font-size: 15px; }
.ms-inline { font-size: .78em; vertical-align: 1%; margin: 0 1px; }

/* ————— badges ————— */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--ui); font-size: 11.5px; font-weight: 600;
  letter-spacing: .09em; text-transform: uppercase;
  padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
  background: rgba(0,0,0,.25); text-decoration: none;
}
.badge b { color: var(--gold); font-weight: 700; letter-spacing: 0; }
.badge-bracket { border-color: var(--gold-dim); text-transform: none; letter-spacing: .05em; }
.badge-link { color: var(--brand); }
.badge-link:hover { border-color: var(--brand); }

/* ————— hero ————— */
.hero { position: relative; min-height: clamp(330px, 48vh, 470px); display: flex; align-items: flex-end; isolation: isolate; }
.hero-art {
  position: absolute; inset: 0; z-index: -2;
  background-size: cover; background-position: center 22%;
  filter: saturate(1.04);
}
.hero-scrim {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(20,16,28,.42) 0%, rgba(20,16,28,.18) 34%, rgba(20,16,28,.82) 74%, var(--ink) 99%),
    linear-gradient(100deg, rgba(20,16,28,.55) 0%, transparent 55%);
}
.hero-inner { width: min(1160px, 100%); margin: 0 auto; padding: 26px clamp(18px, 4vw, 40px) 30px; }
.crumb {
  font-family: var(--ui); font-size: 12px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; text-decoration: none; color: var(--text);
  opacity: .82; position: absolute; top: 18px; left: clamp(18px, 4vw, 40px);
  text-shadow: 0 1px 6px rgba(0,0,0,.8);
}
.crumb:hover { opacity: 1; color: var(--gold); }
.hero-eyebrow {
  font-family: var(--ui); font-size: 12px; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; color: var(--gold);
  margin: 0 0 6px; text-shadow: 0 1px 5px rgba(0,0,0,.9);
}
.hero-title {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.3rem, 6.2vw, 3.7rem); line-height: 1.05;
  margin: 0 0 10px; letter-spacing: .01em;
  text-shadow: 0 2px 18px rgba(0,0,0,.85);
}
.hero-oneliner {
  max-width: 62ch; margin: 0 0 16px; font-style: italic;
  font-size: 1.02rem; line-height: 1.55; color: #d3cbe2;
  text-shadow: 0 1px 8px rgba(0,0,0,.9);
}
.hero-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* ————— flightbar (reading-mode nav) ————— */
.flightbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; gap: 26px; align-items: center;
  overflow-x: auto; scrollbar-width: none;
  padding: 0 clamp(14px, 4vw, 40px);
  background: rgba(20, 16, 28, .88);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  min-height: var(--flightbar-h);
}
.flightbar::-webkit-scrollbar { display: none; }
@media (max-width: 1023px) {
  .flightbar { mask-image: linear-gradient(90deg, #000 calc(100% - 34px), transparent); -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 34px), transparent); }
}
.fb-mode { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.fb-mode + .fb-mode { border-left: 1px solid var(--line); padding-left: 26px; }
.fb-label {
  font-family: var(--ui); font-size: 10.5px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase; color: var(--gold-dim);
  margin-right: 10px; white-space: nowrap;
}
.flightbar a {
  font-family: var(--ui); font-size: 13.5px; font-weight: 600;
  color: var(--muted); text-decoration: none; white-space: nowrap;
  padding: 6px 11px; border-radius: 999px;
}
.flightbar a:hover { color: var(--text); background: var(--brand-ghost); }
.flightbar a.active { color: #efe9fb; background: rgba(109, 40, 217, .38); }

/* ————— layout ————— */
.layout {
  width: min(1160px, 100%); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) 296px;
  gap: clamp(24px, 4vw, 52px);
  padding: 8px clamp(18px, 4vw, 40px) 60px;
}
.primer { max-width: 70ch; min-width: 0; }

/* ————— primer typography ————— */
.primer h2 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.55rem, 3.4vw, 1.95rem); line-height: 1.15;
  letter-spacing: .015em; margin: 2.6em 0 .7em;
  scroll-margin-top: calc(var(--flightbar-h) + 16px);
  padding-bottom: .38em; position: relative;
}
.primer h2::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: linear-gradient(90deg, var(--gold-dim), var(--line) 45%, transparent 95%);
}
.primer h2::before {
  content: '✦'; position: absolute; left: 0; bottom: -8.5px;
  font-size: 11px; color: var(--gold); background: var(--ink); padding-right: 7px;
}
.primer h2:first-child { margin-top: 1.4em; }
.primer h2 .hlink { color: inherit; text-decoration: none; }
.primer h3 {
  font-family: var(--display); font-weight: 400;
  font-size: 1.22rem; letter-spacing: .01em; color: #d9d0ea;
  margin: 2em 0 .5em; scroll-margin-top: calc(var(--flightbar-h) + 16px);
}
.primer h3 .hlink { color: inherit; text-decoration: none; }
.primer p, .primer li { color: var(--text); }
.primer strong { color: #f3edfc; font-weight: 600; }
.primer em { color: #d8cfe8; }
.primer ul, .primer ol { padding-left: 1.35em; }
.primer li { margin: .45em 0; }
.primer li::marker { color: var(--gold-dim); }
.primer ol > li::marker { font-family: var(--ui); font-size: .85em; font-weight: 700; }
.primer hr { border: 0; height: 1px; background: var(--line-soft); margin: 2.5em 0; }
.primer blockquote {
  margin: 1.4em 0; padding: .1em 1.2em;
  border-left: 2px solid var(--line); color: var(--muted); font-style: italic;
}
.primer code {
  font-family: ui-monospace, 'Cascadia Mono', Menlo, monospace;
  font-size: .86em; background: var(--panel-2);
  padding: .12em .4em; border-radius: 5px;
}
.primer-foot { margin-top: 4em; padding-top: 1.2em; border-top: 1px solid var(--line-soft); }
.primer-foot p { font-family: var(--ui); font-size: 12.5px; color: var(--faint); }

/* ————— callouts (GFM alerts) ————— */
.callout {
  margin: 1.6em 0; padding: 16px 20px 6px; border-radius: var(--radius);
  border: 1px solid var(--line); border-left-width: 3px;
  background: var(--panel);
}
.callout-kicker {
  font-family: var(--ui); font-size: 11px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  margin: 0 0 .5em; display: flex; align-items: center; gap: 8px;
}
.callout-kicker::before { font-size: 12px; }
.callout-important { border-left-color: var(--gold); background: linear-gradient(180deg, var(--gold-ghost), var(--panel) 70%); }
.callout-important .callout-kicker { color: var(--gold); }
.callout-important .callout-kicker::before { content: '✦'; }
.callout-warning { border-left-color: var(--ember); background: linear-gradient(180deg, var(--ember-ghost), var(--panel) 70%); }
.callout-warning .callout-kicker { color: var(--ember); }
.callout-warning .callout-kicker::before { content: '⚠'; }
.callout-note, .callout-tip, .callout-caution { border-left-color: var(--brand); }
.callout-note .callout-kicker, .callout-tip .callout-kicker { color: var(--brand); }
.callout p { margin: .4em 0 .9em; }
.callout li { margin: .5em 0; }

/* ————— card references ————— */
.cardref {
  color: #c9b8f5; cursor: pointer; border-radius: 3px;
  text-decoration: underline dotted rgba(167,139,250,.55);
  text-underline-offset: 3.5px; text-decoration-thickness: 1px;
}
.cardref:hover { color: var(--brand); background: var(--brand-ghost); text-decoration-color: var(--brand); }
.card-pop {
  position: fixed; z-index: 80; pointer-events: none;
  width: min(252px, 62vw);
  filter: drop-shadow(0 14px 34px rgba(0, 0, 0, .75));
  transition: opacity .12s ease;
}
.card-pop img { display: block; width: 100%; border-radius: 4.6% / 3.4%; background: var(--panel-2); }
.card-pop .cp-name { display: none; }
.card-pop[data-touch] { pointer-events: auto; }

/* ————— diagrams (mermaid → static SVG) ————— */
.diagram {
  margin: 1.6em 0; padding: 18px 14px; border-radius: var(--radius);
  background: var(--ink-2); border: 1px solid var(--line-soft);
  overflow-x: auto;
}
.diagram svg { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.diagram-web { max-height: 74vh; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.diagram-web svg { min-width: 560px; }
@media (max-width: 640px) { .diagram-loop svg { min-width: 440px; max-width: none; } }
.mermaid-src { overflow-x: auto; font-size: .8em; }

.combo-web { margin: 1.4em 0 2.2em; }
.cw-kicker {
  font-family: var(--ui); font-size: 11.5px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--gold);
  margin: 0 0 .4em;
}
.cw-legend {
  font-family: var(--ui); font-size: 12px; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 14px; margin: .6em 0 0;
}
.lg { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.lg-cmd { background: var(--brand-deep); border: 1px solid var(--brand); }
.lg-hub { background: var(--gold); border: 1px solid var(--gold-dim); }
.lg-res { background: var(--panel-2); border: 1px solid #5b4a7a; }

/* ————— per-combo step-flow line cards ————— */
.combo-lines { margin: 1.8em 0 2.2em; }
.combo-line {
  border: 1px solid var(--line-soft); border-radius: 10px;
  background: var(--panel); margin: 8px 0; overflow: hidden;
}
.combo-line summary {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
  padding: 11px 14px; cursor: pointer; list-style: none;
  font-family: var(--ui); font-size: 14px; font-weight: 600; color: var(--text);
}
.combo-line summary::-webkit-details-marker { display: none; }
.combo-line summary::before {
  content: '▸'; color: var(--gold-dim); font-size: 12px;
  margin-right: 2px; transition: transform .15s; display: inline-block;
}
.combo-line[open] summary::before { transform: rotate(90deg); color: var(--gold); }
.combo-line summary:hover { background: var(--brand-ghost); }
.cl-plus { color: var(--gold); font-weight: 700; }
.cl-produce { font-style: italic; font-weight: 400; color: var(--muted); font-family: var(--body); font-size: 13.5px; }
.cl-produce::before { content: '→ '; color: var(--faint); font-style: normal; }
.combo-line .diagram { margin: 0; border: 0; border-top: 1px solid var(--line-soft); border-radius: 0; }
/* prerequisites row — wraps onto its own line under the cards/produce header */
.cl-needs {
  flex-basis: 100%; min-width: 0;
  font-family: var(--body); font-weight: 400; font-size: 13px;
  color: var(--muted); line-height: 1.5;
}
.cl-needs-k {
  font-family: var(--ui); font-size: 10.5px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold-dim); margin-right: 2px;
}
.cl-needs .ms { font-size: 11px; }
.cl-dot { color: var(--faint); }
.diagram-steps svg { max-width: min(100%, 480px); }

/* ————— decklist tray ————— */
.tray {
  font-family: var(--ui);
  border-left: 1px solid var(--line-soft);
  padding-left: clamp(18px, 2.5vw, 28px);
}
.tray-head { position: sticky; top: var(--flightbar-h); background: var(--ink); padding: 14px 0 8px; z-index: 2; }
.tray-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .2em;
  text-transform: uppercase; color: var(--gold); margin: 0;
}
.tray-total { font-size: 12px; color: var(--faint); margin: 3px 0 0; }
.tray-group { margin: 16px 0; }
.tray-group h3 {
  font-size: 11px; font-weight: 700; letter-spacing: .15em;
  text-transform: uppercase; color: var(--muted);
  margin: 0 0 6px; display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid var(--line-soft); padding-bottom: 5px;
}
.gcount { color: var(--faint); font-weight: 600; letter-spacing: 0; }
.tray-group ul { list-style: none; margin: 0; padding: 0; }
.tray-group li { margin: 0; }
.tray-card {
  display: flex; align-items: center; gap: 7px; width: 100%;
  font-size: 13.5px; line-height: 1.35; padding: 3.5px 6px; margin: 0 -6px;
  border-radius: 6px; text-decoration: none; color: var(--text);
}
.tray-card:hover { background: var(--brand-ghost); color: #efe9fb; }
.tray-card .qty { color: var(--gold); font-weight: 700; font-size: 12px; }
.tray-card .cname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tray-card .mana { display: inline-flex; gap: 2px; flex-shrink: 0; }
.tray-card .mana .ms { font-size: 9.5px; margin: 0; }
.tray-commander { padding: 10px 12px; margin: 14px 0 18px; border: 1px solid var(--gold-dim); border-radius: 10px; background: var(--gold-ghost); }
.tray-commander h3 { color: var(--gold); border-bottom-color: var(--gold-dim); }
.tray-commander .tray-card { font-weight: 600; align-items: flex-start; }
/* the commander's full name must always read — wrap instead of ellipsis;
   mana cost stays pinned top-right (align-items: flex-start above) */
.tray-commander .tray-card .cname { white-space: normal; overflow: visible; text-overflow: clip; }
.tray-commander .tray-card .mana { margin-top: 2px; }

.tray-curve .curve { display: flex; gap: 5px; align-items: flex-end; height: 74px; padding-top: 16px; }
.curve-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; height: 100%; position: relative; }
.curve-bar { width: 100%; min-height: 2px; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, var(--brand), var(--brand-deep)); opacity: .85; }
.curve-n { font-size: 9.5px; color: var(--faint); position: absolute; top: -2px; }
.curve-mv { font-size: 10px; color: var(--muted); }

.tray-toggle { display: none; }
.tray-backdrop { display: none; }

/* ————— mobile: tray becomes off-canvas drawer ————— */
@media (max-width: 1023px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .tray {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 60;
    width: min(340px, 88vw);
    background: var(--ink-2); border-left: 1px solid var(--line);
    padding: 0 18px 24px; overflow-y: auto;
    transform: translateX(105%);
    transition: transform .28s cubic-bezier(.32,.72,.35,1);
    box-shadow: -18px 0 50px rgba(0,0,0,.55);
  }
  .tray.open { transform: none; }
  .tray-head { top: 0; background: var(--ink-2); }
  .tray-toggle {
    display: flex; align-items: center; gap: 8px;
    position: fixed; right: 16px; bottom: 18px; z-index: 55;
    font-family: var(--ui); font-size: 13.5px; font-weight: 700;
    letter-spacing: .04em; color: #f4effd;
    background: linear-gradient(180deg, #7c3aed, var(--brand-deep));
    border: 1px solid var(--brand); border-radius: 999px;
    padding: 12px 20px; cursor: pointer;
    box-shadow: 0 8px 26px rgba(0,0,0,.6), 0 2px 8px rgba(109,40,217,.4);
  }
  .tt-count { font-weight: 600; opacity: .75; font-size: 12px; }
  .tray-backdrop {
    display: block; position: fixed; inset: 0; z-index: 58;
    background: rgba(10, 7, 16, .6); backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none; transition: opacity .25s;
  }
  .tray-backdrop.show { opacity: 1; pointer-events: auto; }
}
@media (min-width: 1024px) {
  .tray { position: sticky; top: var(--flightbar-h); align-self: start; max-height: calc(100vh - var(--flightbar-h)); overflow-y: auto; padding-bottom: 40px; }
  /* the tray is its own scroll container here, so the sticky head's offset is
     tray-relative — top:0 hugs the container edge (flightbar-h would leave a
     52px gap that rows scroll through visibly) */
  .tray-head { top: 0; }
}

/* ————— landing page: The Arcanist's Rubric ————— */
.shelf-head {
  position: relative; text-align: center;
  padding: clamp(60px, 11vh, 110px) 20px 46px;
  background:
    radial-gradient(ellipse 130% 90% at 50% -30%, rgba(109, 40, 217, .30), transparent 60%),
    radial-gradient(ellipse 60% 45% at 50% 0%, rgba(212, 176, 106, .10), transparent 70%);
}
.shelf-head::after {
  content: '✦'; display: block; margin: 34px auto 0;
  color: var(--gold-dim); font-size: 13px; line-height: 1;
}
.shelf-head .hero-eyebrow { text-shadow: none; letter-spacing: .3em; }
.shelf-title {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.6rem, 8vw, 4.4rem); line-height: 1.03;
  margin: .1em 0 .25em; letter-spacing: .015em;
}
.shelf-title .amp { color: var(--gold); }
.shelf-sub {
  max-width: 52ch; margin: 0 auto; font-style: italic;
  color: var(--muted); font-size: 1.05rem;
}
/* ————— landing filters: “what do you want to play tonight?” ————— */
.filterbar { width: min(1200px, 100%); margin: 0 auto; padding: 0 clamp(18px, 4vw, 40px) 26px; }
.fb-question {
  font-family: var(--ui); font-size: 11.5px; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; color: var(--gold-dim);
  margin: 0 0 10px;
}
.fchips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fgroup { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-right: 14px; margin-right: 2px; border-right: 1px solid var(--line-soft); }
.fgroup:last-of-type { border-right: 0; }
.fchip {
  font-family: var(--ui); font-size: 12.5px; font-weight: 600;
  letter-spacing: .06em; text-transform: capitalize;
  color: var(--muted); background: rgba(0,0,0,.25);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.fchip b { color: var(--gold); font-weight: 700; }
.fchip[data-filter="bracket"] { text-transform: none; }
.fchip:hover { color: var(--text); border-color: var(--faint); }
.fchip.on { color: #efe9fb; border-color: var(--brand); background: rgba(109, 40, 217, .32); }
.fchip.on b { color: var(--gold); }
.fchip-pip { padding: 4px 5px 3px; border-radius: 50%; line-height: 0; background: transparent; }
.fchip-pip .ms { font-size: 16px; opacity: .4; transition: opacity .15s; }
.fchip-pip:hover .ms { opacity: .75; }
.fchip-pip.on { background: transparent; border-color: var(--brand); box-shadow: 0 0 10px rgba(167,139,250,.4); }
.fchip-pip.on .ms { opacity: 1; }
.fchip-reset { opacity: .45; pointer-events: none; text-transform: none; }
.fchip-reset.armed { opacity: 1; pointer-events: auto; color: var(--ember); border-color: rgba(224,105,78,.5); }
.fchip-reset.armed:hover { background: var(--ember-ghost); }
.shelf-empty { text-align: center; padding: 40px 20px 80px; }
.shelf-empty .se-glyph { color: var(--gold-dim); font-size: 22px; margin: 0 0 8px; }
.shelf-empty p { font-style: italic; color: var(--muted); max-width: 44ch; margin: 0 auto; }

.shelf {
  width: min(1200px, 100%); margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px; padding: 10px clamp(18px, 4vw, 40px) 70px;
}
.tile {
  position: relative; display: flex; flex-direction: column;
  border-radius: 14px; overflow: hidden; text-decoration: none;
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px rgba(0,0,0,.35);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.tile::after { /* inner hairline — card-frame double border */
  content: ''; position: absolute; inset: 5px; border-radius: 10px;
  border: 1px solid rgba(230, 223, 240, .07); pointer-events: none;
}
.tile:hover, .tile:focus-visible {
  transform: translateY(-4px);
  border-color: var(--brand);
  box-shadow: 0 18px 44px rgba(0,0,0,.55), 0 0 0 1px rgba(167,139,250,.25), 0 6px 24px rgba(109,40,217,.25);
}
.tile-art {
  aspect-ratio: 100 / 62;
  background-size: cover; background-position: center 30%;
  transition: transform .3s ease; position: relative;
}
.tile-art::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(29,23,40,.08) 55%, var(--panel) 100%);
}
.tile:hover .tile-art { transform: scale(1.035); }
.tile-body { padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 8px; z-index: 1; background: var(--panel); }
.tile-name {
  font-family: var(--display); font-weight: 400;
  font-size: 1.45rem; line-height: 1.12; margin: 0; color: var(--text);
}
.tile:hover .tile-name { color: #f1ebfb; }
.tile-typeline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
.tile-typeline .ms { font-size: 13px; }
.tile-oneliner {
  margin: 0; font-style: italic; font-size: .92rem; line-height: 1.55;
  color: var(--muted);
  /* 6 lines, not 3: ten of the authored one-liners ran 4-6 lines and were being
     silently truncated on the shelf. The clamp stays as a backstop only. */
  display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden;
}
.shelf-foot { text-align: center; padding: 0 20px 44px; }
.shelf-foot p { font-family: var(--ui); font-size: 12.5px; color: var(--faint); }

/* ————— reduced motion ————— */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .tile:hover { transform: none; }
  .tile:hover .tile-art { transform: none; }
}

/* ————— reskin art credits ————— */
.reskin-credits {
  margin: 42px 0 8px; padding: 18px 20px;
  border: 1px solid var(--line); border-radius: 10px;
  background: rgba(0,0,0,.22);
}
.reskin-credits h2 {
  font-family: var(--ui); font-size: 12px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 8px; border: 0; padding: 0;
}
.reskin-credits p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--muted); }
.reskin-credits a { color: var(--gold); }

/* ————— reskinned decklist rows ————— */
/* Mirrors the physical proxy: skin name on top, real name beneath in italics.
   Not a hover tooltip — there is no hover on the phone this gets read on. */
.tray-card.is-reskin { align-items: flex-start; }
.tray-card.is-reskin .cname {
  white-space: normal; overflow: visible; text-overflow: clip;
}
.tray-card .cname-real {
  display: block; font-size: 11px; font-style: italic;
  color: var(--muted); line-height: 1.3; margin-top: 1px;
}
.tray-card.is-reskin .mana { margin-top: 2px; }

/* ————— reskin toggle ————— */
.badge-skin {
  cursor: pointer; font-family: var(--ui); background: rgba(0,0,0,.25);
  border-color: var(--gold-dim); color: var(--gold);
}
.badge-skin:hover { background: var(--gold-ghost); }
.badge-skin[aria-pressed="false"] { color: var(--muted); border-color: var(--line); }
/* in original mode the sub-line is emptied, so collapse the row back */
body.show-original .tray-card.is-reskin { align-items: center; }
body.show-original .tray-card.is-reskin .cname {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body.show-original .tray-card .cname-real { display: none; }

/* ————— partner commanders: two art layers, diagonally blended ————— */
/* Second layer fades in across the middle so a partner pair reads as one
   image. A single-commander deck emits one layer and none of this applies. */
.hero-art + .hero-art,
.tile-layer + .tile-layer {
  -webkit-mask-image: linear-gradient(102deg, transparent 34%, #000 64%);
          mask-image: linear-gradient(102deg, transparent 34%, #000 64%);
}
.tile-art { position: relative; overflow: hidden; }
.tile-layer {
  position: absolute; inset: 0;
  background-size: cover; background-position: center 30%;
}

/* Narrow tiles wrap to more lines; Bumbleflower and Omnath need a seventh on a
   phone. Same intent as the 6-line clamp — the clamp is a backstop, not a crop. */
@media (max-width: 600px) {
  .tile-oneliner { -webkit-line-clamp: 7; }
}
