/* ==========================================================================
   POKÉVAULT STYLESHEET
   ========================================================================== */

:root {
  --poke-red: #ee1515;
  --poke-red-dark: #c00d0d;
  --poke-blue: #3b4cca;
  --poke-blue-dark: #2a3a9e;
  --poke-yellow: #ffde00;
  --poke-gold: #e6b800;
  --poke-dark: #1e2024;
  --poke-card-bg: #f8f9fa;
  --text-main: #212529;
  --text-muted: #6c757d;
  
  /* Pokemon Type Colors */
  --type-normal: #a8a878;
  --type-fire: #f08030;
  --type-water: #6890f0;
  --type-grass: #78c850;
  --type-electric: #f8d030;
  --type-ice: #98d8d8;
  --type-fighting: #c03028;
  --type-poison: #a040a0;
  --type-ground: #e0c068;
  --type-flying: #a890f0;
  --type-psychic: #f85888;
  --type-bug: #a8b820;
  --type-rock: #b8a038;
  --type-ghost: #705898;
  --type-dragon: #7038f8;
  --type-steel: #b8b8d0;
  --type-fairy: #ee99ac;
}

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

body {
  font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
  background: #edf2f7;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.poke-header {
  background: linear-gradient(90deg, #ee1515 0%, #d30f0f 70%, #aa0000 100%);
  border-bottom: 4px solid var(--poke-dark);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  color: #fff;
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.pokeball-icon {
  width: 42px;
  height: 42px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='47' fill='%23ffffff' stroke='%231e2024' stroke-width='6'/%3E%3Cpath d='M 3 50 A 47 47 0 0 1 97 50 Z' fill='%23ee1515' stroke='%231e2024' stroke-width='6'/%3E%3Cline x1='3' y1='50' x2='97' y2='50' stroke='%231e2024' stroke-width='8'/%3E%3Ccircle cx='50' cy='50' r='16' fill='%23ffffff' stroke='%231e2024' stroke-width='8'/%3E%3Ccircle cx='50' cy='50' r='8' fill='%23ffffff' stroke='%238a8d91' stroke-width='2'/%3E%3Cellipse cx='30' cy='22' rx='9' ry='4' transform='rotate(-35 30 22)' fill='rgba(255,255,255,0.7)'/%3E%3C/svg%3E");
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.3));
  transition: transform 0.3s ease;
  cursor: pointer;
}

.pokeball-icon:hover {
  transform: rotate(20deg) scale(1.1);
}

.brand-title {
  font-family: 'Press Start 2P', cursive;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  color: #fff;
  text-shadow: 2px 2px 0 var(--poke-dark);
}

.brand-sub {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  letter-spacing: 0.05em;
  display: block;
}

.save-selector-container {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.selector-label {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.65rem;
  color: var(--poke-yellow);
}

.save-select {
  background: #fff;
  color: #1e2024;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: 2px solid var(--poke-dark);
  cursor: pointer;
  outline: none;
  min-width: 260px;
}

.header-actions {
  display: flex;
  gap: 0.6rem;
}

.btn {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid var(--poke-dark);
}

.btn-primary {
  background: #fff;
  color: var(--poke-red);
  box-shadow: 0 3px 0 var(--poke-dark);
}

.btn-primary:hover {
  background: var(--poke-yellow);
  color: var(--poke-dark);
  transform: translateY(-2px);
  box-shadow: 0 5px 0 var(--poke-dark);
}

.btn-secondary {
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
  background: rgba(0, 0, 0, 0.5);
  border-color: #fff;
}

/* ==========================================================================
   NAVIGATION TABS
   ========================================================================== */
.main-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  flex: 1;
}

.tab-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 3px solid var(--poke-dark);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tab-btn {
  background: #e2e8f0;
  border: 2px solid var(--poke-dark);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  padding: 0.8rem 1.4rem;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.7rem;
  color: #4a5568;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  background: #cbd5e0;
  color: #1a202c;
}

.tab-btn.active {
  background: #fff;
  color: var(--poke-red);
  font-weight: bold;
  transform: translateY(3px);
  border-bottom: 3px solid #fff;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Loading State */
.loading-container {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem;
  gap: 1rem;
}

.loading-container.active {
  display: flex;
}

.pokeball-spinner {
  width: 60px;
  height: 60px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='47' fill='%23ffffff' stroke='%231e2024' stroke-width='6'/%3E%3Cpath d='M 3 50 A 47 47 0 0 1 97 50 Z' fill='%23ee1515' stroke='%231e2024' stroke-width='6'/%3E%3Cline x1='3' y1='50' x2='97' y2='50' stroke='%231e2024' stroke-width='8'/%3E%3Ccircle cx='50' cy='50' r='16' fill='%23ffffff' stroke='%231e2024' stroke-width='8'/%3E%3Ccircle cx='50' cy='50' r='8' fill='%23ffffff' stroke='%238a8d91' stroke-width='2'/%3E%3C/svg%3E");
  background-size: contain;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.loading-text {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.75rem;
  color: #718096;
}

/* ==========================================================================
   GENDER BADGES
   ========================================================================== */
.gender-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 900;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
}

.gender-male {
  background: #ebf8ff;
  color: #3182ce;
  border: 1px solid #90cdf4;
}

.gender-female {
  background: #fff5f5;
  color: #e53e3e;
  border: 1px solid #feb2b2;
}

.gender-genderless {
  background: #edf2f7;
  color: #718096;
  border: 1px solid #cbd5e0;
}

/* ==========================================================================
   TAB 1: TRAINER CARD
   ========================================================================== */
.trainer-card-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.trainer-card {
  width: 100%;
  max-width: 620px;
  background: #ffffff;
  border-radius: 20px;
  border: 4px solid var(--poke-dark);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15), 0 5px 0 var(--poke-dark);
  overflow: hidden;
  position: relative;
}

.tc-header {
  background: linear-gradient(90deg, #ee1515 0%, #b80000 100%);
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--poke-dark);
}

.tc-badge-title {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.85rem;
  color: #ffffff;
  letter-spacing: 0.05em;
  text-shadow: 1px 1px 0 #000;
}

.tc-version-badge {
  background: var(--poke-yellow);
  color: var(--poke-dark);
  font-family: 'Press Start 2P', cursive;
  font-size: 0.65rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  border: 2px solid var(--poke-dark);
  text-transform: uppercase;
}

.tc-body {
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.5rem;
  background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
}

.tc-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #edf2f7;
  padding: 1.2rem;
  border-radius: 12px;
  border: 2px solid #cbd5e0;
}

.tc-sprite-frame {
  width: 100px;
  height: 100px;
  background: #fff;
  border-radius: 50%;
  border: 3px solid var(--poke-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.8rem;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
}

.tc-trainer-img {
  width: 80px;
  height: 80px;
  image-rendering: pixelated;
  object-fit: contain;
}

.tc-trainer-name {
  font-family: 'Press Start 2P', cursive;
  font-size: 1rem;
  color: var(--poke-dark);
  margin-bottom: 0.3rem;
}

.tc-trainer-id {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.65rem;
  color: #718096;
}

.tc-info-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.7rem;
}

.tc-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.8rem;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.tc-label {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.65rem;
  color: #718096;
}

.tc-val {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: var(--poke-dark);
}

.tc-money {
  color: #d69e2e;
}

/* Badges section */
.tc-badges-container {
  background: #edf2f7;
  border-top: 3px solid var(--poke-dark);
  padding: 1.2rem 1.5rem;
}

.tc-badges-header {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.7rem;
  color: #4a5568;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
}

.tc-badges-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.5rem;
}

.badge-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.badge-frame {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #cbd5e0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  position: relative;
  transition: all 0.3s ease;
}

.badge-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.badge-slot.unlocked .badge-frame {
  border-color: var(--poke-gold);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
  background: radial-gradient(circle, #fff 0%, #fffbf0 100%);
}

.badge-slot.unlocked:hover .badge-img {
  transform: scale(1.2) rotate(10deg);
}

.badge-slot.locked .badge-frame {
  opacity: 0.35;
  filter: grayscale(1);
  background: #e2e8f0;
}

.badge-name-lbl {
  font-size: 0.65rem;
  font-weight: 700;
  color: #4a5568;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55px;
}

/* ==========================================================================
   TEAM GRID
   ========================================================================== */
.section-block {
  margin-top: 2rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
  border-bottom: 2px solid #cbd5e0;
  padding-bottom: 0.5rem;
}

.section-title {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.95rem;
  color: var(--poke-dark);
}

.section-subtitle {
  font-size: 0.85rem;
  color: #718096;
  font-weight: 600;
}

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

.mon-card {
  background: #fff;
  border-radius: 14px;
  border: 2px solid var(--poke-dark);
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  padding: 1rem;
  display: flex;
  gap: 1rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.mon-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.1);
}

.mon-sprite-box {
  width: 80px;
  height: 80px;
  background: #f7fafc;
  border-radius: 10px;
  border: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mon-sprite {
  width: 72px;
  height: 72px;
  image-rendering: pixelated;
  object-fit: contain;
}

.mon-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mon-name-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.mon-german-name {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.8rem;
  color: var(--poke-dark);
  display: flex;
  align-items: center;
}

.mon-level {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.7rem;
  color: var(--poke-red);
}

.type-pill {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  color: #fff;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-right: 4px;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}

.type-NORMAL { background: var(--type-normal); }
.type-FIRE { background: var(--type-fire); }
.type-WATER { background: var(--type-water); }
.type-GRASS { background: var(--type-grass); }
.type-ELECTRIC { background: var(--type-electric); }
.type-ICE { background: var(--type-ice); }
.type-FIGHTING { background: var(--type-fighting); }
.type-POISON { background: var(--type-poison); }
.type-GROUND { background: var(--type-ground); }
.type-FLYING { background: var(--type-flying); }
.type-PSYCHIC { background: var(--type-psychic); }
.type-BUG { background: var(--type-bug); }
.type-ROCK { background: var(--type-rock); }
.type-GHOST { background: var(--type-ghost); }
.type-DRAGON { background: var(--type-dragon); }
.type-STEEL { background: var(--type-steel); }
.type-FAIRY { background: var(--type-fairy); }

.hp-bar-track {
  background: #edf2f7;
  border: 1px solid #cbd5e0;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin: 0.4rem 0;
}

.hp-bar-fill {
  height: 100%;
  background: #48bb78;
  border-radius: 4px;
}

.hp-text {
  font-size: 0.75rem;
  font-weight: 700;
  color: #718096;
}

.mon-moves-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 0.4rem;
}

.move-chip {
  background: #edf2f7;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  color: #4a5568;
}

/* ==========================================================================
   TAB 2: POKÉDEX
   ========================================================================== */
.pokedex-header-bar {
  background: #fff;
  border-radius: 16px;
  border: 3px solid var(--poke-dark);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.pokedex-stats-counters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.stat-box {
  padding: 1rem;
  border-radius: 12px;
  border: 2px solid var(--poke-dark);
  text-align: center;
}

.stat-box.caught {
  background: #fff5f5;
  border-color: var(--poke-red);
}

.stat-box.caught .stat-number {
  color: var(--poke-red);
}

.stat-box.seen {
  background: #ebf8ff;
  border-color: var(--poke-blue);
}

.stat-box.seen .stat-number {
  color: var(--poke-blue);
}

.stat-box.missing {
  background: #f7fafc;
  border-color: #cbd5e0;
}

.stat-box.missing .stat-number {
  color: #a0aec0;
}

.stat-number {
  font-family: 'Press Start 2P', cursive;
  font-size: 1.6rem;
  margin-bottom: 0.3rem;
}

.stat-title {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.65rem;
  color: #718096;
}

.pokedex-progress-container {
  margin-bottom: 1.2rem;
}

.progress-label-row {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  color: #4a5568;
}

.progress-track {
  height: 14px;
  background: #edf2f7;
  border-radius: 8px;
  border: 2px solid var(--poke-dark);
  overflow: hidden;
  position: relative;
  display: flex;
}

.progress-fill-caught {
  background: var(--poke-red);
  height: 100%;
  transition: width 0.4s ease;
}

.progress-fill-seen {
  background: var(--poke-blue);
  height: 100%;
  transition: width 0.4s ease;
}

.pokedex-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.filter-buttons {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.btn-filter {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: 2px solid #cbd5e0;
  background: #fff;
  color: #4a5568;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-filter:hover {
  border-color: var(--poke-dark);
}

.btn-filter.active {
  background: var(--poke-dark);
  color: #fff;
  border-color: var(--poke-dark);
}

.search-box {
  flex: 1;
  max-width: 320px;
}

.search-input {
  width: 100%;
  padding: 0.5rem 0.8rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  border: 2px solid #cbd5e0;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-input:focus {
  border-color: var(--poke-red);
}

/* ==========================================================================
   POKÉDEX 151 GRID
   ========================================================================== */
.pokedex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.8rem;
}

.dex-card {
  background: #fff;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  padding: 0.8rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.dex-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.08);
}

.dex-card.caught {
  border-color: var(--poke-red);
  background: radial-gradient(circle at center, #ffffff 40%, #fff5f5 100%);
}

.dex-card.caught::after {
  content: '🔴';
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 0.65rem;
}

.dex-card.seen {
  border-color: var(--poke-blue);
  background: #f0f4f8;
}

.dex-card.seen .dex-sprite {
  filter: grayscale(1) opacity(0.65);
}

.dex-card.unseen {
  border-color: #e2e8f0;
  background: #edf2f7;
  opacity: 0.6;
}

.dex-card.unseen .dex-sprite {
  filter: brightness(0) opacity(0.15);
}

.dex-num {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.55rem;
  color: #a0aec0;
  margin-bottom: 0.2rem;
}

.dex-card.caught .dex-num {
  color: var(--poke-red);
}

.dex-sprite-wrap {
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dex-sprite {
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
  object-fit: contain;
}

.dex-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--poke-dark);
  margin-top: 0.3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.dex-types-wrap {
  display: flex;
  gap: 2px;
  margin-top: 0.3rem;
}

/* ==========================================================================
   TAB 3: PC-BOXEN
   ========================================================================== */
.boxes-header-card {
  background: #fff;
  border-radius: 16px;
  border: 3px solid var(--poke-dark);
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.boxes-active-badge {
  background: #edf2f7;
  border: 2px solid var(--poke-dark);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
}

.boxes-active-badge strong {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.8rem;
  color: var(--poke-red);
}

.box-nav-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.6rem;
  margin-bottom: 1.2rem;
}

.box-nav-pill {
  background: #fff;
  border: 2px solid #cbd5e0;
  border-radius: 10px;
  padding: 0.6rem 1rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  transition: all 0.2s ease;
  min-width: 95px;
  white-space: nowrap;
}

.box-nav-pill:hover {
  border-color: var(--poke-dark);
  transform: translateY(-2px);
}

.box-nav-pill.active {
  background: var(--poke-dark);
  border-color: var(--poke-dark);
  color: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.box-nav-pill.active .box-pill-count {
  color: var(--poke-yellow);
}

.box-pill-title {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.7rem;
}

.box-pill-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: #718096;
}

.box-contents-card {
  background: #fff;
  border-radius: 18px;
  border: 3px solid var(--poke-dark);
  padding: 1.5rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.box-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #edf2f7;
  padding-bottom: 0.8rem;
  margin-bottom: 1.2rem;
}

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

.box-slot {
  background: #f8fafc;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  padding: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.box-slot:hover {
  transform: translateY(-2px);
  background: #fff;
  border-color: var(--poke-red);
  box-shadow: 0 6px 14px rgba(0,0,0,0.08);
}

.box-slot.empty {
  border: 2px dashed #cbd5e0;
  background: #f7fafc;
  justify-content: center;
  color: #a0aec0;
  font-weight: 700;
  font-size: 0.85rem;
  min-height: 80px;
  cursor: default;
}

.box-slot.empty:hover {
  transform: none;
  box-shadow: none;
  border-color: #cbd5e0;
}

.box-mon-sprite {
  width: 56px;
  height: 56px;
  image-rendering: pixelated;
  object-fit: contain;
  flex-shrink: 0;
}

.box-mon-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.box-mon-title {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.7rem;
  color: var(--poke-dark);
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.box-mon-level {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--poke-red);
}

/* ==========================================================================
   MODAL
   ========================================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: #fff;
  border-radius: 20px;
  border: 4px solid var(--poke-dark);
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  position: relative;
  overflow: hidden;
  animation: modalPop 0.2s ease-out;
}

@keyframes modalPop {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--poke-dark);
  z-index: 10;
}

.modal-body {
  padding: 2rem;
  text-align: center;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
  .tc-body {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .tc-info-row {
    justify-content: space-between;
  }
  .tc-badges-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.8rem;
  }
  .pokedex-stats-counters {
    grid-template-columns: 1fr;
  }
  .boxes-header-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }
}

/* ==========================================================================
   ADVENTURE & ITEMS TAB
   ========================================================================== */
.adventure-header-card {
  background: #fff;
  border: 4px solid var(--poke-dark);
  border-radius: 18px;
  padding: 1.2rem 1.6rem;
  box-shadow: 4px 4px 0 var(--poke-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-bottom: 1.5rem;
}

.adventure-subnav {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.adv-subnav-btn {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.65rem;
  padding: 0.65rem 0.95rem;
  border: 2px solid var(--poke-dark);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 2px 2px 0 var(--poke-dark);
  color: var(--poke-dark);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.adv-subnav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 2px 4px 0 var(--poke-dark);
  background: #f7fafc;
}

.adv-subnav-btn.active {
  background: var(--poke-red);
  color: #fff;
  border-color: var(--poke-dark);
  box-shadow: 2px 2px 0 var(--poke-dark);
  transform: translateY(1px);
}

.adv-subview {
  display: none;
}

.adv-subview.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

/* Item Filter Bar */
.item-filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
  padding: 0.6rem 0.8rem;
  background: #fff;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
}

.btn-item-filter {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  border: 1px solid #cbd5e0;
  background: #f7fafc;
  color: #4a5568;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-item-filter:hover {
  background: #edf2f7;
  border-color: #a0aec0;
}

.btn-item-filter.active {
  background: var(--poke-blue);
  color: #fff;
  border-color: var(--poke-blue-dark);
  box-shadow: 0 2px 5px rgba(59, 76, 202, 0.3);
}

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

.item-card {
  background: #fff;
  border: 3px solid var(--poke-dark);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  box-shadow: 3px 3px 0 var(--poke-dark);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  overflow: hidden;
}

.item-card:hover {
  transform: translateY(-2px);
  box-shadow: 3px 5px 0 var(--poke-dark);
}

.item-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: #edf2f7;
  border: 2px solid #cbd5e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.item-details {
  flex: 1;
  min-width: 0;
}

.item-name-de {
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--poke-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-name-en {
  font-size: 0.75rem;
  color: #718096;
  margin-bottom: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-cat-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 6px;
  background: #edf2f7;
  color: #4a5568;
}

.item-cat-badge.cat-ball { background: #fed7d7; color: #9b2c2c; }
.item-cat-badge.cat-recovery { background: #c6f6d5; color: #22543d; }
.item-cat-badge.cat-tm_hm { background: #e9d8fd; color: #553c9e; }
.item-cat-badge.cat-key { background: #feebc8; color: #7b341e; }
.item-cat-badge.cat-vitamin { background: #bee3f8; color: #2a4365; }

.item-qty-badge {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.75rem;
  background: #edf2f7;
  border: 2px solid var(--poke-dark);
  border-radius: 8px;
  padding: 0.3rem 0.55rem;
  color: var(--poke-dark);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 2px;
}

.empty-items-notice {
  grid-column: 1 / -1;
  padding: 3rem 1rem;
  text-align: center;
  color: #a0aec0;
  font-weight: 700;
  font-size: 1rem;
  background: #fff;
  border: 2px dashed #cbd5e0;
  border-radius: 12px;
}

/* Kanto Map Banner & Town Cards */
.kanto-summary-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  background: linear-gradient(135deg, #2a4365 0%, #1a365d 100%);
  color: #fff;
  padding: 1.4rem 1.8rem;
  border-radius: 16px;
  border: 3px solid var(--poke-dark);
  margin-bottom: 1.5rem;
  box-shadow: 4px 4px 0 var(--poke-dark);
}

.kanto-banner-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.kanto-banner-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #a0aec0;
  letter-spacing: 0.05em;
}

.kanto-banner-val {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.9rem;
  color: #ffde00;
}

.kanto-towns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
}

.town-card {
  background: #fff;
  border: 3px solid var(--poke-dark);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  box-shadow: 3px 3px 0 var(--poke-dark);
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.town-card:hover {
  transform: translateY(-2px);
  box-shadow: 3px 5px 0 var(--poke-dark);
}

.town-card.visited {
  border-color: #2b6cb0;
  background: #f7fafc;
}

.town-card.unvisited {
  opacity: 0.55;
  border-color: #cbd5e0;
  filter: grayscale(0.5);
}

.town-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.town-name {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.78rem;
  color: var(--poke-dark);
}

.town-status-tag {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 12px;
}

.town-status-tag.tag-visited {
  background: #c6f6d5;
  color: #22543d;
}

.town-status-tag.tag-unvisited {
  background: #edf2f7;
  color: #718096;
}

.town-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed #e2e8f0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #4a5568;
}

.town-desc {
  font-size: 0.82rem;
  color: #718096;
  margin-top: 0.4rem;
  line-height: 1.35;
}

/* Trainer Stats Cards Grid */
.trainer-stats-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.2rem;
}

.stat-tile {
  background: #fff;
  border: 3px solid var(--poke-dark);
  border-radius: 14px;
  padding: 1.2rem;
  box-shadow: 3px 3px 0 var(--poke-dark);
  display: flex;
  align-items: center;
  gap: 1.1rem;
  transition: transform 0.15s ease;
}

.stat-tile:hover {
  transform: translateY(-2px);
}

.stat-tile-icon {
  font-size: 2rem;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #edf2f7;
  border: 2px solid #cbd5e0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-tile-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stat-tile-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #718096;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.stat-tile-val {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.92rem;
  color: var(--poke-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Save Download Card */
.save-download-card {
  background: #fff;
  border: 4px solid var(--poke-dark);
  border-radius: 18px;
  padding: 2.2rem;
  box-shadow: 5px 5px 0 var(--poke-dark);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 680px;
  margin: 1rem auto;
}

.save-download-icon {
  font-size: 3.5rem;
  text-align: center;
}

.save-download-info h3 {
  font-family: 'Press Start 2P', cursive;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  color: var(--poke-dark);
}

.save-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.meta-tag {
  background: #edf2f7;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  color: #4a5568;
}

.save-download-actions {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 0.5rem;
}

.btn-download-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: #38a169;
  color: #fff;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.75rem;
  padding: 1rem 1.4rem;
  border-radius: 10px;
  border: 3px solid var(--poke-dark);
  box-shadow: 3px 3px 0 var(--poke-dark);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-download-primary:hover {
  background: #2f855a;
  transform: translateY(-2px);
  box-shadow: 3px 5px 0 var(--poke-dark);
}

.btn-download-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #fff;
  color: var(--poke-dark);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.85rem 1.4rem;
  border-radius: 10px;
  border: 2px solid var(--poke-dark);
  box-shadow: 2px 2px 0 var(--poke-dark);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-download-secondary:hover {
  background: #edf2f7;
  transform: translateY(-2px);
  box-shadow: 2px 4px 0 var(--poke-dark);
}

/* ==========================================================================
   GAME BOY LIVE EMULATOR TAB
   ========================================================================== */
.emulator-header-card {
  background: #fff;
  border: 4px solid var(--poke-dark);
  border-radius: 18px;
  padding: 1.2rem 1.6rem;
  box-shadow: 4px 4px 0 var(--poke-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-bottom: 1rem;
}

.emu-toolbar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.emu-setting-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.62rem;
  color: var(--poke-dark);
}

.emu-select {
  padding: 0.5rem 0.8rem;
  border: 2px solid var(--poke-dark);
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  background: #f7fafc;
  color: var(--poke-dark);
  cursor: pointer;
  outline: none;
}

.emu-save-badge {
  padding: 0.5rem 0.85rem;
  border: 2px solid var(--poke-dark);
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  background: #ebf8ff;
  color: #2b6cb0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 2px 2px 0 var(--poke-dark);
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.emu-action-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-emu-play {
  background: #38a169;
  color: #fff;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.72rem;
  padding: 0.65rem 1.1rem;
  border: 3px solid var(--poke-dark);
  border-radius: 9px;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--poke-dark);
  transition: all 0.15s ease;
}

.btn-emu-play:hover {
  background: #2f855a;
  transform: translateY(-2px);
  box-shadow: 2px 4px 0 var(--poke-dark);
}

.btn-emu-play.playing {
  background: #e53e3e;
}

.btn-emu-icon {
  background: #fff;
  color: var(--poke-dark);
  font-family: 'Press Start 2P', cursive;
  font-size: 0.72rem;
  padding: 0.6rem 0.75rem;
  border: 2px solid var(--poke-dark);
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--poke-dark);
  transition: all 0.15s ease;
}

.btn-emu-icon:hover {
  background: #f7fafc;
  transform: translateY(-2px);
  box-shadow: 2px 4px 0 var(--poke-dark);
}

/* Save Banner */
.emu-save-banner {
  background: #2d3748;
  color: #fff;
  border: 3px solid var(--poke-dark);
  border-radius: 12px;
  padding: 0.8rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
  box-shadow: 3px 3px 0 var(--poke-dark);
}

.emu-save-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.sync-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #a0aec0;
  display: inline-block;
}

.sync-dot.active {
  background: #48bb78;
  box-shadow: 0 0 8px #48bb78;
}

.sync-dot.saving {
  background: #ecc94b;
  box-shadow: 0 0 8px #ecc94b;
}

.emu-save-buttons {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.btn-save-sync, .btn-save-download, .btn-save-upload {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.6rem;
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  border: 2px solid var(--poke-dark);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.15s ease;
}

.btn-save-sync {
  background: #3182ce;
  color: #fff;
  box-shadow: 2px 2px 0 var(--poke-dark);
}
.btn-save-sync:hover {
  background: #2b6cb0;
  transform: translateY(-1px);
}

.btn-save-download {
  background: #4a5568;
  color: #fff;
  box-shadow: 2px 2px 0 var(--poke-dark);
}
.btn-save-download:hover {
  background: #2d3748;
  transform: translateY(-1px);
}

.btn-save-upload {
  background: #e2e8f0;
  color: #2d3748;
  box-shadow: 2px 2px 0 var(--poke-dark);
}
.btn-save-upload:hover {
  background: #cbd5e0;
  transform: translateY(-1px);
}

/* ==========================================================================
   DOT MATRIX SCREEN UNIT & EMULATOR
   ========================================================================== */
.dotmatrix-player-container {
  display: flex;
  gap: 2rem;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}

/* Authentic Dot Matrix Bezel Unit */
.dotmatrix-bezel {
  width: 100%;
  max-width: 580px;
  background: linear-gradient(155deg, #656b73 0%, #4b5056 45%, #3d4147 100%);
  border: 4px solid var(--poke-dark);
  border-radius: 16px 16px 42px 16px;
  box-shadow: 6px 10px 0 rgba(0, 0, 0, 0.25), inset 0 2px 3px rgba(255, 255, 255, 0.2), inset 0 -3px 8px rgba(0, 0, 0, 0.5);
  padding: 1.2rem 1.5rem 1.4rem 1.5rem;
  position: relative;
  user-select: none;
  transition: all 0.3s ease;
}

/* Bezel Header: Red Line | DOT MATRIX WITH STEREO SOUND | Blue Line */
.dotmatrix-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.dm-line {
  flex: 1;
  height: 3px;
  border-radius: 2px;
}

.dm-line.red {
  background: linear-gradient(90deg, #e53e3e 0%, #c53030 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.dm-line.blue {
  background: linear-gradient(90deg, #3182ce 0%, #2b6cb0 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.dm-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.72rem;
  color: #edf2f7;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

/* Screen Row: Battery Column + Canvas */
.dotmatrix-screen-row {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
}

/* Left Battery Column */
.dm-battery-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 48px;
  flex-shrink: 0;
}

.gb-led {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #2d3748;
  border: 1px solid #1a202c;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
  display: inline-block;
  transition: all 0.25s ease;
}

.gb-led.active {
  background: #ff2b2b;
  box-shadow: 0 0 12px #ff2222, 0 0 4px #ff9999;
  border-color: #990000;
}

.dm-battery-text {
  font-family: 'Outfit', sans-serif;
  font-size: 0.58rem;
  font-weight: 800;
  color: #cbd5e0;
  letter-spacing: 0.06em;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Canvas Wrapper */
.gb-canvas-wrapper {
  position: relative;
  flex: 1;
  width: 100%;
  aspect-ratio: 160 / 144;
  background: #8bac0f;
  border: 4px solid #1a202c;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.65), 0 2px 4px rgba(0, 0, 0, 0.2);
}

.gb-canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  outline: none;
}

.gb-splash {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #8bac0f;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  color: #0f380f;
  z-index: 5;
}

.gb-splash.hidden {
  display: none;
}

.splash-pokeball {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #306230;
  border: 4px solid #0f380f;
  position: relative;
  margin-bottom: 0.8rem;
  animation: splashBob 2s infinite ease-in-out;
}

.splash-pokeball::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #8bac0f;
  border: 3px solid #0f380f;
}

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

.splash-text {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.7rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.splash-sub {
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.85;
}

.emu-toast {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.88);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.emu-toast.show {
  opacity: 1;
}

/* Footer: GAME BOY COLOR / DMG accent */
.dotmatrix-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 14px;
  padding-right: 6px;
}

.dm-sub-brand {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-style: italic;
  font-size: 1.05rem;
  color: #a0aec0;
  letter-spacing: 0.03em;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
}


@media (max-width: 600px) {
  .dotmatrix-bezel {
    padding: 0.8rem 0.8rem 1rem 0.8rem;
    border-radius: 12px 12px 28px 12px;
  }
  .dotmatrix-header {
    margin-bottom: 10px;
    gap: 6px;
  }
  .dm-title {
    font-size: 0.6rem;
    letter-spacing: 0.04em;
  }
  .dotmatrix-screen-row {
    gap: 8px;
  }
  .dm-battery-col {
    width: 36px;
  }
  .dm-battery-text {
    font-size: 0.5rem;
  }
}

