/* Unboxd: shipping warehouse. Corrugated kraft, paper labels, rubber stamps, packing tape. */
:root {
  --kraft: #c49a64; --kraft-d: #a47c48; --kraft-dd: #7d5c34; --kraft-l: #dcbb88;
  --paper: #f6eddb; --paper-2: #ece0c6; --paper-3: #e0d0b0;
  --ink: #2a2018; --ink-2: #5c4b38; --ink-3: #8a775e;
  --stamp: #c2352b; --tape: #e6d3a4; --ok: #3f7a35; --blue: #3a6ea8; --gold: #d8a32a;
  --C: #8d8478; --U: #4f8a3c; --R: #3a6ea8; --E: #7d4aa8; --L: #d08a1c; --M: #c2352b;
  --px: 3px;
  --head: 'Silkscreen', ui-monospace, monospace;
  --body: 'Pixelify Sans', ui-sans-serif, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--kraft); }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font: 16px/1.35 var(--body);
  background-color: var(--kraft);
  background-image: repeating-linear-gradient(90deg, rgba(0,0,0,.045) 0 2px, transparent 2px 9px);
  -webkit-font-smoothing: none;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
img.spr { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }
[hidden] { display: none !important; }

/* ---------- header */
.top { display: flex; align-items: center; gap: 18px; padding: 10px 18px; background: var(--ink); color: var(--paper); flex-wrap: wrap; }
.logo { font: 700 24px/1 var(--head); letter-spacing: 2px; text-decoration: none; display: flex; align-items: center; gap: 10px; }
.logo-box { width: 22px; height: 18px; background: var(--kraft); box-shadow: inset 0 5px 0 var(--kraft-l), inset 0 -3px 0 var(--kraft-d); position: relative; }
.logo-box::after { content: ''; position: absolute; left: 9px; top: 0; width: 4px; height: 18px; background: var(--tape); }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.tabs a { font: 400 13px/1 var(--head); text-decoration: none; padding: 9px 11px 8px; color: #d8cbb0; position: relative; }
.tabs a:hover { color: var(--paper); }
.tabs a.on { background: var(--paper); color: var(--ink); }
.pip { position: absolute; top: 3px; right: 2px; width: 7px; height: 7px; background: var(--stamp); }
.me { display: flex; align-items: center; gap: 10px; font: 400 14px/1 var(--head); }
.me .coins { background: var(--paper); color: var(--ink); padding: 6px 10px 5px; }
.me button { background: none; border: 2px solid #5c4b38; color: var(--paper); padding: 5px 8px 4px; cursor: pointer; font: 400 12px/1 var(--head); }
.me button:hover { border-color: var(--paper); }
.coin { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-family: var(--head); }
.coin svg { width: 12px; height: 12px; flex: none; }

/* ---------- ticker (receipt roll) */
.ticker { display: flex; align-items: stretch; background: var(--paper); border-bottom: 3px solid var(--ink); height: 46px; overflow: hidden; }
.ticker-tag { font: 700 12px/1 var(--head); background: var(--stamp); color: var(--paper); padding: 0 12px; display: flex; align-items: center; white-space: nowrap; }
.ticker-roll { display: flex; gap: 0; overflow: hidden; flex: 1; align-items: center; }
.drop { display: flex; align-items: center; gap: 6px; padding: 0 14px 0 8px; border-right: 2px dashed var(--paper-3); white-space: nowrap; font-size: 14px; animation: slidein .4s steps(4); }
.drop img { width: 32px; height: 32px; }
.drop b { font-weight: 600; }
.drop .t { font: 400 11px/1 var(--head); }
@keyframes slidein { from { transform: translateX(-40px); opacity: 0; } }
.ticker-empty { padding: 0 14px; color: var(--ink-3); font-size: 14px; }

/* ---------- layout */
main { max-width: 1240px; margin: 0 auto; padding: 22px 18px 80px; }
h1, h2, h3 { font-family: var(--head); font-weight: 700; margin: 0; letter-spacing: .5px; }
h1 { font-size: 26px; } h2 { font-size: 18px; } h3 { font-size: 14px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.mt { margin-top: 14px; } .mt2 { margin-top: 24px; }
.cols { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }

/* paper panel with packing tape corner */
.panel { background: var(--paper); border: 3px solid var(--ink); box-shadow: 5px 5px 0 rgba(42,32,24,.35); padding: 16px; position: relative; }
.panel.tape::before { content: ''; position: absolute; top: -10px; left: 50%; width: 90px; height: 20px; margin-left: -45px; background: var(--tape); opacity: .9; transform: rotate(-2deg); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.panel + .panel { margin-top: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { color: var(--ink); }
.page-head p { margin: 4px 0 0; color: var(--ink-2); }

/* ---------- buttons */
.btn { font: 700 13px/1 var(--head); background: var(--paper); color: var(--ink); border: 3px solid var(--ink); padding: 10px 14px 9px; cursor: pointer; box-shadow: 3px 3px 0 var(--ink); text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
.btn:hover { background: #fff8ea; }
.btn:active { transform: translate(3px, 3px); box-shadow: none; }
.btn.go { background: var(--stamp); color: var(--paper); }
.btn.go:hover { background: #d4463b; }
.btn.dark { background: var(--ink); color: var(--paper); }
.btn.sm { padding: 6px 9px 5px; font-size: 11px; box-shadow: 2px 2px 0 var(--ink); border-width: 2px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: 3px 3px 0 var(--ink); }
.seg { display: inline-flex; border: 2px solid var(--ink); }
.seg button { border: 0; background: var(--paper); padding: 6px 10px 5px; font: 400 12px/1 var(--head); cursor: pointer; }
.seg button + button { border-left: 2px solid var(--ink); }
.seg button.on { background: var(--ink); color: var(--paper); }
input.field, select.field { background: #fffaf0; border: 2px solid var(--ink); padding: 8px 9px; min-width: 0; }
input.field:focus, select.field:focus { outline: 3px solid var(--gold); outline-offset: 0; }
label.chk { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; font-size: 14px; }

/* stamp label (rarity) */
.stamp { display: inline-block; font: 700 10px/1 var(--head); padding: 3px 5px 2px; border: 2px solid currentColor; text-transform: uppercase; letter-spacing: .5px; transform: rotate(-3deg); background: rgba(255,255,255,.4); }
.t-C { color: var(--C); } .t-U { color: var(--U); } .t-R { color: var(--R); } .t-E { color: var(--E); } .t-L { color: var(--L); } .t-M { color: var(--M); }
.shiny-tag { color: #b8860b; background: #fff3c4; }

/* ---------- case cards */
.case-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.case-card { background: var(--paper); border: 3px solid var(--ink); box-shadow: 5px 5px 0 rgba(42,32,24,.35); padding: 12px 14px 14px; cursor: pointer; text-decoration: none; display: flex; flex-direction: column; gap: 6px; position: relative; transition: transform .08s steps(2); }
.case-card:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 rgba(42,32,24,.35); }
.case-card .box { width: 128px; height: 128px; margin: 0 auto; }
.box img { width: 100%; height: 100%; }
.case-card h3 { font-size: 15px; }
.case-card .lbl { font-size: 13px; color: var(--ink-2); }
.case-card .price { font: 700 16px/1 var(--head); }
.case-card .flag { position: absolute; top: 10px; right: -6px; font: 700 10px/1 var(--head); background: var(--stamp); color: var(--paper); padding: 4px 7px 3px; }
.case-card .flag.vault { background: var(--ink); }
.case-card.vaulted .box { filter: grayscale(.8) brightness(.9); }
.barcode { height: 14px; background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 3px, var(--ink) 3px 4px, transparent 4px 7px, var(--ink) 7px 10px, transparent 10px 11px); opacity: .75; }

/* ---------- daily strip */
.daily { display: flex; align-items: center; gap: 16px; background: var(--ink); color: var(--paper); padding: 12px 16px; margin-bottom: 20px; flex-wrap: wrap; }
.daily b { font-family: var(--head); }
.daily .btn { box-shadow: 3px 3px 0 #000; }

/* ---------- case page */
.case-top { display: grid; grid-template-columns: 220px 1fr; gap: 22px; align-items: center; }
@media (max-width: 700px) { .case-top { grid-template-columns: 1fr; } }
.case-top .box { width: 200px; height: 200px; }
.stat-line { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); margin: 8px 0 14px; }
.stat-line b { color: var(--ink); font-family: var(--head); font-size: 13px; }
.contents { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; }
.odds-cell { background: #fffaf0; border: 2px solid var(--ink); padding: 6px 6px 8px; text-align: center; position: relative; border-bottom-width: 6px; }
.odds-cell img { width: 80px; height: 80px; margin: 0 auto; }
.odds-cell .nm { font-size: 13px; line-height: 1.15; min-height: 30px; display: flex; align-items: center; justify-content: center; }
.odds-cell .od { font: 400 11px/1 var(--head); color: var(--ink-2); margin-top: 4px; }
.bb-C { border-bottom-color: var(--C); } .bb-U { border-bottom-color: var(--U); } .bb-R { border-bottom-color: var(--R); } .bb-E { border-bottom-color: var(--E); } .bb-L { border-bottom-color: var(--L); } .bb-M { border-bottom-color: var(--M); }

/* ---------- reel (conveyor belt) */
.reels { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.reel { position: relative; height: 128px; background: #3a2e24; border: 3px solid var(--ink); overflow: hidden; }
.reel::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 2px, transparent 2px 24px); pointer-events: none; z-index: 1; }
.reel .strip { position: absolute; top: 10px; left: 0; display: flex; gap: 8px; will-change: transform; }
.reel .tile { width: 104px; height: 104px; flex: none; background: var(--paper-2); border-bottom: 8px solid; display: flex; align-items: center; justify-content: center; position: relative; }
.reel .tile img { width: 88px; height: 88px; }
.reel .mark { position: absolute; top: 0; bottom: 0; left: 50%; width: 4px; margin-left: -2px; background: var(--stamp); z-index: 3; box-shadow: 0 0 0 2px var(--ink); }
.reel .mark::before, .reel .mark::after { content: ''; position: absolute; left: -7px; border: 9px solid transparent; }
.reel .mark::before { top: -2px; border-top-color: var(--stamp); }
.reel .mark::after { bottom: -2px; border-bottom-color: var(--stamp); }
.reel.v { height: 330px; }
.reel.v .strip { flex-direction: column; left: 50%; top: 0; margin-left: -52px; }
.reel.v .mark { left: 0; right: 0; top: 50%; bottom: auto; width: auto; height: 4px; margin: -2px 0 0; }
.reel.v .mark::before, .reel.v .mark::after { display: none; }
.tile.win { animation: win .7s steps(3) 3; }
@keyframes win { 50% { background: #fff; } }
.bt-C { border-color: var(--C) !important; } .bt-U { border-color: var(--U) !important; } .bt-R { border-color: var(--R) !important; } .bt-E { border-color: var(--E) !important; } .bt-L { border-color: var(--L) !important; } .bt-M { border-color: var(--M) !important; }

/* ---------- item cards */
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.item { background: #fffaf0; border: 2px solid var(--ink); border-bottom-width: 7px; padding: 8px 8px 7px; position: relative; cursor: pointer; text-align: center; user-select: none; }
.item:hover { background: #fff; }
.item img { width: 96px; height: 96px; margin: 0 auto; }
.item .nm { font-size: 14px; line-height: 1.15; min-height: 32px; display: flex; align-items: center; justify-content: center; }
.item .meta { display: flex; justify-content: space-between; align-items: center; font: 400 11px/1 var(--head); margin-top: 5px; color: var(--ink-2); }
.item .ser { position: absolute; top: 5px; left: 6px; font: 400 10px/1 var(--head); color: var(--ink-3); }
.item .ser.low { color: var(--stamp); }
.item .fav { position: absolute; top: 4px; right: 6px; font: 700 13px/1 var(--head); color: var(--gold); }
.item .lock { position: absolute; top: 34px; right: -4px; font: 700 9px/1 var(--head); background: var(--ink); color: var(--paper); padding: 3px 4px 2px; }
.item.sel { outline: 4px solid var(--stamp); outline-offset: -1px; background: #fff3e8; }
.item.sm { padding: 4px 4px 5px; border-bottom-width: 5px; }
.item.sm img { width: 56px; height: 56px; }
.item.sm .nm { font-size: 12px; min-height: 26px; }
.items.sm { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.shiny-wrap { position: relative; }
.shiny-wrap::after { content: ''; position: absolute; inset: 0; background:
  radial-gradient(circle at 20% 25%, #fff6b0 0 2px, transparent 3px), radial-gradient(circle at 78% 30%, #fff 0 2px, transparent 3px),
  radial-gradient(circle at 70% 78%, #fff6b0 0 2px, transparent 3px), radial-gradient(circle at 25% 80%, #fff 0 1px, transparent 2px);
  animation: twinkle 1.2s steps(2) infinite; pointer-events: none; }
@keyframes twinkle { 50% { opacity: .2; } }

/* ---------- reveal */
.reveal { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin: 6px 0 4px; }
.reveal .item { width: 168px; animation: pop .35s steps(4); }
.reveal .item img { width: 128px; height: 128px; }
@keyframes pop { from { transform: scale(.4); } }
.reveal-actions { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }

/* ---------- lists / tables */
.list { display: flex; flex-direction: column; gap: 10px; }
.lrow { display: flex; align-items: center; gap: 12px; background: #fffaf0; border: 2px solid var(--ink); padding: 8px 10px; flex-wrap: wrap; }
.lrow img { width: 48px; height: 48px; }
.thumbs { display: flex; gap: 2px; flex-wrap: wrap; }
.thumbs img { width: 36px; height: 36px; }
.board { width: 100%; border-collapse: collapse; font-size: 15px; }
.board td { padding: 6px 4px; border-bottom: 2px dashed var(--paper-3); }
.board td:first-child { font-family: var(--head); width: 30px; color: var(--ink-3); }
.board td.r { text-align: right; font-family: var(--head); font-size: 13px; }
.tag { font: 700 10px/1 var(--head); padding: 3px 5px 2px; background: var(--ink); color: var(--paper); text-transform: uppercase; }
.tag.red { background: var(--stamp); } .tag.green { background: var(--ok); } .tag.gold { background: var(--gold); color: var(--ink); }

/* ---------- battles */
.battle-stage { display: grid; gap: 12px; }
.seat { background: var(--paper); border: 3px solid var(--ink); padding: 10px; text-align: center; }
.seat h3 { font-size: 13px; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .tot { font: 700 18px/1 var(--head); margin: 8px 0 2px; }
.seat.winner { background: #fff3c4; box-shadow: 0 0 0 4px var(--gold); }
.seat.loser { opacity: .7; }
.seat .pulled { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; margin-top: 6px; min-height: 40px; }
.seat .pulled img { width: 36px; height: 36px; }
.round-bar { font: 700 14px/1 var(--head); text-align: center; margin-bottom: 10px; }
.banner { font: 700 22px/1.1 var(--head); text-align: center; padding: 14px; background: var(--ink); color: var(--paper); margin-top: 12px; }
.case-pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.case-pick button { background: #fffaf0; border: 2px solid var(--ink); padding: 4px 2px 3px; cursor: pointer; font: 400 9px/1.1 var(--head); }
.case-pick button img { width: 48px; height: 48px; margin: 0 auto; }
.case-pick button:disabled { opacity: .35; cursor: not-allowed; }
.picked { display: flex; flex-wrap: wrap; gap: 4px; min-height: 52px; background: var(--paper-2); border: 2px dashed var(--ink-3); padding: 4px; }
.picked button { background: none; border: 0; padding: 0; cursor: pointer; }
.picked img { width: 44px; height: 44px; }

/* ---------- auctions */
.auc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.auc { background: var(--paper); border: 3px solid var(--ink); padding: 12px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.auc.house { background: #fff3c4; }
.auc .art { display: flex; justify-content: center; }
.auc .art img { width: 112px; height: 112px; }
.auc .bid { font: 700 18px/1 var(--head); }
.auc .clock { font: 700 13px/1 var(--head); }
.auc .clock.hot { color: var(--stamp); animation: twinkle .8s steps(2) infinite; }
.auc .bidrow { display: flex; gap: 6px; }
.auc .bidrow input { width: 100%; }

/* ---------- trades */
.trade { background: #fffaf0; border: 2px solid var(--ink); padding: 10px; }
.trade-sides { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: start; margin-top: 8px; }
.trade-sides .arrow { font: 700 18px/1 var(--head); padding-top: 18px; }
@media (max-width: 640px) { .trade-sides { grid-template-columns: 1fr; } .trade-sides .arrow { display: none; } }
.side h3 { font-size: 11px; color: var(--ink-2); margin-bottom: 4px; }
.side .empty { font-size: 13px; color: var(--ink-3); padding: 8px 0; }
.tw-ready { outline: 4px solid var(--ok); }

/* ---------- index */
.dex-case h2 { display: flex; justify-content: space-between; align-items: baseline; }
.dex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 10px; }
.dex-cell { background: #fffaf0; border: 2px solid var(--ink); border-bottom-width: 5px; padding: 4px; text-align: center; cursor: pointer; }
.dex-cell img { width: 64px; height: 64px; margin: 0 auto; }
.dex-cell .nm { font-size: 11px; line-height: 1.1; min-height: 24px; }
.dex-cell.miss { background: var(--paper-2); border-bottom-color: var(--ink-3) !important; }
.dex-cell.miss .nm { color: var(--ink-3); }
.meter { height: 12px; background: var(--paper-3); border: 2px solid var(--ink); }
.meter > i { display: block; height: 100%; background: var(--ok); }

/* ---------- packing line */
.line { position: relative; height: 260px; background: #3a2e24; border: 3px solid var(--ink); overflow: hidden; user-select: none; cursor: pointer; }
.line .belt { position: absolute; left: 0; right: 0; bottom: 40px; height: 26px; background: repeating-linear-gradient(90deg, #5a4a3a 0 18px, #4a3c2e 18px 22px); animation: belt 1s linear infinite; }
@keyframes belt { to { background-position: 22px 0; } }
.line .pbox { position: absolute; left: 50%; bottom: 66px; width: 150px; height: 120px; margin-left: -75px; background: var(--kraft); box-shadow: inset 0 18px 0 var(--kraft-l), inset 0 -6px 0 var(--kraft-d), 0 0 0 3px var(--ink); }
.line .pbox .tp { position: absolute; left: 0; right: 0; top: 50px; height: 0; background: var(--tape); transition: height .05s; }
.line .pbox.taped .tp { height: 22px; }
.line .pbox.bump { animation: bump .12s steps(2); }
@keyframes bump { 50% { transform: translateY(4px) scaleX(1.03); } }
.line .pop { position: absolute; font: 700 18px/1 var(--head); color: var(--tape); pointer-events: none; animation: rise .8s steps(6) forwards; }
@keyframes rise { to { transform: translateY(-60px); opacity: 0; } }
.line .hint { position: absolute; top: 14px; left: 0; right: 0; text-align: center; color: var(--paper-3); font: 400 13px/1 var(--head); }
.up { display: flex; gap: 14px; align-items: center; background: #fffaf0; border: 2px solid var(--ink); padding: 10px 12px; }
.up + .up { margin-top: 10px; }
.up .lvl { font: 700 22px/1 var(--head); width: 52px; text-align: center; }

/* ---------- modal + toast */
.scrim { position: fixed; inset: 0; background: rgba(30,22,16,.6); display: flex; align-items: flex-start; justify-content: center; z-index: 50; padding: 6vh 14px 20px; overflow-y: auto; }
.modal { background: var(--paper); border: 3px solid var(--ink); box-shadow: 8px 8px 0 rgba(0,0,0,.4); width: min(560px, 100%); padding: 20px; position: relative; }
.modal.wide { width: min(980px, 100%); }
.modal .x { position: absolute; top: 8px; right: 10px; background: none; border: 0; font: 700 18px/1 var(--head); cursor: pointer; }
.modal h2 { margin-bottom: 12px; }
#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; align-items: center; }
.toast { background: var(--ink); color: var(--paper); padding: 10px 14px 9px; font-size: 15px; border-left: 6px solid var(--gold); box-shadow: 4px 4px 0 rgba(0,0,0,.35); animation: pop .25s steps(3); max-width: 90vw; }
.toast.err { border-left-color: var(--stamp); }
.code { font: 700 22px/1 var(--head); letter-spacing: 2px; background: #fffaf0; border: 2px dashed var(--ink); padding: 12px; text-align: center; user-select: all; }
.big-item { display: grid; grid-template-columns: 200px 1fr; gap: 18px; }
.big-item img { width: 192px; height: 192px; }
@media (max-width: 560px) { .big-item { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 15px; margin: 10px 0; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; font-family: var(--head); font-size: 13px; }
.empty-state { text-align: center; padding: 30px 10px; color: var(--ink-2); }
@media (max-width: 640px) { main { padding: 16px 12px 60px; } .top { gap: 10px; padding: 8px 12px; } .tabs a { padding: 8px 7px 7px; font-size: 11px; } h1 { font-size: 21px; } }
