/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: #1a1f35;
  --bg-glass: rgba(17, 24, 39, 0.7);
  --border-glass: rgba(255, 255, 255, 0.08);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
  --accent-glow: rgba(99, 102, 241, 0.4);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --rarity-common: #9ca3af;
  --rarity-uncommon: #22c55e;
  --rarity-rare: #3b82f6;
  --rarity-epic: #a855f7;
  --rarity-legendary: #f59e0b;
  --rarity-common-glow: rgba(156, 163, 175, 0.3);
  --rarity-uncommon-glow: rgba(34, 197, 94, 0.3);
  --rarity-rare-glow: rgba(59, 130, 246, 0.3);
  --rarity-epic-glow: rgba(168, 85, 247, 0.3);
  --rarity-legendary-glow: rgba(245, 158, 11, 0.5);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Outfit', sans-serif;
  --chat-height: 350px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(168, 85, 247, 0.05) 0%, transparent 50%);
}

a {
  color: var(--accent-primary);
  text-decoration: none;
}

a:hover {
  color: var(--accent-secondary);
}

.hidden {
  display: none !important;
}

/* ===== GLASS ===== */
.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px var(--accent-glow);
}

.btn-accent {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-accent:hover {
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-glass);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.btn-small {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 16px 40px;
  font-size: 1.1rem;
}

.btn-full {
  width: 100%;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius);
  transition: var(--transition);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ===== AUTH OVERLAY ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  background-image:
    radial-gradient(ellipse at 30% 40%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 60%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
}

.auth-container {
  width: 100%;
  max-width: 420px;
  padding: 48px 36px;
  margin: 20px;
  text-align: center;
}

.auth-logo .logo-icon {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 12px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.auth-logo h1 {
  font-size: 2.4rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-subtitle {
  color: var(--text-secondary);
  margin-top: 8px;
  font-size: 0.95rem;
}

.auth-form {
  display: none;
  margin-top: 32px;
}

.auth-form.active {
  display: block;
}

.auth-form h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group input {
  width: 100%;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}

.form-group input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.auth-switch {
  margin-top: 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.error-msg {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 12px;
  min-height: 20px;
}

/* ===== HEADER ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  border-radius: 0;
  border-top: none;
  border-left: none;
  border-right: none;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.brand .logo-icon {
  font-size: 1.6rem;
}

.brand-name {
  font-size: 1.3rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-nav {
  display: flex;
  gap: 4px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-link.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.credits-display {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.1);
  padding: 8px 16px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.credits-icon {
  font-size: 1.1rem;
}

.credits-display.pulse {
  animation: creditPulse 0.4s ease;
}

@keyframes creditPulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }

  100% {
    transform: scale(1);
  }
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}

.username {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
}

.mobile-only {
  display: none;
}

/* ===== MOBILE NAV ===== */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 200;
  display: flex;
}

.mobile-nav {
  width: 280px;
  height: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 0;
  border-left: none;
  border-top: none;
  border-bottom: none;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(0);
  }
}

.close-btn {
  align-self: flex-end;
  margin-bottom: 16px;
}

.mobile-nav-link {
  padding: 14px 18px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 1.05rem;
  transition: var(--transition);
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
}

/* ===== PAGES ===== */
.page {
  display: none;
  padding: 32px 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 80px;
  /* space for chat bar */
}

.page.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-header {
  margin-bottom: 32px;
}

.page-header h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ===== BOOSTERS GRID ===== */
.boosters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.booster-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.booster-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
}

.booster-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(99, 102, 241, 0.3);
}

.booster-image {
  width: 160px;
  height: 220px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  position: relative;
  overflow: hidden;
}

.booster-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}

.booster-image .booster-placeholder {
  font-size: 4rem;
}

.booster-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.booster-card .booster-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.booster-price {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.15);
  padding: 8px 20px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-primary);
}

/* ================================================ */
/* ===== FULLSCREEN BOOSTER OPENING OVERLAY ======= */
/* ================================================ */
.opening-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.opening-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, #0f1729 0%, #050810 100%);
}

/* Ambient particles */
.opening-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.opening-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-primary);
  opacity: 0;
  animation: ambientFloat linear infinite;
}

@keyframes ambientFloat {
  0% {
    opacity: 0;
    transform: translateY(100vh) scale(0);
  }

  10% {
    opacity: 0.8;
  }

  90% {
    opacity: 0.8;
  }

  100% {
    opacity: 0;
    transform: translateY(-20vh) scale(1);
  }
}

.opening-content {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.opening-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  animation: fadeIn 0.5s ease;
}

.opening-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 40px;
  text-align: center;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
}

/* Pack visual */
.pack-wrapper {
  perspective: 1000px;
  cursor: pointer;
}

.pack-visual {
  width: 220px;
  height: 320px;
  position: relative;
  transition: transform 0.4s ease;
  animation: packIdle 2s ease-in-out infinite;
}

.pack-visual:hover {
  transform: scale(1.05) rotateY(5deg);
}

@keyframes packIdle {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-8px) rotate(1deg);
  }
}

.pack-front {
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #1e1b4b, #312e81, #4338ca);
  border-radius: 16px;
  border: 3px solid rgba(139, 92, 246, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  box-shadow:
    0 0 30px rgba(99, 102, 241, 0.3),
    0 0 60px rgba(99, 102, 241, 0.15),
    inset 0 0 30px rgba(99, 102, 241, 0.1);
  position: relative;
  overflow: hidden;
}

.pack-front::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.1), transparent, rgba(255, 255, 255, 0.05), transparent);
  animation: packShine 4s linear infinite;
}

@keyframes packShine {
  100% {
    transform: rotate(360deg);
  }
}

.pack-emoji {
  font-size: 5rem;
  position: relative;
  z-index: 1;
}

.pack-label {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  position: relative;
  z-index: 1;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

.pack-glow {
  position: absolute;
  inset: -20px;
  border-radius: 24px;
  background: radial-gradient(ellipse, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
  animation: glowPulse 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes glowPulse {

  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

/* Pack opening animation */
.pack-visual.opening {
  animation: packOpen 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes packOpen {
  0% {
    transform: scale(1) rotate(0deg);
  }

  20% {
    transform: scale(1.1) rotate(-3deg);
  }

  40% {
    transform: scale(1.15) rotate(3deg);
  }

  60% {
    transform: scale(1.2) rotate(-2deg);
    filter: brightness(2);
  }

  80% {
    transform: scale(1.3) rotate(0deg);
    filter: brightness(3);
  }

  100% {
    transform: scale(0) rotate(0deg);
    filter: brightness(5);
    opacity: 0;
  }
}

/* Burst effect */
.pack-burst {
  position: absolute;
  pointer-events: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: burstOut 0.8s ease-out forwards;
}

@keyframes burstOut {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

/* ===== CARD REVEAL (one by one) ===== */
.reveal-card-container {
  position: relative;
  cursor: pointer;
}

.reveal-card {
  width: 280px;
  height: 400px;
  position: relative;
  perspective: 1200px;
}

.reveal-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-card.flipped .reveal-card-inner {
  transform: rotateY(180deg);
}

.reveal-card.enter {
  animation: cardSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: scale(0.5) translateY(80px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.reveal-card-front,
.reveal-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 16px;
  overflow: hidden;
}

.reveal-card-front {
  background: linear-gradient(145deg, #1e293b, #334155);
  border: 3px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-back-pattern {
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(99, 102, 241, 0.05) 10px, rgba(99, 102, 241, 0.05) 20px),
    radial-gradient(circle at center, rgba(99, 102, 241, 0.15) 0%, transparent 60%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-back-pattern::after {
  content: '?';
  font-size: 5rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.15);
}

.reveal-card-back {
  transform: rotateY(180deg);
  border: 3px solid var(--rarity-common);
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  opacity: 0;
}

.reveal-card.flipped .reveal-card-back {
  opacity: 1;
  transition: opacity 0s 0.4s;
}

.reveal-card.flipped .reveal-card-front {
  opacity: 0;
  transition: opacity 0s 0.4s;
}

/* Rarity styles on reveal */
.reveal-card-back.rarity-common {
  border-color: var(--rarity-common);
}

.reveal-card-back.rarity-uncommon {
  border-color: var(--rarity-uncommon);
  box-shadow: 0 0 25px var(--rarity-uncommon-glow);
}

.reveal-card-back.rarity-rare {
  border-color: var(--rarity-rare);
  box-shadow: 0 0 30px var(--rarity-rare-glow), 0 0 60px var(--rarity-rare-glow);
}

.reveal-card-back.rarity-epic {
  border-color: var(--rarity-epic);
  box-shadow: 0 0 35px var(--rarity-epic-glow), 0 0 70px var(--rarity-epic-glow);
}

.reveal-card-back.rarity-legendary {
  border-color: var(--rarity-legendary);
  box-shadow: 0 0 40px var(--rarity-legendary-glow), 0 0 80px var(--rarity-legendary-glow), 0 0 120px rgba(245, 158, 11, 0.3);
  animation: legendaryGlow 2s ease-in-out infinite alternate;
}

@keyframes legendaryGlow {
  from {
    box-shadow: 0 0 30px var(--rarity-legendary-glow), 0 0 60px var(--rarity-legendary-glow);
  }

  to {
    box-shadow: 0 0 50px var(--rarity-legendary-glow), 0 0 100px rgba(245, 158, 11, 0.7), 0 0 150px rgba(245, 158, 11, 0.3);
  }
}

/* Legendary screen flash */
.legendary-flash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(245, 158, 11, 0.6) 0%, transparent 70%);
  animation: screenFlash 0.8s ease-out forwards;
}

@keyframes screenFlash {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

/* Epic screen flash */
.epic-flash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(168, 85, 247, 0.4) 0%, transparent 70%);
  animation: screenFlash 0.6s ease-out forwards;
}

/* NEW badge */
.card-new-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 50px;
  letter-spacing: 0.1em;
  box-shadow: 0 2px 10px rgba(34, 197, 94, 0.5);
  animation: newBadgePulse 1.5s ease-in-out infinite;
}

.card-new-badge.small {
  top: 6px;
  right: 6px;
  font-size: 0.55rem;
  padding: 2px 7px;
}

@keyframes newBadgePulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.5);
  }

  50% {
    transform: scale(1.1);
    box-shadow: 0 2px 16px rgba(34, 197, 94, 0.8);
  }
}

/* Rarity reveal animations */
.reveal-anim-uncommon .reveal-card-inner {
  animation: revealUncommon 0.5s ease;
}

.reveal-anim-rare .reveal-card-inner {
  animation: revealRare 0.6s ease;
}

.reveal-anim-epic .reveal-card-inner {
  animation: revealEpic 0.7s ease;
}

.reveal-anim-legendary .reveal-card-inner {
  animation: revealLegendary 1s ease;
}

@keyframes revealUncommon {

  0%,
  100% {
    filter: brightness(1);
  }

  50% {
    filter: brightness(1.3);
  }
}

@keyframes revealRare {
  0% {
    filter: brightness(1);
  }

  25% {
    transform: rotateY(180deg) scale(1.05) rotate(-1deg);
    filter: brightness(1.4);
  }

  50% {
    transform: rotateY(180deg) scale(1.08) rotate(1deg);
    filter: brightness(1.2);
  }

  100% {
    transform: rotateY(180deg) scale(1);
    filter: brightness(1);
  }
}

@keyframes revealEpic {
  0% {
    filter: brightness(1);
  }

  15% {
    transform: rotateY(180deg) scale(1.08) rotate(-2deg);
    filter: brightness(1.5) drop-shadow(0 0 10px rgba(168, 85, 247, 0.6));
  }

  30% {
    transform: rotateY(180deg) scale(1.1) rotate(2deg);
  }

  50% {
    transform: rotateY(180deg) scale(1.06) rotate(-1deg);
    filter: brightness(1.3) drop-shadow(0 0 20px rgba(168, 85, 247, 0.4));
  }

  100% {
    transform: rotateY(180deg) scale(1);
    filter: brightness(1) drop-shadow(0 0 0 transparent);
  }
}

@keyframes revealLegendary {
  0% {
    filter: brightness(1);
  }

  10% {
    transform: rotateY(180deg) scale(1.15) rotate(-3deg);
    filter: brightness(2) drop-shadow(0 0 20px rgba(245, 158, 11, 0.8));
  }

  20% {
    transform: rotateY(180deg) scale(1.12) rotate(3deg);
    filter: brightness(1.8);
  }

  35% {
    transform: rotateY(180deg) scale(1.1) rotate(-2deg);
    filter: brightness(1.5) drop-shadow(0 0 30px rgba(245, 158, 11, 0.6));
  }

  50% {
    transform: rotateY(180deg) scale(1.05) rotate(1deg);
    filter: brightness(1.3);
  }

  100% {
    transform: rotateY(180deg) scale(1);
    filter: brightness(1) drop-shadow(0 0 0 transparent);
  }
}

/* Rarity burst particles on flip */
.rarity-burst-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  pointer-events: none;
  animation: rarityBurst 0.7s ease-out forwards;
}

@keyframes rarityBurst {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(var(--tx), var(--ty)) scale(0);
  }
}

.reveal-card-img {
  position: absolute;
  inset: 0;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  overflow: hidden;
}

.reveal-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reveal-card-info {
  padding: 16px 20px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}

.reveal-card-name {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.reveal-card-rarity {
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.rarity-common .reveal-card-rarity,
.reveal-card-back.rarity-common .reveal-card-rarity {
  color: var(--rarity-common);
}

.rarity-uncommon .reveal-card-rarity,
.reveal-card-back.rarity-uncommon .reveal-card-rarity {
  color: var(--rarity-uncommon);
}

.rarity-rare .reveal-card-rarity,
.reveal-card-back.rarity-rare .reveal-card-rarity {
  color: var(--rarity-rare);
}

.rarity-epic .reveal-card-rarity,
.reveal-card-back.rarity-epic .reveal-card-rarity {
  color: var(--rarity-epic);
}

.rarity-legendary .reveal-card-rarity,
.reveal-card-back.rarity-legendary .reveal-card-rarity {
  color: var(--rarity-legendary);
}

.reveal-card-type {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.reveal-counter {
  margin-top: 24px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.reveal-instruction {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
  animation: pulse 1.5s ease-in-out infinite;
}

/* ===== SUMMARY ===== */
.summary-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-bottom: 32px;
  max-width: 800px;
}

.summary-card {
  width: 120px;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: visible;
  border: 2px solid var(--border-glass);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  animation: summaryPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.summary-card:hover {
  transform: translateY(-4px) scale(1.05);
}

.summary-card.rarity-common {
  border-color: var(--rarity-common);
}

.summary-card.rarity-uncommon {
  border-color: var(--rarity-uncommon);
}

.summary-card.rarity-rare {
  border-color: var(--rarity-rare);
  box-shadow: 0 0 15px var(--rarity-rare-glow);
}

.summary-card.rarity-epic {
  border-color: var(--rarity-epic);
  box-shadow: 0 0 15px var(--rarity-epic-glow);
}

.summary-card.rarity-legendary {
  border-color: var(--rarity-legendary);
  box-shadow: 0 0 20px var(--rarity-legendary-glow);
}

.summary-card-img {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: var(--bg-secondary);
  overflow: hidden;
}

.summary-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.summary-card-info {
  padding: 10px;
  text-align: center;
}

.summary-card-name {
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-card-rarity {
  font-size: 0.6rem;
  text-transform: uppercase;
  font-weight: 600;
}

@keyframes summaryPop {
  from {
    opacity: 0;
    transform: scale(0.5);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Card count badge */
.card-count-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 5;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(4px);
  pointer-events: none;
}

/* ===== COLLECTION ===== */
.collection-progress {
  margin-top: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
}

.collection-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.collection-progress-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.collection-progress-count {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-primary);
}

.collection-progress-bar {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.collection-progress-fill {
  height: 100%;
  border-radius: 6px;
  background: var(--accent-gradient);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.collection-progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
  border-radius: 6px;
}

.collection-progress-percent {
  display: block;
  text-align: right;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 6px;
}

@keyframes progressShine {
  0% {
    background-position: 0% 50%;
  }

  100% {
    background-position: 200% 50%;
  }
}

.collection-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.filter-btn {
  padding: 6px 16px;
  border: 1px solid var(--border-glass);
  border-radius: 50px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.collection-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--border-glass);
  transition: var(--transition);
  cursor: pointer;
}

.collection-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.collection-card.rarity-common {
  border-color: var(--rarity-common);
}

.collection-card.rarity-uncommon {
  border-color: var(--rarity-uncommon);
}

.collection-card.rarity-rare {
  border-color: var(--rarity-rare);
}

.collection-card.rarity-epic {
  border-color: var(--rarity-epic);
}

.collection-card.rarity-legendary {
  border-color: var(--rarity-legendary);
  box-shadow: 0 0 15px var(--rarity-legendary-glow);
}

.collection-card-img {
  width: 100%;
  height: 180px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  overflow: hidden;
}

.collection-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.collection-card-info {
  padding: 12px;
}

.collection-card-name {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.collection-card-rarity {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* Card detail modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  z-index: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 36px;
  max-width: 480px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.card-detail {
  text-align: center;
}

.card-detail-img {
  width: 100%;
  height: 300px;
  background: var(--bg-card);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  margin-bottom: 20px;
  overflow: hidden;
}

.card-detail-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}

.card-detail-name {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.card-detail-rarity {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.card-detail-rarity.rarity-common {
  background: rgba(156, 163, 175, 0.2);
  color: var(--rarity-common);
}

.card-detail-rarity.rarity-uncommon {
  background: rgba(34, 197, 94, 0.2);
  color: var(--rarity-uncommon);
}

.card-detail-rarity.rarity-rare {
  background: rgba(59, 130, 246, 0.2);
  color: var(--rarity-rare);
}

.card-detail-rarity.rarity-epic {
  background: rgba(168, 85, 247, 0.2);
  color: var(--rarity-epic);
}

.card-detail-rarity.rarity-legendary {
  background: rgba(245, 158, 11, 0.2);
  color: var(--rarity-legendary);
}

.card-detail-type {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.card-detail-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ===== CLICKER ===== */
.clicker-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.clicker-main {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.clicker-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  position: relative;
}

/* Combo display */
.combo-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
  animation: fadeIn 0.3s ease;
}

.combo-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.combo-value {
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent-primary);
  text-shadow: 0 0 20px var(--accent-glow);
  animation: comboPulse 0.6s ease-in-out infinite alternate;
}

@keyframes comboPulse {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.1);
  }
}

.combo-bar {
  width: 120px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.combo-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 2px;
  transition: width 0.2s ease;
}

.clicker-button {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--accent-gradient);
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  color: white;
  box-shadow: 0 8px 30px var(--accent-glow);
  transition: var(--transition);
  position: relative;
  z-index: 1;
}

.clicker-button:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 40px var(--accent-glow);
}

.clicker-button:active {
  transform: scale(0.92);
}

.clicker-icon {
  font-size: 3rem;
}

.clicker-text {
  font-size: 1.3rem;
  font-weight: 800;
}

.click-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.click-particle {
  position: absolute;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-primary);
  pointer-events: none;
  animation: particleFly 1s ease-out forwards;
}

.click-particle.lucky {
  font-size: 1.6rem;
  color: #f59e0b;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

@keyframes particleFly {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-90px) scale(0.5);
  }
}

/* Lucky notification */
.lucky-notification {
  position: absolute;
  top: 10%;
  font-size: 1.5rem;
  font-weight: 900;
  color: #f59e0b;
  text-shadow: 0 0 20px rgba(245, 158, 11, 0.7);
  pointer-events: none;
}

@keyframes luckyPop {
  0% {
    opacity: 0;
    transform: scale(0.5) translateY(20px);
  }

  20% {
    opacity: 1;
    transform: scale(1.3) translateY(-10px);
  }

  80% {
    opacity: 1;
    transform: scale(1) translateY(-30px);
  }

  100% {
    opacity: 0;
    transform: scale(0.8) translateY(-60px);
  }
}

.clicker-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  margin-top: 24px;
}

.stat-box {
  padding: 16px;
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.stat-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-primary);
}

/* Sidebar */
.clicker-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Upgrades */
.upgrades-section {
  padding: 24px;
}

.upgrades-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.upgrades-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.upgrade-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius);
  border: 1px solid var(--border-glass);
  transition: var(--transition);
}

.upgrade-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(99, 102, 241, 0.2);
}

.upgrade-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.upgrade-icon {
  font-size: 1.5rem;
}

.upgrade-name {
  font-size: 0.85rem;
  font-weight: 700;
}

.upgrade-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.upgrade-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.upgrade-level {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.upgrade-buy {
  padding: 6px 14px !important;
  font-size: 0.8rem !important;
  white-space: nowrap;
}

/* Mini-games */
.minigame-section {
  padding: 20px;
}

.minigame-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.minigame-section p {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-bottom: 14px;
}

.minigame-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.minigame-controls input {
  flex: 1;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.95rem;
  outline: none;
}

.minigame-controls input:focus {
  border-color: var(--accent-primary);
}

.minigame-result {
  padding: 10px;
  border-radius: var(--radius);
  font-weight: 600;
  text-align: center;
  min-height: 40px;
  font-size: 0.85rem;
}

.minigame-result.win {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.minigame-result.lose {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.minigame-cooldown {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 10px;
}

/* Reflex game */
.reflex-game {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.reflex-box {
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border-radius: var(--radius);
  font-size: 1.2rem;
  font-weight: 800;
  color: white;
  transition: background 0.15s ease;
  user-select: none;
}

/* ===== PERSISTENT CHAT BAR ===== */
.chat-bar {
  position: fixed;
  bottom: 0;
  right: 24px;
  width: 360px;
  z-index: 150;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.chat-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--border-glass);
}

.chat-bar-title {
  font-size: 0.9rem;
  font-weight: 700;
}

.chat-bar-toggle {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.chat-bar.open .chat-bar-toggle {
  transform: rotate(180deg);
}

.chat-unread {
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 50px;
  min-width: 18px;
  text-align: center;
}

.chat-bar-body {
  height: var(--chat-height);
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-msg {
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  max-width: 90%;
  word-break: break-word;
}

.chat-msg.own {
  align-self: flex-end;
  background: rgba(99, 102, 241, 0.15);
}

.chat-msg-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}

.chat-msg-user {
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--accent-primary);
}

.chat-msg-time {
  font-size: 0.6rem;
  color: var(--text-muted);
}

.chat-msg-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border-glass);
}

.chat-input-area input {
  flex: 1;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.85rem;
  outline: none;
}

.chat-input-area input:focus {
  border-color: var(--accent-primary);
}

/* ===== TRADE ===== */
.trade-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.trade-create,
.trade-pending {
  padding: 24px;
}

.trade-create h3,
.trade-pending h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.trade-search {
  position: relative;
  margin-bottom: 16px;
}

.trade-search input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
}

.trade-search input:focus {
  border-color: var(--accent-primary);
}

.trade-user-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  margin-top: 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
}

.trade-user-item {
  padding: 10px 16px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
}

.trade-user-item:hover {
  background: rgba(99, 102, 241, 0.1);
}

.trade-selected-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.trade-card-selection {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  margin-bottom: 16px;
  align-items: start;
}

.trade-arrow {
  font-size: 1.5rem;
  padding-top: 60px;
  color: var(--text-muted);
}

.trade-side h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.trade-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.trade-card-mini {
  width: 70px;
  height: 95px;
  background: var(--bg-card);
  border-radius: 6px;
  border: 2px solid var(--border-glass);
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.trade-card-mini:hover {
  transform: scale(1.05);
}

.trade-card-mini.selected {
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-glow);
}

.trade-card-mini.selected::after {
  content: '✓';
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 0.7rem;
  color: var(--accent-primary);
  font-weight: 800;
}

.trade-card-mini-img {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: var(--bg-secondary);
  overflow: hidden;
}

.trade-card-mini-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trade-card-mini-name {
  padding: 3px 4px;
  font-size: 0.5rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trades-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trade-item {
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius);
  border: 1px solid var(--border-glass);
}

.trade-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.trade-item-user {
  font-weight: 700;
  font-size: 0.9rem;
}

.trade-item-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.trade-item-cards {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.trade-item-arrow {
  color: var(--text-muted);
  font-weight: 700;
}

.trade-mini-card {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--bg-card);
  border-radius: 6px;
  font-size: 0.75rem;
  border: 1px solid var(--border-glass);
}

.trade-item-actions {
  display: flex;
  gap: 8px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 16px;
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  color: white;
  box-shadow: var(--shadow);
  max-width: 360px;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

.toast.info {
  background: var(--accent-primary);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-60px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .header-nav {
    display: none;
  }

  .mobile-only {
    display: block;
  }

  .username {
    display: none;
  }

  .trade-container {
    grid-template-columns: 1fr;
  }

  .clicker-layout {
    grid-template-columns: 1fr;
  }

  .chat-bar {
    width: 320px;
    right: 16px;
  }
}

@media (max-width: 768px) {
  .page {
    padding: 20px 16px;
    padding-bottom: 80px;
  }

  .page-header h2 {
    font-size: 1.4rem;
  }

  .app-header {
    padding: 0 16px;
  }

  .boosters-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

  .collection-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .modal-content {
    padding: 24px;
    border-radius: var(--radius-lg);
  }

  .trade-card-selection {
    grid-template-columns: 1fr;
  }

  .trade-arrow {
    padding-top: 0;
    text-align: center;
  }

  .credits-display {
    padding: 6px 12px;
    font-size: 0.85rem;
  }

  .chat-bar {
    width: 100%;
    right: 0;
    border-radius: 0;
  }

  .reveal-card {
    width: 240px;
    height: 340px;
  }

  .pack-visual {
    width: 180px;
    height: 260px;
  }
}

@media (max-width: 480px) {
  .auth-container {
    padding: 32px 24px;
  }

  .auth-logo h1 {
    font-size: 1.8rem;
  }

  .boosters-grid {
    grid-template-columns: 1fr;
  }

  .collection-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }

  .clicker-button {
    width: 140px;
    height: 140px;
  }

  .clicker-icon {
    font-size: 2.2rem;
  }

  .clicker-text {
    font-size: 0.9rem;
  }

  .collection-card-img {
    height: 140px;
  }

  .reveal-card {
    width: 200px;
    height: 280px;
  }

  .reveal-card-name {
    font-size: 1rem;
  }

  .pack-visual {
    width: 160px;
    height: 230px;
  }

  .summary-card {
    width: 90px;
  }

  .summary-card-img {
    height: 100px;
  }
}