:root {
  --bg: #0b0d13;
  --bg-2: #10131b;
  --surface: #151924;
  --surface-2: #1b2030;
  --line: #252b3b;
  --text: #e9ecf4;
  --muted: #8b93a7;
  --accent: #ff5c7a;
  --accent-2: #a24bff;
  --sound: #4fb3ff;
  --down: #ff8a3d;
  --radius: 16px;
  --shiny: linear-gradient(110deg, #ffe08a, #ff9bd2 35%, #9fd8ff 65%, #c9ffb0);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(162, 75, 255, .14), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(255, 92, 122, .10), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}
a { color: inherit; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .92em; }
.muted { color: var(--muted); }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(11, 13, 19, .78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top-inner { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: .2px; white-space: nowrap; }
.pages { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-left: auto; }
.pages::-webkit-scrollbar { display: none; }
.page-link {
  padding: 7px 12px; border-radius: 999px; font-size: 13.5px; white-space: nowrap;
  color: var(--muted); text-decoration: none;
}
.page-link.active { background: var(--surface-2); color: var(--text); }

/* Hero */
.hero { padding: 48px 0 20px; }
.eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; color: var(--accent); }
h1 { margin: 0; font-size: clamp(32px, 6vw, 48px); line-height: 1.05; letter-spacing: -.8px; }
.lede { max-width: 620px; color: var(--muted); margin: 12px 0 0; }

/* Controls */
.controls {
  position: sticky; top: 60px; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 14px 0; margin-top: 8px;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.search {
  flex: 1 1 260px; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 0 12px; height: 42px;
}
.search:focus-within { border-color: #3a4360; }
.search svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex: none; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; }
.search input::placeholder { color: #6b7387; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip, .shiny-toggle {
  height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); font: inherit; font-size: 14px; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.chip:hover, .shiny-toggle:hover { color: var(--text); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.shiny-toggle { display: inline-flex; align-items: center; gap: 6px; }
.shiny-toggle[aria-pressed="true"] {
  color: #1a1420; font-weight: 700; border-color: transparent;
  background: var(--shiny); background-size: 200% 100%; animation: sheen 4s linear infinite;
}
.spark { font-size: 13px; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

.note {
  margin: 4px 0 8px; padding: 12px 14px; border-radius: 12px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); font-size: 14px;
}
.note strong { color: var(--text); font-weight: 600; }
.note em { font-style: normal; color: var(--text); }

/* Grid */
.group-title { font-size: 15px; font-weight: 600; color: var(--muted); margin: 32px 0 14px; letter-spacing: .2px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }

.card {
  position: relative; display: flex; flex-direction: column; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0; overflow: hidden; color: inherit; font: inherit; cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); border-color: #343c55; box-shadow: 0 14px 30px -18px rgba(0,0,0,.8); }
.art {
  position: relative; aspect-ratio: 1 / 1;
  background: radial-gradient(closest-side, rgba(255, 92, 122, .16), transparent 75%), var(--bg-2);
  display: grid; place-items: center;
}
.art .hammer { width: 78%; height: 78%; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(0,0,0,.55)); transition: transform .25s ease; }
.card:hover .art .hammer { transform: scale(1.04) rotate(-2deg); }
.art .gem {
  position: absolute; right: 10px; bottom: 10px; width: 30%; aspect-ratio: 1;
  object-fit: contain; padding: 6px;
  background: rgba(21, 25, 36, .85); border: 1px solid var(--line); border-radius: 12px;
}
.badge {
  position: absolute; top: 10px; left: 10px;
  font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px;
  background: rgba(11, 13, 19, .7); border: 1px solid var(--line); color: var(--muted);
}
.placeholder { color: #4b5368; font-size: 13px; text-align: center; padding: 20px; }
.placeholder b { display: block; font-size: 34px; color: #2c3346; margin-bottom: 4px; }

.meta { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.name { font-weight: 700; font-size: 16px; line-height: 1.2; }
.sub { color: var(--muted); font-size: 13px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.tag { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid; }
.tag.sound { color: var(--sound); border-color: rgba(79, 179, 255, .35); background: rgba(79, 179, 255, .08); }
.tag.down  { color: var(--down);  border-color: rgba(255, 138, 61, .35); background: rgba(255, 138, 61, .08); }

/* Shiny mode */
body.is-shiny .art { background: radial-gradient(closest-side, rgba(255, 224, 138, .18), transparent 75%), var(--bg-2); }
body.is-shiny .card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: var(--shiny); background-size: 200% 100%; animation: sheen 5s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
body.is-shiny .card.no-shiny { opacity: .45; }
@keyframes sheen { to { background-position: 200% 0; } }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* Footer */
.foot { margin-top: 64px; padding: 28px 0 40px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.foot p { margin: 4px 0; }
.foot a { color: var(--text); }

/* Detail dialog */
dialog {
  width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  padding: 0; border: 1px solid var(--line); border-radius: 20px;
  background: var(--surface); color: var(--text);
}
dialog::backdrop { background: rgba(5, 6, 10, .7); backdrop-filter: blur(4px); }
.d-inner { position: relative; padding: 24px; }
.d-inner h2 { margin: 0 0 10px; font-size: 26px; letter-spacing: -.3px; }
.d-close {
  position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer;
}
.d-close:hover { color: var(--text); }
.d-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.d-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 18px; }
.d-tile { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px; text-align: center; }
.d-tile img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.d-tile span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.d-tile.shiny { border-color: rgba(255, 224, 138, .35); }
.d-tile.shiny span { color: #ffe08a; }
.d-clips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.d-clips a {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: 14px;
  padding: 9px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line);
}
.d-clips a:hover { border-color: #3a4360; }
.d-clips small { color: var(--muted); }

/* ---------- Shared list pages ---------- */
.page-link .short { display: none; }
.select {
  height: 42px; padding: 0 34px 0 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b93a7' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px;
  color: var(--text); font: inherit; font-size: 14px; cursor: pointer; appearance: none; -webkit-appearance: none;
}
.select option { background: var(--surface); }
.note p { margin: 0; }
.note p + p { margin-top: 6px; }
.total { color: var(--muted); font-size: 13px; margin: 14px 0 0; }

.group-head { font-size: 22px; letter-spacing: -.3px; margin: 44px 0 4px; }
.sec { margin-top: 28px; scroll-margin-top: 130px; }
.sec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sec-head h3 { margin: 0; font-size: 17px; letter-spacing: -.1px; }
.sec-icon { width: 30px; height: 30px; object-fit: contain; }
.count { font-size: 12px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); padding: 1px 8px; border-radius: 999px; }
.sec-note { color: var(--muted); font-size: 14px; margin: -6px 0 14px; max-width: 760px; }

.art .main { width: 80%; height: 80%; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(0,0,0,.55)); transition: transform .25s ease; }
.card:hover .art .main { transform: scale(1.04) rotate(-2deg); }
.art.glow-legendary { background: radial-gradient(closest-side, rgba(245, 200, 76, .17), transparent 75%), var(--bg-2); }
.art.glow-epic      { background: radial-gradient(closest-side, rgba(213, 138, 192, .17), transparent 75%), var(--bg-2); }
.art.glow-rare      { background: radial-gradient(closest-side, rgba(110, 168, 240, .17), transparent 75%), var(--bg-2); }
.art.glow-common    { background: radial-gradient(closest-side, rgba(140, 200, 120, .15), transparent 75%), var(--bg-2); }
.art.glow-mythical  { background: radial-gradient(closest-side, rgba(255, 92, 122, .18), transparent 75%), var(--bg-2); }
.badge { max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.name-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.name-row .name { min-width: 0; overflow-wrap: anywhere; }
.stats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.value { font-weight: 800; font-size: 18px; letter-spacing: -.3px; margin-right: 2px; font-variant-numeric: tabular-nums; }
.value small { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .2px; }
.value.muted { font-size: 13px; font-weight: 600; color: var(--muted); }

/* pills */
.pill { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 650; padding: 2px 8px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.pill.kind { color: var(--muted); border-color: var(--line); background: var(--bg-2); }
.demand.star { color: #ff7ce0; border-color: rgba(255, 124, 224, .4); background: rgba(255, 124, 224, .1); }
.demand.d5 { color: #5fe3ea; border-color: rgba(95, 227, 234, .35); background: rgba(95, 227, 234, .08); }
.demand.d4 { color: #6fe08a; border-color: rgba(111, 224, 138, .35); background: rgba(111, 224, 138, .08); }
.demand.d3 { color: #f2dd5c; border-color: rgba(242, 221, 92, .35); background: rgba(242, 221, 92, .08); }
.demand.d2 { color: #ffa24d; border-color: rgba(255, 162, 77, .35); background: rgba(255, 162, 77, .08); }
.demand.d1 { color: #ff6b6b; border-color: rgba(255, 107, 107, .35); background: rgba(255, 107, 107, .08); }
.demand.na { color: var(--muted); border-color: var(--line); background: var(--bg-2); }
.status.s-exceptional  { color: #ff9ad0; border-color: rgba(255, 154, 208, .35); background: rgba(166, 77, 121, .22); }
.status.s-overpaid-for { color: #b9a8ff; border-color: rgba(185, 168, 255, .35); background: rgba(142, 124, 195, .16); }
.status.s-doing-well   { color: #7fb0ff; border-color: rgba(127, 176, 255, .35); background: rgba(60, 120, 216, .16); }
.status.s-stable       { color: #a5e0b0; border-color: rgba(165, 224, 176, .25); background: rgba(165, 224, 176, .06); }
.status.s-fluctuating  { color: #f2dd5c; border-color: rgba(242, 221, 92, .3); background: rgba(242, 221, 92, .07); }
.status.s-subpar       { color: #ffa24d; border-color: rgba(255, 162, 77, .3); background: rgba(255, 162, 77, .07); }

.rarity { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650; color: var(--muted); white-space: nowrap; }
.rarity::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.rarity.r-mythical  { color: #ff6f8a; }
.rarity.r-legendary { color: #f5c84c; }
.rarity.r-epic      { color: #d58ac0; }
.rarity.r-rare      { color: #6ea8f0; }
.rarity.r-common    { color: #8cc878; }
.card.r-legendary { border-top-color: rgba(245, 200, 76, .45); }
.card.r-mythical  { border-top-color: rgba(255, 111, 138, .5); }

/* split bundle cards: hammer | gem, each with its own value */
.split { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.split .badge { z-index: 1; }
.piece { display: flex; flex-direction: column; align-items: center; background: var(--bg-2); padding: 12px 8px 10px; min-width: 0; }
.piece-art { width: 100%; aspect-ratio: 1; display: grid; place-items: center; }
.piece-art img { width: 86%; height: 86%; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0,0,0,.5)); transition: transform .25s ease; }
.card:hover .piece-art img { transform: scale(1.05); }
.piece-art img.half { width: 80%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 10px; filter: none; }
.piece-art img.half-top { object-position: 50% 0%; }
.piece-art img.half-bottom { object-position: 50% 100%; }
.piece-art .placeholder { padding: 0; }
.piece-name { margin-top: 6px; font-size: 12px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.piece-val { font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
.piece-val.muted { font-size: 13px; font-weight: 600; color: var(--muted); }
.piece.glow-legendary { background: radial-gradient(closest-side at 50% 40%, rgba(245, 200, 76, .14), transparent 80%), var(--bg-2); }
.piece.glow-epic      { background: radial-gradient(closest-side at 50% 40%, rgba(213, 138, 192, .14), transparent 80%), var(--bg-2); }
.piece.glow-rare      { background: radial-gradient(closest-side at 50% 40%, rgba(110, 168, 240, .14), transparent 80%), var(--bg-2); }
.piece.glow-mythical  { background: radial-gradient(closest-side at 50% 40%, rgba(255, 92, 122, .15), transparent 80%), var(--bg-2); }

/* filler rows: "any rare hammer" etc. */
.fillers { list-style: none; margin: 12px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.fillers li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 9px 14px; background: var(--bg-2); font-size: 14px; }
.fillers li + li { border-top: 1px solid var(--line); }
.f-name { color: var(--muted); min-width: 150px; }
.f-val { font-weight: 800; min-width: 30px; font-variant-numeric: tabular-nums; }
.f-link { margin-left: auto; color: var(--muted); font-size: 13px; text-decoration: none; }
.f-link:hover { color: var(--text); }

/* detail extras */
.d-stats { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 16px 0 0; font-size: 14px; }
.d-stats dt { color: var(--muted); }
.d-stats dd { margin: 0; font-weight: 650; }
.d-note { color: var(--muted); font-size: 14px; }

/* ---------- Home ---------- */
.home-hero { padding-top: 64px; max-width: 760px; }
.home-hero h1 { font-size: clamp(34px, 6.5vw, 56px); }
.search.big { height: 54px; margin-top: 24px; border-radius: 14px; font-size: 16px; }
.hint { color: var(--muted); font-size: 13px; margin: 10px 2px 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 16px; }
.tile {
  display: flex; flex-direction: column; text-decoration: none; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; transition: transform .18s ease, border-color .18s ease;
}
.tile:hover { transform: translateY(-3px); border-color: #343c55; }
.tile-art { height: 120px; display: flex; align-items: center; justify-content: center; gap: 4px; background: radial-gradient(closest-side, rgba(162, 75, 255, .14), transparent 80%), var(--bg-2); }
.tile-art img { width: 30%; height: 100px; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0,0,0,.5)); }
.tile-body { padding: 14px 16px 16px; }
.tile-body .eyebrow { font-size: 11px; }
.tile-body h3 { margin: 0 0 4px; font-size: 18px; }
.tile-body p { margin: 0; color: var(--muted); font-size: 14px; }
.tile-count { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--text); }
.legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 16px; }
.legend-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.legend-card h3 { margin: 0 0 10px; font-size: 15px; }
.legend-card h3.mt { margin-top: 18px; }
.legend-card p { margin: 0; color: var(--muted); font-size: 14px; }
.legend-card em { font-style: normal; color: var(--text); }
.legend-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; color: var(--muted); }
.legend-list li { display: flex; align-items: center; gap: 10px; }
.legend-list .pill { min-width: 84px; justify-content: center; }

@media (max-width: 900px) {
  .page-link .long { display: none; }
  .page-link .short { display: inline; }
}

@media (max-width: 640px) {
  .select { height: 38px; font-size: 13.5px; flex: 1 1 0; min-width: 0; }
  .sec { scroll-margin-top: 170px; }
  .value { font-size: 16px; }
  .tiles { grid-template-columns: 1fr; }
  .home-hero { padding-top: 36px; }
  .top-inner { gap: 10px; }
  .brand span { display: none; }
  .pages { margin-left: 0; }
  .f-name { min-width: 0; flex-basis: 100%; }
  .wrap { padding: 0 16px; }
  .top-inner { gap: 12px; }
  .hero { padding-top: 28px; }
  .controls { top: 60px; }
  .chips { flex: 1 1 100%; flex-wrap: nowrap; }
  .shiny-toggle { margin-left: auto; }
  .chip, .shiny-toggle { height: 38px; padding: 0 12px; font-size: 13.5px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .meta { padding: 10px 11px 12px; }
  .name { font-size: 14.5px; }
  .d-inner { padding: 20px 16px; }

  /* list pages: search on its own row, selects share the next, chips scroll sideways */
  body[data-page] .controls { position: static; background: none; }
  body[data-page] .search { flex-basis: 100%; }
  body[data-page] .chips { overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  body[data-page] .chips::-webkit-scrollbar { display: none; }
  body[data-page] .chip { flex: none; }
  .sec { scroll-margin-top: 76px; }
  .name-row { flex-direction: column; align-items: flex-start; gap: 2px; }
  .name-row .name { overflow-wrap: normal; word-break: normal; hyphens: auto; }
}

.cta {
  display: inline-flex; align-items: center; gap: 14px; margin-top: 18px; padding: 12px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface); text-decoration: none; transition: border-color .15s, transform .15s;
}
.cta:hover { border-color: var(--accent); transform: translateY(-2px); }
.cta b { display: block; font-size: 15px; }
.cta small { display: block; color: var(--muted); font-size: 13px; }
.cta-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--accent); color: #1a0f08; font-size: 18px; font-weight: 800; }

/* ---------- Nav: tools ---------- */
.page-link.tool { color: var(--accent); font-weight: 600; }
.page-link.tool.active { color: var(--text); }

/* ---------- Trade calculator ---------- */
.verdict {
  margin-top: 8px; padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); display: grid; gap: 10px;
}
.verdict.empty p { margin: 0; color: var(--muted); }
.v-main { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.v-title { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.v-diff { margin: 0; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.verdict.win  { border-color: rgba(111, 224, 138, .45); background: linear-gradient(90deg, rgba(111, 224, 138, .10), transparent 70%), var(--surface); }
.verdict.win .v-title, .verdict.win .v-diff { color: #6fe08a; }
.verdict.loss { border-color: rgba(255, 107, 107, .45); background: linear-gradient(90deg, rgba(255, 107, 107, .10), transparent 70%), var(--surface); }
.verdict.loss .v-title, .verdict.loss .v-diff { color: #ff6b6b; }
.verdict.fair { border-color: rgba(242, 221, 92, .4); background: linear-gradient(90deg, rgba(242, 221, 92, .08), transparent 70%), var(--surface); }
.verdict.fair .v-title { color: #f2dd5c; }
.v-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--bg-2); }
.v-give { background: #ff8a6b; transition: width .3s ease; }
.v-get { flex: 1; background: #6fe08a; }
.v-legend { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.v-note { margin: 0; font-size: 14px; color: var(--muted); }

.trade { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.side-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.side-head h2 { margin: 0; font-size: 17px; }
.side-total { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
#side-give .side-head h2 { color: #ff8a6b; }
#side-get .side-head h2 { color: #6fe08a; }
.slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.slot {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0;
  padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); text-align: center;
}
.slot.add { justify-content: center; min-height: 150px; border-style: dashed; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.slot.add:hover { color: var(--text); border-color: #3a4360; }
.slot .plus { font-size: 28px; line-height: 1; }
.slot-art { width: 100%; aspect-ratio: 1; display: grid; place-items: center; }
.slot-art img { width: 86%; height: 86%; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0,0,0,.5)); }
.slot-art img.half, .pick-art img.half { height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 8px; filter: none; }
.slot-art img.half-top, .pick-art img.half-top { object-position: 50% 0%; }
.slot-art img.half-bottom, .pick-art img.half-bottom { object-position: 50% 100%; }
.noimg { width: 70%; aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); color: #4b5368; font-size: 24px; font-weight: 800; }
.slot-name { font-size: 12px; font-weight: 600; line-height: 1.25; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-val { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.slot-val .muted { font-size: 12px; font-weight: 600; color: var(--muted); }
.slot .pill { font-size: 10.5px; padding: 1px 6px; }
.slot-x, .slot-shiny {
  position: absolute; top: 4px; width: 24px; height: 24px; border-radius: 8px; border: 1px solid var(--line);
  background: rgba(11, 13, 19, .75); color: var(--muted); font-size: 14px; line-height: 1; cursor: pointer; z-index: 1;
}
.slot-x { right: 4px; font-size: 17px; }
.slot-shiny { left: 4px; font-size: 12px; }
.slot-x:hover { color: #ff6b6b; }
.slot-shiny:hover { color: #ffe08a; }
.slot-shiny.on { color: #1a1420; border-color: transparent; background: var(--shiny); }
.slot.is-shiny { border-color: rgba(255, 224, 138, .5); background: radial-gradient(closest-side at 50% 35%, rgba(255, 224, 138, .14), transparent 80%), var(--bg-2); }
.slot.is-shiny .slot-name { color: #ffe08a; }
.side-stats { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; }
.side-stats dt { color: var(--muted); }
.side-stats dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.trade-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }

.picker-inner { display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 48px); }
.picker-inner h2 { margin: 0; font-size: 20px; padding-right: 40px; }
.picker-inner .search { flex: none; }
.pick-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; max-height: 55vh; border: 1px solid var(--line); border-radius: 12px; }
.pick-list li + li { border-top: 1px solid var(--line); }
.pick {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 0; background: var(--bg-2);
  color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.pick:hover, .pick:focus-visible { background: var(--surface-2); }
.pick-art { flex: none; width: 44px; height: 44px; display: grid; place-items: center; }
.pick-art img { width: 44px; height: 44px; object-fit: contain; }
.pick-art .noimg { width: 40px; font-size: 16px; }
.pick-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pick-name { font-weight: 650; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-src { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-val { min-width: 54px; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.pick-more { padding: 12px; color: var(--muted); font-size: 13px; text-align: center; }

@media (max-width: 860px) {
  .trade { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .slot.add { min-height: 130px; }
  .pick .rarity { display: none; }
  .v-title { font-size: 19px; }
}

/* ---------- Seasonal themes (picked in js/theme.js) ---------- */
.season-layer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
main, .foot { position: relative; z-index: 1; }
.leaf { position: absolute; top: -40px; animation: leaf-fall var(--dur) linear var(--delay) infinite; will-change: transform; }
.leaf svg { display: block; width: 100%; height: 100%; animation: leaf-sway calc(var(--dur) / 3) ease-in-out var(--delay) infinite alternate; }
@keyframes leaf-fall { to { transform: translateY(calc(100vh + 80px)); } }
@keyframes leaf-sway { from { transform: translateX(0) rotate(0deg); } to { transform: translateX(var(--sway)) rotate(var(--spin)); } }

body.theme-fall {
  --accent: #ff8f3f;
  --accent-2: #d9542b;
  background:
    radial-gradient(900px 520px at 10% -10%, rgba(232, 116, 42, .20), transparent 60%),
    radial-gradient(800px 520px at 100% 0%, rgba(201, 71, 31, .16), transparent 60%),
    radial-gradient(1000px 600px at 50% 120%, rgba(168, 53, 28, .14), transparent 60%),
    #0e0c0d;
  background-attachment: fixed;
}
body.theme-fall .top { background: rgba(16, 12, 11, .78); }
body.theme-fall .controls { background: linear-gradient(#0e0c0d 70%, transparent); }
body.theme-fall .tile-art { background: radial-gradient(closest-side, rgba(232, 116, 42, .16), transparent 80%), var(--bg-2); }
@media (max-width: 640px) {
  body.theme-fall[data-page] .controls { background: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
