/* ── Cyberdeck keyframes ──────────────────────────── */
@keyframes glitchFlash {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-1px, 1px); }
  40% { transform: translate(1px, -1px); }
  60% { transform: translate(-1px, 0); }
  80% { transform: translate(1px, 1px); }
}
@keyframes scanBar {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(2000%); }
}
@keyframes ringPulse {
  0%   { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(2.2); opacity: 0; }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes blinkCaret {
  0%, 49% { opacity: 1; }
  50%, 100%{ opacity: 0; }
}

/* ── Animaciones de transición entre preguntas ────── */
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

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

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.slide-in-right { animation: slideInRight 0.3s ease forwards; }
.slide-in-left  { animation: slideInLeft  0.3s ease forwards; }
.slide-jump     { animation: jumpFade     0.25s ease forwards; }
.fade-in        { animation: fadeIn       0.3s ease forwards; }
.fade-in-up     { animation: fadeInUp     0.4s ease forwards; }
.scale-in       { animation: scaleIn      0.25s ease forwards; }

/* Pantalla de descanso — Cyberdeck */
.break-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: radial-gradient(ellipse at center, #1a0808 0%, #0A0A0A 70%);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
  animation: fadeIn 0.5s ease;
}

.break-ring {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  border: 1px solid var(--red);
  pointer-events: none;
  animation: ringPulse 3s 0s infinite ease-out;
}

.break-ring:nth-child(2) {
  animation-delay: 0.6s;
  border-color: rgba(255, 42, 42, 0.6);
}

.break-ring:nth-child(3) {
  animation-delay: 1.2s;
  border-color: rgba(255, 42, 42, 0.35);
}

.break-content {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.break-clock {
  font-size: 11rem;
  line-height: 0.9;
  color: var(--red);
  text-shadow: 0 0 40px var(--red-glow);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0;
}

.break-message {
  font-size: 12px;
  color: var(--muted);
  max-width: 420px;
  line-height: 1.7;
  margin: 16px auto 32px;
  letter-spacing: 0.02em;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

.modal-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 420px;
  width: 100%;
  animation: scaleIn 0.25s ease;
  box-shadow: var(--shadow-lg);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.modal-body {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Progress bar */
.progress-bar-wrapper {
  width: 100%;
  height: 4px;
  background: var(--color-surface-2);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* Timer */
.timer-display {
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  min-width: 72px;
  text-align: center;
}

.timer-display.urgent {
  color: var(--color-error);
  border-color: var(--color-error);
  background: rgba(239, 68, 68, 0.1);
  animation: timerPulse 1s ease infinite;
}

@keyframes timerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.88rem;
  box-shadow: var(--shadow-md);
  animation: fadeInUp 0.3s ease;
  max-width: 300px;
}

.toast.success { border-left: 3px solid var(--color-success); }
.toast.error   { border-left: 3px solid var(--color-error); }
.toast.info    { border-left: 3px solid var(--color-primary); }

@media (max-width: 480px) {
  .break-clock { font-size: 3.5rem; }
  .break-pulse-ring { display: none; }
  .toast-container { bottom: 16px; right: 16px; left: 16px; }
}
