*,
*::before,
*::after {
  box-sizing: border-box;
  border-radius: 0;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  background: var(--desk);
}

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

#flashOverlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 55;
  transition: opacity 0.3s ease;
}

#flashOverlay.go {
  opacity: 0.48;
}

/* Fixed Motion Layer (flying packs, +N badges, crit banner) */
.motion-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 65;
}

.fly-pack {
  position: fixed;
  top: 0;
  left: 0;
  width: 48px;
  height: 62px;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  will-change: transform, opacity;
}

.fly-pack.is-rare {
  border-color: var(--gold-b);
  outline: 1.5px solid var(--ink);
  box-shadow: 3px 3px 0 var(--gold-a), 4px 4px 0 var(--ink);
}

.fly-pack.is-specialty {
  border-color: var(--red);
  box-shadow: 3px 3px 0 var(--yellow), 4px 4px 0 var(--ink);
}

.fly-pack-crimp {
  height: 5px;
  width: 100%;
  background: repeating-linear-gradient(
    90deg,
    #141414 0 2px,
    rgba(255, 255, 255, 0.85) 2px 4px
  );
  flex-shrink: 0;
}

.fly-pack-emblem {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.fly-pack-emblem svg {
  width: 22px;
  height: 22px;
}

.fly-pack.has-pack-art {
  border: none;
  outline: none;
  box-shadow: none;
  background: transparent;
  filter: drop-shadow(0 4px 6px rgba(20, 20, 20, 0.38));
}

.fly-pack.has-pack-art.is-rare {
  filter: drop-shadow(0 0 6px rgba(242, 210, 122, 0.85))
    drop-shadow(0 4px 6px rgba(20, 20, 20, 0.38));
}

.fly-pack.has-pack-art.is-rare-ssr,
.fly-pack.has-pack-art.is-tier-ur {
  filter: drop-shadow(0 0 8px rgba(255, 198, 72, 0.92))
    drop-shadow(0 0 4px rgba(255, 63, 164, 0.55))
    drop-shadow(0 4px 6px rgba(20, 20, 20, 0.38));
}

.fly-pack.has-pack-art.is-tier-ssr {
  filter: drop-shadow(0 0 7px rgba(224, 179, 76, 0.85))
    drop-shadow(0 4px 6px rgba(20, 20, 20, 0.38));
}

.fly-pack-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Scoped Stage Shake (leaves fixed dock steady) */
.app-main.fx-shake-sm {
  animation: fxShakeSm 0.24s steps(4, end);
}

.app-main.fx-shake-md {
  animation: fxShakeMd 0.32s steps(5, end);
}

.app-main.fx-shake-lg {
  animation: fxShakeLg 0.42s steps(6, end);
}

@keyframes fxShakeSm {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-2px, 1px); }
  50% { transform: translate(2px, -1px); }
  75% { transform: translate(-1px, 1px); }
}

@keyframes fxShakeMd {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-4px, 2px); }
  40% { transform: translate(4px, -2px); }
  60% { transform: translate(-3px, -1px); }
  80% { transform: translate(2px, 2px); }
}

@keyframes fxShakeLg {
  0%, 100% { transform: translate(0, 0); }
  16% { transform: translate(-6px, 3px); }
  33% { transform: translate(6px, -3px); }
  50% { transform: translate(-5px, -2px); }
  66% { transform: translate(4px, 3px); }
  83% { transform: translate(-2px, 1px); }
}

.hud-pop {
  animation: hudPop 0.38s cubic-bezier(0.2, 1.35, 0.35, 1);
}

@keyframes hudPop {
  0% { transform: scale(1) rotate(-3deg); }
  45% { transform: scale(1.24) rotate(-1deg); }
  100% { transform: scale(1) rotate(-3deg); }
}

/* Magazine Page Shell */
.app-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--page-w);
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background-color: var(--paper);
  background-image:
    radial-gradient(rgba(20, 20, 20, 0.065) 0.6px, transparent 0.8px),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 0.08 0 0 0 0 0.08 0 0 0 0 0.08 0 0 0 0.045 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
  background-size: 4px 4px, 200px 200px;
}

@media (min-width: 640px) {
  .app-shell {
    border-left: var(--rule);
    border-right: var(--rule);
    box-shadow: 8px 0 0 rgba(20, 20, 20, 0.14);
  }
}

/* Pure CSS Print Decorations */
.barcode {
  height: 22px;
  width: 84px;
  flex-shrink: 0;
  background: repeating-linear-gradient(
    90deg,
    var(--ink) 0 2px, transparent 2px 3px,
    var(--ink) 3px 4px, transparent 4px 6px,
    var(--ink) 6px 9px, transparent 9px 10px,
    var(--ink) 10px 11px, transparent 11px 14px
  );
}

.barcode.inverted {
  height: 16px;
  width: 58px;
  background: repeating-linear-gradient(
    90deg,
    #fff 0 2px, transparent 2px 3px,
    #fff 3px 4px, transparent 4px 6px,
    #fff 6px 8px, transparent 8px 10px,
    #fff 10px 11px, transparent 11px 13px
  );
}

.ruler {
  height: 6px;
  width: 100%;
  border-top: var(--rule-thin);
  background: repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 10px);
}

.hazard {
  height: 10px;
  width: 100%;
  background: repeating-linear-gradient(-45deg, var(--ink) 0 10px, var(--yellow) 10px 20px);
}

.kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.stamp {
  display: inline-block;
  border: 2px solid currentColor;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 11px;
  line-height: 1.25;
  transform: rotate(-3deg);
  white-space: nowrap;
}

/* === Masthead (Top Editorial Header) === */
.masthead {
  width: 100%;
  flex-shrink: 0;
  background: var(--paper);
  padding: 8px 12px 0;
}

.mh-row1 {
  border-top: 4px solid var(--ink);
  border-bottom: var(--rule);
  padding: 7px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mh-brand {
  flex: 1;
  min-width: 0;
}

.mh-title {
  font-family: var(--font-display);
  font-size: clamp(17px, 4.6vw, 22px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  transform: skewX(-7deg);
  transform-origin: left center;
}

.mh-title em {
  font-style: normal;
  color: var(--red);
}

.mh-sub {
  margin-top: 2px;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
}

.mh-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mh-box {
  position: relative;
  height: 36px;
  padding: 0 10px;
  border: var(--rule);
  background: var(--paper-inset);
  color: var(--ink);
  box-shadow: var(--shadow-hard);
  font-family: var(--font-condensed);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}

.mh-box.mh-icon {
  width: 38px;
  padding: 0;
  font-size: 17px;
  background: var(--ink);
  color: #fff;
}

.mh-box.mh-sound {
  background: var(--paper-inset);
  color: var(--ink);
  font-size: 15px;
}

.mh-box.mh-sound.is-muted {
  opacity: 0.62;
  background: var(--paper-2);
}

.mh-box:active {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 var(--ink);
}

.mh-badge {
  position: absolute;
  top: -7px;
  right: -6px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  background: var(--red);
  color: #fff;
  border: 1.5px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Row 2: Level Stamp + Ruler EXP Bar + Odds + Chest */
.mh-row2 {
  display: none;
  align-items: center;
  gap: 7px;
  padding: 6px 0;
  border-bottom: var(--rule-thin);
}

.mh-row2.visible {
  display: flex;
}

.lv-stamp {
  color: var(--red);
  background: var(--paper-inset);
  font-size: 11px;
  padding: 1px 5px;
  flex-shrink: 0;
}

.exp-ruler {
  flex: 1;
  min-width: 48px;
  height: 12px;
  border: 1.5px solid var(--ink);
  background: var(--paper-inset);
  position: relative;
  overflow: hidden;
}

.exp-fill {
  height: 100%;
  background: var(--red);
  transition: width 0.25s linear;
}

.exp-ruler::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 calc(10% - 1px),
    rgba(20, 20, 20, 0.35) calc(10% - 1px) 10%
  );
}

.mh-mini {
  position: relative;
  height: 24px;
  padding: 0 7px;
  border: 1.5px solid var(--ink);
  background: var(--paper-inset);
  color: var(--ink);
  font-family: var(--font-condensed);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  flex-shrink: 0;
}

.mh-mini:hover {
  background: var(--paper-2);
}

.chest-btn {
  opacity: 0.4;
  cursor: default;
}

.chest-btn.has-chest {
  opacity: 1;
  cursor: pointer;
  background: var(--yellow);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  animation: blinkChest 0.9s steps(2, start) infinite;
}

@keyframes blinkChest {
  0% { background: var(--yellow); }
  50% { background: #ffe478; }
}

/* Main Scrollable Content Area */
.app-main {
  width: 100%;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 12px calc(68px + env(safe-area-inset-bottom));
  scrollbar-width: none;
}

.app-main::-webkit-scrollbar {
  display: none;
}

/* === Bottom Archive Index Bar === */
.bottom-dock {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--page-w);
  z-index: 30;
  display: none;
  border-top: var(--rule);
  background: var(--paper);
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-dock.visible {
  display: flex;
}

@media (min-width: 640px) {
  .bottom-dock {
    border-left: var(--rule);
    border-right: var(--rule);
  }
}

.dock-tab {
  position: relative;
  flex: 1;
  height: 58px;
  border: none;
  border-right: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-family: var(--font-condensed);
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.dock-tab:last-child {
  border-right: none;
}

.dock-tab svg {
  width: 17px;
  height: 17px;
}

.dock-tab.active {
  background: var(--ink);
  color: #fff;
  box-shadow: inset 0 3px 0 var(--red);
}

.dock-tab.hidden {
  display: none;
}

.dock-badge {
  position: absolute;
  top: 4px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--red);
  color: #fff;
  border: 1px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dock-tab.dock-receive-pulse {
  animation: dockReceivePulse 0.4s cubic-bezier(0.2, 1.35, 0.35, 1);
}

@keyframes dockReceivePulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); background: var(--yellow); color: var(--ink); }
  100% { transform: scale(1); }
}

.dock-float-delta {
  position: fixed;
  transform: translate(-50%, 0);
  background: var(--ink);
  color: #fff;
  border: 1.5px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  animation: dockDeltaFloat 0.88s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.dock-float-delta.is-rare {
  background: linear-gradient(135deg, #9A6B16 0%, #F2D27A 60%, #B8862B 100%);
  color: var(--ink);
}

.dock-float-delta.is-specialty {
  background: var(--red);
  color: var(--yellow);
}

.dock-float-delta.is-rare-ssr,
.dock-float-delta.is-tier-ur {
  background: linear-gradient(135deg, #ff3fa4 0%, #ffe600 50%, #29e3ff 100%);
  color: var(--ink);
}

.dock-float-delta.is-tier-ssr {
  background: linear-gradient(135deg, #8b1e24 0%, #e0b34c 100%);
  color: #fff;
}

@keyframes dockDeltaFloat {
  0% { opacity: 0; transform: translate(-50%, 6px) scale(0.8); }
  22% { opacity: 1; transform: translate(-50%, -10px) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -32px) scale(0.95); }
}

/* === Shared Print Buttons === */
.btn-primary,
.btn-secondary,
.btn-ink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: var(--rule);
  box-shadow: var(--shadow-hard);
  font-family: var(--font-condensed);
  font-weight: 800;
  font-size: 13.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.btn-primary {
  background: var(--red);
  color: #fff;
}

.btn-secondary {
  background: var(--paper-inset);
  color: var(--ink);
}

.btn-ink {
  background: var(--ink);
  color: #fff;
}

.btn-primary:active,
.btn-secondary:active,
.btn-ink:active {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 var(--ink);
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-ink:disabled {
  opacity: 0.45;
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}

/* === Slide-In Contents & Settings Drawer === */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(20, 20, 20, 0.56);
  display: none;
}

.drawer-backdrop.open {
  display: block;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(86vw, 340px);
  z-index: 75;
  background: var(--paper);
  border-left: var(--rule);
  box-shadow: -6px 0 0 rgba(20, 20, 20, 0.2);
  transform: translateX(100%);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  background: var(--ink);
  color: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: var(--rule);
}

.drawer-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.drawer-close {
  width: 28px;
  height: 28px;
  border: 1.5px solid #fff;
  background: var(--red);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.drawer-section {
  border-bottom: 1px dotted var(--ink);
  padding-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-row-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.drawer-num {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--red);
}

.drawer-label {
  font-family: var(--font-condensed);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.seg-group {
  display: flex;
  border: var(--rule);
}

.seg-btn {
  flex: 1;
  padding: 7px 10px;
  border: none;
  border-right: var(--rule-thin);
  background: var(--paper-inset);
  color: var(--ink);
  font-family: var(--font-condensed);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}

.seg-btn:last-child {
  border-right: none;
}

.seg-btn.active {
  background: var(--ink);
  color: #fff;
}

.drawer-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.drawer-stat-cell {
  border: var(--rule-thin);
  background: var(--paper-inset);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.drawer-stat-val {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 900;
}

.drawer-footer {
  padding: 12px 14px;
  border-top: var(--rule);
  background: var(--paper-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* === Modals === */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(20, 20, 20, 0.62);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  width: 100%;
  max-width: 450px;
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--paper);
  border: var(--rule);
  box-shadow: var(--shadow-hard-lg);
  padding: 0;
  position: relative;
}

.modal-dialog.wide {
  max-width: 540px;
}

.modal-header {
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: var(--rule);
}

.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transform: skewX(-5deg);
}

.modal-close {
  width: 28px;
  height: 28px;
  border: 1.5px solid #fff;
  background: var(--red);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.modal-body-pad {
  padding: 14px;
}

.modal-close-float {
  position: sticky;
  top: 8px;
  float: right;
  z-index: 12;
  width: 30px;
  height: 30px;
  margin: 8px 8px -30px 0;
  border: 2px solid #fff;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--red);
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  background: var(--paper-inset);
  border: var(--rule-thin);
}

.sheet-table th,
.sheet-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(20, 20, 20, 0.25);
  text-align: left;
}

.sheet-table th {
  background: var(--paper-2);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
}

.big-figure {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  color: var(--red);
  transform: skewX(-6deg);
  margin: 6px 0;
}

.ruler-bar {
  height: 12px;
  border: 1.5px solid var(--ink);
  background: var(--paper-inset);
  position: relative;
  overflow: hidden;
}

.ruler-bar-fill {
  height: 100%;
  background: var(--red);
}

.code-plate {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 900;
  text-align: center;
  padding: 11px;
  background: var(--ink);
  color: var(--yellow);
  border: var(--rule);
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.print-input {
  flex: 1;
  padding: 9px 10px;
  border: var(--rule);
  background: var(--paper-inset);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
}

/* === Toasts === */
.toast-stack {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
  width: calc(100% - 28px);
  max-width: 390px;
}

.toast-item {
  background: var(--ink);
  color: #fff;
  border: var(--rule);
  border-left: 5px solid var(--red);
  box-shadow: var(--shadow-hard);
  padding: 9px 12px;
  font-family: var(--font-condensed);
  font-size: 13px;
  font-weight: 700;
  animation: toastSlideIn 0.24s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes toastSlideIn {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* === Secondary Views (Collection, Trophies, Market) === */
.view-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.subtab-bar {
  display: flex;
  border: var(--rule);
  background: var(--paper-inset);
}

.subtab-btn {
  flex: 1;
  border: none;
  border-right: var(--rule);
  background: transparent;
  padding: 8px 10px;
  font-family: var(--font-condensed);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
}

.subtab-btn:last-child {
  border-right: none;
}

.subtab-btn.active {
  background: var(--ink);
  color: #fff;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.filter-chip {
  border: 1.5px solid var(--ink);
  background: var(--paper-inset);
  color: var(--ink);
  padding: 4px 9px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.filter-chip.active {
  background: var(--ink);
  color: #fff;
}

.filter-select {
  border: 1.5px solid var(--ink);
  background: var(--paper-inset);
  color: var(--ink);
  padding: 4px 7px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  max-width: 100%;
  min-width: 0;
}

.binder-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.empty-state {
  text-align: center;
  padding: 28px 18px;
  background: var(--paper-inset);
  border: var(--rule);
  box-shadow: var(--shadow-hard);
  color: var(--ink-soft);
  font-size: 13.5px;
}

/* Market Classifieds */
.market-hero-card {
  border: var(--rule);
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-hard);
  overflow: hidden;
}

.market-hero-inner {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.market-hero-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  background: var(--r-SSR);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.market-refill-card {
  border: var(--rule);
  background: var(--paper-inset);
  box-shadow: var(--shadow-hard);
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.market-shelf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: var(--rule);
  padding: 4px 0;
  font-family: var(--font-condensed);
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.market-shelf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.shelf-item {
  border: var(--rule);
  background: var(--paper-inset);
  box-shadow: var(--shadow-hard);
  padding: 9px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.shelf-pack-banner {
  border: 1.5px solid var(--ink);
  padding: 8px;
  color: #fff;
  min-height: 74px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.shelf-slot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-height: 18px;
}

.shelf-item.is-rare {
  border: 2px solid var(--gold-a);
  outline: 1.5px solid var(--ink);
  background: linear-gradient(180deg, #fff8e2 0%, var(--paper-inset) 100%);
}

.shelf-pack-banner.is-rare {
  border: 2px solid var(--gold-b);
}

.shelf-item.specialty-slot {
  border-color: var(--red);
  background: repeating-linear-gradient(
    -45deg,
    rgba(217, 43, 30, 0.04) 0 8px,
    rgba(242, 183, 5, 0.05) 8px 16px
  ), var(--paper-inset);
}

.shelf-empty-banner {
  background: var(--paper-2);
  color: var(--ink);
}

.toast-item.crit-toast {
  border-left: 6px solid var(--yellow);
  background: linear-gradient(90deg, #1a1409 0%, #3d280a 100%);
  color: #fff4c2;
}

/* Trophies Table Cards */
.trophy-summary {
  padding: 10px 13px;
  background: var(--ink);
  color: #fff;
  border: var(--rule);
  box-shadow: var(--shadow-hard);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-condensed);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.trophy-card {
  padding: 10px 12px;
  background: var(--paper-inset);
  border: var(--rule-thin);
  border-left: 4px solid var(--ink);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.trophy-card.done {
  border-left-color: var(--red);
  background: #fff9e6;
}

.trophy-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trophy-idx {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  color: var(--muted);
  width: 26px;
  flex-shrink: 0;
}

.trophy-card.done .trophy-idx {
  color: var(--red);
}

.trophy-bar-track {
  height: 9px;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.trophy-bar-fill {
  height: 100%;
  background: var(--red);
}

/* === Market Claiming, R+ Crit Banner & Chest/LevelUp Modal Motion === */
.market-refill-card,
.shelf-item {
  position: relative;
}

.btn-primary.is-ready {
  position: relative;
  overflow: hidden;
}

.btn-primary.is-ready::after {
  content: '';
  position: absolute;
  inset: -20%;
  background: linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, 0.32) 50%, transparent 60%);
  transform: translateX(-80%);
  animation: readySweep 2.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes readySweep {
  0%, 55% { transform: translateX(-80%); }
  100% { transform: translateX(90%); }
}

.shelf-pack-banner.is-rare-sheen::before {
  content: '';
  position: absolute;
  inset: -30%;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.38) 50%, transparent 60%);
  animation: rareSheen 3s linear infinite;
  pointer-events: none;
}

.shelf-limited-mini {
  position: absolute;
  top: 4px;
  right: -16px;
  width: 66px;
  text-align: center;
  background: repeating-linear-gradient(-45deg, var(--red) 0 4px, var(--yellow) 4px 8px);
  color: var(--ink);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 900;
  padding: 1px 0;
  transform: rotate(32deg);
  pointer-events: none;
}

.market-refill-card.just-claimed,
.shelf-item.just-claimed {
  animation: claimCardBounce 0.32s cubic-bezier(0.2, 1.25, 0.35, 1);
}

.market-refill-card.just-claimed-crit {
  border-color: var(--gold-a);
  background: linear-gradient(180deg, #fff6d1 0%, var(--paper-inset) 100%);
  box-shadow: 4px 4px 0 var(--gold-a), 6px 6px 0 var(--ink);
}

@keyframes claimCardBounce {
  0% { transform: scale(1); }
  40% { transform: scale(0.96); }
  100% { transform: scale(1); }
}

.claim-stamp-overlay {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  background: var(--ink);
  color: var(--yellow);
  border: 2px solid var(--ink);
  outline: 1.5px solid #fff;
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.04em;
  transform: rotate(-8deg);
  pointer-events: none;
  animation: stampSlamIn 0.28s cubic-bezier(0.16, 1.32, 0.3, 1) both;
}

.claim-stamp-overlay.is-crit {
  background: linear-gradient(135deg, var(--red) 0%, #9A6B16 55%, var(--gold-b) 100%);
  color: #fff;
  outline-color: var(--gold-b);
}

@keyframes stampSlamIn {
  0% { opacity: 0; transform: scale(1.9) rotate(-18deg); }
  70% { opacity: 1; transform: scale(0.92) rotate(-7deg); }
  100% { opacity: 1; transform: scale(1) rotate(-8deg); }
}

/* R+ Deluxe Crit Editorial Banner */
.crit-banner {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 390px);
  background: linear-gradient(135deg, #1a1409 0%, #3d280a 55%, #1a1409 100%);
  color: #fff4c2;
  border: 2.5px solid var(--gold-b);
  outline: 2px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  padding: 10px 14px;
  text-align: center;
  overflow: hidden;
  animation: critBannerSlam 1.45s cubic-bezier(0.16, 1.15, 0.3, 1) forwards;
}

.crit-banner::after {
  content: '';
  position: absolute;
  inset: -40%;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.45) 50%, transparent 60%);
  animation: rareSheen 0.9s ease-out 0.12s 1;
}

.crit-banner-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  color: var(--gold-b);
  letter-spacing: 0.04em;
}

.crit-banner-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  margin-top: 2px;
}

@keyframes critBannerSlam {
  0% { opacity: 0; transform: translate(-50%, -18px) scale(1.22); }
  16% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  80% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -10px) scale(0.96); }
}

/* Chest & Level-Up Modal Pack Reveal */
.chest-reveal-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 8px;
  border: var(--rule);
  background: var(--paper-2);
  overflow: hidden;
}

.chest-rays {
  position: absolute;
  width: 280px;
  height: 280px;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(242, 183, 5, 0.22) 0deg 14deg,
    transparent 14deg 28deg
  );
  animation: chestRaysSpin 12s linear infinite;
  pointer-events: none;
}

@keyframes chestRaysSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.chest-pack-card {
  position: relative;
  z-index: 2;
  width: 210px;
  border: 2.5px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  color: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: chestPackPop 0.42s cubic-bezier(0.18, 1.22, 0.32, 1) both;
}

.chest-pack-card.is-specialty {
  border-color: var(--red);
}

.chest-pack-inner {
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.chest-pack-emblem {
  width: 56px;
  height: 56px;
  border: 2px solid var(--ink);
  background: rgba(20, 20, 20, 0.45);
  box-shadow: 2px 2px 0 var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chest-pack-emblem svg {
  width: 34px;
  height: 34px;
}

@keyframes chestPackPop {
  0% { opacity: 0; transform: scale(0.55) translateY(20px) rotate(-6deg); }
  68% { opacity: 1; transform: scale(1.06) translateY(-4px) rotate(1.5deg); }
  100% { opacity: 1; transform: scale(1) translateY(0) rotate(0deg); }
}

.levelup-stamp-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 6px;
  border: var(--rule-thin);
  background: var(--paper-inset);
}

.levelup-arrow {
  font-weight: 900;
  color: var(--red);
  font-size: 16px;
}

.levelup-new-stamp {
  animation: stampSlamIn 0.36s cubic-bezier(0.16, 1.32, 0.3, 1) 0.08s both;
}

.levelup-bonus-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  border: var(--rule);
  border-left: 5px solid var(--gold-a);
  background: var(--paper-2);
  padding: 9px 10px;
  margin-bottom: 10px;
}

.levelup-bonus-pack {
  width: 48px;
  height: 62px;
  flex-shrink: 0;
  border: 2px solid var(--gold-b);
  outline: 1.5px solid var(--ink);
  box-shadow: 3px 3px 0 var(--gold-a), 4px 4px 0 var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  animation: chestPackPop 0.38s cubic-bezier(0.18, 1.22, 0.32, 1) 0.1s both;
}

@media (prefers-reduced-motion: reduce) {
  .pack-foil.tearing,
  .pack-foil.tearing.ripped .pack-top-cap,
  .pack-foil.tearing.ripped .pack-body-shell,
  .pack-foil.tearing.ripped .pack-card-peek,
  .pack-fan-ghost,
  .pack-stack.anim-swap,
  .pack-stack.anim-arrival,
  .pack-arrival-badge,
  .tray-pack-btn.is-new-arrival,
  .car-card.reveal-enter,
  .car-card.reveal-next,
  .mini-card.batch-deal-card,
  .app-main.fx-shake-sm,
  .app-main.fx-shake-md,
  .app-main.fx-shake-lg,
  .hud-pop,
  .dock-tab.dock-receive-pulse,
  .btn-primary.is-ready::after,
  .shelf-pack-banner.is-rare-sheen::before,
  .chest-rays,
  .chest-pack-card,
  .levelup-bonus-pack,
  .crit-banner::after,
  .shelf-rare-sheen::after {
    animation: none !important;
  }
}

/* === Market, Chest & Level-Up Real Foil Pack Styles === */
.market-refill-thumb {
  width: 40px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 3px 5px rgba(20, 20, 20, 0.34));
  pointer-events: none;
}

.shelf-pack-banner.has-pack-art {
  background: var(--paper-2);
  color: var(--ink);
  padding: 8px 6px 6px;
  min-height: 158px;
  align-items: center;
  gap: 6px;
}

.shelf-pack-art-wrap {
  position: relative;
  width: 78px;
  height: 106px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.shelf-pack-img {
  width: 78px;
  height: 106px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 6px 10px rgba(20, 20, 20, 0.32));
  pointer-events: none;
}

.shelf-pack-banner.has-pack-art.is-rare .shelf-pack-img {
  filter: drop-shadow(0 0 8px rgba(242, 210, 122, 0.72))
    drop-shadow(0 6px 10px rgba(20, 20, 20, 0.34));
}

.shelf-rare-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  -webkit-mask-size: 78px 106px;
  mask-size: 78px 106px;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.shelf-rare-sheen::after {
  content: '';
  position: absolute;
  inset: -40%;
  background: linear-gradient(
    115deg,
    transparent 38%,
    rgba(242, 210, 122, 0.5) 48%,
    rgba(255, 255, 255, 0.68) 52%,
    rgba(242, 210, 122, 0.35) 56%,
    transparent 66%
  );
  animation: rareSheen 3s linear infinite;
}

.shelf-rare-sheen.is-ssr-fx::after {
  background: linear-gradient(
    115deg,
    transparent 34%,
    rgba(255, 63, 164, 0.44) 44%,
    rgba(255, 230, 0, 0.65) 49%,
    rgba(255, 255, 255, 0.82) 52%,
    rgba(41, 227, 255, 0.45) 56%,
    transparent 66%
  );
  animation: rareSheen 2.4s linear infinite;
}

.shelf-pack-banner.has-pack-art.is-rare-ssr .shelf-pack-img {
  filter: drop-shadow(0 0 10px rgba(255, 198, 72, 0.82))
    drop-shadow(0 0 5px rgba(255, 63, 164, 0.45))
    drop-shadow(0 6px 10px rgba(20, 20, 20, 0.34));
}

.shelf-pack-caption {
  width: 100%;
  text-align: center;
  border-top: 1px solid rgba(20, 20, 20, 0.16);
  padding-top: 4px;
}

.shelf-pack-title {
  font-family: var(--font-condensed);
  font-size: 12.5px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.15;
}

.shelf-pack-sub {
  font-size: 10px;
  color: var(--ink-soft);
  line-height: 1.2;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pack-rare-sash.sm {
  top: 8px;
  left: -26px;
  width: 92px;
  padding: 1.5px 0;
  font-size: 7.5px;
}

.pack-rare-seal.sm {
  top: 6px;
  right: 6px;
  font-size: 8.5px;
  padding: 1px 4px;
}

.chest-pack-card.has-pack-art {
  width: auto;
  border: none;
  box-shadow: none;
  background: transparent;
  align-items: center;
  gap: 8px;
  overflow: visible;
}

.chest-pack-img {
  width: 162px;
  height: 222px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 12px 18px rgba(20, 20, 20, 0.38));
}

.chest-pack-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.chest-multi-grid {
  position: relative;
  z-index: 2;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
  max-height: 290px;
  overflow-y: auto;
  padding: 2px;
}

.chest-multi-item {
  position: relative;
  background: var(--paper-inset);
  border: 1.5px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.chest-multi-img {
  width: 62px;
  height: 84px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 3px 5px rgba(20, 20, 20, 0.28));
}

.chest-multi-fallback {
  width: 62px;
  height: 84px;
  border: 1.5px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}

.chest-multi-fallback svg {
  width: 30px;
  height: 30px;
}

.chest-multi-qty {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--ink);
  color: var(--yellow);
  border: 1px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 900;
  padding: 0 4px;
  line-height: 1.35;
}

.chest-multi-name {
  font-family: var(--font-condensed);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.levelup-bonus-pack.has-pack-art {
  position: relative;
  border: none;
  outline: none;
  box-shadow: none;
  background: transparent;
  overflow: visible;
}

.levelup-bonus-img {
  width: 48px;
  height: 62px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 6px rgba(242, 210, 122, 0.78))
    drop-shadow(0 3px 5px rgba(20, 20, 20, 0.35));
}

.levelup-rare-mini {
  position: absolute;
  top: -4px;
  right: -6px;
  background: linear-gradient(135deg, var(--red) 0%, #9a6b16 55%, var(--gold-b) 100%);
  color: #fff;
  border: 1px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 900;
  padding: 0 3px;
}
