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

/* Prevent overflow on mobile */
@media (max-width: 768px) {
  body, main, .view, .era-section, .cards-grid, .pokemon-grid, .era-grid {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
  
  header {
    max-width: 100% !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
  }
  
  img {
    max-width: 100%;
  }
  
  .desktop-only-filter-summary {
    display: none !important;
  }
}

html {
  overflow-x: hidden;
  width: 100%;
}

body {
  overflow-x: hidden;
  width: 100% !important;
  max-width: 100% !important;
  position: relative;
}

.hidden {
  display: none !important;
}

:root {
  --primary: #ff6b35;
  --primary-dark: #e55a2b;
  --bg-dark: #1a1a2e;
  --bg-card: #16213e;
  --bg-card-hover: #1f2b4a;
  --text: #eaeaea;
  --text-muted: #a0a0a0;
  --border: #3a3f5c;
  --accent-green: #4ade80;
  --accent-blue: #60a5fa;
  --accent-purple: #a78bfa;
  --accent-yellow: #fbbf24;
  --accent-red: #f87171;
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Custom Scrollbar - Slim and Subtle */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* Header */
header {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-dark) 100%);
  padding: 0;
  border-bottom: 2px solid var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
}

.debug-mode-indicator {
  position: fixed;
  top: 0;
  right: 0;
  background-color: var(--accent-red);
  color: white;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: bold;
  z-index: 1000;
  border-bottom-left-radius: 5px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.logo:hover {
  opacity: 0.85;
}

.logo-icon {
  font-size: 2rem;
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-yellow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

nav {
  display: flex;
  gap: 0.5rem;
}

.nav-btn {
  background: transparent;
  border: 2px solid var(--text-muted);
  color: var(--text-muted);
  padding: 0.5rem 1.25rem;
  border-radius: 25px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.nav-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Main */
main {
  flex: 1;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  overflow-x: hidden;
}

.view {
  display: none;
  max-width: 100%;
  overflow-x: hidden;
}

.view.active {
  display: block;
}

h2 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}

/* Back Button */
.back-btn {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 1rem;
  cursor: pointer;
  margin-bottom: 1rem;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.back-btn:hover {
  text-decoration: underline;
}

/* Sets Search */
#sets-view h2 {
  margin-bottom: 0.5rem;
}

#sets-view .inline-filters {
  margin-top: 0;
}

.sets-search-container {
  max-width: 400px;
  margin: 0 auto 1.5rem;
  padding: 1rem 1rem 0;
}

.sets-search-container input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.sets-search-container input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

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

/* Sets Grid - Era Sections */
.sets-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.era-section {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 1rem;
}

.era-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.era-header h2 {
  font-size: 1.5rem;
  color: var(--primary);
  margin: 0;
}

.era-count {
  color: var(--text-muted, #a0a0a0);
  font-size: 0.9rem;
}

.era-fact {
  color: var(--text-muted, #a0a0a0);
  font-size: 0.85rem;
  font-style: italic;
  margin-top: 0.5rem;
  line-height: 1.4;
  max-width: 600px;
}

.set-fact {
  color: var(--text-muted, #a0a0a0);
  font-size: 0.85rem;
  font-style: italic;
  margin-top: 0.5rem;
  line-height: 1.4;
}

.pokemon-fact {
  color: var(--text-muted, #a0a0a0);
  font-size: 0.9rem;
  font-style: italic;
  margin: 0.25rem 0 0.5rem 0;
  line-height: 1.4;
}

.era-cards-link {
  color: var(--accent-blue, #60a5fa);
  text-decoration: none;
  transition: color 0.2s;
}

.era-cards-link:hover {
  color: #93c5fd;
  text-decoration: underline;
}

.era-filter-badge {
  background: var(--bg-dark);
  color: var(--accent-red);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.85rem;
  margin-right: 0.5rem;
  font-weight: 600;
}

.era-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.5rem;
  padding-top: 4px; /* Room for first row hover lift effect */
}

.set-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.set-logo {
  width: 100%;
  max-width: 200px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
  padding: 0.5rem;
}

.set-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

.set-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  transform: translateY(-4px);
}

.set-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.set-card .set-code {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.set-card .set-info {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.set-card .set-stats {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.set-card .stat {
  text-align: center;
}

.set-card .stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-yellow);
}

.set-card .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Set Header */
.set-header {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.set-header-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.set-detail-logo {
  flex-shrink: 0;
  width: 200px;
}

.set-detail-logo img {
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.set-header-info {
  flex: 1;
}

.set-header h2 {
  margin-bottom: 0.25rem;
  font-size: 1.5rem;
}

.set-header .set-series {
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.set-header .set-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Set navigation */
.set-nav-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.set-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  border: 1px solid var(--primary);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 70px;
}

.set-nav-btn:hover:not(.disabled),
.set-nav-btn:focus:not(.disabled) {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(1.05);
  outline: none;
}

.set-nav-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: var(--text-muted);
}

.set-nav-btn .nav-arrow {
  font-size: 1.5rem;
  color: var(--primary);
  line-height: 1;
  pointer-events: none;
  transition: all 0.2s ease;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  background: transparent;
}

.set-nav-btn .nav-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  pointer-events: none;
  transition: color 0.2s ease;
}

/* Change colors and arrow background on button hover */
.set-nav-btn:hover:not(.disabled) .nav-arrow {
  color: white;
  background: rgba(255,255,255,0.15);
}

.set-nav-btn:hover:not(.disabled) .nav-label {
  color: white;
}

.set-nav-container .set-header-row {
  flex: 1;
}

/* Set view toggle (Card List / Rarity Guide) */
/* Set view toggle - pill style */
.set-view-toggle {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  margin-top: 0.75rem;
  gap: 0;
}

.set-view-toggle .toggle-btn {
  padding: 0.5rem 0.75rem;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 110px;
  text-align: center;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: visible;
}

.set-view-toggle .toggle-btn:first-child {
  border-radius: 6px 0 0 6px;
  border-right: none;
}

.set-view-toggle .toggle-btn:last-child {
  border-radius: 0 6px 6px 0;
  border-left: none;
}

.set-view-toggle .toggle-btn:hover:not(.active) {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

.set-view-toggle .toggle-btn.active {
  background: #3b82f6;
  color: #fff;
  font-weight: 500;
  border: 2px solid #3b82f6;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.5);
}

.set-view-toggle .toggle-btn.active:first-child {
  border-right: none;
}

.set-view-toggle .toggle-btn.active:last-child {
  border-left: none;
}

/* Mobile adjustments for set nav */
@media (max-width: 600px) {
  .set-nav-container {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .set-nav-btn {
    padding: 0.4rem 0.6rem;
    min-width: 40px;
    order: 0;
  }
  
  .set-nav-btn .nav-label {
    display: none;
  }
  
  .set-nav-btn .nav-arrow {
    font-size: 1.1rem;
  }
  
  .set-header-row {
    display: contents;
  }
  
  .set-detail-logo {
    width: 150px;
    order: 0;
  }
  
  .set-header-info {
    order: 1;
    flex-basis: 100%;
    text-align: center;
    margin-top: 0.75rem;
  }
  
  .set-header-info h2 {
    font-size: 1.1rem;
  }
  
  .set-header-info .set-series,
  .set-header-info .set-meta,
  .set-header-info .set-fact {
    font-size: 0.8rem;
  }
  
  .set-view-toggle {
    justify-content: center;
  }
}

/* Mobile adjustments for toggle buttons */
@media (max-width: 768px) {
  .set-view-toggle .toggle-btn {
    min-width: 90px;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    white-space: nowrap;
  }
}

/* Stats container for price + rarity */
.stats-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-left: auto;
  padding-left: 1rem;
}

/* Hide set header stats on narrower desktop - use filter panel instead */
@media (max-width: 1200px) {
  #set-header .stats-container {
    display: none;
  }
}

/* Stats container for All Cards view */
#all-cards-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Price range stats */
.price-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.price-stats .filter-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  margin-right: 0.25rem;
}

/* Unified filter chip base styles */
.price-stat,
.rarity-stat,
.type-stat,
.subtype-stat,
.variant-type-stat,
.psa-pop-stat,
.psa-rate-stat,
.sales-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  border-radius: 1rem;
  border: 1px solid var(--border, #3a3f5c);
  background: var(--card-bg, #1e2139);
  transition: background 0.2s, transform 0.1s, border-color 0.2s;
  white-space: nowrap;
}

.price-stat:hover,
.rarity-stat:hover,
.type-stat:hover,
.subtype-stat:hover,
.variant-type-stat:hover,
.psa-pop-stat:hover,
.psa-rate-stat:hover,
.sales-stat:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  transform: scale(1.02);
}

.price-stat.active,
.rarity-stat.active,
.type-stat.active,
.subtype-stat.active,
.variant-type-stat.active,
.psa-pop-stat.active,
.psa-rate-stat.active,
.sales-stat.active {
  background: var(--accent-red);
  color: white;
  font-weight: 600;
  border-color: var(--accent-red);
}

.price-indicator {
  display: none;
}

/* Count inside filter chips - add spacing */
.chip-count {
  margin-left: 0.3em;
  opacity: 0.85;
}

.price-stat b {
  font-weight: 600;
}

.rarity-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.5rem; /* row-gap column-gap - tighter vertical spacing */
  margin-left: auto;
  align-items: center;
  padding-left: 0;
}

/* In All Cards stats container, align to start not end */
#all-cards-stats .rarity-stats {
  margin-left: 0;
}

.rarity-stats .filter-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  margin-right: 0.25rem;
}

/* rarity-stat uses unified base styles above */

.rarity-stat .card-rarity {
  font-size: 0.7rem;
  padding: 0.15rem 0.35rem;
}

/* Variant types filter */
.variant-types-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border, #3a3f5c);
}

.variant-types-stats .filter-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-right: 0.25rem;
}

/* variant-type-stat uses unified base styles above */

/* Subtype filter (Basic, Stage 1, Stage 2, ex, etc.) */
.subtype-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Desktop subtype stats may have border-top */
#all-cards-stats .subtype-stats {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border, #3a3f5c);
}

/* Mobile subtype stats - no extra spacing */
.mobile-stats.subtype-stats {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.subtype-stats .filter-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-right: 0.25rem;
}

/* subtype-stat uses unified base styles above */

/* Type stats (chips) */
.type-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* type-stat uses unified base styles above */

/* Type-specific colors removed - using default styling */

/* Pokemon detail header with sprite */
.pokemon-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.pokemon-header .pokemon-sprite {
  width: 150px;
  height: 150px;
  object-fit: contain;
  flex-shrink: 0;
}

.pokemon-header-info {
  flex: 1;
  min-width: 0;
}

.pokemon-header-info .result-count {
  margin-top: 0.5rem;
}

/* Pokemon detail header with inline stats */
#pokemon-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

#pokemon-name .rarity-stats {
  margin-left: 0;
  padding-left: 0;
}

.pokemon-rarity-stats {
  font-size: 0.9rem;
  font-weight: normal;
}

/* Trainer Header */
.trainer-header {
  margin-bottom: 1rem;
}

.trainer-header h2 {
  margin-bottom: 0.25rem;
}

.trainer-header .result-count {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* View Stats (Trainers/Pokemon totals) */
.view-stats {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.view-stats span {
  color: var(--text);
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.card-item {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1rem;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
}

.card-item .card-price {
  margin-top: auto;
}

.card-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.card-item .card-image {
  width: 100%;
  aspect-ratio: 63/88;
  background: var(--bg-dark);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  overflow: visible;
  position: relative;
  border: 3px solid transparent;
  transition: all 0.2s ease;
}

.variant-badge {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #fbbf24;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-item.in-collection .card-image {
  border: 3px solid #fbbf24;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.8), 0 0 30px rgba(251, 191, 36, 0.4);
}

.card-item.in-collection:hover .card-image {
  box-shadow: 0 0 25px rgba(251, 191, 36, 1), 0 0 40px rgba(251, 191, 36, 0.6);
}

.card-item.is-variant {
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.card-item .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.card-item .card-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-item .card-number {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.card-item .card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  min-height: 1.5rem;
}

.card-item .card-type {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(255,255,255,0.1);
}

.card-item .card-type.Grass { background: #22c55e33; color: #4ade80; }
.card-item .card-type.Fire { background: #ef444433; color: #f87171; }
.card-item .card-type.Water { background: #3b82f633; color: #60a5fa; }
.card-item .card-type.Lightning { background: #eab30833; color: #fbbf24; }
.card-item .card-type.Psychic { background: #a855f733; color: #c084fc; }
.card-item .card-type.Fighting { background: #f9731633; color: #fb923c; }
.card-item .card-type.Darkness { background: #6b21a833; color: #a78bfa; }
.card-item .card-type.Metal { background: #71717a33; color: #a1a1aa; }
.card-item .card-type.Dragon { background: #0ea5e933; color: #22d3ee; }
.card-item .card-type.Colorless { background: #f5f5f533; color: #e5e5e5; }

.card-item .card-rarity {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
}

.card-item .card-rarity.SIR { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #000; }
.card-item .card-rarity.SAR { background: linear-gradient(135deg, #a78bfa, #8b5cf6); color: #fff; }
.card-item .card-rarity.FAT { background: linear-gradient(135deg, #60a5fa, #3b82f6); color: #fff; }
.card-item .card-rarity.MAR { background: linear-gradient(135deg, #f472b6, #ec4899); color: #fff; }
.card-item .card-rarity.RR { background: #6366f1; color: #fff; }
.card-item .card-rarity.R { background: #10b981; color: #fff; }
.card-item .card-rarity.U { background: #64748b; color: #fff; }
.card-item .card-rarity.C { background: #475569; color: #fff; }
.card-item .card-rarity.SHR { background: linear-gradient(135deg, #1e293b, #475569); color: #fbbf24; }
.card-item .card-rarity.SHV { background: linear-gradient(135deg, #1e293b, #6366f1); color: #fbbf24; }
.card-item .card-rarity.SHVMX { background: linear-gradient(135deg, #1e293b, #8b5cf6); color: #fbbf24; }
.card-item .card-rarity.SUR { background: linear-gradient(135deg, #1e293b, #ec4899); color: #fbbf24; }
.card-item .card-rarity.LEG { background: linear-gradient(135deg, #f59e0b, #ef4444); color: #fff; }
.card-item .card-rarity.PRIME { background: linear-gradient(135deg, #fbbf24, #d97706); color: #000; }
.card-item .card-rarity.HR { background: linear-gradient(135deg, #fbbf24, #d97706); color: #000; }
.card-item .card-rarity.MHR { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #000; }
.card-item .card-rarity.IR { background: linear-gradient(135deg, #a78bfa, #7c3aed); color: #fff; }
.card-item .card-rarity.UR { background: linear-gradient(135deg, #60a5fa, #2563eb); color: #fff; }
.card-item .card-rarity.SEC { background: linear-gradient(135deg, #fbbf24, #dc2626); color: #000; }
.card-item .card-rarity.ACE { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
.card-item .card-rarity.V { background: #8b5cf6; color: #fff; }
.card-item .card-rarity.VMAX { background: linear-gradient(135deg, #8b5cf6, #6366f1); color: #fff; }
.card-item .card-rarity.VSTAR { background: linear-gradient(135deg, #fbbf24, #8b5cf6); color: #000; }
.card-item .card-rarity.H { background: linear-gradient(135deg, #06b6d4, #0891b2); color: #fff; }
.card-item .card-rarity.AR { background: linear-gradient(135deg, #ec4899, #8b5cf6, #3b82f6); color: #fff; }
.card-item .card-rarity.RAD { background: linear-gradient(135deg, #f472b6, #fbbf24); color: #000; }
.card-item .card-rarity.BWR { background: linear-gradient(135deg, #1e293b, #f8fafc); color: #fbbf24; }

/* Mechanic badges */
.card-item .card-mechanic {
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-weight: 700;
  text-transform: lowercase;
}

.card-item .card-mechanic.ex { background: linear-gradient(135deg, #dc2626, #b91c1c); color: #fff; }
.card-item .card-mechanic.ACE-SPEC { background: linear-gradient(135deg, #7c3aed, #5b21b6); color: #fff; }
.card-item .card-mechanic.Radiant { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #000; }
.card-item .card-mechanic.Tera { background: linear-gradient(135deg, #06b6d4, #0891b2); color: #fff; }
.card-item .card-mechanic.V { background: linear-gradient(135deg, #ec4899, #db2777); color: #fff; }
.card-item .card-mechanic.VMAX { background: linear-gradient(135deg, #f43f5e, #e11d48); color: #fff; }
.card-item .card-mechanic.VSTAR { background: linear-gradient(135deg, #eab308, #ca8a04); color: #000; }
.card-item .card-mechanic.GX { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; }
.card-item .card-mechanic.EX { background: linear-gradient(135deg, #14b8a6, #0d9488); color: #fff; }
.card-item .card-mechanic.MEGA { background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: #fff; }

.card-item .card-price {
  font-weight: 700;
  color: var(--accent-green);
  font-size: 1rem;
  margin-top: 0.5rem;
}

.card-item .card-price.high {
  color: var(--accent-yellow);
}

.card-item .card-price.chase {
  color: var(--primary);
  font-size: 1.1rem;
}

/* Card prices grid */
.card-item .card-prices {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.4rem;
  font-size: 0.8rem;
}

.card-item .card-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-item .card-price-row .price-label {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.card-item .card-price-row .price-value {
  font-weight: 600;
  color: var(--accent-green);
}

.card-item .card-price-row .price-value.high {
  color: var(--accent-yellow);
}

.card-item .card-price-row .price-value.chase {
  color: var(--primary);
}

.card-item .card-price-row.sales-volume-row {
  padding-top: 0.25rem;
  margin-top: 0.25rem;
}

.card-item .card-price-row.sales-volume-row .price-value {
  color: var(--text-muted);
  font-weight: 500;
}

/* Card Action Buttons */
.card-actions {
  position: absolute;
  bottom: -0.6rem;
  right: -0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  z-index: 10;
}

.card-action-btn {
  width: 1.8rem;
  height: 1.8rem;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  border-radius: 6px;
  padding: 0.2rem;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  backdrop-filter: blur(3px);
}

.card-action-btn:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: scale(1.1);
}

.card-action-btn:active {
  transform: scale(0.95);
}

.card-action-btn.collection-btn {
  /* Base color removed - will be set on .btn-icon */
}

.card-action-btn.collection-btn .btn-icon {
  /* Hollow plus sign with white border */
  color: transparent;
  -webkit-text-stroke: 2px white;
  -webkit-text-fill-color: transparent;
  text-stroke: 2px white;
  font-weight: 300;
  paint-order: stroke fill;
}

.card-action-btn.collection-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}

.card-action-btn.collection-btn.active {
  color: #fbbf24;
}

.card-action-btn.collection-btn.active .btn-icon {
  /* Gold checkmark with heavier stroke */
  -webkit-text-stroke: 2.5px #fbbf24;
  -webkit-text-fill-color: #fbbf24;
  font-weight: 700;
}

.card-action-btn.collection-btn.active:hover {
  background: rgba(251, 191, 36, 0.2);
}

.card-action-btn.wishlist-btn {
  color: white;
}

.card-action-btn.wishlist-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}

.card-action-btn.wishlist-btn.active {
  color: #fbbf24;
}

.card-action-btn.wishlist-btn.active:hover {
  background: rgba(251, 191, 36, 0.2);
}

.card-action-btn .btn-icon {
  display: block;
  line-height: 1;
  font-size: 1.1rem;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.8),
               0 0 6px rgba(0, 0, 0, 0.5);
}

.card-action-btn.active .btn-icon {
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.9),
               0 0 8px rgba(0, 0, 0, 0.6);
}

/* Pokemon Grid */
.pokemon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.pokemon-entry {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.pokemon-entry:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.pokemon-sprite {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pokemon-sprite img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.pokemon-info {
  flex: 1;
  min-width: 0;
}

.pokemon-entry .pokemon-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pokemon-entry .dex-number {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.85em;
}

.pokemon-stats {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.5rem;
}

.pokemon-value {
  color: var(--accent-green);
}

/* Trainer Entry Styles */
.trainer-entry .trainer-sprite {
  background: var(--bg-card-hover);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.trainer-entry .trainer-sprite img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.trainer-icon-fallback {
  font-size: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.trainer-type-badge {
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.trainer-type-badge.trainer {
  background: var(--accent-purple);
  color: #1a1a2e;
}

.trainer-type-badge.item {
  background: var(--accent-blue);
  color: #1a1a2e;
}

/* Search & Filters */
.search-bar {
  margin-bottom: 1.5rem;
}

.search-bar input {
  width: 100%;
  max-width: 400px;
  padding: 0.75rem 1rem;
  border-radius: 25px;
  border: 2px solid var(--bg-card);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--primary);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: 12px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.filter-group label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.filter-group select,
.filter-group input {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: var(--bg-dark);
  color: var(--text);
  font-family: inherit;
  min-width: 150px;
}

.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: var(--primary);
}

/* User Filter Toggles */
.user-filter-toggles {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Checkbox Labels */
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  padding: 0.35rem 0.4rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
  font-size: 0.85rem;
  user-select: none;
  white-space: nowrap;
}

.checkbox-label:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.checkbox-label input[type="checkbox"] {
  min-width: auto;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + span {
  color: var(--primary);
  font-weight: 500;
}

.filter-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 0.25rem;
  flex-shrink: 0;
}

.user-filter-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.user-filter-toggle:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255,255,255,0.2);
}

.user-filter-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent);
}

.user-filter-toggle span {
  flex: 1;
  color: var(--text);
}

.user-filter-toggle input[type="checkbox"]:checked + span {
  color: var(--accent);
  font-weight: 600;
}

/* Sort Buttons */
.sort-buttons-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

.sort-buttons {
  display: flex;
  gap: 0.25rem;
  flex-wrap: nowrap;
}

.sort-btn {
  padding: 0.4rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.sort-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text);
  border-color: rgba(255,255,255,0.25);
}

.sort-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.sort-btn.active:hover {
  background: var(--primary-dark);
}

/* Sort direction indicator - handled inline in HTML */

/* Consolidated Filter Panel */
.filter-panel {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.filter-panel-main {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.filter-panel-main .filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.filter-panel-main .filter-group.sort-buttons-group {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}

.filter-panel-main .filter-group.sort-buttons-group > label {
  min-width: 50px;
  margin-left: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.filter-panel-main .toggle-group {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  align-items: center;
}

.filter-toggles-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.panel-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  background: var(--bg-dark);
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 0.8rem;
  user-select: none;
  transition: all 0.2s;
}

.panel-toggle-label:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255,255,255,0.2);
}

.panel-toggle-label input {
  display: none;
}

.panel-toggle-label .toggle-slider {
  width: 32px;
  height: 18px;
  background: #4a5568;
  border-radius: 9px;
  position: relative;
  transition: background 0.2s;
}

.panel-toggle-label .toggle-slider::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.panel-toggle-label input:checked + .toggle-slider {
  background: var(--primary);
}

.panel-toggle-label input:checked + .toggle-slider::after {
  transform: translateX(14px);
}

.panel-toggle-label .toggle-text {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.75rem;
}

.panel-toggle-label input:checked ~ .toggle-text {
  color: var(--primary);
}

.filter-expand-btn {
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: auto;
}

.filter-expand-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text);
  border-color: rgba(255,255,255,0.25);
}

.filter-expand-btn.expanded {
  background: var(--bg-card-hover);
  color: var(--primary);
}

.filter-panel-expanded {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.filter-panel-expanded .filter-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}

.filter-panel-expanded .filter-group > label {
  min-width: 70px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.filter-panel-expanded .desktop-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.filter-panel-expanded .filter-group select,
.filter-panel-expanded .filter-group input:not([type="checkbox"]) {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: var(--bg-dark);
  color: var(--text);
  font-family: inherit;
  min-width: 140px;
}

/* Mobile filter panel */
@media (max-width: 768px) {
  .filter-panel-main {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-panel-main .sort-buttons-group {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .filter-panel-main .toggle-group {
    justify-content: flex-start;
  }
  
  .filter-expand-btn {
    margin-left: 0;
    width: 100%;
    text-align: center;
  }
  
  .filter-panel-expanded {
    flex-direction: column;
  }
  
  .filter-panel-expanded .filter-group select,
  .filter-panel-expanded .filter-group input {
    width: 100%;
  }
}

.results-count {
  margin-bottom: 1rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.results-count span {
  color: var(--primary);
  font-weight: 600;
}

.add-all-btn {
  background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
  color: #1a1a1a;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.add-all-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(246, 211, 101, 0.4);
}

.add-all-btn:active {
  transform: translateY(0);
}

.add-all-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Footer */
footer {
  background: var(--bg-card);
  padding: 1.5rem 2rem;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.1);
}

footer p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

footer .disclaimer {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  opacity: 0.7;
}

footer .version {
  font-size: 0.7rem;
  margin-top: 0.5rem;
  color: var(--primary);
  font-weight: 500;
}

/* Card Zoom Modal */
.card-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.card-modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  cursor: pointer;
}

.modal-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalZoom 0.2s ease-out;
}

@keyframes modalZoom {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.8);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}

/* Modal Navigation Arrows */
.modal-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid var(--primary);
  color: white;
  font-size: 3rem;
  width: 60px;
  height: 80px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 2001;
  font-family: Arial, sans-serif;
  line-height: 1;
  padding-bottom: 4px;
}

.modal-nav:hover {
  background: var(--primary);
  transform: translateY(-50%) scale(1.05);
}

.modal-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.modal-prev {
  left: 20px;
}

.modal-next {
  right: 20px;
}

.modal-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.modal-nav:disabled:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: translateY(-50%);
}

.modal-card-nav {
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .modal-nav {
    width: 44px;
    height: 60px;
    font-size: 2rem;
  }
  
  .modal-prev {
    left: 5px;
  }
  
  .modal-next {
    right: 5px;
  }
  
  .pokemon-header {
    gap: 1rem;
  }
  
  .pokemon-sprite {
    width: 80px;
    height: 80px;
  }
}

#modal-card-image {
  max-width: 400px;
  max-height: 70vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-info {
  text-align: center;
  margin-top: 1rem;
  color: var(--text);
}

.modal-info h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.modal-info p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Enhanced Card Detail Modal */
.card-detail-modal {
  max-width: 900px;
  width: 95vw;
}

.modal-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.modal-image-side {
  flex-shrink: 0;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-image-side img {
  max-width: 320px;
  max-height: 450px;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* Card stats positioned in left column after image */
.modal-layout > .card-stats {
  /* Will be appended to .modal-image-side by JavaScript */
}

.modal-info-side {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.modal-info-side h3 {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.card-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.price-section, .buy-section, .card-stats, .price-note-section {
  margin-bottom: 1.5rem;
}

.price-note-section {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 152, 0, 0.05));
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: 12px;
  padding: 1rem;
}

.price-note-section h4 {
  font-size: 1rem;
  color: #ffc107;
  margin-bottom: 0.5rem;
}

.price-note-text {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-primary);
  margin: 0;
}

.price-section h4, .buy-section h4 {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.price-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.price-item {
  background: var(--bg-dark);
  padding: 0.75rem;
  border-radius: 8px;
  text-align: center;
}

.price-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.price-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-green);
}

.price-value.high {
  color: var(--accent-yellow);
}

.price-value.chase {
  color: var(--primary);
}

.price-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.5rem;
  background: var(--bg-dark);
  border-radius: 8px;
  font-size: 0.9rem;
}

.price-meta-label {
  color: var(--text-muted);
  font-weight: 500;
}

.price-meta-value {
  color: var(--accent);
  font-weight: 700;
}

.price-meta-value.muted {
  color: var(--text-muted);
  opacity: 0.5;
}

.price-disclaimer {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  opacity: 0.7;
}

.buy-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.buy-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  background: var(--bg-dark);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.buy-link:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.buy-link.tcgplayer { border-color: #1a82b8; }
.buy-link.tcgplayer:hover { background: #1a82b8; }
.buy-link.ebay { border-color: #e53238; }
.buy-link.ebay:hover { background: #e53238; }
.buy-link.pricecharting { border-color: #2ecc71; }
.buy-link.pricecharting:hover { background: #2ecc71; }

.card-stats {
  background: var(--bg-dark);
  padding: 1rem;
  border-radius: 8px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.stat-row:last-child {
  border-bottom: none;
}

.card-stats .stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.card-stats .stat-value {
  color: var(--text);
  font-weight: 500;
  font-size: 0.85rem;
}

/* Evolution chain in modal */
.evolution-chain {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  flex-wrap: wrap;
}

.evo-stage {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.evo-stage:hover {
  background: var(--bg-hover);
  transform: scale(1.05);
}

.evo-stage.current {
  background: var(--primary);
  color: white;
  font-weight: 600;
}

.evo-stage img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.evo-arrow {
  color: var(--text-muted);
  font-size: 0.7rem;
  margin: 0;
}

/* Responsive modal */
@media (max-width: 768px) {
  .modal-content {
    max-height: 95vh;
    overflow-y: auto;
    padding: 1rem;
    padding-top: 50px;
  }
  
  .card-detail-modal {
    max-height: none;
  }
  
  .modal-layout {
    flex-direction: column;
    align-items: center;
  }
  
  .modal-image-side img {
    max-width: 320px !important;
    max-height: 450px !important;
  }
  
  .modal-info-side {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
  }
  
  /* Reorder modal sections on mobile */
  .modal-info-side > h3 { order: 1; }
  .modal-info-side > .card-subtitle { order: 2; }
  .modal-info-side > .variant-section { order: 3; }
  .modal-info-side > .collection-actions { order: 4; }
  .modal-info-side > .price-section { order: 5; }
  .modal-info-side > .buy-section { order: 6; }
  .modal-info-side > .psa-population-section { order: 7; margin-bottom: 1.5rem; }
  .modal-info-side > .card-stats { order: 8; margin-top: 1.5rem; }
  .modal-info-side > .price-note-section { order: 9; }
  
  .price-grid {
    grid-template-columns: 1fr;
  }
  
  .buy-links {
    justify-content: center;
  }
  
  .stat-row {
    justify-content: center;
    gap: 1rem;
  }
  
  .modal-close {
    top: 10px;
    right: 10px;
    position: fixed;
  }
  
  /* Pokemon detail filters - show button, hide inline filters */
  .pokemon-detail-filters {
    display: none !important;
  }
  
  #pokemon-detail-view .mobile-filter-btn {
    display: block;
  }
}

/* Make cards clickable */
.card-item {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(255, 107, 53, 0.3);
}

.card-item:active {
  transform: translateY(-2px);
}

/* Rarity Legend */
.legend-btn {
  background: var(--bg-card) !important;
  border-color: var(--accent-purple) !important;
  color: var(--accent-purple) !important;
}

.legend-btn:hover {
  background: var(--accent-purple) !important;
  color: white !important;
}

.rarity-legend {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.rarity-legend.hidden {
  display: none;
}

.legend-content {
  background: var(--bg-card);
  border-radius: 16px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 2px solid var(--accent-purple);
}

.legend-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  position: sticky;
  top: 0;
  background: var(--bg-card);
}

.legend-header h3 {
  font-size: 1.25rem;
  color: var(--text);
}

.legend-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.legend-close:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text);
}

.legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  padding: 1.5rem;
}

.legend-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem;
  background: var(--bg-dark);
  border-radius: 12px;
  transition: transform 0.2s ease;
}

.legend-item:hover {
  transform: translateY(-2px);
}

.rarity-badge {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 45px;
  text-align: center;
  flex-shrink: 0;
}

.rarity-badge.SIR { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #000; }
.rarity-badge.HR { background: linear-gradient(135deg, #ffd700, #ffb800, #ffd700); color: #1a1a2e; font-weight: 700; }
.rarity-badge.IR { background: linear-gradient(135deg, #f472b6, #ec4899); color: #fff; }
.rarity-badge.FA { background: linear-gradient(135deg, #60a5fa, #3b82f6); color: #fff; }
.rarity-badge.UR { background: linear-gradient(135deg, #c084fc, #9333ea); color: #fff; }
.rarity-badge.RR { background: #6366f1; color: #fff; }
.rarity-badge.SR { background: linear-gradient(135deg, #fcd34d, #fbbf24); color: #000; }
.rarity-badge.R { background: #10b981; color: #fff; }
.rarity-badge.U { background: #64748b; color: #fff; }
.rarity-badge.C { background: #475569; color: #fff; }
.rarity-badge.ACE { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }
.rarity-badge.MHR { background: linear-gradient(135deg, #ffd700, #ff8c00); color: #000; }
.rarity-badge.V { background: linear-gradient(135deg, #818cf8, #6366f1); color: #fff; }
.rarity-badge.VMAX { background: linear-gradient(135deg, #f472b6, #a855f7); color: #fff; }
.rarity-badge.VSTAR { background: linear-gradient(135deg, #fbbf24, #f472b6); color: #000; }
.rarity-badge.AR { background: linear-gradient(135deg, #06b6d4, #8b5cf6, #ec4899); color: #fff; }
.rarity-badge.RAD { background: linear-gradient(135deg, #34d399, #06b6d4, #a855f7); color: #fff; }
.rarity-badge.SHR { background: linear-gradient(135deg, #1e293b, #475569); color: #fbbf24; }
.rarity-badge.SHV { background: linear-gradient(135deg, #1e293b, #6366f1); color: #fbbf24; }
.rarity-badge.SUR { background: linear-gradient(135deg, #1e293b, #9333ea); color: #fbbf24; }
.rarity-badge.LVX { background: linear-gradient(135deg, #0ea5e9, #0284c7); color: #fff; }
.rarity-badge.PRIME { background: linear-gradient(135deg, #fbbf24, #d97706); color: #000; }
.rarity-badge.LEG { background: linear-gradient(135deg, #f59e0b, #ef4444); color: #fff; }
.rarity-badge.BWR { background: linear-gradient(135deg, #1f2937, #374151); color: #fff; }
.rarity-badge.HR2 { background: linear-gradient(135deg, #a78bfa, #8b5cf6); color: #fff; }

.legend-section {
  grid-column: 1 / -1;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 0 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-top: 0.5rem;
}

.legend-info strong {
  display: block;
  color: var(--text);
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.legend-info p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.card-symbol {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: bold;
  color: #333;
  background: #e0e0e0;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.card-symbol.gold {
  color: #d4a500;
  background: linear-gradient(135deg, #fff8dc, #ffeaa7);
  border: 1px solid #d4a500;
  text-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.card-symbol.ace {
  font-size: 0.7rem;
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  border: 1px solid #7c3aed;
}

.card-symbol.white {
  color: #fff;
  background: linear-gradient(135deg, #555, #333);
  border: 1px solid #666;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Responsive */
@media (max-width: 768px) {
  header {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
  }
  
  .logo {
    flex: 0 0 auto;
  }
  
  .logo-icon {
    font-size: 1.5rem;
  }
  
  .logo h1 {
    font-size: 1.1rem;
  }

  nav {
    flex: 1;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.25rem;
  }
  
  .nav-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    border-width: 1px;
  }

  main {
    padding: 1rem;
  }

  .filters {
    display: none !important;
  }

  .pokemon-filters {
    display: none !important;
  }

  .mobile-filter-btn {
    display: block;
  }

  #pokemon-detail-view .mobile-filter-btn {
    display: block;
  }

  .pokemon-detail-filters {
    display: none !important;
  }

  .filter-group select,
  .filter-group input {
    width: 100%;
  }

  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    padding-top: 0.5rem;
  }
}

/* Variant Selector */
.variant-section {
  margin-bottom: 1rem;
}

.variant-section h4 {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.variant-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.variant-btn {
  padding: 0.4rem 0.8rem;
  border: 2px solid var(--bg-card-hover);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.variant-btn:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
}

.variant-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.variant-btn .variant-price {
  font-size: 0.75rem;
  color: var(--accent-green);
  display: block;
  margin-top: 2px;
}

.variant-btn.active .variant-price {
  color: rgba(255,255,255,0.9);
}

/* Multi-select dropdown */
.multi-select {
  position: relative;
  min-width: 150px;
}

.multi-select-btn {
  width: 100%;
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-size: 0.9rem;
}

.multi-select-btn:hover {
  border-color: var(--primary);
}

.multi-select-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 4px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.multi-select-dropdown .era-header {
  padding: 0.5rem 0.75rem 0.25rem;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--primary);
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#filter-set-dropdown {
  min-width: 280px;
}

.multi-select-dropdown.show {
  display: block;
}

.multi-select-dropdown label {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem 0.4rem 0.2rem 0.15rem;
  cursor: pointer;
  font-size: 0.8rem;
}

.multi-select-dropdown label:hover {
  background: var(--bg-card-hover);
}

.multi-select-dropdown input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--primary);
}

/* Total price display */
.total-price {
  color: var(--accent-green);
  font-weight: 600;
  margin-left: 0.25rem;
}

/* Pokemon stats container */
.pokemon-stats-container {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.5rem;
}

.pokemon-price-stats {
  font-size: 0.85rem;
}

.pokemon-price-stats .price-stat {
  font-size: 0.7rem;
}

/* See all cards link in modal */
.see-all-link {
  display: inline-block;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0;
  transition: color 0.2s;
}

.see-all-link:hover {
  color: var(--primary-light);
  text-decoration: underline;
}

/* Pokemon links container for cards with multiple Pokemon */
.pokemon-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.pokemon-links .pokemon-link {
  padding: 0.25rem 0;
}

.pokemon-links-row {
  flex-direction: column;
  align-items: flex-start !important;
}

/* Active Filters Display */
.active-filters {
  display: none;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.active-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: var(--primary);
  color: white;
  border-radius: 20px;
  font-size: 0.85rem;
}

.active-filter-tag strong {
  font-weight: 600;
}

.active-filter-tag button {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.active-filter-tag button:hover {
  background: rgba(255,255,255,0.4);
}

.clear-all-filters {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  margin-left: auto;
}

.clear-all-filters:hover {
  background: var(--bg);
  color: var(--text);
}

/* PSA Toggle */
.psa-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card, #16213e);
  border-radius: 6px;
  border: none;
  font-size: 0.85rem;
  user-select: none;
  transition: background 0.2s;
}

.psa-toggle-label:hover {
  background: var(--bg-card-hover, #1f2b4a);
}

.psa-toggle-label input {
  display: none;
}

.toggle-slider {
  width: 36px;
  height: 20px;
  background: #4a5568;
  border-radius: 10px;
  position: relative;
  transition: background 0.2s, box-shadow 0.2s;
  border: none;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  top: 1px;
  left: 1px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.psa-toggle-label input:checked + .toggle-slider {
  background: var(--primary, #ff6b35);
  box-shadow: 0 0 8px rgba(255, 107, 53, 0.4);
}

.psa-toggle-label input:checked + .toggle-slider::after {
  transform: translateX(16px);
}

.toggle-text {
  color: var(--text-muted);
  font-weight: 500;
}

.psa-toggle-label input:checked ~ .toggle-text {
  color: var(--primary);
}

/* Hide PSA prices when toggle is off */
.card-prices.hide-psa .psa-price {
  display: none;
}

/* Detail view navigation */
.detail-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.prev-next-nav {
  display: flex;
  gap: 0.5rem;
}

.nav-arrow {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.nav-arrow:hover:not(:disabled) {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

.nav-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.detail-sort-select {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
}

.detail-sort-select:focus {
  outline: none;
  border-color: var(--accent-blue);
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */

/* Small screens (phones) */
@media (max-width: 480px) {
  body {
    padding: 0;
    overflow-x: hidden;
    width: 100%;
    min-width: 0;
  }
  
  main {
    padding: 0.5rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  
  header {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  
  .view {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  
  .era-section {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  
  header {
    padding: 0.75rem;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
  }
  
  header h1 {
    font-size: 1.25rem;
  }
  
  nav {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .nav-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }
  
  /* Filters */
  .filters {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .filter-group {
    width: 100%;
  }
  
  .filter-group select,
  .filter-group input {
    width: 100%;
    min-width: unset;
  }
  
  /* Cards grid - exactly 2 columns on mobile */
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    width: 100%;
  }
  
  .card-item {
    min-width: 0;
    width: 100%;
  }
  
  .card-item .card-image {
    height: auto;
    aspect-ratio: 0.715;
  }
  
  .card-item .card-name {
    font-size: 0.75rem;
  }
  
  .card-price {
    font-size: 0.85rem;
  }
  
  .card-set {
    font-size: 0.65rem;
  }
  
  /* Pokemon/Trainer grid */
  .pokemon-grid,
  #trainer-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem;
  }
  
  .pokemon-entry,
  .trainer-entry {
    padding: 0.5rem;
    gap: 0.5rem;
    min-width: 0;
  }
  
  .pokemon-sprite,
  .trainer-sprite {
    width: 50px;
    height: 50px;
  }
  
  .pokemon-sprite img,
  .trainer-sprite img {
    width: 50px;
    height: 50px;
  }
  
  .pokemon-name {
    font-size: 0.85rem;
  }
  
  .pokemon-stats {
    font-size: 0.7rem;
    flex-direction: column;
    gap: 0.2rem;
  }
  
  /* Set cards */
  .era-section {
    padding: 0.75rem;
    border-radius: 12px;
  }
  
  .era-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
  }
  
  .era-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  
  .set-card {
    padding: 0.5rem;
    min-width: 0;
  }
  
  .set-card h3 {
    font-size: 0.8rem;
  }
  
  .set-card .set-code {
    font-size: 0.65rem;
  }
  
  .set-card .set-stats {
    font-size: 0.7rem;
    gap: 0.25rem;
  }
  
  .set-logo {
    height: 60px;
    margin-bottom: 0.15rem;
    padding: 0.25rem;
  }
  
  .set-logo img {
    max-height: 55px;
  }
  
  /* Section headers */
  .view h2 {
    font-size: 1.25rem;
  }
  
  /* Detail views */
  .detail-nav {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }
  
  .prev-next-nav {
    justify-content: space-between;
  }
  
  .back-btn,
  .nav-arrow {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }
  
  /* Hide set header stats on mobile - use filter drawer instead */
  #set-header .price-stats,
  #set-header .rarity-stats,
  #set-header .variant-types-stats,
  #all-cards-stats .variant-types-stats {
    display: none;
  }
  
  /* But show variant-types-stats inside filter drawer */
  .filter-drawer .variant-types-stats {
    display: flex !important;
  }
  
  /* Modal - no horizontal scroll, vertical scroll OK */
  .modal-content {
    max-width: 100%;
    max-height: none;
    padding: 0 0.5rem;
  }
  
  .card-detail-modal {
    width: calc(100% - 1rem);
    max-width: calc(100% - 1rem);
    max-height: 90vh;
    padding: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  
  .modal-layout {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
  }
  
  .modal-image-side {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  
  .modal-image-side img {
    max-width: 290px !important;
    max-height: 400px !important;
    width: auto !important;
  }
  
  /* Card stats already in modal-image-side via JS */
  .modal-image-side .card-stats {
    width: 100%;
  }
  
  .modal-info-side {
    width: 100%;
  }
  
  .modal-info-side h3 {
    font-size: 1.1rem;
  }
  
  .price-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  
  .price-display {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .variant-buttons {
    flex-wrap: wrap;
  }
  
  .variant-btn {
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
  }
  
  .buy-links {
    flex-wrap: wrap;
  }
  
  .buy-link {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
  }
  
  /* Stats badges */
  .price-stats,
  .rarity-stats {
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  
  .price-stat,
  .rarity-stat {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
  }
  
  /* PSA toggle */
  .psa-toggle {
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
  }
  
  /* Set header */
  .set-header {
    padding: 1rem;
  }
  
  .set-header h2 {
    font-size: 1.1rem;
  }
  
  .set-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .stats-container {
    margin-left: 0;
    padding-left: 0;
    width: 100%;
  }
}

/* Medium screens (tablets) */
@media (min-width: 481px) and (max-width: 768px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .pokemon-grid,
  #trainer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .era-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .modal-layout {
    flex-direction: column;
  }
  
  .filter-group {
    flex: 1 1 auto;
  }
  
  .set-header-row {
    flex-wrap: wrap;
  }
}

/* Pokemon Detail Filters */
.pokemon-detail-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* ============================================
   MOBILE FILTER DRAWER
   ============================================ */

.mobile-filter-btn {
  display: none;
  background: var(--accent-blue);
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  margin-bottom: 1rem;
  width: 100%;
}

.mobile-filter-btn:active {
  opacity: 0.8;
}

.mobile-filter-btn .filter-reset {
  margin-left: 0.5rem;
  padding: 0.15rem 0.5rem;
  background: #ff6b6b;
  border-radius: 4px;
  font-size: 0.75rem;
  color: white !important;
  text-decoration: none;
  display: inline-block;
}

.mobile-filter-btn .filter-reset:active {
  background: #ee5a5a;
}

/* Mobile Top Toggles */
.mobile-top-toggles {
  display: none;
}

.mobile-search-box {
  display: none;
}

@media (max-width: 768px) {
  .mobile-filter-btn {
    display: block;
  }
  
  /* Show mobile toggles and search on mobile */
  .mobile-top-toggles {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    justify-content: flex-start; /* Align left */
    width: 100%;
    flex-wrap: nowrap; /* Keep on one line if possible */
  }
  
  .mobile-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: transparent; /* Remove background */
    padding: 0.25rem 0; /* Minimal padding */
    border-radius: 0;
    border: none; /* Remove border */
    cursor: pointer;
    flex: 0 0 auto; /* Don't grow or shrink */
    min-width: unset; /* Remove min-width constraints */
    margin-right: 1.5rem; /* Space between toggles */
  }
  
  .mobile-toggle-label:last-child {
    margin-right: 0;
  }
  
  .mobile-toggle-label input[type="checkbox"] {
    display: none;
  }
  
  .mobile-toggle-slider {
    width: 36px;
    height: 20px;
    background: #4b5563; /* Darker gray for inactive state */
    border-radius: 10px;
    position: relative;
    transition: background 0.3s;
    flex-shrink: 0;
  }
  
  .mobile-toggle-slider::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
  }
  
  .mobile-toggle-label input[type="checkbox"]:checked + .mobile-toggle-slider {
    background: var(--accent-red);
  }
  
  .mobile-toggle-label input[type="checkbox"]:checked + .mobile-toggle-slider::after {
    transform: translateX(16px);
  }
  
  .mobile-toggle-text {
    font-size: 0.95rem; /* Slightly larger and bold */
    color: var(--text);
    font-weight: 700;
    white-space: nowrap;
  }
  
  .mobile-search-box {
    display: block;
    margin-bottom: 0.75rem;
  }
  
  .mobile-search-box input {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 2px solid var(--accent-blue);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text);
  }
  
  .mobile-search-box input:focus {
    outline: none;
    border-color: var(--primary);
  }
  
  .filters,
  .pokemon-filters,
  .filter-panel {
    display: none !important;
  }
  
  /* Exception: Show sealed products sort buttons on mobile */
  .filter-panel.sealed-products-panel {
    display: block !important;
  }
  
  /* Exception: Show collection and wishlist sort buttons on mobile */
  .filter-panel.collection-filter-panel,
  .filter-panel.wishlist-filter-panel {
    display: block !important;
  }
  
  #all-cards-stats {
    display: none !important;
  }
}

.filter-drawer {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
}

.filter-drawer.open {
  display: block;
}

.filter-drawer-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.filter-drawer-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-radius: 16px 16px 0 0;
  padding: 1.5rem;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.filter-drawer.open .filter-drawer-content {
  transform: translateY(0);
}

.filter-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.filter-drawer-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.filter-drawer-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
}

/* Current state summary in filter drawer */
.filter-drawer-body .current-state {
  background: var(--bg-darker);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 1rem;
}

.filter-drawer-body .sort-summary,
.filter-drawer-body .filter-summary {
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.filter-drawer-body .filter-label {
  color: var(--text-muted);
  margin-right: 0.25rem;
}

.filter-drawer-body .filter-group {
  margin-bottom: 1rem;
}

.filter-drawer-body .filter-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* No extra margin/border for variant filter in mobile drawer */
.filter-drawer-body .filter-group .variant-types-stats,
.filter-drawer-body .filter-group .subtype-stats {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* Left-align stats in mobile filter drawer (override margin-left: auto) */
.filter-drawer-body .rarity-stats,
.filter-drawer-body .price-stats,
.filter-drawer-body .type-stats,
.filter-drawer-body .subtype-stats {
  margin-left: 0;
  justify-content: flex-start;
}

.filter-drawer-body select,
.filter-drawer-body input {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
}

.filter-drawer-apply {
  width: 100%;
  padding: 0.875rem;
  background: var(--accent-blue);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
}

/* Mobile stats badges in filter drawer */
.mobile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.mobile-stats .rarity-stat,
.mobile-stats .price-stat {
  font-size: 0.75rem;
  padding: 0.35rem 0.5rem;
}

/* Mobile toggle switches at top of filter drawer */
.mobile-toggles-top {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 0;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mobile-switch {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  flex: 1;
}

.mobile-switch input {
  display: none;
}

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

.mobile-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  top: 2px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}

.mobile-switch input:checked + .mobile-slider {
  background: var(--primary, #ff6b35);
}

.mobile-switch input:checked + .mobile-slider::before {
  transform: translateX(20px);
}

.mobile-switch-label {
  font-size: 0.9rem;
  color: var(--text);
}

/* Old mobile toggle labels (kept for compatibility) */
.mobile-toggles {
  display: none;
}

.mobile-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.5rem;
  background: var(--bg-dark);
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text);
}

.mobile-toggle-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.mobile-toggle-label span {
  flex: 1;
}

/* Mobile sort buttons */
.mobile-sort-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mobile-sort-buttons .sort-btn {
  padding: 0.5rem 0.75rem;
  border: 1px solid #444;
  border-radius: 8px;
  background: var(--bg-dark);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.mobile-sort-buttons .sort-btn:hover {
  border-color: var(--primary);
  background: rgba(255,255,255,0.05);
}

.mobile-sort-buttons .sort-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  font-weight: 600;
}

@media (max-width: 480px) {
  .view h2 {
    margin-bottom: 0.5rem;
  }
}

/* ==========================================
   GAMES SECTION
   ========================================== */

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 1rem 0;
}

.game-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  background: var(--bg-card-hover);
}

.game-card.coming-soon {
  opacity: 0.6;
  cursor: not-allowed;
}

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

.game-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.game-card h3 {
  color: var(--primary);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.game-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.game-play-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.game-play-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

.coming-soon-badge {
  display: inline-block;
  background: var(--text-muted);
  color: var(--bg-card);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
}

/* Battle Game Styles */
#battle-game-view {
  max-width: 900px;
  margin: 0 auto;
}

.battle-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 2rem;
  position: relative;
}

.battle-header .back-btn {
  width: 100%;
  text-align: left;
  justify-content: flex-start;
  margin-bottom: 0.25rem;
}

.battle-header h2 {
  margin: 0;
  flex: 1;
}

.battle-header .hl-score-display,
.battle-header .guess-score-display {
  margin-left: auto;
}

.battle-phase {
  text-align: center;
  padding: 2rem;
}

.battle-phase.hidden {
  display: none;
}

.battle-instruction {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.battle-start-btn,
.battle-confirm-btn,
.battle-action-btn,
.battle-play-again-btn,
.battle-back-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 25px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin: 0.5rem;
}

.battle-start-btn:hover,
.battle-confirm-btn:hover,
.battle-action-btn:hover,
.battle-play-again-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

.battle-back-btn {
  background: var(--bg-card);
  border: 2px solid var(--text-muted);
}

.battle-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.battle-team {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 1.5rem;
  min-width: 200px;
}

.battle-team h3 {
  margin-bottom: 1rem;
  color: var(--text);
}

.team-slots {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.team-slot {
  width: 85px;
  height: 105px;
  background: var(--bg-darker);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--text-muted);
  position: relative;
  overflow: hidden;
  padding: 4px;
}

.team-slot.filled {
  border-style: solid;
  border-color: var(--primary);
}

.team-slot .slot-number {
  position: absolute;
  top: 4px;
  left: 4px;
  background: var(--primary);
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.team-slot img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.team-slot .slot-pokemon-name,
.team-slot .slot-pokemon {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 2px;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  line-height: 1.2;
}

.battle-vs {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary);
}

.user-pokemon-pool {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}

.pokemon-pool-item {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  border: 3px solid transparent;
  text-align: center;
  min-width: 100px;
  position: relative;
}

.pokemon-pool-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.pokemon-pool-item.selected {
  border-color: var(--accent-green, #22c55e);
  background: rgba(34, 197, 94, 0.1);
}

.pokemon-pool-item.selected::after {
  content: attr(data-order);
  position: absolute;
  top: -10px;
  right: -10px;
  background: var(--accent-green, #22c55e);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.pokemon-pool-item img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.pokemon-pool-item span {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.order-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Battle Arena */
.round-indicator {
  margin-bottom: 1.5rem;
}

#round-label {
  background: var(--primary);
  color: white;
  padding: 0.5rem 1.5rem;
  border-radius: 20px;
  font-weight: 600;
}

/* Old battle-field kept for backward compatibility */
.battle-field {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

/* NEW: Diagonal Battle Layout */
.battle-field-diagonal {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto auto;
  gap: 1rem;
  padding: 1rem;
  min-height: 400px;
  position: relative;
}

.battle-fighter-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.battle-fighter-slot.computer-slot {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  align-self: start;
}

.battle-fighter-slot.user-slot {
  grid-column: 3;
  grid-row: 2;
  justify-self: end;
  align-self: end;
}

.fighter-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.25rem 0.75rem;
  background: var(--bg-card);
  border-radius: 12px;
}

.battle-card-large {
  width: 160px;
  height: 220px;
  background: var(--bg-card);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--border);
  overflow: hidden;
  transition: all 0.3s;
}

.battle-card-large .card-back {
  font-size: 4rem;
  color: var(--text-muted);
}

.battle-card-large.revealed {
  border-color: var(--primary);
}

/* Large pre-battle Pokemon sprite */
.prebattle-pokemon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  animation: float 2s ease-in-out infinite;
}

.prebattle-pokemon img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(255,255,255,0.4));
}

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

/* VS Center area */
.battle-vs-center {
  grid-column: 2;
  grid-row: 1 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.battle-result {
  font-size: 1.3rem;
  font-weight: bold;
  min-height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  background: var(--bg-card);
}

.battle-result.tap-prompt {
  color: var(--accent-primary);
  animation: tapPulse 1.5s ease-in-out infinite;
  cursor: pointer;
  font-size: 1.5rem;
}

@keyframes tapPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
}

.battle-result.fighting {
  color: #f59e0b;
  animation: fightingShake 0.1s ease-in-out infinite;
}

@keyframes fightingShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

.battle-result.computer-wins {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

.battle-result.user-wins {
  color: var(--accent-green, #22c55e);
  background: rgba(34, 197, 94, 0.15);
}

.battle-result.tie {
  color: var(--text-muted);
}

/* Score inline with round */
.battle-score-inline {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 0.5rem;
  color: var(--text);
}

/* Clickable battle arena */
#battle-arena.clickable-battle {
  cursor: pointer;
}

#battle-arena.clickable-battle .battle-field-diagonal {
  transition: transform 0.2s;
}

#battle-arena.clickable-battle:hover .battle-field-diagonal {
  transform: scale(1.01);
}

#battle-arena.clickable-battle:active .battle-field-diagonal {
  transform: scale(0.99);
}

/* Battle card within the large container */
.battle-card-large .battle-card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Legacy classes for compatibility */
.battle-card-container {
  text-align: center;
}

.battle-card-container h4 {
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.battle-card {
  width: 180px;
  height: 250px;
  background: var(--bg-card);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--border);
  overflow: hidden;
  transition: all 0.3s;
}

.battle-card .card-back {
  font-size: 4rem;
  color: var(--text-muted);
}

.battle-card.revealed {
  border-color: var(--primary);
}

.battle-card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.battle-card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.8);
  padding: 0.5rem;
  display: none;
}

.battle-pokemon-name {
  font-weight: 600;
  margin-top: 0.5rem;
  color: var(--text);
  font-size: 1.1rem;
}

.battle-price {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--accent-green, #22c55e);
  margin-top: 0.25rem;
}

.battle-result.ready {
  color: var(--accent-primary);
  animation: pulse 1.5s ease-in-out infinite;
}

.battle-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.battle-preview img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(255,255,255,0.3));
}

.battle-score {
  font-size: 2rem;
  font-weight: bold;
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 1.5rem 0;
}

/* Final Result Screen */
.final-winner {
  padding: 2rem;
  border-radius: 20px;
  margin-bottom: 2rem;
}

.final-winner .trophy {
  font-size: 4rem;
  display: block;
  margin-bottom: 1rem;
}

.final-winner h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.final-winner.user-winner {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.05));
  border: 2px solid var(--accent-green, #22c55e);
}

.final-winner.user-winner h2 {
  color: var(--accent-green, #22c55e);
}

.final-winner.computer-winner {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.05));
  border: 2px solid #ef4444;
}

.final-winner.computer-winner h2 {
  color: #ef4444;
}

.final-winner.tie-result {
  background: linear-gradient(135deg, rgba(156, 163, 175, 0.2), rgba(156, 163, 175, 0.05));
  border: 2px solid var(--text-muted);
}

.battle-summary h3 {
  margin-bottom: 1rem;
}

.round-summaries {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 500px;
  margin: 0 auto;
}

.round-summary {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-left: 4px solid var(--text-muted);
}

.round-summary.user-won {
  border-left-color: var(--accent-green, #22c55e);
}

.round-summary.computer-won {
  border-left-color: #ef4444;
}

.round-num {
  font-weight: 600;
  min-width: 70px;
}

.round-matchup {
  display: flex;
  gap: 0.5rem;
  font-size: 0.9rem;
  flex-wrap: wrap;
  justify-content: center;
}

.round-matchup .vs {
  color: var(--text-muted);
}

/* Mobile responsive for games */
@media (max-width: 600px) {
  .battle-teams {
    flex-direction: column;
  }
  
  .battle-vs {
    transform: rotate(90deg);
  }
  
  .battle-field {
    flex-direction: column;
  }
  
  .battle-card {
    width: 140px;
    height: 195px;
  }
  
  .pokemon-pool-item {
    min-width: 80px;
    padding: 0.75rem;
  }
  
  .pokemon-pool-item img {
    width: 48px;
    height: 48px;
  }
  
  .team-slot {
    width: 60px;
    height: 80px;
  }
  
  .team-slot img {
    width: 40px;
    height: 40px;
  }
}

/* Battle Animation Overlay */
.battle-animation-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, #1a1a3e 0%, #0a0a1a 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
  overflow: hidden;
}

.battle-animation-overlay.active {
  opacity: 1;
}

/* Battle Arena - Circular fighting area */
.battle-arena-circle {
  position: relative;
  width: 280px;
  height: 280px;
  margin-bottom: 1rem;
}

/* Fighter containers */
.battle-fighter {
  position: absolute;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.5s ease;
}

.battle-fighter img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.5));
}

.computer-fighter {
  top: 50%;
  left: 50%;
  transform: translate(-150%, -50%);
}

.user-fighter {
  top: 50%;
  left: 50%;
  transform: translate(50%, -50%);
}

/* Fighting animation - rotate around each other */
.battle-arena-circle.fighting .computer-fighter {
  animation: fightRotateLeft 0.4s ease-in-out infinite;
}

.battle-arena-circle.fighting .user-fighter {
  animation: fightRotateRight 0.4s ease-in-out infinite;
}

.battle-arena-circle.fighting .battle-fighter img {
  animation: fightPulse 0.2s ease-in-out infinite alternate;
}

@keyframes fightRotateLeft {
  0% { transform: translate(-150%, -50%) scale(1) rotate(0deg); }
  25% { transform: translate(-50%, -150%) scale(1.2) rotate(-15deg); }
  50% { transform: translate(50%, -50%) scale(0.9) rotate(0deg); }
  75% { transform: translate(-50%, 50%) scale(1.1) rotate(15deg); }
  100% { transform: translate(-150%, -50%) scale(1) rotate(0deg); }
}

@keyframes fightRotateRight {
  0% { transform: translate(50%, -50%) scale(1) rotate(0deg); }
  25% { transform: translate(-50%, 50%) scale(1.2) rotate(15deg); }
  50% { transform: translate(-150%, -50%) scale(0.9) rotate(0deg); }
  75% { transform: translate(-50%, -150%) scale(1.1) rotate(-15deg); }
  100% { transform: translate(50%, -50%) scale(1) rotate(0deg); }
}

@keyframes fightPulse {
  from { transform: scale(1); filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.5)); }
  to { transform: scale(1.15); filter: drop-shadow(0 0 25px rgba(255, 200, 100, 0.8)); }
}

/* Finished state - spread apart */
.battle-arena-circle.finished .computer-fighter {
  animation: none;
  transform: translate(-180%, -50%);
}

.battle-arena-circle.finished .user-fighter {
  animation: none;
  transform: translate(80%, -50%);
}

.battle-arena-circle.finished .battle-fighter img {
  animation: none;
}

/* Winner/Loser states */
.battle-fighter.winner img {
  animation: winnerCelebrate 0.5s ease infinite alternate !important;
  filter: drop-shadow(0 0 30px #22c55e) !important;
}

.battle-fighter.loser {
  opacity: 0.4;
  transform: scale(0.7) !important;
}

.battle-fighter.loser img {
  filter: grayscale(80%) !important;
}

@keyframes winnerCelebrate {
  from { transform: scale(1) rotate(-5deg); }
  to { transform: scale(1.2) rotate(5deg); }
}

/* Explosions */
.battle-explosions {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.battle-explosion {
  position: absolute;
  animation: explode 0.5s ease-out forwards;
  text-shadow: 0 0 10px rgba(255, 200, 0, 0.8);
}

@keyframes explode {
  0% { transform: scale(0) rotate(0deg); opacity: 1; }
  50% { transform: scale(1.5) rotate(180deg); opacity: 1; }
  100% { transform: scale(2) rotate(360deg); opacity: 0; }
}

/* Fighter names */
.battle-fighter-names {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.fighter-name {
  font-size: 1.1rem;
  font-weight: bold;
  color: white;
}

.vs-badge {
  font-size: 1rem;
  font-weight: bold;
  color: #ef4444;
  padding: 0.25rem 0.5rem;
  background: rgba(239, 68, 68, 0.2);
  border-radius: 4px;
}

/* Prices */
.battle-prices {
  display: flex;
  gap: 4rem;
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.battle-prices.show {
  opacity: 1;
  transform: translateY(0);
}

.fighter-price {
  font-size: 1.8rem;
  font-weight: bold;
  color: #fbbf24;
}

.fighter-price.winner {
  color: #22c55e;
  text-shadow: 0 0 15px rgba(34, 197, 94, 0.6);
  animation: priceGlow 0.5s ease infinite alternate;
}

@keyframes priceGlow {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

/* Winner announcement */
.battle-winner-announce {
  font-size: 2rem;
  font-weight: bold;
  padding: 1rem 2rem;
  border-radius: 12px;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.3s ease;
}

.battle-winner-announce.show {
  opacity: 1;
  transform: scale(1);
}

.battle-winner-announce.user {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  box-shadow: 0 0 30px rgba(34, 197, 94, 0.5);
}

.battle-winner-announce.computer {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.5);
}

.battle-winner-announce.tie {
  background: linear-gradient(135deg, #6b7280, #4b5563);
  color: white;
  box-shadow: 0 0 30px rgba(107, 114, 128, 0.5);
}

/* Team sprite in order phase */
.team-slot .team-sprite {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

@media (max-width: 600px) {
  .battle-arena-circle {
    width: 220px;
    height: 220px;
  }
  
  .battle-fighter img {
    width: 70px;
    height: 70px;
  }
  
  .battle-winner-announce {
    font-size: 1.5rem;
    padding: 0.75rem 1.5rem;
  }
  
  .battle-prices {
    gap: 2rem;
  }
  
  .fighter-price {
    font-size: 1.4rem;
  }
}

/* ==========================================
   PRICE GUESS GAME
   ========================================== */

.guess-score-display {
  margin-left: auto;
  display: flex;
  gap: 1.5rem;
  font-size: 1rem;
  color: var(--text-muted);
}

.guess-score-display span:last-child {
  color: var(--accent-green, #22c55e);
  font-weight: 600;
}

.guess-game-area {
  max-width: 500px;
  margin: 0 auto;
  padding: 1rem;
}

.guess-card-container {
  text-align: center;
  margin-bottom: 2rem;
}

.guess-card {
  width: 250px;
  height: 350px;
  margin: 0 auto 1rem;
  background: var(--bg-card);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--border);
  overflow: hidden;
}

.guess-card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card-loading, .card-error {
  color: var(--text-muted);
  font-size: 1.2rem;
}

.guess-card-name {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--primary);
}

.guess-card-set {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.guess-input-area {
  text-align: center;
}

.guess-prompt {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.guess-input-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.guess-currency {
  font-size: 2rem;
  color: var(--accent-green, #22c55e);
}

#price-guess-input {
  font-size: 2rem;
  width: 150px;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  text-align: center;
}

#price-guess-input:focus {
  outline: none;
  border-color: var(--primary);
}

#price-guess-input.error {
  border-color: #ef4444;
  animation: shake 0.3s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.guess-submit-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 1rem 3rem;
  border-radius: 25px;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.guess-submit-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

.guess-hints {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.hint-btn {
  background: var(--bg-card);
  border: 2px solid var(--border);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.hint-btn:hover:not(.used) {
  border-color: var(--primary);
}

.hint-btn.used {
  opacity: 0.5;
  cursor: not-allowed;
}

#hints-used {
  margin-top: 1rem;
}

.hint-reveal {
  background: var(--bg-card);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

/* Result Area */
.guess-result-area {
  text-align: center;
}

.guess-comparison {
  margin-bottom: 1rem;
}

.guess-comparison .your-guess {
  font-size: 1.5rem;
}

.vs-divider {
  color: var(--text-muted);
  margin: 0.5rem 0;
}

.guess-actual-price {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.guess-actual-price span {
  color: var(--accent-green, #22c55e);
  font-weight: bold;
}

.guess-accuracy {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.guess-accuracy .perfect { color: #fbbf24; }
.guess-accuracy .excellent { color: var(--accent-green, #22c55e); }
.guess-accuracy .good { color: #60a5fa; }
.guess-accuracy .ok { color: var(--text-muted); }
.guess-accuracy .miss { color: #ef4444; }

.guess-round-score {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--accent-green, #22c55e);
  margin-bottom: 1.5rem;
}

.hint-penalty {
  color: #ef4444;
  font-size: 1rem;
  font-weight: normal;
}

.guess-next-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 25px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.guess-next-btn:hover {
  background: var(--primary-dark);
}

/* Final Results */
.guess-final-results {
  text-align: center;
  padding: 2rem;
}

.final-grade {
  font-size: 6rem;
  font-weight: bold;
  line-height: 1;
}

.grade-s { color: #fbbf24; text-shadow: 0 0 20px rgba(251, 191, 36, 0.5); }
.grade-a { color: var(--accent-green, #22c55e); }
.grade-b { color: #60a5fa; }
.grade-c { color: var(--text-muted); }
.grade-d { color: #ef4444; }

.final-points {
  font-size: 1.5rem;
  margin-top: 1rem;
}

.final-percent {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.guess-final-breakdown {
  max-width: 500px;
  margin: 0 auto 2rem;
}

.guess-final-breakdown h3 {
  margin-bottom: 1rem;
}

.guess-rounds-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.guess-round-item {
  background: var(--bg-card);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
}

.round-card-name {
  font-weight: 600;
  flex: 1;
  min-width: 100px;
  text-align: left;
}

.round-prices {
  color: var(--text-muted);
}

.round-diff {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.round-points {
  color: var(--accent-green, #22c55e);
  font-weight: 600;
}

.guess-final-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .guess-card {
    width: 200px;
    height: 280px;
  }
  
  #price-guess-input {
    font-size: 1.5rem;
    width: 120px;
  }
  
  .guess-currency {
    font-size: 1.5rem;
  }
  
  .guess-score-display {
    font-size: 0.85rem;
    gap: 1rem;
  }
  
  .final-grade {
    font-size: 4rem;
  }
}

/* ==========================================
   HIGHER OR LOWER GAME
   ========================================== */

.hl-score-display {
  margin-left: auto;
  display: flex;
  gap: 1.5rem;
  font-size: 1rem;
}

.hl-score-display span:first-child {
  color: var(--primary);
  font-weight: 600;
}

.hl-game-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.hl-card-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 280px;
}

.hl-card {
  width: 200px;
  height: 280px;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  border: 3px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hl-card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hl-card-info {
  text-align: center;
  margin-top: 1rem;
}

.hl-card-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.hl-card-set {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.hl-card-price {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--accent-green, #22c55e);
}

.hl-card-price.hidden {
  visibility: hidden;
}

.hl-card-price.revealing {
  animation: priceReveal 0.8s ease-out;
}

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

.hl-vs-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 0 1rem;
}

.hl-vs {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary);
}

.hl-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border: none;
  border-radius: 12px;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 140px;
}

.hl-btn .hl-arrow {
  font-size: 1.5rem;
}

.hl-higher {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
}

.hl-higher:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.hl-lower {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.hl-lower:hover {
  transform: translateY(2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.hl-result {
  font-size: 1.5rem;
  font-weight: bold;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
}

.hl-result.correct {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}

.hl-result.wrong {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* Game Over */
.hl-game-over {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.hl-game-over-content {
  text-align: center;
  padding: 3rem;
  background: var(--bg-card);
  border-radius: 20px;
  max-width: 400px;
}

.hl-game-over-content h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.hl-final-streak {
  font-size: 5rem;
  font-weight: bold;
  color: var(--accent-green, #22c55e);
  line-height: 1;
}

.hl-game-over-content > p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.hl-new-best {
  font-size: 1.5rem;
  color: #fbbf24;
  margin-bottom: 1.5rem;
  animation: pulse 0.5s ease-in-out infinite alternate;
}

@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

/* Loading text indicator */
.loading-text {
  color: var(--text-muted);
  animation: loadingPulse 1.2s ease-in-out infinite;
}

@keyframes loadingPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.hl-game-over-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Mobile Layout */
@media (max-width: 700px) {
  .hl-game-container {
    flex-direction: column;
  }
  
  .hl-card {
    width: 160px;
    height: 224px;
  }
  
  .hl-vs-section {
    flex-direction: row;
    padding: 1rem 0;
  }
  
  .hl-buttons {
    flex-direction: row;
  }
  
  .hl-btn {
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    min-width: auto;
  }
  
  .hl-card-price {
    font-size: 1.4rem;
  }
  
  .hl-final-streak {
    font-size: 4rem;
  }
}

/* Inline Filters - Pokemon/Trainer List Views */
.inline-filters {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--card-bg);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.inline-sort-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.inline-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.inline-sort-buttons {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  flex: 1;
}

.inline-sort-buttons .sort-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  background: var(--bg-dark);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}

.inline-sort-buttons .sort-btn:hover {
  border-color: var(--accent-red);
}

.inline-sort-buttons .sort-btn.active {
  background: var(--accent-red);
  color: white;
  border-color: var(--accent-red);
}

.inline-search-row {
  display: flex;
}

.inline-search-row input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  background: var(--bg-secondary);
  border: 2px solid #555;
  border-radius: 6px;
  color: var(--text-primary);
}

.inline-search-row input:focus {
  border-color: var(--accent-color);
  outline: none;
}

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


/* Smooth transition for set navigation loading */
#set-cards {
  transition: opacity 0.15s ease;
}



/* Infinite Pokemon Game */
/* ===== INFINITE POKEMON - Infinite Craft Style ===== */
.ip-view {
  padding: 0 !important;
  height: 100vh;
  overflow: hidden;
}

.ip-container {
  display: flex;
  height: calc(100vh - 60px);
  background: #1a1a2e;
}

/* Canvas Area */
.ip-canvas {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 100%);
  position: relative;
}

.ip-canvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.ip-back-btn, .ip-clear-btn {
  padding: 0.5rem 1rem;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.ip-back-btn:hover, .ip-clear-btn:hover {
  background: rgba(255,255,255,0.2);
}

.ip-goal-mini {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #ff6b35, #f7931e);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
}

.ip-goal-mini img {
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
}

.ip-canvas-area {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.ip-canvas-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255,255,255,0.3);
  text-align: center;
  font-size: 1.1rem;
  line-height: 1.6;
  pointer-events: none;
}

/* Draggable Pokemon on canvas */
.ip-element {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem 0.5rem 0.5rem;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  cursor: grab;
  user-select: none;
  transition: box-shadow 0.2s, transform 0.1s;
  z-index: 10;
  font-size: 0.95rem;
  color: #333;
  font-weight: 500;
}

.ip-element:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.ip-element:active, .ip-element.dragging {
  cursor: grabbing;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  transform: scale(1.05);
  z-index: 100;
}

.ip-element img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

.ip-element.new-discovery {
  animation: ipSparkle 0.6s ease;
}

.ip-element.moltres {
  background: linear-gradient(135deg, #fff5e6, #ffe4c4);
  border: 2px solid #f7931e;
}

@keyframes ipSparkle {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* Sidebar */
.ip-sidebar {
  width: 280px;
  background: #12121f;
  border-left: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
}

.ip-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.ip-sidebar-header h3 {
  margin: 0;
  color: white;
  font-size: 1.1rem;
}

.ip-count {
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
}

.ip-sidebar-search {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.ip-sidebar-search input {
  width: 100%;
  padding: 0.6rem 1rem;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 0.9rem;
}

.ip-sidebar-search input::placeholder {
  color: rgba(255,255,255,0.4);
}

.ip-sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

/* Sidebar Pokemon Items */
.ip-sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  margin: 0.25rem 0;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  color: white;
  font-size: 0.9rem;
}

.ip-sidebar-item:hover {
  background: rgba(255,255,255,0.12);
}

.ip-sidebar-item img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

.ip-sidebar-item.moltres {
  background: linear-gradient(135deg, rgba(255,107,53,0.3), rgba(247,147,30,0.3));
}

/* Victory Overlay */
.ip-victory {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.ip-victory.hidden {
  display: none;
}

.ip-victory-content {
  text-align: center;
  padding: 3rem;
  background: linear-gradient(135deg, #1a1a2e, #12121f);
  border-radius: 20px;
  border: 2px solid #f7931e;
}

.ip-victory h2 {
  color: #f7931e;
  font-size: 2rem;
  margin: 0 0 1rem 0;
}

.ip-victory-sprite {
  width: 180px;
  height: 180px;
  image-rendering: pixelated;
  animation: ipFloat 2s ease-in-out infinite;
}

@keyframes ipFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.ip-victory p {
  color: white;
  font-size: 1.2rem;
  margin: 1rem 0;
}

.ip-victory-btns {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.ip-victory-btns button {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  transition: transform 0.2s;
}

.ip-victory-btns button:first-child {
  background: #f7931e;
  color: white;
}

.ip-victory-btns button:last-child {
  background: rgba(255,255,255,0.1);
  color: white;
}

.ip-victory-btns button:hover {
  transform: scale(1.05);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .ip-container {
    flex-direction: column-reverse;
    height: calc(100vh - 60px);
  }
  
  .ip-sidebar {
    width: 100%;
    height: 200px;
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.1);
  }
  
  .ip-sidebar-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
  }
  
  .ip-sidebar-item {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
  }
  
  .ip-sidebar-item img {
    width: 24px;
    height: 24px;
  }
  
  .ip-canvas {
    flex: 1;
    min-height: 0;
  }
}


/* ===== POKEMON TRIVIA GAME ===== */
.trivia-score-display {
  display: flex;
  gap: 1.5rem;
  font-size: 1rem;
  color: var(--text-muted);
}

.trivia-score-display span:last-child {
  color: var(--accent-green, #22c55e);
  font-weight: 600;
}

.trivia-game-area {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
}

.trivia-question-container {
  text-align: center;
  margin-bottom: 2rem;
}

.trivia-card-display {
  margin-bottom: 1rem;
}

.trivia-card-display.hidden {
  display: none;
}

.trivia-card-img {
  max-width: 200px;
  max-height: 280px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.trivia-question {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.trivia-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.trivia-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.trivia-option:hover:not(:disabled) {
  border-color: var(--accent-primary);
  transform: translateX(5px);
  background: var(--bg-hover);
}

.trivia-option .option-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent-primary);
  color: white;
  border-radius: 50%;
  font-weight: bold;
  flex-shrink: 0;
}

.trivia-option .option-text {
  font-size: 1.1rem;
  color: var(--text-primary);
}

.trivia-option:disabled {
  cursor: default;
}

.trivia-option.correct {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.15);
}

.trivia-option.correct .option-letter {
  background: #22c55e;
}

.trivia-option.incorrect {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

.trivia-option.incorrect .option-letter {
  background: #ef4444;
}

.trivia-feedback {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border-radius: 12px;
  text-align: center;
}

.trivia-feedback.hidden {
  display: none;
}

.trivia-result {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.trivia-result.correct {
  color: #22c55e;
}

.trivia-result.incorrect {
  color: #ef4444;
}

.trivia-explanation {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.trivia-next-btn {
  padding: 0.75rem 2rem;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary, #7c3aed));
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.trivia-next-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

/* Trivia Results */
.trivia-results {
  text-align: center;
  padding: 2rem;
}

.trivia-results.hidden {
  display: none;
}

.trivia-final-score {
  margin-bottom: 2rem;
}

.trivia-final-score h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.trivia-score-circle {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: bold;
  margin: 1.5rem auto;
  color: white;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.trivia-score-circle.perfect {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  animation: perfectPulse 1s ease infinite;
}

.trivia-score-circle.excellent {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

.trivia-score-circle.good {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.trivia-score-circle.okay {
  background: linear-gradient(135deg, #f97316, #ea580c);
}

.trivia-score-circle.low {
  background: linear-gradient(135deg, #6b7280, #4b5563);
}

@keyframes perfectPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(251, 191, 36, 0.5); }
  50% { transform: scale(1.05); box-shadow: 0 0 40px rgba(251, 191, 36, 0.8); }
}

.trivia-final-score p {
  font-size: 1.2rem;
  color: var(--text-muted);
}

.trivia-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .trivia-question {
    font-size: 1.2rem;
  }
  
  .trivia-option {
    padding: 0.875rem 1rem;
  }
  
  .trivia-option .option-text {
    font-size: 1rem;
  }
  
  .trivia-card-img {
    max-width: 150px;
  }
  
  .trivia-score-circle {
    width: 120px;
    height: 120px;
    font-size: 2rem;
  }
}

/* ===== STEAL A POKEMON GAME ===== */
.sp-view {
  padding: 0 !important;
  height: 100vh;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.sp-container {
  height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  position: relative;
}

.sp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sp-back-btn, .sp-shop-btn {
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}

.sp-back-btn:hover, .sp-shop-btn:hover {
  background: rgba(255,255,255,0.2);
}

.sp-header-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Rebirth Badge */
.sp-rebirth-badge {
  background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: bold;
  animation: spRebornGlow 2s infinite;
}

@keyframes spRebornGlow {
  0%, 100% { box-shadow: 0 0 5px rgba(249, 115, 22, 0.5); }
  50% { box-shadow: 0 0 15px rgba(249, 115, 22, 0.8); }
}

/* Reborn Button */
/* Reborn container with bird indicator */
.sp-reborn-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.sp-bird-indicator {
  display: flex;
  gap: 0.15rem;
  font-size: 0.7rem;
}

.sp-bird-owned {
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.8));
  animation: spBirdGlow 1s ease-in-out infinite alternate;
}

.sp-bird-missing {
  opacity: 0.3;
  filter: grayscale(100%);
}

@keyframes spBirdGlow {
  from { transform: scale(1); }
  to { transform: scale(1.15); }
}

.sp-reborn-btn {
  position: relative;
  padding: 0.5rem 0.75rem;
  background: #374151;
  border: 2px solid #4b5563;
  border-radius: 8px;
  color: #9ca3af;
  cursor: not-allowed;
  font-size: 0.75rem;
  font-weight: bold;
  overflow: hidden;
  min-width: 80px;
  transition: all 0.3s;
}

.sp-reborn-btn .sp-reborn-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #f97316 0%, #ef4444 100%);
  width: 0%;
  transition: width 0.3s;
}

.sp-reborn-btn .sp-reborn-text {
  position: relative;
  z-index: 1;
}

.sp-reborn-btn.ready {
  background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
  border-color: #fb923c;
  color: white;
  cursor: pointer;
  animation: spRebornPulse 1.5s infinite;
}

.sp-reborn-btn.ready .sp-reborn-progress {
  display: none;
}

@keyframes spRebornPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 10px rgba(249, 115, 22, 0.5); }
  50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(249, 115, 22, 0.8); }
}

.sp-reborn-btn.ready:hover {
  transform: scale(1.1);
}

/* Reborn Overlay Animation */
.sp-reborn-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.9) 0%, rgba(0,0,0,0.95) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: spRebornFlash 2.5s ease-out forwards;
}

@keyframes spRebornFlash {
  0% { opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

.sp-reborn-content {
  text-align: center;
  animation: spRebornZoom 0.5s ease-out;
}

@keyframes spRebornZoom {
  0% { transform: scale(0) rotate(-180deg); }
  60% { transform: scale(1.2) rotate(10deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.sp-reborn-flame {
  font-size: 6rem;
  animation: spFlameFloat 0.5s ease-in-out infinite alternate;
}

@keyframes spFlameFloat {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-10px) scale(1.1); }
}

.sp-reborn-content h2 {
  color: white;
  font-size: 3rem;
  margin: 0.5rem 0;
  text-shadow: 0 0 30px rgba(249, 115, 22, 1);
}

.sp-reborn-content p {
  color: #fde68a;
  font-size: 1.2rem;
  margin: 0.25rem 0;
}

.sp-reborn-bonus {
  background: rgba(255,255,255,0.2);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  margin-top: 0.5rem !important;
}

/* Card Count */
.sp-card-count {
  background: rgba(0,0,0,0.2);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.65rem;
  margin-left: 0.5rem;
}

.sp-card-count.full {
  background: #ef4444;
  color: white;
  animation: pulse 1s infinite;
}

/* ============================================
   COMBINE CARDS FEATURE
   ============================================ */

.sp-cards-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sp-combine-toggle {
  margin-left: auto;
  padding: 0.2rem 0.5rem;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  border: none;
  border-radius: 4px;
  color: white;
  font-size: 0.65rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.sp-combine-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.5);
}

.sp-combine-toggle.active {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  animation: pulse 1s infinite;
}

.sp-combine-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.2) 0%, rgba(124, 58, 237, 0.3) 100%);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  border: 1px solid rgba(139, 92, 246, 0.5);
}

.sp-combine-bar span {
  color: white;
  font-size: 0.75rem;
}

.sp-combine-btn {
  padding: 0.3rem 0.6rem;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border: 2px solid #d97706;
  border-radius: 6px;
  color: #78350f;
  font-size: 0.7rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.sp-combine-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 2px 10px rgba(251, 191, 36, 0.5);
}

.sp-combine-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Card selection in combine mode */
.sp-card.sp-selectable {
  cursor: pointer;
  position: relative;
}

.sp-card.sp-selectable::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 3px dashed rgba(139, 92, 246, 0.5);
  border-radius: 6px;
  pointer-events: none;
  transition: all 0.2s;
}

.sp-card.sp-selectable:hover::after {
  border-color: #8b5cf6;
  background: rgba(139, 92, 246, 0.1);
}

.sp-card.sp-selected {
  transform: scale(1.05);
  z-index: 10;
}

.sp-card.sp-selected::after {
  border: 3px solid #8b5cf6;
  background: rgba(139, 92, 246, 0.2);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
}

.sp-select-check {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  background: #8b5cf6;
  border-radius: 50%;
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Fusion card styling */
.sp-card.sp-fusion-card {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 50%, #fbbf24 100%);
  border: 2px solid #f59e0b;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.sp-card.sp-fusion-card::before {
  content: '⚡';
  position: absolute;
  top: -5px;
  left: -5px;
  font-size: 0.8rem;
}

/* Sell mode */
.sp-sell-toggle {
  margin-left: auto;
  padding: 0.2rem 0.5rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  border-radius: 4px;
  color: white;
  font-size: 0.65rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  margin-right: 0.3rem;
}

.sp-sell-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.5);
}

.sp-sell-toggle.active {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  animation: pulse 1s infinite;
}

.sp-card.sp-sellable {
  cursor: pointer;
  position: relative;
}

.sp-card.sp-sellable::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 3px dashed rgba(16, 185, 129, 0.5);
  border-radius: 6px;
  pointer-events: none;
  transition: all 0.2s;
}

.sp-card.sp-sellable:hover::after {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.2);
}

.sp-card.sp-sellable:hover {
  transform: scale(1.05);
}

.sp-sell-price {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: bold;
  z-index: 20;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
  pointer-events: none;
  animation: spSellPulse 1.5s ease-in-out infinite;
}

@keyframes spSellPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.1); }
}

/* Combine animation overlay */
.sp-combine-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.9) 0%, rgba(0,0,0,0.95) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: spCombineFlash 2s ease-out forwards;
}

@keyframes spCombineFlash {
  0% { opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

.sp-combine-content {
  text-align: center;
  animation: spCombineZoom 0.5s ease-out;
}

@keyframes spCombineZoom {
  0% { transform: scale(0) rotate(-180deg); }
  60% { transform: scale(1.2) rotate(10deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.sp-combine-sparks {
  font-size: 3rem;
  animation: spCombineSparks 0.3s ease-in-out infinite alternate;
}

@keyframes spCombineSparks {
  from { transform: scale(1); filter: brightness(1); }
  to { transform: scale(1.2); filter: brightness(1.5); }
}

.sp-combine-content h2 {
  color: white;
  font-size: 2.5rem;
  margin: 0.5rem 0;
  text-shadow: 0 0 30px rgba(139, 92, 246, 1);
}

.sp-combine-card {
  background: linear-gradient(135deg, #fef3c7, #fbbf24);
  padding: 0.5rem;
  border-radius: 10px;
  display: inline-block;
  margin: 0.5rem 0;
  box-shadow: 0 0 30px rgba(251, 191, 36, 0.8);
}

.sp-combine-card img {
  width: 100px;
  height: 140px;
  object-fit: contain;
  border-radius: 6px;
}

.sp-combine-name {
  color: #fbbf24;
  font-size: 1.2rem;
  font-weight: bold;
  margin: 0.5rem 0 0 0;
}

.sp-combine-income {
  color: #4ade80;
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0;
}

.sp-stats {
  display: flex;
  gap: 1.5rem;
  font-size: 1.1rem;
  color: white;
}

.sp-coins {
  color: #ffd700;
  font-weight: bold;
}

.sp-income {
  color: #4ade80;
}

.sp-game-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  overflow-y: auto;
}

/* ============================================
   YOUR BASE - POKEMON CENTER STYLE
   ============================================ */

.sp-base {
  position: relative;
  background: transparent;
  padding: 0;
  border: none;
}

.sp-your-base {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Roof */
.sp-base-roof {
  width: 100%;
  height: 60px;
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  border-radius: 20px 20px 0 0;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  box-shadow: 0 -4px 20px rgba(239, 68, 68, 0.3);
}

.sp-base-roof::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: #991b1b;
}

/* Pokeball Logo on Roof */
.sp-roof-pokeball {
  width: 50px;
  height: 50px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  overflow: hidden;
}

.sp-pokeball-top {
  width: 100%;
  height: 50%;
  background: #ef4444;
  border-radius: 25px 25px 0 0;
}

.sp-pokeball-line {
  width: 100%;
  height: 6px;
  background: #1f2937;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.sp-pokeball-button {
  width: 16px;
  height: 16px;
  background: white;
  border: 4px solid #1f2937;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

/* Building */
.sp-base-building {
  width: 100%;
  background: linear-gradient(180deg, #fef3c7 0%, #fde68a 100%);
  border-left: 4px solid #d97706;
  border-right: 4px solid #d97706;
  padding: 1rem;
  position: relative;
  min-height: 200px;
}

.sp-base-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px dashed rgba(0,0,0,0.1);
}

.sp-base-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sp-base-icon {
  font-size: 1.5rem;
}

.sp-base-header h3 {
  margin: 0;
  color: #92400e;
  font-size: 1.1rem;
  text-shadow: 1px 1px 0 rgba(255,255,255,0.5);
}

.sp-defense {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sp-shield-indicator {
  padding: 0.25rem 0.5rem;
  background: rgba(0,0,0,0.1);
  border-radius: 4px;
  font-size: 0.75rem;
  color: #92400e;
}

.sp-shield-indicator.active {
  background: #4ade80;
  color: white;
  animation: pulse 1s infinite;
}

.sp-shield-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.75rem;
  background: linear-gradient(180deg, #4ade80 0%, #22c55e 100%);
  border: 2px solid #16a34a;
  border-radius: 8px;
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: all 0.2s;
}

.sp-shield-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.sp-shield-icon {
  font-size: 1rem;
}

/* Windows */
.sp-base-windows {
  display: flex;
  justify-content: space-around;
  margin: 0.75rem 0;
}

.sp-window {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  border: 3px solid #92400e;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.sp-window::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 3px;
  background: #92400e;
}

.sp-window::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #92400e;
}

.sp-window-glow {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  background: rgba(255,255,255,0.6);
  border-radius: 2px;
}

/* Cards Container */
.sp-cards-container {
  background: rgba(255,255,255,0.5);
  border: 2px solid rgba(0,0,0,0.1);
  border-radius: 8px;
  padding: 0.75rem;
  margin: 0.5rem 0;
}

.sp-cards-label {
  font-size: 0.7rem;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.sp-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 0.5rem;
  min-height: 80px;
}

.sp-card {
  background: white;
  border-radius: 6px;
  padding: 0.3rem;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  border: 2px solid #e5e7eb;
}

.sp-card:hover {
  transform: scale(1.08) rotate(2deg);
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
  border-color: #fbbf24;
  z-index: 10;
}

.sp-card img {
  width: 55px;
  height: 77px;
  object-fit: contain;
  border-radius: 3px;
}

.sp-card-income {
  font-size: 0.65rem;
  color: #16a34a;
  font-weight: bold;
  margin-top: 0.2rem;
  background: #dcfce7;
  border-radius: 3px;
  padding: 1px 4px;
}

.sp-card-name {
  font-size: 0.6rem;
  color: #4b5563;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.15rem;
}

/* Door */
.sp-base-door {
  width: 40px;
  height: 55px;
  background: linear-gradient(180deg, #92400e 0%, #78350f 100%);
  border-radius: 4px 4px 0 0;
  margin: 0 auto;
  position: relative;
  border: 2px solid #78350f;
}

.sp-door-window {
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border-radius: 2px;
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  border: 2px solid #78350f;
}

/* Ground */
.sp-base-ground {
  width: 110%;
  height: 25px;
  background: linear-gradient(180deg, #65a30d 0%, #4d7c0f 100%);
  border-radius: 0 0 12px 12px;
  position: relative;
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding-top: 5px;
  margin-left: -5%;
}

.sp-grass {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 12px solid #84cc16;
}

/* ============================================
   RAID SECTION - BATTLE ARENA STYLE
   ============================================ */

.sp-raid-section {
  background: linear-gradient(180deg, #1f1f1f 0%, #2d1b4e 100%);
  border: 3px solid #7c3aed;
  border-radius: 16px;
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

.sp-raid-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(239, 68, 68, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(124, 58, 237, 0.1) 0%, transparent 40%);
  pointer-events: none;
}

.sp-raid-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.sp-raid-icon {
  font-size: 1.5rem;
  animation: spSwordPulse 2s infinite;
}

@keyframes spSwordPulse {
  0%, 100% { transform: rotate(-10deg) scale(1); }
  50% { transform: rotate(10deg) scale(1.1); }
}

.sp-raid-section h3 {
  margin: 0;
  color: #c4b5fd;
  font-size: 1.1rem;
  text-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
}

.sp-trainers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
}

.sp-trainer {
  background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
  border-radius: 12px;
  padding: 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  border: 2px solid rgba(255,255,255,0.1);
  position: relative;
  overflow: hidden;
}

.sp-trainer::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s;
}

.sp-trainer:hover::before {
  left: 100%;
}

.sp-trainer:hover {
  border-color: #ff6b35;
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 25px rgba(255, 107, 53, 0.3);
}

.sp-trainer-avatar {
  font-size: 2.8rem;
  margin-bottom: 0.4rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  transition: transform 0.3s;
}

.sp-trainer:hover .sp-trainer-avatar {
  transform: scale(1.15) rotate(-5deg);
}

.sp-trainer-name {
  color: white;
  font-weight: bold;
  font-size: 0.85rem;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.sp-trainer-cards {
  color: rgba(255,255,255,0.7);
  font-size: 0.75rem;
  margin-top: 0.3rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
}

.sp-trainer-value {
  color: #fbbf24;
  font-size: 0.8rem;
  margin-top: 0.3rem;
  font-weight: bold;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

/* Shop Modal */
.sp-shop {
  position: absolute;
  top: 60px;
  right: 1rem;
  width: 300px;
  max-height: 80%;
  background: #1a1a2e;
  border: 2px solid #60a5fa;
  border-radius: 12px;
  z-index: 100;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sp-shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sp-shop-header h3 {
  margin: 0;
  color: white;
}

.sp-shop-header button {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

.sp-shop-cards {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sp-shop-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255,255,255,0.05);
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.sp-shop-item:hover {
  background: rgba(255,255,255,0.1);
}

.sp-shop-item img {
  width: 50px;
  height: 70px;
  object-fit: contain;
  border-radius: 4px;
  background: white;
}

.sp-shop-item-info {
  flex: 1;
}

.sp-shop-item-name {
  color: white;
  font-weight: bold;
  font-size: 0.85rem;
}

.sp-shop-item-income {
  color: #4ade80;
  font-size: 0.75rem;
}

.sp-shop-item-price {
  color: #ffd700;
  font-weight: bold;
}

.sp-refresh-btn {
  margin: 1rem;
  padding: 0.75rem;
  background: #60a5fa;
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: bold;
  cursor: pointer;
}

/* Raid Modal */
.sp-raid-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.sp-raid-content {
  background: #1a1a2e;
  padding: 2rem;
  border-radius: 16px;
  text-align: center;
  min-width: 300px;
  border: 2px solid #ff6b35;
}

.sp-raid-content h3 {
  color: #ff6b35;
  margin: 0 0 1.5rem 0;
}

.sp-raid-progress {
  height: 20px;
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.sp-raid-bar {
  height: 100%;
  background: linear-gradient(90deg, #ff6b35, #f7931e);
  width: 0%;
  transition: width 0.1s linear;
}

#sp-raid-status {
  color: white;
  margin-bottom: 1rem;
}

.sp-raid-loot {
  background: rgba(74,222,128,0.2);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.sp-raid-loot img {
  width: 80px;
  height: 112px;
  border-radius: 6px;
  background: white;
}

.sp-raid-close {
  padding: 0.75rem 2rem;
  background: #4ade80;
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: bold;
  cursor: pointer;
}

/* Alert Modal */
.sp-alert {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: spAlertPulse 0.5s infinite;
}

@keyframes spAlertPulse {
  0%, 100% { background: rgba(255,0,0,0.2); }
  50% { background: rgba(255,0,0,0.4); }
}

.sp-alert-content {
  background: #1a1a2e;
  padding: 2rem;
  border-radius: 16px;
  text-align: center;
  border: 3px solid #ef4444;
}

.sp-alert-content h3 {
  color: #ef4444;
  margin: 0 0 1rem 0;
  font-size: 1.5rem;
}

.sp-alert-content p {
  color: white;
  margin-bottom: 1.5rem;
}

.sp-alert-content button {
  padding: 1rem 2rem;
  background: #ef4444;
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: bold;
  font-size: 1.1rem;
  cursor: pointer;
}

/* ============================================
   STEAL A POKEMON - ANIMATIONS
   ============================================ */

/* Pokemon Sprite Popup */
.sp-pokemon-popup {
  position: fixed;
  z-index: 500;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sp-pokemon-popup img {
  width: 120px;
  height: 120px;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}

.sp-pokemon-popup .sp-pokemon-name {
  color: white;
  font-weight: bold;
  font-size: 1rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
  margin-top: 0.25rem;
}

/* Pokemon entrance animation */
@keyframes spPokemonEnter {
  0% { transform: scale(0) rotate(-180deg); opacity: 0; filter: brightness(3); }
  50% { transform: scale(1.3) rotate(10deg); opacity: 1; filter: brightness(1.5); }
  70% { transform: scale(0.9) rotate(-5deg); filter: brightness(1); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes spPokemonExit {
  0% { transform: scale(1) translateY(0); opacity: 1; }
  100% { transform: scale(0.3) translateY(-100px); opacity: 0; }
}

.sp-pokemon-popup.entering {
  animation: spPokemonEnter 0.6s ease-out forwards;
}

.sp-pokemon-popup.exiting {
  animation: spPokemonExit 0.4s ease-in forwards;
}

/* Type-based particle effects */
.sp-type-particle {
  position: fixed;
  pointer-events: none;
  z-index: 400;
  font-size: 1.5rem;
}

@keyframes spFireParticle {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-80px) scale(0); opacity: 0; }
}

@keyframes spWaterParticle {
  0% { transform: translateY(0) translateX(0) scale(1); opacity: 1; }
  100% { transform: translateY(60px) translateX(var(--drift)) scale(0.5); opacity: 0; }
}

@keyframes spElectricParticle {
  0%, 100% { opacity: 0; transform: scale(0.5); }
  10%, 30%, 50%, 70%, 90% { opacity: 1; transform: scale(1.2); }
  20%, 40%, 60%, 80% { opacity: 0.5; transform: scale(0.8); }
}

@keyframes spGrassParticle {
  0% { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
  100% { transform: translateY(-60px) rotate(360deg) scale(0); opacity: 0; }
}

@keyframes spPsychicParticle {
  0% { transform: scale(0) rotate(0deg); opacity: 0.8; }
  50% { transform: scale(1.5) rotate(180deg); opacity: 1; }
  100% { transform: scale(0) rotate(360deg); opacity: 0; }
}

@keyframes spDarkParticle {
  0% { transform: scale(1); opacity: 0.8; filter: blur(0px); }
  100% { transform: scale(2); opacity: 0; filter: blur(4px); }
}

@keyframes spFightingParticle {
  0% { transform: translateX(0) scale(1); opacity: 1; }
  50% { transform: translateX(var(--tx)) scale(1.3); }
  100% { transform: translateX(calc(var(--tx) * 2)) scale(0); opacity: 0; }
}

@keyframes spDragonParticle {
  0% { transform: scale(0) rotate(0deg); opacity: 1; }
  50% { transform: scale(1.5) rotate(180deg); }
  100% { transform: scale(0) rotate(360deg); opacity: 0; }
}

@keyframes spSteelParticle {
  0% { transform: scale(1) rotate(0deg); opacity: 1; }
  100% { transform: scale(0) rotate(720deg); opacity: 0; }
}

@keyframes spFairyParticle {
  0% { transform: scale(0); opacity: 1; }
  50% { transform: scale(1.2); }
  100% { transform: scale(0) translateY(-40px); opacity: 0; }
}

.sp-type-fire { animation: spFireParticle 0.8s ease-out forwards; color: #ff6b35; }
.sp-type-water { animation: spWaterParticle 1s ease-in forwards; color: #3b82f6; }
.sp-type-electric { animation: spElectricParticle 0.6s ease-in-out forwards; color: #fbbf24; }
.sp-type-grass { animation: spGrassParticle 1s ease-out forwards; color: #22c55e; }
.sp-type-psychic { animation: spPsychicParticle 0.8s ease-in-out forwards; color: #ec4899; }
.sp-type-dark { animation: spDarkParticle 0.6s ease-out forwards; color: #6b7280; }
.sp-type-fighting { animation: spFightingParticle 0.5s ease-out forwards; color: #dc2626; }
.sp-type-dragon { animation: spDragonParticle 0.7s ease-in-out forwards; color: #7c3aed; }
.sp-type-steel { animation: spSteelParticle 0.6s linear forwards; color: #9ca3af; }
.sp-type-fairy { animation: spFairyParticle 0.8s ease-out forwards; color: #f472b6; }
.sp-type-normal { animation: spSparkle 0.6s ease-out forwards; color: #a8a878; }
.sp-type-ice { animation: spWaterParticle 0.8s ease-out forwards; color: #7dd3fc; }
.sp-type-ghost { animation: spPsychicParticle 1s ease-in-out forwards; color: #8b5cf6; }
.sp-type-poison { animation: spDarkParticle 0.7s ease-out forwards; color: #a855f7; }
.sp-type-ground { animation: spFightingParticle 0.6s ease-out forwards; color: #d97706; }
.sp-type-rock { animation: spSteelParticle 0.5s linear forwards; color: #78716c; }
.sp-type-bug { animation: spGrassParticle 0.7s ease-out forwards; color: #84cc16; }
.sp-type-flying { animation: spGrassParticle 0.9s ease-out forwards; color: #38bdf8; }

/* Attack animation overlay */
.sp-attack-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 350;
}

@keyframes spFlamethrower {
  0% { background: radial-gradient(ellipse at 30% 50%, rgba(255,107,53,0.8) 0%, transparent 50%); }
  50% { background: radial-gradient(ellipse at 60% 50%, rgba(255,200,50,0.6) 0%, transparent 60%); }
  100% { background: radial-gradient(ellipse at 90% 50%, rgba(255,107,53,0) 0%, transparent 40%); }
}

@keyframes spThunderbolt {
  0%, 100% { background: transparent; }
  10%, 30%, 50% { background: rgba(251,191,36,0.4); }
  20%, 40% { background: rgba(251,191,36,0.1); }
}

@keyframes spHydropump {
  0% { background: linear-gradient(90deg, rgba(59,130,246,0.6) 0%, transparent 30%); }
  100% { background: linear-gradient(90deg, transparent 70%, rgba(59,130,246,0.6) 100%); }
}

.sp-attack-fire { animation: spFlamethrower 0.8s ease-out forwards; }
.sp-attack-electric { animation: spThunderbolt 0.5s ease-in-out forwards; }
.sp-attack-water { animation: spHydropump 0.6s ease-out forwards; }

/* Card pop in animation */
@keyframes spCardPopIn {
  0% { transform: scale(0) rotate(-10deg); opacity: 0; }
  50% { transform: scale(1.2) rotate(5deg); }
  70% { transform: scale(0.95) rotate(-2deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.sp-card.sp-pop-in {
  animation: spCardPopIn 0.5s ease-out forwards;
}

/* Sparkle effect */
@keyframes spSparkle {
  0%, 100% { opacity: 0; transform: scale(0) rotate(0deg); }
  50% { opacity: 1; transform: scale(1) rotate(180deg); }
}

.sp-sparkle {
  position: absolute;
  width: 20px;
  height: 20px;
  background: radial-gradient(circle, #ffd700 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: spSparkle 0.6s ease-out forwards;
}

/* Coin float animation */
@keyframes spCoinFloat {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-60px) scale(0.5); opacity: 0; }
}

.sp-coin-float {
  position: fixed;
  font-size: 1.2rem;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  pointer-events: none;
  z-index: 1000;
  animation: spCoinFloat 1s ease-out forwards;
}

/* Pokeball throw animation */
@keyframes spPokeballThrow {
  0% { transform: translateX(-100px) translateY(50px) rotate(0deg); opacity: 1; }
  50% { transform: translateX(100px) translateY(-30px) rotate(360deg); }
  100% { transform: translateX(200px) translateY(0) rotate(720deg); opacity: 0; }
}

.sp-pokeball {
  position: fixed;
  font-size: 3rem;
  pointer-events: none;
  z-index: 300;
  animation: spPokeballThrow 0.8s ease-in-out forwards;
}

/* Shield bubble effect */
@keyframes spShieldActivate {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.5); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes spShieldPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(74, 222, 128, 0.5), inset 0 0 20px rgba(74, 222, 128, 0.2); }
  50% { box-shadow: 0 0 40px rgba(74, 222, 128, 0.8), inset 0 0 30px rgba(74, 222, 128, 0.4); }
}

.sp-your-base.sp-shielded {
  animation: spShieldActivate 0.5s ease-out forwards;
}

.sp-your-base.sp-shielded::before {
  content: '🛡️';
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2.5rem;
  animation: spShieldPulse 2s infinite;
}

.sp-shield-active {
  position: relative;
  border-color: #4ade80 !important;
  animation: spShieldPulse 2s infinite;
}

/* Screen shake on raid */
@keyframes spScreenShake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.sp-container.sp-shaking {
  animation: spScreenShake 0.5s ease-in-out;
}

/* Raid incoming flash */
@keyframes spRaidFlash {
  0%, 50%, 100% { background: rgba(255, 0, 0, 0.2); }
  25%, 75% { background: rgba(255, 0, 0, 0.5); }
}

.sp-view.sp-raid-incoming {
  animation: spRaidFlash 1s ease-in-out;
}

/* Success celebration */
@keyframes spCelebrate {
  0% { transform: scale(1); }
  25% { transform: scale(1.1) rotate(-5deg); }
  50% { transform: scale(1.15) rotate(5deg); }
  75% { transform: scale(1.1) rotate(-3deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.sp-celebrate {
  animation: spCelebrate 0.6s ease-out;
}

/* Stolen card fly animation */
@keyframes spCardFlyIn {
  0% { transform: translateX(200px) translateY(-100px) rotate(30deg) scale(0.3); opacity: 0; }
  70% { transform: translateX(-10px) translateY(10px) rotate(-5deg) scale(1.1); opacity: 1; }
  100% { transform: translateX(0) translateY(0) rotate(0deg) scale(1); opacity: 1; }
}

.sp-card-fly-in {
  animation: spCardFlyIn 0.7s ease-out forwards;
}

/* Trainer shake when being raided */
@keyframes spTrainerShake {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  20% { transform: translateX(-3px) rotate(-2deg); }
  40% { transform: translateX(3px) rotate(2deg); }
  60% { transform: translateX(-2px) rotate(-1deg); }
  80% { transform: translateX(2px) rotate(1deg); }
}

.sp-trainer.sp-being-raided {
  animation: spTrainerShake 0.3s ease-in-out infinite;
  border-color: #ff6b35 !important;
  background: rgba(255, 107, 53, 0.2) !important;
}

/* Explosion effect for fails */
@keyframes spExplode {
  0% { transform: scale(0); opacity: 1; }
  100% { transform: scale(3); opacity: 0; }
}

.sp-explosion {
  position: fixed;
  width: 50px;
  height: 50px;
  background: radial-gradient(circle, #ff6b35 0%, #ef4444 50%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 300;
  animation: spExplode 0.4s ease-out forwards;
}

/* Coin burst effect */
@keyframes spCoinBurst {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

.sp-coin-burst {
  position: fixed;
  font-size: 1.5rem;
  pointer-events: none;
  z-index: 300;
  animation: spCoinBurst 0.8s ease-out forwards;
}

/* Mobile */
@media (max-width: 768px) {
  .sp-shop {
    width: calc(100% - 2rem);
    right: 1rem;
    left: 1rem;
  }
  
  .sp-trainers {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop filter chips */
.desktop-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.desktop-chips .type-stat,
.desktop-chips .subtype-stat,
.desktop-chips .variant-type-stat,
.desktop-chips .psa-pop-stat,
.desktop-chips .psa-rate-stat,
.desktop-chips .sales-stat {
  padding: 0.25rem 0.6rem;
  border-radius: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.8rem;
  white-space: nowrap;
}

.desktop-chips .type-stat:hover,
.desktop-chips .subtype-stat:hover,
.desktop-chips .variant-type-stat:hover,
.desktop-chips .psa-pop-stat:hover,
.desktop-chips .psa-rate-stat:hover,
.desktop-chips .sales-stat:hover {
  border-color: var(--accent-red);
}

.desktop-chips .type-stat.active,
.desktop-chips .subtype-stat.active,
.desktop-chips .variant-type-stat.active,
.desktop-chips .psa-pop-stat.active,
.desktop-chips .psa-rate-stat.active,
.desktop-chips .sales-stat.active {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: white;
}

.filter-panel-expanded .filter-group {
  margin-bottom: 0.75rem;
}

.filter-panel-expanded .filter-group > label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Set filters desktop chips */
.set-filters .desktop-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* ==========================================
   RARITY RUSH GAME
   ========================================== */

#rarity-rush-view {
  padding: 1rem;
  min-height: 100vh;
}

#rarity-rush-view.active {
  display: flex;
  flex-direction: column;
}

.rr-score-display {
  display: flex;
  gap: 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}

#rr-game-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  margin-top: 1rem;
  background: linear-gradient(180deg, var(--bg) 0%, var(--card-bg) 100%);
  border-radius: 1rem;
  overflow: hidden;
  min-height: 500px;
}

#rr-card-zone {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.rr-falling-card {
  position: absolute;
  width: 80px;
  height: 112px;
  cursor: grab;
  transition: transform 0.1s;
  z-index: 10;
}

.rr-falling-card:hover {
  transform: scale(1.1);
  z-index: 20;
}

.rr-falling-card.rr-dragging {
  opacity: 0.8;
  transform: scale(1.15);
  z-index: 100;
  cursor: grabbing;
}

.rr-falling-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  pointer-events: none;
}

.rr-rarity-tag {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: white;
  font-size: 0.55rem;
  padding: 2px 6px;
  border-radius: 8px;
  white-space: nowrap;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
}

#rr-bins {
  display: flex;
  justify-content: space-around;
  padding: 1rem;
  background: var(--card-bg);
  border-top: 2px solid var(--border);
  gap: 0.5rem;
}

.rr-bin {
  flex: 1;
  max-width: 100px;
  padding: 1rem 0.5rem;
  background: var(--bg);
  border: 3px dashed var(--border);
  border-radius: 12px;
  text-align: center;
  transition: all 0.2s;
}

.rr-bin-hover {
  border-color: var(--accent);
  background: rgba(255, 107, 53, 0.2);
  transform: scale(1.05);
}

.rr-bin.rr-correct {
  border-color: #4ade80;
  background: rgba(74, 222, 128, 0.3);
}

.rr-bin.rr-wrong {
  border-color: #f87171;
  background: rgba(248, 113, 113, 0.3);
}

.rr-bin-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.rr-bin-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Overlays */
/* Only show overlay when rarity rush view is active */
#rarity-rush-view .rr-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

/* Hide overlays when view is not active */
.view:not(.active) .rr-overlay {
  display: none !important;
}

.rr-start-content {
  text-align: center;
  padding: 2rem;
  max-width: 400px;
}

.rr-start-content h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.rr-instructions {
  text-align: left;
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--card-bg);
  border-radius: 8px;
}

.rr-instructions p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

.rr-start-btn {
  font-size: 1.2rem;
  padding: 1rem 2rem;
}

/* Points popup */
.rr-points-popup {
  position: absolute;
  font-size: 1.5rem;
  font-weight: bold;
  animation: rrFloatUp 0.8s ease-out forwards;
  pointer-events: none;
  z-index: 50;
}

.rr-correct-popup {
  color: #4ade80;
}

.rr-wrong-popup {
  color: #f87171;
}

@keyframes rrFloatUp {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-60px); }
}

/* Miss flash */
.rr-miss-flash {
  animation: rrFlashRed 0.2s;
}

@keyframes rrFlashRed {
  0%, 100% { background: linear-gradient(180deg, var(--bg) 0%, var(--card-bg) 100%); }
  50% { background: rgba(248, 113, 113, 0.3); }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .rr-score-display {
    font-size: 0.9rem;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .rr-falling-card {
    width: 60px;
    height: 84px;
  }
  
  .rr-rarity-tag {
    font-size: 0.5rem;
    max-width: 70px;
  }
  
  .rr-bin {
    padding: 0.75rem 0.25rem;
  }
  
  .rr-bin-icon {
    font-size: 1.2rem;
  }
  
  .rr-bin-label {
    font-size: 0.65rem;
  }
  
  #rr-game-area {
    min-height: 400px;
  }
}

/* ==========================================
   PACK OPENING SIMULATOR
   ========================================== */

#pack-opening-view {
  padding: 1rem;
}

.pack-stats-bar {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1rem;
  background: var(--card-bg);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.pack-stats-bar span {
  font-weight: 600;
}

/* Era Tabs */
.pack-era-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.pack-era-tab {
  padding: 0.5rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.pack-era-tab:hover {
  border-color: var(--accent);
}

.pack-era-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Set Grid */
.pack-set-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.5rem;
}

.pack-set-card {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.pack-set-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.pack-set-logo {
  max-width: 100%;
  max-height: 60px;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

.pack-set-name {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.pack-set-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Pack Display */
.pack-info {
  text-align: center;
  margin-bottom: 1rem;
}

.pack-info h3 {
  margin-bottom: 0.25rem;
}

.pack-info p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

#pack-display {
  display: flex;
  justify-content: center;
  padding: 2rem;
}

#pack-wrapper {
  position: relative;
  width: 200px;
  height: 280px;
  cursor: pointer;
  perspective: 1000px;
}

.pack-front {
  position: relative;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  overflow: hidden;
  transition: transform 0.3s;
}

#pack-wrapper:hover .pack-front {
  transform: scale(1.05);
}

.pack-front img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
}

.pack-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.2) 0%, transparent 60%);
  pointer-events: none;
}

.pack-hint {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  animation: packPulse 1.5s infinite;
}

@keyframes packPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

#pack-wrapper.pack-opening .pack-front {
  animation: packShake 0.8s;
}

@keyframes packShake {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-5deg) scale(1.1); }
  40% { transform: rotate(5deg) scale(1.1); }
  60% { transform: rotate(-3deg) scale(1.05); }
  80% { transform: rotate(3deg) scale(1.05); }
}

#pack-wrapper.pack-opened {
  display: none;
}

/* Card Reveal */
#pack-cards-reveal {
  padding: 1rem;
}

#pack-cards-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.pack-card {
  position: relative;
  aspect-ratio: 0.714;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s;
}

.pack-card-hidden {
  transform: scale(0) rotateY(180deg);
  opacity: 0;
}

.pack-card-reveal {
  animation: packCardReveal 0.5s forwards;
}

@keyframes packCardReveal {
  0% { transform: scale(0) rotateY(180deg); opacity: 0; }
  50% { transform: scale(1.1) rotateY(90deg); opacity: 1; }
  100% { transform: scale(1) rotateY(0); opacity: 1; }
}

.pack-card:hover {
  transform: scale(1.1);
  z-index: 10;
}

.pack-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
}

.pack-card-inner.pack-hit {
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
  animation: packHitGlow 1s infinite alternate;
}

@keyframes packHitGlow {
  0% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.4); }
  100% { box-shadow: 0 0 25px rgba(255, 215, 0, 0.8); }
}

.pack-card-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.pack-card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.9));
  padding: 0.5rem 0.25rem 0.25rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.pack-card:hover .pack-card-info {
  opacity: 1;
}

.pack-card-name {
  font-size: 0.6rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pack-card-rarity {
  font-size: 0.5rem;
  color: var(--text-muted);
}

.pack-card-price {
  font-size: 0.65rem;
  color: #4ade80;
  font-weight: 600;
}

.pack-reveal-summary {
  text-align: center;
  padding: 1rem;
  background: var(--card-bg);
  border-radius: 8px;
}

.pack-reveal-summary p {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.pack-btn-secondary {
  background: var(--card-bg) !important;
  border: 1px solid var(--border);
  margin-left: 0.5rem;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .pack-stats-bar {
    gap: 1rem;
    font-size: 0.85rem;
  }
  
  .pack-set-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
  
  #pack-wrapper {
    width: 160px;
    height: 224px;
  }
  
  #pack-cards-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.4rem;
  }
  
  .pack-card-name {
    font-size: 0.5rem;
  }
}

@media (max-width: 480px) {
  #pack-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Coin System */
.coin-balance {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #000;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-left: 0.5rem;
}

.pack-cost {
  color: #fbbf24;
  font-weight: 600;
  margin-top: 0.5rem;
}

@keyframes coinPopup {
  0% { opacity: 0; transform: translateY(20px); }
  20% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-20px); }
}

/* Mobile coin balance */
@media (max-width: 768px) {
  .coin-balance {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 100;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
  }
}

/* Hide rarity/price stats chips on desktop (only show in filter panel) */
@media (min-width: 769px) {
  #all-cards-stats .price-stats,
  #all-cards-stats .rarity-stats,
  #set-header .price-stats,
  #set-header .rarity-stats,
  .set-detail-stats .price-stats,
  .set-detail-stats .rarity-stats {
    display: none !important;
  }
}

/* Desktop filter panel - match mobile drawer style */
.filter-panel-expanded {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1rem;
  margin-top: 1rem;
}

.filter-panel-expanded .filter-group {
  margin-bottom: 0.75rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.filter-panel-expanded .filter-group:last-child {
  margin-bottom: 0;
}

.filter-panel-expanded .filter-group > label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 70px;
  padding-top: 0.35rem;
  flex-shrink: 0;
}

.filter-panel-expanded .desktop-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex: 1;
}

.filter-panel-expanded .filter-group input[type="text"] {
  flex: 1;
}

.filter-panel-expanded .rarity-stat,
.filter-panel-expanded .price-stat,
.filter-panel-expanded .type-stat,
.filter-panel-expanded .subtype-stat,
.filter-panel-expanded .variant-type-stat {
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  background: var(--bg-dark);
  border: 1px solid rgba(255,255,255,0.25);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.15s;
  color: var(--text);
}

.filter-panel-expanded .rarity-stat:hover,
.filter-panel-expanded .price-stat:hover,
.filter-panel-expanded .type-stat:hover,
.filter-panel-expanded .subtype-stat:hover,
.filter-panel-expanded .variant-type-stat:hover {
  border-color: var(--accent-red);
}

.filter-panel-expanded .rarity-stat.active,
.filter-panel-expanded .price-stat.active,
.filter-panel-expanded .type-stat.active,
.filter-panel-expanded .subtype-stat.active,
.filter-panel-expanded .variant-type-stat.active {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: white;
}

/* Remove border-top from variant stats inside filter panel */
.filter-panel-expanded .variant-types-stats {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.filter-panel-expanded input[type="text"] {
  width: 100%;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.25);
  background: var(--bg-dark);
  color: var(--text);
  font-size: 0.9rem;
}

.filter-panel-expanded input[type="text"]:focus {
  outline: none;
  border-color: var(--accent-red);
}

/* Games Hub Dashboard */
.games-dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.dashboard-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s;
}

.dashboard-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.dashboard-icon {
  font-size: 2rem;
}

.dashboard-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.dashboard-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.coins-card { border-left: 4px solid #fbbf24; }
.collection-card { border-left: 4px solid #60a5fa; cursor: pointer; }
.value-card { border-left: 4px solid #4ade80; }
.packs-card { border-left: 4px solid #f472b6; cursor: pointer; }
.free-coins-card { 
  border-left: 4px solid #f43f5e; 
  cursor: pointer; 
  background: linear-gradient(135deg, var(--card-bg) 0%, rgba(244, 63, 94, 0.1) 100%);
  animation: freeCoinsGlow 2s ease-in-out infinite;
}
.free-coins-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 25px rgba(244, 63, 94, 0.3);
}
@keyframes freeCoinsGlow {
  0%, 100% { box-shadow: 0 2px 10px rgba(244, 63, 94, 0.2); }
  50% { box-shadow: 0 2px 20px rgba(244, 63, 94, 0.4); }
}

/* Games Sections */
.games-section {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.games-section h3 {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-desc {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.see-all-link {
  font-size: 0.85rem;
  color: var(--accent);
  cursor: pointer;
  margin-left: auto;
}

/* Pack Buy Options */
.pack-buy-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.pack-buy-card {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.pack-buy-card:hover {
  border-color: var(--accent);
  transform: scale(1.02);
}

.pack-buy-card.browse-packs {
  border-style: dashed;
}

.pack-buy-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.pack-buy-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.pack-buy-cost {
  color: #fbbf24;
  font-weight: 600;
}

.pack-buy-bonus {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #4ade80;
  color: #000;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
}

/* Collection Preview */
.collection-preview {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.collection-preview-card {
  flex: 0 0 80px;
  aspect-ratio: 0.714;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.collection-preview-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Full Collection View */
.collection-stats-bar {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1rem;
  background: var(--surface);
  border-radius: 12px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.coll-stat {
  text-align: center;
}

.coll-stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.coll-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.coll-stat.highlight .coll-stat-value {
  color: #fbbf24;
}

.collection-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-radius: 8px;
}

.coll-filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.coll-filter-group label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.coll-filter-group select {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
}

.coll-clear-btn {
  margin-left: auto;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid #ef4444;
  background: transparent;
  color: #ef4444;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.coll-clear-btn:hover {
  background: #ef4444;
  color: white;
}

.collection-full-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  padding-bottom: 2rem;
}

.coll-card {
  position: relative;
  aspect-ratio: 0.714;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.coll-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.coll-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.coll-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.9));
  font-size: 0.75rem;
}

.coll-card-name {
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.coll-card-meta {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.coll-card-price {
  color: #22c55e;
  font-weight: 600;
}

/* Hit card glow effects */
.coll-card.hit-ir {
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

.coll-card.hit-sir {
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.6);
}

.coll-card.hit-sar {
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.6);
}

.coll-card.hit-ur {
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.5);
}

.coll-card .hit-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
}

.coll-card.hit-ir .hit-badge { background: #3b82f6; color: white; }
.coll-card.hit-sir .hit-badge { background: #a855f7; color: white; }
.coll-card.hit-sar .hit-badge { background: #ec4899; color: white; }
.coll-card.hit-ur .hit-badge { background: #fbbf24; color: black; }
.coll-card.hit-secret .hit-badge { background: linear-gradient(135deg, #fbbf24, #f472b6); color: black; }

.collection-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.collection-empty .empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.collection-empty h3 {
  color: var(--text);
  margin-bottom: 0.5rem;
}

.collection-empty .primary-btn {
  margin-top: 1.5rem;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .collection-stats-bar {
    gap: 1rem;
    padding: 0.75rem;
  }
  
  .coll-stat-value {
    font-size: 1.2rem;
  }
  
  .collection-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .coll-clear-btn {
    margin-left: 0;
    margin-top: 0.5rem;
  }
  
  .collection-full-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
  }
}

/* Game Card Updates */
.game-reward {
  color: #fbbf24;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0.5rem 0;
}

/* Mobile */
@media (max-width: 768px) {
  .games-dashboard {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .pack-buy-options {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .dashboard-value {
    font-size: 1.2rem;
  }
  
  .dashboard-icon {
    font-size: 1.5rem;
  }
}

/* Era Selector for All Cards */
.cards-header-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.cards-header-row h2 {
  margin: 0;
}

.era-selector {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  min-width: 160px;
}

.era-selector:hover {
  border-color: var(--accent-red);
}

.era-selector:focus {
  outline: none;
  border-color: var(--accent-red);
}

.era-selector option {
  background: var(--bg-card);
  color: var(--text);
}

@media (max-width: 768px) {
  .cards-header-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  
  .cards-header-row h2 {
    font-size: 1.3rem;
  }
  
  .era-selector {
    width: auto;
    min-width: 120px;
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
}

/* Era Rarity Guide Modal */
.era-rarity-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.8);
  z-index: 10000;
  overflow-y: auto;
  padding: 2rem;
}

.era-rarity-modal-overlay.active {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.era-rarity-content {
  background: var(--bg-card);
  border-radius: 12px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.era-rarity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}

.era-rarity-header h2 {
  margin: 0;
  font-size: 1.4rem;
}

.era-rarity-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.era-rarity-close:hover {
  color: var(--text);
}

.era-rarity-body {
  padding: 1.5rem;
}

.era-rarity-body h3 {
  margin: 0 0 0.75rem 0;
  font-size: 1.1rem;
  color: var(--accent-red);
}

.pack-composition {
  background: rgba(255,255,255,0.05);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.pack-composition p {
  margin: 0;
  color: var(--text-muted);
}

.rarity-table {
  margin-bottom: 1.5rem;
}

.rarity-table table {
  width: 100%;
  border-collapse: collapse;
}

.rarity-table th,
.rarity-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.rarity-table th {
  background: rgba(255,255,255,0.05);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.rarity-table td {
  font-size: 0.9rem;
}

.symbol-cell {
  font-weight: bold;
  font-size: 1.1rem;
}

.examples-cell {
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.85rem;
  max-width: 200px;
}

.variants-info {
  background: rgba(255,255,255,0.05);
  padding: 1rem;
  border-radius: 8px;
}

.variants-info ul {
  margin: 0;
  padding-left: 1.5rem;
}

.variants-info li {
  margin-bottom: 0.25rem;
  color: var(--text-muted);
}

.era-guide-link,
.set-rarity-link {
  color: var(--accent-red);
  cursor: pointer;
  text-decoration: none;
  margin-left: 0.5rem;
}

.era-guide-link:hover,
.set-rarity-link:hover {
  text-decoration: underline;
}

/* Set Rarity Guide Styles */
.set-rarity-content {
  max-width: 900px;
  max-height: 85vh;
}

.set-rarity-meta {
  display: flex;
  gap: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.set-rarity-body {
  padding: 1rem 1.5rem;
  overflow-y: auto;
  max-height: calc(85vh - 150px);
}

.set-rarity-row {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  align-items: flex-start;
}

.set-rarity-row:last-child {
  border-bottom: none;
}

.set-rarity-label {
  min-width: 180px;
  font-weight: 600;
  color: var(--accent-red);
  padding-top: 0.5rem;
  font-size: 0.95rem;
}

.set-rarity-cards {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  flex: 1;
}

.set-rarity-card {
  width: 120px;
  cursor: pointer;
  transition: transform 0.2s;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  overflow: hidden;
}

.set-rarity-card:hover {
  transform: scale(1.05);
}

.set-rarity-card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px 8px 0 0;
}

.set-rarity-card-info {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.set-rarity-card-info .card-name {
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.set-rarity-card-info .card-number {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.set-rarity-card-info .card-price {
  font-size: 0.7rem;
  color: var(--price-green);
  font-weight: 500;
}

@media (max-width: 768px) {
  .set-rarity-content {
    max-width: 100%;
    margin: 0.5rem;
  }
  
  .set-rarity-row {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .set-rarity-label {
    min-width: auto;
  }
  
  .set-rarity-card {
    width: 90px;
  }
  
  .set-rarity-meta {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}

@media (max-width: 768px) {
  .era-rarity-modal-overlay {
    padding: 1rem;
  }
  
  .era-rarity-content {
    max-height: 95vh;
  }
  
  .rarity-table {
    overflow-x: auto;
  }
  
  .rarity-table table {
    min-width: 500px;
  }
}

/* Rarity Guide Page (full page view) */
.rarity-guide-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
}

.rarity-guide-header {
  margin-bottom: 1.5rem;
}

.rarity-guide-header .back-btn {
  background: none;
  border: none;
  color: var(--accent-red);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
}

.rarity-guide-header .back-btn:hover {
  text-decoration: underline;
}

.rarity-guide-header h1 {
  margin: 0;
  font-size: 1.75rem;
  color: var(--text);
}

.rarity-guide-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.rarity-guide-content h2 {
  margin: 0 0 0.75rem 0;
  font-size: 1.25rem;
  color: var(--accent-red);
}

.pack-composition {
  background: rgba(255,255,255,0.05);
  padding: 1rem;
  border-radius: 8px;
}

.pack-composition p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Guide Notes (warnings/tips) */
.guide-notes {
  background: rgba(251, 191, 36, 0.15);
  border-left: 4px solid #fbbf24;
  padding: 1rem;
  border-radius: 0 8px 8px 0;
}

.guide-notes p {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
}

/* Mechanics Section */
.mechanics-section {
  background: rgba(255,255,255,0.05);
  padding: 1rem;
  border-radius: 8px;
}

.mechanics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.mechanic-card {
  background: rgba(255,255,255,0.05);
  padding: 0.75rem;
  border-radius: 6px;
  border-left: 3px solid var(--primary);
}

.mechanic-card strong {
  color: var(--primary);
  display: block;
  margin-bottom: 0.25rem;
}

.mechanic-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Box Breakdown */
.box-breakdown {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(34, 197, 94, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.box-breakdown h3 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  color: #22c55e;
}

.box-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.box-stat {
  text-align: center;
  min-width: 60px;
}

.box-stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.box-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.box-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* No Data Message */
.no-data-message {
  background: rgba(255,255,255,0.05);
  padding: 1.5rem;
  border-radius: 8px;
  text-align: center;
  color: var(--text-muted);
}

.no-data-message p {
  margin: 0.5rem 0;
}

.no-data-message p:first-child {
  font-size: 1.1rem;
  color: var(--text);
}

/* Pull Rate Comparison Table */
.pull-rate-comparison {
  margin-bottom: 2rem;
}

.pull-rate-comparison h2 {
  margin-bottom: 0.5rem;
}

.comparison-note {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.pull-rate-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.pull-rate-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 600px;
}

.pull-rate-table th,
.pull-rate-table td {
  padding: 0.6rem 0.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.pull-rate-table th {
  background: var(--surface);
  font-weight: 600;
  color: var(--text);
  position: sticky;
  top: 0;
  font-size: 0.8rem;
}

.pull-rate-table td {
  color: var(--text-muted);
}

.pull-rate-table tbody tr:hover {
  background: rgba(255,255,255,0.05);
}

.pull-rate-table .set-col {
  text-align: left;
  min-width: 140px;
}

.pull-rate-table .hit-col {
  font-weight: 600;
}

.set-name-cell {
  display: block;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.set-date-cell {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.pull-rate-table .good-rate {
  color: #22c55e;
  font-weight: 600;
}

@media (max-width: 768px) {
  .pull-rate-table {
    font-size: 0.75rem;
    min-width: 500px;
  }
  
  .pull-rate-table th,
  .pull-rate-table td {
    padding: 0.5rem 0.3rem;
  }
  
  .set-name-cell {
    max-width: 100px;
  }
}

.rarity-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rarity-card {
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  overflow: hidden;
}

.rarity-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.rarity-symbol {
  font-size: 1.25rem;
  font-weight: bold;
  min-width: 40px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rarity-symbol-img {
  height: 24px;
  width: auto;
  object-fit: contain;
}

.rarity-name {
  font-weight: 600;
  flex: 1;
  font-size: 1rem;
}

.rarity-rate {
  color: var(--accent-red);
  font-size: 0.85rem;
  font-weight: 500;
  background: rgba(255,107,53,0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.rarity-card-body {
  padding: 0.75rem 1rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.rarity-sample-cards {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  align-items: center;
}

.rarity-sample-card {
  width: 60px;
  aspect-ratio: 0.714;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.rarity-sample-card:hover {
  transform: scale(1.1);
  z-index: 10;
}

.rarity-sample-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sample-placeholder {
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.5rem;
}

.no-samples {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-style: italic;
}

.view-more-link {
  font-size: 0.7rem;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
  align-self: center;
}

.view-more-link:hover {
  text-decoration: underline;
}

.rarity-info {
  flex: 1;
  min-width: 0;
}

@media (max-width: 600px) {
  .rarity-card-body {
    flex-direction: column;
  }
  
  .rarity-sample-cards {
    width: 100%;
    justify-content: flex-start;
    margin-bottom: 0.5rem;
  }
  
  .rarity-sample-card {
    width: 50px;
  }
}

.rarity-identify {
  margin: 0 0 0.5rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.rarity-examples {
  margin: 0;
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.85rem;
  opacity: 0.8;
}

.variants-section {
  background: rgba(255,255,255,0.05);
  padding: 1rem;
  border-radius: 8px;
}

.variants-list {
  margin: 0;
  padding-left: 0;
  color: var(--text-muted);
}

.variants-list li {
  margin-bottom: 0.25rem;
}

/* Rarity Guide Mobile */
@media (max-width: 768px) {
  .rarity-guide-page {
    padding: 0.75rem;
  }
  
  .rarity-guide-header h1 {
    font-size: 1.4rem;
  }
  
  .rarity-card-header {
    flex-wrap: wrap;
  }
  
  .rarity-rate {
    width: 100%;
    margin-top: 0.25rem;
  }
}

/* Debug section for TCGdex JSON */
.debug-section {
  margin-top: 16px;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
  max-width: 600px;
}

.debug-toggle {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85em;
  width: 100%;
  text-align: left;
  transition: all 0.2s;
}

.debug-toggle:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.debug-content {
  margin-top: 8px;
  background: #1a1a2e;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px;
  max-height: 700px;
  max-width: 600px;
  overflow: auto;
}

.debug-content pre {
  margin: 0;
  font-size: 0.75em;
  color: #a0e0a0;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: 'Monaco', 'Consolas', monospace;
}

#tcgdex-toggle-icon {
  float: right;
  transition: transform 0.2s;
}

.debug-toggle.expanded #tcgdex-toggle-icon {
  transform: rotate(180deg);
}

.debug-edit-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.debug-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.debug-field label {
  font-size: 0.85em;
  color: var(--text-muted);
  font-weight: 600;
}

.debug-field input,
.debug-field textarea {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 8px;
  color: var(--text);
  font-size: 0.9em;
  font-family: inherit;
}

.debug-field input:focus,
.debug-field textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.debug-save-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9em;
  transition: all 0.2s;
}

.debug-save-btn:hover {
  background: var(--primary-dark);
}

#edit-card-status {
  font-size: 0.85em;
  padding: 4px 0;
}

/* Set Info Page Styles */
.set-info-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

.set-info-loading {
  text-align: center;
  padding: 4rem 2rem;
}

/* set-info-header styles consolidated later in file */

.set-info-title h1 {
  margin: 0;
  font-size: 2rem;
}

.set-meta-info {
  color: var(--text-muted);
  margin: 0.5rem 0 0 0;
}

.set-info-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.stat-card .stat-value {
  display: block;
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--accent);
}

.stat-card .stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Products Section */
.set-info-products {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.set-info-products h3 {
  margin: 0 0 1rem 0;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.product-card-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.product-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.product-icon {
  font-size: 2rem;
}

.product-name {
  font-weight: 500;
  font-size: 0.9rem;
}

.product-price {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--accent);
}

/* Top Cards Section */
.set-info-top-cards {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.set-info-top-cards h3 {
  margin: 0 0 1rem 0;
}

.top-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.top-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

.top-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.top-rank {
  position: absolute;
  top: -8px;
  left: -8px;
  background: var(--accent);
  color: #000;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.8rem;
}

.top-card img {
  width: 100%;
  border-radius: 4px;
}

.top-card-info {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.top-card-name {
  font-weight: 500;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-card-number {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.top-card-price {
  color: var(--accent);
  font-weight: bold;
}

/* Pull Rates Section */
.set-info-pull-rates {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.set-info-pull-rates h3 {
  margin: 0 0 1rem 0;
}

.pull-rates-notes {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-style: italic;
}

.pull-rates-special {
  background: rgba(74, 144, 226, 0.1);
  border: 1px solid rgba(74, 144, 226, 0.3);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  color: var(--accent);
}

.pull-rates-table {
  overflow-x: auto;
  margin-bottom: 1rem;
}

.pull-rates-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 300px;
}

.pull-rates-table th,
.pull-rates-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.pull-rates-table th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text);
}

.pull-rates-table tr:hover {
  background: var(--bg-secondary);
}

.pull-rates-table td:last-child {
  font-weight: 600;
  color: var(--accent);
}

.pull-rates-disclaimer {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* Rarity Guide Section */
.set-info-rarities {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.set-info-rarities h3 {
  margin: 0 0 1rem 0;
}

.rarity-guide-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rarity-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 8px;
  flex-wrap: wrap;
}

.rarity-info {
  min-width: 180px;
}

.rarity-name {
  display: block;
  font-weight: 600;
}

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

.rarity-examples {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex: 1;
}

.rarity-example-card {
  width: 60px;
  cursor: pointer;
  transition: transform 0.2s;
}

.rarity-example-card:hover {
  transform: scale(1.1);
}

.rarity-example-card img {
  width: 100%;
  border-radius: 4px;
}

.example-card-name {
  display: block;
  font-size: 0.65rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Variants Section */
.set-info-variants {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.set-info-variants h3 {
  margin: 0 0 1rem 0;
}

.variants-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
}

.variant-item {
  background: var(--bg);
  border-radius: 8px;
  padding: 1rem;
}

.variant-name {
  font-weight: 600;
  color: var(--accent);
}

.variant-count {
  color: var(--text-muted);
  margin-left: 0.5rem;
  font-size: 0.9rem;
}

.variant-explanation {
  margin: 0.5rem 0 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Pack Contents */
.set-info-pack-contents {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.set-info-pack-contents h3 {
  margin: 0 0 1rem 0;
}

.set-info-pack-contents h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  color: var(--accent);
}

.pack-slots-table {
  width: 100%;
  border-collapse: collapse;
}

.pack-slots-table tr {
  border-bottom: 1px solid var(--border);
}

.pack-slots-table tr:last-child {
  border-bottom: none;
}

.pack-slot-num {
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  vertical-align: top;
  width: 80px;
}

.pack-slot-content {
  padding: 0.5rem 0.75rem;
  color: var(--text);
}

/* Actions */
.set-info-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.action-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}

.action-btn:hover {
  background: var(--bg);
}

.action-btn.primary {
  background: var(--accent);
  color: #000;
  border: none;
}

.action-btn.primary:hover {
  opacity: 0.9;
}

/* Error state */
.set-info-error {
  text-align: center;
  padding: 4rem 2rem;
}

.set-info-error h2 {
  color: #f44;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .set-info-title {
    flex-direction: column;
    text-align: center;
  }
  
  .set-info-title h1 {
    font-size: 1.5rem;
  }
  
  .rarity-row {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .rarity-info {
    width: 100%;
    margin-bottom: 0.5rem;
  }
}

/* Product images */
.product-image {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 8px;
}

.product-card {
  min-height: 140px;
}

/* Enhanced Rarity Guide - Larger cards with details */
.rarity-row-lg {
  display: flex;
  gap: 1rem;
  padding: 0.5rem;
  background: var(--bg);
  border-radius: 12px;
  margin-bottom: 2px;
  flex-wrap: wrap;
}

.rarity-info-lg {
  min-width: 280px;
  flex: 1;
}

.rarity-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.rarity-name-lg {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}

.rarity-symbol {
  background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #000;
  font-weight: bold;
}

.rarity-symbol-img-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
  border-radius: 6px;
  padding: 3px;
}

.rarity-symbol-img-container .rarity-symbol-img {
  height: 18px !important;
  width: auto !important;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.rarity-count-lg {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-left: 0.5rem;
  padding-left: 0.5rem;
  border-left: 1px solid var(--border);
}

.rarity-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.rarity-identify,
.rarity-pull-rate {
  font-size: 1.05rem;
  line-height: 1.5;
}

.rarity-identify strong,
.rarity-pull-rate strong {
  color: var(--text);
}

.rarity-examples-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 2;
}

/* Rarity details toggle */
.rarity-details-toggle {
  font-size: 0.85rem;
  font-weight: normal;
  color: var(--accent);
  margin-left: 1rem;
  text-decoration: none;
}

.rarity-details-toggle:hover {
  text-decoration: underline;
}

.rarity-guide-grid.hide-details .rarity-identify,
.rarity-guide-grid.hide-details .rarity-examples-wrapper {
  display: none;
}

.rarity-nav-btn {
  background: var(--card-bg);
  border: 2px solid var(--border);
  color: var(--text);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.8rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.rarity-nav-btn:hover:not(:disabled) {
  background: rgba(255, 215, 0, 0.2);
  color: var(--accent);
  border-color: var(--accent);
}

.rarity-nav-btn:disabled {
  cursor: not-allowed;
  opacity: 0.3;
}

.rarity-examples-lg {
  display: flex;
  gap: 1rem;
  flex: 1;
  flex-wrap: nowrap;
  justify-content: flex-start;
}

.rarity-example-card-lg {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  width: 160px;
  flex-shrink: 0;
}

.rarity-example-card-lg:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 12px 28px rgba(0,0,0,0.4);
  border-color: var(--accent);
}

.rarity-example-card-lg img {
  width: 100%;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.rarity-example-card-lg .example-card-info {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: left !important;
}

.rarity-example-card-lg .example-card-info .example-card-name {
  font-weight: 600;
  font-size: 0.9rem;
  text-align: left;
}

.rarity-example-card-lg .example-card-info .example-card-number {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: left;
}

.rarity-example-card-lg .example-card-info .example-card-price {
  color: var(--accent);
  font-weight: 800;
  font-size: 1.1rem;
  text-align: left;
}

/* Mobile responsive for rarity guide */
@media (max-width: 768px) {
  .rarity-row-lg {
    flex-direction: column;
  }
  
  .rarity-info-lg {
    min-width: 100%;
  }
  
  .rarity-examples-lg {
    justify-content: center;
  }
  
  .rarity-example-card-lg {
    width: 120px;
  }
}

/* ===== Enhanced Set Info Page Styles ===== */

.set-info-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Header Enhancement - match Set Detail header style */
.set-info-header {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Duplicate text styles for Set Info header to match Set Detail */
.set-info-header h2 {
  margin-bottom: 0.25rem;
  font-size: 1.5rem;
}

.set-info-header .set-series {
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.set-info-header .set-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.set-info-header .set-fact {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  margin-top: 0.5rem;
}

.set-info-title {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.set-info-title .set-logo {
  height: 100px;
  width: auto;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.set-info-title h1 {
  margin: 0;
  font-size: 2.2rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.set-meta-info {
  color: var(--text-muted);
  margin: 0.5rem 0 0 0;
  font-size: 1rem;
}

/* Stats Cards Enhancement */
.set-info-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.set-info-stats .stat-card {
  background: linear-gradient(145deg, var(--card-bg) 0%, rgba(255,215,0,0.05) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.set-info-stats .stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.set-info-stats .stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: #ffd700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.set-info-stats .stat-label {
  color: #b0b0b0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0.5rem;
}

/* Products Section Enhancement */
.set-info-products {
  background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.set-info-products h3,
.set-info-top-cards h3,
.set-info-rarities h3,
.set-info-variants h3 {
  margin: 0 0 1.25rem 0;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.product-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.product-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-height: 300px;
  transition: all 0.2s;
  cursor: pointer;
}

.product-card-link:hover .product-card,
.product-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(255,215,0,0.2);
}

.product-icon {
  font-size: 3rem;
}

.product-image {
  width: 180px;
  height: 180px;
  object-fit: contain;
  border-radius: 10px;
}

.product-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

.product-contents {
  font-size: 0.9rem;
  color: #b0b0b0;
  text-align: center;
  line-height: 1.4;
  margin-top: 0;
  display: block;
  width: 100%;
}

.product-price {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
}

/* Top Cards Enhancement */
.set-info-top-cards {
  background: linear-gradient(135deg, var(--card-bg) 0%, rgba(255,215,0,0.03) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.top-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 180px);
  gap: 1.25rem;
}

.top-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.top-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #ffd700);
  opacity: 0;
  transition: opacity 0.3s;
}

.top-card:hover::before {
  opacity: 1;
}

.top-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 12px 28px rgba(0,0,0,0.4);
  border-color: var(--accent);
}

.top-rank {
  position: absolute;
  top: -5px;
  left: -5px;
  background: linear-gradient(135deg, var(--accent) 0%, #ffd700 100%);
  color: #000;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  z-index: 1;
}

.top-card img {
  width: 100%;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.top-card-info {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: left;
}

.top-card-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.top-card-number {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.top-card-price {
  color: var(--accent);
  font-weight: 800;
  font-size: 1.1rem;
}

/* Rarity Section Enhancement */
.set-info-rarities {
  background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.rarity-row-lg {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: all 0.2s;
}

.rarity-row-lg:hover {
  border-left-color: #ffd700;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.rarity-name-lg {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
}

.rarity-symbol {
  background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
  color: #000;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
}

/* rarity-example-card-lg defined earlier - duplicate removed */

/* Variants Enhancement */
.set-info-variants {
  background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 2rem;
}

.variant-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  transition: all 0.2s;
}

.variant-item:hover {
  border-color: var(--accent);
}

.variant-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
}

.variant-count {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-left: 0.5rem;
}

.variant-description,
.variant-pull-rate,
.variant-available {
  font-size: 0.95rem;
  margin: 0.25rem 0;
  color: var(--text);
}

.variant-pull-rate strong,
.variant-available strong {
  color: var(--text-muted);
}

/* Actions Enhancement */
.set-info-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.action-btn {
  padding: 0.875rem 1.75rem;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.2s;
}

.action-btn:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.action-btn.primary {
  background: linear-gradient(135deg, var(--accent) 0%, #ffd700 100%);
  color: #000;
  border: none;
}

.action-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255,215,0,0.4);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .set-info-page {
    padding: 0.5rem;
    max-width: 100%;
  }
  
  .set-info-header {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
  }
  
  .set-info-title {
    flex-direction: column;
    text-align: center;
  }
  
  .set-info-title h1 {
    font-size: 1.6rem;
  }
  
  .set-info-title .set-logo {
    height: 70px;
  }
  
  /* Match set-info-header font sizes to card list header */
  .set-info-header .set-header-info h2 {
    font-size: 1.1rem;
  }
  
  .set-info-header .set-header-info .set-series,
  .set-info-header .set-header-info .set-meta,
  .set-info-header .set-header-info .set-fact {
    font-size: 0.8rem;
  }
  
  .stat-value {
    font-size: 1.6rem;
  }
  
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .top-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Rarity Guide Mobile Styles */
  .set-info-rarities {
    padding: 1rem;
  }
  
  .set-info-rarities h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }
  
  .rarity-row-lg {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
  }
  
  .rarity-info-lg {
    min-width: 100%;
  }
  
  .rarity-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .rarity-name-lg {
    font-size: 1.1rem;
  }
  
  .rarity-count-lg {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
  }
  
  .rarity-identify,
  .rarity-pull-rate {
    font-size: 0.95rem;
  }
  
  .rarity-examples-wrapper {
    width: 100%;
    justify-content: center;
    gap: 0.25rem;
  }
  
  .rarity-nav-btn {
    width: 28px;
    height: 28px;
    font-size: 1rem;
    min-width: 28px;
  }
  
  .rarity-examples-lg {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 0.5rem;
    flex: 1;
    overflow-x: auto;
  }
  
  .rarity-example-card-lg {
    width: 120px;
    min-width: 120px;
    flex-shrink: 0;
    padding: 0.5rem;
  }
  
  .rarity-example-card-lg .example-card-info {
    margin-top: 0.5rem;
  }
  
  .rarity-example-card-lg .example-card-info .example-card-name {
    font-size: 0.8rem;
  }
  
  .rarity-example-card-lg .example-card-info .example-card-number {
    font-size: 0.75rem;
  }
  
  .rarity-example-card-lg .example-card-info .example-card-price {
    font-size: 0.95rem;
  }
  
  /* Stats cards mobile */
  .set-info-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .set-info-stats .stat-card {
    padding: 1rem;
  }
  
  .set-info-stats .stat-value {
    font-size: 1.5rem;
  }
  
  .set-info-stats .stat-label {
    font-size: 0.75rem;
  }
  
  /* Top cards mobile */
  .set-info-top-cards {
    padding: 1rem;
  }
  
  .top-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    justify-items: center;
  }
  
  .top-card {
    width: 100%;
    max-width: 140px;
    padding: 0.5rem;
  }
  
  .top-card .top-card-info .top-card-name {
    font-size: 0.8rem;
  }
  
  .top-card .top-card-info .top-card-number {
    font-size: 0.75rem;
  }
  
  .top-card .top-card-info .top-card-price {
    font-size: 0.95rem;
  }
  
  /* Products mobile */
  .set-info-products {
    padding: 1rem;
  }
  
  .product-card {
    min-height: auto;
    padding: 1rem;
  }
  
  .product-image {
    width: 120px;
    height: 120px;
  }
  
  .product-name {
    font-size: 0.95rem;
  }
  
  .product-price {
    font-size: 1.1rem;
  }
  
  .product-contents {
    font-size: 0.8rem;
  }
}

.product-contents a {
  color: var(--accent);
  text-decoration: underline;
  font-weight: 500;
  display: inline !important;
  white-space: nowrap !important;
}

.product-contents a:hover {
  color: #fff;
}

/* Rarity Gallery Modal */
.rarity-gallery-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.gallery-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.gallery-card-container {
  position: relative;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gallery-card-img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
  transition: transform 0.3s ease;
}

.gallery-info {
  margin-top: 1rem;
  color: #fff;
  text-align: center;
}

.gallery-info h3 {
  margin: 0;
  font-size: 1.5rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.gallery-info p {
  margin: 0.5rem 0 0;
  color: #ccc;
}

.gallery-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 3rem;
  padding: 1rem;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  backdrop-filter: blur(5px);
}

.gallery-nav-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.1);
}

.gallery-nav-btn.prev { left: 2rem; }
.gallery-nav-btn.next { right: 2rem; }

.gallery-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 10001;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.gallery-close-btn:hover {
  opacity: 1;
}

.gallery-counter {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.5);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  color: #fff;
  font-size: 0.9rem;
  backdrop-filter: blur(5px);
}

/* Make rarity sample cards bigger in the guide */
.rarity-sample-card {
  width: 100px !important; /* Force override */
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.rarity-sample-cards {
  gap: 1rem;
}

@media (max-width: 600px) {
  .rarity-sample-card {
    width: 80px !important;
  }
  .gallery-nav-btn {
    width: 40px;
    height: 40px;
    font-size: 2rem;
    padding: 0;
  }
  .gallery-nav-btn.prev { left: 0.5rem; }
  .gallery-nav-btn.next { right: 0.5rem; }
}

/* Era Guide Table Logo */
.set-col-flex {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.set-logo-table {
  height: 28px;
  width: auto;
  max-width: 80px;
  object-fit: contain;
}
.set-col-text {
  display: flex;
  flex-direction: column;
}

/* Make rarity sample cards even bigger (v2) */
.rarity-sample-card {
  width: 140px !important;
  box-shadow: 0 6px 16px rgba(0,0,0,0.5);
}

@media (max-width: 600px) {
  .rarity-sample-card {
    width: 100px !important;
  }
}

/* Sealed Products Page */
.sealed-products-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.sealed-products-title {
  font-size: 1.3rem;
  margin: 0;
  color: var(--text);
  font-weight: 600;
}

/* Mobile: Stack toolbar items */
@media (max-width: 768px) {
  .sealed-products-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .sealed-products-title {
    font-size: 1.2rem;
  }
}


.product-sales {
  font-size: 0.85rem;
  color: #888;
  margin-top: 0.25rem;
}

.product-promo {
  font-size: 0.85rem;
  color: #ffd700;
  margin-top: 0.5rem;
  padding: 0.25rem 0.5rem;
  background: rgba(255, 215, 0, 0.1);
  border-radius: 4px;
  font-weight: 500;
}

.promo-card-link {
  color: #ffd700;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s;
}

.promo-card-link:hover {
  color: #ffed4e;
  text-decoration: underline;
}

/* Sealed Products Page */
.sealed-products-page {
  max-width: 1400px;
  margin: 0 auto;
}

.sealed-products-content {
  /* Content area - no special styling needed, filter-panel handles it */
}

.sealed-products-panel {
  /* Matches set-filter-panel styling */
}

/* Fix promo spacing in product cards */
.product-card .product-promo {
  display: block;
  width: 100%;
  margin-top: 0;
  margin-bottom: 0;
  text-align: center;
  word-wrap: break-word;
  font-size: 0.8rem;
  line-height: 1.3;
}
/* Authentication Modal Styles */

.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-modal.hidden {
  display: none;
}

.auth-modal-content {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 2rem;
  width: 90%;
  max-width: 450px;
  position: relative;
  z-index: 10002;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  max-height: 90vh;
  overflow-y: auto;
}

.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--bg-dark);
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.auth-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.auth-form h2 {
  margin-bottom: 0.5rem;
  color: var(--text);
}

.auth-subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-weight: 500;
  font-size: 0.9rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--bg-dark);
  border-radius: 8px;
  background: var(--bg-dark);
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
}

.auth-error {
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid #ff6b6b;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #ff6b6b;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.auth-error.hidden {
  display: none;
}

.auth-success {
  background: rgba(46, 204, 113, 0.1);
  border: 1px solid #2ecc71;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #2ecc71;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.auth-success.hidden {
  display: none;
}

.auth-submit-btn {
  width: 100%;
  padding: 1rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 1rem;
}

.auth-submit-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.auth-submit-btn:active {
  transform: translateY(0);
}

.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-secondary-btn {
  flex: 1;
  padding: 1rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-secondary-btn:hover {
  background: var(--bg-card-hover);
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* Migration Prompt */
.migration-summary {
  display: flex;
  gap: 1rem;
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--bg-dark);
  border-radius: 12px;
}

.migration-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.migration-icon {
  font-size: 2rem;
}

.migration-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 600;
}

.migration-value {
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 700;
}

.migration-status {
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid #4caf50;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #4caf50;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.migration-status.hidden {
  display: none;
}

/* User Account Widget */
.user-account-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}

.user-account-btn:hover {
  background: var(--bg-card-hover);
}

/* Removed duplicate user-dropdown styles - see line 11736 for main definition */

.user-dropdown-item {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease;
}

.user-dropdown-item:hover {
  background: var(--bg-card-hover);
}

.user-dropdown-item:first-child {
  border-radius: 8px 8px 0 0;
}

.user-dropdown-item:last-child {
  border-radius: 0 0 8px 8px;
  color: #ff6b6b;
}
/* ==========================================
   NEW HEADER & SIDEBAR NAVIGATION
   ========================================== */

/* Header Container */
.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  width: 100%;
  max-width: none;
}

/* Hamburger Button */
.hamburger-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 1001;
  transition: all 0.3s ease;
}

.hamburger-line {
  width: 24px;
  height: 3px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger-btn:hover .hamburger-line {
  background: var(--primary);
}

/* Header Left (Hamburger + Logo) */
.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 0 0 auto;
}

/* Header Logo */
.header-logo {
  display: flex;
  align-items: center;
}

.header-logo h1 {
  font-size: 2rem;
  margin: 0;
  white-space: nowrap;
}

/* Header Right (User Widget) */
.header-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex: 0 0 auto;
}

.sign-in-btn {
  background: var(--primary);
  color: var(--bg);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sign-in-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* User Account Dropdown */
.user-account {
  position: relative;
  z-index: 5000;
}

.user-account-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.user-account-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.user-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.dropdown-arrow {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
  display: none;
}

.user-account.active .dropdown-arrow {
  transform: rotate(180deg);
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  min-width: 200px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(-10px);
  transition: none !important;
  z-index: 5001;
  display: none !important;
}

.user-dropdown.active {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
  display: block !important;
}

.user-dropdown-header {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.user-email {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.user-coins {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  color: var(--primary);
}

.user-dropdown button {
  width: 100%;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease;
}

.user-dropdown button:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Sidebar Navigation */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: 240px;
  background: #1a1a1a;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 2500;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

/* Sidebar scrollbar - extra subtle */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

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

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 0.1rem 1rem;
  border-bottom: none;
  flex-shrink: 0;
  width: 100%;
}

.sidebar-header h2 {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.sidebar-close {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.sidebar-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-content {
  padding: 0 0 3rem 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.sidebar-section {
  margin-bottom: 1.25rem;
  display: block;
  width: 100%;
}

.sidebar-section:first-child {
  margin-top: 0.25rem;
}

.sidebar-section-title {
  padding: 0.5rem 1rem 0.25rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  margin: 0;
  display: block;
  width: 100%;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: block;
  width: 100%;
}

.sidebar-menu li {
  margin: 0;
  display: block;
  width: 100%;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 0.95rem;
  width: 100%;
  box-sizing: border-box;
}

.sidebar-menu a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--primary);
}

.sidebar-menu a .menu-icon {
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
}

/* Recent Sets */
.sidebar-recent-sets {
  list-style: none;
  padding: 0 0 2rem 0;
  margin: 0;
  display: block;
  width: 100%;
}

.sidebar-recent-sets li {
  margin: 0;
  display: block;
  width: 100%;
}

.sidebar-recent-sets a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  width: 100%;
  box-sizing: border-box;
}

.sidebar-recent-sets a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.sidebar-recent-sets .set-year {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 2499;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .header-logo h1 {
    font-size: 1.5rem;
  }
  
  .header-right {
    width: auto;
  }
  
  .sidebar {
    width: 90%;
    max-width: 320px;
  }
  
  /* Ensure sidebar content is visible on mobile */
  .sidebar-content {
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
    height: auto !important;
    padding-bottom: max(3rem, env(safe-area-inset-bottom, 0px)) !important;
  }
  
  .sidebar-section {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
  
  .sidebar-menu {
    display: block !important;
  }
  
  /* Extra bottom padding for popular sets on mobile */
  .sidebar-recent-sets {
    padding-bottom: 4rem !important;
  }
}

/* ==========================================
   MOBILE NAVIGATION IMPROVEMENTS
   ========================================== */

/* Hide old desktop nav on all screens */
header nav {
  display: none !important;
}

/* Mobile optimizations for header */
@media (max-width: 768px) {
  header {
    padding: 0;
  }
  
  .header-container {
    padding: 0.5rem 0.75rem;
    overflow: visible !important;
  }
  
  .header-right {
    overflow: visible !important;
  }
  
  .hamburger-btn {
    padding: 0.25rem;
  }
  
  .header-logo h1 {
    font-size: 1.4rem;
  }
  
  .user-account-btn {
    width: 36px;
    height: 36px;
    padding: 0.4rem;
  }
  
  .user-icon {
    font-size: 1.1rem;
  }
  
  .sign-in-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .header-logo h1 {
    font-size: 1.2rem;
  }
  
  .header-left {
    gap: 0.5rem;
  }
  
  .user-account-btn {
    width: 32px;
    height: 32px;
    padding: 0.3rem;
  }
  
  .user-icon {
    font-size: 1rem;
  }
}

/* User dropdown mobile/tablet adjustments */
@media (max-width: 800px) {
  .user-account {
    position: relative !important;
    z-index: 9998 !important;
    overflow: visible !important;
  }
  
  #user-dropdown {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    margin-top: 0.5rem !important;
    min-width: 180px;
    font-size: 0.9rem;
    z-index: 9999 !important;
    background: #1a1a1a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8) !important;
  }
  
  #user-dropdown.active,
  .user-dropdown.active {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    display: block !important;
    pointer-events: auto !important;
  }
  
  .user-dropdown button {
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
  }
  
  .user-dropdown-header {
    padding: 0.75rem;
  }
  
  .user-email {
    font-size: 0.8rem;
  }
  
  .user-coins {
    font-size: 0.85rem;
  }
}

/* Extra specificity for stubborn mobile browsers */
@media (max-width: 800px) {
  header #user-dropdown.active {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
  }
}

/* Force dropdown visibility at ALL screen sizes */
@media (max-width: 768px) {
  .user-account {
    position: relative !important;
    overflow: visible !important;
  }
  
  #user-dropdown.active,
  .user-dropdown.active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    z-index: 9999 !important;
    pointer-events: auto !important;
  }
}

/* Sidebar mobile optimization */
@media (max-width: 480px) {
  .sidebar {
    width: 85%;
  }
  
  .sidebar-header {
    padding: 1rem 1rem 0.1rem 1rem;
  }
  
  .sidebar-header h2 {
    font-size: 0.65rem;
  }
  
  .sidebar-menu a {
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
  }
  
  .sidebar-recent-sets a {
    padding: 0.55rem 1rem;
    font-size: 0.8rem;
  }
}

/* Ensure sidebar scrolls properly on mobile */
.sidebar {
  -webkit-overflow-scrolling: touch;
}

/* Fix for iOS Safari bottom bar */
@supports (-webkit-touch-callout: none) {
  .sidebar {
    height: -webkit-fill-available;
  }
}

/* Prevent zoom on input focus (iOS) */
@media (max-width: 768px) {
  input, select, textarea, button {
    font-size: 16px !important;
  }
}

/* Sidebar count badges */
.sidebar-count {
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  color: var(--primary);
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.25rem;
}


/* ==========================================
   DESKTOP SIDEBAR - ALWAYS VISIBLE
   ========================================== */

/* Desktop: Show sidebar permanently when screen is wide enough */
@media (min-width: 1000px) {
  /* Sidebar always visible on desktop */
  .sidebar {
    transform: translateX(0);
    box-shadow: none;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  /* Shift main content to make room for sidebar */
  body:not(.sidebar-hidden) main {
    margin-left: 240px;
    margin-right: 0;
    width: calc(100% - 240px);
    max-width: calc(100vw - 240px);
    transition: margin-left 0.3s ease, width 0.3s ease;
  }
  
  /* Shift header to align with main content */
  body:not(.sidebar-hidden) header {
    padding-left: 240px;
    transition: padding-left 0.3s ease;
  }
  
  /* Hide overlay on desktop */
  .sidebar-overlay {
    display: none;
  }
  
  /* Hide close button on desktop (sidebar is permanent) */
  .sidebar-close {
    display: none;
  }
  
  /* Modal positioning when sidebar is visible - center in content area */
  body:not(.sidebar-hidden) .card-modal {
    left: 0;
    width: 100%;
    padding-left: 240px; /* Account for sidebar width when centering */
  }
  
  /* Adjust modal navigation buttons when sidebar is visible */
  body:not(.sidebar-hidden) .modal-prev {
    left: 260px; /* 240px sidebar + 20px margin */
  }
  
  /* When sidebar is manually hidden on desktop */
  body.sidebar-hidden .sidebar {
    transform: translateX(-100%);
  }
  
  body.sidebar-hidden main {
    margin-left: 0;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
  }
  
  body.sidebar-hidden header {
    padding-left: 0;
  }
}

/* Larger desktop: Wider sidebar */
/* Smaller sort chips for Pokemon and Trainer list views */
#pokemon-view .inline-sort-buttons .sort-btn,
#trainers-view .inline-sort-buttons .sort-btn {
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
}

#pokemon-view .inline-label,
#trainers-view .inline-label {
  font-size: 0.8rem;
}
@media (max-width: 768px) {
  #pokemon-view .inline-sort-buttons .sort-btn,
  #trainers-view .inline-sort-buttons .sort-btn {
    padding: 0.2rem 0.45rem;
    font-size: 0.7rem;
  }
}

/* PSA Population Styles */
.psa-population-section {
  margin-top: 1.5rem;
  padding: 0.75rem;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.psa-population-section h4 {
  margin-bottom: 0.75rem;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
}

.psa-grades {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.psa-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  background: rgba(255, 107, 53, 0.1);
  border-radius: 6px;
  border: 1px solid rgba(255, 107, 53, 0.3);
}

.psa-total .psa-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.psa-total .psa-value {
  font-size: 1.25rem;
  color: var(--accent);
  font-weight: 700;
}

.psa-grade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 0.5rem;
}

.psa-grade-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s;
}

.psa-grade-item.highlight {
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.3);
}

.psa-grade-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.psa-grade-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
  font-weight: 500;
}

.psa-grade-value {
  font-size: 1.25rem;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 0.1rem;
}

.psa-grade-percent {
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.8;
}

.psa-updated {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.7;
  margin-top: 0.4rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .psa-grade-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .psa-total .psa-value {
    font-size: 1.25rem;
  }
  
  .psa-grade-value {
    font-size: 1rem;
  }
}

/* Mobile Sort Buttons Flex (Inside Drawer) */
.mobile-sort-buttons-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
  justify-content: flex-start;
}

.mobile-sort-buttons-grid .sort-btn {
  background: var(--card-bg, #1e2139);
  border: 1px solid var(--border, #3a3f5c);
  color: var(--text-secondary);
  padding: 0.3rem 0.5rem; /* Slightly smaller padding */
  border-radius: 4px;
  font-size: 0.7rem; /* Even smaller font */
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.2rem;
  white-space: nowrap;
  transition: background 0.2s, transform 0.1s, border-color 0.2s;
  width: auto; /* Allow auto width based on content */
  flex: 0 1 auto; /* Don't stretch */
}

.mobile-sort-buttons-grid .sort-btn.active {
  background: var(--accent-red);
  color: white;
  border-color: var(--accent-red);
  font-weight: 600;
}

.mobile-sort-buttons-grid .sort-btn:active {
  transform: scale(0.98);
}

/* CRITICAL: User dropdown visibility fix - MUST be at end of file */
@media (max-width: 770px) {
  header {
    overflow: visible !important;
  }
  
  .header-container {
    overflow: visible !important;
  }
  
  .header-right {
    overflow: visible !important;
  }
  
  .user-account {
    position: relative !important;
    overflow: visible !important;
    z-index: 9998 !important;
  }
  
  #user-dropdown {
    display: none !important;
  }
  
  #user-dropdown.active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    margin-top: 0.5rem !important;
    z-index: 9999 !important;
    background: #1a1a1a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
  }
}
