@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Cinzel:wght@600;700;800&display=swap');

:root {
  --bg-deep: #06060f;
  --bg-primary: #0a0a1a;
  --bg-secondary: #111128;
  --bg-card: rgba(255,255,255,0.04);
  --bg-glass: rgba(255,255,255,0.06);
  --border-glass: rgba(255,255,255,0.08);
  --text-primary: #e8e8f0;
  --text-secondary: #7878a0;
  --text-muted: #4a4a6a;
  --accent: #6c5ce7;
  --accent-light: #a78bfa;
  --accent-rgb: 108,92,231;
  --accent-glow: rgba(var(--accent-rgb),0.3);
  --common: #4ade80;
  --rare: #60a5fa;
  --epic: #a78bfa;
  --legendary: #fbbf24;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --card-width: min(85vw, calc((85vh - 120px) * 0.75 + 16px));
  --anim-speed-pack: 1;
  --anim-speed-flip: 1;
}

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

html { font-size: 16px; }
body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== SCREENS ===== */
.screen { display: none; min-height: 100vh; padding: 20px; padding-bottom: 90px; }
.screen.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== NAVIGATION ===== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  display: flex; height: 70px;
  background: rgba(10,10,26,0.92);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-glass);
}
.bottom-nav button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: none; border: none; color: var(--text-muted); font-family: inherit;
  font-size: 0.7rem; font-weight: 500; cursor: pointer; transition: color 0.3s;
}
.bottom-nav button .nav-icon { font-size: 1.4rem; }
.bottom-nav button.active { color: var(--accent); }
.bottom-nav button:hover { color: var(--text-primary); }

/* ===== SHOP SCREEN ===== */
.shop-header { text-align: center; padding: 30px 0 20px; }
.shop-title {
  font-family: 'Cinzel', serif; font-size: 2rem; font-weight: 800;
  background: linear-gradient(135deg, var(--accent-light), var(--accent), var(--accent-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.shop-subtitle { color: var(--text-secondary); font-size: 0.9rem; margin-top: 6px; }

.stats-bar {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  margin: 20px 0 30px; padding: 0 10px;
}
.stat-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-glass); border: 1px solid var(--border-glass);
  padding: 8px 14px; border-radius: 50px;
  font-size: 0.8rem; color: var(--text-secondary);
}
.stat-chip .stat-value { color: var(--text-primary); font-weight: 600; }

.pack-showcase {
  display: flex; flex-direction: column; align-items: center;
  gap: 30px; padding: 20px;
}

.pack-display {
  position: relative; cursor: pointer;
  width: 200px; height: 280px;
  transition: transform 0.3s ease;
}
.pack-display:hover { transform: scale(1.03); }
.pack-display:active { transform: scale(0.98); }

.pack-visual {
  width: 100%; height: 100%;
  background: linear-gradient(145deg, #1a1a3e, #252560, #1a1a3e);
  border-radius: var(--radius-lg);
  border: 2px solid rgba(var(--accent-rgb),0.4);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  box-shadow: 0 10px 40px rgba(var(--accent-rgb),0.2), inset 0 1px 0 rgba(255,255,255,0.1);
  animation: packFloat 3s ease-in-out infinite;
}
.pack-visual::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 30%, rgba(var(--accent-rgb),0.15) 50%, transparent 70%);
  animation: packSheen 3s ease-in-out infinite;
}
.pack-visual .pack-icon { font-size: 3.5rem; z-index: 1; }
.pack-visual .pack-label {
  font-family: 'Cinzel', serif; font-weight: 700; font-size: 0.9rem;
  color: rgba(255,255,255,0.8); z-index: 1; margin-top: 8px; letter-spacing: 2px;
}

.open-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff; border: none; padding: 14px 40px;
  border-radius: 50px; font-family: inherit; font-size: 1rem; font-weight: 600;
  cursor: pointer; letter-spacing: 1px;
  box-shadow: 0 4px 20px rgba(var(--accent-rgb),0.4);
  transition: all 0.3s ease;
}
.open-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 30px rgba(var(--accent-rgb),0.5); }
.open-btn:active { transform: translateY(0); }
.open-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.no-cards-msg {
  text-align: center; color: var(--text-muted); font-size: 0.9rem;
  margin-top: 20px; padding: 20px;
  background: var(--bg-glass); border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

/* ===== PACK OPENING OVERLAY ===== */
.pack-opening-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg-deep);
  display: none; align-items: center; justify-content: center;
  flex-direction: column;
}
.pack-opening-overlay.active { display: flex; }

.pack-opening-container {
  position: relative; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}

.pack-wrapper {
  width: 200px; height: 280px;  transform-style: preserve-3d;
}
.pack-wrapper .pack-visual { animation: packFloat 2s ease-in-out infinite; }
.pack-wrapper.shaking {
  animation: packShake calc(1.2s / var(--anim-speed-pack)) ease-in-out;
}
.pack-wrapper.opening {
  animation: packOpen calc(0.8s / var(--anim-speed-pack)) ease-in forwards;
}
.pack-wrapper.hidden { visibility: hidden; pointer-events: none; }

.light-burst {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--burst-color);
  box-shadow: 0 0 60px 30px var(--burst-color), 0 0 100px 60px var(--burst-color);
  opacity: 0; pointer-events: none; transition: none;
}
.light-burst.active {
  animation: lightBurst calc(1.2s / var(--anim-speed-pack)) ease-out forwards;
}

/* ===== CARD REVEAL AREA ===== */
.card-reveal-area {
  position: fixed; inset: 0; z-index: 210;
  background: var(--bg-deep);
  display: none; flex-direction: column; align-items: center; justify-content: center;
}
.card-reveal-area.active { display: flex; }

.card-counter {
  position: absolute; top: 24px; right: 24px;
  font-size: 0.85rem; color: var(--text-muted); font-weight: 500;
}
.reveal-fs-btn {
  position: absolute; bottom: 24px; right: 24px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border-glass);
  color: var(--text-muted); border-radius: 50%;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; cursor: pointer; z-index: 220; backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}
.reveal-fs-btn:hover {
  background: rgba(255,255,255,0.15); color: var(--text-primary);
  transform: scale(1.05);
}
.reveal-skip-btn {
  position: absolute; bottom: 24px; left: 24px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border-glass);
  color: var(--text-muted); border-radius: 50px;
  padding: 10px 18px; font-family: inherit; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; z-index: 220; backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}
.reveal-skip-btn:hover {
  background: rgba(255,255,255,0.15); color: var(--text-primary);
  transform: translateY(-2px);
}

.card-stage {
  perspective: 1200px;
  width: var(--card-width);
  position: relative;
}

.reveal-card {
  width: 100%; position: relative; cursor: pointer;
  --rarity-color: #888;
}
.reveal-card.entering { animation: cardEnter calc(0.5s / var(--anim-speed-pack)) ease-out; }
.reveal-card.sliding-out { animation: cardSlideOut calc(0.4s / var(--anim-speed-pack)) ease-in forwards; }

.card-inner {
  width: 100%; position: relative;
  transform-style: preserve-3d;
  transition: transform calc(0.7s / var(--anim-speed-flip)) cubic-bezier(0.4, 0, 0.2, 1);
}
.card-inner.flipped { transform: rotateY(180deg); }

.card-front, .card-back {
  backface-visibility: hidden;
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* Card Back */
.card-back {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(145deg, #14142e, #1e1e4a, #14142e);
  border: 2.5px solid rgba(var(--accent-rgb),0.5);
  display: flex; align-items: center; justify-content: center;
}
.card-back-pattern {
  width: 100%; height: 100%;
  background:
    repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(var(--accent-rgb),0.06) 10px, rgba(var(--accent-rgb),0.06) 20px),
    repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(var(--accent-rgb),0.04) 10px, rgba(var(--accent-rgb),0.04) 20px);
  display: flex; align-items: center; justify-content: center;
}
.card-back-logo {
  font-size: 3rem; color: rgba(var(--accent-rgb),0.3);
  text-shadow: 0 0 20px rgba(var(--accent-rgb),0.3);
}

/* Card Front */
.card-front {
  position: relative; z-index: 2; width: 100%;
  transform: rotateY(180deg);
  background: linear-gradient(180deg, #12122a 0%, #0d0d20 100%);
  border: 2.5px solid var(--rarity-color);
  display: flex; flex-direction: column;
}

.card-image-area {
  overflow: hidden; position: relative;
  background: transparent; flex-shrink: 0;
  margin: 8px 8px 0 8px; border-radius: 8px 8px 0 0;
  aspect-ratio: 3/4; width: calc(100% - 16px);
}
.card-image-area img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.card-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(var(--accent-rgb),0.1), rgba(96,165,250,0.1));
}
.card-placeholder span { font-size: 3rem; opacity: 0.3; }

.card-info {
  height: 120px; flex-shrink: 0; /* Strict fixed height for all cards */
  padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px;
  justify-content: flex-start;
}
.card-name {
  font-family: 'Cinzel', serif; font-weight: 700; font-size: 0.85rem;
  color: var(--text-primary); line-height: 1.2;
}
.card-desc {
  font-size: 0.65rem; color: var(--text-secondary); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta {
  display: flex; align-items: center; justify-content: space-between; margin-top: 2px;
}
.card-category { font-size: 0.65rem; font-weight: 500; }
.card-rarity-badge {
  font-size: 0.55rem; font-weight: 700; padding: 2px 8px;
  border-radius: 50px; color: #000; text-transform: uppercase; letter-spacing: 0.5px;
}

.card-border-glow {
  position: absolute; inset: -2px; border-radius: var(--radius-md);
  pointer-events: none; opacity: 0;
  box-shadow: 0 0 15px var(--rarity-color), 0 0 30px var(--rarity-color);
  transition: opacity 0.5s;
}
.reveal-card.revealed .card-border-glow { opacity: 0.6; }
.reveal-card.legendary-glow .card-border-glow {
  opacity: 1;
  animation: glowPulse 1.5s ease-in-out infinite;
}

/* Holographic overlay for legendary (Interactive 3D Tilt + Foil) */
.holo-overlay, .detail-holo {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: 
    radial-gradient(
      circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
      rgba(255, 255, 255, 0.45) 0%,
      rgba(255, 255, 255, 0.15) 25%,
      transparent 60%
    ),
    linear-gradient(
      var(--angle, 125deg),
      rgba(255,0,128,0.2) 0%,
      rgba(255,154,0,0.2) 15%,
      rgba(208,222,33,0.2) 30%,
      rgba(79,220,74,0.2) 45%,
      rgba(63,218,216,0.2) 60%,
      rgba(47,107,236,0.2) 75%,
      rgba(166,53,223,0.2) 90%,
      rgba(255,0,128,0.2) 100%
    );
  background-size: 200% 200%;
  mix-blend-mode: color-dodge;
  border-radius: inherit;
  transition: opacity 0.4s ease;
  z-index: 4;
}
.reveal-card.revealed .holo-overlay,
.album-card.legendary-card.collected .holo-overlay,
.card-detail-card.legendary-detail .detail-holo {
  opacity: 0.65;
  animation: holoShimmer 4s ease infinite;
}
.tilt-active .holo-overlay,
.tilt-active .detail-holo {
  opacity: 0.95;
  animation: none;
}

/* Badge */
.card-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%) scale(0);
  padding: 6px 16px; border-radius: 50px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 1px;
  white-space: nowrap; z-index: 5;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.card-badge.visible { transform: translateX(-50%) scale(1); }
.badge-new { background: linear-gradient(135deg, #4ade80, #22c55e); color: #000; }
.badge-duplicate { background: rgba(255,255,255,0.15); color: var(--text-secondary); }

.reveal-hint {
  position: relative; margin-top: 24px;
  font-size: 0.85rem; color: var(--text-secondary);
  font-weight: 500; opacity: 0; transition: opacity 0.3s;
  letter-spacing: 0.5px;
}
.reveal-hint.visible { opacity: 1; }

.particle-canvas {
  position: absolute; inset: 0; pointer-events: none; z-index: 3;
}

/* ===== PACK SUMMARY ===== */
.pack-summary-overlay {
  position: fixed; inset: 0; z-index: 220;
  background: rgba(6,6,15,0.95); backdrop-filter: blur(10px);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.pack-summary-overlay.active { display: flex; }

.summary-panel {
  background: var(--bg-secondary); border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl); padding: 30px; max-width: 500px; width: 100%;
  text-align: center;
}
.summary-title {
  font-family: 'Cinzel', serif; font-size: 1.3rem; margin-bottom: 20px;
  color: var(--text-primary);
}
.summary-cards {
  display: flex; flex-direction: column; align-items: center; margin-bottom: 20px;
  max-height: 60vh; overflow-y: auto; padding: 4px;
}
.summary-new-header {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fbbf24;
  text-shadow: 0 0 15px rgba(251, 191, 36, 0.5);
  margin-bottom: 12px;
  animation: pulseGlow 2s infinite ease-in-out;
}
.summary-new-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-bottom: 18px;
}
.summary-card-featured {
  width: 110px;
  border-radius: var(--radius-md);
  border: 2.5px solid var(--rarity-color, #888);
  background: var(--bg-primary);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 15px var(--rarity-color, #888);
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: cardEnter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
.summary-card-featured:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 12px 30px rgba(0,0,0,0.7), 0 0 25px var(--rarity-color, #888);
}
.summary-featured-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: linear-gradient(135deg, #4ade80, #16a34a);
  color: #000;
  font-size: 0.55rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 50px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  z-index: 2;
}
.summary-card-img-wrap {
  width: 100%;
  height: 95px;
  background: #070714;
  display: flex;
  align-items: center;
  justify-content: center;
}
.summary-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.summary-featured-info {
  padding: 6px 4px;
  text-align: center;
  background: var(--bg-secondary);
}
.summary-featured-name {
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.summary-featured-rarity {
  font-size: 0.55rem;
  font-weight: 700;
  color: #000;
  padding: 1px 6px;
  border-radius: 50px;
  display: inline-block;
}
.summary-dup-header {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.summary-dup-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
}
.summary-card-mini {
  width: 65px; height: 90px; border-radius: 8px; overflow: hidden;
  border: 2px solid var(--rarity-color, #888);
  background: var(--bg-primary); position: relative;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.summary-card-mini:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.summary-card-mini img { width: 100%; height: 100%; object-fit: contain; }
.summary-card-mini .mini-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem; color: var(--text-muted); text-align: center; padding: 4px;
}
.summary-card-mini .new-dot {
  position: absolute; top: 3px; right: 3px;
  width: 8px; height: 8px; border-radius: 50%; background: #4ade80;
}

.summary-stats { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 20px; }

.summary-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff; border: none; padding: 12px 30px;
  border-radius: 50px; font-family: inherit; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: all 0.3s;
}
.summary-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(var(--accent-rgb),0.4); }

/* ===== ALBUM SCREEN ===== */
.album-header { text-align: center; padding: 24px 0 8px; }
.album-title {
  font-family: 'Cinzel', serif; font-size: 1.8rem; font-weight: 800;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.album-progress { margin: 10px auto 0; max-width: 280px; text-align: center; }
.progress-text { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 6px; }
.progress-bar { height: 6px; background: var(--bg-glass); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; background: linear-gradient(90deg, var(--accent), var(--accent-light), #fbbf24); }

/* --- Album Book --- */
.album-book {
  position: relative; max-width: 700px; margin: 16px auto 0;
  min-height: 560px; perspective: 1800px;
}
.book-spine {
  position: absolute; left: 0; top: 10px; bottom: 10px; width: 6px; z-index: 5;
  background: linear-gradient(180deg, var(--bg-deep), var(--accent), var(--bg-deep));
  border-radius: 3px 0 0 3px;
  box-shadow: 2px 0 8px rgba(0,0,0,0.5);
}

.book-pages {
  position: relative; margin-left: 6px;
  min-height: 560px; overflow: hidden;
}

.album-page {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, #1a1829 0%, #151422 40%, #12111f 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-left: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 20px 18px 18px;
  box-shadow: inset 2px 0 12px rgba(0,0,0,0.3), 4px 4px 20px rgba(0,0,0,0.4);
  opacity: 0; pointer-events: none;
  transform-origin: left center;
  will-change: transform, opacity;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin; scrollbar-color: var(--accent) transparent;
}
.album-page::-webkit-scrollbar { width: 4px; }
.album-page::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

.album-page::before {
  content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 30px;
  background: linear-gradient(90deg, rgba(0,0,0,0.15), transparent);
  pointer-events: none; z-index: 2;
}
.album-page.active { opacity: 1; pointer-events: auto; z-index: 2; }

/* Page flip animations */
.album-page.flip-out-fwd {
  animation: pageFlipOutFwd 0.55s cubic-bezier(0.4, 0, 0.6, 1) forwards; z-index: 3;
}
.album-page.flip-in-fwd {
  animation: pageFlipInFwd 0.55s cubic-bezier(0.4, 0, 0.6, 1) forwards; z-index: 2;
}
.album-page.flip-out-back {
  animation: pageFlipOutBack 0.55s cubic-bezier(0.4, 0, 0.6, 1) forwards; z-index: 3;
}
.album-page.flip-in-back {
  animation: pageFlipInBack 0.55s cubic-bezier(0.4, 0, 0.6, 1) forwards; z-index: 2;
}

@keyframes pageFlipOutFwd {
  0%   { transform: rotateY(0deg); opacity: 1; }
  100% { transform: rotateY(-105deg); opacity: 0; }
}
@keyframes pageFlipInFwd {
  0%   { transform: rotateY(90deg); opacity: 0; }
  100% { transform: rotateY(0deg); opacity: 1; }
}
@keyframes pageFlipOutBack {
  0%   { transform: rotateY(0deg); opacity: 1; }
  100% { transform: rotateY(90deg); opacity: 0; }
}
@keyframes pageFlipInBack {
  0%   { transform: rotateY(-105deg); opacity: 0; }
  100% { transform: rotateY(0deg); opacity: 1; }
}

/* Page header */
.page-category-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 2px solid var(--cat-color, var(--accent));
}
.page-cat-dot {
  width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 10px var(--cat-color, var(--accent));
}
.page-cat-name {
  font-family: 'Cinzel', serif; font-size: 1.1rem; font-weight: 700;
  color: var(--text-primary);
}
.page-cat-count {
  margin-left: auto; font-size: 0.75rem; color: var(--text-secondary);
  background: var(--bg-glass); padding: 3px 10px; border-radius: 50px;
}

/* Cards grid inside page */
.page-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

/* Album card (inside book page) */
.album-card {
  border-radius: 10px; overflow: hidden;
  position: relative; cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  background: var(--bg-secondary);
}
.album-card:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(0,0,0,0.4); }
.album-card:active { transform: scale(0.97); }
.album-card.collected {
  border: 2px solid var(--rarity-color, #888);
}
.album-card.legendary-card.collected {
  border: 2px solid #fbbf24;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.35);
  transform-style: preserve-3d;
  touch-action: manipulation;
}
.album-card.legendary-card.collected:hover {
  box-shadow: 0 0 22px rgba(251, 191, 36, 0.6);
}
.album-card.not-collected {
  border: 2px solid rgba(255,255,255,0.05);
  background: var(--bg-primary); filter: brightness(0.35) saturate(0.3);
}
.album-card .album-card-img { width: 100%; aspect-ratio: 3/4; height: auto; object-fit: cover; display: block; }
.album-card .album-card-placeholder {
  width: 100%; height: 68%; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.02); font-size: 1.5rem; opacity: 0.15;
}
.album-card .album-card-info { padding: 5px 7px; }
.album-card .album-card-name {
  font-size: 0.62rem; font-weight: 600; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.album-card .album-card-rarity {
  font-size: 0.48rem; font-weight: 700; margin-top: 2px;
  display: inline-block; padding: 1px 6px; border-radius: 50px;
}
.album-card.not-collected .album-card-name { color: var(--text-muted); }
.album-card .count-badge {
  position: absolute; top: 4px; right: 4px;
  font-size: 0.55rem; font-weight: 700;
  background: rgba(0,0,0,0.75); color: var(--text-primary);
  padding: 2px 6px; border-radius: 50px; backdrop-filter: blur(4px);
}

/* Book navigation arrows */
.book-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 10;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(var(--accent-rgb),0.2); border: 1px solid rgba(var(--accent-rgb),0.3);
  color: var(--text-primary); cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: all 0.25s ease; backdrop-filter: blur(8px);
}
.book-nav:hover { background: rgba(var(--accent-rgb),0.4); transform: translateY(-50%) scale(1.1); }
.book-nav:active { transform: translateY(-50%) scale(0.95); }
.book-nav:disabled { opacity: 0.2; cursor: not-allowed; pointer-events: none; }
.book-nav-prev { left: -20px; }
.book-nav-next { right: -12px; }

/* Page indicator */
.book-indicator {
  text-align: center; margin-top: 14px; padding-bottom: 20px;
}
.book-indicator-dots {
  display: flex; gap: 6px; justify-content: center; margin-bottom: 6px;
}
.book-indicator-dots .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--bg-glass); border: 1px solid var(--border-glass);
  cursor: pointer; transition: all 0.3s;
}
.book-indicator-dots .dot.active {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
.book-indicator-dots .dot:hover:not(.active) { background: rgba(255,255,255,0.15); }
.book-indicator-label {
  font-size: 0.75rem; color: var(--text-muted); margin-top: 4px;
}

/* ===== CARD DETAIL MODAL ===== */
.card-detail-modal {
  position: fixed; inset: 0; z-index: 300;
  display: none; align-items: center; justify-content: center;
}
.card-detail-modal.active { display: flex; }
.card-detail-backdrop {
  position: absolute; inset: 0;
  background: rgba(6,6,15,0.88); backdrop-filter: blur(12px);
  animation: fadeIn 0.25s ease;
}
.card-detail-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  width: min(90vw, calc((92vh - 130px) * 0.75 + 16px));
  animation: modalCardEnter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalCardEnter {
  0% { transform: scale(0.7) translateY(40px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.card-detail-close {
  position: absolute; top: -40px; right: -8px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-primary); font-size: 0.9rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; z-index: 5;
}
.card-detail-close:hover { background: rgba(239,68,68,0.3); border-color: rgba(239,68,68,0.5); }

.card-detail-card {
  width: 100%;
  border-radius: var(--radius-lg); overflow: hidden;
  border: 3px solid var(--rarity-color, #888);
  background: linear-gradient(180deg, #12122a, #0d0d20);
  box-shadow: 0 0 30px rgba(0,0,0,0.6), 0 0 15px var(--rarity-color, transparent);
  display: flex; flex-direction: column;
}
.card-detail-card .detail-img-area {
  overflow: hidden; position: relative;
  background: transparent;
  margin: 8px 8px 0 8px; border-radius: 8px 8px 0 0;
  aspect-ratio: 3/4; width: calc(100% - 16px);
}
.card-detail-card .detail-img-area img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.card-detail-card .detail-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(var(--accent-rgb),0.1), rgba(96,165,250,0.1));
}
.card-detail-card .detail-placeholder span { font-size: 4rem; opacity: 0.3; }
.card-detail-card .detail-card-info { padding: 12px 14px 14px; }
.card-detail-card .detail-card-name {
  font-family: 'Cinzel', serif; font-weight: 700; font-size: 1rem;
  color: var(--text-primary); line-height: 1.2; margin-bottom: 4px;
}
.card-detail-card .detail-card-desc {
  font-size: 0.75rem; color: var(--text-secondary); line-height: 1.4; margin-bottom: 8px;
}
.card-detail-card .detail-card-meta {
  display: flex; align-items: center; justify-content: space-between;
}
.card-detail-card .detail-cat { font-size: 0.7rem; font-weight: 500; }
.card-detail-card .detail-rarity-badge {
  font-size: 0.6rem; font-weight: 700; padding: 3px 10px;
  border-radius: 50px; color: #000; text-transform: uppercase; letter-spacing: 0.5px;
}

/* Detail info below card */
.card-detail-info {
  text-align: center; width: 100%;
}
.card-detail-info .detail-collection-status {
  font-size: 0.8rem; padding: 6px 16px; border-radius: 50px;
  display: inline-block;
}
.card-detail-info .detail-owned {
  background: rgba(74,222,128,0.15); color: #4ade80;
}
.card-detail-info .detail-not-owned {
  background: rgba(255,255,255,0.06); color: var(--text-muted);
}

/* Legendary holo in detail */
.card-detail-card.legendary-detail {
  transform-style: preserve-3d;
  box-shadow: 0 0 25px rgba(251, 191, 36, 0.45);
  animation: glowPulse 2s ease-in-out infinite;
  touch-action: manipulation;
}
.card-detail-card.legendary-detail.tilt-active {
  animation: none;
  box-shadow: 0 10px 40px rgba(251, 191, 36, 0.7), 0 0 60px rgba(251, 191, 36, 0.4);
}

/* ===== KEYFRAMES ===== */
@keyframes packFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(0.5deg); }
}
@keyframes packSheen {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}
@keyframes packShake {
  0%, 100% { transform: translateX(0) rotate(0); }
  10% { transform: translateX(-5px) rotate(-1deg); }
  20% { transform: translateX(5px) rotate(1deg); }
  30% { transform: translateX(-8px) rotate(-2deg); }
  40% { transform: translateX(8px) rotate(2deg); }
  50% { transform: translateX(-12px) rotate(-2.5deg); }
  60% { transform: translateX(12px) rotate(2.5deg); }
  70% { transform: translateX(-16px) rotate(-3deg); }
  80% { transform: translateX(16px) rotate(3deg); }
  90% { transform: translateX(-18px) rotate(-3.5deg); }
}
@keyframes packOpen {
  0% { transform: scale(1); opacity: 1; filter: brightness(1); }
  40% { transform: scale(1.08); filter: brightness(2.5); }
  100% { transform: scale(1.6); opacity: 0; filter: brightness(4) blur(8px); }
}
@keyframes lightBurst {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(8); opacity: 0; }
}
@keyframes cardEnter {
  0% { transform: translateY(80vh) rotate(8deg); opacity: 0; }
  100% { transform: translateY(0) rotate(0deg); opacity: 1; }
}
@keyframes cardSlideOut {
  0% { transform: translateX(0) rotate(0); opacity: 1; }
  100% { transform: translateX(-110vw) rotate(-15deg); opacity: 0; }
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 15px var(--rarity-color), 0 0 30px var(--rarity-color); }
  50% { box-shadow: 0 0 25px var(--rarity-color), 0 0 50px var(--rarity-color), 0 0 70px var(--rarity-color); }
}
@keyframes holoShimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ===== SHARE BUTTON ===== */
.share-card-btn {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 10px; padding: 8px 20px;
  border-radius: 50px; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff; font-family: inherit; font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.3px;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 2px 12px rgba(167,139,250,0.3);
}
.share-card-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(167,139,250,0.5);
}
.share-card-btn:active { transform: scale(0.96); }
.share-card-btn:disabled {
  opacity: 0.6; cursor: wait; transform: none;
  box-shadow: none;
}

/* ===== PLAYER STATS PANEL ===== */
.player-stats-panel {
  max-width: 420px; margin: 24px auto 0; padding: 16px 20px;
  background: var(--bg-glass); border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg); display: none;
}
.player-stats-panel.visible { display: block; }
.player-stats-panel .psp-title {
  font-size: 0.8rem; font-weight: 600; color: var(--text-secondary);
  margin-bottom: 10px; text-align: center; text-transform: uppercase;
  letter-spacing: 1px;
}
.player-stats-panel .psp-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.player-stats-panel .psp-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
}
.player-stats-panel .psp-item .psp-icon { font-size: 1.1rem; }
.player-stats-panel .psp-item .psp-data { display: flex; flex-direction: column; }
.player-stats-panel .psp-item .psp-val {
  font-size: 0.85rem; font-weight: 700; color: var(--text-primary);
}
.player-stats-panel .psp-item .psp-label {
  font-size: 0.6rem; color: var(--text-muted);
}

/* ===== ALBUM SEARCH & RARITY FILTER ===== */
.album-search-bar {
  max-width: 700px; margin: 12px auto 0; padding: 0 6px;
}
.album-search-bar input {
  width: 100%; padding: 10px 16px;
  border-radius: 50px; border: 1px solid var(--border-glass);
  background: var(--bg-glass); color: var(--text-primary);
  font-family: inherit; font-size: 0.85rem; outline: none;
  transition: border-color 0.3s;
}
.album-search-bar input:focus { border-color: var(--accent); }
.album-search-bar input::placeholder { color: var(--text-muted); }

.album-rarity-filter {
  display: flex; justify-content: center; gap: 8px; flex-wrap: wrap;
  max-width: 700px; margin: 10px auto 0; padding: 0 6px;
}
.rarity-filter-btn {
  padding: 6px 14px; border-radius: 50px;
  border: 1px solid var(--border-glass); background: var(--bg-glass);
  color: var(--text-secondary); font-family: inherit; font-size: 0.75rem;
  font-weight: 600; cursor: pointer; transition: all 0.25s ease;
  backdrop-filter: blur(8px);
}
.rarity-filter-btn:hover {
  color: var(--text-primary); border-color: var(--rarity-btn-color, var(--accent));
  transform: translateY(-1px);
}
.rarity-filter-btn.active {
  background: var(--rarity-btn-color, var(--accent));
  color: #000; border-color: var(--rarity-btn-color, var(--accent));
  box-shadow: 0 0 12px var(--rarity-btn-color, var(--accent));
}

/* ===== ALBUM COVER PAGE ===== */
.page-content-wrapper {
  position: relative; z-index: 1;
  height: 100%; display: flex;
  flex-direction: column;
}
.album-cover-page {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; height: 100%;
  padding: 40px 20px;
  position: relative; z-index: 1;
}
.album-cover-page .cover-emblem {
  font-size: 4rem; margin-bottom: 16px;
  filter: drop-shadow(0 0 20px rgba(251,191,36,0.4));
}
.album-cover-page .cover-emblem-img {
  width: 72px; height: 72px; margin-bottom: 16px;
  object-fit: contain; filter: drop-shadow(0 0 10px rgba(0,0,0,0.5));
}
.album-cover-page .cover-title {
  font-family: 'Cinzel', serif; font-size: 1.6rem; font-weight: 800;
  background: linear-gradient(135deg, #fbbf24, #f59e0b, #fbbf24);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 8px;
}
.album-cover-page .cover-subtitle {
  font-size: 0.85rem; color: var(--cover-text-color, var(--text-secondary)); margin-bottom: 24px; opacity: 0.9;
}
.album-cover-page .cover-divider {
  width: 60px; height: 2px; margin: 0 auto 20px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.album-cover-page .cover-stats {
  display: flex; gap: 20px; font-size: 0.8rem; color: var(--cover-text-color, var(--text-muted)); opacity: 0.85;
}
.album-cover-page .cover-stat-val {
  font-size: 1.4rem; font-weight: 700; color: var(--cover-text-color, var(--text-primary)); opacity: 1;
  display: block;
}

/* ===== CONFETTI CANVAS ===== */
.confetti-canvas {
  position: fixed; inset: 0; z-index: 400; pointer-events: none;
  display: none;
}
.confetti-canvas.active { display: block; }

/* ===== ALBUM COMPLETION CELEBRATION ===== */
.completion-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
  transition: background 0.6s ease;
}
.completion-overlay.active {
  display: flex;
  background: rgba(6,6,15,0.92);
  backdrop-filter: blur(12px);
}

.completion-confetti-canvas {
  position: fixed; inset: 0; z-index: 501; pointer-events: none;
}

.completion-panel {
  position: relative;
  z-index: 502;
  background: linear-gradient(145deg, rgba(20,20,50,0.95), rgba(10,10,30,0.98));
  border: 2px solid rgba(251,191,36,0.4);
  border-radius: 24px;
  padding: 40px 30px 30px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow:
    0 0 60px rgba(251,191,36,0.15),
    0 0 120px rgba(251,191,36,0.08),
    0 25px 50px rgba(0,0,0,0.5);
  animation: completionPanelIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  overflow: hidden;
}

.completion-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(251,191,36,0.08) 0%, transparent 60%);
  animation: glowRotate 6s linear infinite;
  pointer-events: none;
}

.completion-trophy {
  font-size: 4.5rem;
  margin-bottom: 8px;
  animation: trophyBounce 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s backwards,
             trophyFloat 3s ease-in-out 1.3s infinite;
  filter: drop-shadow(0 0 20px rgba(251,191,36,0.6));
}

.completion-title {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  font-weight: 900;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b, #fbbf24, #fde68a);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmerText 3s ease infinite;
  text-shadow: none;
}

.completion-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
  opacity: 0;
  animation: fadeSlideUp 0.6s ease 0.6s forwards;
}

.completion-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeSlideUp 0.6s ease 0.8s forwards;
}

.completion-stat-item {
  text-align: center;
}

.completion-stat-value {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fbbf24;
  text-shadow: 0 0 10px rgba(251,191,36,0.4);
}

.completion-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.completion-stars {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}

.completion-star {
  font-size: 2rem;
  opacity: 0;
  transform: scale(0) rotate(-180deg);
  animation: starPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) var(--delay) forwards;
  filter: drop-shadow(0 0 8px rgba(251,191,36,0.5));
}

.completion-btn {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #000;
  border: none;
  padding: 14px 36px;
  border-radius: 50px;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(251,191,36,0.3);
  opacity: 0;
  animation: fadeSlideUp 0.6s ease 1s forwards;
  position: relative;
  overflow: hidden;
}

.completion-btn::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255,255,255,0.3) 50%,
    transparent 70%
  );
  animation: btnShine 3s ease infinite;
}

.completion-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 30px rgba(251,191,36,0.5);
}

@keyframes completionPanelIn {
  from { opacity: 0; transform: scale(0.7) translateY(30px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes trophyBounce {
  from { opacity: 0; transform: scale(0) rotate(-20deg); }
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes trophyFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

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

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

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

@keyframes starPop {
  from { opacity: 0; transform: scale(0) rotate(-180deg); }
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes btnShine {
  0% { transform: translateX(-100%) rotate(45deg); }
  30%, 100% { transform: translateX(100%) rotate(45deg); }
}

/* ===== SOUND TOGGLE ===== */
.sound-toggle-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px; background: none; border: none;
  color: var(--text-muted); font-family: inherit; font-size: 0.7rem;
  font-weight: 500; cursor: pointer; transition: color 0.3s;
}
.sound-toggle-btn .nav-icon { font-size: 1.4rem; }
.sound-toggle-btn:hover { color: var(--text-primary); }
.sound-toggle-btn.muted { opacity: 0.4; }

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .shop-title { font-size: 1.5rem; }
  :root { --card-width: 280px; --card-height: 398px; }
  .page-cards-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .page-cat-name { font-size: 0.9rem; }
  .album-book { margin-left: 10px; margin-right: 10px; min-height: 400px; }
  .book-pages { min-height: 400px; }
  .book-nav-prev { left: -14px; }
  .book-nav-next { right: -8px; }
  .book-nav { width: 34px; height: 34px; }
  .card-detail-content { max-width: 280px; }
  .player-stats-panel .psp-grid { grid-template-columns: 1fr; }
  .album-cover-page .cover-title { font-size: 1.2rem; }
}
@media (min-width: 768px) {
  :root { --card-width: 390px; --card-height: 555px; }
  .card-detail-content { max-width: 340px; }
}

/* ===== DUPLICATE EXCHANGE WIDGET ===== */
.duplicate-exchange-widget {
  margin-top: 24px;
  padding: 18px 24px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  animation: fadeIn 0.4s ease-out;
}

.duplicate-exchange-widget .dup-header {
  margin-bottom: 12px;
}

.duplicate-exchange-widget .dup-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.duplicate-exchange-widget .dup-progress-bar {
  position: relative;
  width: 100%;
  height: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 50px;
  overflow: hidden;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.duplicate-exchange-widget .dup-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  box-shadow: 0 0 10px rgba(167, 139, 250, 0.5);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.duplicate-exchange-widget .dup-progress-text {
  position: relative;
  z-index: 2;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.duplicate-exchange-widget .exchange-btn {
  width: 100%;
  padding: 10px 20px;
  border-radius: 50px;
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
  cursor: not-allowed;
  transition: all 0.3s ease;
}

.duplicate-exchange-widget .exchange-btn.ready {
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(167, 139, 250, 0.3);
}

.duplicate-exchange-widget .exchange-btn.ready:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(167, 139, 250, 0.5);
}

.duplicate-exchange-widget .exchange-btn.ready:active {
  transform: translateY(0);
}

/* ===== SHOP GRID ROW (Stats & Canje side by side) ===== */
.shop-grid-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  max-width: 900px;
  margin: 32px auto 0;
  justify-content: center;
  align-items: stretch;
  padding: 0 16px;
}

.shop-grid-row .player-stats-panel,
.shop-grid-row .duplicate-exchange-widget {
  flex: 1;
  min-width: 280px;
  max-width: 420px;
  margin: 0 !important; /* Override auto margins and layout margins */
}

@media (max-width: 768px) {
  .shop-grid-row {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
  .shop-grid-row .player-stats-panel,
  .shop-grid-row .duplicate-exchange-widget {
    width: 100%;
    max-width: 420px;
  }
}

/* ===== RESET ALBUM BUTTON ===== */
.reset-album-btn {
  position: absolute;
  right: 16px;
  top: 24px;
  padding: 6px 14px;
  border-radius: 50px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
}

.reset-album-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
}

.reset-album-btn:active {
  transform: translateY(0);
}

@media (max-width: 580px) {
  .reset-album-btn {
    position: static;
    display: inline-block;
    margin-top: 12px;
  }
}

/* ===== MAINTENANCE SCREEN ===== */
.maintenance-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.maintenance-bg-grid {
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  background-image:
    linear-gradient(rgba(var(--accent-rgb), 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--accent-rgb), 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: maintenance-grid-drift 20s linear infinite;
}

@keyframes maintenance-grid-drift {
  from { transform: translate(0, 0) rotate(0deg); }
  to { transform: translate(60px, 60px) rotate(1deg); }
}

.maintenance-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 30px;
  max-width: 500px;
  animation: maintenance-fade-in 0.8s ease-out;
}

@keyframes maintenance-fade-in {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.maintenance-icon-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
}

.maintenance-icon {
  font-size: 3.5rem;
  animation: maintenance-icon-float 3s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(var(--accent-rgb), 0.4));
}

@keyframes maintenance-icon-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(10deg); }
}

.maintenance-icon-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(var(--accent-rgb), 0.2);
  animation: maintenance-ring-pulse 2.5s ease-in-out infinite;
}

.maintenance-icon-ring::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(var(--accent-rgb), 0.08);
  animation: maintenance-ring-pulse 2.5s ease-in-out infinite 0.3s;
}

@keyframes maintenance-ring-pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.08); opacity: 1; }
}

.maintenance-title {
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-light), var(--accent), var(--accent-light));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: maintenance-title-shimmer 4s linear infinite;
  margin-bottom: 16px;
  line-height: 1.3;
}

@keyframes maintenance-title-shimmer {
  from { background-position: 0% center; }
  to { background-position: 200% center; }
}

.maintenance-message {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 380px;
  margin-bottom: 28px;
}

.maintenance-divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  border-radius: 2px;
  margin-bottom: 24px;
  opacity: 0.6;
}

.maintenance-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 500;
}

.maintenance-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: maintenance-pulse-dot 1.5s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.5);
}

@keyframes maintenance-pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* Responsive */
@media (max-width: 480px) {
  .maintenance-title { font-size: 1.3rem; }
  .maintenance-message { font-size: 0.85rem; }
  .maintenance-icon-wrap { width: 100px; height: 100px; }
  .maintenance-icon { font-size: 2.8rem; }
}

/* ===== CREDITS / PARTICIPANTS SCREEN ===== */
.credits-header {
  text-align: center;
  padding: 30px 0 10px;
}

.credits-title {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #f9a8d4, #c084fc, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.credits-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 6px;
}

.credits-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 10px 8px 30px;
}

/* Category Block */
.credits-category-block {
  margin-bottom: 36px;
  position: relative;
}

.credits-cat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 18px;
}

.credits-cat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

.credits-cat-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.credits-cat-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
  margin-left: auto;
}

.credits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
  padding: 8px 4px 10px;
  max-width: 900px;
  margin: 0 auto;
}

/* Individual contributor card */
.credit-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 18px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease;
  animation: creditCardIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--card-delay, 0s);
}

@keyframes creditCardIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.credit-card:hover {
  transform: translateY(-8px) scale(1.04);
  border-color: rgba(255,255,255,0.22);
  box-shadow:
    0 16px 44px rgba(0,0,0,0.4),
    0 0 35px hsla(var(--card-hue, 260), 75%, 60%, 0.2);
}

/* Subtle glow behind the card on hover */
.credit-card-glow {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    hsla(var(--card-hue, 260), 80%, 65%, 0.08),
    transparent 60%,
    hsla(calc(var(--card-hue, 260) + 60), 80%, 65%, 0.06)
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 0;
}

.credit-card:hover .credit-card-glow {
  opacity: 1;
}

/* Avatar area */
.credit-avatar {
  position: relative;
  z-index: 1;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow:
    0 4px 16px rgba(0,0,0,0.3),
    0 0 0 2px rgba(255,255,255,0.08);
  transition: box-shadow 0.35s ease, transform 0.35s ease;
}

.credit-card:hover .credit-avatar {
  box-shadow:
    0 6px 24px rgba(0,0,0,0.4),
    0 0 0 2px hsla(var(--card-hue, 260), 70%, 60%, 0.45);
  transform: scale(1.06);
}

.credit-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Fallback initials avatar */
.credit-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(
    135deg,
    hsla(var(--avatar-hue, 260), 65%, 45%, 1),
    hsla(calc(var(--avatar-hue, 260) + 40), 65%, 55%, 1)
  );
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
  letter-spacing: 1px;
}

.credit-name {
  position: relative;
  z-index: 1;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.3;
  margin-bottom: 4px;
}

.credit-role {
  position: relative;
  z-index: 1;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  padding: 3px 12px;
  border-radius: 20px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.06);
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

/* Badge for cards created */
.credit-card-badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--accent-light);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  transition: all 0.25s ease;
}

.credit-card:hover .credit-card-badge {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 14px var(--accent-glow);
  transform: translateY(-1px);
}

/* ===== CONTRIBUTOR SHOWCASE MODAL ===== */
.contributor-modal {
  position: fixed; inset: 0; z-index: 120;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}

.contributor-modal.active {
  opacity: 1; pointer-events: auto;
}

.contributor-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(6, 6, 15, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.contributor-modal-container {
  position: relative; z-index: 1;
  width: 100%; max-width: 820px;
  max-height: 88vh;
  background: rgba(16, 16, 38, 0.95);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 60px rgba(0,0,0,0.6), 0 0 40px rgba(108,92,231,0.2);
  display: flex; flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.96);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.contributor-modal.active .contributor-modal-container {
  transform: translateY(0) scale(1);
}

.contributor-modal-close {
  position: absolute; top: 16px; right: 16px; z-index: 10;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.08); border: 1px solid var(--border-glass);
  color: var(--text-primary); font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.25s ease;
}

.contributor-modal-close:hover {
  background: rgba(255,255,255,0.18); transform: scale(1.1) rotate(90deg);
}

.contributor-modal-header {
  padding: 24px 24px 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), transparent);
  border-bottom: 1px solid var(--border-glass);
  display: flex; align-items: center; gap: 18px;
}

.contributor-modal-avatar {
  width: 68px; height: 68px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0;
  box-shadow: 0 0 20px var(--modal-accent, var(--accent));
  border: 2px solid var(--modal-accent, var(--accent));
}

.contributor-modal-avatar img {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
}

.contributor-modal-avatar .credit-avatar-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 700; color: #fff;
}

.contributor-modal-info {
  flex: 1; min-width: 0;
}

.contributor-modal-name {
  font-family: 'Cinzel', serif; font-size: 1.35rem; font-weight: 700;
  color: var(--text-primary); margin-bottom: 6px;
}

.contributor-modal-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

.contributor-cards-wrap {
  flex: 1; overflow-y: auto; padding: 20px 24px 28px;
}

.contributor-cards-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}

.contributor-cards-title {
  font-weight: 700; font-size: 0.95rem; color: var(--text-primary);
}

.contributor-cards-counter {
  font-size: 0.75rem; font-weight: 600; padding: 3px 10px;
  border-radius: 12px; background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
}

.contributor-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 16px;
}

.contributor-cards-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Credits footer */
.credits-footer {
  text-align: center;
  padding: 10px 20px 30px;
}

.credits-divider {
  width: 80px;
  height: 2px;
  margin: 0 auto 16px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  border-radius: 2px;
  opacity: 0.5;
}

.credits-thanks {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* Empty state */
.credits-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.credits-empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 16px;
  opacity: 0.5;
}

.credits-empty p {
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.credits-empty-sub {
  font-size: 0.8rem;
  opacity: 0.6;
}

/* Responsive credits */
@media (max-width: 480px) {
  .credits-title { font-size: 1.5rem; }
  .credits-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 14px;
    padding: 16px 6px 30px;
  }
  .credit-card { padding: 22px 12px 18px; }
  .credit-avatar { width: 64px; height: 64px; margin-bottom: 10px; }
  .credit-avatar-fallback { font-size: 1.2rem; }
  .credit-name { font-size: 0.85rem; }
  .credit-role { font-size: 0.7rem; }
}
