/* ═══════════════════════════════════════════════════════════════════════════
   Silver Fox Gacha — Web Experience
   Dark theme, card game aesthetic, mobile-first
   ═══════════════════════════════════════════════════════════════════════════ */

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

:root {
  --bg-primary: #0a0a1a;
  --bg-secondary: #12122a;
  --bg-card: #1a1a3a;
  --bg-card-hover: #22224a;
  --bg-surface: #16162e;
  --text-primary: #e8e8f0;
  --text-secondary: #8888aa;
  --text-muted: #555577;
  --accent: #ff6b2b;
  --accent-glow: rgba(255, 107, 43, 0.3);
  --gold: #ffd700;
  --gold-glow: rgba(255, 215, 0, 0.3);
  --border: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.12);

  /* Rarity colors */
  --common: #9e9e9e;
  --uncommon: #4caf50;
  --rare: #2196f3;
  --epic: #9c27b0;
  --legendary: #ff9800;
  --mythic: #f44336;

  --sidebar-width: 260px;
  --header-height: 64px;
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ─── Landing Page ───────────────────────────────────────────────────────── */
.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 107, 43, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(255, 215, 0, 0.05) 0%, transparent 50%),
    var(--bg-primary);
  text-align: center;
  padding: 2rem;
}

.landing-logo {
  font-family: 'Orbitron', monospace;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
  letter-spacing: -1px;
}

.landing-sub {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  max-width: 500px;
}

.login-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 40px;
  background: #5865F2;
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  box-shadow: 0 4px 24px rgba(88, 101, 242, 0.3);
}
.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(88, 101, 242, 0.5);
}
.login-btn svg { width: 24px; height: 24px; fill: white; }

.landing-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 4rem;
  max-width: 800px;
  width: 100%;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}
.feature-card .icon { font-size: 2rem; margin-bottom: 0.75rem; }
.feature-card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.feature-card p { font-size: 0.85rem; color: var(--text-secondary); }

/* ─── App Layout ─────────────────────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand {
  font-family: 'Orbitron', monospace;
  font-size: 1.1rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem;
  overflow-y: auto;
}
.nav-section {
  margin-bottom: 1.5rem;
}
.nav-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  font-weight: 500;
  user-select: none;
}
.nav-item:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-item.active { background: var(--accent); color: white; }
.nav-item .icon { font-size: 1.1rem; width: 24px; text-align: center; }
.nav-item .badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
}
.nav-item.active .badge { background: rgba(255,255,255,0.25); }

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
}
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--accent);
}
.user-name { font-size: 0.85rem; font-weight: 600; }
.user-coins { font-size: 0.75rem; color: var(--gold); }
.logout-btn {
  display: block;
  margin-top: 0.75rem;
  padding: 6px 12px;
  background: none;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
}
.logout-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ─── Main Content ───────────────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
}

.page-header {
  padding: 2rem 2rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}
.page-title {
  font-family: 'Orbitron', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.page-subtitle { color: var(--text-secondary); font-size: 0.9rem; }

.page-content { padding: 1.5rem 2rem; }

/* ─── Page: Dashboard ────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}
.stat-value {
  font-family: 'Orbitron', monospace;
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}
.stat-label { color: var(--text-secondary); font-size: 0.85rem; }
.stat-icon {
  position: absolute;
  top: 1rem; right: 1rem;
  font-size: 1.5rem;
  opacity: 0.3;
}

/* ─── Action Buttons Row ─────────────────────────────────────────────────── */
.actions-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.action-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255,255,255,0.1));
  opacity: 0;
  transition: opacity 0.3s;
}
.action-btn:hover::after { opacity: 1; }
.action-btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #ff8f5b);
  color: white;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.btn-gold {
  background: linear-gradient(135deg, #b8860b, var(--gold));
  color: #1a1a2e;
  box-shadow: 0 4px 16px var(--gold-glow);
}
.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}
.btn-disabled {
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: not-allowed;
  border: 1px solid var(--border);
}

/* ─── Page: Collection ───────────────────────────────────────────────────── */
.collection-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.search-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-muted); }

.filter-btn {
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: capitalize;
}
.filter-btn:hover, .filter-btn.active { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: rgba(255, 107, 43, 0.1); }

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

.card-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}
.card-item:hover {
  transform: translateY(-4px);
  border-color: var(--border-light);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.card-item.not-owned { opacity: 0.4; filter: grayscale(0.7); }
.card-item.not-owned:hover { opacity: 0.6; }

.card-image-wrap {
  aspect-ratio: 1;
  overflow: hidden;
  position: relative;
}
.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.card-item:hover .card-image { transform: scale(1.05); }

.card-rarity-bar {
  height: 3px;
  width: 100%;
}
.card-rarity-bar.common { background: var(--common); }
.card-rarity-bar.uncommon { background: var(--uncommon); }
.card-rarity-bar.rare { background: var(--rare); }
.card-rarity-bar.epic { background: var(--epic); }
.card-rarity-bar.legendary { background: var(--legendary); }
.card-rarity-bar.mythic { background: linear-gradient(90deg, #f44336, #ff9800, #ffd700, #f44336); background-size: 200% 100%; animation: shimmer 2s linear infinite; }

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

.card-info {
  padding: 0.75rem;
}
.card-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.25rem;
}
.card-rarity-text {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.card-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Rarity text colors */
.rarity-common { color: var(--common); }
.rarity-uncommon { color: var(--uncommon); }
.rarity-rare { color: var(--rare); }
.rarity-epic { color: var(--epic); }
.rarity-legendary { color: var(--legendary); }
.rarity-mythic { color: var(--mythic); }

/* ─── Page: Pack Opening ─────────────────────────────────────────────────── */
.pack-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 2rem;
}

.pack-container {
  perspective: 1200px;
  cursor: pointer;
}
.pack-wrapper {
  width: 220px;
  height: 320px;
  position: relative;
  transition: transform 0.6s ease;
  transform-style: preserve-3d;
}
.pack-wrapper:hover { transform: translateY(-8px) rotateY(5deg); }
.pack-wrapper.shake {
  animation: packShake 0.5s ease;
}
@keyframes packShake {
  0%, 100% { transform: translateX(0) rotate(0); }
  20% { transform: translateX(-8px) rotate(-2deg); }
  40% { transform: translateX(8px) rotate(2deg); }
  60% { transform: translateX(-5px) rotate(-1deg); }
  80% { transform: translateX(5px) rotate(1deg); }
}

.pack-visual {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bg-card), var(--bg-surface));
  border: 2px solid var(--accent);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 40px var(--accent-glow), inset 0 0 40px rgba(255, 107, 43, 0.05);
  position: relative;
  overflow: hidden;
}
.pack-visual::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: conic-gradient(from 0deg, transparent, rgba(255, 107, 43, 0.1), transparent, rgba(255, 215, 0, 0.1), transparent);
  animation: packSpin 8s linear infinite;
}
@keyframes packSpin { 100% { transform: rotate(360deg); } }

.pack-emoji { font-size: 4rem; position: relative; z-index: 1; }
.pack-text {
  font-family: 'Orbitron', monospace;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  position: relative;
  z-index: 1;
  margin-top: 1rem;
}

/* Pack Tier Grid */
.pack-tier-grid {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  padding: 1rem 0;
}
.pack-tier-card {
  width: 240px;
  background: var(--bg-card);
  border-radius: 16px;
  border: 2px solid var(--border);
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}
.pack-tier-card:hover:not(.disabled) {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.pack-tier-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.pack-tier-card.tier-bronze { border-color: #cd7f32; }
.pack-tier-card.tier-bronze .pack-tier-header { background: linear-gradient(135deg, #cd7f32, #8b5e3c); }
.pack-tier-card.tier-silver { border-color: #c0c0c0; }
.pack-tier-card.tier-silver .pack-tier-header { background: linear-gradient(135deg, #c0c0c0, #808090); }
.pack-tier-card.tier-gold { border-color: #ffd700; }
.pack-tier-card.tier-gold .pack-tier-header { background: linear-gradient(135deg, #ffd700, #ff9800); }
.pack-tier-card.tier-gold:hover:not(.disabled) { box-shadow: 0 12px 40px rgba(255, 215, 0, 0.2); }

.pack-tier-header {
  padding: 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.pack-tier-header::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: conic-gradient(from 0deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
  animation: packSpin 6s linear infinite;
}
.pack-tier-emoji { font-size: 3rem; position: relative; z-index: 1; }
.pack-tier-name {
  font-family: 'Orbitron', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  position: relative;
  z-index: 1;
  margin-top: 0.5rem;
}
.pack-tier-body {
  padding: 1rem 1.25rem 1.25rem;
}
.pack-tier-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}
.pack-tier-odds {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.6;
}
.pack-tier-odds span { font-weight: 600; }
.pack-tier-price {
  text-align: center;
  font-family: 'Orbitron', monospace;
  font-size: 1.1rem;
  font-weight: 700;
}
.pack-tier-price.free { color: #4caf50; }
.pack-tier-price.coins { color: var(--gold); }
.pack-tier-btn {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.6rem;
  border: none;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.pack-tier-btn.btn-bronze { background: linear-gradient(135deg, #cd7f32, #a0622a); color: #fff; }
.pack-tier-btn.btn-silver { background: linear-gradient(135deg, #c0c0c0, #909098); color: #1a1a3a; }
.pack-tier-btn.btn-gold { background: linear-gradient(135deg, #ffd700, #ff9800); color: #1a1a3a; }
.pack-tier-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.pack-tier-btn:hover:not(:disabled) { filter: brightness(1.15); transform: scale(1.02); }

.pack-tier-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  z-index: 2;
  font-family: 'Orbitron', monospace;
}
.pack-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
  margin-top: 0.5rem;
}

/* Card reveal area */
.reveal-area {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  padding: 2rem;
}

.reveal-card {
  width: 200px;
  height: 280px;
  perspective: 1000px;
  cursor: pointer;
}
.reveal-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal-card.flipped .reveal-card-inner {
  transform: rotateY(180deg);
}

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

.reveal-card-front {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-surface));
  border: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}
.reveal-card-front::before {
  content: '';
  position: absolute;
  inset: 0;
  background: conic-gradient(from 0deg, transparent 70%, rgba(255,255,255,0.05) 80%, transparent 90%);
  animation: cardGlint 3s linear infinite;
}
@keyframes cardGlint { 100% { transform: rotate(360deg); } }

.reveal-card-back {
  transform: rotateY(180deg);
}
.reveal-card-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.reveal-card-back .card-reveal-info {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  padding: 1rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.9));
}
.reveal-card-back .card-reveal-name {
  font-weight: 700;
  font-size: 0.9rem;
}
.reveal-card-back .card-reveal-rarity {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

/* Rarity glow on reveal cards */
.reveal-card.rarity-common .reveal-card-front { border-color: var(--common); box-shadow: 0 0 20px rgba(158,158,158,0.2); }
.reveal-card.rarity-uncommon .reveal-card-front { border-color: var(--uncommon); box-shadow: 0 0 20px rgba(76,175,80,0.3); }
.reveal-card.rarity-rare .reveal-card-front { border-color: var(--rare); box-shadow: 0 0 25px rgba(33,150,243,0.3); }
.reveal-card.rarity-epic .reveal-card-front { border-color: var(--epic); box-shadow: 0 0 30px rgba(156,39,176,0.4); }
.reveal-card.rarity-legendary .reveal-card-front { border-color: var(--legendary); box-shadow: 0 0 40px rgba(255,152,0,0.5); animation: legendaryPulse 2s ease infinite; }
.reveal-card.rarity-mythic .reveal-card-front { border-color: var(--mythic); box-shadow: 0 0 50px rgba(244,67,54,0.6); animation: mythicPulse 1.5s ease infinite; }

@keyframes legendaryPulse {
  0%, 100% { box-shadow: 0 0 30px rgba(255,152,0,0.4); }
  50% { box-shadow: 0 0 60px rgba(255,152,0,0.7); }
}
@keyframes mythicPulse {
  0%, 100% { box-shadow: 0 0 40px rgba(244,67,54,0.5); }
  50% { box-shadow: 0 0 80px rgba(244,67,54,0.9), 0 0 120px rgba(255,215,0,0.3); }
}

/* ─── Particles ──────────────────────────────────────────────────────────── */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
}
.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: particleFly 1.5s ease-out forwards;
}
@keyframes particleFly {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0); }
}

/* ─── Page: Shop ─────────────────────────────────────────────────────────── */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}
.shop-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s ease;
}
.shop-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.shop-card-image {
  aspect-ratio: 1;
  overflow: hidden;
}
.shop-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.shop-card-body { padding: 1rem; }
.shop-card-name { font-weight: 700; margin-bottom: 0.25rem; }
.shop-card-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
}
.price-tag {
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  color: var(--gold);
}
.buy-btn {
  padding: 8px 20px;
  background: linear-gradient(135deg, var(--accent), #ff8f5b);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.buy-btn:hover { transform: scale(1.05); }
.buy-btn:disabled { background: var(--bg-surface); color: var(--text-muted); cursor: not-allowed; transform: none; }

/* ─── Page: Craft ────────────────────────────────────────────────────────── */
.craft-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}
.craft-slots {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
.craft-slot {
  width: 140px;
  height: 200px;
  background: var(--bg-card);
  border: 2px dashed var(--border-light);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.craft-slot:hover { border-color: var(--accent); }
.craft-slot.filled { border-style: solid; }
.craft-slot.filled img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}
.craft-slot .plus { font-size: 2rem; color: var(--text-muted); }
.craft-arrow { font-size: 2rem; color: var(--accent); }
.craft-result {
  width: 160px;
  height: 220px;
  background: var(--bg-card);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px var(--gold-glow);
}
.craft-result .mystery { font-size: 3rem; }

/* ─── Card Detail Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}
.modal-overlay.active .modal { transform: scale(1); }

.modal-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
}
.modal-body { padding: 1.5rem; }
.modal-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; }
.modal-description { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 1rem; }
.modal-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0,0,0,0.5);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Toast Notifications ────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 3s forwards;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  min-width: 280px;
}
.toast.success { border-left: 3px solid #4caf50; }
.toast.error { border-left: 3px solid #f44336; }
.toast.info { border-left: 3px solid #2196f3; }

@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } }
@keyframes toastOut { to { transform: translateX(100%); opacity: 0; } }

/* ─── Loading ────────────────────────────────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* ─── Empty State ────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state p { font-size: 1rem; }

/* ─── Mobile Menu Toggle ─────────────────────────────────────────────────── */
.mobile-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px;
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .mobile-toggle { display: flex; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .page-header { padding: 1.5rem 1rem 0.75rem; padding-top: calc(1.5rem + 44px); }
  .page-content { padding: 1rem; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; }
  .shop-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .reveal-card { width: 140px; height: 200px; }
  .craft-slot { width: 100px; height: 140px; }
  .actions-row { flex-direction: column; }
  .action-btn { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: 1fr; }
  .reveal-area { gap: 0.75rem; }
  .reveal-card { width: 100px; height: 150px; }
  .landing-logo { font-size: 2rem; }
}

/* ─── Sidebar Mobile Overlay ─────────────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}
@media (max-width: 768px) {
  .sidebar.open ~ .sidebar-overlay { display: block; }
}

/* ─── Countdown Timer ────────────────────────────────────────────────────── */
.countdown {
  font-family: 'Orbitron', monospace;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
