/**
 * Comprobador de mandos y calibrador de drift de joysticks
 * Estilos canónicos corporativos - Fijate Tools
 */

:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Paleta cromática tema oscuro (predeterminada) */
  --bg-primary: #0b0f17;
  --bg-surface: #131823;
  --bg-surface-elevated: #1a202e;
  --bg-surface-hover: #222a3d;
  --border-color: #232b3e;
  --border-color-focus: #3b82f6;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --color-ok: #10b981;
  --color-warn: #f59e0b;
  --color-alert: #f97316;
  --color-danger: #ef4444;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Modo claro adaptativo */
body.light-theme {
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-surface-hover: #e2e8f0;
  --border-color: #cbd5e1;
  --border-color-focus: #2563eb;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
}

/* Contención canónica */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.5;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.text-mono {
  font-family: var(--font-mono);
}

.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Layout canónico */
.tool-layout {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  box-sizing: border-box;
  flex: 1 0 auto;
}

.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%;
}

/* Barra superior de conexión y estado del mando */
.gamepad-bar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}

.gamepad-status-indicator {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 260px;
  flex: 1 1 300px;
}

.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.status-dot.disconnected {
  background-color: var(--accent-amber);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
  animation: pulse-dot 2s infinite ease-in-out;
}

.status-dot.connected {
  background-color: var(--accent-emerald);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.7);
  animation: none;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0.5; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

.status-texts {
  display: flex;
  flex-direction: column;
}

.status-label {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.status-sub {
  font-size: 0.825rem;
  color: var(--text-secondary);
}

.gamepad-controls-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
}

.control-unit {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.control-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.custom-select {
  background-color: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.45rem 2.2rem 0.45rem 0.75rem;
  font-size: 0.875rem;
  font-family: var(--font-main);
  height: 38px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 14px;
}

.custom-select:focus {
  outline: none;
  border-color: var(--border-color-focus);
}

.btn-refresh-gamepads {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  height: 38px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-refresh-gamepads:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--accent-blue);
}

/* Barra de métricas de telemetría */
.telemetry-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.telemetry-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.telemetry-label {
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.telemetry-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

/* Secciones Bento */
.gamepad-visualizer-section,
.joystick-drift-section,
.deadzone-simulator-section,
.haptic-test-section,
.report-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.visualizer-header,
.section-title-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.visualizer-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.visualizer-desc {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.btn-secondary-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary-sm:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border-color-focus);
}

/* Contenedor del visualizador del mando */
.controller-visualizer-container {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
  gap: 1.5rem;
  align-items: center;
}

@media (max-width: 900px) {
  .controller-visualizer-container {
    grid-template-columns: 1fr;
  }
}

.controller-svg-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.controller-svg {
  width: 100%;
  max-width: 620px;
  height: auto;
  overflow: visible;
}

/* Estilos de botones SVG */
.ctrl-bumper,
.ctrl-trigger,
.ctrl-touchpad,
.ctrl-dpad-btn,
.ctrl-face-btn circle,
.ctrl-center-btn rect,
.ctrl-stick-cap circle:first-child {
  transition: fill 0.08s ease, stroke 0.08s ease, filter 0.08s ease;
}

.svg-btn-txt,
.face-btn-label,
.center-btn-label,
.stick-label {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 11px;
  fill: #94a3b8;
  pointer-events: none;
  user-select: none;
}

.face-btn-label {
  font-size: 13px;
  fill: #e2e8f0;
}

/* Estado activo (pulsado) de botones en SVG */
.ctrl-btn-pressed {
  fill: #06b6d4 !important;
  stroke: #22d3ee !important;
  filter: url(#neonGlow) !important;
}

.ctrl-btn-pressed + text,
.ctrl-face-btn.active circle + text,
.ctrl-center-btn.active rect + text {
  fill: #ffffff !important;
}

.ctrl-face-btn.active circle {
  fill: #06b6d4 !important;
  stroke: #67e8f9 !important;
  filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.8));
}

.ctrl-center-btn.active rect {
  fill: #3b82f6 !important;
  stroke: #60a5fa !important;
}

.ctrl-stick-cap.active circle:first-child {
  fill: #8b5cf6 !important;
  stroke: #a78bfa !important;
}

/* Paneles de gatillos y tabla de botones */
.triggers-summary-panel {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.panel-subtitle {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.85rem;
}

.trigger-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.trigger-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.trigger-name {
  font-weight: 600;
  color: var(--text-secondary);
}

.trigger-val {
  font-weight: 700;
  color: var(--accent-cyan);
}

.trigger-bar-track {
  width: 100%;
  height: 10px;
  background: var(--bg-surface-elevated);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.trigger-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #06b6d4, #3b82f6);
  border-radius: 5px;
  transition: width 0.05s linear;
}

.trigger-raw {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Grilla de estados de botones */
.buttons-grid-status {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 0.45rem;
}

.btn-chip-status {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.45rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.1s ease;
}

.btn-chip-status.active {
  background: rgba(6, 182, 212, 0.2);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

.btn-chip-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-chip-count {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Diales cartesianos de Sticks */
.dials-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.dial-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.dial-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.dial-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.dial-sub {
  font-size: 0.775rem;
  color: var(--text-muted);
}

.drift-badge {
  font-size: 0.775rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  white-space: nowrap;
  font-family: var(--font-mono);
}

.badge-ok {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-ok);
  border: 1px solid var(--color-ok);
}

.badge-warn {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-warn);
  border: 1px solid var(--color-warn);
}

.badge-alert {
  background: rgba(249, 115, 22, 0.15);
  color: var(--color-alert);
  border: 1px solid var(--color-alert);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
}

.dial-canvas-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.5rem;
}

.dial-canvas {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1 / 1;
  display: block;
}

.dial-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.dial-metric-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-lbl {
  font-size: 0.775rem;
  color: var(--text-muted);
}

.metric-val {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.dial-verdict {
  background: var(--bg-surface);
  border-left: 3px solid var(--border-color-focus);
  padding: 0.65rem 0.85rem;
  font-size: 0.825rem;
  color: var(--text-secondary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.dial-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}

.btn-dial-action {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--accent-blue);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-dial-action:hover {
  background: #2563eb;
}

.btn-dial-action.active {
  background: var(--accent-rose);
  animation: pulse-btn 1.5s infinite;
}

@keyframes pulse-btn {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.btn-dial-secondary {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-dial-secondary:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.circularity-result-box {
  margin-top: 0.85rem;
  background: var(--bg-surface);
  border: 1px dashed var(--accent-cyan);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.circ-lbl {
  display: block;
  font-size: 0.775rem;
  color: var(--text-muted);
}

.circ-val {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-cyan);
  margin: 0.2rem 0;
}

.circ-tip {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Simulador de zonas muertas */
.deadzone-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.deadzone-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.deadzone-param-box {
  display: flex;
  flex-direction: column;
}

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

.param-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.slider-val {
  font-weight: 700;
  color: var(--accent-cyan);
  font-size: 0.9rem;
}

.custom-range {
  width: 100%;
  accent-color: var(--accent-cyan);
  margin: 0.4rem 0;
  cursor: pointer;
}

.param-help {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.deadzone-eval-banner {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.eval-item {
  display: flex;
  flex-direction: column;
}

.eval-item.highlight {
  border-left: 2px solid var(--accent-emerald);
  padding-left: 0.75rem;
}

.eval-title {
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.eval-status {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-ok);
}

.eval-status.warning {
  color: var(--color-warn);
}

.eval-recommendation {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-emerald);
}

/* Módulo de vibración háptica */
.haptic-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.haptic-sliders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.haptic-unit {
  display: flex;
  flex-direction: column;
}

.haptic-buttons-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.btn-haptic-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 40px;
}

.btn-haptic-trigger:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-haptic-stop {
  display: inline-flex;
  align-items: center;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-sm);
  color: var(--color-danger);
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 40px;
}

.btn-haptic-stop:hover {
  background: var(--color-danger);
  color: #ffffff;
}

.haptic-status-notice {
  font-size: 0.775rem;
  color: var(--text-muted);
}

/* Sección del informe técnico */
.report-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.report-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.btn-report-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--accent-emerald);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 40px;
  transition: background 0.2s ease;
}

.btn-report-action:hover {
  background: #059669;
}

.btn-report-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 40px;
  transition: all 0.2s ease;
}

.btn-report-secondary:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border-color-focus);
}

.report-textarea {
  width: 100%;
  height: 180px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  font-size: 0.825rem;
  color: var(--text-primary);
  resize: vertical;
  line-height: 1.5;
  box-sizing: border-box;
}

.report-textarea:focus {
  outline: none;
  border-color: var(--border-color-focus);
}

/* Guía SEO y acordeones canónicos */
.seo-guide-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  margin-bottom: 2rem;
}

.seo-guide-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 1rem;
}

.seo-guide-h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1.5rem 0 0.75rem;
}

.seo-guide-content p,
.seo-guide-content li {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.seo-guide-content ul {
  padding-left: 1.25rem;
  margin: 0.75rem 0;
}

.seo-guide-content strong {
  color: var(--text-primary);
}

/* Estructura canónica de FAQs innegociable */
.seo-faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.seo-faq-item {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.seo-faq-item[open] {
  border-color: var(--accent-cyan);
}

.seo-faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  font-family: var(--font-heading);
  font-size: 0.975rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  list-style: none;
}

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

.seo-faq-icon {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.25s ease;
}

.seo-faq-item[open] .seo-faq-icon {
  transform: rotate(180deg);
  color: var(--accent-cyan);
}

.seo-faq-answer {
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.seo-faq-answer p {
  margin: 0.85rem 0 0;
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Modal accesible (sin window.alert) */
.custom-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 15, 23, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.custom-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.custom-modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 480px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.custom-modal-backdrop.active .custom-modal-card {
  transform: scale(1);
}

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

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.btn-close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.btn-close-modal:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.25rem;
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-color);
}

.btn-primary {
  background: var(--accent-blue);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.55rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover {
  background: #2563eb;
}

/* Responsividad táctil */
@media (max-width: 768px) {
  .tool-layout {
    margin: 1rem auto 2rem;
    padding: 0 0.75rem;
  }

  .gamepad-bar-card {
    padding: 1rem;
  }

  .gamepad-controls-group {
    width: 100%;
    justify-content: space-between;
  }

  .control-unit {
    flex: 1 1 100%;
  }

  .custom-select {
    width: 100%;
  }

  .btn-refresh-gamepads {
    width: 100%;
    justify-content: center;
  }

  .dials-grid-container {
    grid-template-columns: 1fr;
  }

  .haptic-buttons-row button,
  .report-actions-bar button {
    width: 100%;
    justify-content: center;
  }
}
