/* Import Inter Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;500;700;900&display=swap');

:root {
  /* Palette */
  --bg-deep: #0f172a;
  --bg-dark: #020617;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.15);

  /* Accents */
  --cyan-primary: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.6);
  --purple-primary: #8b5cf6;
  --amber-primary: #f59e0b;
  --red-error: #ef4444;
  --green-success: #10b981;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;

  /* Rarity Colors */
  --rarity-common: #94a3b8;
  --rarity-rare: #3b82f6;
  --rarity-epic: #a855f7;
  --rarity-legendary: #f59e0b;
}

* { box-sizing: border-box; }

.item-shop-view {
  width: 100%;
  height: 100%;
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(circle at 10% 10%, rgba(139, 92, 246, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(6, 182, 212, 0.1) 0%, transparent 40%);
  font-family: 'Inter', sans-serif;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

/* Ambient Effects */
.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  z-index: 0;
  animation: float 10s infinite ease-in-out;
}
.glow-purple { width: 400px; height: 400px; background: var(--purple-primary); top: -100px; left: -50px; }
.glow-cyan { width: 300px; height: 300px; background: var(--cyan-primary); bottom: -50px; right: -50px; animation-delay: -5s; }

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30px, -30px); }
}

/* Header */
.shop-header { text-align: center; z-index: 2; margin-bottom: 1rem; flex-shrink: 0; }
.header-badge {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 3px;
  font-weight: 700;
  color: var(--purple-primary);
  background: rgba(139, 92, 246, 0.1);
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid rgba(139, 92, 246, 0.2);
  margin-bottom: 0.5rem;
}
.shop-header h1 {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 900;
  text-transform: uppercase;
  text-shadow: 0 4px 12px rgba(0,0,0,0.5);
  background: linear-gradient(to right, #fff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Stage Area */
.shop-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 2;
  position: relative;
  min-height: 0;
}

/* Wallet */
.wallet-pill {
  align-self: center;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(0,0,0,0.4);
  padding: 8px 20px;
  border-radius: 50px;
  border: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.wallet-label { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); letter-spacing: 1px; }
.wallet-amount { font-size: 1.1rem; font-weight: 700; color: var(--amber-primary); transition: transform 0.2s; }
.wallet-amount.pulse { transform: scale(1.3); color: #fff; }

/* Main Console (Grid Container) */
.shop-console {
  flex: 1;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
}

.packages-grid {
  display: grid;
  /* Auto-fit columns, slightly wider min-width to handle large text */
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  grid-auto-rows: max-content; /* Allow rows to grow as tall as needed */
  gap: 1.5rem;
  width: 100%;
  overflow-y: auto;
  padding: 4px;
  align-items: flex-start; /* Prevents stretching empty space */
}

/* Shop Card */
.shop-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 1.5rem 1rem; /* More vertical padding */
  display: flex;
  flex-direction: column;
  align-items: center; /* Center everything horizontally */
  text-align: center;
  gap: 12px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

/* Card Selection States */
.shop-card.selected {
  background: rgba(6, 182, 212, 0.05);
  border-color: var(--cyan-primary);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
  transform: scale(1.02);
}
.shop-card.error {
  border-color: var(--red-error);
  animation: shake 0.4s ease-in-out;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}
.shop-card.success {
  border-color: var(--green-success);
  background: rgba(16, 185, 129, 0.1);
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.4);
  transform: scale(1.05);
}
.shop-card.processing { border-color: var(--amber-primary); }

/* --- 1. EMOJI --- */
.pkg-icon {
  font-size: 3rem; /* Large */
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
  line-height: 1;
}

/* --- 2. PRICE (2x Bigger) --- */
.pkg-price {
  font-size: 2rem; /* Was ~0.9rem, now huge */
  font-weight: 900;
  color: var(--amber-primary);
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
  line-height: 1;
  margin-top: -4px;
}
.currency { font-size: 1.5rem; vertical-align: middle; }

/* --- 3. NAME --- */
.pkg-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  width: 100%;
  padding-bottom: 8px;
}

/* --- 4. ITEMS (Vertical Stack, 2x Bigger) --- */
.item-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.item-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px; /* Fat padding */
  border-radius: 8px;
  font-size: 1.2rem; /* Was 0.7rem, now much bigger */
  font-weight: 700;
  background: rgba(255,255,255,0.03);
  transition: all 0.2s ease;
}

.dot { width: 30px; height: 30px; border-radius: 50%; background: #fff; flex-shrink: 0; }

/* Rarity Styles */
.rarity-common {
  color: var(--rarity-common);
  border: 1px solid rgba(148, 163, 184, 0.2);
}
.rarity-common .dot { background: var(--rarity-common); box-shadow: 0 0 5px var(--rarity-common); }

.rarity-rare {
  color: var(--rarity-rare);
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.rarity-rare .dot { background: var(--rarity-rare); box-shadow: 0 0 8px var(--rarity-rare); }

.rarity-epic {
  color: var(--rarity-epic);
  border: 1px solid rgba(168, 85, 247, 0.3);
}
.rarity-epic .dot { background: var(--rarity-epic); box-shadow: 0 0 8px var(--rarity-epic); }

.rarity-legendary {
  color: var(--rarity-legendary);
  border: 1px solid rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.1);
}
.rarity-legendary .dot { background: var(--rarity-legendary); box-shadow: 0 0 12px var(--rarity-legendary); }


/* Overlay */
.card-status-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(180deg, transparent 60%, rgba(6, 182, 212, 0.2));
  opacity: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 1rem;
  transition: opacity 0.3s;
  pointer-events: none;
}
.shop-card.selected .card-status-overlay { opacity: 1; }
.status-text {
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--cyan-primary);
  text-shadow: 0 0 10px var(--cyan-primary);
}

/* Footer */
.hud-footer { margin-top: 1rem; z-index: 2; display: flex; justify-content: center; flex-shrink: 0; }
.message-glass {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(10px);
  padding: 1rem 2rem;
  border-radius: 100px;
  border: 1px solid var(--glass-border);
  text-align: center;
  min-width: 350px;
  font-weight: 500;
}
.message-glass.active { border-color: var(--cyan-primary); color: var(--cyan-primary); }
.message-glass.error { border-color: var(--red-error); color: var(--red-error); }
.message-glass.success { border-color: var(--green-success); color: var(--green-success); background: rgba(16, 185, 129, 0.1); }

.blink { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* Scrollbar */
.packages-grid::-webkit-scrollbar { width: 6px; }
.packages-grid::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
.packages-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }