:root {
  --pokedex-red: #c00d0d;
  --pokedex-dark-red: #800000;
  --pokedex-border: #500000;
  --pokedex-green-screen: #8b956d;
  --pokedex-green-screen-dark: #737c59;
  --retro-text-color: #0f380f;
  --btn-yellow: #f1c40f;
  --btn-yellow-hover: #d4ac0d;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Courier New', Courier, monospace, sans-serif;
}

body {
  background-color: #1a1a1a;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 10px;
}

.hidden { display: none !important; }
.hidden-input { display: none; }

/* SPLASH SCREEN */
.splash-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.intro-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  animation: zoomIn 0.8s ease-out;
  text-align: center;
  padding: 20px;
}

.intro-text-flash {
  color: #ffcc00;
  font-size: 1.8rem;
  letter-spacing: 2px;
  text-shadow: 0 0 10px #ffcc00, 2px 2px #000;
  animation: blink 0.8s infinite alternate;
}

.intro-subtext {
  color: #00ffcc;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

@keyframes zoomIn {
  from { transform: scale(0.2); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes blink {
  from { opacity: 0.3; }
  to { opacity: 1; }
}

.splash-card {
  background-color: var(--pokedex-red);
  border: 5px solid var(--pokedex-border);
  border-radius: 15px;
  padding: 30px 20px;
  text-align: center;
  max-width: 90%;
  width: 360px;
  box-shadow: 0 0 25px rgba(255,0,0,0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  animation: fadeIn 0.6s ease-in-out;
}

.party-tag {
  color: #00ffcc !important;
  font-weight: bold;
  font-size: 1.1rem !important;
  text-shadow: 0 0 5px #00ffcc;
}

.pokeball-intro-logo {
  width: 70px;
  height: 70px;
  background: linear-gradient(to bottom, #ff0000 50%, #ffffff 50%);
  border: 4px solid #000;
  border-radius: 50%;
  position: relative;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

.pokeball-intro-logo::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 6px;
  background: #000;
  transform: translateY(-50%);
}

.pokeball-intro-logo::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  background: #fff;
  border: 4px solid #000;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

/* OVERLAY DE CAPTURA (PANTALLA NEGRA) */
.capture-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  overflow: hidden;
}

.capture-screen-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  position: relative;
}

.flash-effect {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: white;
  opacity: 0;
  pointer-events: none;
}

.flash-active { animation: cameraFlash 0.6s ease-out; }

@keyframes cameraFlash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.capture-status-text {
  color: #00ffcc;
  font-size: 1.1rem;
  font-weight: bold;
  letter-spacing: 1px;
  text-shadow: 0 0 8px #00ffcc;
}

.capture-sprite-box {
  width: 180px;
  height: 180px;
  border: 3px solid #333;
  border-radius: 50%;
  background: radial-gradient(circle, #222 0%, #000 80%);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  box-shadow: 0 0 20px rgba(0, 255, 204, 0.2);
  transition: box-shadow 0.5s ease;
}

.capture-sprite-box.captured-glow {
  box-shadow: 0 0 30px rgba(255, 204, 0, 0.8), inset 0 0 15px rgba(255, 204, 0, 0.5);
}

.capture-sprite {
  width: 140px;
  height: 140px;
  object-fit: contain;
  image-rendering: pixelated;
  transition: all 0.5s ease-in-out;
}

.sprite-silhouette { filter: brightness(0) drop-shadow(0 0 5px #ffffff); }

.sprite-suck-in {
  transform: scale(0.05) translateY(50px);
  filter: brightness(2) drop-shadow(0 0 15px #ff0000);
  opacity: 0;
}

.pokeball {
  width: 60px;
  height: 60px;
  background: linear-gradient(to bottom, #ff0000 50%, #ffffff 50%);
  border: 3px solid #000;
  border-radius: 50%;
  position: absolute;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

.pokeball::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 4px;
  background: #000;
  transform: translateY(-50%);
}

.pokeball-button {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  background: #fff;
  border: 3px solid #000;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.pokeball-catch-anim {
  animation: pokeballDrop 0.5s ease-in, pokeballShake 1.2s ease-in-out 0.5s infinite;
}

@keyframes pokeballDrop {
  0% { transform: translateY(-80px) scale(0.5); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes pokeballShake {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-15deg); }
  40% { transform: rotate(15deg); }
  60% { transform: rotate(-10deg); }
  80% { transform: rotate(10deg); }
}

.capture-details-card {
  background-color: #111;
  border: 2px solid #00ffcc;
  border-radius: 10px;
  padding: 15px;
  width: 100%;
  color: #fff;
  text-align: left;
}

.capture-pokemon-name {
  color: #ffcc00;
  text-transform: uppercase;
  font-size: 1.4rem;
  margin-bottom: 8px;
  text-align: center;
  border-bottom: 1px solid #444;
  padding-bottom: 4px;
}

.capture-info { font-size: 0.85rem; margin-top: 5px; color: #ddd; }
.btn-close-capture { width: 100%; margin-top: 10px; }

/* INPUT DE NOMBRE RETRO */
.trainer-input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  margin-bottom: 5px;
}

.trainer-input-group label {
  font-size: 0.75rem;
  color: #ffcc00;
  font-weight: bold;
}

.pokemon-font-input {
  font-family: 'Press Start 2P', cursive;
  background-color: #000;
  color: #ffcc00;
  border: 2px solid #ffcc00;
  padding: 10px;
  font-size: 1rem;
  text-align: center;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* MODAL DE VICTORIA ÉPICA */
.victory-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3000;
  padding: 15px;
}

.victory-modal-card {
  background: linear-gradient(135deg, #1e002c, #4a0018);
  border: 5px solid #ffcc00;
  border-radius: 20px;
  padding: 20px;
  max-width: 520px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 35px #ffcc00;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-height: 95vh;
  overflow-y: auto;
}

.trophy-badge {
  font-size: 3rem;
  animation: bounceTrophy 1s infinite alternate;
}

@keyframes bounceTrophy {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

.victory-gold-title {
  color: #ffcc00;
  font-size: 1.5rem;
  text-shadow: 2px 2px #000, 0 0 15px #ffcc00;
}

.victory-subtitle {
  color: #fff;
  font-size: 0.8rem;
}

.canvas-wrapper {
  width: 100%;
  border: 3px solid #ffcc00;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(255, 204, 0, 0.4);
}

#victory-canvas {
  width: 100%;
  height: auto;
  display: block;
}

.victory-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.btn-download {
  background-color: #3498db;
  color: #fff;
  border-color: #1b4f72;
}

.btn-close-modal {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  margin-top: 5px;
  font-size: 0.85rem;
  text-decoration: underline;
}

/* POKÉDEX CONTENEDOR */
.pokedex-container {
  background-color: var(--pokedex-red);
  border: 6px solid var(--pokedex-border);
  border-radius: 20px;
  width: 100%;
  max-width: 850px;
  padding: 15px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.7);
}

.pokedex-top {
  display: flex;
  align-items: center;
  gap: 15px;
  padding-bottom: 15px;
  border-bottom: 4px solid var(--pokedex-border);
  margin-bottom: 15px;
}

.led-big-blue {
  width: 50px;
  height: 50px;
  background: radial-gradient(circle at 30% 30%, #00d2ff, #004080);
  border: 4px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 10px #00d2ff;
}

.pulse { animation: pulse-animation 1.5s infinite; }

@keyframes pulse-animation {
  0% { box-shadow: 0 0 5px #00d2ff; }
  50% { box-shadow: 0 0 20px #00d2ff; }
  100% { box-shadow: 0 0 5px #00d2ff; }
}

.small-leds { display: flex; gap: 8px; }
.led-small { width: 15px; height: 15px; border-radius: 50%; border: 2px solid #333; }
.led-small.red { background-color: #ff3b30; }
.led-small.yellow { background-color: #ffcc00; }
.led-small.green { background-color: #4cd964; }

.pokedex-body { display: flex; flex-direction: column; gap: 15px; }

@media (min-width: 768px) {
  .pokedex-body { flex-direction: row; }
}

.panel { flex: 1; display: flex; flex-direction: column; gap: 15px; }

.screen-border {
  background-color: #dedede;
  border: 4px solid #999;
  border-radius: 10px 10px 10px 30px;
  padding: 15px;
}

.screen-inner {
  background-color: #222;
  border-radius: 5px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.photo-viewer {
  width: 100%;
  height: 200px;
  background-color: #111;
  border: 2px solid #444;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #666;
  font-weight: bold;
  overflow: hidden;
  border-radius: 4px;
  position: relative;
}

.scanner-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #00ffcc;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

.scanner-line {
  width: 80%;
  height: 2px;
  background: #00ffcc;
  box-shadow: 0 0 8px #00ffcc;
  animation: scanMove 2s infinite ease-in-out;
}

@keyframes scanMove {
  0% { transform: translateY(-30px); opacity: 0.2; }
  50% { opacity: 1; }
  100% { transform: translateY(30px); opacity: 0.2; }
}

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

.status-indicator {
  margin-top: 10px;
  width: 100%;
  padding: 6px;
  text-align: center;
  font-weight: bold;
  font-size: 0.85rem;
  border-radius: 4px;
}

.status-ready { background-color: #27ae60; color: #fff; }
.status-analyzing { background-color: #f39c12; color: #fff; }
.status-captured { background-color: #2980b9; color: #fff; }

.controls-left { display: flex; justify-content: center; }

.btn-retro {
  background-color: var(--btn-yellow);
  color: #000;
  border: 3px solid #000;
  border-radius: 8px;
  padding: 12px 20px;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 0 #000;
  transition: transform 0.1s, box-shadow 0.1s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-retro:active { transform: translateY(4px); box-shadow: 0 0 0 #000; }
.btn-capture { width: 100%; }

.hinge {
  width: 100%;
  height: 10px;
  background: linear-gradient(90deg, #500000, #a00d0d, #500000);
  border-radius: 5px;
}

@media (min-width: 768px) {
  .hinge { width: 12px; height: auto; }
}

.green-screen {
  background-color: var(--pokedex-green-screen);
  border: 4px solid var(--pokedex-green-screen-dark);
  border-radius: 10px;
  padding: 10px;
  color: var(--retro-text-color);
  min-height: 280px;
}

.screen-header h2 {
  font-size: 1.2rem;
  border-bottom: 2px dashed var(--retro-text-color);
  padding-bottom: 5px;
  margin-bottom: 10px;
  text-align: center;
}

.slots-container { display: flex; flex-direction: column; gap: 8px; }

.slot-item {
  background-color: rgba(0, 0, 0, 0.05);
  border: 1px solid var(--retro-text-color);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 0.85rem;
}

.slot-empty { color: #556042; font-style: italic; }

.slot-filled { display: flex; align-items: center; gap: 10px; }
.slot-sprite { width: 48px; height: 48px; image-rendering: pixelated; }
.slot-info { display: flex; flex-direction: column; }
.slot-name { font-weight: bold; text-transform: uppercase; }
.slot-details { font-size: 0.75rem; }

.victory-card {
  background-color: #27ae60;
  border: 3px solid #1e8449;
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-whatsapp { background-color: #25d366; color: #fff; border-color: #128c7e; }