:root {
  --ink: #17262a;
  --muted: #56676b;
  --line: #d9e1df;
  --bg: #f4f6f4;
  --card: #fff;
  --night: #0d1f24;
  --night2: #15323a;
  --teal: #0b7a70;
  --teal-soft: #e3f2ef;
  --gold: #e2a91b;
  --gold-ink: #3a2a00;
  --good: #1d7a3a;
  --bad: #b3352b;
  --r: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 Rubik, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
img { max-width: 100%; height: auto; }
a { color: var(--teal); text-underline-offset: 2px; }
a:hover { color: #075a53; }
h1 { font-size: clamp(1.7rem, 3.4vw, 2.35rem); line-height: 1.15; margin: .4em 0 .35em; font-weight: 700; }
h2 { font-size: 1.35rem; line-height: 1.25; margin: 1.6em 0 .5em; font-weight: 600; }
h2 small { color: var(--muted); font-weight: 400; font-size: .8em; }
h3 { font-size: 1.08rem; margin: 1.3em 0 .4em; font-weight: 600; }
code { background: #e8edeb; padding: 0 .3em; border-radius: 4px; font-size: .9em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
main.wrap { padding-bottom: 48px; }
.lede { font-size: 1.08rem; color: #34474b; max-width: 760px; }
.note { color: var(--muted); font-size: .9rem; margin: .4em 0; }

/* header */
.top { background: var(--night); color: #dfeeee; position: sticky; top: 0; z-index: 20; }
.top-in { display: flex; align-items: center; gap: 24px; min-height: 58px; }
.brand { display: flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; font-weight: 600; white-space: nowrap; }
.brand img { border-radius: 6px; background: var(--night2); }
.brand:hover { color: #fff; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: #b9d2d2; text-decoration: none; padding: 7px 10px; border-radius: 6px; font-size: .93rem; white-space: nowrap; }
.nav a:hover { color: #fff; background: var(--night2); }
.nav a[aria-current] { color: #fff; background: var(--night2); box-shadow: inset 0 -2px 0 #3fc1b0; }
@media (max-width: 860px) {
  .top { position: static; }
  .top-in { flex-direction: column; align-items: stretch; gap: 0; padding: 0; }
  .brand { padding: 12px 20px 6px; }
  .nav { padding: 0 14px 8px; }
}

.crumbs { font-size: .85rem; color: var(--muted); margin-top: 18px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }

/* buttons */
.btn, .btn-s { font: inherit; cursor: pointer; border-radius: 8px; border: 0; }
.btn { background: var(--gold); color: var(--gold-ink); font-weight: 600; padding: 11px 18px; }
.btn:hover:not(:disabled) { background: #f0b82a; }
.btn:disabled { background: #e6dcc2; color: #5e5230; cursor: default; }
.btn.big { width: 100%; padding: 14px; font-size: 1.05rem; }
.btn-s { background: #fff; color: var(--ink); border: 1px solid var(--line); padding: 9px 14px; font-weight: 500; }
.btn-s:hover { border-color: var(--teal); color: var(--teal); }
.link { font: inherit; background: none; border: 0; color: var(--teal); cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 2px; }

/* relic tiles: the game's art sits on its own dark panel */
.rtile { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; flex: none; border-radius: 9px; background: var(--night); border: 1px solid #23434a; }
.rtile img { width: 44px; height: 44px; object-fit: contain; }
.coin { font-variant-numeric: tabular-nums; font-weight: 600; color: #8a6200; }
.coin::before { content: ""; display: inline-block; width: .7em; height: .7em; border-radius: 50%; background: var(--gold); border: 1px solid #b8860b; margin-right: .3em; vertical-align: -.02em; }
.tag { display: inline-block; font-size: .75rem; background: var(--teal-soft); color: #075a53; padding: 1px 7px; border-radius: 99px; margin-left: 6px; font-weight: 500; }
.sub { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; }
.good { color: var(--good); }
.bad { color: var(--bad); }

/* home intro */
.intro { padding: 10px 0 2px; max-width: 820px; }
.intro h1 { margin-bottom: .25em; }
.intro .lede { margin: 0 0 6px; }
.aside { font-size: .9rem; color: var(--muted); margin: 0 0 8px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: start; }
.split .shot { margin-top: 2.2em; max-width: none; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 0; } .split .shot { margin-top: 0; } }
.mini { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.mini .rtile { width: 34px; height: 34px; border-radius: 7px; }
.mini .rtile img { width: 28px; height: 28px; }
table.wanted td, table.starts td { vertical-align: middle; }
table.wanted td:nth-child(3), table.starts td:nth-child(3) { color: #34474b; font-size: .9rem; }
.mbar { display: none; }
@media (max-width: 860px) {
  .mbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; align-items: center; gap: 12px; justify-content: space-between; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--night); color: #e1efef; font-size: .92rem; }
  .mbar .btn { padding: 10px 16px; }
}

/* finder */
.finder { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 6px 0 26px; scroll-margin-top: 70px; }
@media (max-width: 860px) { .finder { grid-template-columns: 1fr; padding: 14px; } }
.finder-pick { display: flex; flex-direction: column; gap: 10px; min-width: 0; position: sticky; top: 74px; align-self: start; }
@media (max-width: 860px) { .finder-pick { position: static; } .grid { max-height: 290px; } }
.pick-head { display: flex; gap: 10px; align-items: center; }
.pick-head label { font-weight: 500; font-size: .92rem; }
.pick-head select { flex: 1; min-width: 0; }
select, input[type=search], input[type=email], input[type=text] { font: inherit; padding: 9px 11px; border: 1px solid #7d918c; border-radius: 8px; background: #fff; color: var(--ink); width: 100%; }
select:focus-visible, input:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
.pick-tabs { display: flex; gap: 6px; }
.pick-tabs button { font: inherit; font-size: .9rem; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink); }
.pick-tabs button[aria-pressed=true] { background: var(--night); color: #fff; border-color: var(--night); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; max-height: 372px; overflow-y: auto; padding: 2px; align-content: start; }
.grid button { font: inherit; display: flex; gap: 8px; align-items: center; text-align: left; padding: 5px 8px 5px 5px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; color: var(--ink); min-width: 0; }
.grid button:hover { border-color: var(--teal); }
.grid button[aria-pressed=true] { border-color: var(--teal); background: var(--teal-soft); box-shadow: inset 0 0 0 1px var(--teal); }
.grid .rtile { width: 40px; height: 40px; border-radius: 7px; }
.grid .rtile img { width: 34px; height: 34px; }
.grid b { display: block; font-weight: 500; font-size: .86rem; line-height: 1.2; overflow-wrap: anywhere; }
.grid small { display: block; color: var(--muted); font-size: .76rem; }
.grid .none { color: var(--muted); padding: 10px; grid-column: 1 / -1; }
.finder-out { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.owned { border: 1px dashed #b8c6c2; border-radius: 10px; padding: 10px; }
.owned-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.owned-head [data-n] { background: var(--night); color: #fff; border-radius: 99px; font-size: .8rem; padding: 0 8px; }
.owned-head .link { margin-left: auto; font-size: .88rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .empty { color: var(--muted); font-size: .9rem; }
.chip { font: inherit; display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 3px; border: 1px solid var(--line); border-radius: 99px; background: #fff; font-size: .85rem; cursor: pointer; color: var(--ink); }
.chip img { width: 24px; height: 24px; border-radius: 50%; background: var(--night); }
.chip::after { content: "×"; color: var(--muted); margin-left: 2px; }
.chip:hover { border-color: var(--bad); }

/* fusion result rows */
.fz { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.fz:first-child { border-top: 0; }
.fz > div { min-width: 0; flex: 1; }
.fz b { display: block; }
.fz .have { display: inline-block; font-size: .85rem; color: var(--muted); }
.fz .bar { height: 6px; background: #e6ebe9; border-radius: 99px; margin: 6px 0; overflow: hidden; }
.fz .bar i { display: block; height: 100%; background: var(--teal); border-radius: 99px; }
.fz.done .bar i { background: var(--good); }
.fz p { margin: 4px 0; font-size: .92rem; }
.fz .pcs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.fz .pc { display: inline-flex; align-items: center; gap: 5px; font-size: .82rem; border: 1px solid var(--line); border-radius: 7px; padding: 2px 7px 2px 2px; background: #fff; }
.fz .pc img { width: 26px; height: 26px; background: var(--night); border-radius: 5px; }
.fz .pc.own { background: var(--teal-soft); border-color: #a9d8cf; }
.fz .pc.req { border-color: #d7a12a; }
.fz .buy { font-size: .88rem; margin-top: 6px; color: #34474b; }
.fz-lock b { color: var(--muted); }
.fz-lock .lockline { display: block; height: 10px; width: 70%; background: #e6ebe9; border-radius: 4px; margin: 6px 0; }
.demo-h { font-weight: 400; color: #34474b; margin: 0 0 4px; font-size: .92rem; }
.rtile.dark { background: #1b2f34; }
.pay { background: #fbf6e8; border: 1px solid #ecd9a3; border-radius: 10px; padding: 14px; margin-top: 8px; }
.pay h3 { margin: 0 0 6px; }
.pay ul { margin: 6px 0 10px; padding-left: 20px; font-size: .92rem; }
.pay .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pay small { color: var(--muted); display: block; margin-top: 6px; }
.pay details, .unlock details { margin-top: 10px; font-size: .9rem; }
.pay details input, .unlock details input { margin: 6px 0; max-width: 320px; display: block; }
.err { color: var(--bad); }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; gap: 0; } }
.qa { border-bottom: 1px solid var(--line); padding: 10px 0; }
.qa summary { cursor: pointer; font-weight: 500; }
.qa p { margin: 8px 0 2px; color: #34474b; }

.recipe { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.piece { display: flex; gap: 10px; align-items: center; flex: 1 1 200px; min-width: 0; }
.piece small { display: block; color: var(--muted); font-size: .82rem; line-height: 1.35; }
.piece.sm .rtile { width: 42px; height: 42px; }
.piece.sm .rtile img { width: 34px; height: 34px; }
.plus { font-weight: 700; color: var(--muted); font-size: 1.2rem; }

.more { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 30px; }
.more a { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; text-decoration: none; color: var(--ink); }
.more a:hover { border-color: var(--teal); }
.more img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--night); }
.more b { display: block; padding: 10px 14px 0; }
.more span { display: block; padding: 2px 14px 14px; color: var(--muted); font-size: .9rem; }
@media (max-width: 760px) { .more { grid-template-columns: 1fr; } }

/* tables */
.filters { display: flex; gap: 12px; align-items: center; margin: 14px 0; }
.filters input { max-width: 380px; }
.tbl { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { padding: 9px 12px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
thead th { border-top: 0; background: #eef2f0; font-weight: 600; font-size: .85rem; color: #34474b; white-space: nowrap; }
td.n, th.n { text-align: right; white-space: nowrap; }
td.ic { width: 64px; }
table.relics td { vertical-align: middle; }
tr:target { background: #fff6dc; }
.locked-line { display: inline-block; height: 10px; width: min(320px, 90%); background: #e6ebe9; border-radius: 4px; vertical-align: middle; }

/* fused relic list */
.fused-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
@media (max-width: 860px) { .fused-list { grid-template-columns: 1fr; } }
.fused { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; min-width: 0; }
.fused:target { border-color: var(--gold); }
.fused-head { display: flex; gap: 12px; }
.fused-head h3 { margin: 0 0 4px; font-size: 1.08rem; }
.fit { display: inline-block; font-size: .78rem; color: #6b4e00; background: #fbf0cf; border-radius: 99px; padding: 1px 8px; margin-bottom: 4px; }
.jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.jump a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--card); text-decoration: none; color: var(--ink); font-size: .9rem; }
.jump a:hover { border-color: var(--teal); }
.jump small { color: var(--muted); }
.fused-head p { margin: 0; font-size: .9rem; color: #34474b; }
.fused-recipe { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.fused-recipe .rule { font-size: .8rem; font-weight: 600; color: #075a53; background: var(--teal-soft); padding: 2px 8px; border-radius: 99px; flex-basis: 100%; width: fit-content; max-width: fit-content; }
.locked-pieces { display: flex; gap: 6px; }
.locked-pieces i { width: 36px; height: 36px; border-radius: 7px; background: #1b2f34; display: block; }
.unlock { background: #fbf6e8; border: 1px solid #ecd9a3; border-radius: var(--r); padding: 16px; display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; align-items: center; margin: 18px 0; }
.unlock p { margin: 4px 0 0; font-size: .92rem; color: #34474b; }
.unlock-buy { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.unlock-buy small { flex-basis: 100%; text-align: right; color: var(--muted); }
.unlock details { grid-column: 1 / -1; }
.unlock.paid { background: var(--teal-soft); border-color: #a9d8cf; display: block; }
@media (max-width: 700px) { .unlock { grid-template-columns: 1fr; } .unlock-buy { justify-content: flex-start; } .unlock-buy small { text-align: left; } }

/* screenshots */
.shot { margin: 18px 0; max-width: 560px; }
.shot img { border-radius: var(--r); border: 1px solid #23434a; display: block; }
.shot figcaption { font-size: .85rem; color: var(--muted); margin-top: 6px; }
.steps .shot.sm { max-width: 420px; }

/* characters */
.chars { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 860px) { .chars { grid-template-columns: 1fr; } }
.char { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; min-width: 0; }
.char-top { display: flex; gap: 12px; align-items: center; }
.char-top img { width: 72px; height: 72px; object-fit: cover; object-position: top; border-radius: 10px; background: var(--night); }
.char-top h2 { margin: 0; font-size: 1.15rem; }
.theme { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
.char dl, .alt dl { display: grid; grid-template-columns: 110px 1fr; gap: 4px 10px; margin: 12px 0 0; font-size: .9rem; }
.char dt, .alt dt { color: var(--muted); }
.char dd, .alt dd { margin: 0; }
.alt { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.alt > span { display: block; font-size: .85rem; color: var(--muted); }

/* opponents */
.opps { display: grid; gap: 12px; }
.opp { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.opp-top { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.opp-top img { width: 56px; height: 56px; object-fit: cover; object-position: top; border-radius: 9px; background: var(--night); }
.opp-top h3 { margin: 0; }
.boss-names { margin: 2px 0 0; font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.deck { border-top: 1px solid var(--line); }
.deck summary { cursor: pointer; padding: 9px 0; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.deck summary span { color: var(--muted); font-size: .86rem; }
.deck summary .key { flex-basis: 100%; }
.decklist { columns: 3 220px; font-size: .88rem; padding: 4px 0 12px; }
.decklist h4 { margin: 0 0 4px; font-size: .85rem; column-span: all; color: var(--muted); }
.decklist div { break-inside: avoid; padding: 1px 0; }
.decklist .x { color: var(--muted); display: inline-block; min-width: 2em; }

/* packs */
.packs { display: grid; gap: 8px; }
.pack { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; }
.pack summary { cursor: pointer; display: flex; gap: 12px; align-items: center; }
.pack summary img { width: 40px; height: auto; border-radius: 4px; }
.pack summary small { display: block; color: var(--muted); font-size: .84rem; }
.packlist { padding: 10px 0 4px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; font-size: .86rem; }
.packlist h4 { margin: 0 0 4px; font-size: .85rem; }
.packlist ul { margin: 0; padding: 0; list-style: none; }
@media (max-width: 760px) { .packlist { grid-template-columns: 1fr 1fr; } }

/* card search */
.cardsearch input[type=search] { max-width: 560px; }
.cfilters { margin: 8px 0; }
.cfilters select { width: auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 8px; }
.card b { font-size: 1rem; }
.card .meta { color: var(--muted); font-size: .85rem; }
.card p { margin: 6px 0; font-size: .9rem; }
.card .where { font-size: .86rem; }

.foot { background: var(--night); color: #a9c1c1; font-size: .86rem; padding: 26px 0 34px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 12px; }
.foot a { color: #e1efef; }
.foot p { max-width: 820px; margin: 0; }
.fz .buy b, .fz p b { display: inline; }
.recipe { margin-bottom: 10px; }
.recipe > .piece:first-child { flex-basis: 100%; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.recipe .eq { display: none; }
.startchips { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; margin: 12px 0 8px; }
.startchips a { display: flex; align-items: center; gap: 9px; padding: 6px 10px 6px 6px; background: var(--card); border: 1px solid var(--line); border-radius: 9px; text-decoration: none; color: var(--muted); font-size: .84rem; line-height: 1.3; }
.startchips a:hover { border-color: var(--teal); }
.startchips img { width: 34px; height: 34px; padding: 3px; border-radius: 7px; background: var(--night); flex: none; }
.startchips b { display: block; color: var(--ink); font-weight: 500; font-size: .9rem; }
table.chartbl td { vertical-align: middle; }
.who { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; white-space: nowrap; }
.who img { width: 36px; height: 36px; object-fit: cover; object-position: top; border-radius: 7px; background: var(--night); }
.piece-note { display: block; font-size: .85rem; margin-top: 2px; }
.toppay { padding-left: 22px; }
.toppay li { margin: 3px 0; }
.opp-jump a { font-size: .82rem; padding: 3px 10px; }
.opp { scroll-margin-top: 70px; }
.sleeves { list-style: none; padding: 0; margin: 10px 0 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.sleeves li { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 8px; }
.sleeves img, .sleeves .noart { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; flex: none; background: var(--night); }
.sleeves b { font-weight: 500; }
.sleeves li > span > span { display: block; font-size: .9rem; color: #34474b; }
.sleeves li:target { border-color: var(--gold); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
.top a:focus-visible, .foot a:focus-visible, .mbar button:focus-visible { outline-color: #5fd6c6; }
.locked-pieces { flex-wrap: wrap; }
h1, h2 { text-wrap: balance; }
html, body { overflow-x: clip; }
@media (max-width: 600px) { .intro .lede { font-size: 1rem; } .aside { display: none; } main.wrap { padding-bottom: 80px; } }
@media (max-width: 860px) { body:has(.mbar) .foot { padding-bottom: 90px; } }
