/* ============================================================
   MusicGacha - Design System
   ============================================================ */

/* ---- CSS Variables ---- */
:root {
  /* Colors - Dark Mode */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a2e;
  --bg-card: #16162a;
  --bg-elevated: #1e1e38;

  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b8;
  --text-muted: #6a6a80;

  /* Accent */
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-gradient: linear-gradient(135deg, #8b5cf6, #ec4899);
  --accent-gradient-hover: linear-gradient(135deg, #a78bfa, #f472b6);
  --accent-glow: 0 0 20px rgba(139, 92, 246, 0.4), 0 0 40px rgba(236, 72, 153, 0.2);

  /* Rarity Colors */
  --rarity-c: #6b7280;
  --rarity-uc: #22c55e;
  --rarity-r: #3b82f6;
  --rarity-sr: #a855f7;
  --rarity-ur: #f59e0b;
  --rarity-lr-1: #ef4444;
  --rarity-lr-2: #f59e0b;
  --rarity-lr-3: #22c55e;
  --rarity-lr-4: #3b82f6;
  --rarity-lr-5: #a855f7;

  /* Rarity Glows */
  --glow-c: 0 0 8px rgba(107, 114, 128, 0.3);
  --glow-uc: 0 0 12px rgba(34, 197, 94, 0.4);
  --glow-r: 0 0 16px rgba(59, 130, 246, 0.5);
  --glow-sr: 0 0 20px rgba(168, 85, 247, 0.5);
  --glow-ur: 0 0 24px rgba(245, 158, 11, 0.6), 0 0 48px rgba(245, 158, 11, 0.2);
  --glow-lr: 0 0 30px rgba(239, 68, 68, 0.4), 0 0 60px rgba(168, 85, 247, 0.3), 0 0 90px rgba(59, 130, 246, 0.2);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Fonts */
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-card: 'Outfit', 'Inter', sans-serif;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: 0.15s var(--ease-out);
  --transition-normal: 0.3s var(--ease-out);
  --transition-slow: 0.5s var(--ease-out);

  /* Z-index layers */
  --z-nav: 100;
  --z-modal: 200;
  --z-dialog: 300;
  --z-loading: 400;
  --z-toast: 500;

  /* Header height */
  --header-height: 48px;

  /* Glassmorphism */
  --glass-bg: rgba(22, 22, 42, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: blur(20px);

  /* Shadows */
  --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow-purple: 0 0 20px rgba(139, 92, 246, 0.3);
  --shadow-glow-pink: 0 0 20px rgba(236, 72, 153, 0.3);
  --shadow-glow-gold: 0 0 20px rgba(245, 158, 11, 0.3);

  /* Card Hologram */
  --holo-gradient: linear-gradient(135deg,
      rgba(255, 0, 0, 0.1), rgba(255, 154, 0, 0.1),
      rgba(208, 222, 33, 0.1), rgba(79, 220, 74, 0.1),
      rgba(63, 218, 216, 0.1), rgba(47, 201, 226, 0.1),
      rgba(28, 127, 238, 0.1), rgba(95, 21, 242, 0.1),
      rgba(186, 12, 248, 0.1), rgba(251, 7, 217, 0.1));

  /* Gaming Font */
  --font-gaming: 'Rajdhani', 'Outfit', sans-serif;
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-ui);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(139, 92, 246, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(236, 72, 153, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

select,
input {
  font-family: inherit;
  color: inherit;
}

/* ---- Screens ---- */
.screen {
  display: none;
  min-height: 100vh;
  padding-top: var(--header-height);
  padding-bottom: var(--space-xl);
  position: relative;
  z-index: 1;
}

.screen.active {
  display: block;
  animation: screenFadeIn 0.5s var(--ease-out);
}

@keyframes screenFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen-content {
  max-width: 540px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
}

/* ---- Unified Header (1-row) ---- */
.unified-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  z-index: var(--z-nav);
}

.header-row {
  height: var(--header-height);
  max-width: 540px;
  margin: 0 auto;
  padding: 0 var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.header-logo {
  font-family: var(--font-gaming);
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.header-logo .title-text {
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-logo .title-icon {
  font-size: 1rem;
  animation: titlePulse 3s ease-in-out infinite;
  filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.4));
}

/* Header Navigation - inline tabs */
.header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.header-nav .nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  position: relative;
  transition: all var(--transition-fast);
  border-radius: var(--radius-full);
}

.header-nav .nav-item.active {
  background: rgba(139, 92, 246, 0.12);
}

.header-nav .nav-label {
  font-family: var(--font-gaming);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s var(--ease-out);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.header-nav .nav-item.active .nav-label {
  color: var(--text-primary);
}

.header-nav .nav-item.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: 2px;
}

.header-nav .nav-item:hover .nav-label {
  color: var(--text-secondary);
}

/* Header Actions (country btn + volume) */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-shrink: 0;
}

/* Country Switch Button */
.country-btn {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-gaming);
  letter-spacing: 0.04em;
  transition: all var(--transition-fast);
  cursor: pointer;
  line-height: 1;
}

.country-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(139, 92, 246, 0.3);
  color: var(--text-primary);
}

.country-btn i,
.country-btn svg {
  width: 14px;
  height: 14px;
}

.country-code {
  text-transform: uppercase;
}

/* Volume Control */
.header-volume {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.volume-btn {
  font-size: 1rem;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  line-height: 1;
}

.volume-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.volume-slider {
  width: 70px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-purple);
  cursor: pointer;
  transition: transform var(--transition-fast);
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-purple);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}

/* ---- Header Mobile Responsive ---- */
@media (max-width: 480px) {
  .header-logo .title-text {
    display: none;
  }

  .header-nav .nav-item {
    padding: 4px 8px;
  }

  .header-nav .nav-label {
    font-size: 0.72rem;
  }

  .volume-slider {
    width: 50px;
  }

  .header-row {
    padding: 0 var(--space-xs);
    gap: var(--space-xs);
  }
}

@media (max-width: 360px) {
  .volume-slider {
    display: none;
  }

  .header-nav .nav-item {
    padding: 4px 6px;
  }

  .header-nav .nav-label {
    font-size: 0.68rem;
  }
}

/* ---- Home Screen ---- */
.home-subtitle-section {
  text-align: center;
  padding: var(--space-lg) 0 var(--space-md);
}

.app-title {
  font-family: var(--font-card);
  font-size: 2.4rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.title-icon {
  font-size: 2rem;
  animation: titlePulse 3s ease-in-out infinite;
}

@keyframes titlePulse {

  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }

  50% {
    transform: scale(1.1) rotate(5deg);
  }
}

.title-accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.app-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: var(--space-sm);
}

/* Pack Info Card */
.pack-info-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  margin-bottom: var(--space-lg);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-soft), var(--shadow-glow-purple);
}

.pack-info-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(139, 92, 246, 0.1) 0%, transparent 70%),
    radial-gradient(circle at 100% 100%, rgba(236, 72, 153, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.pack-count {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
}

.pack-count-current {
  font-family: var(--font-gaming);
  font-size: 3.5rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.5));
  animation: packCountGlow 3s ease-in-out infinite;
}

@keyframes packCountGlow {

  0%,
  100% {
    filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.4));
  }

  50% {
    filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.7));
  }
}

.pack-count-separator {
  font-size: 1.5rem;
  color: var(--text-muted);
  font-weight: 300;
}

.pack-count-max {
  font-size: 1.5rem;
  color: var(--text-muted);
  font-weight: 600;
}

.pack-count-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-left: var(--space-sm);
  font-weight: 500;
}

/* Pack info bar - compact horizontal */
.pack-info-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-xs) var(--space-lg);
  margin-bottom: var(--space-xs);
}

.pack-info-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pack-info-icon {
  font-size: 0.9rem;
}

.pack-info-value {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.pack-info-value span {
  background: linear-gradient(135deg, #a78bfa, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pack-info-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
}

.pack-info-divider {
  width: 1px;
  height: 20px;
  background: var(--glass-border);
}

.pack-regen-timer {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.7);
  margin-left: 2px;
}

.pack-info-desc {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 400;
  margin-top: 1px;
}

/* ===== Pack Carousel - Horizontal infinite scroll ===== */
.pack-carousel {
  position: relative;
  margin: -8px calc(-1 * var(--space-lg));
  padding: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}

.pack-carousel-track {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scroll-behavior: auto;
  padding: 0 var(--space-xl);
  -ms-overflow-style: none;
  scrollbar-width: none;
  cursor: grab;
}

.pack-carousel-track:active {
  cursor: grabbing;
}

.pack-carousel-track::-webkit-scrollbar {
  display: none;
}

/* ---- Pack item ---- */
.pack-item {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  width: 200px;
  transition: transform 0.3s var(--ease-spring), filter 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: visible;
  user-select: none;
  -webkit-user-select: none;
  z-index: 1;
}

.pack-item:hover {
  z-index: 10;
}

.pack-item::after {
  display: none;
}



.pack-item:active {
  transform: translateY(-2px) scale(1.01);
}

.pack-item:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.pack-item:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* Pack image - large */
.pack-item-img {
  width: 400px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.6));
  transition: transform 0.3s var(--ease-spring), filter 0.3s ease;
  pointer-events: none;
}

.pack-item:hover .pack-item-img {
  transform: scale(1.08) rotate(-2deg);
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 16px rgba(139, 92, 246, 0.4));
}

/* Pack name - overlaid at bottom */
.pack-item-name {
  font-family: var(--font-gaming);
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: -40px;
  color: #fff;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  opacity: 1;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  position: relative;
  z-index: 2;
}

/* Recommended badge */
.pack-badge {
  position: absolute;
  top: 16px;
  left: 8px;
  right: auto;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white;
  font-family: var(--font-gaming);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
  z-index: 2;
  pointer-events: none;
}

/* TOP200 special highlight */
.pack-item[data-pack="top200"] {
  /* no special border/bg needed - borderless design */
}

.pack-item[data-pack="top200"]:hover {
  transform: translateY(-8px) scale(1.06);
}

.pack-item[data-pack="top200"]:hover .pack-item-img {
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 20px rgba(245, 158, 11, 0.5));
}

/* Top 200 Progress Bar */
.top200-progress {
  margin-bottom: var(--space-md);
  background: var(--bg-elevated);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  animation: top200FadeIn 0.3s var(--ease-out);
}

@keyframes top200FadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.top200-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.top200-progress-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.top200-progress-count {
  font-family: var(--font-card);
  font-size: 0.85rem;
  font-weight: 700;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.top200-progress-bar {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.top200-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  border-radius: var(--radius-full);
  transition: width 0.6s var(--ease-out);
}

/* Gold Pack Progress */
.gold-pack-progress {
  margin-top: var(--space-md);
  margin-bottom: var(--space-lg);
  text-align: center;
}

.gold-pack-bar {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-xs);
}

.gold-pack-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  border-radius: var(--radius-full);
  transition: width 0.5s var(--ease-out);
}

.gold-pack-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fbbf24;
}

/* Daily Bonus Card */
.daily-bonus-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(250, 204, 21, 0.04));
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.daily-bonus-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, rgba(245, 158, 11, 0.06), transparent, rgba(250, 204, 21, 0.06), transparent);
  animation: dailyBonusRotate 6s linear infinite;
  pointer-events: none;
}

@keyframes dailyBonusRotate {
  to {
    transform: rotate(360deg);
  }
}

.daily-bonus-card:hover {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: var(--shadow-glow-gold);
  transform: translateY(-2px);
}

.daily-bonus-card.claimed {
  opacity: 0.5;
  pointer-events: none;
}

.daily-bonus-card.claimed::before {
  display: none;
}

.daily-bonus-icon {
  font-size: 2.2rem;
  animation: bonusBounce 2s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.4));
}

@keyframes bonusBounce {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  25% {
    transform: translateY(-6px) rotate(-5deg);
  }

  75% {
    transform: translateY(-2px) rotate(5deg);
  }
}

.daily-bonus-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.daily-bonus-title {
  font-family: var(--font-gaming);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}

.daily-bonus-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.btn-daily-bonus {
  padding: var(--space-sm) var(--space-md);
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-radius: var(--radius-md);
  font-family: var(--font-gaming);
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.2s var(--ease-spring);
  position: relative;
  z-index: 1;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-daily-bonus:hover {
  transform: scale(1.08);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
}

.btn-daily-bonus:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Ad Pack Button */
.btn-ad-pack {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-md);
  background: var(--bg-elevated);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  margin-bottom: var(--space-lg);
}

.btn-ad-pack:hover {
  border-color: rgba(139, 92, 246, 0.3);
  color: var(--text-primary);
}

.btn-ad-icon {
  width: 24px;
  height: 24px;
  background: var(--accent-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #fff;
}

/* Collection Progress */
.collection-progress {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.progress-ring {
  width: 64px;
  height: 64px;
  position: relative;
  flex-shrink: 0;
}

.progress-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-ring-bg {
  fill: none;
  stroke: var(--bg-tertiary);
  stroke-width: 6;
}

.progress-ring-fill {
  fill: none;
  stroke: url(#progressGradient);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 276.46;
  stroke-dashoffset: 276.46;
  transition: stroke-dashoffset 1s var(--ease-out);
}

.progress-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-card);
  font-weight: 700;
  font-size: 1.1rem;
}

.progress-info {
  display: flex;
  flex-direction: column;
}

.progress-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.progress-total {
  font-family: var(--font-card);
  font-weight: 600;
  font-size: 1rem;
}

/* ---- Pack Opening Screen ---- */
.pack-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: calc(100vh - var(--header-height));
  max-height: calc(100dvh - var(--header-height));
  padding: var(--space-lg);
  position: relative;
  overflow: visible;
}

.pack-opening-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.pack-wrapper {
  text-align: center;
  cursor: pointer;
}

.pack-visual {
  width: 600px;
  max-width: 80vw;
  position: relative;
  cursor: pointer;
  transition: all var(--transition-normal);
  animation: packFloat 3s ease-in-out infinite;
}

@keyframes packFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.pack-visual:hover {
  transform: scale(1.04);
  filter: drop-shadow(0 8px 30px rgba(139, 92, 246, 0.3));
}

/* ---- Rarity Hint Hover Glow ---- */
.pack-visual[data-hint-rarity="R"]:hover {
  filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.6)) drop-shadow(0 0 40px rgba(59, 130, 246, 0.3));
}

.pack-visual[data-hint-rarity="SR"]:hover {
  filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.7)) drop-shadow(0 0 40px rgba(168, 85, 247, 0.4));
  animation: packFloat 3s ease-in-out infinite, hintPulseSR 1.5s ease-in-out infinite;
}

.pack-visual[data-hint-rarity="UR"]:hover {
  filter: drop-shadow(0 0 25px rgba(245, 158, 11, 0.8)) drop-shadow(0 0 50px rgba(245, 158, 11, 0.4)) drop-shadow(0 0 70px rgba(245, 158, 11, 0.2));
  animation: packFloat 3s ease-in-out infinite, hintPulseUR 1.2s ease-in-out infinite;
}

.pack-visual[data-hint-rarity="LR"]:hover {
  filter: drop-shadow(0 0 25px rgba(239, 68, 68, 0.7)) drop-shadow(0 0 45px rgba(245, 158, 11, 0.5)) drop-shadow(0 0 65px rgba(34, 197, 94, 0.4)) drop-shadow(0 0 85px rgba(59, 130, 246, 0.3)) drop-shadow(0 0 100px rgba(168, 85, 247, 0.2));
  animation: packFloat 3s ease-in-out infinite, hintPulseLR 2s ease-in-out infinite;
}

@keyframes hintPulseSR {

  0%,
  100% {
    filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.7)) drop-shadow(0 0 40px rgba(168, 85, 247, 0.4));
  }

  50% {
    filter: drop-shadow(0 0 30px rgba(168, 85, 247, 0.9)) drop-shadow(0 0 55px rgba(168, 85, 247, 0.5));
  }
}

@keyframes hintPulseUR {

  0%,
  100% {
    filter: drop-shadow(0 0 25px rgba(245, 158, 11, 0.8)) drop-shadow(0 0 50px rgba(245, 158, 11, 0.4)) drop-shadow(0 0 70px rgba(245, 158, 11, 0.2));
  }

  50% {
    filter: drop-shadow(0 0 35px rgba(245, 158, 11, 1)) drop-shadow(0 0 65px rgba(245, 158, 11, 0.6)) drop-shadow(0 0 90px rgba(245, 158, 11, 0.3));
  }
}

@keyframes hintPulseLR {

  0%,
  100% {
    filter: drop-shadow(0 0 25px rgba(239, 68, 68, 0.7)) drop-shadow(0 0 45px rgba(245, 158, 11, 0.5)) drop-shadow(0 0 65px rgba(34, 197, 94, 0.4)) drop-shadow(0 0 85px rgba(59, 130, 246, 0.3)) drop-shadow(0 0 100px rgba(168, 85, 247, 0.2));
  }

  50% {
    filter: drop-shadow(0 0 35px rgba(245, 158, 11, 0.8)) drop-shadow(0 0 55px rgba(34, 197, 94, 0.6)) drop-shadow(0 0 75px rgba(59, 130, 246, 0.5)) drop-shadow(0 0 95px rgba(168, 85, 247, 0.4)) drop-shadow(0 0 110px rgba(239, 68, 68, 0.3));
  }
}

.pack-image {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.4));
  transition: all var(--transition-normal);
  user-select: none;
  -webkit-user-drag: none;
}

.pack-visual.gold .pack-image {
  filter: drop-shadow(0 8px 30px rgba(245, 158, 11, 0.5)) drop-shadow(0 0 20px rgba(245, 158, 11, 0.3));
}

.pack-tap-hint {
  margin-top: var(--space-lg);
  font-size: 0.85rem;
  color: var(--text-muted);
  animation: hintPulse 2s ease-in-out infinite;
}

@keyframes hintPulse {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

/* Pack Cards */
.pack-cards-container {
  width: 100%;
  max-width: 900px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.pack-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  width: 100%;
}

.pack-cards .music-card {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 1 / 1;
  justify-self: center;
}

.pack-wrapper .card-new-badge,
.pack-opening-container .card-new-badge {
  display: none;
}

.pack-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: 0 var(--space-md);
}

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

/* ---- Pack Split Animation ---- */
.pack-split-half {
  position: absolute;
  left: 0;
  width: 100%;
  will-change: transform, opacity;
  pointer-events: none;
}

.pack-split-half img {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.4));
}

/* 上パーツ: clip-pathはJSで動的にセット */
.pack-split-top {
  top: 0;
  z-index: 3;
  transform-origin: center bottom;
}

/* 下パーツ */
.pack-split-bottom {
  top: 0;
  z-index: 2;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 上パーツの飛散: JSでクラス追加 → 回転しながら斜め上に弾け飛ぶ */
.pack-split-top.fly-away {
  animation: packTopFlyAway 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes packTopFlyAway {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }

  30% {
    transform: translateY(-40px) rotate(-6deg);
    opacity: 1;
  }

  100% {
    transform: translateY(-180px) translateX(60px) rotate(-18deg);
    opacity: 0;
  }
}

.pack-split-bottom.split {
  transform: translateY(50px);
}

/* 切断面の光漏れグロー */
.pack-tear-glow {
  position: absolute;
  left: 22.5%;
  width: 55%;
  height: 10px;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(180deg,
      transparent 0%,
      rgba(200, 170, 255, 0.5) 30%,
      rgba(255, 255, 255, 0.7) 50%,
      rgba(200, 170, 255, 0.5) 70%,
      transparent 100%);
  filter: blur(3px);
  transform: translateY(-50%);
}

.pack-tear-glow.active {
  animation: tearGlowPulse 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes tearGlowPulse {
  0% {
    opacity: 0;
    filter: blur(2px);
    transform: translateY(-50%) scaleY(0.5);
  }

  25% {
    opacity: 1;
    filter: blur(3px);
    transform: translateY(-50%) scaleY(1);
  }

  100% {
    opacity: 0;
    filter: blur(5px);
    transform: translateY(-50%) scaleY(1.2);
  }
}

/* 切断時の火花パーティクル */
.pack-tear-spark {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: white;
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 0 6px 2px rgba(200, 170, 255, 0.8), 0 0 12px 4px rgba(139, 92, 246, 0.4);
}

.pack-tear-spark.animate {
  animation: sparkFly var(--spark-duration, 0.6s) cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes sparkFly {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }

  50% {
    opacity: 0.8;
  }

  100% {
    transform: translate(var(--spark-x, 40px), var(--spark-y, -60px)) scale(0);
    opacity: 0;
  }
}

/* パックスプリットフラッシュ */
.pack-split-flash {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg,
      rgba(200, 170, 255, 0.3) 0%,
      rgba(255, 255, 255, 0.6) 50%,
      rgba(200, 170, 255, 0.3) 100%);
  opacity: 0;
  z-index: 100;
  pointer-events: none;
}

.pack-split-flash.active {
  animation: splitFlash 0.4s ease-out forwards;
}

@keyframes splitFlash {
  0% {
    opacity: 0.3;
  }

  100% {
    opacity: 0;
  }
}

/* ローディング */
.pack-split-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.4s ease 0.3s;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.pack-split-loading.visible {
  opacity: 1;
}

.pack-split-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(139, 92, 246, 0.2);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: packSplitSpin 0.8s linear infinite;
}

@keyframes packSplitSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- God Pack Styles ---- */
.pack-visual.god .pack-image {
  filter:
    drop-shadow(0 0 20px rgba(239, 68, 68, 0.6)) drop-shadow(0 0 40px rgba(245, 158, 11, 0.4)) drop-shadow(0 0 60px rgba(168, 85, 247, 0.3));
  animation: godPackPulse 1.5s ease-in-out infinite;
}

@keyframes godPackPulse {

  0%,
  100% {
    filter:
      drop-shadow(0 0 20px rgba(239, 68, 68, 0.6)) drop-shadow(0 0 40px rgba(245, 158, 11, 0.4)) drop-shadow(0 0 60px rgba(168, 85, 247, 0.3));
  }

  50% {
    filter:
      drop-shadow(0 0 30px rgba(59, 130, 246, 0.7)) drop-shadow(0 0 50px rgba(34, 197, 94, 0.5)) drop-shadow(0 0 70px rgba(239, 68, 68, 0.4));
  }
}

.pack-visual.god .pack-title,
.pack-visual.god .pack-tap-hint {
  background: linear-gradient(90deg, #ef4444, #f59e0b, #22c55e, #3b82f6, #a855f7, #ef4444);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: godTextShimmer 2s linear infinite;
  font-weight: 800;
}

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

  100% {
    background-position: 200% 50%;
  }
}

.god-spinner {
  border: 3px solid rgba(255, 255, 255, 0.1) !important;
  border-top-color: #ef4444 !important;
  border-right-color: #f59e0b !important;
  border-bottom-color: #22c55e !important;
  border-left-color: #a855f7 !important;
}

/* God Pack Shockwave */
.god-shockwave {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 300px;
  height: 300px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.6);
  background: radial-gradient(circle,
      rgba(239, 68, 68, 0.15) 0%,
      rgba(245, 158, 11, 0.1) 25%,
      rgba(34, 197, 94, 0.05) 50%,
      transparent 70%);
  animation: shockwaveExpand 0.8s ease-out forwards;
  pointer-events: none;
  z-index: 100;
}

@keyframes shockwaveExpand {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
    border-width: 3px;
  }

  100% {
    transform: translate(-50%, -50%) scale(4);
    opacity: 0;
    border-width: 1px;
  }
}

/* God Pack - 画面暗転 */
.god-dim-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 50;
  pointer-events: none;
  transition: background 0.6s ease;
}

.god-dim-overlay.active {
  background: rgba(0, 0, 0, 0.7);
}

/* God Pack - ホワイトフラッシュ */
.god-white-flash {
  position: fixed;
  inset: 0;
  background: white;
  opacity: 0;
  z-index: 200;
  pointer-events: none;
  transition: opacity 0.15s ease-in, opacity 0.5s ease-out;
}

.god-white-flash.active {
  opacity: 0.9;
}

/* God Pack - アナウンスオーバーレイ */
.god-announce-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 201;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.god-announce-overlay.active {
  opacity: 1;
}

.god-announce-overlay.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.god-announce-text {
  font-family: var(--font-card), 'Outfit', sans-serif;
  font-size: clamp(3rem, 10vw, 7rem);
  font-weight: 900;
  letter-spacing: 0.15em;
  background: linear-gradient(135deg, #ef4444, #f59e0b, #22c55e, #3b82f6, #a855f7, #ec4899);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: godTextGlow 1s ease-in-out infinite alternate, godTextShimmer 2s linear infinite;
  filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.8)) drop-shadow(0 0 40px rgba(245, 158, 11, 0.5)) drop-shadow(0 0 60px rgba(239, 68, 68, 0.3));
  transform: scale(0.5);
  animation: godAnnounceIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
    godTextShimmer 2s linear infinite;
}

@keyframes godAnnounceIn {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }

  60% {
    transform: scale(1.1);
    opacity: 1;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* God Pack - 画面シェイク */
.god-screen-shake {
  animation: godScreenShake 0.6s ease-in-out;
}

@keyframes godScreenShake {

  0%,
  100% {
    transform: translate(0, 0);
  }

  10% {
    transform: translate(-8px, 4px);
  }

  20% {
    transform: translate(6px, -6px);
  }

  30% {
    transform: translate(-4px, 8px);
  }

  40% {
    transform: translate(8px, -3px);
  }

  50% {
    transform: translate(-6px, -5px);
  }

  60% {
    transform: translate(5px, 7px);
  }

  70% {
    transform: translate(-3px, -4px);
  }

  80% {
    transform: translate(4px, 3px);
  }

  90% {
    transform: translate(-2px, -2px);
  }
}

/* God Pack - 背景レインボーオーラ （カード表示中） */
.god-background-aura {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at center,
      rgba(168, 85, 247, 0.15) 0%,
      rgba(59, 130, 246, 0.1) 20%,
      rgba(34, 197, 94, 0.05) 40%,
      transparent 70%);
  animation: godAuraRotate 4s linear infinite;
}

@keyframes godAuraRotate {
  0% {
    background: radial-gradient(ellipse at center,
        rgba(239, 68, 68, 0.15) 0%, rgba(245, 158, 11, 0.1) 20%,
        rgba(34, 197, 94, 0.05) 40%, transparent 70%);
  }

  25% {
    background: radial-gradient(ellipse at center,
        rgba(245, 158, 11, 0.15) 0%, rgba(34, 197, 94, 0.1) 20%,
        rgba(59, 130, 246, 0.05) 40%, transparent 70%);
  }

  50% {
    background: radial-gradient(ellipse at center,
        rgba(34, 197, 94, 0.15) 0%, rgba(59, 130, 246, 0.1) 20%,
        rgba(168, 85, 247, 0.05) 40%, transparent 70%);
  }

  75% {
    background: radial-gradient(ellipse at center,
        rgba(59, 130, 246, 0.15) 0%, rgba(168, 85, 247, 0.1) 20%,
        rgba(239, 68, 68, 0.05) 40%, transparent 70%);
  }

  100% {
    background: radial-gradient(ellipse at center,
        rgba(239, 68, 68, 0.15) 0%, rgba(245, 158, 11, 0.1) 20%,
        rgba(34, 197, 94, 0.05) 40%, transparent 70%);
  }
}

/* ---- Cards ---- */
.music-card {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
  flex-shrink: 0;
}

.music-card:hover {
  transform: perspective(600px) rotateY(6deg) rotateX(-4deg) scale(1.06);
  z-index: 10;
}

/* Card Holographic Sheen */
.music-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.05) 40%,
      rgba(255, 255, 255, 0.15) 50%,
      rgba(255, 255, 255, 0.05) 60%,
      rgba(255, 255, 255, 0) 100%);
  transform: translateX(-100%);
  transition: transform 0.6s var(--ease-out);
  z-index: 5;
  pointer-events: none;
}

.music-card:hover::after {
  transform: translateX(100%);
}

.card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
      rgba(0, 0, 0, 0.1) 0%,
      rgba(0, 0, 0, 0.3) 50%,
      rgba(0, 0, 0, 0.85) 100%);
  z-index: 1;
}

.card-border {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  z-index: 2;
  pointer-events: none;
}

/* Rarity borders */
.card-rarity-c .card-border {
  border: 2px solid var(--rarity-c);
}

.card-rarity-uc .card-border {
  border: 2px solid var(--rarity-uc);
}

.card-rarity-r .card-border {
  border: 2px solid var(--rarity-r);
}

.card-rarity-sr .card-border {
  border: 2px solid var(--rarity-sr);
}

.card-rarity-ur .card-border {
  border: 2px solid var(--rarity-ur);
}

.card-rarity-lr .card-border {
  border: 2px solid;
  border-image: linear-gradient(135deg, var(--rarity-lr-1), var(--rarity-lr-2), var(--rarity-lr-3), var(--rarity-lr-4), var(--rarity-lr-5), var(--rarity-lr-1)) 1;
  animation: rainbowBorder 3s linear infinite;
}

@keyframes rainbowBorder {
  0% {
    filter: hue-rotate(0deg);
  }

  100% {
    filter: hue-rotate(360deg);
  }
}

/* Rarity glow effects */
.card-rarity-c {
  box-shadow: var(--glow-c);
}

.card-rarity-uc {
  box-shadow: var(--glow-uc);
}

/* R - Blue gradient glow */
.card-rarity-r {
  box-shadow: var(--glow-r);
}

.card-rarity-r .card-border {
  border: 2px solid;
  border-image: linear-gradient(135deg, #3b82f6, #06b6d4, #3b82f6) 1;
}

.card-rarity-r:hover {
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.6), 0 0 48px rgba(59, 130, 246, 0.2);
}

/* SR - Purple glow + particle */
.card-rarity-sr {
  box-shadow: var(--glow-sr);
}

.card-rarity-sr .card-border {
  border: 2px solid;
  border-image: linear-gradient(135deg, #a855f7, #ec4899, #a855f7) 1;
}

.card-rarity-sr::before {
  content: '';
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at 30% 50%, rgba(168, 85, 247, 0.12), transparent 50%),
    radial-gradient(circle at 70% 30%, rgba(236, 72, 153, 0.08), transparent 40%);
  animation: srParticleFloat 4s ease-in-out infinite;
  z-index: -1;
  pointer-events: none;
}

@keyframes srParticleFloat {

  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }

  50% {
    transform: translate(5px, -5px) rotate(3deg);
  }
}

.card-rarity-sr:hover {
  box-shadow: 0 0 28px rgba(168, 85, 247, 0.6), 0 0 56px rgba(168, 85, 247, 0.2);
}

/* UR - Gold foil + sparkle */
.card-rarity-ur {
  box-shadow: var(--glow-ur);
}

.card-rarity-ur .card-border {
  border: 2px solid;
  border-image: linear-gradient(135deg, #f59e0b, #fbbf24, #f59e0b, #d97706) 1;
  animation: urBorderShimmer 3s linear infinite;
}

@keyframes urBorderShimmer {
  0% {
    filter: hue-rotate(0deg);
  }

  100% {
    filter: hue-rotate(30deg);
  }
}

/* UR sparkle pseudo-element */
.card-rarity-ur::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 215, 0, 0.3), transparent 20%),
    radial-gradient(circle at 80% 30%, rgba(255, 215, 0, 0.2), transparent 15%),
    radial-gradient(circle at 50% 80%, rgba(255, 215, 0, 0.25), transparent 18%),
    radial-gradient(circle at 10% 70%, rgba(255, 215, 0, 0.15), transparent 12%);
  animation: urSparkle 2s ease-in-out infinite alternate;
  z-index: 6;
  pointer-events: none;
  mix-blend-mode: screen;
}

@keyframes urSparkle {
  0% {
    opacity: 0.4;
    transform: scale(1);
  }

  100% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

.card-rarity-ur:hover {
  box-shadow: 0 0 32px rgba(245, 158, 11, 0.7), 0 0 64px rgba(245, 158, 11, 0.3);
}

/* LR - Rainbow hologram + shimmer */
.card-rarity-lr {
  box-shadow: var(--glow-lr);
}

.card-rarity-lr::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--holo-gradient);
  background-size: 200% 200%;
  animation: lrHoloShift 3s ease-in-out infinite;
  z-index: 6;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.7;
}

@keyframes lrHoloShift {
  0% {
    background-position: 0% 0%;
  }

  50% {
    background-position: 100% 100%;
  }

  100% {
    background-position: 0% 0%;
  }
}

.card-rarity-lr:hover {
  box-shadow: 0 0 40px rgba(239, 68, 68, 0.5), 0 0 60px rgba(168, 85, 247, 0.4), 0 0 80px rgba(59, 130, 246, 0.3);
}

.card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-sm);
  z-index: 3;
}

.card-title {
  font-family: var(--font-card);
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

.card-artist {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-stats {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-xs);
}

.card-stat {
  font-family: var(--font-card);
  font-size: 0.6rem;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.5);
}

.card-stat-atk {
  color: #ef4444;
}

.card-stat-def {
  color: #3b82f6;
}

/* Pack Badges Container */
.card-pack-badges {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-end;
  z-index: 4;
}

.card-genre-badge {
  font-size: 0.55rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
}

/* Favorite Heart Icon */
.card-fav-icon {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  font-size: 0.9rem;
  z-index: 4;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease, filter 0.2s ease;
  user-select: none;
  line-height: 1;
  pointer-events: none;
}

.card-fav-icon.active {
  opacity: 1;
  color: #ef4444;
  filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.6));
  pointer-events: auto;
}

.card-fav-icon.bounce {
  animation: favBounce 0.4s ease;
}

@keyframes favBounce {
  0% {
    transform: scale(1);
  }

  30% {
    transform: scale(1.5);
  }

  50% {
    transform: scale(0.9);
  }

  70% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

/* Rarity Badge */
.card-rarity-badge {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  font-family: var(--font-card);
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  z-index: 4;
}

.rarity-badge-c {
  background: var(--rarity-c);
  color: #fff;
}

.rarity-badge-uc {
  background: var(--rarity-uc);
  color: #fff;
}

.rarity-badge-r {
  background: var(--rarity-r);
  color: #fff;
}

.rarity-badge-sr {
  background: var(--rarity-sr);
  color: #fff;
}

.rarity-badge-ur {
  background: var(--rarity-ur);
  color: #000;
}

.rarity-badge-lr {
  background: linear-gradient(135deg, var(--rarity-lr-1), var(--rarity-lr-2), var(--rarity-lr-3), var(--rarity-lr-4), var(--rarity-lr-5));
  color: #fff;
  animation: rainbowShift 3s linear infinite;
  background-size: 300% 300%;
}

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

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* Listen Button */
.card-listen-btn {
  position: absolute;
  bottom: var(--space-sm);
  right: var(--space-sm);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  z-index: 4;
  transition: transform var(--transition-fast);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

.card-listen-btn:hover {
  transform: scale(1.15);
}

.card-listen-btn.playing {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 2px 12px rgba(34, 197, 94, 0.5);
  animation: listenBtnPulse 1.5s ease-in-out infinite;
}

@keyframes listenBtnPulse {

  0%,
  100% {
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
  }

  50% {
    box-shadow: 0 2px 16px rgba(34, 197, 94, 0.7);
  }
}

/* Card Progress Bar */
.card-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
  z-index: 5;
}

.card-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-pink));
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  transition: width 0.3s linear;
  box-shadow: 0 0 6px rgba(139, 92, 246, 0.6);
}

/* NEW Badge */
.card-new-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  z-index: 6;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
  animation: newBadgePulse 1.5s ease-in-out infinite;
}

@keyframes newBadgePulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

/* Card Flip Animation */
.card-flip {
  transform: perspective(800px) rotateY(180deg);
  opacity: 0;
}

.card-flip.revealed {
  transform: perspective(800px) rotateY(0deg);
  opacity: 1;
  transition: transform 0.6s var(--ease-spring), opacity 0.3s ease;
}

/* ---- Collection Screen ---- */
.collection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  padding-top: var(--space-lg);
}

.section-title {
  font-family: var(--font-card);
  font-size: 1.6rem;
  font-weight: 700;
}

.collection-stats {
  display: flex;
  gap: var(--space-sm);
}

.stat-badge {
  font-family: var(--font-gaming);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(139, 92, 246, 0.15);
  color: var(--text-secondary);
  letter-spacing: 0.03em;
}

.stat-badge.stat-unique {
  border-color: rgba(236, 72, 153, 0.2);
}

/* Filter Bar */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-pills {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.pill {
  font-family: var(--font-gaming);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  transition: all 0.2s var(--ease-spring);
  cursor: pointer;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.pill:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.pill.active {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-glow-purple);
  transform: scale(1.05);
}

.pill-c.active {
  background: var(--rarity-c);
  box-shadow: 0 0 12px rgba(107, 114, 128, 0.3);
}

.pill-uc.active {
  background: var(--rarity-uc);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
}

.pill-r.active {
  background: var(--rarity-r);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.pill-sr.active {
  background: var(--rarity-sr);
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.4);
}

.pill-ur.active {
  background: var(--rarity-ur);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.4);
}

.pill-lr.active {
  background: linear-gradient(135deg, var(--rarity-lr-1), var(--rarity-lr-3), var(--rarity-lr-5));
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.3), 0 0 24px rgba(239, 68, 68, 0.2);
}

.sort-select {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  appearance: none;
  outline: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sort-select:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.2);
}

.search-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  outline: none;
  transition: all var(--transition-fast);
}

.search-input:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.2);
  background: rgba(22, 22, 42, 0.8);
}

.search-input::placeholder {
  color: var(--text-muted);
}

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  padding-bottom: var(--space-xl);
}

/* Staggered card entrance */
.card-grid .music-card {
  animation: cardFadeIn 0.4s var(--ease-out) both;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.search-input::placeholder {
  color: var(--text-muted);
}

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  padding-bottom: var(--space-xl);
}

.empty-collection {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

/* ---- Settings Screen ---- */
.settings-header {
  padding-top: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
}

.settings-item-label {
  font-weight: 500;
  font-size: 0.9rem;
}

.settings-select {
  padding: var(--space-xs) var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  outline: none;
  appearance: none;
  cursor: pointer;
}

.settings-input {
  width: 180px;
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-family: monospace;
  outline: none;
}

.settings-input:focus,
.settings-select:focus {
  border-color: var(--accent-purple);
}

.settings-item-danger {
  border-color: rgba(239, 68, 68, 0.15);
}

.settings-section {
  padding: var(--space-md) 0;
}

.settings-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
}

.credits-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.credit-link {
  display: flex;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.credit-link:hover {
  background: var(--bg-tertiary);
}

.credit-name {
  font-weight: 600;
  font-size: 0.85rem;
}

.credit-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.settings-link {
  display: block;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: var(--space-xs);
  transition: background var(--transition-fast);
}

.settings-link:hover {
  background: var(--bg-tertiary);
}

.settings-version {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: var(--space-lg) 0;
}

/* ---- Buttons ---- */
.btn-primary {
  width: 100%;
  padding: var(--space-md);
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-secondary {
  width: 100%;
  padding: var(--space-md);
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-danger {
  padding: var(--space-xs) var(--space-md);
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  color: #ef4444;
  transition: all var(--transition-fast);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-tertiary {
  width: 100%;
  padding: var(--space-sm);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.btn-tertiary:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.toggle-switch input:checked+.toggle-slider {
  background: var(--accent-purple);
  border-color: transparent;
}

.toggle-switch input:checked+.toggle-slider::before {
  transform: translateX(22px);
  background: #fff;
}

/* Settings Item Info */
.settings-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-item-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Toggle Small Variant */
.toggle-switch-sm {
  width: 38px;
  height: 22px;
}

.toggle-switch-sm .toggle-slider::before {
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
}

.toggle-switch-sm input:checked+.toggle-slider::before {
  transform: translateX(16px);
}

/* Pack Auto-Open Toggle */
.pack-auto-open-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-xs) 0;
  margin-bottom: var(--space-xs);
}

.pack-auto-open-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pack-auto-open-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.pack-auto-open-desc {
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  animation: modalFadeIn 0.35s var(--ease-out);
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-content {
  background: linear-gradient(180deg, rgba(18, 18, 28, 0.98), rgba(10, 10, 18, 0.98));
  border: 1px solid rgba(139, 92, 246, 0.12);
  border-radius: var(--radius-xl);
  max-width: 400px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-xl);
  position: relative;
  animation: modalSlideUp 0.45s var(--ease-spring);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 40px rgba(139, 92, 246, 0.1);
}

@keyframes modalSlideUp {
  from {
    transform: translateY(40px) scale(0.92);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text-secondary);
  transition: all 0.2s var(--ease-spring);
  z-index: 10;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  transform: rotate(90deg) scale(1.1);
}

.modal-card-container {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.modal-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.modal-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.modal-info-label {
  color: var(--text-muted);
}

.modal-info-value {
  font-weight: 600;
}

.pack-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #c4b5fd;
  white-space: nowrap;
}

.modal-stat-bar {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 2px;
}

.modal-stat-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s var(--ease-out);
}

.modal-stat-atk .modal-stat-fill {
  background: linear-gradient(90deg, #ef4444, #f97316);
}

.modal-stat-def .modal-stat-fill {
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
}

.modal-player {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: var(--space-md);
}

.modal-player-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.btn-spotify {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: #1db954;
  border-radius: var(--radius-md);
  font-weight: 600;
  color: #fff;
  transition: all 0.2s var(--ease-spring);
  position: relative;
  overflow: hidden;
}

.btn-spotify:hover {
  background: #1ed760;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(30, 215, 96, 0.4);
}

.btn-youtube {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: rgba(255, 0, 0, 0.12);
  border: 1px solid rgba(255, 0, 0, 0.25);
  border-radius: var(--radius-md);
  font-weight: 600;
  color: #ff4444;
  transition: all 0.2s var(--ease-spring);
}

.btn-youtube:hover {
  background: rgba(255, 0, 0, 0.2);
  border-color: rgba(255, 0, 0, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(255, 0, 0, 0.2);
}

.btn-amazon-music {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: linear-gradient(135deg, #ff9900, #ff6600);
  border-radius: var(--radius-md);
  font-weight: 600;
  color: #fff;
  transition: all var(--transition-fast);
}

.btn-amazon-music:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* ---- Ad Container ---- */
.ad-container {
  width: 100%;
  max-width: 728px;
  margin: var(--space-md) auto;
  padding: var(--space-xs);
  border-radius: var(--radius-md);
  overflow: hidden;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-container ins {
  display: block;
  width: 100%;
}

.ad-placeholder {
  width: 100%;
  padding: var(--space-lg);
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* Rewarded Ad Button Enhancement */
.btn-ad-pack.ad-ready {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(16, 185, 129, 0.15));
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #22c55e;
}

.btn-ad-pack.ad-cooldown {
  opacity: 0.5;
  cursor: not-allowed;
}

.ad-cooldown-timer {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

@media (max-width: 479px) {
  .ad-container {
    max-width: 320px;
    min-height: 50px;
  }
}

/* ---- Rewarded Ad Overlay ---- */
.rewarded-ad-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  animation: modalFadeIn 0.35s var(--ease-out);
}

.rewarded-ad-content {
  background: linear-gradient(180deg, rgba(18, 18, 28, 0.98), rgba(10, 10, 18, 0.98));
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: var(--radius-xl);
  max-width: 400px;
  width: 90%;
  padding: var(--space-xl);
  text-align: center;
  animation: modalSlideUp 0.45s var(--ease-spring);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 40px rgba(139, 92, 246, 0.1);
}

.rewarded-ad-header {
  margin-bottom: var(--space-lg);
}

.rewarded-ad-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: var(--space-sm);
}

.rewarded-ad-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 var(--space-xs);
}

.rewarded-ad-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.rewarded-ad-slot {
  margin: var(--space-md) auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.rewarded-ad-countdown-area {
  margin-top: var(--space-md);
}

.rewarded-ad-countdown {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-display);
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-sm);
}

.rewarded-ad-progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.rewarded-ad-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #8b5cf6, #ec4899);
  transition: width 1s linear;
  border-radius: var(--radius-full);
}

.rewarded-ad-close {
  margin-top: var(--space-lg);
  width: 100%;
  padding: var(--space-md);
  background: linear-gradient(135deg, #22c55e, #10b981);
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  cursor: pointer;
  transition: all var(--transition-fast);
  animation: modalFadeIn 0.3s var(--ease-out);
}

.rewarded-ad-close:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.3);
}

.btn-apple-music {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: linear-gradient(135deg, #fc3c44, #d63384);
  border-radius: var(--radius-md);
  font-weight: 600;
  color: #fff;
  transition: all var(--transition-fast);
}

.btn-apple-music:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* ---- Share Card Button ---- */
.modal-share-section {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-share-card {
  width: 100%;
  padding: var(--space-md);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.15));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  color: #a5b4fc;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.btn-share-card:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(139, 92, 246, 0.25));
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
  color: #c7d2fe;
}

.btn-share-card:active {
  transform: translateY(0);
}

/* ---- Share Receive Modal ---- */
.share-receive-modal {
  z-index: calc(var(--z-modal) + 1);
}

.share-receive-content {
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  max-width: 360px;
  width: 100%;
  padding: var(--space-xl);
  text-align: center;
  animation: modalSlideUp 0.5s var(--ease-spring);
  position: relative;
  overflow: hidden;
}

.share-receive-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.08), transparent);
  pointer-events: none;
}

.share-receive-header {
  position: relative;
  z-index: 1;
  margin-bottom: var(--space-lg);
}

.share-receive-icon {
  display: block;
  font-size: 3rem;
  margin-bottom: var(--space-sm);
  animation: giftBounce 1s ease infinite;
}

@keyframes giftBounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

.share-receive-title {
  font-family: var(--font-card);
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(135deg, #a78bfa, #c084fc, #e879f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 var(--space-sm);
}

.share-receive-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.share-receive-rarity {
  display: inline-block;
  font-family: var(--font-card);
  font-weight: 800;
  font-size: 0.8rem;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  margin-top: var(--space-xs);
}

.share-receive-rarity.rarity-c {
  background: rgba(107, 114, 128, 0.2);
  color: #9ca3af;
}

.share-receive-rarity.rarity-uc {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.share-receive-rarity.rarity-r {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.share-receive-rarity.rarity-sr {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}

.share-receive-rarity.rarity-ur {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.share-receive-rarity.rarity-lr {
  background: linear-gradient(135deg, rgba(255, 0, 128, 0.15), rgba(255, 215, 0, 0.1));
  color: #f472b6;
}

.share-receive-card {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-lg);
  position: relative;
  z-index: 1;
}

.share-receive-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  position: relative;
  z-index: 1;
}

.share-receive-accept {
  background: linear-gradient(135deg, #8b5cf6, #a855f7) !important;
  font-size: 1rem !important;
  padding: var(--space-md) !important;
  letter-spacing: 0.5px;
}

.share-receive-accept:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.share-receive-decline {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: var(--text-muted) !important;
  font-size: 0.85rem !important;
}

/* ---- Dialog ---- */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: var(--z-dialog);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  animation: modalFadeIn 0.2s ease;
}

.dialog-content {
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  max-width: 320px;
  width: 100%;
  text-align: center;
}

.dialog-message {
  font-size: 0.95rem;
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

.dialog-actions {
  display: flex;
  gap: var(--space-sm);
}

.dialog-actions .btn-secondary,
.dialog-actions .btn-danger {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
}

/* ---- Loading ---- */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.85);
  z-index: var(--z-loading);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner {
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bg-tertiary);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto var(--space-md);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ---- Toast ---- */
.toast-container {
  position: fixed;
  top: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
  width: 90%;
  max-width: 400px;
}

.toast {
  padding: var(--space-md) var(--space-lg);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  text-align: center;
  pointer-events: auto;
  animation: toastIn 0.5s var(--ease-spring);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.toast.toast-out {
  animation: toastOut 0.3s var(--ease-out) forwards;
}

@keyframes toastIn {
  from {
    transform: translateY(-20px) scale(0.9);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes toastOut {
  from {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  to {
    transform: translateY(-20px) scale(0.9);
    opacity: 0;
  }
}

.toast-success {
  border-left: 3px solid #22c55e;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 12px rgba(34, 197, 94, 0.15);
}

.toast-error {
  border-left: 3px solid #ef4444;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 12px rgba(239, 68, 68, 0.15);
}

.toast-info {
  border-left: 3px solid var(--accent-purple);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 12px rgba(139, 92, 246, 0.15);
}

/* ---- Responsive ---- */
@media (min-width: 480px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .screen-content {
    max-width: 640px;
  }

  .pack-cards {
    gap: var(--space-lg);
  }
}

@media (min-width: 768px) {
  .bottom-nav {
    bottom: auto;
    top: 0;
    height: 56px;
    border-top: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .screen {
    padding-top: 72px;
    padding-bottom: var(--space-xl);
  }

  .nav-item {
    flex-direction: row;
    gap: var(--space-sm);
  }

  .nav-item.active::after {
    top: auto;
    bottom: -1px;
  }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.3), rgba(236, 72, 153, 0.2));
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.5), rgba(236, 72, 153, 0.35));
}

/* ---- Utility ---- */
.hidden {
  display: none !important;
}

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

/* ---- Pack Filter Tabs (Collection) ---- */
.pack-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: var(--space-xs) 0 var(--space-md);
}

.pack-filter-tabs::-webkit-scrollbar {
  display: none;
}

.pack-filter-tab {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  font-family: var(--font-gaming);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  transition: all 0.2s var(--ease-spring);
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.pack-filter-tab:hover {
  color: var(--text-secondary);
  border-color: rgba(255, 255, 255, 0.12);
}

.pack-filter-tab.active {
  color: var(--text-primary);
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.4);
}

.pack-filter-tab-top200.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(239, 68, 68, 0.1));
  border-color: rgba(245, 158, 11, 0.5);
}

/* ---- Top 200 Date Selector ---- */
.top200-date-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-md) 0;
}

.top200-date-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.top200-date-btn:hover:not(:disabled) {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.3);
}

.top200-date-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.top200-date-label {
  font-family: var(--font-card);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 120px;
  text-align: center;
}

/* ---- Top 200 Collection Stats ---- */
.top200-collection-stats {
  text-align: center;
  padding-bottom: var(--space-md);
}

.top200-collection-stats .stat-badge {
  font-family: var(--font-card);
  font-weight: 700;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 0.9rem;
}

/* ---- Top 200 Ranking Grid ---- */
.top200-ranking-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}

@media (min-width: 640px) {
  .top200-ranking-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Top 200 Slot */
.top200-slot {
  position: relative;
  aspect-ratio: 1 / 1;
}

.top200-rank-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  color: var(--text-primary);
  font-family: var(--font-card);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1.2;
}

/* ---- Card Back (未取得スロット) ---- */
.card-back {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.04);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.card-back-pattern {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(45deg,
      transparent,
      transparent 8px,
      rgba(255, 255, 255, 0.015) 8px,
      rgba(255, 255, 255, 0.015) 16px);
  pointer-events: none;
}

.card-back-icon {
  font-size: 2rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.08);
  font-family: var(--font-card);
  margin-bottom: var(--space-sm);
  z-index: 1;
}

.card-back-info {
  z-index: 1;
  text-align: center;
  padding: 0 var(--space-xs);
}

.card-back-title {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.card-back-artist {
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.15s !important;
  }

  .pack-count-current {
    filter: none;
  }

  .btn-open-pack::before,
  .btn-open-pack::after {
    animation: none;
  }

  .daily-bonus-card::before {
    animation: none;
  }

  .music-card:hover {
    transform: scale(1.02);
  }

  .card-rarity-sr::before,
  .card-rarity-ur::before,
  .card-rarity-lr::before {
    animation: none;
  }

  .screen.active {
    animation: none;
  }
}

/* ---- Lucide Icons Base Styles ---- */
/* Lucide createIcons() converts <i data-lucide> to <svg class="lucide lucide-{name}"> */
svg.lucide {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* .lucide-icon wrapper (from JS icon() helper) */
.lucide-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ---- Icon Sizes & Colors ---- */

/* Title icon - purple glow */
.title-icon svg.lucide {
  width: 24px;
  height: 24px;
  color: #a78bfa;
  filter: drop-shadow(0 0 6px rgba(167, 139, 250, 0.5));
}

/* Volume icon - lavender */
.volume-icon svg.lucide {
  width: 20px;
  height: 20px;
  color: #c4b5fd;
}

/* Pack info bar icons */
.pack-info-icon svg.lucide {
  width: 18px;
  height: 18px;
}

/* パック残数アイコン - 紫 */
.pack-info-item:first-child .pack-info-icon svg.lucide {
  color: #a78bfa;
  filter: drop-shadow(0 0 4px rgba(167, 139, 250, 0.4));
}

/* TOP 200アイコン - ゴールド */
.pack-info-item:last-child .pack-info-icon svg.lucide {
  color: #fbbf24;
  filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.5));
}

/* Daily bonus - emerald green glow */
.daily-bonus-icon svg.lucide {
  width: 36px;
  height: 36px;
  color: #34d399;
  filter: drop-shadow(0 0 8px rgba(52, 211, 153, 0.5));
}

/* Empty collection */
.empty-icon svg.lucide {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
}

/* Share receive - purple glow */
.share-receive-icon svg.lucide {
  width: 48px;
  height: 48px;
  color: #c084fc;
  filter: drop-shadow(0 0 10px rgba(192, 132, 252, 0.5));
}

/* Rewarded ad - indigo */
.rewarded-ad-icon svg.lucide {
  width: 40px;
  height: 40px;
  color: #818cf8;
}

/* ---- Pack Filter Tab Icon Colors ---- */
.pack-filter-tab svg.lucide {
  width: 14px;
  height: 14px;
  margin-right: 2px;
}

.pack-filter-tab[data-pack-filter="jpop"] svg.lucide {
  color: #f472b6;
}

.pack-filter-tab[data-pack-filter="kpop"] svg.lucide {
  color: #c084fc;
}

.pack-filter-tab[data-pack-filter="vocaloid"] svg.lucide {
  color: #22d3ee;
}

.pack-filter-tab[data-pack-filter="anime"] svg.lucide {
  color: #fbbf24;
}

.pack-filter-tab[data-pack-filter="hiphop"] svg.lucide {
  color: #fb923c;
}

.pack-filter-tab[data-pack-filter="western"] svg.lucide {
  color: #38bdf8;
}

.pack-filter-tab[data-pack-filter="top200"] svg.lucide {
  color: #f59e0b;
  filter: drop-shadow(0 0 3px rgba(245, 158, 11, 0.5));
}

.pack-filter-tab.active svg.lucide {
  filter: drop-shadow(0 0 4px currentColor) brightness(1.2);
}

/* ---- Modal Service Button Icons ---- */
.btn-apple-music svg.lucide,
.btn-spotify svg.lucide,
.btn-amazon-music svg.lucide,
.btn-youtube svg.lucide,
.btn-share-card svg.lucide {
  width: 16px;
  height: 16px;
}

.btn-apple-music svg.lucide {
  color: #fff;
}

.btn-spotify svg.lucide {
  color: #1db954;
}

.btn-amazon-music svg.lucide {
  color: #ff9900;
}

.btn-youtube svg.lucide {
  color: #ff0000;
}

.btn-share-card svg.lucide {
  color: #818cf8;
}

/* ホームに戻るボタン */
.btn-tertiary svg.lucide {
  width: 16px;
  height: 16px;
  margin-right: 4px;
  color: #a78bfa;
}

/* Favorite heart - red filled */
.card-fav-icon svg.lucide {
  width: 16px;
  height: 16px;
  fill: #ef4444;
  stroke: #ef4444;
  filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.5));
}

/* Pack tag / genre badge */
.pack-tag svg.lucide,
.card-genre-badge svg.lucide {
  width: 14px;
  height: 14px;
  opacity: 0.9;
}

/* Ad pack button */
.btn-ad-pack svg.lucide {
  color: #fbbf24;
}

/* Debug section */
.modal-debug-section svg.lucide {
  width: 14px;
  height: 14px;
  color: #888;
}


/* ---- App Footer ---- */
.app-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(10, 10, 15, 0.6);
  margin-top: var(--space-xl);
}

.footer-content {
  max-width: 540px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
  text-align: center;
}

.footer-settings {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.footer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
}

.footer-item-label {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.footer-item-danger {
  border-color: rgba(239, 68, 68, 0.15);
}

.footer-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: var(--space-sm) 0;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
}

.footer-link {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--text-secondary);
}

.footer-link-danger {
  color: rgba(239, 68, 68, 0.6);
}

.footer-link-danger:hover {
  color: #ef4444;
}

.footer-link-sep {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.15);
}

.footer-credits {
  padding: var(--space-sm) 0;
}

.footer-credits-title {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.footer-credits-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.footer-credit {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer-credit:hover {
  color: var(--text-secondary);
}

.footer-version {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.2);
  padding-top: var(--space-sm);
}

/* ============================================================
   Ad System Styles
   ============================================================ */

/* ---- Ad Container (Banner) ---- */
.ad-container {
  width: 100%;
  max-width: 728px;
  margin: var(--space-md) auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.ad-container:empty {
  display: none;
}

/* パック結果エリアの広告 */
.ad-pack-result {
  margin-top: var(--space-lg);
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(10, 10, 15, 0.3);
}

/* モーダル内広告 */
.ad-modal {
  margin-top: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: var(--space-sm);
  border-radius: 0;
}

/* ---- Interstitial Ad Overlay ---- */
.interstitial-ad-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 350;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.interstitial-ad-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.interstitial-ad-content {
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s var(--ease-spring);
}

.interstitial-ad-overlay.active .interstitial-ad-content {
  transform: scale(1);
}

.interstitial-ad-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.interstitial-ad-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.interstitial-ad-countdown {
  font-family: var(--font-card);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.1);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.interstitial-ad-slot {
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
}

.interstitial-ad-close {
  width: 100%;
  padding: var(--space-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.interstitial-ad-close:hover {
  background: var(--bg-elevated);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

/* ---- Rewarded Ad Overlay ---- */
.rewarded-ad-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 350;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  animation: modalFadeIn 0.3s ease;
}

.rewarded-ad-content {
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.rewarded-ad-header {
  margin-bottom: var(--space-lg);
}

.rewarded-ad-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
  margin-bottom: var(--space-md);
}

.rewarded-ad-title {
  font-family: var(--font-card);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-xs);
}

.rewarded-ad-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.rewarded-ad-slot {
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-lg);
}

.rewarded-ad-countdown-area {
  margin-bottom: var(--space-lg);
}

.rewarded-ad-countdown {
  font-family: var(--font-card);
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-purple);
  margin-bottom: var(--space-sm);
}

.rewarded-ad-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
}

.rewarded-ad-progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 2px;
  transition: width 1s linear;
}

.rewarded-ad-close {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  border: none;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.rewarded-ad-close:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}