/* ==========================================================================
   NES SMART CONSOLE // RETRO BEZEL CHASSIS & HYBRID BALANCED FILTER
   Optimized to be flush (al ras del marco) with maximum visible screen
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Silkscreen:wght@400;700&family=VT323&family=Space+Grotesk:wght@400;600&display=swap');

:root {
  /* Paleta NES / Famicom Original */
  --nes-red: #d82800;
  --nes-dark-red: #881400;
  --nes-gold: #f8b800;
  --nes-grey: #a4a4a4;
  --nes-dark-grey: #202020;
  --nes-bg-dark: #0a0b0e;
  --nes-screen-bg: #000000;
  --nes-border: #333a42;
  --nes-accent: #00e5ff;
  --nes-green: #00e676;
  --nes-warning: #ff9100;

  /* Chasis Game Boy (Battleship Palette) */
  --gb-bezel: #68696e;
  --gb-bezel-inner: #3a3b3e;
  --gb-stripe-red: #ba1333;
  --gb-stripe-blue: #003399;
  --gb-brand-blue: #1e3a8a;

  /* Jev AI Theme */
  --jev-brand: #7c3aed;
  --jev-glow: rgba(124, 58, 237, 0.4);
  --jev-text: #f3e8ff;

  /* Tipografías */
  --font-pixel: 'Press Start 2P', monospace;
  --font-screen: 'Silkscreen', monospace;
  --font-terminal: 'VT323', monospace;
  --font-ui: 'Space Grotesk', -apple-system, sans-serif;
}

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

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--nes-bg-dark);
  color: #fff;
  font-family: var(--font-pixel);
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   VIEWPORT PRINCIPAL: FULLSCREEN SIN MÁRGENES ESTORBOSOS
   ========================================================================== */
#console-viewport {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #151821 0%, #07080a 100%);
  overflow: hidden;
}

/* Pantalla del emulador */
#screen-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 42px 10px 10px 10px;
}

/* Desplazamiento inteligente hacia la izquierda cuando el panel de Jev está abierto */
#console-viewport.drawer-open #screen-wrapper {
  transform: translateX(-190px);
}

/* ==========================================================================
   CABINA ARCADE RETRO (IMAGEN ENVOLVENTE Y PANTALLA 4:3 CALIBRADA)
   ========================================================================== */
:root {
  --tv-height: min(84vh, calc(100vh - 76px));
}

#crt-tv-chassis {
  height: var(--tv-height);
  width: calc(var(--tv-height) * (4 / 3));
  max-width: calc(100vw - 20px);
  max-height: calc((100vw - 20px) * (3 / 4));
  aspect-ratio: 4 / 3;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  position: relative;
  user-select: none;
  box-sizing: border-box;
}

/* Imagen de Cabina Arcade envolvente con recorte transparente */
.arcade-bezel-art {
  position: absolute;
  top: -47.3495%;
  left: -80.3419%;
  width: 259.6866%;
  height: 182.8392%;
  max-width: none !important;
  max-height: none !important;
  pointer-events: none;
  z-index: 10;
  user-select: none;
  transition: opacity 0.25s ease;
}

/* Imagen de Chasis Consola envolvente con recorte transparente */
.console-bezel-art {
  position: absolute;
  top: -22.5256%;
  left: -61.7183%;
  width: 223.5629%;
  height: 179.2662%;
  max-width: none !important;
  max-height: none !important;
  pointer-events: none;
  z-index: 10;
  user-select: none;
  transition: opacity 0.25s ease;
}

/* Pantalla CRT donde se proyecta el emulador al ras del recorte */
#crt-tube-bezel {
  position: relative;
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  min-height: 0;
  background: #000;
  border-radius: 6px;
  border: none;
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.95);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

/* Reflejo / Brillo especular del cristal curvado */
.crt-glass-glare {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 6;
  border-radius: 6px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.07) 0%,
    rgba(255, 255, 255, 0.02) 22%,
    transparent 50%
  );
  box-shadow: 
    inset 0 1px 2px rgba(255, 255, 255, 0.08),
    inset 0 -2px 8px rgba(0, 0, 0, 0.7);
}

/* Ocultar el marco plástico viejo */
.tv-bottom-lip {
  display: none !important;
}

.tv-power-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
}

.tv-power-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff3333;
  box-shadow: 0 0 8px #ff2222, 0 0 2px #ffffff;
  display: inline-block;
  animation: ledPulse 4s infinite ease-in-out;
}

@keyframes ledPulse {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 1; box-shadow: 0 0 10px #ff2222, 0 0 3px #ffffff; }
}

.tv-brand-label {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: #8b92a0;
  letter-spacing: 1.5px;
}

.tv-badges {
  display: flex;
  gap: 8px;
}

.tv-feature-text {
  font-family: var(--font-screen);
  font-size: 8px;
  color: #64748b;
  letter-spacing: 1px;
  border: 1px solid #2e323b;
  padding: 1px 6px;
  border-radius: 2px;
  background: #14161a;
}

/* El lienzo aprovecha el 100% del contenedor al ras del marco */
#nes-canvas,
#nostalgist-canvas,
.crt-game-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  background-color: var(--nes-screen-bg);
  object-fit: fill !important;
  border-radius: 14px;
  
  /* --- FILTRO MEDIO (PUNTO MEDIO ENTRE CRT Y CRUDO) --- */
  image-rendering: auto; /* Suaviza cortes secos de pixeles tipo bloques duros */
  filter: contrast(1.08) brightness(1.03) saturate(1.18);
  transition: filter 0.3s ease, image-rendering 0.3s ease;
}

#nes-canvas.hidden,
#nostalgist-canvas.hidden,
canvas.hidden {
  display: none !important;
}

/* Modo Crudo (100% Pixelado) */
body.filter-raw #nes-canvas,
body.filter-raw #nostalgist-canvas,
body.filter-raw .crt-game-canvas {
  image-rendering: pixelated !important;
  image-rendering: crisp-edges !important;
  filter: none !important;
}

/* Modo CRT Clásico Fuerte */
body.filter-heavy-crt #nes-canvas,
body.filter-heavy-crt #nostalgist-canvas,
body.filter-heavy-crt .crt-game-canvas {
  image-rendering: auto !important;
  filter: contrast(1.14) brightness(1.05) saturate(1.25) drop-shadow(0 0 10px rgba(255, 255, 255, 0.08));
}

/* CRT Standby Prompt (Mensaje de espera al inicio) */
.crt-prompt {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: radial-gradient(circle at center, #0e121a 0%, #030408 100%);
  z-index: 4;
  border-radius: 14px;
  padding: 24px;
  text-align: center;
}

.crt-prompt-icon {
  font-size: 2.8rem;
  filter: drop-shadow(0 0 12px rgba(0, 229, 255, 0.4));
  animation: promptFloat 2.5s ease-in-out infinite alternate;
}

.crt-prompt-text {
  font-family: var(--font-pixel);
  font-size: 13px;
  color: #00e5ff;
  letter-spacing: 1px;
  line-height: 1.8;
  max-width: 85%;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.6), 0 0 20px rgba(0, 229, 255, 0.2);
  animation: promptGlow 3s ease-in-out infinite alternate;
}

.crt-prompt-subtext {
  font-family: var(--font-screen);
  font-size: 10px;
  color: #64748b;
  letter-spacing: 0.5px;
}

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

@keyframes promptGlow {
  0% { opacity: 0.85; }
  100% { opacity: 1; text-shadow: 0 0 14px rgba(0, 229, 255, 0.8), 0 0 25px rgba(0, 229, 255, 0.4); }
}

/* Retro CRT Loader */
.crt-loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: radial-gradient(circle at center, #0a0e17 0%, #030408 100%);
  z-index: 5;
  border-radius: 14px;
}

.crt-loader-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(16, 185, 129, 0.2);
  border-top-color: #10b981;
  border-radius: 50%;
  animation: crtSpin 0.8s linear infinite;
}

@keyframes crtSpin {
  to { transform: rotate(360deg); }
}

.crt-loader-text {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: #10b981;
  text-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
  letter-spacing: 1.5px;
  text-align: center;
  padding: 0 20px;
  animation: crtTextPulse 1.5s ease-in-out infinite;
}

@keyframes crtTextPulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; text-shadow: 0 0 14px rgba(16, 185, 129, 1); }
}

/* ==========================================================================
   MODAL DE CARGA Y PATROCINIO / RECOMPENSA DE CRÉDITOS ARCADE
   ========================================================================== */
.ad-loading-modal {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 6, 12, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 12px;
  animation: adModalFadeIn 0.25s ease-out;
  box-sizing: border-box;
}

@keyframes adModalFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.ad-loading-modal.fade-out {
  animation: adModalFadeOut 0.4s ease-in forwards;
}

@keyframes adModalFadeOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(1.02); pointer-events: none; }
}

.ad-modal-card {
  width: 92%;
  max-width: 380px;
  max-height: 94%;
  background: linear-gradient(145deg, rgba(20, 24, 36, 0.98) 0%, rgba(10, 13, 20, 0.99) 100%);
  border: 2px solid #2563eb;
  border-radius: 12px;
  box-shadow: 0 0 25px rgba(37, 99, 235, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font-screen);
  box-sizing: border-box;
}

.ad-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.92);
  border-bottom: 1px solid rgba(37, 99, 235, 0.35);
}

.ad-badge {
  font-family: var(--font-nes);
  font-size: 7.5px;
  color: #fbbf24;
  letter-spacing: 0.5px;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
}

.ad-status {
  font-size: 8.5px;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  animation: pulseNeonStatus 1.4s infinite alternate;
}

@keyframes pulseNeonStatus {
  from { opacity: 0.75; }
  to { opacity: 1; text-shadow: 0 0 10px #38bdf8; }
}

.ad-media-container {
  min-height: 110px;
  max-height: 190px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #111827 0%, #030712 100%);
  padding: 12px;
  overflow: hidden;
}

.ad-media-container video,
.ad-media-container iframe {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: none;
}

.ad-placeholder-art {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.arcade-neon-spinner {
  width: 38px;
  height: 38px;
  border: 3.5px solid rgba(59, 130, 246, 0.2);
  border-top-color: #38bdf8;
  border-right-color: #ec4899;
  border-radius: 50%;
  animation: arcadeSpin 0.85s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.5);
}

@keyframes arcadeSpin {
  to { transform: rotate(360deg); }
}

.ad-placeholder-title {
  font-family: var(--font-nes);
  font-size: 8.5px;
  color: #f8fafc;
  letter-spacing: 0.5px;
  max-width: 92%;
  line-height: 1.35;
}

.ad-placeholder-desc {
  font-size: 8px;
  color: #94a3b8;
  letter-spacing: 0.3px;
  max-width: 90%;
  line-height: 1.3;
}

.ad-modal-footer {
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.88);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ad-progress-bar {
  width: 100%;
  height: 7px;
  background: #090d16;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(59, 130, 246, 0.4);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7);
}

.ad-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2563eb, #38bdf8, #10b981);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
  transition: width 0.3s ease;
}

.ad-reward-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.5);
  border-radius: 6px;
  padding: 4px 8px;
  color: #fbbf24;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-align: center;
  transition: all 0.3s ease;
}

.ad-reward-pill.granted {
  background: rgba(16, 185, 129, 0.22);
  border-color: #10b981;
  color: #34d399;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
  animation: rewardPulse 0.4s ease;
}

@keyframes rewardPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* Botón de Reclamar Créditos e Iniciar Partida */
.btn-ad-claim {
  width: 100%;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 8px;
  font-family: var(--font-screen);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  cursor: not-allowed;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(30, 41, 59, 0.85);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

.btn-ad-claim.ready {
  cursor: pointer;
  background: linear-gradient(135deg, #f59e0b 0%, #eab308 50%, #ca8a04 100%);
  border: 1.5px solid #fef08a;
  color: #0f172a;
  font-weight: 800;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.75), inset 0 1px 1px rgba(255, 255, 255, 0.6);
  animation: btnClaimPulse 1.2s infinite alternate ease-in-out;
}

.btn-ad-claim.ready:hover,
.btn-ad-claim.ready:active {
  transform: scale(1.02);
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  box-shadow: 0 0 26px rgba(251, 191, 36, 0.95), inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

.btn-ad-claim.injecting {
  cursor: wait;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: #6ee7b7;
  color: #fff;
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.6);
}

@keyframes btnClaimPulse {
  0% { transform: scale(1); box-shadow: 0 0 12px rgba(245, 158, 11, 0.5); }
  100% { transform: scale(1.025); box-shadow: 0 0 24px rgba(251, 191, 36, 0.9); }
}

#btn-add-credits {
  background: rgba(245, 158, 11, 0.18);
  border-color: #f59e0b;
  color: #fef08a;
  font-weight: 700;
}

#btn-add-credits:hover {
  background: rgba(245, 158, 11, 0.35);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
  color: #fff;
}

@media (max-width: 480px) {
  .ad-modal-card {
    width: 95%;
  }
  .ad-media-container {
    min-height: 95px;
    padding: 8px;
  }
  .arcade-neon-spinner {
    width: 30px;
    height: 30px;
  }
  .ad-placeholder-title {
    font-size: 7.5px;
  }
  .ad-placeholder-desc {
    font-size: 7px;
  }
}

/* ==========================================================================
   OVERLAY DE SCANLINES CRT (EQUILIBRADO)
   ========================================================================== */
.crt-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  transition: opacity 0.3s ease;
  border-radius: 14px;
}

/* Modo Balanceado (Punto Medio sutil y limpio) */
.crt-overlay.mode-balanced {
  opacity: 0.22;
  background: 
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.28) 50%),
    linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02));
  background-size: 100% 3px, 3px 100%;
}

/* Modo Pesado */
.crt-overlay.mode-heavy {
  opacity: 0.85;
  background: 
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.45) 50%),
    linear-gradient(90deg, rgba(255, 0, 0, 0.05), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.05)),
    radial-gradient(circle at center, transparent 65%, rgba(0, 0, 0, 0.5) 100%);
  background-size: 100% 4px, 3px 100%, 100% 100%;
}

/* Modo Desactivado */
.crt-overlay.disabled {
  display: none;
}

/* ==========================================================================
   TOP BAR HUD FLOTANTE (ULTRA SLIM & COMPACTO)
   ========================================================================== */
#top-hud {
  position: absolute;
  top: 6px;
  left: 12px;
  right: 12px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: rgba(15, 17, 23, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  z-index: 25;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

#top-hud.collapsed {
  transform: translateY(-115%) !important;
}

/* Botón pestaña para desplegar/ocultar el HUD */
.btn-hud-toggle {
  position: absolute;
  bottom: -20px;
  right: 16px;
  background: rgba(15, 17, 23, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-top: none;
  border-radius: 0 0 8px 8px;
  color: var(--nes-gold);
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 3px 8px;
  cursor: pointer;
  z-index: 30;
  transition: transform 0.25s ease, background 0.2s ease, color 0.2s ease;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
}

.btn-hud-toggle:hover {
  background: #1e222d;
  color: #fff;
}

#top-hud.collapsed .btn-hud-toggle {
  transform: translateY(20px);
}

.hud-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Logo */
.console-logo {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--nes-gold);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.console-logo .badge-famicom {
  background: var(--nes-red);
  color: #fff;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 8px;
}

/* Selector de Plataforma (Arcade vs Consola) */
.platform-selector {
  display: flex;
  align-items: center;
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 1px;
  gap: 2px;
}

.platform-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-family: var(--font-screen);
  font-size: 8.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 3px;
}

.platform-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.platform-btn.active[data-platform="arcade"] {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #fff;
  box-shadow: 0 0 10px rgba(217, 119, 6, 0.5);
}

.platform-btn.active[data-platform="console"] {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
}

/* Selector de Idioma (i18n Multilingüe Anti-Baneo) */
.lang-selector {
  display: flex;
  align-items: center;
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 1px;
  gap: 2px;
}

.lang-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-family: var(--font-screen);
  font-size: 8.5px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}

.lang-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.lang-btn.active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.5);
}

/* Selector de Juegos */
.game-selector select {
  background: #11141a;
  border: 1px solid var(--nes-border);
  color: #e2e8f0;
  font-family: var(--font-screen);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  max-width: 250px;
}

.game-selector select:hover {
  border-color: var(--nes-accent);
}

/* Badges de Estado */
.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  font-size: 9px;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: all 0.2s;
}

.status-pill:hover {
  background: rgba(255, 255, 255, 0.08);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #64748b;
}

.status-dot.active {
  background: var(--nes-green);
  box-shadow: 0 0 8px var(--nes-green);
}

.status-dot.jev-active {
  background: #a855f7;
  box-shadow: 0 0 8px #a855f7;
}

.status-pill.credits-pill {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fef08a;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  cursor: default;
}

.status-dot.credits-dot.active {
  background: #fbbf24;
  box-shadow: 0 0 8px #fbbf24;
}

.status-dot.credits-dot.empty {
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

/* Controles de Consola */
.hud-btn {
  background: #1e232d;
  border: 1px solid var(--nes-border);
  color: #cbd5e1;
  font-family: var(--font-screen);
  font-size: 10px;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}

.hud-btn:hover {
  background: #2d3748;
  color: #fff;
  border-color: var(--nes-accent);
}

.hud-btn.active {
  background: #2563eb;
  border-color: #3b82f6;
  color: #fff;
}

#btn-silhouettes.active {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  color: #fef08a;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

#btn-palette.active {
  background: rgba(6, 182, 212, 0.2);
  border-color: #06b6d4;
  color: #a5f3fc;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}


/* ==========================================================================
   DRAWER LATERAL: JEV AI CO-PILOT & TELEMETRÍA (COLAPSABLE)
   ========================================================================== */
#jev-drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: 360px;
  height: 100vh;
  background: rgba(14, 16, 22, 0.95);
  backdrop-filter: blur(15px);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 30;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
}

#jev-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 16px;
  border-bottom: 1px solid var(--nes-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #12151d;
}

.drawer-title {
  font-size: 11px;
  color: #c084fc;
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
}

.drawer-close:hover {
  color: #fff;
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Tarjetas de Telemetría */
.telemetry-card {
  background: #181c25;
  border: 1px solid #2b323f;
  border-radius: 6px;
  padding: 12px;
}

.telemetry-card-title {
  font-family: var(--font-screen);
  font-size: 9px;
  color: #94a3b8;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.telemetry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.metric-box {
  background: #11141b;
  padding: 8px;
  border-radius: 4px;
  border-left: 2px solid var(--nes-accent);
}

.metric-label {
  font-family: var(--font-ui);
  font-size: 9px;
  color: #64748b;
  text-transform: uppercase;
}

.metric-value {
  font-family: var(--font-terminal);
  font-size: 18px;
  color: #f8fafc;
  margin-top: 2px;
}

/* Consola Táctica de Jev */
.tactical-log {
  background: #0d0f14;
  border: 1px solid #232935;
  border-radius: 4px;
  padding: 10px;
  font-family: var(--font-terminal);
  font-size: 14px;
  color: #a7f3d0;
  height: 180px;
  overflow-y: auto;
  line-height: 1.4;
}

.tactical-entry {
  margin-bottom: 6px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
  padding-bottom: 4px;
}

.tactical-time {
  color: #64748b;
  font-size: 12px;
}

.tactical-action {
  color: var(--nes-gold);
  font-weight: bold;
}

/* Configuración de API Key */
.config-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.config-group label {
  font-family: var(--font-screen);
  font-size: 8px;
  color: #94a3b8;
}

.config-group input {
  background: #0f1218;
  border: 1px solid #333a46;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 11px;
  padding: 8px 10px;
  border-radius: 4px;
  outline: none;
}

.config-group input:focus {
  border-color: #a855f7;
}

/* ==========================================================================
   HUD FLOTANTE INFERIOR: ESTADO DEL MANDO XBOX
   ========================================================================== */
#bottom-hud {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(15, 17, 23, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 5px 16px;
  z-index: 20;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#console-viewport.drawer-open #bottom-hud {
  transform: translateX(calc(-50% - 190px));
}

.xbox-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 10px;
  color: #e2e8f0;
}

.xbox-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #107c10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: bold;
  color: #fff;
}

.gamepad-buttons {
  display: flex;
  gap: 4px;
}

.gp-key {
  display: inline-block;
  padding: 2px 5px;
  background: #252b36;
  border-radius: 3px;
  font-size: 8px;
  color: #94a3b8;
}

.gp-key.pressed {
  background: var(--nes-gold);
  color: #000;
  font-weight: bold;
}

/* ==========================================================================
   MANDO TÁCTIL VIRTUAL PARA MÓVILES Y TABLETS (RETRO ON-SCREEN GAMEPAD)
   ========================================================================== */
.touch-controller {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  display: none;
  justify-content: space-between;
  align-items: flex-end;
  padding: 15px 20px 20px 20px;
  pointer-events: none;
  z-index: 60;
  touch-action: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.touch-controller.active {
  display: flex !important;
}

.v-btn {
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  border: none;
  outline: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-pixel);
  transition: transform 0.05s ease, background-color 0.05s ease, filter 0.05s ease;
}

/* --- CRUCETA D-PAD VIRTUAL --- */
.virtual-dpad {
  position: relative;
  width: 130px;
  height: 130px;
  background: rgba(18, 20, 26, 0.7);
  backdrop-filter: blur(12px);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), inset 0 2px 5px rgba(255, 255, 255, 0.1);
}

.dpad-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  background: #12141a;
  border-radius: 6px;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.8);
}

.dpad-btn {
  position: absolute;
  background: #232733;
  color: #94a3b8;
  font-size: 14px;
  box-shadow: 0 3px 0 #12141a;
}

.dpad-up {
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 42px;
  border-radius: 8px 8px 0 0;
}

.dpad-down {
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 42px;
  border-radius: 0 0 8px 8px;
}

.dpad-left {
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 40px;
  border-radius: 8px 0 0 8px;
}

.dpad-right {
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 40px;
  border-radius: 0 8px 8px 0;
}

.dpad-btn:active, .dpad-btn.v-pressed {
  background: var(--nes-gold) !important;
  color: #000 !important;
  box-shadow: 0 0 8px var(--nes-gold) !important;
}

.dpad-up:active, .dpad-up.v-pressed {
  transform: translateX(-50%) translateY(2px) scale(0.98) !important;
}

.dpad-down:active, .dpad-down.v-pressed {
  transform: translateX(-50%) translateY(-2px) scale(0.98) !important;
}

.dpad-left:active, .dpad-left.v-pressed {
  transform: translateY(-50%) translateX(2px) scale(0.98) !important;
}

.dpad-right:active, .dpad-right.v-pressed {
  transform: translateY(-50%) translateX(-2px) scale(0.98) !important;
}

/* --- BOTONES CENTRALES SELECT & START --- */
.virtual-meta-btns {
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
  background: rgba(18, 20, 26, 0.7);
  backdrop-filter: blur(10px);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.v-pill-btn {
  background: #2b303c;
  color: #cbd5e1;
  font-size: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  box-shadow: 0 2px 0 #151821;
}

.v-pill-btn:active, .v-pill-btn.v-pressed {
  background: #e2e8f0 !important;
  color: #000 !important;
  transform: scale(0.92);
}

/* --- BOTONES DE ACCIÓN (B, A, Y, X) --- */
.virtual-action-btns {
  position: relative;
  width: 140px;
  height: 140px;
  background: rgba(18, 20, 26, 0.7);
  backdrop-filter: blur(12px);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
}

.v-round-btn {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: bold;
  color: #fff;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.6);
}

.btn-b {
  bottom: 12px;
  left: 20px;
  background: #dc2626; /* Rojo NES */
}

.btn-a {
  bottom: 30px;
  right: 8px;
  background: #d82800; /* Carmín */
}

.btn-y {
  top: 30px;
  left: 8px;
  background: #2563eb; /* Azul */
}

.btn-x {
  top: 12px;
  right: 20px;
  background: #ca8a04; /* Amarillo */
}

.v-round-btn:active, .v-round-btn.v-pressed {
  filter: brightness(1.4);
  transform: scale(0.90);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.8) !important;
}

/* --- VARIACIONES DINÁMICAS DE BOTONERA SEGÚN EL SISTEMA --- */

/* 1. MODO 2 BOTONES (NES, Game Boy, GBA) */
.virtual-action-btns.layout-2btns .btn-x,
.virtual-action-btns.layout-2btns .btn-y {
  display: none !important;
}

.virtual-action-btns.layout-2btns .btn-b {
  bottom: 24px;
  left: 18px;
  width: 50px;
  height: 50px;
}

.virtual-action-btns.layout-2btns .btn-a {
  bottom: 48px;
  right: 18px;
  width: 50px;
  height: 50px;
}

/* 2. MODO ARCADE / NEO GEO (4 Botones: A, B, C, D) */
.virtual-action-btns.layout-arcade .btn-b {
  bottom: 12px;
  left: 18px;
  background: #e11d48; /* Rojo - NeoGeo A */
}

.virtual-action-btns.layout-arcade .btn-a {
  bottom: 28px;
  right: 10px;
  background: #eab308; /* Amarillo - NeoGeo B */
}

.virtual-action-btns.layout-arcade .btn-y {
  top: 28px;
  left: 10px;
  background: #10b981; /* Verde - NeoGeo C */
}

.virtual-action-btns.layout-arcade .btn-x {
  top: 12px;
  right: 18px;
  background: #2563eb; /* Azul - NeoGeo D */
}

/* ==========================================================================
   ADAPTACIONES RESPONSIVAS PARA PANTALLAS MÓVILES (SMARTPHONES)
   ========================================================================== */
@media (max-width: 768px) and (max-height: 520px), (max-width: 600px) {
  #top-hud {
    padding: 4px 8px;
    gap: 6px;
    flex-wrap: wrap;
  }

  .hud-btn {
    font-size: 8px;
    padding: 3px 6px;
  }
}

/* Contenedor de Banner Móvil: Oculto por defecto en desktop y landscape */
.portrait-ad-container {
  display: none;
}

/* Móvil en Modo Vertical (Portrait): 
   - Pantalla arriba
   - Botones Select y Start elevados justo al pie del monitor CRT (liberando espacio central para futuros banners)
   - D-Pad y botones de acción ampliados ergonómicamente a los extremos inferiores */
@media (orientation: portrait) and (max-width: 768px), (orientation: portrait) and (max-width: 500px) {
  #screen-wrapper {
    align-items: flex-start !important;
    padding-top: calc(56px + 3.5vh) !important;
    padding-bottom: 190px !important;
  }

  #crt-tv-chassis {
    width: 94vw;
    height: auto;
    aspect-ratio: 4 / 3;
    max-height: calc(94vw * (3 / 4));
    max-width: 95vw;
    margin-top: 18px;
  }

  .touch-controller {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    padding: 10px 14px 20px 14px !important;
    display: none;
    align-items: flex-end !important;
    justify-content: space-between !important;
    pointer-events: none !important;
    box-sizing: border-box !important;
  }

  .touch-controller.active {
    display: flex !important;
  }

  /* Botones Select y Start elevados justo al pie del monitor CRT */
  .virtual-meta-btns {
    position: absolute !important;
    top: calc(56px + 3.5vh + 18px + min(94vw * 0.75, 71vw) + 12px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin: 0 !important;
    padding: 5px 14px !important;
    gap: 14px !important;
    border-radius: 20px !important;
    background: rgba(18, 20, 26, 0.8) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5) !important;
    z-index: 70 !important;
  }

  .v-pill-btn {
    font-size: 8px !important;
    padding: 6px 12px !important;
    border-radius: 10px !important;
  }

  /* Espacio de Banner y Recompensas Dedicado en Modo Portrait Móvil */
  .portrait-ad-container {
    display: flex !important;
    flex-direction: column !important;
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    top: calc(56px + 3.5vh + 18px + min(94vw * 0.75, 71vw) + 48px) !important;
    width: min(320px, 92vw) !important;
    align-items: center !important;
    z-index: 68 !important;
    pointer-events: auto !important;
  }

  .portrait-ad-banner {
    display: flex !important;
    width: 100% !important;
    height: 52px !important;
    background: rgba(18, 20, 26, 0.5) !important;
    backdrop-filter: blur(8px) !important;
    border: 1px dashed rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
  }

  .portrait-reward-badge {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: var(--font-terminal) !important;
    font-size: 11px !important;
    color: var(--nes-gold) !important;
    background: rgba(14, 17, 24, 0.85) !important;
    border: 1px solid rgba(248, 184, 0, 0.25) !important;
    padding: 2px 8px !important;
    border-radius: 4px !important;
    margin-top: 3px !important;
    letter-spacing: 0.5px !important;
  }

  /* D-Pad Virtual en Portrait: Ampliado para máxima precisión */
  .virtual-dpad {
    width: 152px !important;
    height: 152px !important;
    margin-bottom: 4px !important;
    background: rgba(18, 20, 26, 0.55) !important;
    backdrop-filter: blur(10px) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.18) !important;
  }

  .dpad-center {
    width: 44px !important;
    height: 44px !important;
  }

  .dpad-up {
    top: 6px !important;
    width: 48px !important;
    height: 48px !important;
  }

  .dpad-down {
    bottom: 6px !important;
    width: 48px !important;
    height: 48px !important;
  }

  .dpad-left {
    left: 6px !important;
    width: 48px !important;
    height: 48px !important;
  }

  .dpad-right {
    right: 6px !important;
    width: 48px !important;
    height: 48px !important;
  }

  .dpad-btn {
    font-size: 16px !important;
  }

  /* Botonera de Acción en Portrait: Ampliada y cómoda */
  .virtual-action-btns {
    width: 162px !important;
    height: 162px !important;
    margin-bottom: 4px !important;
    background: rgba(18, 20, 26, 0.55) !important;
    backdrop-filter: blur(10px) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.18) !important;
  }

  .v-round-btn {
    width: 50px !important;
    height: 50px !important;
    font-size: 14px !important;
  }

  /* Distribución de 4 Botones */
  .virtual-action-btns .btn-b,
  .virtual-action-btns.layout-arcade .btn-b {
    bottom: 12px !important;
    left: 20px !important;
  }

  .virtual-action-btns .btn-a,
  .virtual-action-btns.layout-arcade .btn-a {
    bottom: 36px !important;
    right: 10px !important;
  }

  .virtual-action-btns .btn-y,
  .virtual-action-btns.layout-arcade .btn-y {
    top: 36px !important;
    left: 10px !important;
  }

  .virtual-action-btns .btn-x,
  .virtual-action-btns.layout-arcade .btn-x {
    top: 12px !important;
    right: 20px !important;
  }

  /* Distribución de 2 Botones (Modo Consola NES / GB / GBA) */
  .virtual-action-btns.layout-2btns .btn-b {
    bottom: 24px !important;
    left: 18px !important;
    width: 56px !important;
    height: 56px !important;
    font-size: 15px !important;
  }

  .virtual-action-btns.layout-2btns .btn-a {
    bottom: 56px !important;
    right: 18px !important;
    width: 56px !important;
    height: 56px !important;
    font-size: 15px !important;
  }
}

/* Móvil en Modo Horizontal (Landscape): 
   - Pantalla del emulador perfectamente centrada en el eje horizontal y vertical
   - Ocultar containers de banners para no distorsionar el layout flex ni encimar elementos
   - D-Pad y Botones de Acción ampliados en los extremos para agarre ergonómico
   - Mando transparente que no tapa la pantalla */
@media (orientation: landscape) and (max-height: 620px) {
  #console-viewport {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
  }

  .portrait-ad-container {
    display: none !important;
  }

  .desktop-sponsor-sidebar {
    display: none !important;
  }

  #top-hud {
    top: 2px;
    left: 4px;
    right: 4px;
    height: 36px;
    padding: 0 8px;
    gap: 6px;
  }

  #top-hud .hud-section:last-child {
    overflow-x: auto;
    max-width: 52vw;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: 4px;
  }

  #top-hud .hud-section:last-child::-webkit-scrollbar {
    display: none;
  }

  .hud-btn {
    font-size: 7.5px;
    padding: 3px 5px;
    white-space: nowrap;
  }

  .game-selector select {
    max-width: 140px;
    font-size: 8px;
    padding: 2px 4px;
  }

  #screen-wrapper {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100vw !important;
    height: 100vh !important;
    padding: 0 !important;
    margin: 0 auto !important;
    transform: none !important;
  }

  #crt-tv-chassis {
    margin: 0 auto !important;
    height: min(90vh, calc(100vh - 16px)) !important;
    max-height: 90vh !important;
    width: calc(min(90vh, calc(100vh - 16px)) * (4 / 3)) !important;
    max-width: 66vw !important;
    position: relative !important;
  }

  .touch-controller {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    padding: 8px 12px 10px 12px !important;
    display: none;
    align-items: flex-end !important;
    justify-content: space-between !important;
    pointer-events: none !important;
    box-sizing: border-box !important;
    z-index: 60 !important;
  }

  .touch-controller.active {
    display: flex !important;
  }

  /* Círculo D-Pad 50% Más Grande (de 104px a 156px) */
  .virtual-dpad {
    width: 156px !important;
    height: 156px !important;
    background: rgba(18, 20, 26, 0.45) !important;
    backdrop-filter: blur(8px) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.18) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
    margin-bottom: 2px !important;
  }

  .dpad-center {
    width: 44px !important;
    height: 44px !important;
  }

  .dpad-up {
    top: 6px !important;
    width: 48px !important;
    height: 50px !important;
  }

  .dpad-down {
    bottom: 6px !important;
    width: 48px !important;
    height: 50px !important;
  }

  .dpad-left {
    left: 6px !important;
    width: 50px !important;
    height: 48px !important;
  }

  .dpad-right {
    right: 6px !important;
    width: 50px !important;
    height: 48px !important;
  }

  .dpad-btn {
    font-size: 16px !important;
  }

  /* Círculo Botones de Acción 50% Más Grande (de 114px a 170px) */
  .virtual-action-btns {
    width: 170px !important;
    height: 170px !important;
    background: rgba(18, 20, 26, 0.45) !important;
    backdrop-filter: blur(8px) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.18) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
    margin-bottom: 2px !important;
  }

  .v-round-btn {
    width: 52px !important;
    height: 52px !important;
    font-size: 14px !important;
  }

  /* Posiciones de 4 Botones en Landscape (Sin traslaparse) */
  .virtual-action-btns .btn-b,
  .virtual-action-btns.layout-arcade .btn-b {
    bottom: 14px !important;
    left: 22px !important;
  }

  .virtual-action-btns .btn-a,
  .virtual-action-btns.layout-arcade .btn-a {
    bottom: 38px !important;
    right: 12px !important;
  }

  .virtual-action-btns .btn-y,
  .virtual-action-btns.layout-arcade .btn-y {
    top: 38px !important;
    left: 12px !important;
  }

  .virtual-action-btns .btn-x,
  .virtual-action-btns.layout-arcade .btn-x {
    top: 14px !important;
    right: 22px !important;
  }

  /* Posiciones de 2 Botones en Landscape (NES / GB / GBA) */
  .virtual-action-btns.layout-2btns .btn-b {
    bottom: 26px !important;
    left: 20px !important;
    width: 58px !important;
    height: 58px !important;
    font-size: 15px !important;
  }

  .virtual-action-btns.layout-2btns .btn-a {
    bottom: 60px !important;
    right: 20px !important;
    width: 58px !important;
    height: 58px !important;
    font-size: 15px !important;
  }

  .virtual-meta-btns {
    position: absolute !important;
    bottom: 6px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    padding: 3px 10px !important;
    gap: 10px !important;
    background: rgba(18, 20, 26, 0.75) !important;
    border-radius: 14px !important;
    z-index: 65 !important;
  }

  .v-pill-btn {
    font-size: 7.5px !important;
    padding: 5px 9px !important;
  }
}

/* ==========================================================================
   MODO PANTALLA COMPLETA TOTAL (DESKTOP, TV Y XBOX)
   ========================================================================== */
:fullscreen #screen-wrapper,
:-webkit-full-screen #screen-wrapper {
  padding: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
}

:fullscreen #crt-tv-chassis,
:-webkit-full-screen #crt-tv-chassis {
  height: 96vh !important;
  max-height: 96vh !important;
  width: calc(96vh * (4 / 3)) !important;
  max-width: 98vw !important;
  aspect-ratio: 4 / 3 !important;
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
}

/* ==========================================================================
   SUB-MONITOR LATERAL DERECHO (DESKTOP ARCADE TV // SPONSOR & PLAYTIME COIN)
   ========================================================================== */
.desktop-sponsor-sidebar {
  display: none;
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 320px;
  background: rgba(14, 17, 24, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65), 0 0 20px rgba(0, 229, 255, 0.12);
  z-index: 45;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 1260px) {
  .desktop-sponsor-sidebar {
    display: flex;
    flex-direction: column;
  }
}

.desktop-sponsor-sidebar.collapsed .sidebar-body {
  display: none;
}

.desktop-sponsor-sidebar.collapsed {
  width: auto;
  border-radius: 8px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(20, 24, 34, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-screen);
  font-size: 8.5px;
  letter-spacing: 0.5px;
  color: var(--nes-accent);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--nes-green);
  box-shadow: 0 0 8px var(--nes-green);
  animation: pulse-live 1.8s infinite;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.sidebar-toggle-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
  line-height: 1;
}

.sidebar-toggle-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.sidebar-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.sponsor-media-slot {
  width: 300px;
  height: 250px;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.8);
}

.playtime-reward-widget {
  width: 100%;
  background: rgba(18, 22, 30, 0.75);
  border: 1px solid rgba(248, 184, 0, 0.25);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.reward-widget-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-pixel);
  font-size: 7.5px;
  color: var(--nes-gold);
}

.coin-icon {
  font-size: 12px;
}

.reward-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.reward-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #10b981);
  border-radius: 3px;
  transition: width 1s linear;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.reward-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-terminal);
  font-size: 13px;
  color: #cbd5e1;
}

.reward-badge {
  font-family: var(--font-pixel);
  font-size: 7px;
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid #f59e0b;
  padding: 2px 4px;
  border-radius: 4px;
}

/* Supresión de banners flotantes in-page push que cubran la cabina */
div[id*="push"], div[class*="in-page-push"], div[class*="ipp-"], div[id*="monetag"] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}


