[hidden] { display: none !important; }
:root {
  --bg: #0c0f17; --panel: #141926; --panel2: #1b2131; --line: #262e42;
  --text: #ece7dc; --muted: #8a92a6; --gold: #d8b45f; --gold-d: #8c7339;
  --fury: #e2453c; --calm: #3fae7a; --mind: #3d8bd9; --body: #e88b2e; --chaos: #9b59d0; --order: #e9c440; --colorless: #9aa1b2;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--text); font: 15px/1.5 Manrope, system-ui, sans-serif; background:
  radial-gradient(900px 500px at 12% -10%, color-mix(in srgb, var(--a) 22%, transparent), transparent 70%),
  radial-gradient(900px 500px at 92% -5%, color-mix(in srgb, var(--b) 18%, transparent), transparent 70%), var(--bg);
  background-repeat: no-repeat; transition: --a .6s, --b .6s; min-height: 100vh; }
h1, h2, h3, .cond { font-family: 'Saira Condensed', sans-serif; letter-spacing: .01em; }
a { color: var(--gold); }
button { font: inherit; color: inherit; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* header */
header { padding: 34px 0 18px; display: flex; align-items: end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.mark { font-family: 'Saira Condensed'; font-weight: 600; color: var(--muted); font-size: 15px; margin: 0 0 2px; }
h1 { font-size: 64px; line-height: .9; margin: 0; font-weight: 800; text-transform: uppercase; }
.total { text-align: right; }
.total b { font-family: 'Saira Condensed'; font-size: 44px; line-height: 1; font-weight: 800; }
.total b small { font-size: 22px; color: var(--muted); font-weight: 700; }
.total p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

/* tabs */
nav.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 6px 0 26px; }
nav.tabs button { background: none; border: 0; padding: 12px 14px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
nav.tabs button[aria-selected="true"] { color: var(--text); border-color: var(--gold); }
nav.tabs small { margin-left: 6px; background: var(--panel2); color: var(--muted); padding: 1px 7px; border-radius: 99px; font-size: 12px; }

/* deck tiles */
.decks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 30px; }
.tile { position: relative; height: 210px; border: 0; padding: 0; border-radius: 14px; overflow: hidden; cursor: pointer; text-align: left; background: var(--panel);
  outline: 2px solid transparent; outline-offset: 3px; transition: transform .25s, outline-color .25s; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; transform: scale(1.15); filter: saturate(1.05); }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,15,23,0) 25%, rgba(12,15,23,.92) 78%); }
.tile .edge { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; z-index: 2; background: linear-gradient(90deg, var(--a) 50%, var(--b) 50%); }
.tile .in { position: absolute; z-index: 2; left: 16px; right: 16px; bottom: 16px; }
.tile h3 { margin: 0; font-size: 34px; line-height: 1; text-transform: uppercase; font-weight: 800; }
.tile .sub { font-size: 12px; color: #c9cbd3; display: flex; justify-content: space-between; margin-top: 4px; }
.tile .bar { height: 4px; border-radius: 4px; background: rgba(255,255,255,.15); margin-top: 8px; overflow: hidden; }
.tile .bar i { display: block; height: 100%; background: var(--gold); }
.tile:hover { transform: translateY(-3px); }
.tile[aria-pressed="true"] { outline-color: var(--gold); }

/* deck view */
.deck { display: grid; grid-template-columns: 300px 1fr; gap: 36px; align-items: start; }
.legend { position: sticky; top: 20px; }
.legend .big { width: 100%; aspect-ratio: 744/1039; border-radius: 14px; overflow: hidden; box-shadow: 0 30px 60px rgba(0,0,0,.5); background: var(--panel); }
.legend .big img { width: 100%; height: 100%; display: block; }
.legend h2 { font-size: 30px; line-height: 1.05; margin: 18px 0 6px; font-weight: 800; }
.doms { display: flex; gap: 6px; margin-bottom: 12px; }
.dom { font-size: 12px; font-weight: 700; padding: 3px 9px 3px 7px; border-radius: 99px; background: var(--panel2); display: inline-flex; align-items: center; gap: 6px; }
.dom::before { content: ""; width: 9px; height: 9px; border-radius: 2px; transform: rotate(45deg); background: var(--c); }
.legend p { margin: 0 0 4px; color: var(--muted); font-size: 13px; }
.legend .upd { margin-top: 10px; font-size: 12px; color: var(--text); background: var(--panel); border-left: 3px solid var(--gold); padding: 8px 10px; border-radius: 0 6px 6px 0; }

.prog { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.prog b { font-family: 'Saira Condensed'; font-size: 40px; font-weight: 800; line-height: 1; }
.prog span { color: var(--muted); }
.filters { display: flex; gap: 6px; margin-left: auto; }
.chip { background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 5px 12px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); }
.chip[aria-pressed="true"] { color: var(--bg); background: var(--text); border-color: var(--text); }

.sections { columns: 2; column-gap: 28px; }
.sec { break-inside: avoid; margin-bottom: 22px; }
.sec h3 { font-size: 15px; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; font-weight: 700; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.row { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; width: 100%; background: none; border: 0; padding: 6px 6px; border-radius: 8px; cursor: pointer; text-align: left; }
.row:hover { background: var(--panel); }
.row .th { width: 34px; aspect-ratio: 744/1039; border-radius: 3px; overflow: hidden; background: var(--panel2); position: relative; }
.row .th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.row .th::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--c); }
.row .nm { font-weight: 600; line-height: 1.25; }
.row .nm small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.pips { display: flex; gap: 4px; }
.pip { width: 11px; height: 11px; transform: rotate(45deg); border: 1.5px solid var(--gold-d); border-radius: 2px; }
.pip.on { background: var(--gold); border-color: var(--gold); }
.row.done .nm { color: var(--muted); }
.row.short .nm::after { content: attr(data-miss); margin-left: 8px; font-size: 11px; font-weight: 700; color: #ffb3a8; background: rgba(226,69,60,.16); padding: 1px 6px; border-radius: 4px; vertical-align: 1px; }

/* shopping */
.shop-h { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.shop-h b { font-family: 'Saira Condensed'; font-size: 40px; font-weight: 800; line-height: 1; }
.only { font-size: 12px; color: var(--muted); border: 1px dashed var(--line); padding: 3px 8px; border-radius: 6px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); text-transform: uppercase; font-weight: 700; padding: 8px; border-bottom: 1px solid var(--line); }
td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .cardcell { display: flex; align-items: center; gap: 12px; }
td .cardcell .th { width: 30px; aspect-ratio: 744/1039; border-radius: 3px; overflow: hidden; flex: none; }
td .cardcell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.decktag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 4px; background: var(--panel2); margin-right: 4px; white-space: nowrap; }

/* versions */
.picks { display: grid; gap: 30px; }
.pick h3 { font-size: 26px; margin: 0 0 2px; font-weight: 800; }
.pick > p { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.vers { display: flex; gap: 18px; flex-wrap: wrap; }
.ver { width: 170px; }
.ver .im { aspect-ratio: 744/1039; border-radius: 10px; overflow: hidden; background: var(--panel); position: relative; box-shadow: 0 12px 26px rgba(0,0,0,.4); }
.ver .im img { width: 100%; height: 100%; display: block; }
.ver .im .q { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-family: 'Saira Condensed'; font-size: 18px; text-align: center; padding: 20px; border: 1px dashed var(--line); border-radius: 10px; }
.ver b { display: block; margin-top: 10px; font-size: 13px; line-height: 1.3; }
.ver span { font-size: 12px; color: var(--muted); }
.ver .pips { margin-top: 6px; }

/* card zoom */
.zoom { position: fixed; inset: 0; background: rgba(5,7,12,.82); display: none; place-items: center; z-index: 10; cursor: zoom-out; backdrop-filter: blur(4px); }
.zoom.on { display: grid; }
.zoom img { max-height: 86vh; max-width: 90vw; border-radius: 18px; box-shadow: 0 40px 80px rgba(0,0,0,.6); }
.zoom p { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; color: var(--muted); }

@media (max-width: 900px) {
  h1 { font-size: 44px; } .total { text-align: left; }
  .decks { grid-template-columns: repeat(2, 1fr); } .tile { height: 160px; } .tile h3 { font-size: 26px; }
  .deck { grid-template-columns: 1fr; } .legend { position: static; display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: start; }
  .legend h2 { margin-top: 0; font-size: 24px; }
  .sections { columns: 1; } .prog { flex-wrap: wrap; } .filters { margin-left: 0; }
  .wrap { padding: 0 16px; } .ver { width: calc(50% - 9px); }
  .hide-s { display: none; }
}

/* footer, login, admin */
footer { margin: 60px 0 40px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer p { margin: 0; max-width: 70ch; }
.link { background: none; border: 0; padding: 0; color: var(--gold); cursor: pointer; text-decoration: underline; font-size: inherit; }
dialog.login { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 26px; width: min(380px, 92vw); }
dialog.login::backdrop { background: rgba(5,7,12,.8); backdrop-filter: blur(3px); }
dialog.login h2 { margin: 0 0 4px; font-size: 28px; font-weight: 800; }
dialog.login p { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
dialog.login label { display: block; font-size: 13px; font-weight: 600; }
.pw { display: flex; gap: 6px; margin-top: 6px; }
input { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.pw input { flex: 1; }
.btn { background: var(--gold); color: var(--bg); border: 0; border-radius: 8px; padding: 9px 16px; font-weight: 700; cursor: pointer; }
.btn.ghost { background: var(--panel2); color: var(--text); }
.btn.wide { width: 100%; margin-top: 14px; }
.err { color: #ffb3a8; font-size: 13px; min-height: 1.2em; margin: 8px 0 0; }
.adminbar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 20; display: flex; gap: 6px; align-items: center;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 99px; padding: 6px 6px 6px 16px; box-shadow: 0 16px 40px rgba(0,0,0,.5); font-size: 13px; }
.adminbar span { color: var(--gold); font-weight: 700; margin-right: 6px; }
.adminbar a, .adminbar button { background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 99px; padding: 5px 12px; text-decoration: none; cursor: pointer; font-size: 13px; }
.step { display: inline-flex; align-items: center; gap: 2px; }
.step button { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel2); cursor: pointer; line-height: 1; font-weight: 700; }
.step b { min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; }
.zoom .card-box { display: grid; justify-items: center; gap: 14px; cursor: default; }
.zoom .card-box p { position: static; margin: 0; color: var(--text); }
.zoom .step { font-size: 18px; }
.zoom .step button { width: 36px; height: 36px; font-size: 18px; }
td input.price { width: 76px; text-align: right; padding: 4px 6px; }
.ver .pips button.pip { padding: 0; background: none; cursor: pointer; }
.ver .pips .pip.on, .ver .pips button.pip.on { background: var(--gold); border-color: var(--gold); }
.ver .left { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); background: #5b1f1b; color: #ffd9d4; padding: 8px 14px; border-radius: 8px; z-index: 30; font-size: 13px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.ver button.im { display: block; width: 100%; border: 0; padding: 0; cursor: zoom-in; }
.ver .left .step { margin-top: 2px; }
