:root {
  --bg: #14110f;
  --bg-raise: #221c18;
  --ink: #f4eee6;
  --muted: #b3a496;
  --line: rgba(244, 238, 230, 0.1);
  --gold: #e2b15a;
  --gold-ink: #2a1c0a;
  --paper: #f4ecdf;
  --paper-ink: #241c16;
  --up: #8fd0a8;
  --down: #f0a090;
  --common: #9aa6b2;
  --uncommon: #7dcea0;
  --rare: #79b0e8;
  --mythic: #d0a0e6;
  --legendary: #e2b15a;
  --secret: #f3e7c4;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: #100e0c;
  color: var(--ink);
  overflow: hidden;
  overscroll-behavior: none;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
button:disabled { opacity: 0.4; cursor: default; }
#app { height: 100%; height: 100dvh; }

.shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 280px at 50% -40px, rgba(226, 177, 90, 0.16), transparent 55%),
    var(--bg);
  position: relative;
  min-height: 0;
}

header.top {
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid rgba(226, 177, 90, 0.28);
}
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand-actions { display: flex; gap: 8px; align-items: center; }
.brand { display: flex; flex-direction: column; min-width: 0; }
.brand strong {
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-size: 22px;
  letter-spacing: 0.14em;
  line-height: 1;
}
.brand span, .when, .sub, .due { color: var(--muted); font-size: 13px; }
.when { margin-top: 8px; }
.cash {
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-size: 40px;
  line-height: 1.05;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.cash.pulse { animation: cash-pop 0.45s ease; }
.depart {
  pointer-events: none;
  position: relative;
  z-index: 3;
}
.depart::after {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.depart-sold { animation: sold-away 0.42s ease forwards; }
.depart-sold::after { content: "Sold"; color: #1d7a42; }
.depart-bought { animation: sold-away 0.42s ease forwards; }
.depart-bought::after { content: "Bought"; color: #0e6e78; }
.depart-walked { animation: walk-away 0.46s ease forwards; }
.depart-walked::after { content: "Walked"; color: #a33b28; }
.depart-dealer { animation: dealer-sold 0.4s ease; }
.depart-dealer::after { content: "Sold"; color: #8a5a12; }
.settled.arrive { animation: dock-in 0.35s ease both; }
@keyframes sold-away {
  0% { transform: none; opacity: 1; }
  35% { transform: translateY(-6px); }
  100% { transform: translateY(22px) scale(0.97); opacity: 0; }
}
@keyframes walk-away {
  0% { transform: none; opacity: 1; }
  100% { transform: translateX(36px); opacity: 0; }
}
@keyframes dealer-sold {
  0% { transform: none; }
  40% { transform: translateY(-3px); filter: brightness(1.12); }
  100% { transform: none; filter: none; }
}
@keyframes cash-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.05); color: var(--up); }
  100% { transform: scale(1); }
}
@keyframes dock-in {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.sub { margin-top: 2px; font-variant-numeric: tabular-nums; }
.due { margin-top: 6px; }
.due.short { color: var(--down); }
.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(226, 177, 90, 0.4);
  background: transparent;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 18px;
}
.icon-btn svg { width: 18px; height: 18px; display: block; }
.icon-btn.on { background: rgba(226, 177, 90, 0.18); }

.view { flex: 1; overflow: auto; overflow-anchor: none; padding: 14px 14px 18px; min-height: 0; }
.day-bar { padding: 8px 14px 10px; }
nav.tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid rgba(226, 177, 90, 0.22);
  background: #120f0d;
  padding-bottom: env(safe-area-inset-bottom);
}
nav.tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-height: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  letter-spacing: 0.02em;
}
nav.tabs button svg { width: 18px; height: 18px; }
nav.tabs button.active { color: var(--gold); }

h2, h3, p { margin: 0; }
h2 {
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-size: 22px;
  font-weight: 600;
}
h3 { font-size: 15px; font-weight: 650; }
.section { margin-top: 16px; }
.lede, .quiet { color: var(--muted); font-size: 14px; line-height: 1.45; }
.stack { display: flex; flex-direction: column; gap: 10px; }

.panel, .ticket, .sheet, .ledger {
  border-radius: 16px;
}
.panel {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  padding: 12px;
}
.panel.gold { border-color: rgba(226, 177, 90, 0.35); }
.kicker {
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.spread { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.nums { font-variant-numeric: tabular-nums; }

.ticket {
  background: var(--paper);
  color: var(--paper-ink);
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.ticket.with-art {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  align-items: start;
}
.ticket-body { min-width: 0; }
.identity { display: flex; gap: 10px; align-items: center; min-width: 0; }
.identity h3 { margin: 0; }
.set-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--set, #e2b15a) 22%, transparent);
  color: var(--set, #e2b15a);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.35;
  text-transform: none;
}
.set-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--set, #e2b15a);
  display: inline-block;
  flex: none;
}
.album-need {
  display: inline-flex;
  margin: 6px 0 0;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--gold-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.album-need.held {
  background: transparent;
  color: #8a5a12;
  border: 1px solid rgba(138, 90, 18, 0.45);
  font-weight: 650;
}
.set-edge { border-left: 4px solid var(--set, #e2b15a); }
.set-quotes { display: flex; flex-direction: column; gap: 8px; }
.set-quote {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-left: 4px solid var(--set, #e2b15a);
  background: var(--bg-raise);
  border-radius: 14px;
  padding: 10px 12px;
  color: inherit;
}
.set-quote strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.slab-art { position: relative; display: inline-block; }
.slab-art b {
  position: absolute;
  right: -3px;
  bottom: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 8px;
  background: #1c140f;
  color: #f4efe6;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  border: 1px solid #f4efe6;
}
.slab-art.g-10 b { color: #f6e7b1; border-color: #f6e7b1; }
.slab-art.g-9 b { color: #e2b15a; border-color: #e2b15a; }
.slab-art.g-8 b { color: #8fd0a8; border-color: #8fd0a8; }
.slab-art.g-6 b { color: #c5bfb4; border-color: #c5bfb4; }
.grade-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #1c140f;
  color: #f4efe6;
  font-size: 11px;
  font-weight: 700;
}
.g-10 .grade-badge { color: #f6e7b1; }
.g-9 .grade-badge { color: #e2b15a; }
.g-8 .grade-badge { color: #8fd0a8; }
.g-6 .grade-badge { color: #c5bfb4; }
.slab-list { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.slab-line { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.slab-line button {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #8a5a12;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
}
.card-moves {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid rgba(226, 177, 90, 0.5);
  background: rgba(226, 177, 90, 0.14);
  color: var(--gold);
  border-radius: 999px;
  min-height: 32px;
  padding: 4px 8px 4px 12px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
}
.pill::after {
  content: "›";
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
}
.pill:active:not(:disabled) { filter: brightness(0.92); }
.slab-line button.pill {
  margin-left: 0;
  border: 1px solid rgba(226, 177, 90, 0.5);
  background: rgba(226, 177, 90, 0.14);
  color: var(--gold);
  text-decoration: none;
  padding: 2px 8px 2px 10px;
  min-height: 28px;
}
.set-quote span { color: var(--muted); font-size: 13px; }
.hide {
  border: 0;
  background: transparent;
  color: #8a5a12;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 8px 0 0;
  font-size: 13px;
}
.ticket header, .row-top, .spread { display: flex; justify-content: space-between; gap: 8px; }
.ticket header { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #7a6756; }
.ticket .who-collector { color: #8a5a12; }
.ticket .who-player { color: #215f93; }
.ticket .who-flipper { color: #6d4e8d; }
.ticket .who-seller { color: #0e6e78; }
.ticket p { margin-top: 6px; line-height: 1.35; }
.ticket .meta { margin-top: 8px; font-size: 13px; color: #5e5146; font-variant-numeric: tabular-nums; }
.ticket .trends { display: flex; gap: 12px; margin-top: 4px; font-size: 13px; font-variant-numeric: tabular-nums; }
.ticket .deal { margin-top: 2px; font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }
.ticket .flat { color: #7a6756; }
.ticket.sold { opacity: 0.55; }
.ticket .up { color: #1d7a42; }
.ticket .down { color: #a33b28; }

.actions, .row-actions, .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.actions { margin-top: 10px; }
.actions .btn { flex: 1; }

.btn {
  appearance: none;
  border: 0;
  background: var(--gold);
  color: var(--gold-ink);
  border-radius: 999px;
  min-height: 44px;
  padding: 10px 14px;
  font-weight: 650;
  transition: filter 0.12s ease;
}
.btn:active:not(:disabled) {
  filter: brightness(0.92);
}
.btn.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(244, 238, 230, 0.22);
}
.btn.buy-sealed { background: #1c7c96; color: #f4fbfd; }
.btn.buy-sealed.alt { background: #145868; color: #e7f6f8; }
.btn.buy-single { background: #3c5ea8; color: #f4f7ff; }
.btn.sell-pack { background: #c47b3a; color: #2a1c0a; }
.btn.sell-sealed { background: #e2b15a; color: #2a1c0a; }
.btn.sell-sealed.alt { background: #b8893a; color: #fff8ea; }
.btn.sell-single { background: #d4654a; color: #fff6f2; }
.btn.sell-single.alt { background: #a84b36; color: #fff1ec; }
.btn.bulk { background: #6d4e8d; color: #f8f4fc; }
.btn.haggle { background: #d0892b; color: #2a1c0a; }
.haggle-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.haggle-options .btn { flex: 1 1 calc(33% - 8px); min-width: 72px; padding: 8px 8px; font-variant-numeric: tabular-nums; }
.haggle-options .choose { flex: 1 1 100%; }
.stunt {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #24180f;
  color: #f6efe4;
}
.stunt p { margin: 0 0 8px; font-size: 13px; line-height: 1.35; }
.stunt .btn { width: 100%; }
.stunt.trade { display: flex; gap: 10px; align-items: flex-start; }
.stunt.trade .frame { flex: none; }
.stunt.trade .trade-copy { flex: 1; min-width: 0; }
.stunt.trade .album-need { margin: 0 0 8px; }
.trade-art {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  flex: none;
}
.trade-art:focus-visible { outline: 2px solid #e2b15a; outline-offset: 2px; border-radius: 8px; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.compare-side { min-width: 0; }
.compare-side .frame { display: block; width: 100%; }
.compare-side .art.compare { width: 100%; height: auto; aspect-ratio: 5 / 7; border-radius: 10px; }
.compare-side h3 { margin: 8px 0 4px; font-size: 16px; line-height: 1.2; }
.compare-side .rarity { margin: 0; font-size: 12px; }
.compare-side .set-pill { max-width: 100%; white-space: normal; }
.compare-side .trends { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.compare-side .compare-price { margin: 6px 0; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.compare-side .flavor { margin: 6px 0 0; font-size: 12px; }
.coin-stage { perspective: 600px; margin: 8px 0 4px; }
.coin {
  width: 108px;
  height: 108px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #241c16;
  background: radial-gradient(circle at 35% 30%, #ffe7a8, #e2b15a 55%, #8a5a12);
  box-shadow: inset 0 0 0 5px #8a5a12, 0 10px 22px rgba(0, 0, 0, 0.28);
  animation: coin-land 0.7s ease;
}
.coin.lost {
  background: radial-gradient(circle at 35% 30%, #f4f1ea, #b7b1a6 58%, #5c564e);
  box-shadow: inset 0 0 0 5px #5c564e, 0 10px 22px rgba(0, 0, 0, 0.28);
}
@keyframes coin-land {
  0% { transform: rotateY(0deg) scale(0.86); }
  70% { transform: rotateY(540deg) scale(1.04); }
  100% { transform: rotateY(720deg) scale(1); }
}
.price-field {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  border-radius: 12px;
  border: 1px solid rgba(36, 28, 22, 0.22);
  background: #fffaf3;
  color: var(--paper-ink);
  padding: 8px 12px;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}
.sheet .form-error { color: #a33b28; margin: 8px 0 0; }
.btn.open { background: #c4512e; color: #fff5f1; }
.btn.open.alt { background: #8d351c; color: #ffe8e0; }
.panel.buy-sealed { border-color: rgba(56, 168, 196, 0.55); }
.ticket.sell-pack { box-shadow: inset 4px 0 0 #c47b3a, var(--shadow); }
.ticket.sell-sealed { box-shadow: inset 4px 0 0 #e2b15a, var(--shadow); }
.pack-stock { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(36, 28, 22, 0.1); }
.sheet .stepper button { color: var(--paper-ink); border-color: rgba(36, 28, 22, 0.28); }
.ticket.sell-single { box-shadow: inset 4px 0 0 #d4654a, var(--shadow); }
.ticket.bulk { box-shadow: inset 4px 0 0 #8d6bb8, var(--shadow); }
.ticket.incoming { box-shadow: inset 4px 0 0 #3aa7b8, var(--shadow); }
.ticket .talk {
  margin: 8px 0 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f3eee4;
  border-left: 4px solid currentColor;
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-size: 15px;
  line-height: 1.35;
}
.ticket .talk.mood-easy { background: #e7f6ec; }
.ticket .talk.mood-warn { background: #f8f0dc; }
.ticket .talk.mood-hot { background: #fdecea; }
.ticket .talk.fresh { animation: talk-in 0.7s ease; }
.mood-easy { color: #1d7a42; }
.mood-warn { color: #8a5a12; }
.mood-hot { color: #a33b28; }
.ticket .btn.secondary, .sheet .btn.secondary, .ledger .btn.secondary {
  color: var(--paper-ink);
  border-color: rgba(36, 28, 22, 0.22);
}
.btn.block { width: 100%; }
.btn.small { min-height: 36px; padding: 6px 10px; font-size: 13px; }
.linkish {
  border: 0;
  background: transparent;
  color: var(--gold);
  padding: 8px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.chips { margin: 10px 0; }
.chips button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  min-height: 34px;
  padding: 4px 12px;
}
.chips button.on { color: var(--gold-ink); background: var(--gold); border-color: var(--gold); }

.meter { height: 8px; border-radius: 99px; background: rgba(244, 238, 230, 0.08); overflow: hidden; margin-top: 8px; }
.meter span { display: block; height: 100%; background: var(--gold); }
.album-set { margin-top: 14px; }
.album-set .meter { background: rgba(36, 28, 22, 0.1); }
.album-set:first-of-type { margin-top: 12px; }
.album-set .rarity { margin-top: 12px; }
.album-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  color: inherit;
}
.album-toggle h3 { margin: 0; }
.album-toggle .chev { color: #7a6756; font-size: 14px; }
.album-set.shut .album-body { display: none; }
.album-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 6px; }
.album-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #7a6756;
  font-size: 9px;
  line-height: 1.2;
}
.album-card {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: center;
  color: inherit;
  font-size: 9px;
  line-height: 1.2;
}
.album-art { position: relative; width: 100%; }
.album-art .album-card { display: block; }
.album-slot .art.sm,
.album-slot .art.slot { width: 100%; height: auto; aspect-ratio: 5 / 7; }
.floor-add {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
  padding: 8px 6px;
  border: 0;
  border-radius: 10px;
  background: var(--gold);
  color: var(--gold-ink);
  font-size: 14px;
  font-weight: 750;
  line-height: 1;
}
.floor-add:active { filter: brightness(0.92); }
.album-slot > span { display: block; margin-top: 3px; }
.album-slot:not(.have):not(.floor) .art { filter: grayscale(1) brightness(0.72); }
.album-slot.secret-unknown:not(.have) .art { filter: none; }
.art.mystery {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f6e7c4;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 50% 38%, rgba(226, 75, 58, 0.55), transparent 58%),
    #1a1410;
}
.album-slot.floor > span,
.album-slot.have > span { color: var(--ink); }
.album-slot.have .album-card {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-radius: 7px;
}
.album-flag {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  width: 22px;
  height: 18px;
  border-radius: 0 6px 0 8px;
  background: #1a1410;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
}
.album-flag::before { content: "✓"; }
.album-search {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  max-width: calc(100% - 24px);
  padding: 3px 5px;
  border-radius: 6px 0 8px 0;
  background: #1c7c96;
  color: #f4fbfd;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.1;
  text-transform: uppercase;
  pointer-events: none;
}
.album-slot .want {
  border: 0;
  background: transparent;
  color: #8a5a12;
  font-size: 10px;
  padding: 2px 0 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.album-slot .want.on {
  margin-top: 3px;
  padding: 3px 6px;
  border-radius: 999px;
  background: #1c7c96;
  color: #f4fbfd;
  font-weight: 750;
  text-decoration: none;
}
.album-slot .move {
  border: 0;
  background: transparent;
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 0 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cred {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f4ecdf;
  color: #241c16;
  font-size: 14px;
}
.shelf-line { display: flex; align-items: center; gap: 10px; margin: 2px 0 12px; }
.shelf-line > span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.shelf-line .meter { flex: 1; margin: 0; }
.stock-sealed { margin-bottom: 12px; }
.stock-sealed h3 { margin: 0; font-size: 16px; }
.stock-sealed .product {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.stock-sealed .product .quiet { margin: 2px 0 0; font-size: 13px; }
.stock-sealed .stepper { margin-top: 6px; }
.stock-actions { margin-top: 8px; }
.stock-actions .btn { min-height: 36px; padding: 6px 10px; font-size: 13px; }
.stock-case { margin-top: 12px; }
.stock-case .linkish { display: inline-block; }
.stock-rarity { margin: 16px 0 2px; }
.stock-card { align-items: start; }
.stock-card .quiet { margin: 2px 0 0; font-size: 13px; }
.stock-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.stock-tools .stepper { margin: 0; }
.stock-moves { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 0 100%; }
.stock-tools .pill { min-height: 28px; }
.meter.warn span { background: var(--down); }
.meter-label { margin-top: 6px; color: var(--muted); font-size: 12px; }

.row[data-act] { cursor: pointer; width: 100%; text-align: left; }
.row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.art {
  width: 52px;
  height: 72px;
  object-fit: cover;
  border-radius: 7px;
  background: #1a1410;
  display: block;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
}
.art.sm { width: 36px; height: 50px; border-radius: 5px; }
.art.pull { width: 88px; height: 124px; border-radius: 10px; }
.art.hero {
  width: auto;
  height: 230px;
  max-width: 100%;
  margin: 12px auto;
  border-radius: 14px;
}
.frame {
  display: inline-block;
  line-height: 0;
  vertical-align: top;
  border-radius: 8px;
}
.album-art .frame,
.frame:has(.hero) { display: block; }
.album-art .frame { width: 100%; }
.frame:has(.hero) { width: fit-content; margin: 12px auto; }
.frame .art.hero { margin: 0; }
.frame.r-common { box-shadow: 0 0 0 2px #d5dbe1, 0 0 0 4px #66727c; }
.frame.r-uncommon { box-shadow: 0 0 0 2px #e7fff1, 0 0 0 4px #178a4e, 0 0 10px rgba(23, 138, 78, 0.4); }
.frame.r-rare { box-shadow: 0 0 0 2px #e8f4ff, 0 0 0 4px #1d6fd0, 0 0 12px rgba(29, 111, 208, 0.45); }
.frame.r-mythic { box-shadow: 0 0 0 2px #f8e9ff, 0 0 0 4px #7a2ea8, 0 0 14px rgba(138, 46, 168, 0.55); }
.frame.r-legendary { box-shadow: 0 0 0 2px #fff4cc, 0 0 0 4px #e2b15a, 0 0 0 7px #8a5a12, 0 0 16px rgba(226, 177, 90, 0.65); }
.frame.r-secret { animation: secret-foil 2.6s ease-in-out infinite; }
.row .frame,
.settled .frame,
.missing .frame,
.loot-list .frame { animation: none; }
.row .frame.r-common,
.settled .frame.r-common,
.missing .frame.r-common,
.loot-list .frame.r-common { box-shadow: 0 0 0 2px #8b97a3; }
.row .frame.r-uncommon,
.settled .frame.r-uncommon,
.missing .frame.r-uncommon,
.loot-list .frame.r-uncommon { box-shadow: 0 0 0 2px #178a4e; }
.row .frame.r-rare,
.settled .frame.r-rare,
.missing .frame.r-rare,
.loot-list .frame.r-rare { box-shadow: 0 0 0 2px #1d6fd0; }
.row .frame.r-mythic,
.settled .frame.r-mythic,
.missing .frame.r-mythic,
.loot-list .frame.r-mythic { box-shadow: 0 0 0 2px #7a2ea8; }
.row .frame.r-legendary,
.settled .frame.r-legendary,
.missing .frame.r-legendary,
.loot-list .frame.r-legendary { box-shadow: 0 0 0 2px #e2b15a; }
.row .frame.r-secret,
.settled .frame.r-secret,
.missing .frame.r-secret,
.loot-list .frame.r-secret { box-shadow: 0 0 0 2px #e24b3a, 0 0 6px rgba(226, 75, 58, 0.45); }
@keyframes secret-foil {
  0%, 100% { box-shadow: 0 0 0 2px #fff6e4, 0 0 0 5px #e24b3a, 0 0 0 8px #f0c14b, 0 0 16px rgba(226, 75, 58, 0.7); }
  50% { box-shadow: 0 0 0 2px #ffe08a, 0 0 0 5px #fff4d2, 0 0 0 8px #e24b3a, 0 0 20px rgba(240, 193, 75, 0.85); }
}
@media (prefers-reduced-motion: reduce) {
  .frame.r-secret { animation: none; box-shadow: 0 0 0 2px #fff6e4, 0 0 0 5px #e24b3a, 0 0 0 8px #f0c14b, 0 0 16px rgba(226, 75, 58, 0.7); }
  .coin { animation: none; }
}
.settled-dock {
  border-top: 1px solid rgba(226, 177, 90, 0.22);
  background: #181410;
  max-height: 148px;
  overflow: auto;
  padding: 4px 10px 6px;
}
.settled-dock.open { max-height: 42%; }
.settled {
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid rgba(244, 238, 230, 0.08);
  background: transparent;
  color: var(--muted);
  min-height: 44px;
  padding: 4px 2px;
  text-align: left;
  font-size: 13px;
}
.settled .art { width: 28px; height: 38px; border-radius: 4px; }
.settled span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settled strong { color: var(--ink); font-weight: 650; }
.settled em { font-style: normal; color: var(--up); font-variant-numeric: tabular-nums; }
.settled.hot em { color: var(--down); }
.missing-stack {
  background: #161311;
  border: 1px dashed rgba(154, 140, 126, 0.45);
  border-radius: 14px;
  padding: 8px 10px 4px;
}
.missing-stack .kicker { color: #9a8c7e; }
.missing {
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: center;
  border: 0;
  border-top: 1px solid rgba(154, 140, 126, 0.18);
  background: transparent;
  color: #9a8c7e;
  min-height: 44px;
  padding: 4px 2px;
  text-align: left;
  font-size: 13px;
}
.missing .art { width: 28px; height: 38px; border-radius: 4px; opacity: 0.45; filter: grayscale(0.7); }
.missing span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.missing strong { color: #c8b8a6; font-weight: 650; }
.missing em { font-style: normal; color: #9a8c7e; letter-spacing: 0.04em; font-size: 11px; text-transform: uppercase; }
.ticket.out { opacity: 0.92; box-shadow: inset 4px 0 0 #6d6258, var(--shadow); }
.loot-list { list-style: none; margin: 8px 0 0; padding-left: 0; }
.loot-list li { display: flex; align-items: center; gap: 8px; }
.row.secret { box-shadow: inset 3px 0 0 #e24b3a; padding-left: 8px; }
.row.legendary { box-shadow: inset 3px 0 0 var(--legendary); padding-left: 8px; }
.row.mythic { box-shadow: inset 3px 0 0 var(--mythic); padding-left: 8px; }
.row.rare { box-shadow: inset 3px 0 0 var(--rare); padding-left: 8px; }
.row.uncommon { box-shadow: inset 3px 0 0 #178a4e; padding-left: 8px; }
.row.common { box-shadow: inset 3px 0 0 #8b97a3; padding-left: 8px; }
.name { font-weight: 650; }
.rarity { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.r-common { color: var(--common); }
.r-uncommon { color: var(--uncommon); }
.r-rare { color: var(--rare); }
.r-mythic { color: var(--mythic); }
.r-legendary { color: var(--legendary); }
.r-secret { color: #a33b28; }
.tag {
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--up);
  margin-left: 6px;
}
.tag.down { color: var(--down); }
.up { color: var(--up); }
.down { color: var(--down); }
.stepper { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; font-size: 13px; }
.stepper button {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}
.spark {
  border: 0;
  background: transparent;
  padding: 0;
  width: 84px;
}
.sparkline { width: 84px; height: 28px; display: block; }

.ledger {
  background: var(--paper);
  color: var(--paper-ink);
  padding: 14px;
}
.ledger .quiet, .sheet .quiet { color: #6d5e52; }
.line { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid rgba(36, 28, 22, 0.08); font-variant-numeric: tabular-nums; }
.line.miss { color: #a33b28; }
.pips { display: flex; gap: 6px; margin: 8px 0; }
.pips span { width: 14px; height: 14px; border-radius: 99px; border: 1px solid rgba(36, 28, 22, 0.3); }
.pips span.on { background: #a33b28; border-color: #a33b28; }
.upgrade { padding: 10px 0; border-bottom: 1px solid rgba(36, 28, 22, 0.08); }
.upgrade p { margin: 4px 0 8px; line-height: 1.4; }

.backdrop {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(10, 8, 7, 0.62);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet {
  position: relative;
  width: 100%;
  max-height: 88%;
  overflow: auto;
  background: var(--paper);
  color: var(--paper-ink);
  border-radius: 20px 20px 0 0;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow);
}
.sheet-x {
  position: sticky;
  top: 6px;
  float: right;
  z-index: 3;
  width: 36px;
  height: 36px;
  margin: 0 0 -36px;
  padding: 0;
  border: 1px solid rgba(36, 28, 22, 0.22);
  border-radius: 999px;
  background: #fffaf3;
  color: #241c16;
  font-size: 22px;
  line-height: 1;
}
.sheet-x:active { filter: brightness(0.95); }
.sheet-field {
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  margin-top: 8px;
  border-radius: 12px;
  border: 1px solid rgba(36, 28, 22, 0.22);
  background: #fffaf3;
  color: var(--paper-ink);
  padding: 8px 12px;
  font-size: 16px;
}
.board-switch { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.board-switch button {
  flex: 1 1 auto;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(36, 28, 22, 0.2);
  background: transparent;
  color: var(--paper-ink);
  font-size: 13px;
}
.board-switch button.on { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.board-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(36, 28, 22, 0.08);
}
.board-row.mine strong { color: #8a5a12; }
.stand { margin: 0 0 12px; font-size: 22px; font-weight: 700; }
.track-toggle { white-space: nowrap; }
.grab { width: 36px; height: 4px; border-radius: 99px; background: rgba(36, 28, 22, 0.16); margin: 4px auto 12px; }
.sheet h2 { font-size: 28px; }
.sheet .price-xl, .price-xl {
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-size: 36px;
  margin: 4px 0;
}
.flavor { font-family: Georgia, "Iowan Old Style", Palatino, serif; font-size: 16px; line-height: 1.4; margin: 8px 0 12px; }
.chart { width: 100%; height: auto; display: block; }
.chart-line { fill: none; stroke: #8a5a12; stroke-width: 2.4; }
.chart-fill { fill: rgba(226, 177, 90, 0.28); stroke: none; }
.chart-scale { display: flex; justify-content: space-between; color: #6d5e52; font-size: 12px; font-variant-numeric: tabular-nums; }
.event { padding: 8px 0; border-top: 1px solid rgba(36, 28, 22, 0.08); font-size: 14px; line-height: 1.4; }
.event small { display: block; color: #6d5e52; letter-spacing: 0.06em; text-transform: uppercase; font-size: 10px; }

.pack-card {
  display: grid;
  gap: 8px;
}
.pull {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 10px;
  align-items: center;
  background: #fffaf3;
  border-radius: 12px;
  padding: 8px;
  border: 1px solid rgba(36, 28, 22, 0.08);
  animation: rise 0.35s ease both;
}
.pull strong { display: block; font-size: 16px; }
.pull.r-legendary { background: #fff4dc; border-color: rgba(138, 90, 18, 0.45); }
.pull.r-secret {
  background: #fff6f2;
  border-color: rgba(163, 59, 40, 0.55);
  animation: rise 0.35s ease both, secret-land 1.2s ease 0.15s both;
}
.secret-sheet { background: #140e0c; color: #fff6e4; }
.secret-burst {
  position: relative;
  overflow: hidden;
  margin: 0 -4px;
  padding: 8px 8px 4px;
  border-radius: 18px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 38%, rgba(226, 75, 58, 0.5), transparent 46%),
    radial-gradient(circle at 50% 28%, #5c3418, #140e0c 74%);
}
.secret-rays {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 560px;
  height: 560px;
  margin: -280px 0 0 -280px;
  background: repeating-conic-gradient(from 0deg, rgba(240, 193, 75, 0.28) 0 7deg, transparent 7deg 18deg);
  animation: secret-spin 16s linear infinite;
  pointer-events: none;
}
.secret-flash {
  position: absolute;
  inset: 0;
  background: #fff8ea;
  animation: secret-flash 0.85s ease forwards;
  pointer-events: none;
}
.secret-stage { position: relative; z-index: 1; animation: secret-pop 0.9s cubic-bezier(0.16, 1.25, 0.36, 1) both; }
.sheet .secret-burst .kicker { color: #f0c14b; letter-spacing: 0.22em; }
.sheet .secret-burst h2 { color: #fff6e4; font-size: 32px; text-shadow: 0 0 22px rgba(226, 75, 58, 0.85); }
.sheet .secret-burst p { color: #f3e7c4; }
.secret-burst .frame { margin-top: 8px; }
@keyframes secret-spin { to { transform: rotate(360deg); } }
@keyframes secret-flash { 0% { opacity: 0.9; } 100% { opacity: 0; } }
@keyframes secret-pop {
  0% { opacity: 0; transform: scale(0.5) translateY(28px); filter: brightness(2.4); }
  58% { filter: brightness(1.2); }
  100% { opacity: 1; transform: none; filter: none; }
}
@keyframes secret-land {
  0% { box-shadow: 0 0 0 0 rgba(240, 193, 75, 0); }
  35% { box-shadow: 0 0 0 6px rgba(226, 75, 58, 0.28), 0 0 26px rgba(240, 193, 75, 0.75); }
  100% { box-shadow: 0 0 0 0 rgba(240, 193, 75, 0); }
}
.pull.r-mythic { background: #f8f0fb; }
.sealed-pack {
  height: 180px;
  border-radius: 16px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.2), transparent 40%),
    linear-gradient(165deg, var(--set, #e2b15a), #1c1411 72%);
  color: var(--gold);
  display: grid;
  place-items: center;
  text-align: center;
  font-family: Georgia, serif;
  letter-spacing: 0.08em;
}
.compare { margin: 12px 0; line-height: 1.45; }

.toast {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(78px + env(safe-area-inset-bottom));
  z-index: 6;
  margin: 0;
  pointer-events: none;
  background: #f4ecdf;
  color: #241c16;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 14px;
  box-shadow: var(--shadow);
}

.title-screen, .end-screen { justify-content: center; padding: 28px 22px; text-align: center; }
.title-inner, .end-inner { max-width: 360px; margin: 0 auto; }
.eyebrow { letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); font-size: 12px; }
.title-inner h1, .end-inner h1 {
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-size: 64px;
  letter-spacing: 0.12em;
  margin: 8px 0 0;
  font-weight: 600;
}
.tag { letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.title-inner .lede, .end-inner .lede { margin: 14px 0 18px; }
.mark { position: relative; width: 92px; height: 118px; margin: 18px auto; }
.cardlet { position: absolute; inset: 0; border-radius: 10px; box-shadow: var(--shadow); }
.cardlet.c1 { transform: rotate(-10deg); background: #2a231e; border: 1px solid rgba(226, 177, 90, 0.45); }
.cardlet.c2 { transform: rotate(8deg) translate(10px, 2px); background: #79b0e8; }
.cardlet.c3 { background: linear-gradient(#f7f1e6, #e7d3a4); }

.help ul, .sheet ul { margin: 8px 0 0; padding-left: 18px; }
.help li, .sheet li { margin: 8px 0; line-height: 1.4; }
.history-row { font-size: 13px; padding: 6px 0; border-bottom: 1px solid rgba(36, 28, 22, 0.08); }

@keyframes talk-in {
  0% { box-shadow: 0 0 0 3px rgba(208, 137, 43, 0.7); }
  100% { box-shadow: 0 0 0 0 rgba(208, 137, 43, 0); }
}
@keyframes rise {
  from { transform: translateY(6px); }
  to { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pull, .depart, .depart::after, .cash.pulse, .settled.arrive, .ticket .talk.fresh, .btn,
  .secret-rays, .secret-flash, .secret-stage { animation: none; transition: none; }
}
@media (min-width: 760px) {
  body {
    display: grid;
    place-items: center;
    background:
      radial-gradient(800px 400px at 50% 0%, #3a2c22, transparent 60%),
      #0c0a09;
  }
  #app {
    width: 420px;
    height: min(900px, 100dvh);
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(226, 177, 90, 0.28);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  }
}
