/* Packs screen extras: welcome, stats, tip, "Your Packs" shelf, rarity panel,
   showcase, floating background cards. */

.packs-top, .packs-extra { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 1.2rem; }
.view-packs { gap: 1.4rem; }

/* ---------- Welcome ---------- */
.hero { text-align: center; }
.hero-title { margin: 0; font: 400 clamp(1.8rem, 5vw, 2.8rem) var(--font-display); text-shadow: 0 4px 0 rgba(0, 0, 0, 0.25); }
.hero-sub { margin: 0.3rem 0 0; font-weight: 800; color: var(--muted); }

.stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.7rem; }
.stat {
  display: flex; flex-direction: column; align-items: center;
  min-width: 128px; padding: 0.65rem 1rem;
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
  transition: transform 0.15s, border-color 0.15s;
}
.stat:hover { transform: translateY(-3px); border-color: rgba(255, 181, 52, 0.55); }
.stat b { font: 400 1.9rem/1.1 var(--font-display); }
.stat b i { font-style: normal; }
.stat span { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* ---------- Tip ---------- */
.tip {
  margin: 0.6rem 0 0; padding: 0.45rem 1.1rem; max-width: 40rem; text-align: center;
  font-size: 0.88rem; font-weight: 800; color: var(--muted);
  border-radius: 999px; background: rgba(0, 0, 0, 0.22);
  transition: opacity 0.35s;
}
.tip.fade { opacity: 0; }

/* ---------- Section headings ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; }
.section-head h2 { margin: 0; font: 400 1.4rem var(--font-display); }
.section-sub { font-weight: 800; font-size: 0.85rem; color: var(--muted); }

.panel { padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }

/* ---------- Your Packs shelf ---------- */
.shelf { width: 100%; padding: 1.1rem 1.2rem 1.3rem; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.shelf-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.2rem; }

.shelf-pack {
  display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
  width: 150px; padding: 0.9rem 0.6rem 0.8rem;
  border: 1px solid var(--line); border-radius: 14px; background: rgba(0, 0, 0, 0.2);
  color: var(--ink); font-family: var(--font-body); cursor: pointer;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.shelf-pack:hover { transform: translateY(-6px); border-color: var(--glow, var(--accent)); box-shadow: 0 10px 26px color-mix(in srgb, var(--glow, #ffb534) 45%, transparent); }
.sp-art {
  position: relative; display: grid; place-items: center; width: 84px; height: 118px; margin-bottom: 0.4rem;
  border-radius: 6px; background: var(--foil);
  clip-path: polygon(0 5px, 8% 0, 16% 5px, 24% 0, 32% 5px, 40% 0, 48% 5px, 56% 0, 64% 5px, 72% 0, 80% 5px, 88% 0, 100% 5px, 100% calc(100% - 5px), 92% 100%, 84% calc(100% - 5px), 76% 100%, 68% calc(100% - 5px), 60% 100%, 52% calc(100% - 5px), 44% 100%, 36% calc(100% - 5px), 28% 100%, 20% calc(100% - 5px), 12% 100%, 4% calc(100% - 5px), 0 100%);
  animation: sp-bob 3s ease-in-out infinite;
}
.shelf-pack:nth-child(2n) .sp-art { animation-delay: -1s; }
.shelf-pack:nth-child(3n) .sp-art { animation-delay: -2s; }
@keyframes sp-bob { 50% { transform: translateY(-5px) rotate(-2deg); } }
.sp-logo { font: 400 1.9rem var(--font-display); color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.3); }
.sp-count {
  position: absolute; right: 4px; bottom: 8px; padding: 0.05rem 0.4rem;
  font: 400 0.85rem var(--font-display); color: #fff; border-radius: 999px; background: rgba(0, 0, 0, 0.55);
}
.sp-name { font: 400 1.1rem var(--font-display); }
.sp-sub { font-size: 0.72rem; font-weight: 800; color: var(--muted); text-align: center; min-height: 2.1em; }
.sp-open {
  margin-top: 0.3rem; padding: 0.25rem 1rem; font-weight: 800; font-size: 0.82rem; border-radius: 999px;
  color: var(--accent-ink); background: var(--accent); box-shadow: 0 3px 0 #b9770a;
}

.shelf-empty {
  display: flex; align-items: center; gap: 1rem; width: 100%; max-width: 30rem; padding: 1rem 1.2rem;
  border: 2px dashed var(--line); border-radius: 14px; color: var(--muted);
}
.shelf-empty b { color: var(--ink); }
.shelf-empty p { margin: 0.15rem 0 0; font-size: 0.88rem; font-weight: 700; }
.shelf-empty-icon {
  flex: none; display: grid; place-items: center; width: 40px; height: 56px;
  font: 400 1.6rem var(--font-display); color: rgba(255, 255, 255, 0.3);
  border: 2px dashed var(--line); border-radius: 6px;
}

/* ---------- Rarity + showcase row ---------- */
.extra-row { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 1.2rem; align-items: stretch; }
@media (max-width: 760px) { .extra-row { grid-template-columns: 1fr; } }
.rarity-bars { display: grid; gap: 0.8rem; }
.rarity-row { display: grid; grid-template-columns: 5.5rem 1fr 3rem; align-items: center; gap: 0.8rem; }
.rarity-name { font: 400 1rem var(--font-display); }
.rarity-num { font-weight: 800; font-size: 0.85rem; color: var(--muted); text-align: right; }
.rarity-row .progress-fill { transition: width 0.8s cubic-bezier(.2,.8,.2,1); }

.showcase-panel { display: flex; flex-direction: column; align-items: center; }
.showcase { display: grid; place-items: center; flex: 1; }
.empty.small { padding: 1rem 0; max-width: 14rem; text-align: center; font-size: 0.88rem; }

/* ---------- Floating cards in the background ---------- */
.bg-cards { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg-card {
  position: absolute; bottom: -200px; width: 90px; height: 140px;
  border: 3px solid var(--c); border-radius: 12px; opacity: 0;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%);
  transform: rotate(var(--rot)) scale(var(--s));
  animation: bg-rise 32s linear infinite;
}
@keyframes bg-rise {
  0%   { transform: translateY(0) rotate(var(--rot)) scale(var(--s)); opacity: 0; }
  10%  { opacity: 0.16; }
  90%  { opacity: 0.16; }
  100% { transform: translateY(-120vh) rotate(calc(var(--rot) * -1)) scale(var(--s)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .bg-cards { display: none; } .sp-art { animation: none; } }
