/* ===================================================================== tokens */
:root {
  --bg: #0d0f14; --bg-2: #11141b; --surface: #161a22; --surface-2: #1c212b; --surface-3: #232937;
  --line: #262c38; --line-2: #313848;
  --text: #e9ecf2; --text-2: #b7bdcb; --muted: #7f879a;
  --gold: #e3b45a; --gold-2: #f2cd84; --blue: #6fa6ff; --green: #45c38a; --amber: #f2b33d; --red: #ef5d5d; --violet: #a68bff;
  --mW: #f3ecc4; --mU: #7fb8ea; --mB: #a598ad; --mR: #f08a6b; --mG: #6cc08b; --mC: #c9c2bb;
  --r-sm: 8px; --r: 12px; --r-lg: 18px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35); --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
  --font: "Noto Sans Thai", "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --nav-h: 60px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(227, 180, 90, .35); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

/* ===================================================================== layout */
.topnav { position: sticky; top: 0; z-index: 30; height: var(--nav-h); display: flex; align-items: center; gap: var(--s5); padding: 0 var(--s5);
  background: rgba(13, 15, 20, .86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .2px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--gold), #b9792b); display: grid; place-items: center; color: #1a1206; font-weight: 800; font-size: 14px; }
.nav-links { display: flex; gap: 4px; }
.nav-link { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; color: var(--text-2); font-weight: 500; }
.nav-link:hover { background: var(--surface); color: var(--text); }
.nav-link.on { background: var(--surface-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--gold); }
.nav-meta { margin-left: auto; color: var(--muted); font-size: 12px; text-align: right; line-height: 1.3; }
.view { min-height: calc(100vh - var(--nav-h)); }
.page { max-width: 1240px; margin: 0 auto; padding: var(--s6) var(--s5) var(--s7); }
.page-narrow { max-width: 920px; }
.page-head { display: flex; align-items: flex-end; gap: var(--s4); margin-bottom: var(--s5); flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 28px; line-height: 1.2; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.page-head .spacer { flex: 1; }
.eyebrow { color: var(--gold); font-size: 12px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; }
.grid { display: grid; gap: var(--s4); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.grid > *, .deck-body, .deck-stats > *, .stack > * { min-width: 0; }
html, body { overflow-x: hidden; }
@media (max-width: 860px) { .deck-page-2col { grid-template-columns: minmax(0, 1fr) !important; } }
@media (max-width: 640px) { .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } .page-head .btn { flex: 1; } .deck-stats { grid-template-columns: 96px minmax(0, 1fr); } .deck-hero .in { padding: 22px 18px; } .deck-hero h1 { font-size: 24px; } .wiz-title { font-size: 24px; } .page { padding: var(--s5) var(--s4); } .nav-link span { display: none; } .nav-meta { display: none; } }
.row { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: var(--s3); }
.muted { color: var(--muted); } .t2 { color: var(--text-2); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.ok { color: var(--green); } .warn { color: var(--amber); } .bad { color: var(--red); } .gold { color: var(--gold); }
.sep { height: 1px; background: var(--line); margin: var(--s4) 0; }

/* ===================================================================== surfaces */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); }
.panel-tight { padding: var(--s4); }
.panel h3, .panel h2 { margin: 0 0 var(--s3); font-size: 16px; }
.panel-title { display: flex; align-items: center; gap: 8px; margin-bottom: var(--s3); font-weight: 600; }
.panel-title .hint { margin-left: auto; font-weight: 400; color: var(--muted); font-size: 12px; }

/* ===================================================================== controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text); font-weight: 600; cursor: pointer; transition: .15s; white-space: nowrap; }
.btn:hover { background: var(--surface-3); border-color: #3c4558; }
.btn-primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #1b1305; border-color: transparent; }
.btn-primary:hover { filter: brightness(1.06); background: linear-gradient(180deg, var(--gold-2), var(--gold)); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface); color: var(--text); }
.btn-lg { height: 48px; padding: 0 22px; font-size: 16px; border-radius: 12px; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn-icon { width: 34px; padding: 0; height: 34px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.input { height: 40px; width: 100%; padding: 0 12px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; outline: none; }
.input:focus { border-color: var(--gold); }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; min-height: 110px; }
select.input { padding-right: 28px; }
.search { position: relative; } .search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 38px; height: 46px; font-size: 15px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font-size: 13px; cursor: pointer; user-select: none; }
.chip:hover { border-color: #46506a; color: var(--text); }
.chip.on { background: rgba(227, 180, 90, .14); border-color: var(--gold); color: var(--gold-2); }
.chip.static { cursor: default; }
.chip .x { opacity: .6; }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; color: var(--text-2); cursor: pointer; font-weight: 500; }
.seg button.on { background: var(--surface-3); color: var(--text); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: var(--s5); overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 12px 16px; color: var(--text-2); font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--text); border-bottom-color: var(--gold); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text-2); }
.badge.gold { background: rgba(227, 180, 90, .16); color: var(--gold-2); }
.badge.green { background: rgba(69, 195, 138, .14); color: #7fe0b2; }
.badge.red { background: rgba(239, 93, 93, .14); color: #ff9c9c; }
.badge.blue { background: rgba(111, 166, 255, .14); color: #a9c9ff; }
.badge.violet { background: rgba(166, 139, 255, .14); color: #c9b9ff; }

/* slider */
.slider { padding: 10px 0 6px; }
.slider-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.slider-head b { font-weight: 600; }
.slider-val { color: var(--gold-2); font-size: 13px; font-weight: 600; min-width: 92px; text-align: right; }
.slider input[type=range] { width: 100%; accent-color: var(--gold); margin: 6px 0 2px; }
.slider-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.slider-desc { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ===================================================================== mana symbols */
img.sym, svg.sym { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -.2em; margin-right: 1px; }
.cost { white-space: nowrap; }
.pips { display: inline-flex; gap: 3px; }
.pips img, .pips svg { width: 20px; height: 20px; }

/* ===================================================================== cards */
.card-tile { position: relative; border-radius: 11px; overflow: hidden; background: var(--surface-2); aspect-ratio: 63 / 88; cursor: pointer; transition: transform .15s, box-shadow .15s; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.card-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-tile img { width: 100%; height: 100%; object-fit: cover; }
.card-tile .ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; text-align: center; font-size: 12px; color: var(--text-2); }
.card-tile .qty { position: absolute; bottom: 34px; right: 6px; min-width: 26px; height: 24px; padding: 0 7px; border-radius: 999px; background: rgba(10, 12, 16, .88); color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .18); }
.card-tile .role { position: absolute; left: 6px; right: 6px; bottom: 6px; padding: 3px 7px; border-radius: 7px; background: rgba(10, 12, 16, .86); font-size: 11px; font-weight: 600; color: var(--gold-2); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-tile.sel { outline: 2px solid var(--gold); outline-offset: 2px; }
.card-tile .lock { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 999px; background: rgba(10, 12, 16, .88); display: grid; place-items: center; color: var(--gold-2); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: var(--s3); }
.card-grid.sm { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.card-grid.lg { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
.card-name { font-size: 13px; margin-top: 6px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-title { display: flex; align-items: center; gap: 10px; margin: var(--s5) 0 var(--s3); font-weight: 600; }
.group-title .count { color: var(--muted); font-weight: 500; }
.group-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.list-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; cursor: pointer; }
.list-row:hover { background: var(--surface-2); }
.list-row .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .thumb { width: 34px; height: 47px; border-radius: 4px; object-fit: cover; flex: none; background: var(--surface-3); }

/* hover popover */
.pop { position: fixed; z-index: 60; width: auto; overflow: hidden; pointer-events: none; background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 12px; display: none; }
.pop.show { display: block; }
.pop img.art { width: 100%; border-radius: 12px; aspect-ratio: 63 / 88; object-fit: cover; background: var(--surface-2); }
.pop-grid { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 14px; align-items: start; width: min(580px, calc(100vw - 48px)); }
.pop-grid.wide { width: min(760px, calc(100vw - 48px)); }
.pop-info { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.pop-name { font-size: 15px; line-height: 1.25; }
.pop-text { font-size: 12.5px; line-height: 1.5; color: var(--text-2); border-left: 2px solid var(--line-2); padding-left: 8px; }
.pop .ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pop .meta { margin-top: 0; font-size: 12.5px; }
@media (max-width: 600px) { .pop-grid, .pop-grid.wide { grid-template-columns: 110px minmax(0, 1fr); gap: 10px; } .pop-text { font-size: 12px; } }
.pop .meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin-top: 10px; font-size: 13px; }
.pop .meta .k { color: var(--muted); }
.set-line { display: flex; align-items: center; gap: 8px; }
.set-logo { width: 24px; height: 24px; object-fit: contain; flex: none; background: #ece8df; border-radius: 6px; padding: 2px; box-sizing: border-box; } /* light backing: many set symbols are black and vanish on the dark theme */

/* drawer */
.backdrop { position: fixed; inset: 0; background: rgba(5, 6, 9, .6); z-index: 70; opacity: 0; pointer-events: none; transition: .2s; }
.backdrop.show { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); z-index: 71; background: var(--bg-2); border-left: 1px solid var(--line); transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column; }
.drawer.show { transform: none; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { margin: 0; font-size: 17px; flex: 1; }
.drawer-body { overflow: auto; padding: 20px; flex: 1; }
.card-detail { display: grid; grid-template-columns: 260px 1fr; gap: 22px; }
@media (max-width: 720px) { .card-detail { grid-template-columns: 1fr; } }
.oracle { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; line-height: 1.65; }
.oracle p { margin: 0 0 6px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 14px; }
.kv .k { color: var(--muted); }
.tip { display: flex; gap: 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.tip svg { flex: none; color: var(--gold); margin-top: 2px; }

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--surface-3); border: 1px solid var(--line-2); padding: 10px 16px; border-radius: 12px; z-index: 90; opacity: 0; transition: .2s; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translateX(-50%); }

/* progress */
.progress { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); border-radius: 99px; transition: width .2s; }
.overlay { position: fixed; inset: 0; z-index: 80; background: rgba(8, 9, 12, .82); display: grid; place-items: center; }
.overlay .box { width: min(420px, 90vw); text-align: center; }

/* ===================================================================== home */
.hero { position: relative; overflow: hidden; border-radius: 24px; padding: 56px 48px; background: radial-gradient(1200px 400px at 85% -10%, rgba(227, 180, 90, .22), transparent 60%), radial-gradient(800px 380px at 0% 120%, rgba(111, 166, 255, .14), transparent 60%), var(--surface); border: 1px solid var(--line); }
.hero h1 { font-size: 40px; line-height: 1.15; margin: 10px 0 12px; max-width: 640px; }
.hero p { color: var(--text-2); font-size: 17px; max-width: 560px; margin: 0 0 24px; }
.hero-fan { position: absolute; right: 40px; top: 50%; transform: translateY(-50%); width: 360px; height: 280px; }
.hero-fan img { position: absolute; width: 170px; border-radius: 12px; box-shadow: var(--shadow-lg); }
@media (max-width: 980px) { .hero-fan { display: none; } .hero { padding: 36px 26px; } .hero h1 { font-size: 30px; } }
.entry { display: flex; flex-direction: column; gap: 10px; padding: 22px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; transition: .15s; min-height: 170px; }
.entry:hover { border-color: #3c4558; transform: translateY(-2px); }
.entry .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(227, 180, 90, .14); color: var(--gold-2); }
.entry h3 { margin: 0; font-size: 18px; }
.entry p { margin: 0; color: var(--text-2); font-size: 14px; }
.entry .go { margin-top: auto; color: var(--gold-2); font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; }

/* ===================================================================== wizard */
.wiz-top { display: flex; align-items: center; gap: var(--s4); margin-bottom: var(--s5); }
.wiz-top .progress { flex: 1; }
.wiz-step-n { color: var(--muted); font-size: 13px; white-space: nowrap; }
.wiz-title { font-size: 30px; margin: 0 0 6px; line-height: 1.2; }
.wiz-sub { color: var(--text-2); margin: 0 0 var(--s5); }
.wiz-foot { position: sticky; bottom: 0; margin-top: var(--s6); padding: var(--s4) 0; display: flex; gap: var(--s3); align-items: center; background: linear-gradient(180deg, transparent, var(--bg) 35%); }
.wiz-foot .spacer { flex: 1; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--s3); }
.choice { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; transition: .15s; text-align: left; }
.choice:hover { border-color: #46506a; }
.choice.on { border-color: var(--gold); background: linear-gradient(180deg, rgba(227, 180, 90, .10), rgba(227, 180, 90, .02)), var(--surface); }
.choice.on::after { content: ""; position: absolute; top: 14px; right: 14px; width: 18px; height: 18px; border-radius: 99px; background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12l5 5 9-10' stroke='%231b1305' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center/12px no-repeat; }
.choice h4 { margin: 0; font-size: 16px; }
.choice p { margin: 0; color: var(--text-2); font-size: 13px; }
.choice .ic { color: var(--gold-2); }
.choice.art { padding: 0; overflow: hidden; }
.choice.art .art-img { height: 104px; background-size: 128%; background-position: 50% 17%; }
.choice.art .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.colour-pick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s3); }
@media (max-width: 640px) { .colour-pick { grid-template-columns: repeat(3, 1fr); } }
.colour-pick .choice { align-items: center; text-align: center; padding: 22px 10px; }
.colour-pick .choice img, .colour-pick .choice svg.sym { width: 46px; height: 46px; margin: 0; }
.atom-group { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); margin-bottom: var(--s3); overflow: hidden; }
.atom-group > summary { list-style: none; cursor: pointer; padding: 14px 18px; display: flex; align-items: center; gap: 10px; font-weight: 600; }
.atom-group > summary::-webkit-details-marker { display: none; }
.atom-group > summary .hint { margin-left: auto; color: var(--muted); font-weight: 400; font-size: 13px; }
.atom-group .inner { padding: 0 18px 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
@media (max-width: 720px) { .atom-group .inner { grid-template-columns: 1fr; } }
.profile-strip { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--s4); }

/* ===================================================================== results */
.deck-card { display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); transition: .15s; cursor: pointer; }
.deck-card:hover { border-color: #3c4558; transform: translateY(-2px); box-shadow: var(--shadow); }
.deck-banner { position: relative; height: 128px; background: var(--surface-3) center 22% / cover no-repeat; }
.deck-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13, 15, 20, 0) 30%, rgba(22, 26, 34, 1)); }
.deck-banner .tags { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 6px; z-index: 1; }
.deck-banner .rank { margin-left: auto; }
.deck-body { padding: 0 18px 18px; margin-top: -26px; position: relative; z-index: 1; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.deck-body h3 { margin: 0; font-size: 18px; line-height: 1.25; }
.deck-stats { display: grid; grid-template-columns: 116px 1fr; gap: 12px; align-items: center; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpi { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.kpi .v { font-size: 20px; font-weight: 700; line-height: 1.1; }
.kpi .l { color: var(--muted); font-size: 11px; }
.statbar { display: grid; grid-template-columns: 92px 1fr 30px; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.statbar .track { position: relative; height: 7px; background: var(--surface-3); border-radius: 99px; }
.statbar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; }
.statbar .base { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text-2); opacity: .7; border-radius: 2px; }
.statbar .num { text-align: right; color: var(--text); font-weight: 600; }

/* ===================================================================== deck page */
.deck-hero { position: relative; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); margin-bottom: var(--s5); }
.deck-hero .bg { position: absolute; inset: 0; background: center 25% / cover no-repeat; opacity: .32; filter: saturate(1.1); }
.deck-hero .bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--surface) 25%, rgba(22, 26, 34, .55)); }
.deck-hero .in { position: relative; padding: 30px 32px; display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.deck-hero h1 { margin: 6px 0 8px; font-size: 32px; line-height: 1.15; }
.deck-hero .fan { margin-left: auto; display: flex; }
.deck-hero .fan img { width: 112px; border-radius: 9px; box-shadow: var(--shadow); margin-left: -42px; transition: .15s; }
.deck-hero .fan img:first-child { margin-left: 0; transform: rotate(-6deg); } .deck-hero .fan img:last-child { transform: rotate(6deg); }
@media (max-width: 720px) { .deck-hero .fan { display: none; } }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.insight { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.insight:last-child { border-bottom: 0; }
.insight .dot { width: 8px; height: 8px; border-radius: 99px; margin-top: 8px; flex: none; }
.turn { display: grid; grid-template-columns: 64px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.turn:last-child { border-bottom: 0; }
.turn .t { font-weight: 700; color: var(--gold-2); font-size: 15px; }
.turn .cards { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.turn .cards img { width: 64px; border-radius: 5px; cursor: pointer; }
.guide-row { display: grid; grid-template-columns: 76px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.guide-row img { width: 76px; border-radius: 6px; cursor: pointer; }
.guide-row h4 { margin: 0 0 4px; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.guide-row ul { margin: 6px 0 0; padding-left: 18px; color: var(--text-2); }
.guide-row li { margin: 3px 0; }
.mu { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 14px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.mu h4 { margin: 0; display: flex; align-items: center; gap: 8px; }

/* ===================================================================== library */
.lib { display: grid; grid-template-columns: 270px 1fr; gap: var(--s5); align-items: start; }
@media (max-width: 900px) { .lib { grid-template-columns: 1fr; } .lib-side { position: static !important; } }
.lib-side { position: sticky; top: calc(var(--nav-h) + 16px); max-height: calc(100vh - var(--nav-h) - 32px); overflow: auto; }
.facet { padding: 14px 0; border-bottom: 1px solid var(--line); }
.facet:first-child { padding-top: 0; }
.facet h5 { margin: 0 0 10px; font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .8px; text-transform: uppercase; }
.facet .row { gap: 6px; }
.understood { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 10px 0 0; font-size: 13px; color: var(--muted); }

/* ===================================================================== builder */
.builder { display: grid; grid-template-columns: 400px minmax(0, 1fr) 300px; gap: var(--s4); align-items: start; }
@media (max-width: 1180px) { .builder { grid-template-columns: 380px minmax(0, 1fr); } .builder .b-stats { grid-column: 1 / -1; } }
@media (max-width: 760px) { .builder { grid-template-columns: 1fr; } }
.b-search { position: sticky; top: calc(var(--nav-h) + 16px); max-height: calc(100vh - var(--nav-h) - 32px); display: flex; flex-direction: column; }
.b-search .results { overflow: auto; margin-top: 10px; flex: 1; }
.qty-ctl { display: inline-flex; align-items: center; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 9px; }
.qty-ctl button { width: 28px; height: 28px; border: 0; background: none; color: var(--text-2); cursor: pointer; font-size: 16px; }
.qty-ctl button:hover { color: var(--text); }
.qty-ctl span { min-width: 18px; text-align: center; font-weight: 700; }
.stack-tile { display: flex; flex-direction: column; gap: 6px; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); border: 1px dashed var(--line-2); border-radius: 18px; }

/* ===================================================================== charts */
.chart-caption { font-size: 12px; color: var(--muted); margin-top: 6px; }
svg text { font-family: var(--font); }
.deck-banner { background-size: 150%; background-position: 50% 16%; }
.deck-banner .badge { background: rgba(10, 12, 16, .82); backdrop-filter: blur(4px); }
.deck-banner .badge.gold { color: var(--gold-2); } .deck-banner .badge.blue { color: #a9c9ff; } .deck-banner .badge.red { color: #ff9c9c; } .deck-banner .badge.green { color: #7fe0b2; } .deck-banner .badge.violet { color: #c9b9ff; }

.pips img, .pips svg { border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .08); }
.click-row:hover { background: var(--bg-2); }
.b-search .list-row { padding: 6px 6px; } .b-search .list-row .nm { white-space: normal; line-height: 1.25; font-size: 13.5px; } .b-search .list-row .btn-sm { padding: 0 8px; white-space: nowrap; }
#supporter-badge { margin-left: 10px; text-decoration: none; } #supporter-badge[hidden] { display: none; }

/* deck doctor */
.doc-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.doc-tabs { flex-wrap: wrap; row-gap: 10px; }
@media (max-width: 640px) { .doc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .doc-tabs .seg { width: 100%; } .doc-tabs .seg button { flex: 1; } .doc-tabs .hint { flex-basis: 100%; } }
.tabs-slot { display: contents; }

/* find a deck v2 */
.scene { text-align: left; background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; padding: 18px; cursor: pointer; color: var(--text); font: inherit; display: flex; flex-direction: column; gap: 12px; transition: border-color .15s, transform .15s; }
.scene:hover, .scene:focus-visible { border-color: var(--gold); transform: translateY(-2px); }
.scene p { margin: 0; font-size: 16px; line-height: 1.5; }
.scene-fan { display: flex; justify-content: center; padding: 6px 0 4px; }
.scene-fan img { border-radius: 8px; margin: 0 -14px; box-shadow: var(--shadow); aspect-ratio: 63 / 88; object-fit: cover; background: var(--surface-2); }
.react.on .card-tile { outline: 2px solid var(--gold); border-radius: 10px; }
.studio { display: grid; grid-template-columns: 260px minmax(0, 1fr) 300px; gap: var(--s4); align-items: start; }
.studio-side { position: sticky; top: calc(var(--nav-h) + 16px); }
@media (max-width: 1180px) { .studio { grid-template-columns: minmax(0, 1fr) 300px; } .studio > :first-child { grid-column: 1 / -1; position: static; } }
@media (max-width: 760px) { .studio { grid-template-columns: 1fr; } .studio-side { position: static; } }
.hand { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.hand img { width: 100%; border-radius: 5px; aspect-ratio: 63 / 88; object-fit: cover; background: var(--surface-2); }
.hand.big { gap: 8px; } .hand.big img { border-radius: 9px; }
@media (max-width: 640px) { .hand.big { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* footer */
.site-foot { max-width: 1200px; margin: 40px auto 0; padding: 20px var(--s5) 32px; border-top: 1px solid var(--line); font-size: 13px; }
.site-foot a { color: var(--text-2); }
.ad-slot { min-height: 140px; }

.set-code { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .5px; padding: 1px 6px; border-radius: 6px; border: 1px solid currentColor; line-height: 1.5; }
.set-code.r-common { color: #c9ccd3; } .set-code.r-uncommon { color: #a9c3d6; } .set-code.r-rare { color: #e3c06e; } .set-code.r-mythic { color: #f08a4b; }
.chip svg.sym { width: 18px; height: 18px; }

/* ===================================================================== viz system (js/viz, docs/viz-system.md) */
.t0, .t1 { color: var(--muted); } .t2 { color: var(--text-2); } .t3 { color: #ead7aa; } .t4 { color: var(--gold-2); font-weight: 700; }
.vz-tip { position: fixed; z-index: 65; max-width: 300px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); pointer-events: none; opacity: 0; transition: opacity .12s; font-size: 13px; left: -999px; top: -999px; }
.vz-tip.show { opacity: 1; }
.vz-term { border-bottom: 1px dotted currentColor; cursor: help; }
.vz-term:focus-visible { border-radius: 3px; }
.vz-g { display: flex; flex-direction: column; gap: 8px; }
.vz-g-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vz-g-row img.sym, .vz-g-row svg.sym { width: 22px; height: 22px; }
.vz-g-chip { padding: 2px 8px; border-radius: 6px; background: var(--surface-3); font-size: 12px; font-weight: 600; }
.vz-g-arrow { color: var(--muted); } .vz-g-eq { font-weight: 700; }
.vz-g-turns { display: inline-flex; gap: 3px; }
.vz-g-turns span { width: 20px; height: 20px; border-radius: 6px; background: var(--surface-3); font-size: 11px; display: grid; place-items: center; color: var(--muted); }
.vz-g-turns .past { background: rgba(227, 180, 90, .22); color: var(--text-2); } .vz-g-turns .on { background: var(--gold); color: #1b1305; font-weight: 700; }

/* identity panel */
.vz-profile { container-type: inline-size; }
.vz-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.vz-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.vz-legend i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.vz-legend i.me { background: rgba(227, 180, 90, .35); border: 1.5px solid var(--gold); }
.vz-legend i.cmp { border: 1.5px dashed var(--text-2); }
.vz-legend i.band { background: rgba(183, 189, 203, .16); }
.vz-body { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 28px; align-items: start; }
@container (max-width: 820px) { .vz-body { grid-template-columns: minmax(0, 1fr); gap: 16px; } }
.vz-left { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.vz-radar { position: relative; width: 100%; }
.vz-radar.mini { width: 116px; }
.vz-radar-svg { display: block; overflow: visible; }
.vz-radar-svg .grid, .vz-radar-svg .band, .vz-radar-svg .spoke, .vz-radar-svg .gap, .vz-radar-svg .peek, .vz-radar-svg .cmp, .vz-radar-svg .me, .vz-radar-svg .dots { pointer-events: none; }
.vz-wedge, .vz-wdot { cursor: pointer; }
.vz-wedge:focus { outline: none; }
.vz-ax { position: absolute; display: block; max-width: 116px; padding: 4px 7px; border: 0; border-radius: 8px; background: none; color: var(--text-2); font-size: 13px; line-height: 1.25; cursor: pointer; transition: opacity .15s, background .15s; white-space: normal; }
.vz-ax span { display: block; } .vz-ax .l { font-weight: 600; color: var(--text); } .vz-ax .w { font-size: 12px; margin-top: 1px; }
.vz-ax.dim { opacity: .42; } .vz-ax.on .l { color: var(--gold-2); } .vz-ax.pin { background: rgba(227, 180, 90, .1); }
.vz-picker { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.vz-picker .chip { height: 28px; font-size: 12.5px; }
.vz-more { width: auto; height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 999px; color: var(--text-2); }
.vz-reading { min-height: 420px; min-width: 0; }
.vz-reading > * { animation: vzIn .22s ease both; }
@keyframes vzIn { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .vz-reading > * { animation: none; } }
.vz-eyebrow { color: var(--gold); font-size: 12px; font-weight: 600; letter-spacing: .6px; }
.vz-title { margin: 4px 0 6px; font-size: 22px; line-height: 1.3; }
.vz-watch { margin: 0 0 10px; color: var(--text-2); }
.vz-watch .k { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 999px; background: rgba(242, 179, 61, .14); color: var(--amber); font-size: 12px; font-weight: 600; }
.vz-fit { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 8px; color: var(--text-2); font-size: 13px; } .vz-fit b { font-size: 20px; color: var(--gold-2); }
.vz-note { margin: 6px 0; padding: 8px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.vz-note.up { border-color: rgba(69, 195, 138, .35); } .vz-note.bad { border-color: rgba(239, 93, 93, .4); color: var(--text); }
.vz-rows { display: grid; gap: 1px; margin-top: 12px; }
.vz-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) 104px; gap: 12px; align-items: center; padding: 6px 8px; border: 0; border-radius: 9px; background: none; color: var(--text-2); font-size: 13px; text-align: left; cursor: pointer; }
.vz-row:hover, .vz-row:focus-visible { background: var(--surface-2); }
.vz-row .l { color: var(--text); }
.vz-row .track, .vz-meter .track { position: relative; height: 8px; border-radius: 99px; background: var(--surface-3); }
.vz-row .band { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: rgba(183, 189, 203, .16); }
.vz-row .fill, .vz-meter .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--gold); }
.vz-row .cmp { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--text-2); }
.vz-row .w { text-align: right; font-weight: 600; }
.vz-hint { margin: 6px 8px 0; }
.vz-sub { margin: 16px 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .3px; }
.vz-kin-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 72px 58px; gap: 10px; align-items: center; width: 100%; padding: 7px 8px; border: 1px solid transparent; border-radius: 10px; background: none; color: var(--text); font-size: 13.5px; text-align: left; cursor: pointer; }
.vz-kin-row:hover { background: var(--surface-2); } .vz-kin-row.on { border-color: var(--line-2); background: var(--surface-2); }
.vz-kin-row .pips img, .vz-kin-row .pips svg { width: 16px; height: 16px; }
.vz-kin-row .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vz-kin-row .bar { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; } .vz-kin-row .bar i { display: block; height: 100%; background: #8a93a8; border-radius: 99px; }
.vz-kin-row .w { font-size: 12px; color: var(--muted); text-align: right; }
.vz-back { margin: -4px 0 6px -8px; }
.vz-q { margin-top: 2px; font-size: 15px; color: var(--text-2); }
.vz-answer { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 4px 0 2px; }
.vz-answer .w { font-size: 30px; font-weight: 800; line-height: 1.2; }
.vz-strip { margin: 4px 0 0; } .vz-strip svg { display: block; overflow: visible; }
.vz-strip-ends { display: flex; justify-content: space-between; margin-top: -2px; font-size: 11.5px; color: var(--muted); }
.vz-fact { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.vz-fact .big { font-size: 24px; font-weight: 800; line-height: 1.2; } .vz-fact .cap { font-size: 13px; color: var(--text-2); } .vz-fact .more { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.vz-vs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--text-2); }
.vz-vs .sw { width: 18px; border-top: 2px dashed var(--text-2); }
.vz-vs .lev { flex-basis: 100%; display: flex; gap: 6px; align-items: flex-start; color: var(--gold-2); } .vz-vs .lev svg { flex: none; margin-top: 2px; }
.vz-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.vz-thumb { position: relative; width: 64px; aspect-ratio: 63 / 88; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: var(--surface-2); cursor: pointer; transition: transform .15s; }
.vz-thumb:hover, .vz-thumb:focus-visible { transform: translateY(-2px); }
.vz-thumb img { width: 100%; height: 100%; object-fit: cover; }
.vz-thumb .ph { display: grid; place-items: center; height: 100%; padding: 4px; font-size: 10px; color: var(--text-2); }
.vz-thumb .q { position: absolute; top: 3px; right: 3px; padding: 0 5px; border-radius: 99px; background: rgba(10, 12, 16, .86); color: #fff; font-size: 11px; font-weight: 700; }
.vz-thumb .bar { position: absolute; left: 4px; right: 4px; bottom: 4px; height: 4px; border-radius: 99px; background: rgba(10, 12, 16, .75); overflow: hidden; }
.vz-thumb .bar i { display: block; height: 100%; } .vz-thumb .bar.up i { background: var(--green); } .vz-thumb .bar.down i { background: var(--amber); }
.vz-profile.compact .vz-body { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.vz-profile.compact .vz-reading { min-height: 0; }
.vz-profile.compact .vz-row { grid-template-columns: 92px minmax(0, 1fr) 84px; gap: 8px; }
@media (max-width: 640px) { .vz-row { grid-template-columns: 96px minmax(0, 1fr) 84px; gap: 8px; } .vz-reading { min-height: 0; } .vz-title { font-size: 19px; } }

/* compact meter (deck cards) */
.vz-meter { display: grid; grid-template-columns: 76px minmax(0, 1fr) 64px; gap: 8px; align-items: center; font-size: 12px; color: var(--text-2); }
.vz-meter .track { height: 6px; } .vz-meter .w { text-align: right; font-weight: 600; }

/* curve, mana, roles */
.vz-curve svg { display: block; }
.vz-curve-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--muted); }
.vz-mana { display: grid; gap: 16px; }
.vz-mrow { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; }
.vz-msym img, .vz-msym svg { width: 26px; height: 26px; }
.vz-mline { display: grid; grid-template-columns: 112px minmax(0, 1fr) 42px; gap: 8px; align-items: center; font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.vz-mline .track { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; } .vz-mline .track i { display: block; height: 100%; border-radius: 99px; }
.vz-mline .v { text-align: right; color: var(--text); font-weight: 600; }
.vz-mprob { font-size: 12.5px; margin-top: 2px; } .vz-mprob b { font-weight: 700; }
.vz-roles { display: grid; gap: 8px; }
.vz-role { display: grid; grid-template-columns: 96px minmax(0, 1fr) 26px; gap: 8px; align-items: center; font-size: 12.5px; color: var(--text-2); border-radius: 6px; }
.vz-role .track { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; } .vz-role .track i { display: block; height: 100%; background: var(--blue); border-radius: 99px; transition: background .15s; }
.vz-role .v { text-align: right; font-weight: 600; color: var(--text); }
.vz-role.zero { opacity: .45; } .vz-role.lit .track i { background: var(--gold); } .vz-role.lit .l { color: var(--gold-2); }
.vz-diff { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; font-size: 12.5px; color: var(--muted); }
.vz-diff .k { margin-right: 2px; }
.vz-diff-x { border: 1px solid var(--line-2); background: var(--bg-2); border-radius: 999px; padding: 2px 10px; font-size: 12.5px; cursor: pointer; color: var(--text-2); }
.vz-diff-x.up { color: #7fe0b2; } .vz-diff-x.down { color: #f5c46a; } .vz-diff-x:hover { border-color: #46506a; }
.vz-ax { width: max-content; } .vz-ax span { white-space: nowrap; }
.vz-profile.compact .vz-kin-row { grid-template-columns: auto minmax(0, 1fr) auto; } .vz-profile.compact .vz-kin-row .bar { display: none; }
.vz-radar.tight .vz-ax .w { display: none; }
.vz-profile.compact .vz-left { align-items: center; }
.vz-radar.tight .vz-ax { font-size: 12px; padding: 2px 4px; }
.shell .panel a, .shell p a { color: var(--gold-2); }
