/* Cozy Card Shop & Collection Binder - Styles & 3D Holographic Card Shaders */

:root {
  --bg-cream: #fbf7f0;
  --bg-warm: #f3ece0;
  --bg-card: #ffffff;
  --ink-dark: #2c221e;
  --ink-muted: #6e5a4f;
  --ink-soft: #9c897e;
  --border-warm: #e4d5c3;
  --accent-coral: #e86f52;
  --accent-coral-dark: #c85338;
  --accent-gold: #f59e0b;
  --accent-sage: #4c956c;
  --accent-purple: #7c5dfa;
  --shadow-soft: 0 10px 28px -6px rgba(66, 42, 23, 0.1);
  --shadow-card: 0 12px 24px -6px rgba(44, 34, 30, 0.16), 0 4px 8px -2px rgba(44, 34, 30, 0.08);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-card: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', 'Plus Jakarta Sans', 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-cream);
  background-image:
    radial-gradient(circle at 15% 15%, rgba(232, 111, 82, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(124, 93, 250, 0.08) 0%, transparent 45%),
    radial-gradient(#dfd3c3 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 26px 26px;
  color: var(--ink-dark);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* ================= TOP HEADER & CURRENCY BAR ================= */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 247, 240, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--border-warm);
  padding: 0.75rem 1.5rem;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(135deg, #e86f52, #f59e0b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(232, 111, 82, 0.3);
}

.brand-title h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink-dark);
}

.collector-rank-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink-muted);
  background: var(--bg-warm);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border-warm);
  margin-top: 0.15rem;
}

.nav-tabs {
  display: flex;
  gap: 0.45rem;
  background: var(--bg-warm);
  padding: 0.3rem;
  border-radius: 999px;
  border: 1px solid var(--border-warm);
}

.nav-tab {
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.55rem 1.05rem;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.18s ease;
}

.nav-tab:hover {
  color: var(--ink-dark);
  background: rgba(255, 255, 255, 0.6);
}

.nav-tab.active {
  background: var(--ink-dark);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(44, 34, 30, 0.18);
}

.tab-badge {
  background: var(--accent-coral);
  color: #fff;
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-weight: 800;
}

.stats-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.currency-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #ffffff;
  border: 2px solid var(--border-warm);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.currency-pill.coins {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #92400e;
}

.currency-pill.dust {
  border-color: #d8b4fe;
  background: #faf5ff;
  color: #581c87;
}

.currency-pill.progress {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #065f46;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--border-warm);
  background: #ffffff;
  cursor: pointer;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
}

.icon-btn:hover {
  background: var(--bg-warm);
  transform: scale(1.06);
}

/* ================= MAIN CONTAINER ================= */
.main-content {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  flex: 1;
}

.view-section {
  display: none;
  animation: fadeIn 0.25s ease;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================= COZY DISPLAY SHELF BANNER ================= */
.shelf-banner {
  background: linear-gradient(135deg, #fff9ef 0%, #f7ebd9 100%);
  border: 2px solid #e2cdb5;
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.4rem;
  margin-bottom: 1.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow-soft);
}

.shelf-info {
  flex: 1;
  min-width: 240px;
}

.shelf-info h2 {
  font-size: 1.08rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.shelf-info p {
  font-size: 0.86rem;
  color: var(--ink-muted);
}

.shelf-slots {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.shelf-mini-card {
  width: 66px;
  height: 88px;
  border-radius: 10px;
  background: #ffffff;
  border: 2px solid var(--border-warm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.shelf-mini-card:hover {
  transform: translateY(-4px) scale(1.05);
}

.shelf-mini-card.empty {
  background: rgba(255, 255, 255, 0.45);
  border-style: dashed;
  color: var(--ink-soft);
  font-size: 0.72rem;
  text-align: center;
}

.shelf-mini-card .mini-art {
  width: 48px;
  height: 44px;
}

.shelf-mini-card .mini-art svg {
  width: 100%;
  height: 100%;
}

.shelf-mini-card .mini-rate {
  font-size: 0.66rem;
  font-weight: 800;
  color: #92400e;
  background: #fef3c7;
  padding: 0.08rem 0.35rem;
  border-radius: 99px;
  margin-top: 2px;
}

.shelf-claim-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
}

.btn-primary,
.btn-secondary,
.btn-gold {
  border: none;
  border-radius: 12px;
  padding: 0.65rem 1.15rem;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: all 0.16s ease;
}

.btn-primary {
  background: var(--accent-coral);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(232, 111, 82, 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-coral-dark);
  transform: translateY(-2px);
}

.btn-gold {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.32);
}

.btn-gold:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.btn-secondary {
  background: #ffffff;
  color: var(--ink-dark);
  border: 2px solid var(--border-warm);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-warm);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ================= BOOSTER PACK SHOP GRID ================= */
.shop-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.shop-header-row h2 {
  font-size: 1.4rem;
  font-weight: 800;
}

.pity-meter {
  font-size: 0.85rem;
  font-weight: 700;
  background: #fffbeb;
  border: 1.5px solid #fcd34d;
  color: #92400e;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
}

.packs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(265px, 1fr));
  gap: 1.35rem;
  margin-bottom: 2rem;
}

.pack-card {
  background: #ffffff;
  border: 2px solid var(--border-warm);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  box-shadow: var(--shadow-soft);
}

.pack-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 34px -8px rgba(44, 34, 30, 0.16);
}

/* Foil Booster Pack Wrapper Visual */
.booster-pack-visual {
  width: 156px;
  height: 215px;
  border-radius: 14px;
  position: relative;
  margin: 0.4rem 0 1.1rem;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  color: #ffffff;
  cursor: pointer;
  user-select: none;
  box-shadow:
    0 14px 24px -6px rgba(0, 0, 0, 0.25),
    inset 0 2px 4px rgba(255, 255, 255, 0.6);
  transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  overflow: hidden;
}

.booster-pack-visual:hover {
  transform: scale(1.05) rotate(-1.5deg);
}

/* Crimped foil top & bottom edges */
.booster-pack-visual::before,
.booster-pack-visual::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 11px;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.38) 0px,
    rgba(255, 255, 255, 0.38) 3px,
    rgba(0, 0, 0, 0.15) 3px,
    rgba(0, 0, 0, 0.15) 6px
  );
}

.booster-pack-visual::before {
  top: 0;
  border-bottom: 1.5px dashed rgba(255, 255, 255, 0.65);
}

.booster-pack-visual::after {
  bottom: 0;
  border-top: 1.5px solid rgba(0, 0, 0, 0.15);
}

.pack-shimmer {
  position: absolute;
  inset: -60%;
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(255, 255, 255, 0.45) 50%,
    transparent 65%
  );
  transform: translateX(-80%) rotate(15deg);
  animation: packGleam 4.5s infinite ease-in-out;
  pointer-events: none;
}

@keyframes packGleam {
  0%, 55% {
    transform: translateX(-90%) rotate(15deg);
  }
  100% {
    transform: translateX(90%) rotate(15deg);
  }
}

.pack-badge-circle {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.3rem;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
  z-index: 1;
}

.pack-visual-title {
  font-weight: 900;
  font-size: 0.96rem;
  line-height: 1.15;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.32);
  z-index: 1;
}

.pack-card-count-pill {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(0, 0, 0, 0.28);
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  z-index: 1;
}

.pack-meta-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
}

.pack-meta-sub {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 0.55rem;
}

.pack-meta-desc {
  font-size: 0.84rem;
  color: var(--ink-muted);
  margin-bottom: 0.9rem;
  line-height: 1.4;
  flex: 1;
}

.pack-progress-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ink-muted);
  margin-bottom: 0.85rem;
  background: var(--bg-warm);
  padding: 0.35rem 0.75rem;
  border-radius: 99px;
}

/* ================= PACK OPENING STAGE OVERLAY ================= */
.pack-stage-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(24, 18, 16, 0.88);
  backdrop-filter: blur(10px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
}

.pack-stage-overlay.active {
  display: flex;
}

.stage-header {
  color: #ffffff;
  text-align: center;
  margin-bottom: 1.25rem;
}

.stage-header h2 {
  font-size: 1.65rem;
  font-weight: 900;
  margin-bottom: 0.3rem;
}

.stage-header p {
  color: #d6c7b8;
  font-size: 0.95rem;
}

.god-pack-banner {
  background: linear-gradient(90deg, #ec4899, #f59e0b, #10b981, #3b82f6, #8b5cf6);
  background-size: 300% 100%;
  animation: rainbowShift 2.5s linear infinite;
  color: #ffffff;
  font-weight: 900;
  padding: 0.4rem 1.2rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  font-size: 0.92rem;
  letter-spacing: 0.05em;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.6);
}

/* Unopened Pack waiting to be torn */
.stage-pack-tear-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  margin: 1rem 0;
}

.stage-pack-tear-box .booster-pack-visual {
  width: 210px;
  height: 290px;
  animation: floatPack 2.4s ease-in-out infinite;
}

.stage-pack-tear-box.tearing .booster-pack-visual {
  animation: tearBurst 0.55s forwards ease-in;
}

@keyframes floatPack {
  0%, 100% {
    transform: translateY(0px) rotate(-1deg);
  }
  50% {
    transform: translateY(-10px) rotate(1.5deg);
  }
}

@keyframes tearBurst {
  0% {
    transform: scale(1) rotate(0deg);
  }
  40% {
    transform: scale(1.12) rotate(-5deg);
    filter: brightness(1.3);
  }
  100% {
    transform: scale(1.55) translateY(20px);
    opacity: 0;
    filter: brightness(2);
  }
}

.pulled-cards-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.15rem;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0.5rem 0 1.5rem;
  perspective: 1200px;
}

.stage-controls {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ================= 3D COLLECTIBLE CARD & HOLOGRAPHIC SHADERS ================= */
.card-flip-container {
  width: 210px;
  height: 296px;
  perspective: 1100px;
  cursor: pointer;
  user-select: none;
}

.card-flipper {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.card-flip-container.flipped .card-flipper {
  transform: rotateY(180deg);
}

.card-back,
.card-front-wrap {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-card);
}

.card-back {
  background: linear-gradient(135deg, #3c2a21 0%, #1f1612 100%);
  border: 6px solid #f3e5d0;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.card-back::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 2px dashed rgba(243, 229, 208, 0.35);
  border-radius: 10px;
}

.card-back-emblem {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: radial-gradient(circle, #f59e0b, #b45309);
  border: 3px solid #fef3c7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.1rem;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.45);
}

.card-back.rare-glow {
  box-shadow: 0 0 26px rgba(59, 130, 246, 0.75);
  border-color: #93c5fd;
}

.card-back.secret-glow {
  box-shadow: 0 0 32px rgba(245, 158, 11, 0.95);
  border-color: #fde047;
  animation: pulseSecret 1.4s infinite alternate;
}

@keyframes pulseSecret {
  from {
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.7);
  }
  to {
    box-shadow: 0 0 36px rgba(236, 72, 153, 0.95);
  }
}

.card-front-wrap {
  transform: rotateY(180deg);
}

/* Interactive 3D Collectible Card Component */
.collectible-card {
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 50%;
  width: 210px;
  height: 296px;
  border-radius: var(--radius-card);
  background: #fffdf9;
  border: 6px solid #e7d8c5;
  padding: 9px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.12s ease-out, box-shadow 0.2s ease;
  cursor: pointer;
  user-select: none;
}

.collectible-card:hover {
  box-shadow: 0 20px 36px -8px rgba(44, 34, 30, 0.28);
  z-index: 5;
}

/* Rarity Frame Borders */
.collectible-card.rarity-common {
  border-color: #d6ccc2;
}
.collectible-card.rarity-uncommon {
  border-color: #6ee7b7;
  background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
}
.collectible-card.rarity-rare {
  border-color: #60a5fa;
  background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
}
.collectible-card.rarity-secret {
  border-color: #fbbf24;
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
}

/* Holographic & Foil Shader Overlay Layers */
.card-holo-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  border-radius: 10px;
  transition: opacity 0.2s ease;
}

.collectible-card.finish-holo .card-holo-overlay {
  opacity: 0.48;
  background:
    radial-gradient(
      circle at var(--mx) var(--my),
      rgba(255, 255, 255, 0.85) 0%,
      rgba(56, 189, 248, 0.35) 28%,
      rgba(236, 72, 153, 0.35) 55%,
      transparent 80%
    ),
    repeating-linear-gradient(
      125deg,
      rgba(255, 0, 128, 0.14) 0%,
      rgba(255, 230, 0, 0.14) 14%,
      rgba(0, 255, 180, 0.14) 28%,
      rgba(0, 140, 255, 0.14) 42%,
      rgba(255, 0, 128, 0.14) 56%
    );
  mix-blend-mode: color-dodge;
}

.collectible-card.finish-gold {
  border-color: #f59e0b;
  box-shadow: 0 12px 26px rgba(245, 158, 11, 0.28);
}

.collectible-card.finish-gold .card-holo-overlay {
  opacity: 0.55;
  background:
    radial-gradient(
      circle at var(--mx) var(--my),
      rgba(255, 251, 235, 0.9) 0%,
      rgba(251, 191, 36, 0.48) 38%,
      transparent 75%
    ),
    repeating-linear-gradient(
      45deg,
      rgba(245, 158, 11, 0.2) 0px,
      rgba(254, 240, 138, 0.3) 8px,
      rgba(217, 119, 6, 0.15) 16px
    );
  mix-blend-mode: overlay;
}

.collectible-card.finish-prismatic {
  border-color: #e879f9;
  box-shadow: 0 12px 28px rgba(217, 70, 239, 0.34);
}

.collectible-card.finish-prismatic .card-holo-overlay {
  opacity: 0.65;
  background:
    radial-gradient(
      circle at var(--mx) var(--my),
      rgba(255, 255, 255, 0.95) 0%,
      transparent 55%
    ),
    conic-gradient(
      from 45deg at var(--mx) var(--my),
      rgba(255, 80, 140, 0.42),
      rgba(255, 200, 50, 0.42),
      rgba(60, 240, 160, 0.42),
      rgba(70, 170, 255, 0.42),
      rgba(190, 90, 255, 0.42),
      rgba(255, 80, 140, 0.42)
    );
  mix-blend-mode: color-dodge;
}

@keyframes rainbowShift {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 300% 50%;
  }
}

/* Card Internal Layout */
.card-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  z-index: 2;
}

.card-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ink-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-cozy-badge {
  font-size: 0.68rem;
  font-weight: 900;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  padding: 0.08rem 0.38rem;
  border-radius: 99px;
  flex-shrink: 0;
}

.card-art-frame {
  width: 100%;
  height: 138px;
  border-radius: 10px;
  border: 2px solid rgba(44, 34, 30, 0.12);
  overflow: hidden;
  position: relative;
  background: #fff;
  z-index: 2;
  margin: 4px 0;
}

.card-svg-art {
  width: 100%;
  height: 100%;
  display: block;
}

.card-finish-pill {
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 0.62rem;
  font-weight: 900;
  padding: 0.12rem 0.42rem;
  border-radius: 99px;
  background: rgba(25, 20, 18, 0.78);
  color: #ffffff;
  backdrop-filter: blur(4px);
}

.card-new-pill {
  position: absolute;
  top: 5px;
  left: 5px;
  font-size: 0.62rem;
  font-weight: 900;
  padding: 0.12rem 0.44rem;
  border-radius: 99px;
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
}

.card-vibe-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--ink-muted);
  background: rgba(0, 0, 0, 0.04);
  padding: 0.18rem 0.45rem;
  border-radius: 6px;
  z-index: 2;
}

.card-flavor-text {
  font-size: 0.68rem;
  color: var(--ink-muted);
  line-height: 1.32;
  font-style: italic;
  z-index: 2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--ink-soft);
  border-top: 1px solid rgba(0, 0, 0, 0.07);
  padding-top: 3px;
  z-index: 2;
}

.card-count-badge {
  background: var(--ink-dark);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 800;
  padding: 0.08rem 0.42rem;
  border-radius: 99px;
}

/* ================= COLLECTION BINDER VIEW ================= */
.binder-controls {
  background: #ffffff;
  border: 2px solid var(--border-warm);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: var(--shadow-soft);
}

.set-selector-pills {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.set-pill-btn {
  border: 2px solid var(--border-warm);
  background: var(--bg-cream);
  color: var(--ink-dark);
  font-weight: 800;
  font-size: 0.84rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.set-pill-btn.active {
  background: var(--ink-dark);
  color: #ffffff;
  border-color: var(--ink-dark);
}

.binder-filter-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.binder-select {
  border: 2px solid var(--border-warm);
  background: var(--bg-cream);
  color: var(--ink-dark);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.42rem 0.75rem;
  border-radius: 10px;
}

.binder-book {
  background: #e9dcc9;
  border: 4px solid #c9b59c;
  border-radius: 26px;
  padding: 1.65rem;
  box-shadow:
    inset 0 2px 10px rgba(0, 0, 0, 0.08),
    0 18px 40px -12px rgba(44, 34, 30, 0.2);
}

.binder-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 2px dashed #c9b59c;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.binder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1.35rem;
  justify-items: center;
}

/* Uncollected Empty Binder Pocket */
.binder-empty-slot {
  width: 210px;
  height: 296px;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.38);
  border: 2.5px dashed #bba68e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.15rem;
  text-align: center;
  color: var(--ink-muted);
  position: relative;
  transition: background 0.18s ease;
}

.binder-empty-slot:hover {
  background: rgba(255, 255, 255, 0.62);
}

.empty-slot-num {
  font-size: 0.8rem;
  font-weight: 900;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}

.empty-slot-silhouette {
  width: 96px;
  height: 76px;
  opacity: 0.18;
  filter: grayscale(1) contrast(200%);
  margin: 0.35rem 0;
}

.empty-slot-name {
  font-size: 0.88rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

/* ================= TRADING POST & DUPLICATE RECYCLER ================= */
.trade-layout {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 1.5rem;
}

@media (max-width: 920px) {
  .trade-layout {
    grid-template-columns: 1fr;
  }
}

.panel-box {
  background: #ffffff;
  border: 2px solid var(--border-warm);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  box-shadow: var(--shadow-soft);
}

.panel-box h3 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.panel-sub {
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin-bottom: 1.2rem;
}

.recycler-summary {
  background: var(--bg-cream);
  border: 2px solid var(--border-warm);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
}

.npc-offers-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.npc-offer-card {
  border: 2px solid var(--border-warm);
  background: var(--bg-cream);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.npc-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.npc-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--border-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
}

.trade-exchange-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1.5px solid var(--border-warm);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ================= CARD DETAIL INSPECTION MODAL ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(28, 21, 18, 0.75);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

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

.modal-card-dialog {
  background: var(--bg-cream);
  border: 3px solid var(--border-warm);
  border-radius: 24px;
  max-width: 680px;
  width: 100%;
  padding: 1.65rem;
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 1.5rem;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
}

@media (max-width: 640px) {
  .modal-card-dialog {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border-warm);
  background: #ffffff;
  cursor: pointer;
  font-weight: 900;
}

.variant-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.85rem 0;
}

.variant-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1.5px solid var(--border-warm);
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  font-size: 0.83rem;
  font-weight: 700;
}

/* ================= TOAST NOTIFICATION ================= */
.toast-container {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.toast {
  background: var(--ink-dark);
  color: #ffffff;
  padding: 0.75rem 1.15rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.22s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ================= ENAMEL PIN CORKBOARD & CAPSULE MACHINE ================= */
.corkboard-showcase {
  background-color: #c89d6c;
  background-image:
    radial-gradient(rgba(92, 60, 28, 0.16) 1.5px, transparent 1.5px),
    radial-gradient(rgba(255, 238, 210, 0.22) 1.5px, #c89d6c 1.5px);
  background-size: 18px 18px;
  background-position: 0 0, 9px 9px;
  border: 10px solid #784f2b;
  border-radius: 24px;
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.6rem;
  box-shadow:
    inset 0 4px 16px rgba(45, 25, 10, 0.35),
    0 14px 32px -8px rgba(44, 34, 30, 0.22);
  color: #2c1c11;
}

.corkboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: rgba(255, 251, 244, 0.92);
  border: 2px solid #a87b4c;
  border-radius: 16px;
  padding: 0.85rem 1.2rem;
  margin-bottom: 1.25rem;
}

.corkboard-buff-pills {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.corkboard-buff-pill {
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.32rem 0.75rem;
  border-radius: 999px;
  background: #fef3c7;
  border: 1.5px solid #f59e0b;
  color: #92400e;
}

.corkboard-slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 1.1rem;
  justify-items: center;
}

.corkboard-pin-slot {
  width: 145px;
  height: 158px;
  border-radius: 18px;
  background: rgba(255, 250, 240, 0.86);
  border: 2.5px solid #9a6d42;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.65rem;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.2), box-shadow 0.2s ease;
  box-shadow: 0 8px 18px rgba(45, 25, 10, 0.24);
}

.corkboard-pin-slot:hover {
  transform: translateY(-5px) rotate(1.5deg) scale(1.04);
}

.corkboard-pin-slot.empty {
  background: rgba(65, 40, 18, 0.16);
  border: 2.5px dashed rgba(65, 40, 18, 0.42);
  box-shadow: none;
  color: #462b14;
  font-weight: 800;
  font-size: 0.8rem;
  text-align: center;
}

.pin-art-circle {
  width: 82px;
  height: 82px;
  position: relative;
  transition: transform 0.22s ease;
}

.pin-svg-art {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.2));
}

/* Enamel Pin Finishes */
.pin-finish-glitter .pin-svg-art {
  filter: drop-shadow(0 0 10px rgba(244, 114, 182, 0.65));
}

.pin-finish-gold .pin-svg-art {
  filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.85)) brightness(1.06);
}

.pin-finish-neon .pin-svg-art {
  filter: drop-shadow(0 0 14px rgba(52, 211, 153, 0.95));
  animation: neonPinPulse 1.8s infinite alternate;
}

@keyframes neonPinPulse {
  from {
    filter: drop-shadow(0 0 8px rgba(52, 211, 153, 0.75));
  }
  to {
    filter: drop-shadow(0 0 18px rgba(167, 139, 250, 0.95));
  }
}

/* Capsule Gashapon Dispensers Grid */
.capsules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 1.15rem;
  margin-bottom: 1.75rem;
}

.capsule-machine-card {
  background: #ffffff;
  border: 2px solid var(--border-warm);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease;
}

.capsule-machine-card:hover {
  transform: translateY(-4px);
}

.gashapon-ball {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  position: relative;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.1rem;
  box-shadow:
    0 10px 18px rgba(0, 0, 0, 0.16),
    inset 0 6px 12px rgba(255, 255, 255, 0.75);
  border: 3px solid rgba(44, 34, 30, 0.2);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}

.gashapon-ball:hover {
  transform: rotate(14deg) scale(1.08);
}

.gashapon-ball::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  background: rgba(0, 0, 0, 0.18);
  transform: translateY(-50%);
}

/* Pin Backing Card in Collection Tray */
.pin-tray-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 1.15rem;
  justify-items: center;
}

.pin-backing-card {
  width: 185px;
  height: 235px;
  border-radius: 16px;
  background: #fffdf9;
  border: 3px solid #e2d2be;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  position: relative;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.pin-backing-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 28px -8px rgba(44, 34, 30, 0.22);
}

.pin-backing-card::before {
  content: '';
  width: 28px;
  height: 7px;
  border-radius: 99px;
  background: #e9dcc9;
  border: 1.5px solid #c9b59c;
}

.pin-empty-card {
  width: 185px;
  height: 235px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.42);
  border: 2.5px dashed #bba68e;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--ink-muted);
  cursor: pointer;
}


/* ================= TABLET & MOBILE RESPONSIVE OPTIMIZATIONS ================= */

/* Prevent iOS tap highlight flash & ensure smooth touch scrolling */
button,
.collectible-card,
.card-flip-container,
.booster-pack-visual,
.gashapon-ball,
.pin-backing-card,
.corkboard-pin-slot,
.shelf-mini-card {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Tablet Layout (<= 1024px) */
@media (max-width: 1024px) {
  .app-header {
    padding: 0.65rem 1rem;
  }

  .main-content {
    padding: 1.15rem 1rem;
  }

  .packs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }

  .capsules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }

  .binder-book {
    padding: 1.2rem;
    border-radius: 20px;
  }

  .binder-grid {
    grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
    gap: 1rem;
  }

  .corkboard-slots-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
  }
}

/* Mobile & Small Tablet Layout (<= 720px) */
@media (max-width: 720px) {
  body {
    padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  }

  .app-header {
    padding: 0.55rem 0.75rem;
  }

  .header-inner {
    gap: 0.5rem;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
    border-radius: 10px;
  }

  .brand-title h1 {
    font-size: 1.05rem;
  }

  .collector-rank-pill {
    font-size: 0.68rem;
    padding: 0.1rem 0.45rem;
  }

  .stats-bar {
    width: 100%;
    justify-content: space-between;
    gap: 0.35rem;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .stats-bar::-webkit-scrollbar {
    display: none;
  }

  .currency-pill {
    padding: 0.28rem 0.58rem;
    font-size: 0.78rem;
    flex-shrink: 0;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
    font-size: 0.92rem;
    flex-shrink: 0;
  }

  /* Thumb-Friendly Bottom Navigation Dock on Mobile */
  .nav-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 95;
    background: rgba(251, 247, 240, 0.97);
    backdrop-filter: blur(14px);
    border-radius: 18px 18px 0 0;
    border: none;
    border-top: 2px solid var(--border-warm);
    padding: 0.4rem 0.5rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
    justify-content: space-around;
    box-shadow: 0 -6px 20px rgba(44, 34, 30, 0.12);
    gap: 0.25rem;
  }

  .nav-tab {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    padding: 0.4rem 0.25rem;
    font-size: 0.72rem;
    gap: 0.15rem;
    border-radius: 12px;
    position: relative;
  }

  .nav-tab span:first-child {
    font-size: 1.15rem;
  }

  .tab-badge {
    position: absolute;
    top: 2px;
    right: 8px;
    font-size: 0.6rem;
    padding: 0.05rem 0.35rem;
  }

  .main-content {
    padding: 0.85rem 0.75rem;
  }

  /* Compact Cozy Display Shelf on Mobile */
  .shelf-banner {
    padding: 0.9rem;
    margin-bottom: 1.15rem;
    gap: 0.85rem;
    border-radius: 16px;
  }

  .shelf-info h2 {
    font-size: 0.96rem;
    flex-wrap: wrap;
  }

  .shelf-info p {
    font-size: 0.78rem;
  }

  .shelf-slots {
    width: 100%;
    justify-content: space-between;
    gap: 0.35rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .shelf-mini-card {
    width: 58px;
    height: 78px;
    flex-shrink: 0;
  }

  .shelf-mini-card .mini-art {
    width: 42px;
    height: 38px;
  }

  .shelf-claim-box {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .shelf-claim-box button {
    flex: 1;
    padding: 0.55rem 0.65rem;
    font-size: 0.78rem;
  }

  /* Responsive 2-Column Pack & Capsule Grids */
  .shop-header-row h2 {
    font-size: 1.15rem;
  }

  .pity-meter {
    font-size: 0.76rem;
    padding: 0.3rem 0.65rem;
    width: 100%;
    text-align: center;
  }

  .packs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .pack-card {
    padding: 0.85rem 0.65rem;
    border-radius: 16px;
  }

  .booster-pack-visual {
    width: 122px;
    height: 170px;
    padding: 12px 8px;
    margin: 0.2rem 0 0.75rem;
  }

  .pack-badge-circle {
    width: 52px;
    height: 52px;
    font-size: 1.75rem;
  }

  .pack-visual-title {
    font-size: 0.82rem;
  }

  .pack-meta-title {
    font-size: 0.96rem;
  }

  .pack-meta-sub {
    font-size: 0.7rem;
  }

  .pack-meta-desc {
    font-size: 0.74rem;
    margin-bottom: 0.65rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .pack-progress-row {
    font-size: 0.68rem;
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.6rem;
    flex-direction: column;
    gap: 2px;
  }

  .pack-card .btn-primary {
    padding: 0.5rem 0.55rem;
    font-size: 0.76rem;
  }

  /* Horizontal Pill Scroller for Binder & Pin Series */
  .binder-controls {
    padding: 0.75rem;
    gap: 0.65rem;
    margin-bottom: 1rem;
  }

  .set-selector-pills {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .set-selector-pills::-webkit-scrollbar {
    display: none;
  }

  .set-pill-btn {
    flex-shrink: 0;
    font-size: 0.76rem;
    padding: 0.38rem 0.75rem;
  }

  .binder-filter-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
  }

  .binder-select {
    width: 100%;
    font-size: 0.76rem;
    padding: 0.38rem 0.5rem;
  }

  /* 2-Column Card Binder Grid on Mobile Phones */
  .binder-book {
    padding: 0.85rem 0.65rem;
    border-radius: 18px;
    border-width: 3px;
  }

  .binder-page-header h2 {
    font-size: 1.05rem !important;
  }

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

  .collectible-card,
  .card-flip-container,
  .binder-empty-slot {
    width: 100%;
    max-width: 176px;
    height: 254px;
  }

  .collectible-card {
    padding: 7px;
    border-width: 4.5px;
  }

  .card-art-frame {
    height: 110px;
  }

  .card-name {
    font-size: 0.74rem;
  }

  .card-cozy-badge {
    font-size: 0.62rem;
    padding: 0.05rem 0.3rem;
  }

  .card-vibe-line {
    font-size: 0.62rem;
    padding: 0.14rem 0.35rem;
  }

  .card-flavor-text {
    font-size: 0.62rem;
    line-height: 1.25;
  }

  .card-bottom-bar {
    font-size: 0.62rem;
  }

  /* Enamel Pin Corkboard & Tray on Mobile */
  .corkboard-showcase {
    padding: 0.9rem;
    border-width: 6px;
    border-radius: 18px;
  }

  .corkboard-header {
    padding: 0.7rem 0.85rem;
  }

  .corkboard-slots-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
  }

  .corkboard-pin-slot {
    width: 100%;
    max-width: 120px;
    height: 136px;
    padding: 0.45rem;
    border-radius: 14px;
  }

  .corkboard-pin-slot .pin-art-circle {
    width: 62px !important;
    height: 62px !important;
  }

  .capsules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  .capsule-machine-card {
    padding: 0.85rem 0.6rem;
  }

  .gashapon-ball {
    width: 68px;
    height: 68px;
    font-size: 1.7rem;
  }

  .pin-tray-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  .pin-backing-card,
  .pin-empty-card {
    width: 100%;
    max-width: 170px;
    height: 215px;
    padding: 0.6rem;
  }

  /* Pack Opening Overlay on Mobile */
  .pack-stage-overlay {
    justify-content: flex-start;
    padding: 1rem 0.65rem 2.5rem;
  }

  .stage-header h2 {
    font-size: 1.25rem;
  }

  .stage-header p {
    font-size: 0.82rem;
  }

  .stage-pack-tear-box .booster-pack-visual {
    width: 175px;
    height: 245px;
  }

  .pulled-cards-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    width: 100%;
    justify-items: center;
  }

  .pulled-cards-row .card-flip-container:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .stage-controls {
    position: sticky;
    bottom: 0.5rem;
    z-index: 10;
    background: rgba(24, 18, 16, 0.92);
    padding: 0.6rem 0.85rem;
    border-radius: 16px;
    width: 100%;
  }

  /* Card & Pin Detail Modal on Mobile */
  .modal-backdrop {
    padding: 0.65rem;
    align-items: flex-end;
  }

  .modal-card-dialog {
    max-height: 88dvh;
    overflow-y: auto;
    padding: 1.15rem 1rem;
    border-radius: 20px 20px 14px 14px;
    gap: 1rem;
  }

  .modal-card-dialog .collectible-card {
    width: 185px;
    height: 262px;
  }

  /* Trading Post on Mobile */
  .panel-box {
    padding: 1rem 0.85rem;
  }

  .trade-exchange-row {
    padding: 0.65rem;
    gap: 0.5rem;
  }

  .trade-exchange-row button {
    width: 100%;
  }

  .toast-container {
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    right: 12px;
  }

  .toast {
    text-align: center;
    font-size: 0.82rem;
  }
}

/* Extra-Compact Phones (<= 380px) */
@media (max-width: 380px) {
  .packs-grid,
  .capsules-grid {
    grid-template-columns: 1fr;
  }
}
