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

  /* Modo claro por defecto */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-card-hover: #e2e8f0;
  --border-color: #e2e8f0;
  --border-color-focus: #3b82f6;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --accent-primary: #2563eb;
  --accent-primary-hover: #1d4ed8;
  --accent-primary-glow: rgba(37, 99, 235, 0.2);

  --accent-success: #10b981;
  --accent-success-bg: rgba(16, 185, 129, 0.12);
  --accent-warning: #f59e0b;
  --accent-warning-bg: rgba(245, 158, 11, 0.12);
  --accent-danger: #ef4444;
  --accent-purple: #8b5cf6;

  --shadow-card: 0 4px 16px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 30px -4px rgba(15, 23, 42, 0.12);
}

[data-theme="dark"] {
  --bg-body: #0b0f17;
  --bg-card: #131b26;
  --bg-card-subtle: #1a2434;
  --bg-card-hover: #223046;
  --border-color: #243042;
  --border-color-focus: #60a5fa;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-primary: #3b82f6;
  --accent-primary-hover: #60a5fa;
  --accent-primary-glow: rgba(59, 130, 246, 0.3);

  --accent-success: #34d399;
  --accent-success-bg: rgba(52, 211, 153, 0.15);
  --accent-warning: #fbbf24;
  --accent-warning-bg: rgba(251, 191, 36, 0.15);
  --accent-danger: #f87171;
  --accent-purple: #a78bfa;

  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 36px -4px rgba(0, 0, 0, 0.65);
}

/* Base de página y contención canónica */
*, *::before, *::after {
  box-sizing: border-box;
}

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

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

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
  margin-top: 0;
}

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

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

/* Tarjeta principal del juego Perceptle */
.card-main.perceptle-arena {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 2rem;
  position: relative;
}

/* Barra superior de control del juego */
.arena-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background-color: var(--bg-card-subtle);
  border-bottom: 1px solid var(--border-color);
}

.arena-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.mode-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-success);
  box-shadow: 0 0 8px var(--accent-success);
  animation: pulseDot 2s infinite ease-in-out;
}

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

.arena-date-chip {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  background-color: var(--border-color);
  color: var(--text-muted);
}

/* Barra de progreso de las 5 pruebas */
.test-progress-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  background-color: transparent;
  transition: all 0.2s ease;
  user-select: none;
}

.progress-step .step-num {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--border-color);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.progress-step.active {
  color: var(--accent-primary);
  background-color: var(--bg-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.progress-step.active .step-num {
  background-color: var(--accent-primary);
  color: #ffffff;
}

.progress-step.done {
  color: var(--accent-success);
}

.progress-step.done .step-num {
  background-color: var(--accent-success);
  color: #ffffff;
}

.arena-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-arena-tool {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-arena-tool:hover {
  color: var(--text-main);
  border-color: var(--border-color-focus);
  background-color: var(--bg-card-hover);
}

/* Escenario y vistas dinámicas */
.arena-stage-container {
  padding: 1.5rem;
  min-height: 440px;
  display: flex;
  flex-direction: column;
}

.stage-view {
  display: none;
  width: 100%;
}

.stage-view.active {
  display: block;
  animation: fadeInStage 0.25s ease-out forwards;
}

@keyframes fadeInStage {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Encabezado de prueba */
.test-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.test-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-primary);
  background-color: var(--bg-card-subtle);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}

.test-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: var(--text-main);
}

.test-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0 auto;
  max-width: 600px;
}

.highlight-target {
  color: var(--accent-primary);
  font-weight: 800;
  padding: 0 0.2rem;
  border-radius: 4px;
  background-color: var(--bg-card-subtle);
}

/* Vista 0: Intro */
.intro-card-inner {
  text-align: center;
  max-width: 540px;
  margin: 1.5rem auto;
}

.intro-hero-visual {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-circle-glow {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-primary-glow) 0%, transparent 70%);
  animation: pulseGlow 3s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 0.9; }
}

.intro-heading {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.65rem;
}

.intro-description {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

.daily-status-box {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.daily-status-title {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
}

.daily-status-desc {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-primary-play {
  background-color: var(--accent-primary);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 0.85rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font-heading);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-primary-play:hover {
  background-color: var(--accent-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px var(--accent-primary-glow);
}

.practice-alternative-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.btn-secondary-play {
  background-color: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  justify-content: center;
}

.btn-secondary-play:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-color-focus);
}

.toggle-extreme-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  margin-top: 0.25rem;
}

.toggle-extreme-wrap input {
  display: none;
}

.toggle-slider {
  width: 32px;
  height: 18px;
  background-color: var(--border-color);
  border-radius: 18px;
  position: relative;
  transition: background-color 0.2s ease;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #ffffff;
  transition: transform 0.2s ease;
}

.toggle-extreme-wrap input:checked + .toggle-slider {
  background-color: var(--accent-purple);
}

.toggle-extreme-wrap input:checked + .toggle-slider::after {
  transform: translateX(14px);
}

/* Áreas de Canvas (Conteo y Trayectoria) */
.count-canvas-wrapper,
.track-canvas-wrapper {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto 1.5rem;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

canvas#canvas-count,
canvas#canvas-track {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 600 / 340;
}

.count-flash-overlay,
.track-start-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(11, 15, 23, 0.75);
  backdrop-filter: blur(4px);
  z-index: 5;
  transition: opacity 0.2s ease;
}

.btn-flash-trigger {
  background: var(--accent-primary);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 0.85rem 1.4rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-heading);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px var(--accent-primary-glow);
}

.btn-flash-trigger:hover {
  background: var(--accent-primary-hover);
  transform: scale(1.03);
}

.count-timer-line {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-success));
  width: 100%;
  transform-origin: left;
  transform: scaleX(0);
}

/* Controles de respuesta genéricos */
.test-controls-card {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.input-prompt-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
}

.count-input-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  max-width: 320px;
}

.btn-numpad-step {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 8px;
  height: 44px;
  padding: 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-numpad-step:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-color-focus);
}

.input-count-field {
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
  height: 44px;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--bg-card);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s ease;
}

.input-count-field:focus {
  border-color: var(--border-color-focus);
}

.btn-confirm-action {
  background-color: var(--accent-primary);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1.6rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-heading);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
  width: 100%;
  max-width: 320px;
}

.btn-confirm-action:hover {
  background-color: var(--accent-primary-hover);
  transform: translateY(-1px);
}

.guide-instruction-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

/* Feedback de resultado */
.test-result-feedback {
  max-width: 480px;
  margin: 0 auto;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  animation: fadeIn 0.3s ease;
}

.feedback-stats-row {
  display: flex;
  justify-content: space-around;
  text-align: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.feedback-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.feedback-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.feedback-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.val-green {
  color: var(--accent-success);
}

.val-score {
  color: var(--accent-primary);
  font-size: 1.4rem;
}

.btn-next-test {
  background-color: var(--accent-primary);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1.4rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-heading);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-next-test:hover {
  background-color: var(--accent-primary-hover);
}

/* Prueba 2: Trayectoria */
.track-landing-guide {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: rgba(0, 0, 0, 0.15);
  border-top: 2px dashed var(--border-color);
  cursor: crosshair;
}

.track-landing-marker {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  transition: left 0.05s ease-out;
}

.marker-pin {
  color: var(--accent-warning);
  font-size: 16px;
  line-height: 1;
}

.marker-label {
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--bg-card);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  white-space: nowrap;
}

/* Prueba 3: Dial de ángulo */
.angle-interactive-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
}

#svg-angle-dial {
  touch-action: none;
  cursor: grab;
  user-select: none;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.06));
}

#svg-angle-dial:active {
  cursor: grabbing;
}

.angle-dial-bg {
  fill: var(--bg-card-subtle);
}

.angle-dial-border {
  fill: none;
  stroke: var(--border-color);
  stroke-width: 2;
}

.angle-axis-line {
  stroke: var(--border-color);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}

.angle-user-arc {
  fill: var(--accent-primary-glow);
  stroke: var(--accent-primary);
  stroke-width: 2.5;
}

.angle-user-line {
  stroke: var(--accent-primary);
  stroke-width: 4;
  stroke-linecap: round;
}

.angle-handle {
  fill: var(--accent-primary);
  stroke: #ffffff;
  stroke-width: 3;
  cursor: grab;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
  transition: transform 0.1s ease;
}

.angle-handle:hover {
  transform: scale(1.1);
}

.angle-pivot {
  fill: var(--text-main);
}

.angle-target-arc {
  fill: var(--accent-success-bg);
  stroke: var(--accent-success);
  stroke-width: 2;
  stroke-dasharray: 4 2;
}

.angle-target-line {
  stroke: var(--accent-success);
  stroke-width: 3;
  stroke-linecap: round;
}

/* Prueba 4: Ritmo */
.tempo-interactive-wrapper {
  max-width: 480px;
  margin: 0 auto 1.5rem;
  text-align: center;
}

.tempo-visual-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 4px solid var(--border-color);
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.tempo-pulse-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background-color: var(--bg-card-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s ease;
}

.tempo-pulse-circle.pulse {
  background-color: var(--accent-primary);
  transform: scale(1.12);
  box-shadow: 0 0 24px var(--accent-primary-glow);
}

.tempo-pulse-circle.pulse .tempo-count-number {
  color: #ffffff;
}

.tempo-count-number {
  font-size: 1.35rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--text-main);
}

.tempo-guide-state {
  margin-bottom: 1.25rem;
}

.tempo-mode-chip {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  background-color: var(--bg-card-subtle);
  color: var(--text-muted);
}

.tempo-tap-area {
  margin-bottom: 1.5rem;
}

.btn-tempo-tap {
  width: 100%;
  min-height: 84px;
  border-radius: 14px;
  background: var(--bg-card-subtle);
  border: 2px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-heading);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: all 0.08s ease;
}

.btn-tempo-tap:active,
.btn-tempo-tap.tap-active {
  background-color: var(--accent-primary-glow);
  border-color: var(--accent-primary);
  transform: scale(0.97);
}

.tap-main-text {
  font-size: 1.25rem;
  font-weight: 800;
}

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

.tempo-dots-tracker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.tempo-beat-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 700;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-dim);
  transition: all 0.15s ease;
}

.tempo-beat-dot.guide {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.tempo-beat-dot.hit {
  background-color: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  transform: scale(1.1);
}

.tempo-beat-dot.blind.hit {
  background-color: var(--accent-success);
  border-color: var(--accent-success);
  color: #ffffff;
}

.tempo-beat-divider {
  color: var(--text-dim);
  font-weight: 700;
  padding: 0 0.15rem;
}

/* Prueba 5: Proporción */
.split-interactive-wrapper {
  max-width: 540px;
  margin: 1.5rem auto 2rem;
  padding: 0 1rem;
}

.split-track-container {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.split-bar-bg {
  position: relative;
  width: 100%;
  height: 54px;
  background-color: var(--bg-card-subtle);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  overflow: visible;
  cursor: ew-resize;
  touch-action: none;
}

.split-fill-user {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 50%;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.15), rgba(37, 99, 235, 0.35));
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
  pointer-events: none;
}

.split-target-mark {
  position: absolute;
  top: -8px;
  bottom: -8px;
  width: 4px;
  background-color: var(--accent-success);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--accent-success);
  pointer-events: none;
  z-index: 4;
}

.split-handle {
  position: absolute;
  top: -8px;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
}

.split-handle-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: var(--accent-primary);
  border-radius: 2px;
}

.split-handle-knob {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: #ffffff;
  border: 3px solid var(--accent-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  position: absolute;
  top: calc(50% - 11px);
}

.split-endpoints-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

/* Vista 6: Resultados */
.results-card-inner {
  max-width: 560px;
  margin: 0 auto;
}

.results-score-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.results-grade-circle {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px var(--accent-primary-glow);
  flex-shrink: 0;
}

.grade-letter {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
}

.results-score-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.results-kpi-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.results-kpi-total {
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
}

.score-number {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.score-max {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.grade-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-primary);
}

/* Gráfico de radar */
.results-radar-container {
  text-align: center;
  margin-bottom: 1.5rem;
}

.radar-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.radar-canvas-wrap {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

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

/* Desglose de puntuaciones */
.results-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.75rem;
}

.breakdown-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
}

.b-name {
  width: 155px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

.b-track {
  flex: 1 1 0%;
  height: 10px;
  border-radius: 5px;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.b-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-success));
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.b-score {
  width: 38px;
  text-align: right;
  font-weight: 700;
  color: var(--text-main);
}

/* Botones de acción en resultados */
.results-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.btn-share-results {
  background-color: var(--accent-primary);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-heading);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
}

.btn-share-results:hover {
  background-color: var(--accent-primary-hover);
  transform: translateY(-1px);
}

.btn-practice-again {
  background-color: var(--bg-card-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-heading);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
}

.btn-practice-again:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-color-focus);
}

.daily-countdown-wrap {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.countdown-timer {
  font-weight: 700;
  color: var(--accent-primary);
}

/* Modales accesibles */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(11, 15, 23, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

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

.modal-card-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

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

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

.modal-card-body {
  padding: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-main);
}

.rules-list {
  padding-left: 1.2rem;
  margin: 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rules-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  background-color: var(--bg-card-subtle);
  border-left: 3px solid var(--accent-primary);
  padding: 0.6rem 0.8rem;
  border-radius: 0 6px 6px 0;
  margin-top: 1rem;
}

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

.btn-modal-primary {
  background-color: var(--accent-primary);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-heading);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-modal-primary:hover {
  background-color: var(--accent-primary-hover);
}

/* Estadísticas en modal */
.stats-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  text-align: center;
}

.stat-box {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.6rem 0.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stat-number {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent-primary);
}

.stat-caption {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.stats-subheading {
  font-size: 0.95rem;
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

.stats-skills-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.skill-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  background-color: var(--bg-card-subtle);
  font-size: 0.88rem;
}

.skill-val {
  font-weight: 700;
  color: var(--text-main);
}

/* Toast flotante */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background-color: #0f172a;
  color: #ffffff;
  padding: 0.7rem 1.25rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2000;
}

.toast-notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Guía SEO complementaria */
.seo-guide-section {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.75rem;
  margin-bottom: 2rem;
}

.seo-guide-section h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.85rem;
}

.seo-guide-section p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.guide-grid-pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 2rem;
}

.guide-pillar-card {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
}

.pillar-icon {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.guide-pillar-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.guide-pillar-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* Preguntas frecuentes */
.faq-section {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
}

.faq-section-title {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  background-color: var(--bg-card-subtle);
  overflow: hidden;
}

.faq-question {
  padding: 0.85rem 1rem;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  color: var(--text-main);
  user-select: none;
}

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

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

.faq-item[open] .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-card);
}

.faq-answer p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-muted);
}

/* Adaptación responsive */
@media (max-width: 768px) {
  .tool-layout {
    margin-top: 0.75rem;
    padding: 0 0.5rem;
  }

  .arena-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.75rem;
  }

  .arena-mode-badge {
    justify-content: space-between;
  }

  .test-progress-bar {
    justify-content: space-between;
    width: 100%;
  }

  .progress-step .step-label {
    display: none;
  }

  .arena-stage-container {
    padding: 1rem 0.75rem;
    min-height: 400px;
  }

  .test-title {
    font-size: 1.25rem;
  }

  .results-score-header {
    flex-direction: column;
    text-align: center;
  }

  .results-actions-grid {
    grid-template-columns: 1fr;
  }

  .b-name {
    width: 120px;
    font-size: 0.8rem;
  }

  .stats-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
