/* 50/50 packs — player site + odds page (SPEC REV 19: the bright ocean-blue reference look).
   Mobile first (320–430 px), then tablet and desktop. The opening show keeps its own scene colours. */

:root {
  /* the ground: measured on the reference frames */
  --sky-1: #17729f;
  --sky-2: #13608a;
  --sky-3: #10425c;
  --sky-4: #0e344b;
  --glow: #36b6ee;
  --surface: rgba(255, 255, 255, .055);
  --surface-2: rgba(255, 255, 255, .09);
  --card: rgba(40, 92, 120, .34);
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .16);
  --ink: #ffffff;
  --dim: rgba(255, 255, 255, .62);
  --faint: rgba(255, 255, 255, .46);
  --accent: #5cc8ff;
  --accent-2: #0693ee;
  --blue-1: #6cc6fb;
  --blue-2: #3aa4e8;
  --blue-3: #1a7fd0;
  --ok: #5ad69a;
  --bad: #ff8a80;
  --bg: #0e344b;
  --coral: #ff6b5b; /* the legendary rarity's warm end (opening + reveal) */

  --r-common: #ffc39a;
  --r-rare: #ff7aa2;
  --r-epic: #b26bff;
  --r-legendary: #ff8a4c;

  --font-display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --font-body: 'Nunito', ui-rounded, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Nunito', ui-rounded, system-ui, sans-serif;

  /* the selected tier (REV 14 table): used by the opening show and small accents */
  --s1: #4a5563; --s2: #12161b; --a1: #c9d1dc; --a2: #f4f6fa; --c1: #a3adbb; --c2: #4a5563;
  --rc: var(--r-common);

  --gutter: 16px;
  --bar-h: 56px;
  --tab-h: 64px;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.2, 1.35, .35, 1);
  color-scheme: dark;
}

[data-tier="silver"] { --s1: #4a5563; --s2: #12161b; --a1: #c9d1dc; --a2: #f4f6fa; --c1: #a3adbb; --c2: #4a5563; }
[data-tier="gold"] { --s1: #6b4a12; --s2: #1a1206; --a1: #f0ae3c; --a2: #ffd88a; --c1: #d39a37; --c2: #6b4a12; }
[data-tier="ruby"] { --s1: #6e0f1f; --s2: #1c0509; --a1: #ff4d6a; --a2: #ffa3b2; --c1: #d0304d; --c2: #6e0f1f; }
[data-tier="diamond"] { --s1: #5b8fb0; --s2: #0e1a24; --a1: #a8dcf6; --a2: #e6f7ff; --c1: #93c6e2; --c2: #3e6d8c; }
/* the box's metal (REV 15): the key, and the bands of the open-box window; --kg is the key's gem */
[data-tier="silver"] { --k1: #ffffff; --k2: #c3cad4; --k3: #4f5864; --kg1: #f4f7ff; --kg2: #7f93ad; }
[data-tier="gold"] { --k1: #fff4c2; --k2: #f0b443; --k3: #7a4a0c; --kg1: #ff6a88; --kg2: #a3002a; }
[data-tier="ruby"] { --k1: #f7eef0; --k2: #a9a1a6; --k3: #2f272b; --kg1: #ff5a75; --kg2: #8c0018; }
[data-tier="diamond"] { --k1: #ffffff; --k2: #c9e6f6; --k3: #4d7690; --kg1: #e9f9ff; --kg2: #4fa8d8; }

[data-r="common"] { --rc: var(--r-common); }
[data-r="rare"] { --rc: var(--r-rare); }
[data-r="epic"] { --rc: var(--r-epic); }
[data-r="legendary"] { --rc: var(--r-legendary); }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--sky-4); }
html.has-modal { overflow: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font: 700 15px/1.45 var(--font-body);
  color: var(--ink);
  background: transparent; /* the fixed .ground paints the page; html carries the fallback colour */
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* older browsers */
  overflow-x: clip; /* unlike hidden, no scroll container: the sticky top bar stays put while a sheet is open */
}
/* The ocean-blue ground stays put behind everything (a fixed layer: iOS ignores fixed backgrounds). */
.ground {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 26%, var(--sky-3) 58%, var(--sky-4) 76%, var(--sky-4) 100%);
  pointer-events: none;
}

img { max-width: 100%; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
.mono { font-family: var(--font-mono); font-weight: 900; letter-spacing: -.005em; font-variant-numeric: tabular-nums; }

:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 3px; border-radius: 12px; }
[tabindex="-1"]:focus { outline: none; }
/* the page moves focus itself (the key, Skip, "Ship it to me"); after a tap or click that draws no ring */
html[data-input="pointer"] :focus-visible { outline: none; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff;
  color: var(--sky-4);
  font-weight: 900;
  text-decoration: none;
}
.skip:focus { top: 12px; }

.notice {
  margin: 24px var(--gutter);
  padding: 16px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--dim);
}

/* ---------- the 50/50 mark + top bar ---------- */

.mark {
  font: italic 800 24px/1 var(--font-display);
  letter-spacing: .01em;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  text-shadow: 0 2px 10px rgba(0, 40, 70, .35);
}
.mark i { color: var(--accent); font-style: inherit; }
.mark-sm { font-size: 20px; }

.bar {
  position: sticky;
  top: 0;
  z-index: 45; /* above the toasts (40), so an open account menu is never covered by one */
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: calc(var(--bar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--gutter) 0;
  transition: background .25s, box-shadow .25s;
}
/* once the page scrolls, the bar gets a backing so it stays readable over the list */
.bar.is-stuck {
  background: rgba(19, 96, 138, .82);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08);
}
.bar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.bar-nav { display: none; }

.balance {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 4px 0 14px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, .26);
  background: rgba(6, 40, 62, .42);
  font: 900 16px/1 var(--font-body);
  cursor: pointer;
  transition: background .2s, transform .15s;
}
.balance:hover { background: rgba(6, 40, 62, .6); }
.balance:active { transform: scale(.97); }
.balance.bump .mono { display: inline-block; animation: bump .6s var(--ease-spring); }
.balance-plus {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--blue-1), var(--blue-2) 55%, var(--blue-3));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 2px 8px rgba(10, 110, 200, .5);
  color: #fff;
}
.balance-plus svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; }

.account { position: relative; }
.avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .3);
  background: linear-gradient(160deg, #2a8cc0, #0f4e72);
  font: 900 16px/1 var(--font-body);
  cursor: pointer;
}
.badge, .nav-badge {
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ff4d6a;
  color: #fff;
  font: 900 11px/18px var(--font-body);
  font-style: normal;
  text-align: center;
}
.badge { position: absolute; top: -5px; right: -5px; box-shadow: 0 0 0 2px var(--sky-1); }

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 40;
  display: grid;
  gap: 2px;
  min-width: 240px;
  padding: 8px;
  border-radius: 20px;
  border: 1px solid var(--line-2);
  background: #0f3c56;
  box-shadow: 0 24px 50px -18px rgba(0, 10, 20, .8);
}
.menu-email {
  padding: 8px 10px 10px;
  font-size: 13px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 10px;
  border: 0;
  border-radius: 12px;
  background: none;
  text-align: left;
  font-weight: 800;
  cursor: pointer;
}
.menu-item:hover { background: var(--surface-2); }
.menu-item svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.menu-count { margin-left: auto; font-size: 12px; color: var(--accent); }

/* Play | Admin — same look as admin.html's switch */
.mode-switch {
  display: inline-flex;
  justify-self: start;
  margin: 0 6px 6px;
  padding: 3px;
  gap: 2px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .2);
  border: 1px solid var(--line-2);
}
.mode-switch a {
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  color: var(--dim);
  text-decoration: none;
  line-height: 1.2;
}
.mode-switch a:hover { color: var(--ink); }
.mode-switch a[aria-current="page"] { background: #fff; color: var(--sky-4); }

/* ---------- buttons ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font: 800 15px/1.1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s, box-shadow .3s, background .2s, opacity .2s, filter .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { cursor: not-allowed; opacity: .55; }
.btn-sm { min-height: 36px; padding: 0 15px; font-size: 15.5px; }
/* Hit areas grow to 44 px without changing how the controls look. */
.btn-sm::after, .round-btn::after, .icon-btn::after, .balance::after, .avatar::after, .stage-arrow::after,
.toast-x::after, .toast-action::after, .sort button::after, .reveal .link::after, .bigger::after, .info-btn::after {
  content: '';
  position: absolute;
  inset: -5px -3px;
}
.btn-lg { min-height: 54px; width: 100%; font-size: 17px; }

/* the reference's glossy blue: a lit top half, a deeper bottom edge, a soft blue glow */
.btn-glossy, .btn-open {
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .26) 0%, rgba(255, 255, 255, .12) 46%, rgba(255, 255, 255, 0) 52%),
    linear-gradient(180deg, #4fb4f0 0%, #3aa4e8 55%, #2c97e2 100%);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, .55),
    inset 0 -2px 0 rgba(10, 70, 140, .35),
    0 0 0 1.5px rgba(16, 100, 170, .65),
    0 8px 22px -8px rgba(30, 150, 240, .75);
  text-shadow: 0 1px 2px rgba(0, 60, 120, .35);
}
.btn-glossy:hover:not(:disabled), .btn-open:hover:not(:disabled) { filter: brightness(1.06); }
.btn-white { background: #fff; color: #0e344b; box-shadow: 0 10px 30px -14px rgba(255, 255, 255, .5); }
.btn-white:hover:not(:disabled) { background: #eef8ff; }
.btn-outline {
  color: #fff;
  background: rgba(255, 255, 255, .1);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .38), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.btn-outline:hover:not(:disabled) { background: rgba(255, 255, 255, .16); }
.btn-ghost { color: var(--ink); background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .16); }
.btn-sell {
  color: #04210f;
  background: linear-gradient(180deg, #7dffb0, #2cff7a 55%, #18d863);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .6), 0 8px 22px -8px rgba(44, 255, 122, .7);
}

.round-btn {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .08);
  cursor: pointer;
}
.round-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#soundBtn svg { width: 20px; height: 20px; stroke-width: 1.8; }
#soundBtn[aria-pressed="true"] .i-sound-off, #soundBtn[aria-pressed="false"] .i-sound-on { display: none; }

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: rgba(92, 200, 255, .7);
  text-underline-offset: 3px;
  cursor: pointer;
}
.link:hover { color: #fff; text-decoration-color: var(--accent); }
.link-btn {
  position: relative;
  min-height: 34px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 36px; height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  cursor: pointer;
}
.icon-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.icon-btn::after { inset: -5px; }

.spinner {
  flex: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  opacity: .7;
  animation: spin .8s linear infinite;
}

/* ---------- the packs screen: category tabs, the coverflow, the title and the stats card ---------- */

main { overflow-x: clip; } /* glows and side packs may not widen the page */

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  /* one screen, like the app: the stage takes whatever the header, title, card and bottom bar leave */
  min-height: max(560px, calc(100svh - var(--bar-h) - env(safe-area-inset-top) - var(--tab-h) - env(safe-area-inset-bottom)));
  padding: 0 var(--gutter) 16px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, auto));
  justify-content: space-between;
  margin-top: 10px;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .12);
}
.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 42px;
  padding: 0 2px 2px;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, .5);
  font: 800 14px/1 var(--font-body);
  white-space: nowrap;
  cursor: pointer;
  transition: color .2s;
}
.tab svg { flex: none; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tab:hover { color: rgba(255, 255, 255, .78); }
.tab[aria-selected="true"] { color: #fff; }
.tab::after {
  content: '';
  position: absolute;
  left: -6px; right: -6px; bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: #fff;
  transform: scaleX(0);
  transition: transform .3s var(--ease-out);
}
.tab[aria-selected="true"]::after { transform: none; }

.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 210px;
  margin: 0 calc(-1 * var(--gutter));
  perspective: 1100px;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}
.stage-glow {
  position: absolute;
  left: 58%; top: 34%;
  width: min(118vw, 680px);
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(54, 182, 238, .95), rgba(54, 182, 238, .55) 38%, rgba(40, 150, 210, .18) 70%, transparent);
  pointer-events: none;
}
.stage-rings { position: absolute; left: 50%; top: 52%; width: 0; height: 0; pointer-events: none; }
.stage-rings i {
  position: absolute;
  left: 0; top: 0;
  width: var(--d); height: var(--d);
  translate: -50% -50%;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.stage-rings i:nth-child(1) { --d: min(70vw, 300px); }
.stage-rings i:nth-child(2) { --d: min(118vw, 520px); }
.stage-rings i:nth-child(3) { --d: min(170vw, 760px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07); }

/* the flow's own plane sits in front of the packs pushed back in 3-D: only the packs take taps */
.flow { position: absolute; inset: 0; transform-style: preserve-3d; pointer-events: none; }
.flow-item { pointer-events: auto; }
.flow.is-swapping { transition: opacity .18s ease; opacity: 0; }
.flow-item {
  position: absolute;
  left: 50%; top: 50%;
  width: var(--item-w, 180px);
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  translate: -50% -50%;
  transform-style: preserve-3d;
  will-change: transform, opacity;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.flow-item[aria-checked="true"] { cursor: grab; }
.flow.is-dragging .flow-item { cursor: grabbing; }
.flow-item:focus-visible { outline-offset: 8px; border-radius: 18px; }
.flow-float { display: block; }
.flow-item[aria-checked="true"] .flow-float { animation: float 4.2s ease-in-out infinite; }
.flow-item.is-poked .flow-float { animation: poke .5s var(--ease-out), float 4.2s ease-in-out .5s infinite; }
.flow-tilt { display: block; transition: transform .25s var(--ease-out); transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.flow.is-tilting .flow-tilt { transition: none; }
.flow-floor {
  position: absolute;
  left: 18%; right: 18%;
  bottom: -14px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 20, 40, .45), transparent);
  pointer-events: none;
}
.flow-item.is-away { visibility: hidden; }

.stage-arrow {
  position: absolute;
  top: 50%;
  z-index: 200;
  display: none;
  place-items: center;
  width: 46px; height: 46px;
  margin-top: -23px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .3);
  background: rgba(8, 50, 78, .4);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: opacity .2s, background .2s, transform .15s;
}
.stage-arrow.is-prev { left: max(var(--gutter), calc(50% - 560px)); }
.stage-arrow.is-next { right: max(var(--gutter), calc(50% - 560px)); }
.stage-arrow:hover:not(:disabled) { background: rgba(8, 50, 78, .65); }
.stage-arrow:active:not(:disabled) { transform: scale(.94); }
.stage-arrow:disabled { opacity: .25; cursor: default; }
.stage-arrow svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.dots { display: flex; justify-content: center; align-items: center; gap: 8px; height: 18px; margin-top: 4px; }
.dot {
  width: 7px; height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #356077;
  transition: background .25s, transform .25s;
}
.dot.is-on { background: var(--accent-2); transform: scale(1.35); box-shadow: 0 0 8px rgba(6, 147, 238, .6); }

.title-row { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 40px; margin: 8px 0 18px; }
.box-name {
  font: 800 26px/1.1 var(--font-display);
  letter-spacing: .005em;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 30, 50, .45);
}
.info-btn {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 24px; height: 24px;
  padding: 0;
  border: 1.5px solid rgba(255, 255, 255, .5);
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  cursor: pointer;
}
.info-btn span { font: italic 600 15px/1 Georgia, 'Times New Roman', serif; color: #fff; margin-top: 1px; }
.info-btn::after { inset: -10px; }

.stats-card {
  padding: 14px 16px 16px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), 0 18px 40px -26px rgba(0, 10, 20, .7);
}
.stats { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.stat { display: grid; gap: 1px; min-width: 0; }
.stat span { font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, .66); }
.stat b { font: 900 22px/1.1 var(--font-body); letter-spacing: -.01em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat.is-max { text-align: right; }
.odds-pill {
  display: grid;
  gap: 1px;
  justify-items: center;
  min-width: 104px;
  padding: 7px 18px 8px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .04));
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .26), inset 0 1px 0 rgba(255, 255, 255, .18), 0 6px 16px -10px rgba(0, 0, 0, .6);
  cursor: pointer;
  transition: background .2s;
}
.odds-pill:hover { background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .06)); }
.odds-pill span { font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, .66); }
.odds-pill b { font: 900 22px/1.1 var(--font-body); }

.btn-open {
  width: 100%;
  min-height: 52px;
  margin-top: 14px;
  border-radius: 17px;
  font: 800 17px/1 var(--font-body);
  overflow: hidden;
}
.btn-open .mono { font-weight: 900; }
.btn-open:disabled { opacity: .72; filter: saturate(.7); }
.btn-open::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .38) 48%, transparent 66%);
  transform: translateX(-120%);
  animation: sweep 5.2s ease-in-out 1.6s infinite;
  pointer-events: none;
}
.btn-open:disabled::after { display: none; }

/* "Your Ruby Pack is paid for and still locked": over the top of the stage, never pushing it */
.resume {
  position: absolute;
  left: var(--gutter); right: var(--gutter);
  top: 8px;
  z-index: 300;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 8px;
  max-width: 440px;
  margin: 0 auto;
  padding: 12px 8px 12px 16px;
  border-radius: 20px;
  background: rgba(8, 44, 66, .9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1.5px rgba(92, 200, 255, .55), 0 14px 30px -18px rgba(0, 0, 0, .8);
  text-align: left;
  animation: toast-in .35s var(--ease-spring);
}
.resume-text { font-size: 14px; font-weight: 800; }
.resume .btn { grid-column: 1 / -1; grid-row: 2; width: 100%; }
.resume-x {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  color: var(--dim);
  cursor: pointer;
}
.resume-x::after { content: ''; position: absolute; inset: -4px; }
.resume-x svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* The Open button, docked above the bottom bar while the page pushes the real one below the fold */
.open-dock {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
  z-index: 29;
  padding: 18px max(var(--gutter), env(safe-area-inset-right)) 10px max(var(--gutter), env(safe-area-inset-left));
  background: linear-gradient(180deg, transparent, rgba(14, 52, 75, .94) 45%);
  pointer-events: none;
}
.open-dock .btn-open { display: flex; width: min(100%, 440px); min-height: 50px; margin: 0 auto; pointer-events: auto; }

/* ---------- pack art (REV 19): our foil pack + the category's look layered on, all following the tilt ---------- */

.pk {
  position: relative;
  display: block;
  aspect-ratio: 590 / 1100;
  container-type: inline-size;
}
.pk-base {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  filter: drop-shadow(0 18px 26px rgba(0, 20, 40, .45));
  pointer-events: none;
  -webkit-user-drag: none;
}
/* everything painted on the foil is clipped to the pack's own silhouette (its alpha) */
.pk-skin {
  position: absolute;
  inset: 0;
  overflow: hidden;
  -webkit-mask: var(--pk-mask) center / 100% 100% no-repeat;
  mask: var(--pk-mask) center / 100% 100% no-repeat;
  pointer-events: none;
}
.pk-skin i { position: absolute; inset: 0; }
.pk-wash { mix-blend-mode: overlay; }
.pk-burst {
  left: 50%; top: 47%;
  inset: auto;
  width: 190cqw; aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  mix-blend-mode: screen;
  opacity: .5;
}
.pk-sheen {
  left: -60%; right: -60%;
  background: linear-gradient(115deg, transparent 34%, rgba(255, 255, 255, .5) 46%, rgba(255, 255, 255, .08) 52%, transparent 60%);
  mix-blend-mode: soft-light;
  transform: translateX(var(--sheen, 0%));
  transition: transform .3s var(--ease-out);
}
.pk-crimp {
  /* the crimped ends stay plain foil, like a real pack */
  background: linear-gradient(180deg, rgba(0, 0, 0, .18) 0 7.5%, transparent 7.6% 93%, rgba(0, 0, 0, .18) 93.1%);
  mix-blend-mode: multiply;
}
.pk-emblem {
  position: absolute;
  left: 50%; top: 47%;
  width: 74cqw;
  translate: -50% -50%;
  filter: drop-shadow(0 0 7cqw var(--pk-glow, rgba(255, 220, 90, .65))) drop-shadow(0 2cqw 3cqw rgba(0, 0, 0, .35));
  pointer-events: none;
  -webkit-user-drag: none;
}
.pk-mark {
  position: absolute;
  left: 0; right: 0;
  top: 11.5%;
  display: grid;
  justify-items: center;
  font: italic 800 20cqw/.86 var(--font-display);
  letter-spacing: .01em;
  color: #fff;
  -webkit-text-stroke: 1.6cqw var(--pk-ink, #0b3a8c);
  paint-order: stroke fill;
  text-shadow: 0 1.6cqw 0 var(--pk-ink, #0b3a8c), 0 3cqw 5cqw rgba(0, 0, 0, .45);
  pointer-events: none;
}
.pk-mark i { font-style: inherit; color: var(--pk-slash, #ffd23f); }
.pk-mark small {
  margin-top: 1.6cqw;
  padding: .9cqw 3.4cqw .7cqw;
  border-radius: 1.6cqw;
  background: var(--pk-ink, #0b3a8c);
  font: 800 8.6cqw/1 var(--font-display);
  letter-spacing: .24em;
  text-indent: .24em;
  -webkit-text-stroke: 0;
  text-shadow: none;
  color: #fff;
}
.pk-name {
  position: absolute;
  left: 0; right: 0;
  bottom: 13%;
  font: italic 800 14cqw/1 var(--font-display);
  letter-spacing: .01em;
  text-align: center;
  color: #fff;
  -webkit-text-stroke: 1.1cqw rgba(10, 16, 40, .78);
  paint-order: stroke fill;
  text-shadow: 0 1.2cqw 3cqw rgba(0, 0, 0, .55);
  pointer-events: none;
}

/* category looks: a coloured light behind the emblem and streaks in the category's colours; the tier keeps its
   foil colour everywhere else, so a Silver Pokémon pack still reads silver */
.pk[data-section="pokemon"] { --pk-ink: #0b3a8c; --pk-slash: #ffd23f; --pk-glow: rgba(255, 214, 60, .75); }
.pk[data-section="pokemon"] .pk-wash { background: radial-gradient(54% 38% at 50% 47%, rgba(255, 220, 70, .95), rgba(255, 150, 20, .5) 55%, transparent 100%); }
.pk[data-section="pokemon"] .pk-burst { background: repeating-conic-gradient(from 0deg, rgba(255, 246, 200, .6) 0deg 2.5deg, transparent 2.5deg 15deg); -webkit-mask-image: radial-gradient(circle, #000 10%, transparent 34%); mask-image: radial-gradient(circle, #000 10%, transparent 34%); }
.pk[data-section="sports"] { --pk-ink: #3b0f7a; --pk-slash: #ff5fa8; --pk-glow: rgba(255, 90, 200, .7); }
.pk[data-section="sports"] .pk-wash { background: radial-gradient(58% 38% at 50% 48%, rgba(255, 70, 170, .95), rgba(140, 60, 255, .55) 55%, transparent 100%), linear-gradient(150deg, transparent 30%, rgba(160, 70, 255, .4) 46%, transparent 47%, transparent 58%, rgba(255, 80, 180, .4) 59%, transparent 72%); }
.pk[data-section="sports"] .pk-burst { background: repeating-conic-gradient(from 10deg, rgba(255, 200, 245, .55) 0deg 2deg, transparent 2deg 12deg); -webkit-mask-image: radial-gradient(circle, #000 9%, transparent 32%); mask-image: radial-gradient(circle, #000 9%, transparent 32%); }
.pk[data-section="everyday"] { --pk-ink: #13102e; --pk-slash: #7cf3ff; --pk-glow: rgba(120, 240, 255, .7); }
.pk[data-section="everyday"] .pk-wash { background: radial-gradient(60% 40% at 50% 48%, rgba(255, 63, 164, .95), rgba(124, 243, 255, .6) 60%, transparent 100%); }
.pk[data-section="everyday"] .pk-burst { background: repeating-linear-gradient(115deg, rgba(255, 255, 255, .5) 0 1.6cqw, transparent 1.6cqw 8cqw); -webkit-mask-image: radial-gradient(closest-side, #000 10%, transparent 62%); mask-image: radial-gradient(closest-side, #000 10%, transparent 62%); }
/* the darker foils carry the light a little harder */
.pk[data-tier="ruby"] .pk-wash, .pk[data-tier="gold"] .pk-wash { mix-blend-mode: soft-light; }
.pk[data-tier="ruby"] .pk-burst { opacity: .62; }

/* Watches: the chest art (REV 19 "Ruby Watch Box") */
.chest { position: relative; display: block; aspect-ratio: 720 / 671; }
.chest img {
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 24px rgba(0, 20, 40, .5));
  pointer-events: none;
  -webkit-user-drag: none;
}

/* a mini pack/box for sheets, rows and the Add credit header */
.pk-mini { width: 44px; flex: none; }
.chest.pk-mini { width: 64px; }

/* ---------- prize visuals: the graded holder (REV 18), raw cards, cutouts, cash ---------- */

.pv { position: relative; display: block; container-type: inline-size; }
.pv-glow {
  position: absolute;
  left: 50%; top: 50%;
  width: 120%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--rc) 46%, transparent), transparent 72%);
  pointer-events: none;
}

/* a product cutout floating on the scene: no plate, a soft contact shadow, a glow in its rarity colour */
.pv-item { aspect-ratio: 1; }
.pv-item > img {
  position: absolute;
  inset: 6%;
  width: 88%;
  height: 88%;
  object-fit: contain;
  filter: drop-shadow(0 4cqw 4cqw rgba(0, 18, 36, .45));
}
/* a photo shot on white or a colour (older catalog images): a soft studio plate behind it */
.pv-item.is-plate { border-radius: 16%; overflow: hidden; background: var(--plate, #e9f1f6); }
.pv-item.is-plate.is-light { background: radial-gradient(120% 95% at 50% 30%, #ffffff 0%, #f1f6f9 55%, #dfe9ef 100%); }
.pv-item.is-plate > img { inset: 9%; width: 82%; height: 82%; filter: none; }
.pv-item.is-plate.is-light > img { mix-blend-mode: multiply; }
.pv-item.is-empty { display: grid; place-items: center; border-radius: 16%; background: rgba(255, 255, 255, .06); }
.pv-item.is-empty > span { font: italic 800 18cqw/1 var(--font-display); color: rgba(255, 255, 255, .2); }
.pv-item::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }

.pv-cash {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2cqw;
  border-radius: 16%;
  background:
    radial-gradient(90% 70% at 50% 28%, rgba(76, 201, 133, .35), transparent 70%),
    linear-gradient(180deg, #0f3d29, #06190f);
}
.pv-cash img { width: 66%; height: auto; }
.cash-amount {
  font: italic 800 17cqw/1 var(--font-display);
  letter-spacing: .01em;
  color: #eafff3;
  text-shadow: 0 0 18px rgba(76, 201, 133, .8);
}
.cash-amount small { display: block; margin-top: 1.5cqw; font: 900 5.5cqw/1 var(--font-body); letter-spacing: .3em; color: #9de9bf; text-align: center; }
@container (max-width: 64px) {
  .pv-cash img { width: 56%; }
  .cash-amount { font-size: 21cqw; }
  .cash-amount small { display: none; }
}

/* the holder: thick clear acrylic, bevels, the label insert, the inner well — drawn, so it is crisp at any size */
.pv-slab { aspect-ratio: 62 / 100; }
.slab-tilt {
  position: absolute;
  inset: 0;
  transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .4s var(--ease-out);
  will-change: transform;
}
.pv-slab.is-tilting .slab-tilt { transition: none; }
.slab {
  position: absolute;
  inset: 0;
  border-radius: 5cqw;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .42) 0%, rgba(255, 255, 255, .12) 18%, rgba(255, 255, 255, .05) 50%, rgba(255, 255, 255, .14) 82%, rgba(255, 255, 255, .34) 100%),
    rgba(200, 225, 240, .16);
  box-shadow:
    inset 0 0 0 .7cqw rgba(255, 255, 255, .7),
    inset 0 0 0 1.3cqw rgba(120, 160, 190, .25),
    inset 0 0 0 2.4cqw rgba(255, 255, 255, .12),
    inset 1.6cqw 1.6cqw 2.2cqw rgba(255, 255, 255, .32),
    inset -1.4cqw -1.8cqw 2.6cqw rgba(0, 20, 40, .35),
    0 4cqw 9cqw rgba(0, 14, 30, .5),
    0 .6cqw 1.2cqw rgba(0, 14, 30, .35);
  overflow: hidden;
}
/* the inner frame of the case: a raised rim with a hairline, around label and card */
.slab::before {
  content: '';
  position: absolute;
  inset: 3.6cqw;
  border-radius: 3cqw;
  box-shadow:
    inset 0 0 0 .45cqw rgba(255, 255, 255, .55),
    inset 0 0 0 1.1cqw rgba(255, 255, 255, .08),
    0 0 0 .45cqw rgba(0, 30, 60, .18);
}
.slab-label {
  position: absolute;
  left: 6.4cqw; right: 6.4cqw;
  top: 6cqw;
  height: 29cqw;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 1fr auto;
  gap: 0 2cqw;
  padding: 2.4cqw 3cqw 1.8cqw;
  border-radius: 1.6cqw;
  background: var(--lbl-bg, #fbfbf7);
  color: var(--lbl-ink, #151515);
  box-shadow: inset 0 0 0 .8cqw var(--lbl-frame, #c8102e), inset 0 0 0 1.25cqw var(--lbl-bg, #fbfbf7), inset 0 0 0 1.6cqw var(--lbl-frame-2, rgba(200, 16, 46, .35)), 0 .5cqw 1cqw rgba(0, 0, 0, .25);
  font-family: 'Arial Narrow', 'Roboto Condensed', 'Barlow Condensed', system-ui, sans-serif;
  overflow: hidden;
}
.lbl-left { display: grid; align-content: start; gap: .3cqw; min-width: 0; padding-top: .6cqw; }
.lbl-left span {
  font: 800 calc(4.3cqw * var(--fit, 1))/1.12 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif; /* --fit: app.js fitLabel */
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lbl-left .lbl-name { font-size: calc(5.1cqw * var(--fit, 1)); }
.lbl-right { display: grid; justify-items: end; align-content: start; padding-top: .3cqw; }
.lbl-co { font: 900 6.2cqw/1 var(--font-body); letter-spacing: .04em; color: var(--lbl-co, #c8102e); }
.lbl-words { margin-top: .8cqw; font: 800 3.7cqw/1 'Barlow Condensed', system-ui, sans-serif; letter-spacing: .04em; white-space: nowrap; }
.lbl-grade { font: 900 10.5cqw/.95 var(--font-body); letter-spacing: -.02em; }
.lbl-cert {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2cqw;
  font: 800 3.3cqw/1 'Barlow Condensed', system-ui, sans-serif;
  letter-spacing: .1em;
  opacity: .8;
}
.lbl-bars {
  width: 26cqw; height: 3.2cqw;
  background: repeating-linear-gradient(90deg, currentColor 0 .35cqw, transparent .35cqw .7cqw, currentColor .7cqw 1.4cqw, transparent 1.4cqw 1.75cqw, currentColor 1.75cqw 2cqw, transparent 2cqw 2.6cqw);
  opacity: .85;
}
.slab-well {
  position: absolute;
  left: 7.2cqw; right: 7.2cqw;
  top: 38.5cqw;
  bottom: 7cqw;
  display: grid;
  place-items: center;
  border-radius: 2.4cqw;
  background: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .03));
  box-shadow: inset 0 0 0 .4cqw rgba(255, 255, 255, .45), inset 0 .8cqw 2cqw rgba(0, 20, 40, .35);
}
.slab-card {
  display: block;
  width: 91%;
  aspect-ratio: 63 / 88;
  object-fit: cover;
  border-radius: 3.4cqw;
  box-shadow: 0 .6cqw 1.4cqw rgba(0, 0, 0, .4), 0 0 0 .25cqw rgba(0, 0, 0, .25);
  background: rgba(255, 255, 255, .06);
}
/* the slow light sweep across the plastic, and the glare that follows the tilt */
.slab-sweep { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.slab-sweep::before {
  content: '';
  position: absolute;
  top: -30%; bottom: -30%;
  left: 0;
  width: 46%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5) 45%, rgba(255, 255, 255, .7) 50%, rgba(255, 255, 255, .5) 55%, transparent);
  transform: translateX(-140%) rotate(16deg);
  animation: slab-sweep 6.5s cubic-bezier(.45, 0, .25, 1) var(--sweep-delay, 1s) infinite;
  mix-blend-mode: soft-light;
}
.slab-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(70% 50% at var(--gx, 30%) var(--gy, 18%), rgba(255, 255, 255, .34), transparent 70%);
  mix-blend-mode: screen;
  pointer-events: none;
}
/* per company: label colours only, never a logo */
.pv-slab[data-co="BGS"] { --lbl-bg: #17191e; --lbl-ink: #e9edf2; --lbl-frame: #b9c0c9; --lbl-frame-2: rgba(185, 192, 201, .3); --lbl-co: #d9dee5; }
.pv-slab[data-co="BGS"][data-grade="9.5"], .pv-slab[data-co="BGS"][data-grade="10"] { --lbl-frame: #d8b45a; --lbl-co: #f1d27c; --lbl-frame-2: rgba(216, 180, 90, .35); }
.pv-slab[data-co="CGC"] { --lbl-bg: #fbfcff; --lbl-ink: #10213f; --lbl-frame: #1f4e9c; --lbl-frame-2: rgba(31, 78, 156, .3); --lbl-co: #1f4e9c; }
.pv-slab[data-co="SGC"] { --lbl-bg: #121212; --lbl-ink: #f2f2f2; --lbl-frame: #f2f2f2; --lbl-frame-2: rgba(255, 255, 255, .25); --lbl-co: #ffffff; }
.pv-slab[data-co="TAG"], .pv-slab[data-co="ACE"] { --lbl-frame: #2b2b2b; --lbl-co: #2b2b2b; --lbl-frame-2: rgba(0, 0, 0, .2); }
/* thumbnails: the label is a colour band, no text to blur; no animation */
@container (max-width: 110px) {
  .slab-label > * { visibility: hidden; }
  .slab-label { height: 22cqw; }
  .slab-well { top: 33cqw; }
  .slab-sweep { display: none; }
}
/* Collection tiles and other mid-size thumbnails: big enough to read the company and the grade, so the label keeps
   those two (a blank label there reads as a broken holder) */
@container (min-width: 65px) and (max-width: 110px) {
  .slab-label { display: flex; align-items: center; justify-content: space-between; padding: 0 6cqw; }
  .slab-label > .lbl-left, .lbl-right > .lbl-words, .lbl-cert > :not(.lbl-co) { display: none; }
  .slab-label > .lbl-right, .slab-label > .lbl-cert { visibility: visible; padding: 0; }
  .lbl-cert { order: -1; opacity: 1; }
  .lbl-co { font-size: 9cqw; }
  .lbl-grade { font-size: 14cqw; line-height: 1; }
}

/* a graded card shot in its holder (photo): float it, sweep it */
.pv-slabphoto { aspect-ratio: 1; }
.pv-slabphoto > img { position: absolute; inset: 4%; width: 92%; height: 92%; object-fit: contain; filter: drop-shadow(0 4cqw 4cqw rgba(0, 18, 36, .45)); }
.pv-slabphoto.is-plate { border-radius: 16%; overflow: hidden; background: radial-gradient(120% 95% at 50% 30%, #ffffff 0%, #f1f6f9 55%, #dfe9ef 100%); }
.pv-slabphoto.is-plate > img { filter: none; mix-blend-mode: multiply; }

/* a raw card: rounded corners and a holo shimmer */
.pv-card { aspect-ratio: 63 / 88; }
.pv-card > img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 4.5cqw; object-fit: cover; box-shadow: 0 3cqw 6cqw rgba(0, 14, 30, .5); }
.pv-card .holo { position: absolute; inset: 0; border-radius: 4.5cqw; overflow: hidden; mix-blend-mode: color-dodge; opacity: .55; pointer-events: none; }
.pv-card .holo::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: -100%;
  width: 300%;
  background: linear-gradient(115deg, transparent 20%, rgba(255, 0, 170, .5) 32%, rgba(0, 240, 255, .5) 42%, rgba(255, 255, 90, .5) 52%, rgba(120, 90, 255, .5) 62%, transparent 74%);
  animation: holo 7s linear infinite;
}

/* ---------- top pulls: a fan of the best (cards) and a row of big tiles ---------- */

.pulls, .inside, .ticker, .best { max-width: 1100px; margin: 0 auto; }
.pulls { padding: 22px var(--gutter) 6px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sec-head h2, .inside-head h2 { font: 800 25px/1.1 var(--font-display); letter-spacing: .005em; }
.pull-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 40%);
  gap: 12px;
  margin: 0 calc(-1 * var(--gutter));
  padding: 4px var(--gutter) 14px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.pull-row::-webkit-scrollbar { display: none; }
.pull {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 12px 12px 12px;
  border: 0;
  border-radius: 22px;
  background:
    radial-gradient(90% 60% at 50% 32%, color-mix(in srgb, var(--rc) 22%, transparent), transparent 70%),
    rgba(6, 36, 56, .5);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 30%, rgba(255, 255, 255, .06)), 0 14px 30px -20px rgba(0, 10, 20, .8);
  text-align: left;
  cursor: pointer;
  scroll-snap-align: start;
}
.pull .pv { width: 100%; margin: 4px auto 10px; }
.pull .pv-slab, .pull .pv-card { width: 84%; }
/* the fan: the best holders spread like a hand of cards, light catching the middle one */
.pull-fan {
  --fan-w: min(29vw, 168px);
  --fan-step: min(14.5vw, 76px);
  position: relative;
  display: block;
  width: 100%;
  height: calc(var(--fan-w) * 1.61 + 46px);
  margin: 4px 0 14px;
  padding: 0;
  border: 0;
  background: radial-gradient(60% 55% at 50% 58%, rgba(54, 182, 238, .45), transparent 70%);
  cursor: pointer;
}
.fan-card {
  position: absolute;
  left: 50%;
  bottom: 30px;
  width: var(--fan-w);
  transform-origin: 50% 130%;
  transition: transform .35s var(--ease-out);
}
.fan-card .pv { width: 100%; }
.fan-card:not([style*="--slot:0"]) .slab-sweep { display: none; }
.fan-tag {
  position: absolute;
  left: 50%;
  bottom: 0;
  translate: -50% 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(4, 30, 48, .78);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  font: 900 13px/1 var(--font-body);
  white-space: nowrap;
}
/* card categories: taller tiles so the holder's label reads */
[data-section="pokemon"] .pull-row, [data-section="sports"] .pull-row { grid-auto-columns: minmax(158px, 46%); }
.pull-value { font: 900 19px/1.1 var(--font-body); }
.pull-name { margin-top: 2px; font-size: 13px; font-weight: 800; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pull-meta { margin-top: auto; padding-top: 6px; font-size: 12px; font-weight: 800; color: var(--faint); }
.pull-odds {
  position: absolute;
  top: 10px; left: 10px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(4, 30, 48, .72);
  font: 900 10.5px/1 var(--font-body);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.pull-odds.is-grand { color: #2a0f06; background: linear-gradient(100deg, #ffd27a, #ff8a4c); }

/* ---------- What's inside: every prize, paged ---------- */

.inside { padding: 14px var(--gutter) 22px; }
.inside-head { display: grid; gap: 12px; margin-bottom: 12px; }
.inside-sub { margin-top: 4px; font-size: 13px; font-weight: 700; color: var(--dim); }
.inside-sub .mono { color: var(--ink); }

.sort {
  display: inline-flex;
  justify-self: start;
  padding: 3px;
  gap: 2px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .16);
  box-shadow: inset 0 0 0 1px var(--line);
}
.sort button {
  position: relative;
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-size: 13px;
  font-weight: 800;
  color: var(--dim);
  cursor: pointer;
  transition: background .2s, color .2s;
}
.sort button[aria-pressed="true"] { background: #fff; color: var(--sky-4); }
.sort button::after { inset: -6px 0; }

.rows { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 84px;
  padding: 8px 14px 8px 8px;
  border-radius: 18px;
  background: rgba(6, 36, 56, .42);
  box-shadow: inset 0 0 0 1px var(--line);
  content-visibility: auto;
  contain-intrinsic-size: auto 68px;
}
.row-art { display: grid; place-items: center; width: 64px; height: 68px; }
.row-art .pv { width: 64px; }
.row-art .pv-slab { width: 42px; }
.row-art .pv-card { width: 48px; }
.row-name { font-size: 14px; font-weight: 800; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.row-detail { margin-top: 2px; font-size: 12px; font-weight: 700; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; min-width: 0; }
.row-odds { font-size: 12px; font-weight: 800; color: var(--faint); white-space: nowrap; }
.row-value { font: 900 16px/1.1 var(--font-body); white-space: nowrap; text-align: right; }

.r-chip {
  flex: none;
  padding: 3px 7px;
  border-radius: 6px;
  font: 900 9.5px/1.1 var(--font-body);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--rc);
  background: color-mix(in srgb, var(--rc) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 40%, transparent);
}
[data-r="legendary"] .r-chip { color: #2a0f06; background: linear-gradient(100deg, #ffd27a, #ff8a4c); box-shadow: none; }

.row.is-skeleton { grid-template-columns: 64px 1fr; grid-template-rows: auto auto; row-gap: 6px; }
.row.is-skeleton .row-art { grid-row: 1 / 3; border-radius: 14px; background: linear-gradient(100deg, rgba(255, 255, 255, .04) 30%, rgba(255, 255, 255, .1) 50%, rgba(255, 255, 255, .04) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
.sk-line { display: block; height: 12px; width: 70%; border-radius: 6px; background: rgba(255, 255, 255, .08); align-self: end; }
.sk-line.short { width: 35%; align-self: start; }

.btn-more {
  width: 100%;
  min-height: 52px;
  margin-top: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, .08);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.btn-more:hover { background: rgba(255, 255, 255, .13); }

.how { margin-top: 16px; padding: 4px 2px; color: var(--dim); font-size: 14px; }
.how summary { cursor: pointer; font-weight: 800; color: var(--ink); width: max-content; max-width: 100%; padding: 12px 0; margin: -12px 0; }
.how p { margin-top: 8px; max-width: 70ch; }

/* ---------- Just won + best hit this week ---------- */

.ticker { padding: 8px 0 18px; }
.ticker-label, .rw-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font: 900 12px/1 var(--font-body);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
}
.ticker-label { padding: 0 var(--gutter); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #2cff7a; box-shadow: 0 0 0 0 rgba(44, 255, 122, .6); animation: live 1.8s ease-out infinite; }
.ticker-viewport {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.ticker-track {
  display: flex;
  gap: 10px;
  width: max-content;
  margin: 0;
  padding: 0 var(--gutter);
  list-style: none;
  animation: marquee var(--tk-duration, 40s) linear infinite;
}
.ticker-track.is-still { animation: none; }
.ticker-viewport:hover .ticker-track { animation-play-state: paused; }
.tk {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 7px;
  border-radius: 16px;
  background: rgba(6, 36, 56, .5);
  box-shadow: inset 0 0 0 1px var(--line);
  white-space: nowrap;
}
.tk .pv { width: 42px; flex: none; }
.tk .pv-slab { width: 28px; }
.tk-text { display: grid; gap: 2px; font-size: 13px; }
.tk-line b { font-weight: 900; }
.tk-line strong { font-weight: 800; }
.tk-meta { font-size: 12px; color: var(--faint); font-weight: 700; }
.tk-meta .mono { color: var(--ink); }

.best { padding: 0 var(--gutter) 26px; }
.best-label { margin-bottom: 10px; font: 900 12px/1.2 var(--font-body); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.best-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 8px 8px;
  border-radius: 20px;
  background: radial-gradient(120% 140% at 0% 50%, color-mix(in srgb, var(--rc) 18%, transparent), transparent 60%), rgba(6, 36, 56, .5);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 35%, transparent);
}
.best-card .row-art { width: 64px; }
.best-name { font-weight: 900; font-size: 14px; line-height: 1.3; }
.best-meta { font-size: 12px; color: var(--faint); font-weight: 700; margin-top: 2px; }
.best-value { font: 900 18px/1.1 var(--font-body); }

/* ---------- Collection, Rewards, Profile ---------- */

.page { max-width: 1100px; margin: 0 auto; padding: 14px var(--gutter) 30px; }
.page-head { margin-bottom: 16px; }
.page-head h1 { font: 800 34px/1.05 var(--font-display); letter-spacing: .005em; }
.page-sub { margin-top: 6px; font-size: 14px; font-weight: 700; color: var(--dim); }
.page-sub .mono { color: var(--ink); }

.top-grid, .collection, .rw-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rw-block + .rw-block { margin-top: 26px; }
.rw-sub { margin: -4px 0 12px; font-size: 13px; color: var(--faint); font-weight: 700; }

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 12px;
  border: 0;
  border-radius: 22px;
  text-align: left;
  background:
    radial-gradient(90% 55% at 50% 30%, color-mix(in srgb, var(--rc) 20%, transparent), transparent 70%),
    rgba(6, 36, 56, .5);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 -3px 0 color-mix(in srgb, var(--rc) 70%, transparent);
  overflow: hidden;
}
button.tile { cursor: pointer; transition: transform .2s var(--ease-out); }
button.tile:hover { transform: translateY(-2px); }
.tile-art { display: grid; place-items: center; min-height: 0; aspect-ratio: 1 / 1.05; margin-bottom: 10px; }
.tile-art .pv { width: 86%; }
.tile-art .pv-slab { width: auto; height: 100%; aspect-ratio: 62 / 100; }
.tile-art .pv-card { width: auto; height: 92%; aspect-ratio: 63 / 88; }
.tile-value { font: 900 19px/1.1 var(--font-body); }
.tile-name { margin-top: 2px; font-size: 13px; font-weight: 800; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-meta, .mine-detail { margin-top: 2px; font-size: 12px; color: var(--faint); font-weight: 700; }
.tile-actions { display: grid; gap: 8px; margin-top: auto; padding-top: 10px; }
.tile-actions .btn { width: 100%; }
.tile-sell { min-height: 38px; font-size: 13.5px; }
.status { display: inline-block; padding: 6px 10px; border-radius: 999px; background: rgba(255, 255, 255, .08); font-size: 12px; font-weight: 900; color: var(--dim); }
.status-ok { color: var(--ok); background: rgba(90, 214, 154, .12); }
.status-sold { color: #2cff7a; background: rgba(44, 255, 122, .1); }
/* REV 26: the small, quiet tag on a forced (demo) prize — the reveal, the pack's pull line and the Collection tile */
.demo-tag {
  display: inline-block;
  padding: 4px 8px 3px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  background: rgba(18, 10, 12, .5);
  font: 900 10px/1 var(--font-body);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .72);
  text-shadow: none;
  vertical-align: middle;
}
.tile-actions .demo-tag { justify-self: start; }
.ps-tag .demo-tag { margin-left: 8px; }
/* REV 21: shipping status in Collection — the tracking link and a delivered gift card's code. */
.mine-track a { color: var(--accent); }
.mine-code { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.mine-code code { font: 800 13px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); background: rgba(255, 255, 255, .08); padding: 4px 8px; border-radius: 8px; word-break: break-all; }
.mine-copy { min-height: 30px; padding: 4px 10px; font-size: 12px; }

.empty {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 34px 16px;
  text-align: center;
  color: var(--dim);
  font-weight: 700;
  border-radius: 22px;
  background: rgba(6, 36, 56, .42);
  box-shadow: inset 0 0 0 1px var(--line);
}
.empty-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.empty-actions .btn { min-width: 128px; }

.profile { display: grid; gap: 12px; max-width: 520px; }
.profile-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.profile-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.profile-who .avatar { width: 48px; height: 48px; font-size: 20px; flex: none; cursor: default; }
.profile-email { font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.profile-row b { font: 900 22px/1 var(--font-body); }
.profile-row span { color: var(--dim); font-weight: 700; font-size: 14px; }
.profile-links { display: grid; gap: 2px; padding: 6px; border-radius: 22px; background: var(--card); }
.profile-links a, .profile-links button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 12px;
  border: 0;
  border-radius: 14px;
  background: none;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.profile-links a:hover, .profile-links button:hover { background: rgba(255, 255, 255, .06); }
.profile .mode-switch { margin: 0; justify-self: start; }

/* ---------- footer + bottom bar ---------- */

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px var(--gutter) calc(22px + var(--tab-h) + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, .07);
  color: var(--faint);
  font-size: 13px;
}
.foot nav { display: flex; gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
.foot nav a { color: var(--dim); font-weight: 800; text-decoration: none; padding: 12px 0; margin: -12px 0; }
.foot nav a:hover { color: var(--ink); }

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding: 0 4px env(safe-area-inset-bottom);
  background: linear-gradient(180deg, rgba(14, 52, 75, .9), #0d3248);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
}
.tabbar > a, .tabbar > button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  border: 0;
  background: none;
  color: rgba(214, 228, 236, .78);
  font: 700 12px/1.1 var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
/* duotone glyphs like the reference: a light body, the cut-outs in the bar's colour */
.tabbar svg { width: 26px; height: 26px; fill: #7f98a8; stroke: none; }
.tabbar svg .ic-cut { fill: none; stroke: #0e344b; stroke-width: 1.9; stroke-linecap: round; }
.tabbar svg .ic-line { fill: none; stroke: #7f98a8; stroke-width: 1.9; stroke-linecap: round; }
.tabbar [aria-current="page"] { color: var(--accent); }
.tabbar [aria-current="page"] svg { fill: var(--accent); }
.tabbar [aria-current="page"] svg .ic-line { stroke: var(--accent); }
.tabbar .nav-badge { position: absolute; top: 6px; left: calc(50% + 6px); }

/* ---------- toasts ---------- */

.toasts {
  position: fixed;
  inset: calc(var(--bar-h) + 8px + env(safe-area-inset-top)) auto auto 50%;
  z-index: 40;
  display: grid;
  gap: 8px;
  width: min(calc(100% - 24px), 440px);
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  overflow: visible;
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px 10px 14px;
  border-radius: 18px;
  background: rgba(10, 46, 68, .97);
  border: 1px solid var(--line-2);
  box-shadow: 0 18px 40px -16px rgba(0, 10, 20, .7);
  font-size: 14px;
  font-weight: 700;
  pointer-events: auto;
  animation: toast-in .35s var(--ease-spring);
}
.toast-success { border-color: rgba(90, 214, 154, .5); }
.toast-error { border-color: rgba(255, 138, 128, .6); }
.toast-text { flex: 1; }
.toast-action { position: relative; flex: none; min-height: 34px; padding: 0 12px; border: 0; border-radius: 999px; background: #fff; color: var(--sky-4); font-size: 13px; font-weight: 900; cursor: pointer; }
.toast-action::after { inset: -6px -2px; }
.toast-x { position: relative; flex: none; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--dim); font-size: 18px; cursor: pointer; }
.toast-x::after { inset: -8px; }

/* ---------- sheets (dialogs) ---------- */

dialog { color: var(--ink); }
dialog::backdrop { background: rgba(2, 18, 30, .6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

dialog.sheet {
  width: 100%;
  max-width: 480px;
  max-height: calc(min(92dvh, var(--vvh, 100dvh)) - 8px);
  margin: auto auto var(--kb, 0);
  padding: 0;
  border: 0;
  border-top: 1px solid var(--line-2);
  border-radius: 28px 28px 0 0;
  background: linear-gradient(180deg, #145d84, #0e3a55 260px, #0c3249);
  box-shadow: 0 -24px 60px rgba(0, 10, 20, .55);
  overflow: auto;
  overscroll-behavior: contain;
}
dialog.sheet[open] { animation: sheet-up .38s var(--ease-out); }
dialog.sheet-tall { max-width: 560px; height: calc(min(90dvh, var(--vvh, 100dvh)) - 8px); }
.sheet-body {
  display: grid;
  gap: 14px;
  padding: 14px 20px calc(22px + env(safe-area-inset-bottom));
}
.sheet-body > form { display: grid; gap: 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head h2 { font: 800 25px/1.1 var(--font-display); letter-spacing: .005em; text-wrap: balance; }
.sheet-lede { color: var(--dim); font-size: 15px; }
.sheet-lede strong { color: var(--ink); }
.sheet-lede .mono { color: var(--ink); }
.sheet-switch { font-size: 14px; color: var(--dim); text-align: center; }
.sheet-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.list-sheet { align-content: start; }
.list-sheet .sheet-head { align-items: flex-start; position: sticky; top: -14px; z-index: 2; margin: -14px -20px 0; padding: 14px 20px 10px; background: #145d84; }
.list-foot { text-align: center; font-size: 13px; font-weight: 800; }
.list-foot a { color: var(--accent); }

.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 900; color: var(--dim); }
.field-row { display: grid; grid-template-columns: 1.2fr 1fr; gap: 10px; }
.input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: rgba(0, 20, 34, .3);
  color: var(--ink);
  font: 700 17px/1.2 var(--font-body);  /* >= 16px: no iOS zoom on focus */
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(92, 200, 255, .25); }
.input[aria-invalid="true"] { border-color: var(--bad); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%); background-position: calc(100% - 20px) 22px, calc(100% - 14px) 22px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 34px; }
select.input option { background: #0e3a55; }
.code-input { font: 900 26px/1 var(--font-body); letter-spacing: .4em; text-align: center; }
.hint { font-size: 12px; color: var(--faint); }
.form-error { color: var(--bad); font-size: 14px; font-weight: 800; }
.form-note { color: var(--ok); font-size: 14px; font-weight: 800; }
.signup-bonus { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 14px; border-radius: 14px; border: 1px solid rgba(44, 255, 122, .45); background: rgba(44, 255, 122, .1); color: #c8ffdc; font-size: 15px; font-weight: 800; line-height: 1.3; }
.signup-bonus::before { content: "+"; display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: #2cff7a; color: #04220f; font-weight: 900; font-size: 17px; line-height: 1; }
.signup-bonus[hidden] { display: none; }
.dev-hint { padding: 8px 12px; border-radius: 10px; background: rgba(92, 200, 255, .12); color: #bfe9ff; font-size: 13px; font-weight: 800; }

.buy-box {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 10px;
  border-radius: 20px;
  background: radial-gradient(120% 140% at 0% 50%, color-mix(in srgb, var(--a1) 22%, transparent), transparent 70%), rgba(0, 20, 34, .25);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--a1) 30%, transparent);
}
.buy-box .pk, .buy-box .chest { justify-self: center; }
.buy-box-name { font: 800 21px/1.1 var(--font-display); letter-spacing: .005em; }
.buy-box-sub { margin-top: 3px; font-size: 13px; font-weight: 700; color: var(--dim); }
.buy-box-sub .mono { color: var(--ink); }

.packs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pack {
  display: grid;
  gap: 4px;
  justify-items: start;
  padding: 15px 14px;
  border-radius: 18px;
  border: 1.5px solid var(--line-2);
  background: rgba(0, 20, 34, .22);
  text-align: left;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .15s;
}
.pack:active { transform: scale(.98); }
.pack[aria-checked="true"] {
  border-color: var(--accent);
  background: rgba(92, 200, 255, .12);
  box-shadow: 0 0 0 3px rgba(92, 200, 255, .18);
}
.pack-amount { font-size: 24px; }
.pack-sub { font-size: 12.5px; font-weight: 800; color: var(--dim); }
.pay-note { font-size: 13px; color: var(--faint); }

/* payment status */
.pay { justify-items: center; text-align: center; }
.pay .sheet-head { width: 100%; }
.pay-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px; height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(92, 200, 255, .25), transparent 70%);
}
.pay-spin { width: 54px; height: 54px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .14); border-top-color: var(--accent); animation: spin 1s linear infinite; }
.pay-ok, .pay-bad { display: none; width: 52px; height: 52px; fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.pay-ok { stroke: var(--ok); }
.pay-bad { stroke: var(--bad); }
.pay[data-state="credited"] .pay-icon { background: radial-gradient(circle, rgba(90, 214, 154, .2), transparent 70%); }
.pay[data-state="credited"] .pay-spin, .pay[data-state="failed"] .pay-spin { display: none; }
.pay[data-state="credited"] .pay-ok { display: block; animation: pop .5s var(--ease-spring); }
.pay[data-state="failed"] .pay-bad { display: block; }
.pay-title { font: 800 27px/1.1 var(--font-display); letter-spacing: .005em; }
.pay-line { color: var(--dim); font-weight: 700; max-width: 34ch; }
.pay-line .mono { color: var(--ink); }
.pay-steps { display: flex; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; font-size: 12px; font-weight: 900; color: var(--faint); }
.pay-steps li { display: flex; align-items: center; gap: 6px; }
.pay-steps li + li::before { content: ''; width: 18px; height: 2px; border-radius: 1px; background: currentColor; opacity: .5; }
.pay-steps li.done, .pay-steps li.now { color: var(--ink); }
.pay-steps li.now { color: var(--accent); }
.pay[data-state="failed"] .pay-steps { display: none; }
.pay-countdown { width: min(100%, 260px); height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.pay-countdown i { display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--accent); transform-origin: left; animation: countdown var(--ms, 1800ms) linear forwards; }
.pay-foot { font-size: 13px; color: var(--faint); max-width: 36ch; }
.pay #payAction { margin-top: 4px; }

.claim-prize { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 12px; padding: 10px; border-radius: 18px; background: rgba(0, 20, 34, .25); border: 1px solid var(--line); }
.claim-prize .row-art { width: 64px; }
.claim-name { font-weight: 900; }
.claim-value { margin-top: 4px; font-size: 14px; font-weight: 800; color: var(--dim); }
.claim-value .mono { color: var(--ink); }
.claim-email { padding: 14px; border-radius: 14px; background: rgba(0, 20, 34, .3); font-weight: 900; word-break: break-all; }
#sellSheet .link { justify-self: center; }

/* ---------- opening (REV 15): the key, the unlock, the item window, the reveal ---------- */

dialog.opening {
  --chest-w: min(76vw, 40svh, 360px);
  --key-w: clamp(58px, 10svh, 86px);
  --vault-h: clamp(300px, 54svh, 500px);
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--s2);
  overflow: hidden;
  overscroll-behavior: contain;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
dialog.opening::backdrop { background: #0b0709; }
.op-shell { position: absolute; inset: 0; overflow: hidden; }
/* the key step: a swipe anywhere on the scene moves the key, so no part of it may scroll or zoom */
.opening[data-step="key"]:not(.is-reduced) .op-shell { touch-action: none; cursor: grab; }
.opening.is-holding .op-shell { cursor: grabbing; }
.op-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 42% at 50% 36%, color-mix(in srgb, var(--a1) 30%, transparent), transparent 72%),
    radial-gradient(130% 80% at 50% 30%, var(--s1), var(--s2) 85%);
}
.op-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) 12px max(var(--gutter), env(safe-area-inset-left));
}
.op-title { font: 800 21px/1.1 var(--font-display); letter-spacing: .01em; color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, .4); }
.op-tools { display: flex; align-items: center; gap: 8px; }

/* the chest, big in the upper middle */
.op-stage {
  position: absolute;
  left: 50%;
  top: 39%;
  width: var(--chest-w);
  margin-left: calc(var(--chest-w) / -2);
  transform: translateY(-50%);
  z-index: 2;
}
.op-float { animation: float 3.6s ease-in-out infinite; }
.opening.is-still .op-float { animation-play-state: paused; }
.op-chest { position: relative; aspect-ratio: var(--ar, 720 / 640); }
/* No filters on the two halves: a glow on a clip-path'd image gets clipped into a visible box. */
.op-body, .op-lid, .op-padlock img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  -webkit-user-drag: none;
}
.op-shadow {
  position: absolute;
  left: 8%; right: 8%;
  bottom: -5%;
  height: 16%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .6), transparent);
}
.op-glow {
  position: absolute;
  left: 50%; top: 46%;
  width: 165%;
  aspect-ratio: 1;
  margin-left: -82.5%;
  translate: 0 -50%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--a1) 52%, transparent), color-mix(in srgb, var(--a1) 14%, transparent) 58%, transparent);
  opacity: .7;
  transition: opacity .4s ease-in, transform .4s ease-in;
  pointer-events: none;
}
.op-stage.is-charging .op-glow { opacity: 1; transform: scale(1.2); }
.op-body { clip-path: inset(var(--seam, 44%) 0 0 0); }
.op-lid { clip-path: inset(0 0 calc(100% - var(--seam, 44%) - 1.5%) 0); transform-origin: 50% 6%; z-index: 2; }
.op-chest.is-shaking { animation: shake .4s linear infinite; }
.op-chest.is-shaking-hard { animation: shake-hard .2s linear infinite; }

.op-light {
  position: absolute;
  left: 4%; right: 4%;
  top: calc(var(--seam, 44%) - 22%);
  height: 40%;
  z-index: 1;
  border-radius: 50%;
  background: radial-gradient(50% 50% at 50% 55%, #fff 0 16%, var(--a2) 34%, color-mix(in srgb, var(--a1) 70%, transparent) 52%, transparent 72%);
  mix-blend-mode: screen;
  opacity: 0;
  transform: scale(.4, .1);
  pointer-events: none;
}
/* light leaking out of the lid's seam once the lock is off */
.op-seam {
  position: absolute;
  left: 1%; right: 1%;
  top: var(--seam, 44%);
  height: 18%;
  translate: 0 -50%;
  z-index: 3;
  border-radius: 50%;
  background:
    radial-gradient(50% 12% at 50% 50%, #fff 0 60%, transparent),
    radial-gradient(closest-side, #fff 0 14%, color-mix(in srgb, var(--a2) 85%, transparent) 40%, color-mix(in srgb, var(--a1) 45%, transparent) 66%, transparent);
  mix-blend-mode: screen;
  opacity: 0;
  transform: scaleX(.12);
  pointer-events: none;
}
/* where the padlock was: the light inside the chest shows through */
.op-core {
  position: absolute;
  left: var(--lock-x, 60%);
  top: var(--lock-y, 58%);
  width: calc(var(--lock-w, 16%) * 1.9);
  aspect-ratio: .82;
  translate: -50% -50%;
  z-index: 3;
  border-radius: 50%;
  background: radial-gradient(closest-side, #fff 0 38%, color-mix(in srgb, var(--a2) 90%, transparent) 58%, color-mix(in srgb, var(--a1) 45%, transparent) 76%, transparent);
  opacity: 0;
  pointer-events: none;
}
.op-padlock {
  position: absolute;
  inset: 0;
  z-index: 4;
  clip-path: var(--padlock, inset(40% 30% 30% 55%));
  transform-origin: var(--lock-x, 60%) var(--lock-y, 58%);
  -webkit-mask-image: radial-gradient(calc(var(--lock-w, 16%) * .62) calc(var(--lock-h, 30%) * .6) at var(--lock-x, 60%) var(--lock-y, 58%), #000 72%, transparent 98%);
  mask-image: radial-gradient(calc(var(--lock-w, 16%) * .62) calc(var(--lock-h, 30%) * .6) at var(--lock-x, 60%) var(--lock-y, 58%), #000 72%, transparent 98%);
  pointer-events: none;
}
.op-padlock-white {
  filter: brightness(0) invert(1);
  opacity: 0;
  -webkit-mask-image: radial-gradient(calc(var(--lock-w, 16%) * .5) calc(var(--lock-h, 30%) * .42) at var(--lock-x, 60%) var(--lock-y, 58%), #000 25%, rgba(0, 0, 0, .55) 60%, transparent 100%);
  mask-image: radial-gradient(calc(var(--lock-w, 16%) * .5) calc(var(--lock-h, 30%) * .42) at var(--lock-x, 60%) var(--lock-y, 58%), #000 25%, rgba(0, 0, 0, .55) 60%, transparent 100%);
}
.op-lockflash {
  position: absolute;
  left: var(--lock-x, 60%);
  top: var(--lock-y, 58%);
  z-index: 5;
  width: 46%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 12%, var(--a2) 28%, color-mix(in srgb, var(--a1) 50%, transparent) 46%, transparent 68%);
  mix-blend-mode: screen;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
}
.op-burst { position: absolute; left: 50%; top: var(--seam, 44%); z-index: 6; width: 0; height: 0; }
.op-burst-lock { left: var(--lock-x, 60%); top: var(--lock-y, 58%); }
.op-burst i {
  position: absolute;
  left: 0; top: 0;
  width: var(--s, 8px);
  height: var(--s, 8px);
  margin: calc(var(--s, 8px) / -2);
  background: #fff;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  filter: drop-shadow(0 0 4px var(--a2));
}
.op-rays {
  position: absolute;
  left: 50%;
  top: 44%;
  width: 300%;
  aspect-ratio: 1;
  margin-left: -150%;
  translate: 0 -50%;
  opacity: 0;
  transform: scale(.15);
  pointer-events: none;
  z-index: 0;
}
.op-rays::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--a2) 45%, transparent) 0deg 4deg, transparent 4deg 13deg);
  -webkit-mask-image: radial-gradient(circle, #000 4%, rgba(0, 0, 0, .55) 24%, transparent 60%);
  mask-image: radial-gradient(circle, #000 4%, rgba(0, 0, 0, .55) 24%, transparent 60%);
  animation: spin 24s linear infinite;
}

/* the key, hanging at the bottom: a real button (drag it, tap it, or Enter/Space) */
.op-key {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}
.opening:is([data-step="vault"], [data-step="land"], [data-step="reveal"]) .op-key { visibility: hidden; }
.key-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font: 800 12.5px/1 var(--font-body);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .55);
  transition: opacity .2s;
}
.opening.is-holding .key-hint, .opening:not([data-step="key"]) .key-hint { opacity: 0; }
.key-chevrons { display: grid; justify-items: center; }
.key-chevrons i {
  width: 14px; height: 14px;
  margin-top: -5px;
  border-left: 3px solid #fff;
  border-top: 3px solid #fff;
  border-radius: 2px 0 0 0;
  transform: rotate(45deg);
  opacity: .2;
  filter: drop-shadow(0 0 6px var(--a2));
  animation: chevron 1.5s ease-in-out infinite;
}
.key-chevrons i:nth-child(1) { animation-delay: .4s; }
.key-chevrons i:nth-child(2) { animation-delay: .2s; }
.key {
  position: relative;
  display: block;
  width: var(--key-w);
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: none;
  color: #141012;
  touch-action: none; /* the drag must not scroll the page */
  cursor: inherit;
  pointer-events: auto;
  transform-origin: 50% 0; /* the tip: every pose is measured from it */
  will-change: transform;
}
.key:focus-visible { outline-offset: 6px; }
.opening.is-holding .key:focus-visible { outline: none; } /* the ring must not ride the key into the lock */
.key-sway {
  position: relative;
  display: block;
  transform-origin: 50% 2%;
  animation: sway 3.4s ease-in-out infinite;
}
.key-sway.is-held { animation: none; }
.key-glow {
  position: absolute;
  left: 50%; top: 62%;
  width: 260%;
  aspect-ratio: .7;
  translate: -50% -50%;
  border-radius: 50%;
  background:
    radial-gradient(closest-side at 50% 74%, rgba(255, 226, 190, .7), rgba(255, 190, 130, .26) 46%, transparent 74%),
    radial-gradient(closest-side, color-mix(in srgb, var(--a2) 22%, transparent), transparent 80%);
  mix-blend-mode: screen;
  animation: key-glow 2.6s ease-in-out infinite;
  pointer-events: none;
}
.key-art { position: relative; display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .5)); }
.key-art .k1 { stop-color: var(--k1); }
.key-art .k2 { stop-color: var(--k2); }
.key-art .k3 { stop-color: var(--k3); }
.key-art .kg1 { stop-color: var(--kg1); }
.key-art .kg2 { stop-color: var(--kg2); }
.key-label { display: none; }

/* reduced motion: no drag needed, the key is an "Unlock" button */
.opening.is-reduced .key {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: auto;
  min-height: 56px;
  padding: 0 26px 0 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 14px 34px -12px color-mix(in srgb, var(--a1) 85%, transparent);
  cursor: pointer;
  transform: none !important;
}
.opening.is-reduced .key-sway { width: 15px; animation: none; }
.opening.is-reduced .key-glow, .opening.is-reduced .key-chevrons { display: none; }
.opening.is-reduced .key-art { filter: none; }
.opening.is-reduced .key-label { display: inline; font: 800 17px/1 var(--font-body); }

/* the open box: a framed window with the box's metal for bands and a warm light inside */
.vault {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: var(--vault-h);
  margin-top: calc(var(--vault-h) / -2);
  z-index: 3;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.vault-band {
  position: relative;
  z-index: 2;
  height: clamp(16px, 2.6svh, 24px);
  background:
    radial-gradient(circle, var(--k1) 0 1.6px, var(--k3) 2.4px, transparent 3.3px) 0 50% / 30px 100% repeat-x,
    linear-gradient(180deg, var(--k1) 0%, var(--k2) 30%, var(--k3) 70%, var(--k2) 100%);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -1px 0 rgba(0, 0, 0, .35);
}
.vault-band.is-bottom { box-shadow: 0 -8px 18px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -1px 0 rgba(0, 0, 0, .35); }
.vault-inner {
  position: relative;
  overflow: hidden;
  background: radial-gradient(64% 80% at 50% 48%, #fffdf8 0%, #fdf1e4 42%, #f0dac6 100%);
}
.vault-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(110, 60, 35, .22), transparent 16%, transparent 84%, rgba(110, 60, 35, .22)),
    radial-gradient(90% 120% at 50% 48%, transparent 55%, rgba(120, 70, 40, .16));
  pointer-events: none;
}
.vault-inner::after {
  content: '';
  position: absolute;
  left: 50%; top: 46%;
  width: 1000px; height: 1000px;
  margin: -500px 0 0 -500px;
  z-index: 1;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 196, 140, .26) 0deg 7deg, transparent 7deg 20deg);
  -webkit-mask-image: radial-gradient(circle, #000 8%, rgba(0, 0, 0, .45) 24%, transparent 44%);
  mask-image: radial-gradient(circle, #000 8%, rgba(0, 0, 0, .45) 24%, transparent 44%);
  animation: spin 40s linear infinite;
  pointer-events: none;
}
.vault-hot {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(70% 90% at 50% 46%, #fff 0%, color-mix(in srgb, var(--rc) 55%, #fff) 22%, var(--rc) 50%, color-mix(in srgb, var(--rc) 55%, #1a0d10) 100%);
  opacity: 0;
}
.vault-rays {
  position: absolute;
  left: 50%; top: 46%;
  width: 1100px; height: 1100px;
  margin: -550px 0 0 -550px;
  z-index: 3;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .55) 0deg 5deg, transparent 5deg 15deg);
  -webkit-mask-image: radial-gradient(circle, #000 4%, rgba(0, 0, 0, .5) 20%, transparent 46%);
  mask-image: radial-gradient(circle, #000 4%, rgba(0, 0, 0, .5) 20%, transparent 46%);
  opacity: 0;
  animation: spin 16s linear infinite;
}
.vault-stack { position: absolute; inset: 0; z-index: 4; }
.vi {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  opacity: 0;
  visibility: hidden;
}
.vi.is-on { opacity: 1; visibility: visible; }
.vi-ring {
  position: absolute;
  left: 50%; top: 46%;
  width: calc(var(--vault-h) * .74);
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--rc) 80%, transparent) 0%, color-mix(in srgb, var(--rc) 46%, transparent) 46%, color-mix(in srgb, var(--rc) 12%, transparent) 74%, transparent);
}
.vi-ring::after {
  content: '';
  position: absolute;
  inset: 13%;
  border-radius: 50%;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--rc) 85%, #fff), 0 0 26px 4px color-mix(in srgb, var(--rc) 60%, transparent);
}
.vi-photo {
  position: relative;
  width: calc(var(--vault-h) * .48);
  aspect-ratio: 1;
  border-radius: 24px;
  box-shadow: 0 18px 32px -14px rgba(70, 35, 20, .6), 0 0 0 1px rgba(255, 255, 255, .8);
}
.vi-name {
  position: relative;
  max-width: 84%;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  font: 800 13.5px/1.25 var(--font-body);
  color: #3b261f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vi-value { position: relative; margin-top: -4px; font-size: 22px; font-weight: 700; color: #2a1712; opacity: 0; }
.vault[data-r] .vi-name { background: rgba(255, 255, 255, .9); }
.vault[data-r] .vi-value { color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, .45); }
.vault-hint {
  position: absolute;
  left: 0; right: 0;
  top: calc(50% + var(--vault-h) / 2 + 16px);
  z-index: 3;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: rgba(255, 246, 241, .72);
}

/* REV 11 explosion: shockwaves from the prize (rays and the hot light live inside the window) */
.op-boom { position: absolute; left: var(--bx, 50%); top: var(--by, 50%); z-index: 4; width: 0; height: 0; pointer-events: none; }
.boom-rays { display: none; }
.op-shock {
  position: absolute;
  left: -110px; top: -110px;
  width: 220px; height: 220px;
  border-radius: 50%;
  border: 6px solid #fff;
  box-shadow: 0 0 34px 10px var(--rc), inset 0 0 26px 6px var(--rc);
  opacity: 0;
}

/* the full-screen reveal (REV 12): the rarity colour floods out from the prize */
.reveal { position: absolute; inset: 0; z-index: 5; }
.reveal-bg { position: absolute; inset: 0; overflow: hidden; background: #120a0c; }
.reveal-flood {
  position: absolute;
  left: var(--fx, 50%);
  top: var(--fy, 45%);
  width: 260vmax;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  /* measured in px from the prize, so the text under the photo sits on the deeper colour on any screen */
  background: radial-gradient(circle,
    color-mix(in srgb, var(--rc) 75%, #fff) 0,
    var(--rc) 60px,
    color-mix(in srgb, var(--rc) 50%, #1d0f13) 150px,
    color-mix(in srgb, var(--rc) 28%, #120a0c) 330px,
    #120a0c 720px);
}
.reveal-rays {
  position: absolute;
  left: 50%; top: 36%;
  width: 1000px; height: 1000px;
  margin: -500px 0 0 -500px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .13) 0deg 6deg, transparent 6deg 18deg);
  -webkit-mask-image: radial-gradient(circle, #000 6%, rgba(0, 0, 0, .5) 22%, transparent 54%);
  mask-image: radial-gradient(circle, #000 6%, rgba(0, 0, 0, .5) 22%, transparent 54%);
  animation: spin 30s linear infinite;
}
.reveal-body {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: calc(58px + env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-user-select: text;
  user-select: text;
}
.reveal-body > :first-child { margin-top: auto; }
.reveal-body > :last-child { margin-bottom: auto; }
.reveal-card { display: flex; flex-direction: column; align-items: center; width: min(100%, 440px); text-align: center; }
.reveal-tag { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; }
.rarity-pill {
  padding: 7px 12px 6px;
  border-radius: 999px;
  font: 800 13px/1 var(--font-display);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #1a0d10;
  background: linear-gradient(180deg, #fff, var(--rc) 60%);
  box-shadow: 0 0 22px -2px var(--rc);
}
.reveal[data-r="legendary"] .rarity-pill { background: linear-gradient(100deg, #ffd27a, var(--r-legendary) 45%, var(--coral)); }
.reveal-brand {
  padding: 6px 11px 5px;
  border-radius: 999px;
  background: rgba(18, 10, 12, .58);
  font: 800 12px/1 var(--font-body);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #fff;
}
.reveal-photo { position: relative; width: min(76vw, 33svh, 320px); margin-top: 16px; }
.reveal-halo {
  position: absolute;
  left: 50%; top: 50%;
  width: min(152%, 92vw); /* it breathes to 104%: still inside the screen */
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--rc) 70%, #fff), color-mix(in srgb, var(--rc) 34%, transparent) 52%, transparent);
  animation: halo 3.2s ease-in-out infinite;
  pointer-events: none;
}
.reveal-plate {
  position: relative;
  aspect-ratio: 1 / .86;
  border-radius: 26px;
  box-shadow: 0 26px 60px -18px rgba(0, 0, 0, .75), 0 0 0 2px color-mix(in srgb, var(--rc) 75%, #fff);
}
.reveal-plate.plate { display: grid; }
.reveal-sweep { position: absolute; inset: 0; overflow: hidden; border-radius: 26px; pointer-events: none; }
.reveal-sweep i {
  position: absolute;
  top: -20%; bottom: -20%; left: 0;
  width: 38%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent);
  transform: translateX(-130%) skewX(-14deg);
}
/* The words sit on their own soft dark pool, painted above the photo's drop shadow (positioned, later
   in the page): the rarity flood behind them can be as light as peach. */
.reveal-text {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  margin-top: 14px;
  padding: 4px 18px 6px;
}
.reveal-text::before {
  content: '';
  position: absolute;
  inset: -4px 0 -12px; /* inside the page's width: the blur feathers it */
  z-index: -1;
  border-radius: 34px;
  background: rgba(18, 10, 12, .62);
  filter: blur(12px);
}
.reveal-eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; color: #fff6f1; }
.reveal-eyebrow, .reveal-name, .reveal-odds, .reveal-note { text-shadow: 0 1px 10px rgba(20, 8, 10, .7); }
.reveal-name { margin-top: 4px; font: 800 clamp(25px, 7vw, 34px)/1.08 var(--font-display); letter-spacing: .005em; text-wrap: balance; }
.reveal-value { margin-top: 6px; font-size: clamp(36px, 11vw, 52px); font-weight: 700; line-height: 1; color: #fff; text-shadow: 0 0 28px color-mix(in srgb, var(--rc) 80%, transparent); }
.reveal-odds { margin-top: 8px; font-size: 13px; font-weight: 700; color: #f4e6df; }
.reveal-note { max-width: 34ch; text-align: center; font-size: 14px; font-weight: 600; color: rgba(255, 246, 241, .8); }
.reveal-actions { display: grid; gap: 10px; width: min(100%, 360px); }
.reveal-actions .mono { font-weight: 700; }
.reveal-note.is-error { color: #ffd2d2; }
.reveal-actions.has-sell { grid-template-columns: 1fr 1fr; }
.reveal-actions.has-sell #revealAgain { grid-column: 1 / -1; }
.reveal-actions.has-sell #revealSell, .reveal-actions.has-sell #revealClaim { padding: 0 10px; font-size: 16px; line-height: 1.1; text-align: center; white-space: normal; }
.sell-two { display: grid; justify-items: center; gap: 2px; }
.sell-two small { font: 900 10.5px/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.sell-two .mono { font-size: 17px; line-height: 1; }
.btn-sell.is-sold { color: #2cff7a; background: rgba(44, 255, 122, .12); box-shadow: inset 0 0 0 1.5px rgba(44, 255, 122, .6); text-shadow: none; pointer-events: none; opacity: 1; }
.bigger { position: relative; min-height: 44px; padding: 6px 10px; border: 0; background: none; color: var(--ink); font-weight: 800; text-decoration: underline; text-decoration-color: var(--coral); text-underline-offset: 3px; cursor: pointer; }
.bigger::after { inset: -6px 0; }
.reveal .link { position: relative; font-size: 14px; }
.reveal .link::after { inset: -12px -10px; }
.bigger:disabled, .reveal .link:disabled { opacity: .45; cursor: default; }

.op-flash {
  position: absolute;
  inset: 0;
  z-index: 7;
  background: radial-gradient(circle at 50% 40%, #fff 0%, color-mix(in srgb, var(--a2) 80%, transparent) 28%, color-mix(in srgb, var(--a1) 30%, transparent) 55%, transparent 80%);
  opacity: 0;
  pointer-events: none;
}
.op-flash[data-mode="white"] { background: radial-gradient(circle at var(--bx, 50%) var(--by, 50%), #fff 0 30%, rgba(255, 250, 240, .85) 60%, rgba(255, 240, 225, .6)); }
.op-dark { position: absolute; inset: 0; z-index: 7; background: #0b0709; opacity: 0; pointer-events: none; }
.fx { position: absolute; inset: 0; z-index: 8; width: 100%; height: 100%; pointer-events: none; }


/* the item window and the reveal show prize visuals: holders stand upright, cutouts float, plates keep their tone */
.vi-photo.pv { box-shadow: none; border-radius: 0; }
.vi-photo.pv-slab { width: calc(var(--vault-h) * .36); aspect-ratio: 62 / 100; }
.vi-photo.pv-card { width: calc(var(--vault-h) * .34); aspect-ratio: 63 / 88; }
.vi-photo.pv-item:not(.is-plate) > img { filter: drop-shadow(0 10px 14px rgba(70, 35, 20, .35)); }
.vi-photo.is-plate, .vi-photo.pv-cash { box-shadow: 0 18px 32px -14px rgba(70, 35, 20, .6), 0 0 0 1px rgba(255, 255, 255, .8); }
.reveal-photo:has(.pv-slab) { width: min(56vw, 30svh, 250px); }
.reveal-photo:has(.pv-card) { width: min(54vw, 28svh, 230px); }
.reveal-plate.pv { box-shadow: none; border-radius: 0; }
.reveal-plate.pv-slab { aspect-ratio: 62 / 100; }
.reveal-plate.pv-card { aspect-ratio: 63 / 88; }
.reveal-plate.pv-item, .reveal-plate.pv-slabphoto, .reveal-plate.pv-cash { aspect-ratio: 1; }
.reveal-plate.is-plate, .reveal-plate.pv-cash { border-radius: 26px; box-shadow: 0 26px 60px -18px rgba(0, 0, 0, .75), 0 0 0 2px color-mix(in srgb, var(--rc) 75%, #fff); }
.reveal-photo:has(.pv-slab) .reveal-sweep, .reveal-photo:has(.pv-item:not(.is-plate)) .reveal-sweep { display: none; }

/* ---------- the pack opening (REV 17/20/22): rip → the holder rises out → presented → sell or keep ---------- */

/* the pack's lean follows the finger and wobbles while it waits (registered, so it can be animated) */
@property --rx { syntax: '<angle>'; inherits: true; initial-value: 0deg; }
@property --ry { syntax: '<angle>'; inherits: true; initial-value: 0deg; }

dialog.opening[data-mode="pack"] { background: #050608; }
dialog.opening[data-mode="pack"]::backdrop { background: #050608; }
.opening[data-mode="pack"] :is(.op-bg, .op-stage, .op-key, .vault, .vault-hint, .reveal) { display: none !important; }
.opening[data-mode="pack"] .op-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.opening[data-mode="pack"] .op-tools { margin-left: auto; }
.ps-close { background: rgba(255, 255, 255, .1); color: #fff; }
.ps-close svg { width: 18px; height: 18px; }
/* REV 20 colours on the shockwaves */
.opening[data-mode="pack"] .op-boom[data-r="common"] { --rc: #ffffff; }
.opening[data-mode="pack"] .op-boom[data-r="rare"] { --rc: #2cff7a; }
.opening[data-mode="pack"] .op-boom[data-r="epic"] { --rc: #ffd400; }
.opening[data-mode="pack"] .op-boom[data-r="legendary"] { --rc: #ff9a1f; }

.ps {
  --pack-w: min(66vw, 300px, calc(52svh * 590 / 1100));
  --pack-h: calc(var(--pack-w) * 1100 / 590);
  --info-h: 268px;
  --glow: #ffffff;
  position: absolute;
  inset: 0;
  z-index: 2;
  color: #fff;
}

/* the dark spotlight: near-black edges, a charcoal pool of light in the middle, a cone from above */
.ps-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: radial-gradient(120% 75% at 50% 44%, #2a2d33 0%, #16181c 46%, #050608 100%);
}
.ps-bg::before {
  content: '';
  position: absolute;
  left: 50%; top: -12%;
  width: 150%; height: 95%;
  translate: -50% 0;
  background: radial-gradient(42% 62% at 50% 0%, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03) 55%, transparent 75%);
  pointer-events: none;
}
.ps-bg::after {
  content: '';
  position: absolute;
  left: 50%; bottom: 4%;
  width: 90%; height: 22%;
  translate: -50% 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .07), transparent);
  pointer-events: none;
}
.ps-flood {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .6s ease-out;
  background: radial-gradient(110% 80% at 50% 38%, #ffc35e 0%, #ff7a00 34%, #8a3000 66%, #3a1500 100%);
}
.ps.is-legendary .ps-flood { opacity: 1; }
.ps-rays {
  position: absolute;
  left: 50%; top: 40%;
  width: 1100px; height: 1100px;
  margin: -550px 0 0 -550px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 244, 214, .5) 0deg 5deg, transparent 5deg 16deg);
  -webkit-mask-image: radial-gradient(circle, #000 4%, rgba(0, 0, 0, .45) 22%, transparent 48%);
  mask-image: radial-gradient(circle, #000 4%, rgba(0, 0, 0, .45) 22%, transparent 48%);
  opacity: 0;
  transition: opacity .8s ease-out;
  animation: spin 34s linear infinite;
}
.ps.is-legendary .ps-rays { opacity: .55; }
.ps.is-epic .ps-rays { opacity: .22; background: repeating-conic-gradient(from 0deg, rgba(255, 220, 60, .7) 0deg 5deg, transparent 5deg 16deg); }
.ps.is-epic .ps-bg { background: radial-gradient(120% 75% at 50% 42%, #4a4320 0%, #1c1a10 46%, #070604 100%); transition: background .6s; }
.ps-sparkles { position: absolute; inset: 0; opacity: 0; transition: opacity .6s; }
.ps.is-legendary .ps-sparkles { opacity: 1; }
.ps-sparkles::before, .ps-sparkles::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(2px 2px at 12% 22%, #fff, transparent), radial-gradient(2.5px 2.5px at 82% 16%, #fff7d6, transparent),
    radial-gradient(2px 2px at 30% 70%, #fff, transparent), radial-gradient(3px 3px at 70% 64%, #fff3c4, transparent),
    radial-gradient(2px 2px at 90% 44%, #fff, transparent), radial-gradient(2.5px 2.5px at 8% 54%, #ffe9a8, transparent),
    radial-gradient(2px 2px at 52% 10%, #fff, transparent), radial-gradient(2px 2px at 60% 86%, #fff, transparent);
  animation: ps-twinkle 2.6s ease-in-out infinite;
}
.ps-sparkles::after { transform: scale(-1, 1) translateY(4%); animation-delay: -1.3s; }
.ps-flash { position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, rgba(44, 255, 122, .9), rgba(44, 255, 122, .55) 60%, rgba(44, 255, 122, .35)); opacity: 0; pointer-events: none; }

/* the balance, in neon green at the top (REV 20); "+$31.50" ticks up under it after a sale */
.ps-wallet {
  position: absolute;
  left: 50%;
  top: calc(14px + env(safe-area-inset-top));
  z-index: 9;
  translate: -50% 0;
  display: grid;
  justify-items: center;
  gap: 4px;
  pointer-events: none;
}
.ps-balance {
  padding: 6px 16px;
  border-radius: 999px;
  border: 1.5px solid #2cff7a;
  background: rgba(4, 30, 12, .78);
  box-shadow: 0 0 16px rgba(44, 255, 122, .55), inset 0 0 10px rgba(44, 255, 122, .25);
  font-size: 16px;
  line-height: 1.2;
  color: #2cff7a;
}
.ps-chip { font-size: 13px; font-weight: 900; color: #2cff7a; text-shadow: 0 0 10px rgba(44, 255, 122, .7); opacity: 0; transform: translateY(-4px); transition: opacity .3s, transform .3s; }
.ps-chip.is-on { opacity: 1; transform: none; }
.ps-fly { position: absolute; left: 0; top: 0; z-index: 10; font-size: 24px; color: #2cff7a; text-shadow: 0 0 14px rgba(44, 255, 122, .85); white-space: nowrap; pointer-events: none; }

/* "Swipe across the top to rip it open", over the pack */
.ps-prompt {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(40% + var(--pack-h) / 2 + 22px);
  z-index: 8;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 0 var(--gutter);
  text-align: center;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
}
.ps-eyebrow { font: 800 21px/1 var(--font-display); letter-spacing: .01em; color: rgba(255, 255, 255, .95); }
.ps-prompt-text { font-size: 13.5px; font-weight: 900; line-height: 1.3; letter-spacing: .12em; text-transform: uppercase; text-wrap: balance; color: rgba(255, 255, 255, .82); text-shadow: 0 0 12px rgba(0, 0, 0, .6); }
@media (max-width: 370px) { .ps-prompt-text { font-size: 12px; letter-spacing: .07em; } }
.ps.is-tearing .ps-prompt, .opening:not([data-step="rip"]) .ps-prompt { opacity: 0; transform: translateY(-8px); }

/* the pack: four copies of the pack art sharing one pose, clipped along the tear */
.ps-pack {
  position: absolute;
  left: 50%; top: 60%;
  width: var(--pack-w);
  height: var(--pack-h);
  margin: calc(var(--pack-h) / -2) 0 0 calc(var(--pack-w) / -2);
}
.ps-layers { position: absolute; inset: 0; }
.ps-layer.pk {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: perspective(1100px) rotateX(var(--rx)) rotateY(var(--ry)) rotate(-4deg);
  transition: transform .22s var(--ease-out);
}
.ps-pack.is-idle { animation: ps-wobble 4.6s ease-in-out infinite; }
.ps-pack.is-idle .ps-layer, .ps-pack.is-idle .ps-tear { transition: none; }
.ps-wall { z-index: 1; opacity: 0; filter: brightness(.34) saturate(.7); }
.ps-wall .pk-mark, .ps-wall .pk-name, .ps-wall .pk-emblem { display: none; }
.ps-body { z-index: 3; }
.ps-strip, .ps-torn { z-index: 4; }
.ps-torn.pk { transition: none; will-change: transform; }
/* the foil's light drifts while the pack waits, then follows the finger */
.ps-pack.is-idle .pk-sheen { animation: ps-sheen 3.8s ease-in-out infinite; }
/* the dashed "tear here" line under the crimp, and a light that runs along it until the first touch */
.ps-tear {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  transform: perspective(1100px) rotateX(var(--rx)) rotateY(var(--ry)) rotate(-4deg);
  transition: transform .22s var(--ease-out), opacity .2s;
}
.ps-tear::before {
  content: '';
  position: absolute;
  left: 4%; right: 4%;
  top: calc(8.8% - 1px);
  border-top: 2px dashed rgba(255, 255, 255, .85);
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, .9)) drop-shadow(0 0 1px rgba(0, 0, 0, .6));
}
.ps-tear-hint { position: absolute; left: 4%; right: 4%; top: calc(8.8% - 6px); height: 12px; overflow: hidden; }
.ps-tear-hint::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(6px 6px at 97% 50%, #fff 0 45%, rgba(255, 255, 255, .7) 60%, transparent 100%),
    linear-gradient(90deg, transparent 52%, rgba(255, 255, 255, .55) 95%, transparent 98%) 0 50% / 100% 3px no-repeat;
  filter: drop-shadow(0 0 5px #fff);
  transform: translateX(-100%);
  animation: ps-hint 2s cubic-bezier(.45, .05, .35, 1) .5s infinite;
}
.ps.is-tearing .ps-tear-hint { display: none; }
.opening:not([data-step="rip"]) .ps-tear { opacity: 0; }
/* the tear zone: a real button over the top of the pack, the only place that takes the drag */
.ps-zone {
  position: absolute;
  left: -14%; right: -14%;
  top: -12%;
  height: 36%;
  z-index: 6;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: none;
  touch-action: none;
  cursor: grab;
  -webkit-tap-highlight-color: transparent;
}
.ps-zone:active { cursor: grabbing; }
.ps-zone-label { display: none; }
.opening:not([data-step="rip"]) .ps-zone { visibility: hidden; }
/* reduced motion: no drag needed, an "Open pack" button under the pack */
.opening.is-reduced .ps-pack { top: 55%; }
.opening.is-reduced .ps-prompt { bottom: calc(45% + var(--pack-h) / 2 + 22px); }
.opening.is-reduced .ps-zone {
  left: 50%; right: auto;
  top: calc(100% + 16px); bottom: auto;
  height: 54px;
  padding: 0 30px;
  translate: -50% 0;
  border-radius: 18px;
  color: #fff;
  font: 900 17px/1 var(--font-body);
  white-space: nowrap;
  touch-action: manipulation;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(255, 255, 255, .26) 0%, rgba(255, 255, 255, .12) 46%, rgba(255, 255, 255, 0) 52%), linear-gradient(180deg, #4fb4f0 0%, #3aa4e8 55%, #2c97e2 100%);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .55), 0 10px 26px rgba(30, 140, 220, .45);
}
.opening.is-reduced .ps-zone-label { display: inline; }
.opening.is-reduced .ps-tear { display: none; }

/* where the prize rests once out: the middle of the space above the presented info */
.ps-spot {
  position: absolute;
  left: 0; right: 0;
  top: calc(66px + env(safe-area-inset-top));
  bottom: var(--info-h);
  z-index: 2; /* between the pack's back wall (1) and its front (3): it comes out of the pack */
  display: grid;
  place-items: center;
  pointer-events: none;
}
.ps.is-out .ps-spot { z-index: 7; }
.ps-hero {
  position: relative;
  height: min(100%, calc(min(70vw, 340px) / var(--ar)));
  aspect-ratio: var(--ar);
  visibility: hidden;
  pointer-events: auto;
  touch-action: none;
  outline: none;
}
.ps.is-pulling .ps-hero { visibility: visible; }
.ps-hero:focus-visible .ps-outline { box-shadow: 0 0 0 1cqw var(--accent), 0 0 6cqw var(--accent); opacity: 1; }
.ps-hero.can-swipe { cursor: grab; }
.ps-hero.is-swiping { cursor: grabbing; }
.ps-move { position: absolute; inset: 0; transform-origin: 50% 50%; will-change: transform; }
.ps-bob { position: absolute; inset: 0; }
.ps.is-landed:not(.is-decided) .ps-hero:not(.is-swiping) .ps-bob { animation: ps-bob 4.4s ease-in-out .4s infinite; }
.ps-visual { position: absolute; left: 0; top: 0; width: 100%; }
.ps-halo {
  position: absolute;
  left: 50%; top: 50%;
  width: 175%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--glow) 30%, transparent), color-mix(in srgb, var(--glow) 10%, transparent) 55%, transparent 72%);
  opacity: 0;
  transition: opacity .7s ease-out;
  pointer-events: none;
}
.ps.is-landed .ps-halo { opacity: 1; }
.ps-hero.is-down { --glow: #ffffff; }
.ps-hero.is-down .ps-halo { opacity: .55; }
/* the thin bright outline in the rarity colour (REV 20) */
.ps-outline {
  position: absolute;
  inset: 0;
  border-radius: 5cqw;
  pointer-events: none;
  opacity: 0;
  box-shadow:
    0 0 0 .6cqw var(--glow),
    0 0 4cqw color-mix(in srgb, var(--glow) 85%, transparent),
    0 0 14cqw color-mix(in srgb, var(--glow) 42%, transparent);
  transition: opacity .5s ease-out, box-shadow .5s ease-out;
}
.ps.is-landed .ps-outline { opacity: 1; }
.ps-toploader .ps-outline { border-radius: 3.2cqw; }

/* the card that turns over: its face, and our own 50/50 back */
.ps-flip { position: relative; transform-style: preserve-3d; }
.ps-flip.is-back { transform: rotateY(180deg); }
.slab-well { perspective: 900px; }
.slab-well > .ps-flip { width: 91%; aspect-ratio: 63 / 88; }
.ps-face, .card-back {
  position: absolute;
  inset: 0;
  container-type: inline-size;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 4.4cqw;
  overflow: hidden;
}
.ps-face { transform: rotateY(0deg); box-shadow: 0 1.2cqw 3cqw rgba(0, 0, 0, .45), 0 0 0 .3cqw rgba(0, 0, 0, .25); }
.ps-face > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ps-face .holo { position: absolute; inset: 0; overflow: hidden; mix-blend-mode: color-dodge; opacity: .3; pointer-events: none; }
.ps-face .holo::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: -100%;
  width: 300%;
  background: linear-gradient(115deg, transparent 20%, rgba(255, 0, 170, .55) 32%, rgba(0, 240, 255, .55) 42%, rgba(255, 255, 90, .55) 52%, rgba(120, 90, 255, .55) 62%, transparent 74%);
  animation: holo 6s linear infinite;
}
.ps-glint {
  position: absolute;
  inset: -10% -40%;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .85) 50%, transparent 62%);
  transform: translateX(-130%);
  pointer-events: none;
}
/* the faces swap at the edge-on moment of the turn (the page sets is-down), never left to backface-visibility alone */
.ps-hero:not(.is-down) .card-back { visibility: hidden; }
.ps-hero.is-down .ps-face { visibility: hidden; }
.card-back {
  transform: rotateY(180deg);
  display: grid;
  align-content: center;
  justify-items: center;
  background:
    repeating-conic-gradient(from 0deg at 50% 44%, rgba(255, 255, 255, .08) 0deg 5deg, transparent 5deg 15deg),
    radial-gradient(120% 90% at 50% 44%, #2a9ef0 0%, #0f5aa0 34%, #0a2f57 66%, #04152a 100%);
  box-shadow:
    inset 0 0 0 2.4cqw #0a3666,
    inset 0 0 0 3.1cqw #a6e6ff,
    inset 0 0 0 4.4cqw #0a3666,
    inset 0 0 10cqw 4cqw rgba(0, 0, 0, .5);
}
.card-back::before {
  content: '';
  position: absolute;
  left: 50%; top: 44%;
  width: 64cqw;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(140, 225, 255, .35), rgba(140, 225, 255, 0) 70%);
  box-shadow: 0 0 0 1.1cqw rgba(255, 255, 255, .9), 0 0 0 2.3cqw #0a3666, 0 0 7cqw 2cqw rgba(120, 220, 255, .55);
}
.card-back::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, transparent 30%, rgba(255, 255, 255, .16) 46%, transparent 60%);
}
.cb-mark {
  position: relative;
  margin-top: -6cqw;
  font: italic 800 17cqw/.9 var(--font-display);
  color: #fff;
  -webkit-text-stroke: 1.4cqw #0b2f5c;
  paint-order: stroke fill;
  text-shadow: 0 1.4cqw 0 #0b2f5c, 0 0 7cqw rgba(120, 220, 255, .85);
}
.cb-mark i { font-style: inherit; color: #ffd23f; }
.cb-sub { position: relative; margin-top: 2.4cqw; padding: 1cqw 3.6cqw .8cqw; border-radius: 1.6cqw; background: #0b2f5c; font: 800 7.4cqw/1 var(--font-display); letter-spacing: .24em; text-indent: .24em; color: #fff; }
/* face-down: the holder's label is blurred too, so the grade can't give the hit away */
.ps-hero .slab-label > * { transition: filter .5s, opacity .5s; }
.ps-hero.is-down .slab-label > * { filter: blur(1.4cqw); opacity: .7; }

/* a raw card: a penny sleeve inside a clear toploader */
.ps-toploader { aspect-ratio: 76 / 101; }
.tl-case {
  position: absolute;
  inset: 0;
  border-radius: 3.2cqw;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, .36) 0%, rgba(255, 255, 255, .1) 20%, rgba(255, 255, 255, .04) 55%, rgba(255, 255, 255, .18) 100%),
    rgba(190, 215, 235, .1);
  box-shadow:
    inset 0 0 0 .6cqw rgba(255, 255, 255, .7),
    inset 0 0 0 1.5cqw rgba(255, 255, 255, .1),
    inset 1.4cqw 1.4cqw 2cqw rgba(255, 255, 255, .25),
    inset -1.2cqw -1.6cqw 2.4cqw rgba(0, 20, 40, .3),
    0 4cqw 9cqw rgba(0, 0, 0, .55);
}
.tl-case::before {
  /* the thumb notch at the open end */
  content: '';
  position: absolute;
  left: 50%; top: 0;
  width: 24cqw; height: 5.5cqw;
  translate: -50% 0;
  border-radius: 0 0 12cqw 12cqw;
  background: rgba(5, 8, 12, .35);
  box-shadow: inset 0 -.5cqw 0 rgba(255, 255, 255, .5);
}
.tl-sleeve {
  position: absolute;
  left: 6cqw; right: 6cqw;
  top: 6.5cqw; bottom: 5cqw;
  display: grid;
  place-items: end center;
  padding-bottom: 1.2cqw;
  border-radius: 1.6cqw;
  background: linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .04) 30%);
  box-shadow: inset 0 0 0 .3cqw rgba(255, 255, 255, .55);
  perspective: 900px;
}
.tl-sleeve > .ps-flip { width: 94%; aspect-ratio: 63 / 88; }
.tl-shine {
  position: absolute;
  inset: 0;
  border-radius: 3.2cqw;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(118deg, transparent 30%, rgba(255, 255, 255, .22) 40%, transparent 48%, transparent 62%, rgba(255, 255, 255, .12) 68%, transparent 74%);
}

/* our prize card: a foil frame in the rarity colour around the item, its name and value */
.ps-prizecard { aspect-ratio: 63 / 88; }
.ps-prizecard .ps-flip { position: absolute; inset: 0; }
.ps-prizecard .ps-face, .ps-prizecard .card-back { border-radius: 5cqw; }
.pc-front {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, #ffffff 0%, var(--glow) 16%, color-mix(in srgb, var(--glow) 35%, #1a1f29) 40%, var(--glow) 60%, #ffffff 76%, color-mix(in srgb, var(--glow) 55%, #000) 100%);
}
.pc-front::before {
  content: '';
  position: absolute;
  inset: 2.6cqw;
  border-radius: 3.2cqw;
  background: radial-gradient(95% 62% at 50% 38%, color-mix(in srgb, var(--glow) 28%, #1b2330) 0%, #0e131b 64%, #070a0f 100%);
  box-shadow: inset 0 0 0 .5cqw rgba(255, 255, 255, .35), inset 0 0 9cqw rgba(0, 0, 0, .65);
}
.pc-mark { position: absolute; left: 8cqw; top: 6.5cqw; font: italic 800 9.5cqw/1 var(--font-display); color: #fff; -webkit-text-stroke: .6cqw #0b2f5c; paint-order: stroke fill; }
.pc-mark i { font-style: inherit; color: #ffd23f; }
.pc-tag { position: absolute; right: 8cqw; top: 8cqw; font: 900 4.2cqw/1 var(--font-body); letter-spacing: .18em; text-transform: uppercase; color: var(--glow); text-shadow: 0 0 3cqw color-mix(in srgb, var(--glow) 70%, transparent); }
.pc-window { position: absolute; left: 11cqw; right: 11cqw; top: 19cqw; display: grid; place-items: center; }
.pc-window > .pv { width: 100%; }
.pc-window > .pv-item:not(.is-plate) > img { filter: drop-shadow(0 3cqw 3cqw rgba(0, 0, 0, .55)); }
.pc-name {
  position: absolute;
  left: 8cqw; right: 8cqw;
  top: 100cqw;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: center;
  font: 800 7.6cqw/1.04 var(--font-display);
  letter-spacing: .02em;
  text-transform: uppercase;
  color: #fff;
}
.pc-value { position: absolute; left: 0; right: 0; bottom: 8.5cqw; text-align: center; font-size: 10cqw; line-height: 1; color: #fff; text-shadow: 0 0 4cqw color-mix(in srgb, var(--glow) 80%, transparent); }
.pc-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
/* … and the product it bursts into, floating big in its rarity glow */
.ps-cutout { position: absolute; left: 50%; top: 50%; width: min(150%, 86vw); translate: -50% -50%; opacity: 0; pointer-events: none; }
.ps-hero.is-burst .ps-cutout { opacity: 1; }
.ps-hero.is-burst .ps-visual { opacity: 0; }
.ps-cutout:is(.pv-item, .pv-slabphoto):not(.is-plate) > img {
  filter: drop-shadow(0 0 1px var(--glow)) drop-shadow(0 0 12px color-mix(in srgb, var(--glow) 70%, transparent)) drop-shadow(0 18px 22px rgba(0, 0, 0, .55));
}
/* a photo on its own plate (not a cutout) is shown as a framed tile, a little smaller */
.ps-cutout.is-plate, .ps-cutout.pv-cash { width: min(118%, 74vw); box-shadow: 0 0 0 2px var(--glow), 0 0 28px color-mix(in srgb, var(--glow) 60%, transparent), 0 26px 50px rgba(0, 0, 0, .6); }

/* swipe feedback on the holder */
.ps-badge {
  position: absolute;
  top: 9%;
  z-index: 3;
  padding: 6px 12px 5px;
  border-radius: 10px;
  font: 800 20px/1 var(--font-display);
  letter-spacing: .16em;
  text-transform: uppercase;
  pointer-events: none;
}
.ps-badge-sell { right: 6%; rotate: 12deg; color: #2cff7a; border: 2.5px solid #2cff7a; background: rgba(4, 30, 12, .7); opacity: var(--sell, 0); box-shadow: 0 0 18px rgba(44, 255, 122, .45); }
.ps-badge-keep { left: 6%; rotate: -12deg; color: #fff; border: 2.5px solid #fff; background: rgba(0, 0, 0, .45); opacity: var(--keep, 0); }

.ps-flip-hint {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(var(--info-h) - 70px);
  z-index: 8;
  text-align: center;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 14px rgba(255, 170, 60, .9), 0 0 2px rgba(0, 0, 0, .8);
  pointer-events: none;
  animation: ps-pulse 1.3s ease-in-out infinite;
}

/* REV 29: a big hit's build-up — light out of the torn top, the stage darkening to a vignette, rings pulsing out on
   each step of the ladder, rays leaking from behind the card; the value line and Keep / Sell wait for the slam */
.ps-light {
  position: absolute;
  left: 50%; top: 8.8%;
  z-index: 2; /* between the pack's back wall (1) and its front (3): it shines out of the mouth, behind the holder */
  width: 170%; height: 84%;
  translate: -50% -58%;
  border-radius: 50%;
  background: radial-gradient(closest-side, #fffdf6, rgba(255, 244, 222, .75) 24%, rgba(255, 230, 190, .28) 55%, transparent);
  opacity: 0;
  pointer-events: none;
}
.ps-dim {
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 52% at 50% 40%, rgba(0, 0, 0, .25), rgba(0, 0, 0, .94));
  opacity: 0;
  pointer-events: none;
}
.ps-ring {
  position: absolute;
  left: 50%; top: 50%;
  width: 100%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  border: 2px solid var(--glow);
  box-shadow: 0 0 22px color-mix(in srgb, var(--glow) 70%, transparent), inset 0 0 18px color-mix(in srgb, var(--glow) 45%, transparent);
  opacity: 0;
  pointer-events: none;
}
.ps-leak {
  position: absolute;
  left: 50%; top: 50%;
  width: 260%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--glow) 80%, transparent) 0deg 4deg, transparent 4deg 13deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 30%, rgba(0, 0, 0, .55) 60%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 30%, rgba(0, 0, 0, .55) 60%, transparent 100%);
  opacity: 0;
  pointer-events: none;
  animation: spin 40s linear infinite;
}
.ps.is-inhale .ps-leak { animation-play-state: paused; }
.ps-hero.is-down .ps-outline { transition: opacity .5s ease-out; } /* each step of the ladder flips colour at once */
/* each step of the ladder glows harder than the last */
.ps-hero[data-tier] .ps-halo { background: radial-gradient(closest-side, color-mix(in srgb, var(--glow) 50%, transparent), color-mix(in srgb, var(--glow) 16%, transparent) 55%, transparent 72%); }
.ps-hero[data-tier="1"] .ps-outline { box-shadow: 0 0 0 .7cqw var(--glow), 0 0 5cqw var(--glow), 0 0 16cqw color-mix(in srgb, var(--glow) 55%, transparent); }
.ps-hero[data-tier="2"] .ps-outline { box-shadow: 0 0 0 .85cqw var(--glow), 0 0 7cqw var(--glow), 0 0 22cqw color-mix(in srgb, var(--glow) 68%, transparent); }
.ps-hero[data-tier="3"] .ps-outline { box-shadow: 0 0 0 1cqw var(--glow), 0 0 9cqw var(--glow), 0 0 30cqw color-mix(in srgb, var(--glow) 80%, transparent); }
.ps.is-counting :is(.ps-val, .ps-acts) { visibility: hidden; }
.ps-hero.is-glinting .ps-glint { animation: ps-glint 3.6s ease-in-out 1.2s infinite; }
@keyframes ps-glint {
  0% { transform: translateX(-130%); }
  32%, 100% { transform: translateX(130%); }
}

/* presented (REV 20): the card in small caps, "Sell for", the price big, ← Sell / Keep → */
.ps-info {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 8;
  min-height: var(--info-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 max(18px, env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  text-align: center;
  pointer-events: none;
}
.ps-info > * { pointer-events: auto; }
.ps-tag { font-size: 11.5px; font-weight: 900; letter-spacing: .22em; text-transform: uppercase; color: var(--glow); text-shadow: 0 0 12px color-mix(in srgb, var(--glow) 70%, transparent); }
.ps.is-legendary .ps-tag { color: #fff3c4; }
.ps-line {
  margin-top: 8px;
  max-width: 36ch;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .86);
  text-wrap: balance;
}
.ps-k { margin-top: 10px; font-size: 12.5px; font-weight: 800; color: rgba(255, 255, 255, .6); }
.ps-price { font-size: 46px; line-height: 1.04; text-shadow: 0 2px 0 rgba(0, 0, 0, .3), 0 0 26px color-mix(in srgb, var(--glow) 35%, transparent); }
.ps-val { margin-top: 2px; max-width: 40ch; font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .62); }
.ps-val.is-error { color: #ffd2cc; font-weight: 800; }
.ps.is-legendary .ps-k, .ps.is-legendary .ps-val { color: rgba(255, 246, 230, .82); }
.ps-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(100%, 380px); margin-top: 14px; }
.ps-acts.is-single { grid-template-columns: 1fr; }
.ps-acts button {
  position: relative;
  min-height: 52px;
  border-radius: 16px;
  font: 900 16.5px/1 var(--font-body);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.ps-acts button:disabled { opacity: .55; cursor: default; }
.ps-sell { color: #2cff7a; background: rgba(44, 255, 122, .14); border: 1.5px solid #2cff7a; box-shadow: 0 0 18px rgba(44, 255, 122, .22), inset 0 0 12px rgba(44, 255, 122, .12); }
.ps-keep { color: #fff; background: rgba(255, 255, 255, .12); border: 1.5px solid rgba(255, 255, 255, .55); }
.ps-sell:hover:not(:disabled) { background: rgba(44, 255, 122, .22); }
.ps-keep:hover:not(:disabled) { background: rgba(255, 255, 255, .2); }
.ps-next { display: grid; gap: 6px; width: min(100%, 380px); margin-top: 14px; }
.ps-links { display: flex; justify-content: center; gap: 22px; }
.ps-links .link { position: relative; min-height: 40px; font-size: 14px; color: rgba(255, 255, 255, .85); }
.ps-links .link::after { content: ''; position: absolute; inset: -4px -8px; }
.ps-links .link:disabled { opacity: .45; }

/* after Sell / Keep the holder has gone: what happened sits in the middle, the next step stays under the thumb */
.opening[data-step="done"] .ps-info { top: 0; justify-content: center; padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
.opening[data-step="done"] .ps-price { font-size: 58px; }
.opening[data-step="done"] .ps-next { position: absolute; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); width: min(calc(100% - 36px), 380px); translate: -50% 0; }
.ps.is-sold .ps-price { color: #2cff7a; text-shadow: 0 0 26px rgba(44, 255, 122, .55), 0 2px 0 rgba(0, 0, 0, .3); }
.ps.is-sold .ps-tag { color: #2cff7a; }

@keyframes ps-wobble {
  0%, 100% { --ry: -6deg; --rx: 2deg; }
  50% { --ry: 6deg; --rx: -1.5deg; }
}
@keyframes ps-sheen {
  0%, 100% { transform: translateX(-26%); }
  50% { transform: translateX(26%); }
}
@keyframes ps-hint {
  0% { transform: translateX(-100%); opacity: 0; }
  10% { opacity: 1; }
  70% { transform: translateX(4%); opacity: 1; }
  80%, 100% { transform: translateX(4%); opacity: 0; }
}
@keyframes ps-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
@keyframes ps-pulse {
  0%, 100% { transform: scale(1); opacity: .85; }
  50% { transform: scale(1.06); opacity: 1; }
}
@keyframes ps-twinkle {
  0%, 100% { opacity: .2; }
  50% { opacity: 1; }
}

/* short phones: a tighter presented block */
@media (max-height: 700px) {
  .ps { --info-h: 240px; --pack-w: min(62vw, 300px, calc(50svh * 590 / 1100)); }
  .ps-price { font-size: 38px; }
  /* three lines even here: a real card line ("2023 POKÉMON CROWN ZENITH GALARIAN GALLERY · HISUIAN ZOROARK VSTAR · …
     · PSA 10") must not lose its name and grade */
  .ps-line { margin-top: 6px; -webkit-line-clamp: 4; font-size: 11px; line-height: 1.3; letter-spacing: .05em; }
  .ps-k { margin-top: 6px; }
  .ps-acts button { min-height: 48px; }
  .ps-eyebrow { font-size: 18px; }
}

/* ---------- odds page ---------- */

.odds-page { max-width: 1040px; margin: 0 auto; padding: 18px var(--gutter) 40px; }
.odds-page + .foot { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
.eyebrow { margin-bottom: 8px; font: 900 11px/1 var(--font-body); letter-spacing: .22em; text-transform: uppercase; color: var(--accent); }
.odds-hero h1 { font: 800 38px/1.02 var(--font-display); letter-spacing: .005em; }
.odds-hero .lede { margin-top: 10px; max-width: 60ch; color: var(--dim); font-size: 15px; }
.odds-tabs { margin: 18px 0 0; }
.odds-nav {
  position: sticky;
  top: calc(var(--bar-h) + env(safe-area-inset-top));
  z-index: 10;
  display: flex;
  gap: 8px;
  margin: 0 calc(-1 * var(--gutter)) 8px;
  padding: 10px var(--gutter);
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(12, 48, 70, .9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.odds-nav::-webkit-scrollbar { display: none; }
.odds-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  background: rgba(0, 20, 34, .3);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--a1) 45%, transparent);
  text-decoration: none;
  font-weight: 900;
  font-size: 13px;
  white-space: nowrap;
}
.odds-chip .pk-mini { width: 18px; }
.odds-chip .chest.pk-mini { width: 30px; }
.odds-chip b { font-size: 13px; }

.odds-level { margin-top: 26px; scroll-margin-top: 130px; }
.odds-head {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 22px;
  background: radial-gradient(120% 160% at 0% 50%, color-mix(in srgb, var(--a1) 22%, transparent), transparent 70%), var(--card);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--a1) 30%, transparent);
}
.odds-head .pk { width: 40px; justify-self: center; }
.odds-head .chest { width: 64px; }
.odds-head h2 { font: 800 25px/1.05 var(--font-display); letter-spacing: .005em; }
.odds-head p { margin-top: 4px; font-size: 13px; font-weight: 700; color: var(--dim); }
.odds-head p .mono { color: var(--ink); }
.odds-table { width: 100%; margin-top: 10px; border-collapse: collapse; }
.odds-table th, .odds-table td { padding: 8px 6px; border-bottom: 1px solid rgba(255, 255, 255, .07); text-align: left; vertical-align: middle; }
.odds-table thead th { font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.odds-table tbody th { font-weight: 800; }
.odds-table .num { text-align: right; white-space: nowrap; }
.odds-prize { display: flex; align-items: center; gap: 10px; }
.odds-prize .row-art { width: 48px; height: 52px; }
.odds-prize .row-art .pv { width: 48px; }
.odds-prize .row-art .pv-slab { width: 32px; }
.odds-prize .row-art .pv-card { width: 36px; }
.odds-name { display: block; font-size: 14px; line-height: 1.3; }
.odds-table .row-detail { display: block; white-space: normal; }
.odds-table .r-dot { display: flex; width: max-content; }
.odds-table th[scope="row"] { width: 100%; }
.r-dot { display: inline-flex; align-items: center; gap: 5px; margin-top: 2px; font-size: 10.5px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--rc); }
.r-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--rc); box-shadow: 0 0 6px var(--rc); }
.odds-value { font-size: 15px; }
.odds-n { display: block; font-weight: 900; font-size: 13px; }
.odds-pct { display: block; font-size: 11px; color: var(--faint); font-weight: 800; }
.odds-more { margin-top: 10px; }
.terms { margin-top: 40px; scroll-margin-top: 130px; }
.terms h2 { font: 800 27px/1.1 var(--font-display); margin-bottom: 12px; }
.placeholder { padding: 22px; border-radius: 18px; border: 1.5px dashed var(--line-2); color: var(--dim); font-weight: 800; text-align: center; }

/* ---------- keyframes ---------- */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}
@keyframes floor {
  0%, 100% { transform: scale(1); opacity: .9; }
  50% { transform: scale(.84); opacity: .6; }
}
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(.2) rotate(0deg); }
  45% { opacity: 1; transform: scale(1) rotate(45deg); }
  70% { opacity: 0; transform: scale(.4) rotate(90deg); }
}
@keyframes poke {
  0% { transform: none; }
  30% { transform: translateY(-14px) rotate(-4deg); }
  60% { transform: translateY(-4px) rotate(3deg); }
  100% { transform: none; }
}
@keyframes shake {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  20% { transform: translate(-3px, 1px) rotate(-1.6deg); }
  40% { transform: translate(3px, -1px) rotate(1.6deg); }
  60% { transform: translate(-2px, 1px) rotate(-1deg); }
  80% { transform: translate(2px, 0) rotate(1deg); }
}
@keyframes shake-hard {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  25% { transform: translate(-6px, 2px) rotate(-3.5deg) scale(1.02); }
  50% { transform: translate(5px, -2px) rotate(3deg) scale(1.03); }
  75% { transform: translate(-4px, 1px) rotate(-2deg) scale(1.02); }
}
@keyframes sway {
  0%, 100% { transform: rotate(2.6deg); }
  50% { transform: rotate(-2.6deg); }
}
@keyframes chevron {
  0%, 100% { opacity: .18; }
  40% { opacity: 1; }
}
@keyframes key-glow {
  0%, 100% { opacity: .75; transform: scale(.94); }
  50% { opacity: 1; transform: scale(1.06); }
}
@keyframes halo {
  0%, 100% { opacity: .8; transform: scale(.96); }
  50% { opacity: 1; transform: scale(1.04); }
}
@keyframes sweep {
  0%, 60% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}
@keyframes slab-sweep {
  0%, 55% { transform: translateX(-140%) rotate(16deg); }
  100% { transform: translateX(320%) rotate(16deg); }
}
@keyframes holo { to { transform: translateX(33.333%); } }
@keyframes shimmer { to { background-position: -300% 0; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes live {
  0% { box-shadow: 0 0 0 0 rgba(44, 255, 122, .6); }
  100% { box-shadow: 0 0 0 8px rgba(44, 255, 122, 0); }
}
@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.22); }
  100% { transform: scale(1); }
}
@keyframes pop {
  from { transform: scale(.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes countdown {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes toast-in {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes sheet-up {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes sheet-in {
  from { transform: translateY(14px) scale(.98); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* ---------- larger screens ---------- */

@media (min-width: 700px) {
  :root { --gutter: 28px; }
  .tabs { width: min(100%, 620px); margin-left: auto; margin-right: auto; }
  .stats-card, .title-row { width: min(100%, 560px); margin-left: auto; margin-right: auto; }
  .title-row { margin-bottom: 18px; }
  .box-name { font-size: 32px; }
  .inside-head { grid-template-columns: 1fr auto; align-items: end; }
  .top-grid, .collection, .rw-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .pull-row { grid-auto-columns: 210px; }
  .pull-fan { --fan-w: 190px; --fan-step: 120px; }
  dialog.sheet { margin: auto; border-radius: 28px; border: 1px solid var(--line-2); }
  dialog.sheet[open] { animation: sheet-in .3s var(--ease-out); }
  .sheet-body { padding: 18px 26px 26px; }
  .list-sheet .sheet-head { top: -18px; margin: -18px -26px 0; padding: 18px 26px 10px; }
  .stage-arrow { display: grid; }
  .odds-hero h1 { font-size: 46px; }
}

/* Desktop: the bottom bar moves into the top bar. */
@media (min-width: 900px) {
  :root { --bar-h: 68px; --tab-h: 0px; }
  .tabbar { display: none; }
  .bar { padding-left: max(var(--gutter), calc(50% - 560px)); padding-right: max(var(--gutter), calc(50% - 560px)); }
  .mark { font-size: 28px; }
  .bar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 28px;
  }
  .bar-nav > a, .bar-nav > button {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: none;
    color: rgba(255, 255, 255, .72);
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
  }
  .bar-nav > a:hover, .bar-nav > button:hover { color: #fff; background: rgba(255, 255, 255, .08); }
  .bar-nav [aria-current="page"] { color: #fff; background: rgba(255, 255, 255, .14); }
  .hero { min-height: max(640px, calc(100svh - var(--bar-h))); padding-bottom: 28px; }
  .tabs { margin-top: 6px; }
  .tab { font-size: 16px; min-height: 48px; }
  .rows { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }
  /* the ⓘ sheet is ~560 px wide: one row per line, so real names ("Gengar · 5/62 · Fossil · 1st Edition · PSA 10") stay readable */
  .sheet .rows { grid-template-columns: minmax(0, 1fr); }
  .top-grid, .collection, .rw-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .page { padding-top: 30px; }
  .page-head h1 { font-size: 44px; }
  .foot { padding-left: max(var(--gutter), calc(50% - 550px)); padding-right: max(var(--gutter), calc(50% - 550px)); }
  dialog.opening { --vault-h: min(60svh, 560px); --chest-w: min(40svh, 380px); }
  .vi-name { font-size: 15px; }
  .reveal-actions { grid-template-columns: 1fr 1fr; width: 440px; }
}

@media (max-width: 370px) {
  :root { --gutter: 12px; }
  .mark { font-size: 21px; }
  .bar-actions { gap: 6px; }
  .btn-sm { padding: 0 13px; font-size: 15px; }
  .balance { padding-left: 11px; font-size: 15px; }
  .tab { font-size: 13px; gap: 4px; padding: 0 2px 2px; }
  .tab svg { display: none; } /* four labels only: "Sports Cards" needs the room */
  .stat b, .odds-pill b { font-size: 19px; }
  .odds-pill { min-width: 90px; padding: 6px 12px 7px; }
  .box-name { font-size: 24px; }
  .row { grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; padding-right: 12px; }
  .row-art { width: 56px; }
  .row-value { font-size: 15px; }
  .tabbar > a, .tabbar > button { font-size: 11px; }
  .mode-switch a { padding: 5px 9px; font-size: 12px; }
}

/* Short phones: the stage gives way first, so the Open button stays above the bottom bar. */
@media (max-height: 700px) and (max-width: 899px) {
  .reveal-note, .reveal-eyebrow { display: none; }
  .reveal-body { gap: 10px; }
  .hero { min-height: max(470px, calc(100svh - var(--bar-h) - env(safe-area-inset-top) - var(--tab-h) - env(safe-area-inset-bottom))); padding-bottom: 12px; }
  .title-row { margin: 4px 0 10px; }
  .stats-card { padding: 12px 14px 14px; }
  .btn-open { margin-top: 10px; min-height: 48px; }
}
@media (max-height: 620px) and (max-width: 899px) {
  .tabs { margin-top: 4px; }
  .tab { min-height: 38px; }
  .stage { min-height: 170px; }
  .box-name { font-size: 22px; }
  .stat b, .odds-pill b { font-size: 18px; }
  .sheet-body { gap: 10px; padding-top: 10px; }
  .buy-box { padding: 8px 12px 8px 8px; }
  .pack { padding: 11px 12px; }
  .pack-amount { font-size: 21px; }
}

/* Landscape phones: a smaller chest and key so the prompt clears the chest and the key has room to
   travel; the open box's window stays below the title bar. */
@media (orientation: landscape) and (max-height: 500px) {
  dialog.opening {
    --chest-w: min(30svh, 34vw, 240px);
    --key-w: clamp(40px, 12svh, 56px);
    --vault-h: calc(100svh - 2 * (64px + env(safe-area-inset-top)) - 12px);
  }
  .op-stage { top: 33%; }
  .op-key { bottom: calc(8px + env(safe-area-inset-bottom)); }
  .key-chevrons { display: none; }
  .key-hint { margin-bottom: 4px; letter-spacing: .14em; }
  .vault-hint { top: calc(50% + var(--vault-h) / 2 + 10px); }
  .hero { min-height: 520px; }
}

/* ---------- reduced motion: keep it still ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .btn-open::after, .slab-sweep, .pv-card .holo { display: none; }
  .ticker-viewport { overflow-x: auto; }
  .ticker-track { animation: none; }
  .pay-countdown i { animation: none; transform: none; }
}
