/* PACK LUCK · packluck.css
   Candlelit card-shop look: ink-black wood, warm gold, parchment text.
   Sections: tokens · base · buttons · boot · bar & tabs · cards & foils · thumbs ·
   packs · boxes · scene · summary · sheets · views · toasts · desktop */

/* ---------- tokens ---------- */
:root {
  --ink: #0c0805;
  --ink2: #140e09;
  --panel: #1a130c;
  --panel2: #22190f;
  --panel3: #2b2014;
  --line: #3a2a1a;
  --line2: #5a4128;
  --gold: #e8b65a;
  --gold2: #ffe3a1;
  --gold3: #a8742a;
  --text: #efe4cc;
  --muted: #a8977c;
  --dim: #7a6a51;
  --good: #8be09a;
  --bad: #ff8a72;
  --r-c: #d6cfbf;
  --r-u: #bcd4e3;
  --r-r: #f2c95e;
  --r-m: #ff8a3d;
  --barh: 56px;
  --tabh: 62px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --display: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --flav: 'Spectral', Georgia, serif;
  --goldtext: linear-gradient(180deg, #fff6d6 0%, #f3cf7a 38%, #b07a24 52%, #f7d886 70%, #fff0c4 100%);
  --cw: min(76vw, 400px, calc((100vh - 290px) * 0.7176));
  color-scheme: dark;
}
@supports (height: 100dvh) {
  :root { --cw: min(76vw, 400px, calc((100dvh - 290px) * 0.7176)); }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255, 180, 90, 0.16), transparent 70%),
    radial-gradient(ellipse 60% 60% at 100% 100%, rgba(120, 60, 20, 0.12), transparent 70%),
    linear-gradient(180deg, #120c07, var(--ink) 40%);
  color: var(--text);
  font: 400 15px/1.45 var(--ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  font-variant-numeric: tabular-nums;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: var(--tex-grain);
  background-size: 160px;
  opacity: 0.022;
  z-index: 1;
}
/* a blended full-screen layer makes Safari redraw everything under it, so the grain is a plain overlay and sits out the pack scene */
body.in-scene::before { display: none; }
img { -webkit-user-drag: none; user-select: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:disabled { cursor: default; }
a { color: var(--gold); }
svg { display: block; }
input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

#fxc { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  font: 700 14px/1 var(--ui);
  letter-spacing: 0.01em;
  color: var(--text);
  background: linear-gradient(180deg, #33261a, #241a10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 1px var(--line2), 0 6px 16px -8px rgba(0, 0, 0, 0.8);
  transition: transform 0.12s, filter 0.2s, opacity 0.2s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.4; filter: saturate(0.4); }
.btn.gold {
  color: #2a1704;
  background: linear-gradient(180deg, #ffe7a6 0%, #f0bf5c 48%, #c98d33 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 -2px 0 rgba(120, 70, 10, 0.35), 0 0 0 1px #8a5a17, 0 8px 22px -8px rgba(232, 160, 60, 0.6);
  text-shadow: 0 1px 0 rgba(255, 240, 200, 0.5);
}
.btn.ghost { background: rgba(255, 255, 255, 0.03); box-shadow: inset 0 0 0 1px var(--line2); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.wide { width: 100%; }
.btn.danger { color: var(--bad); }

/* ---------- boot ---------- */
#boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  background:
    radial-gradient(ellipse 60% 45% at 50% 40%, rgba(255, 170, 80, 0.2), transparent 70%),
    var(--ink);
  transition: opacity 0.6s, transform 0.6s;
}
#boot.gone { opacity: 0; transform: scale(1.04); pointer-events: none; }
.bt-fan { position: relative; width: 120px; height: 150px; margin-bottom: 18px; }
.bt-fan span {
  position: absolute;
  left: 50%;
  top: 0;
  width: 96px;
  aspect-ratio: 488 / 680;
  margin-left: -48px;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
  transform-origin: 50% 120%;
  animation: fanIn 1.4s cubic-bezier(0.2, 0.8, 0.2, 1) both, fanBob 3s ease-in-out 1.4s infinite;
}
.bt-fan span img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bt-fan span:nth-child(1) { --r: -16deg; }
.bt-fan span:nth-child(2) { --r: 0deg; animation-delay: 0.1s, 1.5s; }
.bt-fan span:nth-child(3) { --r: 16deg; animation-delay: 0.2s, 1.6s; }
@keyframes fanIn { from { transform: rotate(0) translateY(30px); opacity: 0; } to { transform: rotate(var(--r)); opacity: 1; } }
@keyframes fanBob { 50% { transform: rotate(calc(var(--r) * 1.15)) translateY(-4px); } }
.bt-logo, .bar-brand, .intro-logo {
  font: 900 64px/1 var(--display);
  letter-spacing: 0.14em;
  background: var(--goldtext);
  background-size: 100% 220%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 0 rgba(60, 30, 5, 0.8)) drop-shadow(0 10px 30px rgba(232, 160, 60, 0.35));
  animation: goldShift 5s ease-in-out infinite;
}
@keyframes goldShift { 50% { background-position: 0 100%; } }
.bt-tag { font: 500 13px var(--ui); letter-spacing: 0.4em; text-transform: uppercase; color: var(--muted); margin-top: -2px; }
.bt-bar { width: min(280px, 70vw); height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.07); overflow: hidden; margin-top: 26px; }
.bt-bar i { display: block; height: 100%; width: calc(var(--k, 0) * 100%); background: linear-gradient(90deg, var(--gold3), var(--gold2)); transition: width 0.3s; border-radius: 4px; box-shadow: 0 0 12px var(--gold); }
.bt-status { font-size: 13px; color: var(--muted); min-height: 1.4em; text-align: center; }
.bt-err { text-align: center; max-width: 360px; display: grid; gap: 14px; justify-items: center; }
.bt-err p { color: var(--bad); font-size: 14px; }

/* ---------- top bar ---------- */
#app { position: fixed; inset: 0; z-index: 2; }
.bar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: calc(var(--barh) + var(--sat));
  padding: var(--sat) calc(12px + var(--sar)) 0 calc(14px + var(--sal));
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10;
  background: linear-gradient(180deg, rgba(16, 11, 7, 0.97), rgba(16, 11, 7, 0.88));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(232, 182, 90, 0.14);
}
.bar-brand { font-size: 22px; letter-spacing: 0.16em; margin-right: auto; filter: drop-shadow(0 2px 0 rgba(60, 30, 5, 0.8)); }
.bar-lv { position: relative; width: 36px; height: 36px; display: grid; place-items: center; }
.bar-lv svg { position: absolute; inset: 0; width: 36px; height: 36px; }
.bar-lv .ring-bg { fill: rgba(255, 255, 255, 0.04); stroke: rgba(255, 255, 255, 0.1); stroke-width: 3; }
.bar-lv .ring-fg { transform: rotate(-90deg); transform-origin: 50% 50%; filter: none; fill: none; stroke: var(--gold); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 94.25; stroke-dashoffset: calc(94.25 * (1 - var(--k, 0))); transition: stroke-dashoffset 0.6s; }
.bar-lv b { position: relative; font: 800 13px var(--ui); color: var(--gold2); }
.bar-day { display: flex; align-items: center; gap: 6px; font: 600 12px var(--ui); color: var(--muted); white-space: nowrap; }
.bar-day i { width: 14px; height: 14px; border-radius: 50%; background: conic-gradient(var(--gold) calc(var(--k, 0) * 360deg), rgba(255, 255, 255, 0.1) 0); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.04); }
.bar-cash {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px 0 6px;
  border-radius: 20px;
  background: linear-gradient(180deg, #2a1f13, #1b140c);
  box-shadow: inset 0 0 0 1px var(--line2), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.bar-cash .coin { width: 24px; height: 24px; }
.bar-cash .coin svg { width: 24px; height: 24px; }
.bar-cash b { font: 800 15px var(--ui); color: var(--gold2); min-width: 64px; text-align: right; }
.bar-cash.bump .coin { animation: coinFlip 0.6s; }
.bar-cash.bump b { animation: cashUp 0.7s; }
.bar-cash.drop b { animation: cashDown 0.6s; }
@keyframes coinFlip { 50% { transform: rotateY(180deg) scale(1.2); } }
@keyframes cashUp { 30% { color: #fff; text-shadow: 0 0 12px var(--gold); } }
@keyframes cashDown { 30% { color: var(--bad); } }
.bar-gear { width: 36px; height: 36px; display: grid; place-items: center; color: var(--muted); border-radius: 50%; }
.bar-gear svg { width: 22px; height: 22px; }

/* ---------- tabs ---------- */
.tabs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--tabh) + var(--sab));
  padding: 0 var(--sar) var(--sab) var(--sal);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 10;
  background: linear-gradient(0deg, rgba(14, 10, 6, 0.98), rgba(18, 13, 8, 0.92));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(232, 182, 90, 0.14);
}
.tabs button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--dim); font: 600 11px var(--ui); letter-spacing: 0.02em; }
.tabs .ic svg { width: 24px; height: 24px; }
.tabs button.on { color: var(--gold2); }
.tabs button.on .ic { filter: drop-shadow(0 0 8px rgba(232, 182, 90, 0.6)); }
.tabs button.on::before { content: ''; position: absolute; top: -1px; left: 30%; right: 30%; height: 2px; border-radius: 2px; background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.badge { position: absolute; top: 7px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #d9442b; color: #fff; font: 800 11px/18px var(--ui); font-style: normal; text-align: center; box-shadow: 0 0 0 2px var(--ink); }

/* ---------- view ---------- */
#view {
  position: absolute;
  top: calc(var(--barh) + var(--sat));
  bottom: calc(var(--tabh) + var(--sab));
  left: 0;
  right: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px calc(16px + var(--sar)) 40px calc(16px + var(--sal));
}
#view > * { max-width: 1180px; margin-left: auto; margin-right: auto; }
.sec { display: flex; align-items: center; gap: 10px; margin: 26px auto 12px; font: 700 15px var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.sec::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line2), transparent); }
.sec .lock, .lock { display: inline-flex; align-items: center; gap: 4px; font: 600 11px var(--ui); letter-spacing: 0.04em; color: var(--muted); font-style: normal; text-transform: none; }
.lock svg { width: 13px; height: 13px; }
.empty { padding: 18px; border-radius: 14px; border: 1px dashed var(--line2); color: var(--muted); text-align: center; font-size: 14px; }
.empty.wide { grid-column: 1 / -1; }
.dim { color: var(--muted); font-size: 13px; }
.gold { color: var(--gold2); }
.foot { margin-top: 40px !important; font-size: 11px; color: var(--dim); text-align: center; line-height: 1.6; max-width: 640px !important; }
.loading-set { display: grid; justify-items: center; gap: 14px; padding: 80px 20px; color: var(--muted); text-align: center; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid rgba(232, 182, 90, 0.15); border-top-color: var(--gold); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* set picker */
.setpick { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 4px; }
.setpick::-webkit-scrollbar { display: none; }
.sp { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 19px; flex: none; font: 600 13px var(--ui); color: var(--muted); background: rgba(255, 255, 255, 0.03); box-shadow: inset 0 0 0 1px var(--line); }
.sp img { width: 18px; height: 18px; filter: invert(0.85) sepia(0.5) saturate(2) hue-rotate(-10deg); }
.sp.on { color: var(--gold2); background: linear-gradient(180deg, #3a2a17, #261b0f); box-shadow: inset 0 0 0 1px var(--gold3), 0 0 18px -6px var(--gold); }
.sp.locked { opacity: 0.6; }
.sp em { display: inline-flex; align-items: center; gap: 3px; font-style: normal; font-size: 11px; color: var(--dim); }
.sp em svg { width: 12px; height: 12px; }

/* ring */
.ring { flex: none; }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 5; }
.ring-fg { fill: none; stroke: var(--gold); stroke-width: 5; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; filter: drop-shadow(0 0 4px rgba(232, 182, 90, 0.6)); }
.ring text { fill: var(--gold2); font: 800 14px var(--ui); }

.trend { display: inline-flex; align-items: center; gap: 1px; font: 700 12px var(--ui); }
.trend svg { width: 13px; height: 13px; stroke-width: 2.6; }
.trend.up { color: var(--good); }
.trend.down { color: var(--bad); }
.rar { font: 700 11px var(--ui); letter-spacing: 0.06em; text-transform: uppercase; }
.rar.r-c { color: var(--r-c); }
.rar.r-u { color: var(--r-u); }
.rar.r-r { color: var(--r-r); }
.rar.r-m { color: var(--r-m); }
em.new { display: inline-block; font: 800 9px/1 var(--ui); letter-spacing: 0.1em; text-transform: uppercase; font-style: normal; color: #1d1003; background: linear-gradient(180deg, #c9ff9e, #6fd36b); padding: 3px 5px; border-radius: 4px; margin-left: 8px; vertical-align: middle; }

/* ---------- card (3D + foil) ---------- */
.mc {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%; --bx: 50%; --by: 50%; --hyp: 0; --act: 0; --ang: 0deg;
  position: relative;
  aspect-ratio: 488 / 680;
  perspective: 1200px;
  isolation: isolate;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.mc-tilt { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(var(--ry)); }
.mc-flip { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.62s cubic-bezier(0.3, 1.3, 0.5, 1); }
.mc.down .mc-flip { transform: rotateY(180deg); }
.mc.slowflip .mc-flip { transition: transform 1.05s cubic-bezier(0.2, 0.9, 0.25, 1.12); }
.mc-face {
  position: absolute;
  inset: 0;
  border-radius: 4.75% / 3.4%;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: #16120d;
  transform: translateZ(0.1px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
}
.mc-back { transform: rotateY(180deg) translateZ(0.1px); }
.mc-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.mc-ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 14%; text-align: center; font: 600 13px/1.3 var(--display); color: var(--dim); background: linear-gradient(160deg, #2b2118, #110c08); }
.mc-backart, .bt-fan i, .du .mc-backart {
  position: absolute;
  inset: 0;
  display: block;
  background:
    radial-gradient(ellipse 30% 22% at 50% 50%, #e0a046 0 30%, transparent 32%),
    radial-gradient(ellipse 38% 32% at 50% 50%, #2a170a 0 60%, transparent 62%),
    radial-gradient(ellipse 44% 40% at 50% 50%, #c88a3a 0 50%, #233f6d 52% 92%, transparent 94%),
    linear-gradient(160deg, #6a4522, #3a2210 60%, #2a170a);
  box-shadow: inset 0 0 0 5px #23140a, inset 0 0 0 7px #8a5f2c, inset 0 0 22px rgba(0, 0, 0, 0.7);
}

/* shared fx layers */
.mc-holo, .mc-glit, .mc-glare { position: absolute; inset: 0; pointer-events: none; }
.mc-glare {
  mix-blend-mode: overlay;
  background: radial-gradient(farthest-corner circle at var(--mx) var(--my), rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.28) 22%, rgba(0, 0, 0, 0.4) 95%);
  opacity: calc(var(--act) * 0.4);
}
.mc:not([data-fx='none']) .mc-glare { opacity: calc(0.15 + var(--act) * 0.55); }

/* traditional foil: rainbow bands + diagonal sheen + glitter */
.mc[data-fx='foil'] .mc-holo {
  background-image:
    repeating-linear-gradient(110deg, #ff6a7f 0%, #ffc36b 3.6%, #a8ff8a 7.2%, #63f2ff 10.8%, #8590ff 14.4%, #f683ff 18%, #ff6a7f 21.6%),
    repeating-linear-gradient(-35deg, rgba(10, 14, 30, 0.6) 0%, rgba(200, 225, 230, 0.5) 3.4%, rgba(10, 14, 30, 0.6) 7%);
  background-size: 300% 300%, 220% 220%;
  background-position: var(--bx) var(--by), calc(100% - var(--bx)) calc(100% - var(--by));
  background-blend-mode: hard-light;
  mix-blend-mode: color-dodge;
  filter: brightness(0.62) contrast(1.5) saturate(1.25);
  opacity: calc(0.42 + var(--act) * 0.3);
}
.mc[data-fx='foil'] .mc-glit,
.mc[data-fx='rainbow'] .mc-glit,
.mc[data-fx='textured'] .mc-glit {
  background-image: var(--tex-glitter);
  background-size: 42% auto;
  background-position: calc(var(--bx) * 1.6) calc(var(--by) * 1.6);
  mix-blend-mode: color-dodge;
  opacity: calc(0.08 + var(--act) * var(--hyp) * 0.7);
}

/* foil-etched: metallic, grainy, a single bright band */
.mc[data-fx='etched'] .mc-holo {
  background-image:
    linear-gradient(112deg, rgba(0, 0, 0, 0.25) 10%, rgba(255, 230, 180, 0.8) calc(var(--mx) - 10%), #fff var(--mx), rgba(190, 215, 255, 0.8) calc(var(--mx) + 10%), rgba(0, 0, 0, 0.25) 90%),
    repeating-linear-gradient(112deg, rgba(255, 255, 255, 0) 0 3px, rgba(255, 255, 255, 0.18) 4px, rgba(255, 255, 255, 0) 6px);
  mix-blend-mode: overlay;
  opacity: calc(0.3 + var(--act) * 0.5);
}
.mc[data-fx='etched'] .mc-glit { background-image: var(--tex-grain); background-size: 120px; mix-blend-mode: soft-light; opacity: 0.12; }
.mc[data-fx='etched'] .mc-front .mc-img { filter: saturate(0.82) contrast(1.06) sepia(0.12); }

/* surge foil: hard rainbow waves and lines that keep flowing */
.mc[data-fx='surge'] .mc-holo {
  background-image:
    repeating-linear-gradient(128deg, #ff3d6e 0%, #ffb340 2%, #f5ff6b 4%, #42ffb0 6%, #3dc9ff 8%, #8e5cff 10%, #ff3d9e 12%, #ff3d6e 14%),
    radial-gradient(farthest-corner at var(--mx) var(--my), rgba(255, 255, 255, 0.5), rgba(0, 0, 0, 0.3) 70%);
  background-size: 220% 220%, 100% 100%;
  background-position: var(--bx) var(--by), center;
  background-blend-mode: overlay;
  mix-blend-mode: color-dodge;
  filter: brightness(0.56) contrast(1.5) saturate(1.5);
  opacity: calc(0.28 + var(--act) * 0.24);
}
.mc[data-fx='surge'] .mc-glit {
  inset: 0 0 0 -29px;
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0) 0 9px, rgba(255, 255, 255, 0.55) 11px, rgba(255, 255, 255, 0) 14px, rgba(255, 255, 255, 0) 20px);
  mix-blend-mode: overlay;
  opacity: 0.4;
  animation: surgeFlow 1.4s linear infinite;
}
@keyframes surgeFlow { to { transform: translateX(28.28px); } }

/* galaxy / confetti: twinkling stars */
.mc[data-fx='galaxy'] .mc-holo {
  background-image:
    radial-gradient(farthest-corner at var(--mx) var(--my), rgba(170, 140, 255, 0.7), rgba(40, 20, 90, 0) 65%),
    repeating-linear-gradient(110deg, #ff7aa8 0%, #ffd27a 4%, #8affc0 8%, #7ad8ff 12%, #b18cff 16%, #ff7aa8 20%);
  background-size: 100% 100%, 280% 280%;
  background-position: center, var(--bx) var(--by);
  mix-blend-mode: color-dodge;
  filter: brightness(0.5) contrast(1.4) saturate(1.3);
  opacity: calc(0.3 + var(--act) * 0.25);
}
.mc[data-fx='galaxy'] .mc-glit {
  background-image: var(--tex-stars), var(--tex-stars);
  background-size: 40% auto, 26% auto;
  background-position: var(--bx) var(--by), calc(100% - var(--bx)) calc(100% - var(--by));
  mix-blend-mode: color-dodge;
  opacity: calc(0.25 + var(--act) * 0.3);
  animation: twinkle 2.2s ease-in-out infinite alternate;
}
@keyframes twinkle { from { filter: brightness(0.6); } to { filter: brightness(1.5); } }
/* the back face is dropped once a card is revealed */

/* textured / raised: embossed rings that follow the light */
.mc[data-fx='textured'] .mc-holo {
  background-image:
    repeating-radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, 0) 0 5px, rgba(255, 255, 255, 0.4) 6px, rgba(255, 255, 255, 0) 8px),
    repeating-linear-gradient(110deg, #ff6a7f 0%, #ffc36b 4%, #a8ff8a 8%, #63f2ff 12%, #8590ff 16%, #f683ff 20%, #ff6a7f 24%);
  background-size: 100% 100%, 300% 300%;
  background-position: center, var(--bx) var(--by);
  mix-blend-mode: color-dodge;
  filter: brightness(0.55) contrast(1.6);
  opacity: calc(0.32 + var(--act) * 0.25);
}

/* double rainbow / halo: a conic rainbow centered on the light */
.mc[data-fx='rainbow'] .mc-holo {
  background-image: conic-gradient(from var(--ang) at var(--mx) var(--my), #ff4d6d, #ffbe3d, #d8ff4d, #3dffa8, #3dd2ff, #6b5cff, #ff4dd8, #ff4d6d);
  mix-blend-mode: color-dodge;
  filter: brightness(0.5) contrast(1.6) saturate(1.4);
  opacity: calc(0.3 + var(--act) * 0.25);
}

/* gleaming gold headliner */
.mc[data-fx='gold'] .mc-front .mc-img { filter: sepia(0.35) saturate(1.35) contrast(1.05); }
.mc[data-fx='gold'] .mc-holo {
  background-image: linear-gradient(118deg, #3d2500 0%, #b8862b 20%, #ffe49a calc(var(--mx) - 9%), #fffbe8 var(--mx), #ffd25e calc(var(--mx) + 9%), #a06a12 80%, #3d2500 100%);
  mix-blend-mode: overlay;
  opacity: calc(0.78 + var(--act) * 0.22);
}
.mc[data-fx='gold'] .mc-glit {
  background-image: var(--tex-stars), var(--tex-glitter);
  background-size: 34% auto, 40% auto;
  background-position: var(--bx) var(--by), calc(100% - var(--bx)) var(--by);
  filter: sepia(1) saturate(5) hue-rotate(-12deg) brightness(1.2);
  mix-blend-mode: color-dodge;
  opacity: 0.55;
  animation: twinkle 1.6s ease-in-out infinite alternate;
}
.mc[data-fx='gold'] .mc-face { box-shadow: 0 0 0 1px rgba(255, 220, 140, 0.7), inset 0 0 24px rgba(255, 200, 90, 0.4); }

/* big cards get a soft floor shadow */
.mc.cur::after, .cs-card .mc::after, .sum-best-card .mc::after {
  content: '';
  position: absolute;
  inset: 8% 6% -3%;
  z-index: -2;
  border-radius: 10%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.35) 55%, transparent);
  transform: translate(calc(var(--ry) * -0.8px), calc(var(--rx) * 0.8px + 16px)) scale(1.12);
}
/* rarity aura while face down, softer halo once revealed */
.mc.cur::before {
  content: '';
  position: absolute;
  inset: -9%;
  z-index: -1;
  border-radius: 12%;
  opacity: 0;
  background: radial-gradient(closest-side, var(--glow, transparent), transparent);
  transition: opacity 0.5s;
}
.mc.cur[data-glow='u'] { --glow: rgba(188, 212, 227, 0.4); }
.mc.cur[data-glow='r'] { --glow: rgba(242, 201, 94, 0.85); }
.mc.cur[data-glow='m'] { --glow: rgba(255, 118, 40, 0.95); }
.mc.cur[data-glow='x'] { --glow: rgba(255, 236, 160, 1); }
.mc.cur.down:not([data-glow='c'])::before { opacity: 1; animation: aura 1.8s ease-in-out infinite; }
.mc.cur.down[data-glow='m']::before { animation-duration: 1s; }
.mc.cur.down[data-glow='x']::before { animation-duration: 0.55s; inset: -16%; }
.mc.cur:not(.down)[data-tier='2']::before, .mc.cur:not(.down)[data-tier='3']::before { opacity: 0.55; }
.mc.cur:not(.down)[data-tier='4']::before, .mc.cur:not(.down)[data-tier='5']::before { opacity: 0.9; animation: aura 2.4s ease-in-out infinite; }
.mc.cur:not(.down)[data-tier='4'] { --glow: rgba(255, 226, 140, 0.9); }
@keyframes aura { 50% { transform: scale(1.06); opacity: 0.75; } }
.mc.charging .mc-tilt { animation: tremble 0.08s linear infinite; }
.mc.charging-x::before { inset: -26% !important; opacity: 1 !important; animation: aura 0.35s infinite !important; }
@keyframes tremble {
  0% { translate: 0 0; } 25% { translate: 1.5px -1px; } 50% { translate: -1px 1.5px; } 75% { translate: 1px 1px; } 100% { translate: 0 0; }
}

/* ---------- thumbnails ---------- */
.th { position: relative; display: block; aspect-ratio: 488 / 680; border-radius: 5% / 3.6%; overflow: hidden; background: linear-gradient(160deg, #2a2017, #120d09); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4); }
.th img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.th-sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 25%, rgba(255, 110, 190, 0.55) 36%, rgba(255, 236, 130, 0.6) 43%, rgba(110, 255, 210, 0.55) 50%, rgba(120, 150, 255, 0.55) 57%, transparent 70%);
  background-size: 320% 100%;
  mix-blend-mode: color-dodge;
  opacity: 0.7;
  animation: sheen 3.6s ease-in-out infinite;
}
.th[data-fx='surge'] .th-sheen { animation-duration: 1.8s; opacity: 0.95; }
.th[data-fx='gold'] .th-sheen { background-image: linear-gradient(115deg, transparent 25%, rgba(255, 220, 120, 0.8) 42%, #fff8d8 50%, rgba(255, 200, 80, 0.8) 58%, transparent 72%); opacity: 1; }
.th[data-fx='etched'] .th-sheen { background-image: linear-gradient(115deg, transparent 30%, rgba(255, 240, 210, 0.6) 48%, transparent 66%); mix-blend-mode: overlay; }
@keyframes sheen { 0% { background-position: 110% 0; } 65%, 100% { background-position: -110% 0; } }

/* ---------- pack ---------- */
.pack {
  --tear: 0;
  --pw: 200px;
  position: relative;
  width: var(--pw);
  aspect-ratio: 0.6;
  container-type: inline-size;
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.pack.big { --pw: min(calc(var(--cw) * 1.1), calc((100vh - 250px) * 0.6), 440px); }
@supports (height: 100dvh) { .pack.big { --pw: min(calc(var(--cw) * 1.1), calc((100dvh - 250px) * 0.6), 440px); } }
.pack.mini { --pw: 100%; }
.pack-body {
  position: absolute;
  inset: 10.5% 0 0;
  overflow: hidden;
  border-radius: 0 0 2.5cqw 2.5cqw;
  background: linear-gradient(165deg, var(--wa), var(--wc) 75%);
  box-shadow: 0 3cqw 8cqw -2cqw rgba(0, 0, 0, 0.8), 0 0 0 0.4cqw rgba(0, 0, 0, 0.4);
}
.pack-art { position: absolute; inset: 0 0 12%; background: var(--art) 50% 28% / cover no-repeat, var(--wc); }
.pack-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.2) 34%, transparent 50%, rgba(0, 0, 0, 0.35) 70%, rgba(0, 0, 0, 0.92) 88%); }
.pack[data-kind='collector'] .pack-body, .pack[data-kind='special'] .pack-body { background: linear-gradient(165deg, #23201a, #060504 70%); }
.pack[data-kind='collector'] .pack-art, .pack[data-kind='special'] .pack-art {
  inset: 22% 9% 27%;
  border-radius: 1.5cqw;
  box-shadow: 0 0 0 1.2cqw #0b0907, 0 0 0 1.8cqw var(--wb), 0 0 6cqw rgba(255, 210, 120, 0.35);
}
.pack[data-kind='collector'] .pack-shade, .pack[data-kind='special'] .pack-shade { background: radial-gradient(ellipse 80% 60% at 50% 45%, transparent 40%, rgba(0, 0, 0, 0.6)); }
.pack-logo { position: absolute; top: 5.5%; left: 6%; right: 6%; display: grid; justify-items: center; gap: 1.2cqw; text-align: center; }
.pl-pre { font: 700 3.2cqw/1 var(--ui); letter-spacing: 0.32em; text-transform: uppercase; color: var(--wink); opacity: 0.85; }
.pl-set {
  font: 900 13.5cqw/0.92 var(--display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--goldtext);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0.6cqw 0 rgba(40, 20, 0, 0.9)) drop-shadow(0 1cqw 2cqw rgba(0, 0, 0, 0.8));
}
.pack-label {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 6%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2cqw;
  padding: 2.6cqw 4cqw;
  border-radius: 1.6cqw;
  background: linear-gradient(90deg, #8a5a1b, #f5d68b 30%, #ffefc2 50%, #f5d68b 70%, #8a5a1b);
  color: #241304;
  box-shadow: 0 1cqw 3cqw rgba(0, 0, 0, 0.6), inset 0 0.4cqw 0 rgba(255, 255, 255, 0.6);
}
.pl-kind { font: 900 5.6cqw/1 var(--display); letter-spacing: 0.04em; text-transform: uppercase; }
.pl-count { font: 800 3.4cqw/1 var(--ui); letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.75; white-space: nowrap; }
.pack[data-kind='collector'] .pack-label, .pack[data-kind='special'] .pack-label { background: linear-gradient(90deg, #111, #2a2419 30%, #3a3222 50%, #2a2419 70%, #111); color: var(--gold2); box-shadow: 0 0 0 0.5cqw var(--wb), 0 1cqw 3cqw rgba(0, 0, 0, 0.6); }
.pack-seal { position: absolute; left: 50%; bottom: 16%; width: 9cqw; height: 9cqw; margin-left: -4.5cqw; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #fff1c2, #d39a3a 60%, #7a4b10); box-shadow: 0 0.6cqw 1.5cqw rgba(0, 0, 0, 0.6); }
.pack-seal svg { width: 6.4cqw; height: 6.4cqw; color: #3a2205; }
.pack[data-kind='collector'] .pack-seal, .pack[data-kind='special'] .pack-seal { bottom: 18.5%; }
.pack-foil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(115deg, transparent 28%, rgba(255, 255, 255, 0.5) calc(var(--mx, 50%) - 4%), rgba(255, 255, 255, 0.85) var(--mx, 50%), rgba(255, 255, 255, 0.5) calc(var(--mx, 50%) + 4%), transparent 72%),
    repeating-linear-gradient(105deg, rgba(255, 90, 120, 0.5) 0%, rgba(255, 210, 100, 0.5) 5%, rgba(120, 255, 180, 0.5) 10%, rgba(100, 200, 255, 0.5) 15%, rgba(200, 120, 255, 0.5) 20%, rgba(255, 90, 120, 0.5) 25%);
  background-size: 100% 100%, 300% 300%;
  background-position: center, var(--bx, 50%) var(--by, 50%);
  mix-blend-mode: overlay;
  opacity: calc(0.25 + var(--act, 0.5) * 0.3);
}
.pack[data-kind='collector'] .pack-foil, .pack[data-kind='special'] .pack-foil { mix-blend-mode: color-dodge; opacity: calc(0.25 + var(--act, 0.5) * 0.35); filter: brightness(0.7); }
.pack-edge {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 0.4cqw, transparent 0.4cqw 9cqw);
  box-shadow: inset 3cqw 0 4cqw -3cqw rgba(255, 255, 255, 0.35), inset -3cqw 0 4cqw -3cqw rgba(0, 0, 0, 0.75), inset 0 -4cqw 5cqw -4cqw rgba(0, 0, 0, 0.8);
}
.pack-crimp {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.55) 0 0.5cqw, rgba(0, 0, 0, 0.35) 0.5cqw 1.1cqw),
    linear-gradient(180deg, #f3ecd8, #9a8a6a 45%, #e3d8bf 62%, #6f6047);
  background-blend-mode: overlay;
}
.pc-bot {
  top: auto;
  height: 6%;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 4cqw 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 4cqw 100%;
}
.pack[data-kind='collector'] .pack-crimp, .pack[data-kind='special'] .pack-crimp { background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.4) 0 0.5cqw, rgba(0, 0, 0, 0.4) 0.5cqw 1.1cqw), linear-gradient(180deg, #ffe7a6, #a8742a 45%, #f0c56a 62%, #6b430b); background-blend-mode: overlay; }
.pack-top { position: absolute; left: 0; right: 0; top: 0; height: 11%; z-index: 2; }
.pt { position: absolute; inset: 0; }
.pt .pack-crimp {
  -webkit-mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) 50% / 4cqw 100%;
  mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) 50% / 4cqw 100%;
  border-bottom: 0.6cqw solid rgba(0, 0, 0, 0.25);
}
.pt-b { clip-path: inset(0 0 0 calc(var(--tear) * 100%)); }
.pt-a {
  clip-path: inset(0 calc((1 - var(--tear)) * 100%) 0 0);
  transform-origin: calc(var(--tear) * 100%) 100%;
  transform: translateY(calc(var(--tear) * -18%)) rotate(calc(var(--tear) * -4deg));
  filter: brightness(1.1);
}
.pack-rip {
  position: absolute;
  left: 0;
  right: 0;
  top: 9.8%;
  height: 2%;
  z-index: 3;
  background: linear-gradient(180deg, #fff, #d9d2c2);
  -webkit-mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) 50% / 2.4cqw 100%;
  mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) 50% / 2.4cqw 100%;
  clip-path: inset(0 calc((1 - var(--tear)) * 100%) 0 0);
  opacity: calc(var(--tear) * 10);
  filter: drop-shadow(0 0.4cqw 0.4cqw rgba(0, 0, 0, 0.5));
}
.pack-guide { position: absolute; left: 6%; right: 6%; top: 10.5%; height: 0; border-top: 0.6cqw dashed rgba(255, 240, 200, 0.55); z-index: 4; display: none; }
.pack.big .pack-guide { display: block; }
.pack-guide i { position: absolute; top: -2.6cqw; left: 0; width: 5cqw; height: 5cqw; border-radius: 50%; background: radial-gradient(circle, #fff, rgba(255, 220, 140, 0.4) 60%, transparent 70%); animation: guide 1.8s ease-in-out infinite; }
@keyframes guide { 0% { left: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: 92%; opacity: 0; } }
.pack.big[style*='--tear'] .pack-guide { opacity: 0; transition: opacity 0.3s; }
.pack.torn .pack-guide, .pack.torn .pack-rip { display: none; }
.pack.torn .pack-top { animation: topFly 0.75s cubic-bezier(0.2, 0.7, 0.3, 1) forwards; }
@keyframes topFly { to { transform: translate(40%, -220%) rotate(28deg); opacity: 0; } }
.pack.big.enter { animation: packIn 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.1) both; }
@keyframes packIn { from { opacity: 0; translate: 0 40px; scale: 0.85; } }
.pack.away { transition: translate 0.6s cubic-bezier(0.5, 0, 0.8, 0.4), opacity 0.55s; translate: 0 90%; opacity: 0; }

/* ---------- box ---------- */
.boxv { position: relative; width: 100%; aspect-ratio: 1.1; container-type: inline-size; perspective: 900px; display: grid; place-items: center; }
.bx3d {
  --bw: 72cqw;
  --bh: 60cqw;
  --bd: 20cqw;
  position: relative;
  width: var(--bw);
  height: var(--bh);
  margin: 8cqw 6cqw 0 0;
  transform-style: preserve-3d;
  transform: rotateX(calc(-16deg - var(--rx, 0deg) * 0.5)) rotateY(calc(-28deg + var(--ry, 0deg) * 0.6));
}
.bx-face { position: absolute; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.bx-front { inset: 0; overflow: hidden; border-radius: 0.8cqw; transform: translateZ(calc(var(--bd) / 2)); background: linear-gradient(165deg, var(--wa), var(--wc) 80%); box-shadow: inset 0 0 0 0.6cqw rgba(0, 0, 0, 0.3); }
.boxv[data-kind='collector'] .bx-front, .boxv[data-kind='special'] .bx-front { background: linear-gradient(165deg, #23201a, #060504 75%); box-shadow: inset 0 0 0 0.8cqw var(--wb); }
.bx-side {
  top: 0;
  left: calc(50% - var(--bd) / 2);
  width: var(--bd);
  height: var(--bh);
  display: grid;
  place-items: center;
  overflow: hidden;
  transform: rotateY(90deg) translateZ(calc(var(--bw) / 2));
  background: linear-gradient(90deg, color-mix(in srgb, var(--wc) 80%, #000), var(--wc) 45%, color-mix(in srgb, var(--wa) 60%, #000));
  box-shadow: inset 0 0 0 0.4cqw rgba(0, 0, 0, 0.35);
}
.bx-side span { transform: rotate(90deg); white-space: nowrap; font: 900 4.2cqw var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold2); opacity: 0.8; }
.boxv[data-kind='collector'] .bx-side, .boxv[data-kind='special'] .bx-side { background: linear-gradient(90deg, #0d0b08, #1d1913 45%, #2a2419); box-shadow: inset 0 0 0 0.5cqw var(--wb); }
.bx-top {
  left: 0;
  top: calc(50% - var(--bd) / 2);
  width: var(--bw);
  height: var(--bd);
  transform: rotateX(90deg) translateZ(calc(var(--bh) / 2));
  background: linear-gradient(180deg, color-mix(in srgb, var(--wa) 70%, #fff) 0%, var(--wa) 100%);
  box-shadow: inset 0 0 0 0.4cqw rgba(0, 0, 0, 0.25);
}
.boxv[data-kind='collector'] .bx-top, .boxv[data-kind='special'] .bx-top { background: linear-gradient(180deg, #4a4030, #1d1913); box-shadow: inset 0 0 0 0.5cqw var(--wb); }
.bx-art { position: absolute; inset: 0; background: var(--art) 50% 30% / cover; opacity: 0.85; }
.bx-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent 40%, transparent 55%, rgba(0, 0, 0, 0.85)); }
.bx-logo { position: absolute; top: 7%; left: 5%; right: 5%; text-align: center; font: 900 9.5cqw/0.95 var(--display); text-transform: uppercase; background: var(--goldtext); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0.5cqw 0 rgba(40, 20, 0, 0.9)); }
.bx-kind { position: absolute; bottom: 7%; left: 0; right: 0; text-align: center; font: 800 3.8cqw var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold2); text-shadow: 0 1px 2px #000; }

/* ---------- opening scene ---------- */
body.in-scene #app { display: none; }
.scene {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  padding: var(--sat) var(--sar) 0 var(--sal);
}
.sc-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 65% 50% at 50% 42%, rgba(255, 196, 120, 0.22), transparent 70%),
    radial-gradient(ellipse 140% 90% at 50% 50%, transparent 40%, rgba(0, 0, 0, 0.85) 100%),
    repeating-linear-gradient(176deg, rgba(255, 220, 170, 0.025) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(4deg, rgba(0, 0, 0, 0.18) 0 2px, transparent 2px 23px),
    linear-gradient(180deg, #2a1a0e, #1a0f07 60%, #0e0804);
  transition: filter 0.6s;
}
.scene.dimmed .sc-bg { filter: brightness(0.35) saturate(0.6); }
.sc-rays {
  display: none;
  position: absolute;
  left: 50%;
  top: 46%;
  width: 96vmax;
  height: 96vmax;
  margin: -48vmax 0 0 -48vmax;
  pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255, 214, 140, 0) 0deg 8deg, rgba(255, 214, 140, 0.2) 11deg 14deg, rgba(255, 214, 140, 0) 17deg 22.5deg);
  -webkit-mask: radial-gradient(circle closest-side, #000 0%, rgba(0, 0, 0, 0.55) 42%, transparent 100%);
  mask: radial-gradient(circle closest-side, #000 0%, rgba(0, 0, 0, 0.55) 42%, transparent 100%);
  opacity: 0;
  transition: opacity 0.8s;
  animation: spin 30s linear infinite;
}
.sc-rays.show { display: block; }
.sc-rays.on { opacity: 1; }
.sc-rays[data-t='3'] { background: repeating-conic-gradient(from 0deg, rgba(255, 140, 60, 0) 0deg 8deg, rgba(255, 140, 60, 0.22) 11deg 14deg, rgba(255, 140, 60, 0) 17deg 22.5deg); }
.sc-rays[data-t='5'] { background: repeating-conic-gradient(from 0deg, rgba(255, 230, 160, 0) 0deg 6deg, rgba(255, 230, 160, 0.42) 9deg 13deg, rgba(255, 230, 160, 0) 16deg 18deg); animation-duration: 12s; }
.sc-flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 45%, var(--flash, #fff), transparent 65%); z-index: 4; }
.sc-flash.on { animation: flash 0.7s ease-out; }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }
.scene.shake .sc-stage { animation: shake 0.45s; }
.scene.shake-big .sc-stage { animation: shakeBig 0.7s; }
@keyframes shake { 20% { translate: -6px 3px; } 40% { translate: 5px -4px; } 60% { translate: -3px 2px; } 80% { translate: 2px -1px; } }
@keyframes shakeBig { 10% { translate: -12px 6px; } 25% { translate: 10px -8px; } 40% { translate: -8px 4px; } 55% { translate: 6px -5px; } 70% { translate: -3px 2px; } 85% { translate: 2px -1px; } }

.sc-top { position: relative; z-index: 6; display: grid; grid-template-columns: 44px 1fr auto 44px; align-items: center; gap: 8px; padding: 8px 12px 0; }
.sc-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--text); background: rgba(0, 0, 0, 0.35); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); }
.sc-btn svg { width: 22px; height: 22px; }
.sc-title { display: grid; line-height: 1.15; min-width: 0; }
.sc-set { font: 700 13px var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-kind { font: 500 12px var(--ui); color: var(--muted); }
.sc-count { font: 700 13px var(--ui); color: var(--muted); padding: 0 6px; }

.sc-stage { position: relative; z-index: 3; display: grid; place-items: center; grid-template-areas: 'c'; min-height: 0; }
.sc-stage > * { grid-area: c; }
.sc-packwrap { position: relative; display: grid; place-items: center; }
.sc-packwrap > * { grid-area: 1 / 1; }
.sc-packwrap .pack { z-index: 2; }
.sc-tearbtn { align-self: end; margin-bottom: 4px; opacity: 0.85; }
.deck { position: relative; width: var(--cw); aspect-ratio: 488 / 680; }
.deck.rising { z-index: 1; transform: translateY(6%) scale(0.84); transition: transform 0.6s cubic-bezier(0.2, 0.85, 0.25, 1); }
.deck.rising.up { transform: translateY(-38%) scale(0.84); }
.deck.rising.center { z-index: 3; transform: none; }
.deck-under { position: absolute; inset: 0; }
.du { position: absolute; inset: 0; border-radius: 4.75% / 3.4%; overflow: hidden; transform: translate(calc(var(--k) * 2px), calc(var(--k) * 3.5px)); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.du img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.deck .mc { position: absolute; inset: 0; }
.deck .mc.out { transition: transform 0.5s cubic-bezier(0.55, 0, 0.8, 0.3), opacity 0.45s 0.05s; transform: translate(var(--ox, 0px), 75vh) rotate(var(--orot, 0deg)) scale(0.3); opacity: 0; pointer-events: none; }
.sc-info {
  align-self: center;
  transform: translateY(calc(var(--cw) / 0.7176 / 2 + 34px));
  width: min(92vw, 520px);
  text-align: center;
  opacity: 0;
  pointer-events: none;
}
.sc-info.on { animation: infoIn 0.45s ease-out forwards; }
@keyframes infoIn { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }
.si-name { font: 700 17px/1.2 var(--display); color: var(--text); text-shadow: 0 2px 8px #000; }
.si-meta { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 10px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.si-price { font: 800 15px var(--ui); color: var(--text); }
.si-price.t2 { color: var(--r-r); }
.si-price.t3 { color: var(--r-m); }
.si-price.t4, .si-price.t5 { color: var(--gold2); text-shadow: 0 0 12px var(--gold); }

.sc-banner { position: absolute; top: calc(10% + var(--sat)); left: 0; right: 0; z-index: 5; text-align: center; pointer-events: none; }
.sc-banner span { display: inline-block; opacity: 0; }
.sc-banner i {
  display: inline-block;
  font-style: normal;
  font: 900 clamp(38px, 10vw, 84px)/1 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--goldtext);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 0 rgba(50, 25, 0, 0.9)) drop-shadow(0 0 26px rgba(255, 190, 90, 0.6));
}
.sc-banner.t3 i { background-image: linear-gradient(180deg, #fff1d0, #ffb35a 45%, #c2420e 55%, #ff9a4a); }
.sc-banner.show span { animation: bannerIn 1.7s cubic-bezier(0.2, 0.9, 0.3, 1.2) forwards; }
.sc-banner.show.t4 span, .sc-banner.show.t5 span { animation-duration: 2.6s; }
@keyframes bannerIn { 0% { opacity: 0; transform: scale(0.4) translateY(20px); letter-spacing: 0.4em; } 18% { opacity: 1; transform: scale(1.08); letter-spacing: 0.08em; } 28% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(1.04) translateY(-10px); } }
.pop { position: fixed; z-index: 60; transform: translate(-50%, -50%); pointer-events: none; font: 800 22px var(--ui); color: var(--r-r); text-shadow: 0 2px 0 #3a2205, 0 0 18px rgba(255, 200, 90, 0.7); animation: popUp 1.7s cubic-bezier(0.2, 0.8, 0.3, 1) forwards; white-space: nowrap; }
.pop.t3 { color: #ffb070; font-size: 26px; }
.pop.t4, .pop.t5 { color: #fff3c8; font-size: 34px; }
@keyframes popUp { 0% { opacity: 0; translate: 0 10px; scale: 0.6; } 15% { opacity: 1; scale: 1.15; } 30% { scale: 1; } 80% { opacity: 1; } 100% { opacity: 0; translate: 0 -70px; } }
.sc-hint { text-align: center; font: 500 13px var(--ui); color: var(--muted); opacity: 0; transition: opacity 0.4s; pointer-events: none; padding: 0 20px; min-height: 1.5em; }
.sc-hint.on { opacity: 1; animation: hintBob 2.4s ease-in-out infinite; }
@keyframes hintBob { 50% { translate: 0 -3px; } }
.sc-bottom { position: relative; z-index: 6; padding: 6px 12px calc(10px + var(--sab)); display: grid; gap: 6px; justify-items: stretch; background: linear-gradient(0deg, rgba(0, 0, 0, 0.6), transparent); }
.sc-tearbtn { justify-self: center; min-width: 160px; display: none; }
.scene.ph-pack .sc-tearbtn { display: inline-flex; }
.scene.ph-pack .sc-total, .scene.ph-pack .sc-tray { display: none; }
.scene.ph-pack .sc-bottom { min-height: 120px; align-content: center; }
.sc-total { display: flex; justify-content: center; align-items: baseline; gap: 8px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; }
.sc-total b { font: 800 20px var(--ui); letter-spacing: 0; color: var(--gold2); text-transform: none; }
.sc-tray { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; min-height: 78px; padding: 2px 2px 4px; }
.sc-tray > :first-child { margin-left: auto; }
.sc-tray > :last-child { margin-right: auto; }
.sc-tray::-webkit-scrollbar { display: none; }
.tr-card { flex: none; width: 46px; display: grid; gap: 3px; animation: trayIn 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3) both; }
.tr-card span { font: 700 10px var(--ui); color: var(--muted); text-align: center; }
.tr-card.t2 span { color: var(--r-r); }
.tr-card.t3 span { color: var(--r-m); }
.tr-card.t4 span, .tr-card.t5 span { color: var(--gold2); }
.tr-card.t2 .th, .tr-card.t3 .th { box-shadow: 0 0 0 1px var(--r-r), 0 0 10px -2px var(--r-r); }
.tr-card.t4 .th, .tr-card.t5 .th { box-shadow: 0 0 0 1px var(--gold2), 0 0 14px var(--gold); }
@keyframes trayIn { from { opacity: 0; transform: translateY(-30px) scale(1.6); } }

/* box break */
.bb { width: min(94vw, 760px); max-height: 100%; display: grid; grid-template-rows: auto auto 1fr auto; justify-items: center; gap: 10px; padding: 8px 0; min-height: 0; }
.bb-pack { width: min(32vw, 150px); }
.bb-pack.rip { animation: bbRip 0.32s ease-out; }
@keyframes bbRip { 30% { transform: scale(1.06) rotate(-2deg); filter: brightness(1.4); } }
.bb-count { font: 600 13px var(--ui); color: var(--muted); }
.bb-count b { font: 800 20px var(--ui); color: var(--gold2); }
/* the scene blocks touch scrolling for swiping packs; the hit list scrolls by touch, and fades at the
   bottom so a part-hidden row reads as more to scroll to */
.bb-hits { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; overflow-y: auto; align-content: start; min-height: 0; padding: 4px 4px 20px; touch-action: pan-y; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(180deg, #000 calc(100% - 28px), transparent); }
/* the box break has no card tray or hint: the hit list gets that room */
.scene.many .sc-tray, .scene.many .sc-hint, .scene.many .sc-tearbtn { display: none; }
.bb-hit { display: grid; gap: 3px; animation: trayIn 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.3) both; }
.bb-hit span { font: 700 11px var(--ui); color: var(--r-r); text-align: center; }
.bb-hit.t3 span { color: var(--r-m); }
.bb-hit.t4 span, .bb-hit.t5 span { color: var(--gold2); }
.bb-hit.t4 .th, .bb-hit.t5 .th { box-shadow: 0 0 0 1px var(--gold2), 0 0 16px var(--gold); }
.bb-note { font-size: 12px; color: var(--dim); }

/* ---------- summary ---------- */
.sc-summary { position: absolute; inset: 0; z-index: 8; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; padding: calc(64px + var(--sat)) calc(16px + var(--sar)) calc(20px + var(--sab)) calc(16px + var(--sal)); background: radial-gradient(ellipse 70% 40% at 50% 10%, rgba(255, 190, 100, 0.14), transparent 70%), rgba(10, 6, 3, 0.94); animation: fadeIn 0.4s ease-out; }
@keyframes fadeIn { from { opacity: 0; } }
.sum { max-width: 1000px; margin: 0 auto; display: grid; gap: 18px; }
.sum-head { text-align: center; display: grid; gap: 2px; }
.sum-kicker { font: 700 12px var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.sum-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.2em; color: var(--muted); margin-top: 6px; }
.sum-total { font: 800 46px/1.05 var(--ui); letter-spacing: -0.02em; background: var(--goldtext); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sum-delta { font: 700 14px var(--ui); }
.sum-delta.up { color: var(--good); }
.sum-delta.down { color: var(--bad); }
.sum-sub { font-size: 12px; color: var(--dim); margin-top: 2px; }
.sum-body { display: grid; gap: 18px; }
.sum-best { display: grid; grid-template-columns: minmax(0, 46%) 1fr; gap: 16px; align-items: center; padding: 14px; border-radius: 18px; background: linear-gradient(160deg, rgba(255, 210, 130, 0.08), rgba(255, 255, 255, 0.02)); box-shadow: inset 0 0 0 1px rgba(232, 182, 90, 0.2); }
.sum-best-card .mc { width: 100%; }
.sum-best-txt { display: grid; gap: 4px; }
.sum-best-txt span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--muted); }
.sum-best-txt b { font: 700 19px/1.2 var(--display); }
.sum-best-txt i { font-style: normal; font-size: 12px; color: var(--muted); }
.sum-best-txt em { font: 800 26px var(--ui); font-style: normal; color: var(--r-r); }
.sum-best-txt em.t3 { color: var(--r-m); }
.sum-best-txt em.t4, .sum-best-txt em.t5 { color: var(--gold2); text-shadow: 0 0 16px var(--gold); }
.sum-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.sum-card { display: grid; gap: 4px; animation: dealIn 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; animation-delay: var(--d); }
.sum-card .th { position: relative; }
.sum-card .th em.new { position: absolute; top: 4px; left: 4px; margin: 0; }
.sum-card span { font: 700 12px var(--ui); color: var(--muted); text-align: center; }
.sum-card.t2 span { color: var(--r-r); }
.sum-card.t3 span { color: var(--r-m); }
.sum-card.t4 span, .sum-card.t5 span { color: var(--gold2); }
.sum-card.t4 .th, .sum-card.t5 .th { box-shadow: 0 0 0 1px var(--gold2), 0 0 18px var(--gold); }
@keyframes dealIn { from { opacity: 0; transform: translateY(16px) scale(0.92); } }
.sum-more { text-align: center; font-size: 13px; color: var(--muted); }
/* a toolbar pinned to the bottom: every row has the same width, so the buttons line up */
.sum-actions { position: sticky; bottom: calc(-20px - var(--sab)); display: grid; grid-template-columns: minmax(0, 480px); justify-content: center; gap: 8px; margin: 0 -16px; padding: 12px 16px calc(14px + var(--sab)); background: rgba(10, 6, 3, 0.95); box-shadow: 0 -14px 22px rgba(10, 6, 3, 0.9); }
.sum-bulk, .sum-main { display: flex; gap: 8px; }
.sum-bulk:empty { display: none; }
.sum-actions .btn { flex: 1 1 0; min-width: 0; }
.sum-bulk .btn { min-height: 36px; font-size: 12px; padding: 0 10px; white-space: normal; line-height: 1.2; }
.sum-body.single { grid-template-columns: minmax(0, 560px) !important; justify-content: center; }
.sum-body.single .sum-best { position: static; grid-template-columns: minmax(0, 46%) 1fr; }

/* ---------- sheets ---------- */
#sheets { position: relative; z-index: 80; }
.sheet { position: fixed; inset: 0; z-index: 80; }
.sh-back { position: absolute; inset: 0; background: rgba(5, 3, 1, 0.66); opacity: 0; transition: opacity 0.28s; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sh-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: calc(100% - 24px - var(--sat));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 22px calc(18px + var(--sar)) calc(22px + var(--sab)) calc(18px + var(--sal));
  border-radius: 22px 22px 0 0;
  background: linear-gradient(180deg, #241a10, #160f09 220px);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 220, 160, 0.14);
  transform: translateY(105%);
  transition: transform 0.34s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.sheet.open .sh-back { opacity: 1; }
.sheet.open .sh-panel { transform: none; }
.sheet.closing .sh-panel { transition-duration: 0.22s; }
.sh-x { position: sticky; top: -8px; margin: -8px -6px -30px auto; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.35); box-shadow: inset 0 0 0 1px var(--line2); z-index: 2; }
.sh-x svg { width: 20px; height: 20px; }
.sh-panel { overflow-x: hidden; }
.sheet h2 { font: 700 22px/1.2 var(--display); color: var(--text); }
.sheet h3 { font: 700 13px var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); margin: 18px 0 6px; }

/* card sheet */
.cs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.cs-vis { display: grid; justify-items: center; gap: 12px; }
.cs-card { width: min(64vw, 300px); }
.cs-card .mc { width: 100%; }
.cs-tools { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.cs-info { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-content: start; min-width: 0; }
.cs-set { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.cs-set img { width: 16px; height: 16px; filter: invert(0.85) sepia(0.5) saturate(2) hue-rotate(-10deg); }
.cs-type { font-size: 13px; color: var(--muted); margin-top: -4px; }
.mana { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--gold2); }
.cs-labels { display: flex; flex-wrap: wrap; gap: 6px; }
.cs-labels span { font: 700 11px var(--ui); letter-spacing: 0.04em; padding: 4px 8px; border-radius: 6px; color: var(--gold2); background: rgba(232, 182, 90, 0.1); box-shadow: inset 0 0 0 1px rgba(232, 182, 90, 0.3); }
.cs-price { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 14px; background: rgba(0, 0, 0, 0.25); box-shadow: inset 0 0 0 1px var(--line); }
.cs-price > div { display: grid; }
.cs-price span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.cs-price b { font: 800 26px var(--ui); color: var(--gold2); }
.spark { width: 100%; height: 44px; }
.spark polyline { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark.up polyline { stroke: var(--good); }
.spark.down polyline { stroke: var(--bad); }
.cs-price .cs-src { font: 400 11px/1.35 var(--ui); color: var(--dim); font-style: normal; margin-top: 2px; }
.cs-price.none { grid-template-columns: 1fr; }
.cs-price.none b { font-size: 20px; color: var(--muted); }
.spark-none { font-size: 11px; color: var(--dim); display: grid; place-items: center; text-align: center; }
.cs-own { font-size: 13px; color: var(--muted); }
.cs-own b { color: var(--text); }
.cs-keep { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: 12px; font-size: 13px; color: var(--muted); background: rgba(255, 255, 255, 0.03); box-shadow: inset 0 0 0 1px var(--line); }
.cs-keep > svg { flex: none; width: 16px; height: 16px; }
.cs-keep > span { flex: 1; min-width: 0; }
.cs-keep b { color: var(--text); }
.cs-keep.on { color: var(--text); background: rgba(232, 182, 90, 0.08); box-shadow: inset 0 0 0 1px rgba(232, 182, 90, 0.35); }
.cs-keep.on > svg { color: var(--gold); }
.ck-step { flex: none; display: flex; align-items: center; gap: 6px; }
.ck-step b { min-width: 16px; text-align: center; font-size: 15px; }
.ck-b { width: 34px; height: 34px; border-radius: 10px; font: 700 18px/1 var(--ui); background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px var(--line2); }
.ck-b:disabled { opacity: 0.35; }
.cs-want { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(139, 224, 154, 0.07); box-shadow: inset 0 0 0 1px rgba(139, 224, 154, 0.3); font-size: 13px; }
.cs-want span { flex: 1; }
.cs-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.cs-acts .btn { flex: 1 1 140px; }
.lp { display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: rgba(232, 182, 90, 0.06); box-shadow: inset 0 0 0 1px rgba(232, 182, 90, 0.25); }
.lp-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--muted); }
.lp-top b { font: 800 18px var(--ui); color: var(--gold2); }
.lp input[type='range'] { width: 100%; accent-color: var(--gold); height: 28px; }
.lp-meta { font-size: 12px; color: var(--muted); }
.lp-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.lp-btns .btn { flex: 1; }
.cs-text { font-size: 14px; line-height: 1.5; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); color: var(--text); }
.cs-flav { font: italic 15px/1.45 var(--flav); color: var(--muted); padding: 0 4px; }
.cs-others > span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; }
.cs-others { min-width: 0; }
.cs-others > div { display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; padding: 6px 0; scrollbar-width: none; }
.cs-others > div::-webkit-scrollbar { display: none; }
.cs-others button { position: relative; flex: none; width: 58px; }
.cs-others .own { position: absolute; top: 3px; right: 3px; width: 9px; height: 9px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 2px #000; }
.cs-art { font-size: 12px; color: var(--dim); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.cs-art a { display: inline-flex; align-items: center; gap: 3px; }
.cs-art svg { width: 13px; height: 13px; }

.chip { height: 32px; padding: 0 12px; border-radius: 16px; display: inline-flex; align-items: center; gap: 5px; font: 600 12px var(--ui); color: var(--muted); background: rgba(255, 255, 255, 0.03); box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; }
.chip svg { width: 15px; height: 15px; }
.chip.on { color: #241304; background: linear-gradient(180deg, #ffe3a1, #e0a948); box-shadow: none; }
.chip.act { color: var(--gold2); box-shadow: inset 0 0 0 1px var(--gold3); }

.sheet.small .sh-panel { padding-top: 26px; }
.confirm p { font-size: 16px; margin: 6px 30px 18px 0; }
.cf-btns { display: flex; gap: 10px; }
.cf-btns .btn { flex: 1; }
.lvl { text-align: center; display: grid; gap: 8px; justify-items: center; padding: 10px 0; }
.lvl-n { position: relative; animation: lvlIn 2s ease-out both; }
.lvl-n::before { content: ''; position: absolute; inset: 0 -20%; z-index: -1; background: radial-gradient(closest-side, rgba(232, 182, 90, 0.35), transparent); }
.lvl-n span { display: inline-block; font: 900 84px/1 var(--display); background: var(--goldtext); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 0 rgba(60, 30, 5, 0.8)); }
@keyframes lvlIn { from { transform: scale(0.3) rotate(-10deg); opacity: 0; } 60% { transform: scale(1.1); opacity: 1; } }
.lvl-t { font: 700 15px var(--display); color: var(--gold); letter-spacing: 0.08em; }
.lvl-u { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.lvl-u b { color: var(--text); }
.intro { display: grid; gap: 14px; }
.intro-logo { font-size: clamp(30px, 9vw, 44px); letter-spacing: 0.1em; text-align: center; }
.intro-lead { font-size: 16px; line-height: 1.5; }
.intro ul { list-style: none; display: grid; gap: 8px; }
.intro li { padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; color: var(--muted); }
.intro li b { color: var(--gold2); }
.settings { display: grid; gap: 12px; }
.tg { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.tg input { position: absolute; opacity: 0; pointer-events: none; }
.tg i { position: relative; width: 46px; height: 28px; border-radius: 14px; background: rgba(255, 255, 255, 0.12); transition: background 0.2s; flex: none; }
.tg i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #e9dcc0; transition: transform 0.2s; }
.tg input:checked + i { background: var(--gold); }
.tg input:checked + i::after { transform: translateX(18px); }
.pcode { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); box-shadow: inset 0 0 0 1px var(--line); }
.pcode span { flex: 1; min-width: 0; font-size: 14px; }
.pcode em { display: block; font-style: normal; font-size: 12px; color: var(--dim); margin-top: 2px; }
.pcode b { font-family: ui-monospace, Menlo, monospace; font-size: 14px; letter-spacing: 0.04em; color: var(--gold2); white-space: nowrap; }
.credit { font-size: 11px; color: var(--dim); line-height: 1.6; margin-top: 8px; }
.prof { display: grid; gap: 16px; }
.prof-head { display: flex; gap: 16px; align-items: center; }
.prof-head p { font-size: 13px; color: var(--muted); }
.prof-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.prof-stats div, .mstats div { display: grid; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); box-shadow: inset 0 0 0 1px var(--line); }
.prof-stats span, .mstats span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.prof-stats b, .mstats b { font: 800 17px var(--ui); color: var(--text); }
.shelf { display: grid; gap: 10px; padding: 12px; border-radius: 14px; background: linear-gradient(180deg, rgba(232, 182, 90, 0.07), rgba(232, 182, 90, 0.02)); box-shadow: inset 0 0 0 1px rgba(232, 182, 90, 0.25); }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.shelf-head b { display: inline-flex; align-items: center; gap: 6px; font: 700 12px var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.shelf-head b svg { width: 14px; height: 14px; }
.shelf-head span { font-size: 12px; color: var(--muted); }
.shelf-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.shelf-row.s12 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kp-slot { display: grid; gap: 4px; min-width: 0; text-align: center; }
.kp-slot > span { font: 700 11px var(--ui); color: var(--gold2); }
.kp-slot.empty { aspect-ratio: 488 / 680; border-radius: 5% / 3.6%; border: 1px dashed rgba(232, 182, 90, 0.25); background: rgba(0, 0, 0, 0.2); }
.kp-slot .th { box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(232, 182, 90, 0.35); }
.kp-n { position: absolute; top: 4px; right: 4px; font: 800 10px/1 var(--ui); font-style: normal; padding: 3px 5px; border-radius: 5px; background: rgba(0, 0, 0, 0.72); color: var(--text); }
.shelf > p { margin: 0; }
.prof-best { display: grid; grid-template-columns: auto 70px 1fr; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: rgba(232, 182, 90, 0.06); box-shadow: inset 0 0 0 1px rgba(232, 182, 90, 0.25); }
.prof-best > span { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.prof-best div { display: grid; gap: 2px; }
.prof-best i { font-style: normal; font-size: 12px; color: var(--muted); }
.prof-best em { font-style: normal; font-weight: 800; color: var(--gold2); }

/* ---------- shop ---------- */
.hero { position: relative; margin-top: 12px !important; border-radius: 20px; overflow: hidden; min-height: 190px; display: flex; align-items: flex-end; background: var(--art) 50% 30% / cover no-repeat, var(--panel); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(232, 182, 90, 0.25); }
.hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12, 8, 5, 0.1), rgba(12, 8, 5, 0.6) 55%, rgba(12, 8, 5, 0.96)); }
.hero-in { position: relative; padding: 18px; display: grid; gap: 6px; }
.hero-kicker { display: flex; align-items: center; gap: 8px; font: 700 11px var(--ui); letter-spacing: 0.2em; color: var(--gold); }
.hero-kicker img { width: 18px; height: 18px; filter: invert(0.8) sepia(1) saturate(3) hue-rotate(-10deg); }
.hero h1 { font: 900 clamp(26px, 7vw, 46px)/1.02 var(--display); text-shadow: 0 3px 18px #000; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.hero-stats b { color: var(--gold2); }
.stash { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.st-item { display: grid; grid-template-columns: 62px 1fr; grid-template-rows: auto auto; gap: 4px 14px; align-items: center; padding: 12px; border-radius: 16px; background: linear-gradient(160deg, var(--panel2), var(--panel)); box-shadow: inset 0 0 0 1px var(--line); }
.st-vis { position: relative; grid-row: span 2; width: 62px; }
.st-n { position: absolute; right: -8px; top: -8px; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 14px; display: grid; place-items: center; font: 800 13px var(--ui); color: #241304; background: linear-gradient(180deg, #ffe7a6, #e0a948); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); }
.st-txt { display: grid; }
.st-txt b { font: 700 15px var(--display); }
.st-txt span { font-size: 12px; color: var(--muted); }
.st-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.st-btns .btn { min-height: 36px; }
.prods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.prod { display: grid; grid-template-rows: auto 1fr; gap: 12px; padding: 16px 14px 14px; border-radius: 18px; background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255, 200, 120, 0.1), transparent 70%), linear-gradient(170deg, var(--panel2), var(--panel)); box-shadow: inset 0 0 0 1px var(--line); }
.prod-vis { width: min(100%, 150px); margin: 0 auto; filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.6)); }
.boxes .prod-vis { width: min(100%, 190px); }
.prod-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.prod-buy { margin-top: auto; display: grid; gap: 6px; padding-top: 6px; }
.prod-info h3 { font: 700 16px/1.2 var(--display); }
.prod-info p { font-size: 12px; color: var(--muted); }
.prod-info .disc { color: var(--good); }
.prod-info .mk { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; }
.prod-price .trend { font-size: 12px; }
.src { font-size: 12px; color: var(--dim); margin: -6px auto 12px !important; }
.prod-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; line-height: 1.15; }
.prod-price b { font: 800 22px/1.15 var(--ui); color: var(--gold2); }
.prod-price s { flex-basis: 100%; font: 600 13px/1.2 var(--ui); color: var(--dim); }
.prod-btns { display: grid; grid-template-columns: 1fr; gap: 6px; }
.prods.locked .prod { opacity: 0.55; }
/* a set with three boosters: the last one gets the whole row, laid out sideways */
.prods > .prod:last-child:nth-child(odd) { grid-column: 1 / -1; grid-template-columns: 130px minmax(0, 1fr); grid-template-rows: none; align-items: center; }
.boxes > .prod:last-child:nth-child(odd) { grid-template-columns: 150px minmax(0, 1fr); }
.prods > .prod:last-child:nth-child(odd) .prod-vis { align-self: center; }

/* ---------- binder ---------- */
.bhead { display: flex; align-items: center; gap: 16px; margin-top: 14px !important; }
.bh-txt h1 { font: 700 clamp(20px, 5vw, 30px)/1.1 var(--display); }
.bh-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.bh-stats b { color: var(--text); }
.miles { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 16px !important; padding-bottom: 10px; }
.miles > i { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--gold) calc(var(--k) * 100%), rgba(255, 255, 255, 0.08) 0); }
.mile { display: grid; justify-items: center; padding: 8px 4px; border-radius: 10px; background: rgba(255, 255, 255, 0.025); box-shadow: inset 0 0 0 1px var(--line); font-size: 11px; color: var(--muted); }
.mile b { font-size: 14px; color: var(--text); }
.mile.done { background: rgba(232, 182, 90, 0.1); box-shadow: inset 0 0 0 1px var(--gold3); }
.mile.done span::before { content: '\2713  '; color: var(--good); }
.filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 16px !important; position: sticky; top: -14px; z-index: 3; padding: 10px 0; background: linear-gradient(180deg, rgba(12, 8, 5, 0.97) 80%, rgba(12, 8, 5, 0)); }
.search { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--line2); }
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 16px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; align-items: center; }
.chips::-webkit-scrollbar { display: none; }
.chips .sep { width: 1px; height: 20px; background: var(--line2); flex: none; margin: 0 2px; }
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px 10px; margin-top: 6px !important; }
.bc { position: relative; display: grid; gap: 4px; text-align: left; content-visibility: auto; contain-intrinsic-size: 104px 175px; }
.bc .th { transition: transform 0.15s; }
.bc:active .th { transform: scale(0.96); }
.bc.miss .th img { filter: grayscale(1) brightness(0.32) contrast(0.9); }
.bc.miss .th { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.bc-cn { position: absolute; top: 4px; left: 4px; font: 700 9px var(--ui); padding: 2px 4px; border-radius: 4px; background: rgba(0, 0, 0, 0.6); color: var(--muted); }
.bc-own { position: absolute; top: 4px; right: 4px; display: flex; gap: 3px; }
.bc-own em { font: 800 10px/1 var(--ui); font-style: normal; padding: 3px 5px; border-radius: 5px; background: rgba(0, 0, 0, 0.72); color: var(--text); }
.bc-kept { position: absolute; left: 4px; bottom: 4px; display: inline-flex; align-items: center; gap: 2px; font: 800 10px/1 var(--ui); font-style: normal; padding: 3px 5px; border-radius: 5px; color: #1d1003; background: var(--gold); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
.bc-kept svg { width: 9px; height: 9px; stroke-width: 3; }
.bh-stats span { white-space: nowrap; }
.bh-stats span svg { display: inline-block; width: 12px; height: 12px; vertical-align: -1px; margin-right: 3px; color: var(--gold); }
.bc-own em.b-f, .bc-own em.b-e { color: #1d1003; background: linear-gradient(120deg, #ffb3d0, #ffe28a, #9dffd1, #9ec5ff); }
.bc-p { font: 700 11px var(--ui); color: var(--muted); text-align: center; }
.bc:not(.miss) .bc-p { color: var(--text); }

/* ---------- market ---------- */
.mstats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 14px !important; }
.news { display: grid; gap: 6px; }
.nw { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; text-align: left; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.025); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; }
.nw-d { font: 700 10px var(--ui); color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; }
.movers { display: grid; grid-template-columns: 1fr; gap: 12px; }
.movers h3 { font: 700 11px var(--ui); color: var(--muted); text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 6px; }
.mv { width: 100%; display: grid; grid-template-columns: 34px 1fr auto; grid-template-rows: auto auto; gap: 0 10px; align-items: center; text-align: left; padding: 6px; border-radius: 10px; margin-bottom: 4px; }
.mv .th { grid-row: span 2; width: 34px; }
.mv-n { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-p { font-size: 12px; color: var(--muted); grid-column: 2; }
.mv .trend { grid-column: 3; grid-row: 1 / span 2; }
.listings, .sales { display: grid; gap: 8px; }
.ls { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.025); box-shadow: inset 0 0 0 1px var(--line); }
.ls-txt { display: grid; gap: 2px; font-size: 12px; color: var(--muted); min-width: 0; }
.ls-txt > b { font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ls-txt span b { color: var(--gold2); }
.ls-txt em { font-style: normal; font-weight: 700; }
.ls-txt em.good { color: var(--good); }
.ls-txt em.bad { color: var(--bad); }
.ls-eta { color: var(--dim); }
.tools { display: grid; gap: 8px; }
.tool { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.025); box-shadow: inset 0 0 0 1px var(--line); }
.tool > div { flex: 1; display: grid; gap: 2px; }
.tool span { font-size: 12px; color: var(--muted); }
.sl { display: grid; grid-template-columns: 50px 1fr auto auto; gap: 10px; align-items: center; font-size: 13px; padding: 6px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.sl-d { font-size: 11px; color: var(--dim); }
.sl-n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-how { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.sl b { color: var(--good); }

/* ---------- customers ---------- */
.chead { margin-top: 10px !important; }
.chead h1 { font: 700 26px var(--display); }
.chead p { font-size: 13px; color: var(--muted); margin-top: 4px; }
.custs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-top: 16px !important; }
.cu { display: grid; gap: 10px; padding: 14px; border-radius: 18px; background: linear-gradient(170deg, var(--panel2), var(--panel)); box-shadow: inset 0 0 0 1px var(--line); animation: dealIn 0.4s both; }
.cu header { display: flex; align-items: center; gap: 10px; }
.cu header div { flex: 1; display: grid; }
.cu header b { font-size: 14px; }
.cu header span { font-size: 12px; color: var(--muted); }
.cu header em { font-style: normal; font-size: 11px; color: var(--dim); white-space: nowrap; }
.ava { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; font: 800 14px var(--ui); color: #140a02; background: radial-gradient(circle at 35% 30%, hsl(var(--h) 80% 86%), hsl(var(--h) 55% 62%)); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4); }
.cu-line { font: italic 15px/1.4 var(--flav); color: var(--text); }
.cu-deal { display: grid; grid-template-columns: 74px 1fr; gap: 12px; align-items: center; }
.cu-th { width: 74px; }
.cu-txt { display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.cu-txt > b { font-size: 15px; color: var(--text); }
.cu-txt b.gold { color: var(--gold2); font-size: 14px; }
.cu-txt .have { color: var(--good); }
.cu-txt .nohave { color: var(--bad); }
.cu-stack { position: relative; width: 74px; aspect-ratio: 488 / 680; }
.cu-stack span { position: absolute; inset: 0; transform: rotate(calc((var(--i) - 1) * 8deg)) translateX(calc((var(--i) - 1) * 6px)); }
.cu-stack .th img { filter: brightness(0.75); }
.cu footer { display: flex; gap: 8px; justify-content: flex-end; }
.cu footer .btn.gold { flex: 1; }

/* ---------- toasts ---------- */
#toasts { position: fixed; z-index: 90; top: calc(var(--barh) + var(--sat) + 8px); left: 50%; transform: translateX(-50%); width: min(92vw, 440px); display: grid; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; font-size: 13px; background: rgba(30, 22, 13, 0.96); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), inset 0 0 0 1px var(--line2); opacity: 0; transform: translateY(-10px) scale(0.98); transition: opacity 0.3s, transform 0.3s; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.toast.on { opacity: 1; transform: none; }
.toast img { width: 26px; border-radius: 3px; }
.toast.good { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(139, 224, 154, 0.45); }
.toast.bad { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 138, 114, 0.5); }
.toast.gold { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), inset 0 0 0 1px var(--gold), 0 0 24px -6px var(--gold); }

/* ---------- desktop ---------- */
@media (min-width: 620px) {
  .prods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prod { grid-template-columns: 150px 1fr; grid-template-rows: none; align-items: stretch; }
  .prod-vis { align-self: center; }
  .boxes .prod { grid-template-columns: 170px 1fr; }
  .prod-btns { grid-template-columns: 1fr 1fr; }
  .boxes .prod-btns { grid-template-columns: 1fr; }
  .mstats { grid-template-columns: repeat(4, 1fr); }
  .movers { grid-template-columns: 1fr 1fr; }
  .bgrid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 16px 12px; }
  .sum-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
  .tr-card { width: 54px; }
}
@media (min-width: 900px) {
  :root { --barh: 64px; --tabh: 0px; }
  .tabs {
    top: var(--sat);
    bottom: auto;
    left: 50%;
    right: auto;
    width: 520px;
    height: var(--barh);
    transform: translateX(-50%);
    background: none;
    border: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0;
    z-index: 11;
  }
  .tabs button { flex-direction: row; gap: 8px; font-size: 13px; }
  .tabs .ic svg { width: 20px; height: 20px; }
  .tabs button.on::before { top: auto; bottom: 0; }
  .badge { position: static; margin-left: -2px; }
  #view { padding-top: 22px; }
  .prods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prod { grid-template-columns: 170px 1fr; padding: 20px; }
  .hero { min-height: 260px; }
  .hero-in { padding: 28px; }
  .sheet .sh-panel {
    left: 50%;
    top: 50%;
    bottom: auto;
    width: min(940px, 92vw);
    max-height: 88vh;
    border-radius: 22px;
    transform: translate(-50%, -46%) scale(0.97);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.25s;
    padding: 28px;
  }
  .sheet.small .sh-panel { width: min(520px, 92vw); }
  .sheet.open .sh-panel { transform: translate(-50%, -50%); opacity: 1; }
  .cs { grid-template-columns: 380px minmax(0, 1fr); align-items: start; }
  .cs-card { width: 360px; }
  .cs-vis { position: sticky; top: 0; }
  .sum-body { grid-template-columns: 330px 1fr; align-items: start; }
  .sum-best { grid-template-columns: 1fr; position: sticky; top: 0; }
  .sum-best-card { width: 100%; }
  .sc-top { padding: 14px 24px 0; }
}
@media (min-width: 900px) and (max-height: 760px) {
  :root { --cw: min(400px, calc((100vh - 270px) * 0.7176)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* mana and card symbols from Scryfall */
.sym { display: inline-block; width: 1.05em; height: 1.05em; vertical-align: -0.16em; margin: 0 0.04em; border-radius: 50%; box-shadow: -0.05em 0.08em 0 rgba(0, 0, 0, 0.6); }
.sym-t { font: 700 0.85em ui-monospace, Menlo, monospace; color: var(--gold2); }

/* bulk listing */
.ls-th { position: relative; }
.ls-q { position: absolute; right: -4px; bottom: -4px; font: 800 11px/1 var(--ui); font-style: normal; padding: 3px 5px; border-radius: 6px; color: #241304; background: linear-gradient(180deg, #ffe7a6, #e0a948); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6); }
.sec .chip { margin-left: auto; height: 28px; font-family: var(--ui); letter-spacing: 0; text-transform: none; }
.sec:has(.chip)::after { display: none; }
.bulk { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.bulk > p.dim { margin-top: -6px; }
.bk-row { display: grid; grid-template-columns: 58px 1fr; gap: 8px; align-items: center; }
.bk-row > span { font: 700 11px var(--ui); color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.bk-row .chips { flex-wrap: wrap; overflow: visible; }
.bk-price { display: grid; gap: 6px; }
.bk-pct { font-size: 13px; color: var(--muted); }
.bk-pct b { color: var(--gold2); font-size: 15px; }
.bk-price input[type='range'] { width: 100%; accent-color: var(--gold); height: 26px; }
.bk-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bk-sum > div { display: grid; padding: 10px 12px; border-radius: 12px; background: rgba(232, 182, 90, 0.07); box-shadow: inset 0 0 0 1px rgba(232, 182, 90, 0.25); }
.bk-sum span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.bk-sum b { font: 800 17px var(--ui); color: var(--gold2); }
.bk-sum i { font-style: normal; font-size: 11px; color: var(--muted); }
.bk-sum p { grid-column: 1 / -1; }
.bk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; max-height: 300px; overflow-y: auto; padding: 4px; border-radius: 12px; background: rgba(0, 0, 0, 0.2); }
.bk-card { position: relative; display: grid; gap: 2px; transition: opacity 0.15s, filter 0.15s; }
.bk-card em { position: absolute; top: 3px; right: 3px; font: 800 10px/1 var(--ui); font-style: normal; padding: 2px 4px; border-radius: 4px; background: rgba(0, 0, 0, 0.75); color: var(--text); }
.bk-card span { font: 700 10px var(--ui); color: var(--muted); text-align: center; }
.bk-card.off { opacity: 0.3; filter: grayscale(1); }
.bk-acts { position: sticky; bottom: calc(-22px - var(--sab)); display: flex; gap: 8px; padding: 12px 0 4px; background: linear-gradient(0deg, #160f09 70%, rgba(22, 15, 9, 0)); }
.bk-acts .btn { flex: 1; white-space: normal; line-height: 1.2; }
.lp-q { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
@media (max-width: 420px) { .bk-sum { grid-template-columns: 1fr 1fr; } .bk-sum > div:last-child { grid-column: span 2; } }

/* top bar fit on phones */
.bar > * { flex: none; }
.bar-brand { flex: 0 1 auto; min-width: 0; overflow: hidden; }
@media (max-width: 430px) {
  .bar { gap: 8px; padding-left: calc(12px + var(--sal)); padding-right: calc(8px + var(--sar)); }
  .bar-brand { font-size: 18px; letter-spacing: 0.1em; }
  .bar-day { font-size: 11px; gap: 5px; }
  .bar-cash { padding: 0 10px 0 5px; gap: 5px; }
  .bar-cash b { font-size: 14px; min-width: 0; }
  .bar-gear { width: 32px; }
}
@media (max-width: 360px) {
  .bar-day span { display: none; }
}
.bulk h2 { padding-right: 40px; }

/* crash log */
.clog { display: grid; gap: 10px; }
.savecode { display: grid; gap: 10px; }
.savecode h2 { padding-right: 40px; }
.savecode textarea { width: 100%; min-height: 110px; resize: vertical; padding: 10px 12px; border: 0; border-radius: 12px; font: 12px/1.4 ui-monospace, Menlo, monospace; color: var(--text); background: rgba(0, 0, 0, 0.35); box-shadow: inset 0 0 0 1px var(--line2); word-break: break-all; }
.savecode textarea:focus { outline: none; box-shadow: inset 0 0 0 1px var(--gold); }
.sv-err { margin: 0; font-size: 13px; color: var(--bad); }
.clog h2 { padding-right: 40px; }
.cl-item { border-radius: 12px; background: rgba(255, 255, 255, 0.03); box-shadow: inset 0 0 0 1px var(--line); }
.cl-item summary { display: grid; gap: 2px; padding: 10px 12px; cursor: pointer; list-style: none; }
.cl-item summary::-webkit-details-marker { display: none; }
.cl-item summary b { font-size: 13px; color: var(--bad); }
.cl-item summary b.cl-reload { color: var(--gold2); }
.cl-item summary span { font-size: 11px; color: var(--dim); }
.cl-item summary i { font-style: normal; font-size: 12px; color: var(--muted); }
.cl-item pre { margin: 0 12px 12px; padding: 10px; border-radius: 8px; background: rgba(0, 0, 0, 0.35); font: 11px/1.45 ui-monospace, Menlo, monospace; color: var(--muted); white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; }

/* Pack Luck wordmark: one line on wide screens, stacked on phones */
.bt-logo { font-size: clamp(34px, 10vw, 64px); letter-spacing: 0.1em; text-align: center; }
.bar-brand span { white-space: nowrap; }
@media (max-width: 430px) {
  .bar-brand { display: grid; font-size: 14px; line-height: 0.95; letter-spacing: 0.14em; }
}

/* Lighter effects: fewer animated and blended layers, for phones that run short of memory */
body.lite .mc-glit,
body.lite .th-sheen,
body.lite .mc.cur::before,
body.lite .pack-foil { animation: none !important; }
body.lite .mc::after,
body.lite .sc-rays,
body.lite .th-sheen,
body.lite .pack .pack-foil,
body.lite .boxv .pack-foil { display: none !important; }
body.lite .mc[data-fx='galaxy'] .mc-glit,
body.lite .mc[data-fx='gold'] .mc-glit,
body.lite .mc[data-fx='surge'] .mc-glit { display: none; }
.tg span em { display: block; font-style: normal; font-size: 12px; color: var(--dim); margin-top: 2px; }

/* update banner, sits above the tab bar so it never covers toasts */
.upd {
  position: fixed;
  z-index: 95;
  left: 50%;
  bottom: calc(var(--tabh) + var(--sab) + 10px);
  width: min(92vw, 440px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px 10px 14px;
  border-radius: 16px;
  background: rgba(30, 22, 13, 0.97);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.65), inset 0 0 0 1px var(--gold), 0 0 26px -8px var(--gold);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transform: translate(-50%, 14px);
  transition: opacity 0.3s, transform 0.3s;
}
.upd.on { opacity: 1; transform: translate(-50%, 0); }
.upd-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--good); box-shadow: 0 0 10px var(--good); animation: updPulse 1.6s ease-in-out infinite; }
@keyframes updPulse { 50% { opacity: 0.4; } }
.upd-txt { flex: 1; min-width: 0; display: grid; }
.upd-txt b { font-size: 14px; color: var(--gold2); }
.upd-txt span { font-size: 12px; color: var(--muted); }
.upd-x { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); }
.upd-x svg { width: 18px; height: 18px; }
