/**
 * Fijate Tools - Estilos Canónicos del Emulador Arcade MAME (Midnight Slate)
 * 
 * Estética de mueble recreativo retro (Arcade Cabinet), simulación de tubo CRT
 * con scanlines analógicas y fósforo, botonera arcade tridimensional y panel
 * táctil multitáctil adaptable para móviles.
 */

:root {
  --arcade-bg: #0b0f17;
  --arcade-surface: #111827;
  --arcade-surface-light: #1f2937;
  --arcade-border: #374151;
  --arcade-border-glow: rgba(6, 182, 212, 0.4);
  --arcade-text: #f3f4f6;
  --arcade-text-muted: #9ca3af;
  --arcade-neon-cyan: #06b6d4;
  --arcade-neon-pink: #ec4899;
  --arcade-neon-gold: #f59e0b;
  --arcade-neon-green: #10b981;
  --arcade-neon-red: #ef4444;
  --arcade-radius: 12px;
  --arcade-cabinet-bevel: #1a2234;

  /* Variables canónicas del sistema de componentes Fijate (seo-guide, header, etc.) */
  --bg-card: #111827;
  --bg-input: #0b0f17;
  --border-color: #23314d;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --primary: #06b6d4;
  --primary-light: rgba(6, 182, 212, 0.15);
  --card-radius: 14px;
}

[data-theme="light"] {
  --arcade-bg: #f8fafc;
  --arcade-surface: #ffffff;
  --arcade-surface-light: #f1f5f9;
  --arcade-border: #cbd5e1;
  --arcade-border-glow: rgba(14, 165, 233, 0.3);
  --arcade-text: #0f172a;
  --arcade-text-muted: #64748b;
  --arcade-cabinet-bevel: #0f172a;

  /* Variables canónicas para modo claro */
  --bg-card: #ffffff;
  --bg-input: #f8fafc;
  --border-color: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --primary: #0284c7;
  --primary-light: rgba(2, 132, 199, 0.12);
}

/* ==========================================================================
   1. ESTRUCTURA Y CONTENEDOR GENERAL
   ========================================================================== */
body {
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--arcade-bg);
  color: var(--arcade-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 0;
}

.tool-layout {
  max-width: 1280px;
  margin: 0.5rem auto 2rem;
  padding: 0 1rem;
  width: 100%;
  box-sizing: border-box;
}

.tool-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
}

/* ==========================================================================
   2. MUEBLE ARCADE (CABINET)
   ========================================================================== */
.arcade-cabinet {
  background: linear-gradient(180deg, #131b2e 0%, #0d1322 100%);
  border: 2px solid #23314d;
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6), 0 0 30px rgba(6, 182, 212, 0.15);
  overflow: hidden;
  margin-bottom: 2rem;
  position: relative;
  transition: all 0.3s ease;
}

.cabinet-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 999999 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  display: flex !important;
  flex-direction: column !important;
  background: #000000 !important;
}

/* Marquesina arcade iluminada */
.arcade-marquee {
  background: linear-gradient(90deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  border-bottom: 2px solid #312e81;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  position: relative;
}

.arcade-marquee::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--arcade-neon-cyan), var(--arcade-neon-pink), transparent);
}

.marquee-title-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.arcade-neon-sign {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.neon-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(6, 182, 212, 0.8), 0 0 20px rgba(6, 182, 212, 0.4);
  margin: 0;
}

.marquee-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.arcade-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-idle {
  background: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
  border: 1px solid rgba(156, 163, 175, 0.3);
}

.badge-running {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
  animation: pulse-badge 2s infinite ease-in-out;
}

.badge-paused {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-connected {
  background: rgba(6, 182, 212, 0.15);
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.4);
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ==========================================================================
   3. PANTALLA ARCADE Y CANVAS CRT
   ========================================================================== */
.arcade-screen-box {
  background: #000000;
  position: relative;
  width: 100%;
  max-width: min(100%, calc((56vh - 40px) * (4 / 3)));
  height: clamp(280px, calc(56vh - 40px), 520px);
  margin: 0 auto;
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.9);
  transition: max-width 0.25s ease, height 0.25s ease;
  box-sizing: border-box;
}

.arcade-screen-box.screen-box-wide {
  max-width: 100% !important;
}

.cabinet-fullscreen .arcade-screen-box {
  max-width: 100vw !important;
  max-height: 100vh !important;
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: unset !important;
  flex: 1 1 0% !important;
}

/* Marco biselado de tubo */
.screen-bezel {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 2px solid rgba(8, 12, 20, 0.7);
  border-radius: 6px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
  z-index: 10;
}

#arcade-canvas,
#canvas,
.arcade-screen-box canvas {
  position: absolute !important;
  top: 6px !important;
  bottom: 6px !important;
  left: 6px !important;
  right: 6px !important;
  width: calc(100% - 12px) !important;
  height: calc(100% - 12px) !important;
  max-width: calc(100% - 12px) !important;
  max-height: calc(100% - 12px) !important;
  object-fit: contain !important;
  display: block !important;
  background-color: #000000;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  margin: auto !important;
}

/* Filtro CRT (Scanlines, fósforo y curvatura) */
.crt-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 12;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.crt-active .crt-overlay {
  opacity: 1;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.28) 50%),
              linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
  background-size: 100% 3px, 6px 100%;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.6);
}

.crt-active #arcade-canvas,
.crt-active #canvas,
.crt-active .arcade-screen-box canvas {
  filter: contrast(1.08) brightness(1.04) saturate(1.1);
}

/* Pantalla de espera interactiva (cuando no hay juego corriendo) */
.arcade-idle-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  background: radial-gradient(circle at center, #111a2e 0%, #050811 100%);
  z-index: 5;
  transition: opacity 0.3s ease;
}

.screen-running .arcade-idle-screen {
  display: none;
}

.idle-arcade-icon {
  width: 72px;
  height: 72px;
  color: var(--arcade-neon-cyan);
  filter: drop-shadow(0 0 16px rgba(6, 182, 212, 0.5));
  margin-bottom: 1rem;
  animation: float-icon 3s ease-in-out infinite;
}

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

.idle-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.5rem;
}

.idle-desc {
  max-width: 520px;
  color: #94a3b8;
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0 0 1.5rem;
}

.idle-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* Loader overlay */
.arcade-loader {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 17, 0.92);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
  gap: 1rem;
}

.arcade-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(6, 182, 212, 0.2);
  border-top-color: var(--arcade-neon-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.arcade-loader-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  color: #ffffff;
  letter-spacing: 0.02em;
}

/* ==========================================================================
   4. BARRA DE CONTROL ARCADE (TOOLBAR)
   ========================================================================== */
.arcade-toolbar {
  background: #0f1626;
  border-top: 1px solid #23314d;
  padding: 0.5rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.arcade-btn {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  min-height: 40px;
  transition: all 0.15s ease;
  user-select: none;
}

.arcade-btn:hover:not(:disabled) {
  background: #334155;
  color: #ffffff;
  border-color: #475569;
  transform: translateY(-1px);
}

.arcade-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.arcade-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.arcade-btn.btn-active {
  background: rgba(6, 182, 212, 0.2);
  border-color: var(--arcade-neon-cyan);
  color: var(--arcade-neon-cyan);
}

.arcade-btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.arcade-btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.45);
}

.arcade-btn-accent {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  border-color: #fbbf24;
  color: #ffffff;
}

.arcade-select {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  min-height: 40px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
}

.arcade-select option {
  background-color: #1e293b;
  color: #e2e8f0;
}

/* ==========================================================================
   5. ZONA DE CARGA DE ROMS (DROPZONE Y DEMOS)
   ========================================================================== */
.rom-manager-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.card-panel {
  background: var(--arcade-surface);
  border: 1px solid var(--arcade-border);
  border-radius: var(--arcade-radius);
  padding: 1.25rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.panel-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--arcade-text);
  margin: 0 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-desc {
  color: var(--arcade-text-muted);
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0 0 1rem;
}

/* Dropzone */
.rom-dropzone {
  border: 2px dashed #334155;
  border-radius: 10px;
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(30, 41, 59, 0.4);
}

.rom-dropzone:hover,
.rom-dropzone.dropzone-active {
  border-color: var(--arcade-neon-cyan);
  background: rgba(6, 182, 212, 0.08);
}

.dropzone-icon {
  width: 44px;
  height: 44px;
  color: var(--arcade-neon-cyan);
  margin-bottom: 0.75rem;
}

.dropzone-label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.dropzone-sub {
  font-size: 0.8rem;
  color: #94a3b8;
}

/* Demos list */
.demos-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.demo-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: #1a2234;
  border: 1px solid #2d3b56;
  border-radius: 8px;
  gap: 1rem;
  transition: border-color 0.2s ease;
}

.demo-card:hover {
  border-color: var(--arcade-neon-cyan);
}

.demo-info h4 {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
}

.demo-info p {
  margin: 0;
  font-size: 0.8rem;
  color: #94a3b8;
}

/* ==========================================================================
   6. PANEL TÁCTIL VIRTUAL EN PANTALLA (MÓVILES)
   ========================================================================== */
.arcade-touch-panel {
  display: none;
  background: #090e1a;
  border: 1px solid #23314d;
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 2rem;
  user-select: none;
  touch-action: none;
}

.arcade-touch-panel.touch-panel-enabled {
  display: block;
}

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

/* D-Pad Cruceta */
.touch-dpad-box {
  width: 140px;
  height: 140px;
  position: relative;
  margin: 0 auto;
}

.dpad-cross {
  width: 100%;
  height: 100%;
  position: relative;
}

.dpad-btn {
  position: absolute;
  background: #1e293b;
  border: 2px solid #475569;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: none;
  transition: background-color 0.05s ease;
}

.dpad-btn:active,
.dpad-btn.touch-btn-pressed {
  background: var(--arcade-neon-cyan);
  color: #000000;
}

.dpad-up {
  top: 0;
  left: 45px;
  width: 50px;
  height: 48px;
  border-radius: 8px 8px 0 0;
}

.dpad-down {
  bottom: 0;
  left: 45px;
  width: 50px;
  height: 48px;
  border-radius: 0 0 8px 8px;
}

.dpad-left {
  top: 45px;
  left: 0;
  width: 48px;
  height: 50px;
  border-radius: 8px 0 0 8px;
}

.dpad-right {
  top: 45px;
  right: 0;
  width: 48px;
  height: 50px;
  border-radius: 0 8px 8px 0;
}

.dpad-center {
  top: 45px;
  left: 45px;
  width: 50px;
  height: 50px;
  background: #111827;
  border: none;
  pointer-events: none;
}

/* Botonera de sistema (Coin / Start) */
.touch-system-box {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: center;
  margin: 0 auto;
}

.system-arcade-btn {
  background: #312e81;
  border: 2px solid #4f46e5;
  color: #ffffff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.6rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.system-arcade-btn:active,
.system-arcade-btn.touch-btn-pressed {
  background: #ec4899;
  border-color: #f472b6;
  transform: scale(0.96);
}

/* 6 Botones de acción arcade (Estilo Sanwa) */
.touch-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 52px);
  grid-template-rows: repeat(2, 52px);
  gap: 0.6rem;
  margin: 0 auto;
}

.arcade-action-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 3px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 -4px 6px rgba(0, 0, 0, 0.4), 0 5px 12px rgba(0, 0, 0, 0.5);
  transition: transform 0.05s ease;
  touch-action: none;
}

.btn-a { background: radial-gradient(circle at 35% 35%, #ef4444, #991b1b); }
.btn-b { background: radial-gradient(circle at 35% 35%, #3b82f6, #1d4ed8); }
.btn-c { background: radial-gradient(circle at 35% 35%, #10b981, #047857); }
.btn-d { background: radial-gradient(circle at 35% 35%, #f59e0b, #b45309); }
.btn-e { background: radial-gradient(circle at 35% 35%, #8b5cf6, #6d28d9); }
.btn-f { background: radial-gradient(circle at 35% 35%, #ec4899, #be185d); }

.arcade-action-btn:active,
.arcade-action-btn.touch-btn-pressed {
  transform: scale(0.92);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
  filter: brightness(1.25);
}

/* ==========================================================================
   7. MODALES Y TOAST
   ========================================================================== */
.arcade-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 1rem;
}

.arcade-modal-card {
  background: #111827;
  border: 1px solid #374151;
  border-radius: 14px;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.modal-header {
  padding: 1.25rem;
  border-bottom: 1px solid #1f2937;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  color: #ffffff;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
}

.modal-close-btn:hover {
  color: #ffffff;
  background: #1f2937;
}

.modal-body {
  padding: 1.25rem;
}

.controls-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
}

.controls-table th,
.controls-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #1f2937;
}

.controls-table th {
  color: #94a3b8;
  font-weight: 600;
}

.kbd-chip {
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 4px;
  padding: 0.2rem 0.45rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--arcade-neon-cyan);
}

/* Toast */
.arcade-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #1e293b;
  border: 1px solid #475569;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  z-index: 999999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  max-width: 90vw;
}

.arcade-toast.toast-visible {
  transform: translateY(0);
  opacity: 1;
}

.arcade-toast.toast-success {
  border-color: #10b981;
  background: #064e3b;
}

.arcade-toast.toast-warning {
  border-color: #f59e0b;
  background: #78350f;
}

.arcade-toast.toast-error {
  border-color: #ef4444;
  background: #7f1d1d;
}


/* ==========================================================================
   8. ESTILOS DE LA GUÍA TÉCNICA SEO Y DIVULGATIVA (.seo-guide-section)
   ========================================================================== */
.seo-block-heading {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

[data-theme="light"] .seo-block-heading {
  color: var(--text-main, #0f172a);
}

.seo-card-icon-box,
.guide-card-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.25);
  color: var(--arcade-neon-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.seo-guide-card:hover .seo-card-icon-box,
.guide-feature-card:hover .guide-card-icon-box {
  transform: scale(1.08);
}

/* Acentos cromáticos temáticos de salón recreativo */
.card-accent-cyan .seo-card-icon-box,
.card-accent-cyan .guide-card-icon-box {
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.25);
  color: #06b6d4;
}

.card-accent-green .seo-card-icon-box,
.card-accent-green .guide-card-icon-box {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.25);
  color: #10b981;
}

.card-accent-gold .seo-card-icon-box,
.card-accent-gold .guide-card-icon-box {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.25);
  color: #f59e0b;
}

.card-accent-pink .seo-card-icon-box,
.card-accent-pink .guide-card-icon-box {
  background: rgba(236, 72, 153, 0.12);
  border-color: rgba(236, 72, 153, 0.25);
  color: #ec4899;
}

.seo-guide-card.card-accent-cyan:hover,
.guide-feature-card.card-accent-cyan:hover {
  border-color: rgba(6, 182, 212, 0.45);
  box-shadow: 0 8px 24px -4px rgba(6, 182, 212, 0.2);
}

.seo-guide-card.card-accent-green:hover,
.guide-feature-card.card-accent-green:hover {
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 8px 24px -4px rgba(16, 185, 129, 0.2);
}

.seo-guide-card.card-accent-gold:hover,
.guide-feature-card.card-accent-gold:hover {
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 8px 24px -4px rgba(245, 158, 11, 0.2);
}

.seo-guide-card.card-accent-pink:hover,
.guide-feature-card.card-accent-pink:hover {
  border-color: rgba(236, 72, 153, 0.45);
  box-shadow: 0 8px 24px -4px rgba(236, 72, 153, 0.2);
}

/* Pasos de uso (Workflow) */
.seo-step-card,
.workflow-step-item {
  position: relative;
  background: var(--bg-input, #0f172a);
  border: 1px solid var(--border-color, #1e293b);
  border-radius: 12px;
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="light"] .seo-step-card,
[data-theme="light"] .workflow-step-item {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.seo-step-card:hover,
.workflow-step-item:hover {
  border-color: var(--arcade-neon-cyan);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -4px rgba(6, 182, 212, 0.15);
}

.seo-step-num,
.step-number-badge {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(6, 182, 212, 0.15);
  color: var(--arcade-neon-cyan);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.seo-step-title,
.step-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
  margin: 0;
  line-height: 1.35;
}

[data-theme="light"] .seo-step-title,
[data-theme="light"] .step-title {
  color: var(--text-main, #0f172a);
}

.seo-step-desc,
.step-desc {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-muted, #9ca3af);
  margin: 0;
}

[data-theme="light"] .seo-step-desc,
[data-theme="light"] .step-desc {
  color: var(--text-muted, #475569);
}

/* Fallback y retrocompatibilidad para clases alternativas */
.guide-cards-grid,
.workflow-steps-track {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.15rem;
  margin: 1.5rem 0 2rem 0;
}

.guide-feature-card {
  background: var(--bg-input, #0f172a);
  border: 1px solid var(--border-color, #1e293b);
  border-radius: 12px;
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.guide-feature-card:hover {
  border-color: rgba(6, 182, 212, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.25);
}

.faq-accordion-item {
  background: var(--bg-input, #0f172a);
  border: 1px solid var(--border-color, #1e293b);
  border-radius: 10px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  overflow: hidden;
  margin-bottom: 0.85rem;
}

.faq-accordion-item[open] {
  border-color: var(--arcade-neon-cyan);
}

.faq-question-btn {
  padding: 1.05rem 1.25rem;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  user-select: none;
  min-height: 44px;
  box-sizing: border-box;
  list-style: none;
}

.faq-question-btn::-webkit-details-marker {
  display: none;
}

.faq-arrow-icon {
  color: var(--text-muted, #94a3b8);
  transition: transform 0.25s ease, color 0.2s ease;
  flex-shrink: 0;
}

.faq-accordion-item[open] .faq-arrow-icon {
  transform: rotate(180deg);
  color: var(--arcade-neon-cyan);
}

.faq-answer-content {
  padding: 0 1.25rem 1.2rem 1.25rem;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-muted, #9ca3af);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* ==========================================================================
   8. RESPONSIVIDAD Y AJUSTES MÓVILES
   ========================================================================== */
@media (max-width: 768px) {
  .tool-layout {
    margin: 0.75rem auto 2rem;
    padding: 0 0.5rem;
  }

  .arcade-marquee {
    padding: 0.75rem 1rem;
  }

  .neon-title {
    font-size: 1.05rem;
  }

  .arcade-screen-box {
    aspect-ratio: 4 / 3;
    max-height: 60vh;
  }

  .screen-bezel {
    border-width: 6px;
  }

  .arcade-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-group {
    justify-content: center;
    width: 100%;
  }

  .arcade-btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .rom-manager-section {
    grid-template-columns: 1fr;
  }
}
