/* @property for SSR animated conic-gradient border */
@property --ssr-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

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

:root {
  --bg-primary: #0d0d0d;
  --bg-secondary: #1a1a2e;
  --bg-card: #16213e;
  --text-primary: #e0e0e0;
  --text-secondary: #888;
  --accent: #e040fb;
  --accent-glow: rgba(224, 64, 251, 0.4);
  --gold: #ffd700;
  --rarity-n: #aaaaaa;
  --rarity-r: #4fc3f7;
  --rarity-sr: #ffb74d;
  --rarity-ssr: #ff4081;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  cursor: url('../assets/cursor-default.svg') 2 1, auto;
}

body {
  font-family: 'Segoe UI', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Custom cursor - pointer for interactive */
a, button, [role="button"], .pack-card, .collection-card.obtained, .collection-tab,
.settings-toggle, .settings-action-btn, .settings-btn, .lang-toggle-btn, #gacha-btn, #multi-pull-btn,
#result-close-btn, #result-share-btn, #multi-result-close-btn,
#ad-close-btn, #collection-detail-close, #age-yes, #age-no,
.age-gate-buttons button, .settings-close-btn, .share-btn {
  cursor: url('../assets/cursor-pointer.svg') 6 1, pointer !important;
}

#gacha-btn:disabled, #ad-close-btn:disabled {
  cursor: url('../assets/cursor-default.svg') 2 1, not-allowed !important;
}

/* ==============================
   Background (Lightweight gradient)
   ============================== */
.mosaic-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(124,77,255,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(224,64,251,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(255,215,0,0.03) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

/* Content above background */
.site-header, .ad-banner, .gacha-stage, .gacha-btn-wrap,
.pack-section, .collection-section, .stats-section, .history-section, .site-footer,
.age-gate, .result-modal, .ad-overlay, .settings-modal, .collection-modal {
  position: relative;
  z-index: 1;
}

/* ==============================
   Age Gate
   ============================== */
.age-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
  text-align: center;
  padding: 20px;
}

.age-gate h2 {
  font-size: 1.5rem;
  color: #fff;
}

.age-gate p {
  color: var(--text-secondary);
  max-width: 360px;
  line-height: 1.6;
}

.age-gate-buttons {
  display: flex;
  gap: 16px;
}

.age-gate-buttons button {
  padding: 12px 32px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}

.age-gate-buttons button:active {
  transform: scale(0.95);
}

#age-yes {
  background: var(--accent);
  color: #fff;
}

#age-no {
  background: #333;
  color: #aaa;
}

/* ==============================
   Header
   ============================== */
.site-header {
  text-align: center;
  padding: 24px 16px 8px;
  position: relative;
  background: linear-gradient(135deg, rgba(26,17,37,0.95), rgba(13,13,13,0.95));
  border-bottom: 1px solid rgba(224,64,251,0.15);
  overflow: hidden;
}

.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(224,64,251,0.06), rgba(255,215,0,0.04), transparent);
  background-size: 200% 100%;
  animation: headerShimmer 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes headerShimmer {
  0%, 100% { background-position: -200% 0; }
  50% { background-position: 200% 0; }
}

.site-header h1 {
  font-size: 1.6rem;
  background: linear-gradient(135deg, var(--accent), var(--gold), var(--accent));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleGradient 4s ease-in-out infinite;
  text-shadow: none;
  filter: drop-shadow(0 0 12px rgba(224,64,251,0.3));
}

@keyframes titleGradient {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 200% center; }
}

.header-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
}

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

/* Streak */
.streak-display {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--rarity-sr);
  background: rgba(255,183,77,0.1);
  padding: 2px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,183,77,0.2);
}

.streak-display.rainbow {
  border-color: var(--rarity-ssr);
  animation: streakRainbow 2s linear infinite;
}

@keyframes streakRainbow {
  0% { border-color: #ff4081; }
  33% { border-color: #e040fb; }
  66% { border-color: #7c4dff; }
  100% { border-color: #ff4081; }
}

.streak-icon { font-size: 1em; }
.streak-count { font-weight: 700; }

/* Header Buttons */
.header-buttons {
  position: absolute;
  top: 20px;
  right: 16px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.lang-toggle-btn {
  background: none;
  border: 1px solid #333;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lang-toggle-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent);
  background: rgba(224,64,251,0.1);
}

.lang-flag {
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

.settings-btn {
  background: none;
  border: 1px solid #333;
  color: var(--text-secondary);
  font-size: 1.4rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}

/* ==============================
   Settings Modal
   ============================== */
.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

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

.settings-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  max-width: 400px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
}

.settings-card h2 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 1.2rem;
}

.settings-group {
  margin-bottom: 20px;
}

.settings-group h3 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

/* Toggle Switch */
.settings-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 0.9rem;
  cursor: pointer;
}

.settings-toggle input {
  display: none;
}

.toggle-slider {
  width: 44px;
  height: 24px;
  background: #333;
  border-radius: 12px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #888;
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}

.settings-toggle input:checked + .toggle-slider {
  background: var(--accent);
}

.settings-toggle input:checked + .toggle-slider::after {
  transform: translateX(20px);
  background: #fff;
}

/* Language label */
.lang-label {
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--accent);
  margin-left: 8px;
  min-width: 20px;
}

/* Rates Display */
.settings-rates {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-rate-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  padding: 4px 0;
}

.settings-rate-row .rate-label {
  font-weight: bold;
}

.settings-rate-row .rate-value {
  color: var(--text-secondary);
}

/* Action Buttons */
.settings-action-btn {
  display: block;
  width: 100%;
  padding: 10px;
  margin-bottom: 8px;
  background: #1e2a4a;
  color: var(--text-primary);
  border: 1px solid #333;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.settings-action-btn:hover {
  background: #2a3a5a;
}

.settings-action-btn.danger {
  border-color: #c62828;
  color: #ef5350;
}

.settings-action-btn.danger:hover {
  background: #3a1a1a;
}

.settings-close-btn {
  display: block;
  width: 100%;
  padding: 12px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 8px;
}

/* ==============================
   Pack Selector
   ============================== */
.pack-section {
  max-width: 600px;
  margin: 16px auto;
  padding: 0 16px;
}

.pack-selector {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}

.pack-selector::-webkit-scrollbar {
  height: 4px;
}

.pack-selector::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}

.pack-card {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 2px solid transparent;
  border-radius: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  min-width: 110px;
}

.pack-card:hover {
  border-color: #444;
  transform: translateY(-2px);
}

.pack-card.active {
  border-color: var(--accent);
  color: var(--text-primary);
  box-shadow: 0 0 16px var(--accent-glow);
}

.pack-card.coming-soon {
  opacity: 0.45;
  cursor: url('../assets/cursor-default.svg') 2 1, not-allowed !important;
  filter: grayscale(0.5);
}

.pack-card.coming-soon:hover {
  border-color: transparent;
  transform: none;
}

.pack-card.coming-soon .pack-desc {
  color: var(--gold);
  font-weight: bold;
  font-size: 0.6rem;
  letter-spacing: 1px;
}

.pack-icon {
  font-size: 1.6rem;
}

.pack-name {
  font-size: 0.8rem;
  font-weight: bold;
  white-space: nowrap;
}

.pack-desc {
  font-size: 0.7rem;
  opacity: 0.6;
}

/* ==============================
   Gacha Stage
   ============================== */
.gacha-stage {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 24px auto;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 16px;
  background: var(--bg-secondary);
}

.gacha-orb {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #555, #222);
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.05);
  transition: transform 0.3s, box-shadow 0.3s;
}

/* Animating states */
.gacha-stage.animating .gacha-orb {
  animation: orbSpin 0.6s ease-in-out infinite;
}

.gacha-stage.rarity-n.animating .gacha-orb {
  box-shadow: 0 0 40px var(--rarity-n);
}

.gacha-stage.rarity-r.animating .gacha-orb {
  box-shadow: 0 0 60px var(--rarity-r);
  animation: orbSpin 0.5s ease-in-out infinite;
}

.gacha-stage.rarity-sr.animating .gacha-orb {
  box-shadow: 0 0 80px var(--rarity-sr);
  animation: orbSpin 0.4s ease-in-out infinite, orbPulse 0.8s ease-in-out infinite;
}

.gacha-stage.rarity-ssr.animating .gacha-orb {
  box-shadow: 0 0 100px var(--rarity-ssr), 0 0 200px var(--accent-glow);
  animation: orbSpin 0.3s ease-in-out infinite, orbPulse 0.5s ease-in-out infinite, rainbowShift 1s linear infinite;
}

.gacha-stage.rarity-ssr.animating {
  animation: screenShake 0.15s ease-in-out infinite;
}

.gacha-stage.rarity-ssr.animating::after {
  content: '';
  position: absolute;
  inset: -20px;
  background: conic-gradient(from 0deg, #ff0000, #ff8800, #ffff00, #00ff00, #0088ff, #8800ff, #ff0088, #ff0000);
  opacity: 0.15;
  border-radius: 16px;
  animation: rainbowRotate 1s linear infinite;
  pointer-events: none;
}

@keyframes orbSpin {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.1); }
}

@keyframes orbPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.5); }
}

@keyframes rainbowShift {
  0% { background: radial-gradient(circle at 35% 35%, #ff4081, #7c4dff); }
  25% { background: radial-gradient(circle at 35% 35%, #e040fb, #448aff); }
  50% { background: radial-gradient(circle at 35% 35%, #18ffff, #69f0ae); }
  75% { background: radial-gradient(circle at 35% 35%, #ffff00, #ff9800); }
  100% { background: radial-gradient(circle at 35% 35%, #ff4081, #7c4dff); }
}

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

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

/* Particles */
.particle {
  position: absolute;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  opacity: 0;
  animation: particleBurst 1s var(--delay, 0s) ease-out forwards;
  pointer-events: none;
}

@keyframes particleBurst {
  0% {
    transform: translate(0, 0) scale(0);
    opacity: 1;
  }
  100% {
    transform: translate(var(--x), var(--y)) scale(1);
    opacity: 0;
  }
}

/* ==============================
   Gacha Button
   ============================== */
.gacha-btn-wrap {
  text-align: center;
  padding: 8px 16px 24px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

#gacha-btn, #multi-pull-btn {
  display: inline-block;
  padding: 16px 48px;
  font-size: 1.2rem;
  font-weight: bold;
  color: #fff;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  overflow: hidden;
}

#gacha-btn {
  background: linear-gradient(135deg, var(--accent), #7c4dff);
  box-shadow: 0 4px 20px var(--accent-glow);
  animation: btnPulse 2.5s ease-in-out infinite;
}

#gacha-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: btnHoloSweep 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes btnPulse {
  0%, 100% { box-shadow: 0 4px 20px var(--accent-glow); }
  50% { box-shadow: 0 4px 35px var(--accent-glow), 0 0 60px rgba(224,64,251,0.15); }
}

@keyframes btnHoloSweep {
  0% { left: -100%; }
  50%, 100% { left: 150%; }
}

#multi-pull-btn {
  background: linear-gradient(135deg, var(--gold), #ff9800, var(--gold));
  background-size: 200% auto;
  box-shadow: 0 4px 20px rgba(255,215,0,0.25);
  animation: multiBtnShine 3s ease-in-out infinite;
  padding: 16px 36px;
  font-size: 1.1rem;
}

@keyframes multiBtnShine {
  0%, 100% { background-position: 0% center; box-shadow: 0 4px 20px rgba(255,215,0,0.25); }
  50% { background-position: 200% center; box-shadow: 0 4px 30px rgba(255,215,0,0.4); }
}

#gacha-btn:hover:not(:disabled), #multi-pull-btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

#gacha-btn:hover:not(:disabled) {
  box-shadow: 0 6px 30px var(--accent-glow);
}

#multi-pull-btn:hover:not(:disabled) {
  box-shadow: 0 6px 30px rgba(255,215,0,0.4);
}

#gacha-btn:active:not(:disabled), #multi-pull-btn:active:not(:disabled) {
  transform: scale(0.96);
}

#gacha-btn:disabled, #multi-pull-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  animation: none;
}

/* Daily FREE badge on gacha button */
#gacha-btn.daily-free::after {
  content: 'FREE';
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, #4caf50, #66bb6a);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  animation: freeBadgePulse 1.5s ease-in-out infinite;
  letter-spacing: 0.05em;
}

@keyframes freeBadgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); box-shadow: 0 0 12px rgba(76,175,80,0.5); }
}

/* ==============================
   Banner Ad Slot
   ============================== */
.ad-banner {
  max-width: 728px;
  margin: 0 auto 24px;
  padding: 0 16px;
}

.ad-slot {
  background: var(--bg-card);
  border: 1px dashed #333;
  border-radius: 8px;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.8rem;
  overflow: hidden;
}

.ad-slot-label {
  opacity: 0.5;
}

/* ==============================
   Result Modal
   ============================== */
.result-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

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

.result-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  max-width: 360px;
  width: 100%;
  animation: resultPop 0.4s ease-out;
  margin: auto 0;
  flex-shrink: 0;
}

.result-modal.ssr-glow .result-card {
  box-shadow: 0 0 40px var(--rarity-ssr), 0 0 80px rgba(255, 64, 129, 0.3);
  animation: resultPop 0.4s ease-out, ssrGlowPulse 1.5s ease-in-out infinite;
}

@keyframes resultPop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes ssrGlowPulse {
  0%, 100% { box-shadow: 0 0 40px var(--rarity-ssr), 0 0 80px rgba(255, 64, 129, 0.3); }
  50% { box-shadow: 0 0 60px var(--rarity-ssr), 0 0 120px rgba(255, 64, 129, 0.5); }
}

.result-image-wrap {
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 16px;
  background: #111;
  position: relative;
}

/* NEW!! Badge */
.new-badge {
  position: absolute;
  top: 12px;
  right: -40px;
  padding: 6px 48px;
  background: linear-gradient(135deg, #ff4081, #ff6e40, #ffd740);
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 2px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  transform: rotate(30deg);
  box-shadow: 0 4px 16px rgba(255, 64, 129, 0.5);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: none;
}

.new-badge.active {
  opacity: 1;
  animation: newBadgePop 0.5s ease-out, newBadgeGlow 1.2s 0.5s ease-in-out infinite;
}

@keyframes newBadgePop {
  0% { transform: rotate(30deg) scale(0); opacity: 0; }
  60% { transform: rotate(30deg) scale(1.3); opacity: 1; }
  100% { transform: rotate(30deg) scale(1); opacity: 1; }
}

@keyframes newBadgeGlow {
  0%, 100% {
    box-shadow: 0 4px 16px rgba(255, 64, 129, 0.5);
    background: linear-gradient(135deg, #ff4081, #ff6e40, #ffd740);
  }
  50% {
    box-shadow: 0 4px 28px rgba(255, 64, 129, 0.8), 0 0 40px rgba(255, 215, 64, 0.4);
    background: linear-gradient(135deg, #ffd740, #ff4081, #e040fb);
  }
}

.result-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-name {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 4px;
}

.result-pack-name {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.rarity-badge {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: bold;
  color: #fff;
}

.rarity-badge.rarity-ssr {
  animation: rainbowBadge 2s linear infinite;
}

@keyframes rainbowBadge {
  0% { background: #ff4081; }
  25% { background: #e040fb; }
  50% { background: #7c4dff; }
  75% { background: #448aff; }
  100% { background: #ff4081; }
}

#result-close-btn {
  margin-top: 16px;
  padding: 10px 32px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
}

.result-ad-slot {
  margin-top: 16px;
}

/* ==============================
   Ad Overlay (Interstitial)
   ============================== */
.ad-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

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

.ad-overlay-content {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 24px;
  max-width: 500px;
  width: 100%;
  text-align: center;
}

.ad-overlay-content h3 {
  margin-bottom: 16px;
  color: var(--gold);
}

.ad-overlay-slot {
  min-height: 250px;
  background: #111;
  border: 1px dashed #444;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  overflow: hidden;
}

#ad-close-btn {
  padding: 12px 32px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.2s;
}

#ad-close-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==============================
   Stats Section
   ============================== */
.stats-section {
  max-width: 500px;
  margin: 0 auto 24px;
  padding: 0 16px;
}

.stats-section h2 {
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.stats-panel {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.stats-row .label {
  color: var(--text-secondary);
}

.stats-row .value {
  font-weight: bold;
}

.stats-rarity-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rarity-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}

.rarity-bar-label {
  width: 32px;
  font-weight: bold;
  text-align: center;
  flex-shrink: 0;
}

.rarity-bar-track {
  flex: 1;
  height: 8px;
  background: #111;
  border-radius: 4px;
  overflow: hidden;
}

.rarity-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.rarity-bar-pct {
  width: 42px;
  text-align: right;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.completion-bar-track {
  height: 12px;
  background: #111;
  border-radius: 6px;
  overflow: hidden;
}

.completion-bar-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width 0.4s ease;
}

.completion-bar-fill--all {
  background: linear-gradient(90deg, #4fc3f7, #69f0ae);
}

/* ==============================
   History Section
   ============================== */
.history-section {
  max-width: 500px;
  margin: 0 auto 40px;
  padding: 0 16px;
}

.history-section h2 {
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border-radius: 8px;
  padding: 8px 12px;
}

.history-item img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background: #111;
}

.history-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-name {
  font-size: 0.9rem;
}

.history-rarity {
  font-size: 0.75rem;
  font-weight: bold;
}

.history-pack {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.empty-history {
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: center;
  padding: 20px;
}

/* ==============================
   Collection Section
   ============================== */
.collection-section {
  max-width: 600px;
  margin: 0 auto 24px;
  padding: 0 16px;
  position: relative;
  z-index: 1;
}

.collection-section h2 {
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

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

/* Tabs */
.collection-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}

.collection-tab {
  padding: 6px 16px;
  background: var(--bg-card);
  border: 1px solid transparent;
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s;
}

.collection-tab:hover {
  border-color: #444;
}

.collection-tab.active {
  border-color: var(--accent);
  color: var(--text-primary);
}

.collection-tab.coming-soon {
  opacity: 0.4;
  filter: grayscale(1);
  cursor: url('../assets/cursor-default.svg') 2 1, not-allowed !important;
  pointer-events: none;
}

.collection-tab.coming-soon .tab-soon-label {
  display: block;
  font-size: 0.55em;
  color: var(--rarity-sr);
  letter-spacing: 0.05em;
  margin-top: 1px;
}

/* Grid */
.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}

.collection-card {
  position: relative;
  background: var(--bg-card);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid transparent;
}

.collection-card:hover {
  transform: translateY(-3px);
}

.collection-card.locked {
  cursor: default;
}

.collection-card.locked:hover {
  transform: none;
}

/* ---- SR sparkle ---- */
.collection-card.obtained.rarity-sr {
  border-color: var(--rarity-sr);
  box-shadow: 0 0 10px rgba(255, 183, 77, 0.35), 0 0 20px rgba(255, 183, 77, 0.15);
  animation: srPulse 2.5s ease-in-out infinite;
}

.collection-card.obtained.rarity-sr::before {
  content: '';
  position: absolute;
  inset: -2px;
  z-index: 2;
  pointer-events: none;
  border-radius: 10px;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 215, 0, 0.25) 45%,
    rgba(255, 255, 255, 0.35) 50%,
    rgba(255, 215, 0, 0.25) 55%,
    transparent 70%
  );
  background-size: 250% 100%;
  animation: srShimmer 3s ease-in-out infinite;
}

@keyframes srPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 183, 77, 0.35), 0 0 20px rgba(255, 183, 77, 0.15); }
  50% { box-shadow: 0 0 18px rgba(255, 183, 77, 0.55), 0 0 36px rgba(255, 183, 77, 0.25); }
}

@keyframes srShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---- SSR mega sparkle ---- */
.collection-card.obtained.rarity-ssr {
  border: 2px solid transparent;
  animation: ssrBorderRainbow 2s linear infinite, ssrMegaPulse 1.8s ease-in-out infinite;
}

/* Rainbow rotating border via background-clip trick */
.collection-card.obtained.rarity-ssr {
  background:
    linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
    conic-gradient(from var(--ssr-angle, 0deg), #ff4081, #e040fb, #7c4dff, #448aff, #18ffff, #69f0ae, #ffd740, #ff6e40, #ff4081) border-box;
  animation: ssrBorderSpin 2s linear infinite, ssrMegaPulse 1.8s ease-in-out infinite;
}

/* Holographic shimmer overlay */
.collection-card.obtained.rarity-ssr::before {
  content: '';
  position: absolute;
  inset: -2px;
  z-index: 2;
  pointer-events: none;
  border-radius: 10px;
  background: linear-gradient(
    105deg,
    transparent 20%,
    rgba(255, 64, 129, 0.15) 30%,
    rgba(224, 64, 251, 0.2) 38%,
    rgba(255, 255, 255, 0.4) 50%,
    rgba(68, 138, 255, 0.2) 62%,
    rgba(24, 255, 255, 0.15) 70%,
    transparent 80%
  );
  background-size: 300% 100%;
  animation: ssrHoloShimmer 2.5s ease-in-out infinite;
}

/* Sparkle particles overlay */
.collection-card.obtained.rarity-ssr::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: 10px;
  background-image:
    radial-gradient(circle at 20% 20%, #fff 1px, transparent 1px),
    radial-gradient(circle at 70% 15%, #ffd740 1px, transparent 1px),
    radial-gradient(circle at 85% 60%, #fff 1px, transparent 1px),
    radial-gradient(circle at 30% 75%, #18ffff 1px, transparent 1px),
    radial-gradient(circle at 55% 45%, #fff 1.2px, transparent 1.2px),
    radial-gradient(circle at 10% 50%, #e040fb 0.8px, transparent 0.8px),
    radial-gradient(circle at 90% 85%, #ffd740 1px, transparent 1px),
    radial-gradient(circle at 45% 90%, #fff 0.8px, transparent 0.8px);
  animation: ssrSparkleFlicker 1.5s steps(2) infinite;
}

@keyframes ssrBorderSpin {
  to { --ssr-angle: 360deg; }
}

/* Fallback for browsers not supporting @property */
@supports not (background: conic-gradient(from 0deg, red, blue)) {
  .collection-card.obtained.rarity-ssr {
    border-color: var(--rarity-ssr);
  }
}

@keyframes ssrMegaPulse {
  0%, 100% {
    box-shadow:
      0 0 14px rgba(255, 64, 129, 0.5),
      0 0 30px rgba(224, 64, 251, 0.3),
      0 0 50px rgba(124, 77, 255, 0.15);
  }
  50% {
    box-shadow:
      0 0 22px rgba(255, 64, 129, 0.7),
      0 0 44px rgba(224, 64, 251, 0.45),
      0 0 70px rgba(124, 77, 255, 0.25),
      0 0 90px rgba(68, 138, 255, 0.12);
  }
}

@keyframes ssrHoloShimmer {
  0%   { background-position: 300% 0; opacity: 0.7; }
  50%  { opacity: 1; }
  100% { background-position: -300% 0; opacity: 0.7; }
}

@keyframes ssrSparkleFlicker {
  0%   { opacity: 0.9; }
  50%  { opacity: 0.3; }
  100% { opacity: 0.9; }
}

/* Animated sparkle particles (JS-spawned) */
.card-sparkle {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  width: var(--sparkle-size, 4px);
  height: var(--sparkle-size, 4px);
  background: var(--sparkle-color, #fff);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--sparkle-color, #fff), 0 0 12px var(--sparkle-color, #fff);
  animation: sparkleFloat 1.2s ease-out forwards;
}

.card-sparkle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200%;
  height: 1px;
  background: var(--sparkle-color, #fff);
  opacity: 0.6;
}

.card-sparkle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 1px;
  height: 200%;
  background: var(--sparkle-color, #fff);
  opacity: 0.6;
}

@keyframes sparkleFloat {
  0% {
    opacity: 0;
    transform: scale(0) translateY(0);
  }
  30% {
    opacity: 1;
    transform: scale(1.2) translateY(-4px);
  }
  70% {
    opacity: 0.8;
    transform: scale(1) translateY(-10px);
  }
  100% {
    opacity: 0;
    transform: scale(0.3) translateY(-18px);
  }
}

.collection-card-img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
  background: #111;
}

.collection-card.locked .collection-card-img {
  filter: brightness(0) saturate(0);
  opacity: 0.2;
}

.collection-card-info {
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.collection-card-name {
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.collection-card.locked .collection-card-name {
  color: var(--text-secondary);
}

.collection-card-rarity {
  font-size: 0.65rem;
  font-weight: bold;
}

.collection-card-count {
  font-size: 0.6rem;
  color: var(--text-secondary);
}

.collection-card-lock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #333;
  pointer-events: none;
}

/* Collection Detail Modal */
.collection-modal {
  position: fixed;
  inset: 0;
  z-index: 7000;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

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

.collection-detail-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  animation: resultPop 0.4s ease-out;
}

.collection-modal.detail-sr .collection-detail-card {
  box-shadow: 0 0 30px rgba(255, 183, 77, 0.3), 0 0 60px rgba(255, 183, 77, 0.1);
  border: 1px solid rgba(255, 183, 77, 0.3);
}

.collection-modal.detail-ssr .collection-detail-card {
  box-shadow: 0 0 40px rgba(255, 64, 129, 0.4), 0 0 80px rgba(224, 64, 251, 0.2);
  animation: resultPop 0.4s ease-out, ssrGlowPulse 1.5s ease-in-out infinite;
  border: 1px solid rgba(255, 64, 129, 0.4);
}

/* 3D Card Viewer */
.card-viewer-scene {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 3/4;
  margin: 0 auto 8px;
  perspective: 800px;
}

.card-viewer {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.1s linear;
  cursor: url('../assets/cursor-pointer.svg') 6 1, grab;
}

.card-viewer.dragging {
  transition: none;
  cursor: url('../assets/cursor-pointer.svg') 6 1, grabbing;
}

.card-viewer-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

.card-viewer-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-viewer-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0d0d0d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-back-design {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px;
  border: 2px solid #333;
  border-radius: 8px;
  width: 70%;
  aspect-ratio: 3/4;
  justify-content: center;
  background:
    repeating-linear-gradient(45deg, transparent, transparent 8px, rgba(255,255,255,0.015) 8px, rgba(255,255,255,0.015) 16px),
    radial-gradient(ellipse at center, rgba(224,64,251,0.08), transparent 70%);
}

.card-back-logo {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 4px;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.card-back-rarity {
  font-size: 1rem;
  font-weight: bold;
  letter-spacing: 2px;
}

.card-viewer-hint {
  font-size: 0.7rem;
  color: var(--text-secondary);
  opacity: 0.6;
  margin-bottom: 10px;
}

/* Holographic sheen on front face during rotation */
.card-viewer-front::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 10px;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255,255,255,0.08) 45%,
    rgba(255,255,255,0.15) 50%,
    rgba(255,255,255,0.08) 55%,
    transparent 70%
  );
  background-size: 300% 300%;
  background-position: var(--sheen-x, 50%) var(--sheen-y, 50%);
  transition: background-position 0.1s linear;
}

.collection-detail-name {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 6px;
}

.collection-detail-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 8px;
  margin-bottom: 4px;
}

/* ==============================
   Footer
   ============================== */
.site-footer {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  border-top: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent, var(--accent), var(--gold), var(--accent), transparent) 1;
}

/* ==============================
   Ambient Particles
   ============================== */
.ambient-particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ambient-particle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(224,64,251,0.5), transparent 70%);
  opacity: 0;
  animation: ambientFloat linear infinite;
  pointer-events: none;
}

@keyframes ambientFloat {
  0% { opacity: 0; transform: translateY(100vh) scale(0.5); }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(-20vh) scale(1); }
}

/* ==============================
   Pity Counter
   ============================== */
.pity-section {
  max-width: 400px;
  margin: 0 auto;
  padding: 0 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.pity-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pity-label {
  font-size: 0.65rem;
  color: var(--text-secondary);
  min-width: 56px;
  text-align: right;
}

.pity-bar-track {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
}

.pity-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.pity-bar-fill.pity-sr {
  background: linear-gradient(90deg, var(--rarity-sr), #ffd740);
}

.pity-bar-fill.pity-ssr {
  background: linear-gradient(90deg, var(--rarity-ssr), #e040fb, #7c4dff);
}

.pity-bar-fill.pity-full {
  animation: pityGlow 0.8s ease-in-out infinite alternate;
}

@keyframes pityGlow {
  0% { filter: brightness(1); }
  100% { filter: brightness(1.5); box-shadow: 0 0 8px currentColor; }
}

.pity-text {
  font-size: 0.65rem;
  color: var(--text-secondary);
  min-width: 40px;
}

/* ==============================
   Daily Bonus
   ============================== */
.daily-bonus-bar {
  max-width: 400px;
  margin: 0 auto 4px;
  padding: 6px 16px;
  text-align: center;
  border-radius: 8px;
  background: rgba(76,175,80,0.1);
  border: 1px solid rgba(76,175,80,0.25);
  position: relative;
  z-index: 1;
}

.daily-bonus-bar.available {
  animation: dailyPulse 2s ease-in-out infinite;
  border-color: rgba(76,175,80,0.5);
}

@keyframes dailyPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(76,175,80,0); }
  50% { box-shadow: 0 0 16px 2px rgba(76,175,80,0.2); }
}

.daily-bonus-text {
  font-size: 0.8rem;
  color: #81c784;
  font-weight: 600;
}

.daily-timer {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-left: 8px;
  font-variant-numeric: tabular-nums;
}

/* ==============================
   Share Button
   ============================== */
.result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}

.share-btn {
  display: inline-block;
  padding: 10px 24px;
  font-size: 0.9rem;
  font-weight: bold;
  color: #fff;
  background: linear-gradient(135deg, #1da1f2, #0d8ed6);
  border: none;
  border-radius: 50px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.share-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(29,161,242,0.3);
}

.share-btn.glow {
  animation: shareGlow 1.5s ease-in-out infinite;
}

@keyframes shareGlow {
  0%, 100% { box-shadow: 0 2px 8px rgba(29,161,242,0.2); }
  50% { box-shadow: 0 2px 24px rgba(29,161,242,0.5), 0 0 40px rgba(29,161,242,0.15); }
}

/* ==============================
   Confetti
   ============================== */
.confetti-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 10;
}

.confetti-piece {
  position: absolute;
  top: -10px;
  width: 8px;
  height: 12px;
  opacity: 0;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(var(--fall-dist, 400px)) rotate(var(--spin, 720deg)) scale(0.5); }
}

/* ==============================
   Multi-Pull Results
   ============================== */
.multi-result-modal {
  z-index: 1001;
}

.multi-result-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  max-width: 600px;
  width: 95%;
  max-height: 85vh;
  overflow-y: auto;
  animation: resultPop 0.4s ease-out;
  scrollbar-width: thin;
}

.multi-result-title {
  font-size: 1.2rem;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.multi-result-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.multi-result-item {
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 6px;
  border: 1px solid rgba(255,255,255,0.06);
  opacity: 0;
  animation: multiCardReveal 0.4s ease-out forwards;
  animation-delay: var(--reveal-delay, 0s);
  transition: transform 0.2s;
}

.multi-result-item:hover {
  transform: scale(1.05);
}

.multi-result-item.rarity-sr {
  border-color: var(--rarity-sr);
  box-shadow: 0 0 10px rgba(255,183,77,0.2);
}

.multi-result-item.rarity-ssr {
  border-color: var(--rarity-ssr);
  box-shadow: 0 0 15px rgba(255,64,129,0.3);
  animation: multiCardReveal 0.4s ease-out forwards, ssrGlowPulse 1.5s 0.5s ease-in-out infinite;
  animation-delay: var(--reveal-delay, 0s);
}

.multi-result-item .new-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 0.45rem;
  padding: 1px 4px;
}

@keyframes multiCardReveal {
  0% { opacity: 0; transform: scale(0.5) rotateY(90deg); }
  60% { transform: scale(1.05) rotateY(-5deg); }
  100% { opacity: 1; transform: scale(1) rotateY(0); }
}

.multi-result-item img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.multi-result-item .multi-item-name {
  font-size: 0.55rem;
  color: var(--text-secondary);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-result-item .multi-item-rarity {
  font-size: 0.6rem;
  font-weight: 700;
}

/* ==============================
   Responsive
   ============================== */
@media (max-width: 480px) {
  .site-header h1 {
    font-size: 1.3rem;
  }

  .gacha-stage {
    max-width: 90vw;
  }

  #gacha-btn {
    padding: 14px 40px;
    font-size: 1.1rem;
  }

  /* Mobile result modal fix - ensure scrollable */
  .result-modal {
    padding: 12px;
    align-items: flex-start;
  }

  .result-card {
    padding: 16px;
    margin: 12px 0;
    max-height: none;
  }

  .result-image-wrap {
    aspect-ratio: 3/4;
    max-height: 45vh;
    width: auto;
    margin: 0 auto 12px;
  }

  .result-image-wrap img {
    object-fit: contain;
  }

  .result-ad-slot {
    margin-top: 12px;
  }

  .result-ad-slot .ad-slot {
    min-height: 60px;
  }

  .result-actions {
    margin-top: 8px;
    flex-wrap: wrap;
  }

  #result-close-btn, .share-btn {
    padding: 10px 24px;
    font-size: 0.85rem;
  }

  .pack-card {
    padding: 10px 14px;
    min-width: 90px;
  }

  .collection-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
  }

  .multi-result-modal {
    padding: 12px;
  }

  .multi-result-card {
    padding: 14px;
    max-height: 90vh;
  }

  .multi-result-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  #multi-pull-btn {
    padding: 12px 28px;
    font-size: 1rem;
  }

  .gacha-btn-wrap {
    gap: 8px;
  }

  .header-meta {
    flex-direction: column;
    gap: 4px;
  }
}
