/* Spritz Reader v2 */

.spritz-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
}

.spritz-overlay.active {
  display: flex;
}

.spritz-container {
  width: min(90vw, 700px);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Redicle */
.spritz-redicle {
  display: flex;
  align-items: baseline;
  justify-content: center;
  font-family: 'SF Mono', 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1;
  padding: 2rem 0;
  border-top: 2px solid #444;
  border-bottom: 2px solid #444;
  position: relative;
  min-height: 4rem;
}

.spritz-redicle::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #ef4444;
  opacity: 0.4;
}

.spritz-before {
  color: #e2e8f0;
  text-align: right;
  width: 45%;
  overflow: hidden;
}

.spritz-orp {
  color: #ef4444;
  font-weight: 700;
  width: auto;
  text-align: center;
}

.spritz-after {
  color: #e2e8f0;
  text-align: left;
  width: 45%;
  overflow: hidden;
}

/* Barra de progreso YouTube-style */
.spritz-progress {
  position: relative;
  height: 20px;
  display: flex;
  align-items: center;
}

.spritz-progress-bar {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  background: #ef4444;
  border-radius: 2px;
  width: 0%;
  pointer-events: none;
  transition: width 0.1s linear;
}

.spritz-progress::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  background: #374151;
  border-radius: 2px;
}

.spritz-seeker {
  position: relative;
  width: 100%;
  height: 20px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  z-index: 1;
}

.spritz-seeker::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ef4444;
  border: none;
  cursor: grab;
}

.spritz-seeker::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ef4444;
  border: none;
  cursor: grab;
}

.spritz-seeker::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
}

.spritz-seeker::-moz-range-track {
  height: 4px;
  background: transparent;
}

/* Controles */
.spritz-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: #e2e8f0;
  font-size: 0.9rem;
}

.spritz-controls button {
  background: none;
  border: 1px solid #4b5563;
  color: #e2e8f0;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.spritz-controls button:hover:not(:disabled) {
  background: #374151;
  border-color: #6b7280;
}

.spritz-controls button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.spritz-controls button:focus-visible {
  outline: 2px solid #ef4444;
  outline-offset: 2px;
}

.spritz-wpm {
  min-width: 5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.spritz-counter {
  min-width: 7rem;
  text-align: center;
  color: #9ca3af;
  font-variant-numeric: tabular-nums;
}

/* Mobile */
@media (max-width: 768px) {
  .spritz-redicle {
    font-size: clamp(3rem, 8vw, 6rem);
    padding: 3rem 0;
  }

  .spritz-controls button {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }

  .spritz-progress {
    height: 32px;
  }

  .spritz-progress-bar,
  .spritz-progress::before {
    height: 6px;
  }

  .spritz-seeker::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
  }

  .spritz-seeker::-moz-range-thumb {
    width: 20px;
    height: 20px;
  }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
  .spritz-progress-bar {
    transition: none;
  }
}

/* FAB */
#spritz-fab {
  position: fixed;
  bottom: 5rem;
  right: 1.5rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: #1e293b;
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
}

#spritz-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

#spritz-fab:focus-visible {
  outline: 2px solid #ef4444;
  outline-offset: 2px;
}
