/* ==========================================================================
   chrono.css — Estilos personalizados para el Cronómetro Tabata
   Elimina dependencia de Bootstrap · Diseño moderno y responsivo
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Variables de diseño (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
  /* Paleta base */
  --color-bg: #0b0e14;
  --color-bg-elevated: #141922;
  --color-bg-card: #1c2330;
  --color-bg-input: #12161f;
  --color-text: #edf0f7;
  --color-text-muted: #8b93a7;
  --color-border: #2a3242;
  --color-border-light: #374052;

  /* Colores de fase */
  --color-work: #22c55e;
  --color-work-dark: #15803d;
  --color-break: #ef4444;
  --color-break-dark: #b91c1c;
  --color-precount: #f59e0b;
  --color-idle: #64748b;

  /* Color de acento */
  --color-accent: #6366f1;
  --color-accent-hover: #818cf8;
  --color-accent-active: #4f46e5;

  /* Tipografía */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", "Fira Code", Consolas, "Courier New",
    monospace;

  /* Espaciado */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;

  /* Radios */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Sombras */
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  --glow-work: 0 0 40px rgba(34, 197, 94, 0.25);
  --glow-break: 0 0 40px rgba(239, 68, 68, 0.25);
  --glow-precount: 0 0 40px rgba(245, 158, 11, 0.25);

  /* Transiciones */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 600ms ease;

  /* Layout */
  --header-height: 60px;
  --content-max-width: 520px;
}

/* --------------------------------------------------------------------------
   2. Reset y estilos base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--transition-slow),
    box-shadow var(--transition-slow);
  overflow-x: hidden;
  overscroll-behavior: none;
}

/* Fondo con glow según fase — controlado por data-phase en body */
body[data-phase="work"] {
  background: radial-gradient(
    ellipse at 50% 20%,
    rgba(34, 197, 94, 0.12),
    transparent 60%
  );
  background-color: var(--color-bg);
}

body[data-phase="break"] {
  background: radial-gradient(
    ellipse at 50% 20%,
    rgba(239, 68, 68, 0.12),
    transparent 60%
  );
  background-color: var(--color-bg);
}

body[data-phase="precount"] {
  background: radial-gradient(
    ellipse at 50% 20%,
    rgba(245, 158, 11, 0.1),
    transparent 60%
  );
  background-color: var(--color-bg);
}

img,
svg,
video {
  max-width: 100%;
  display: block;
}

button,
input {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-hover);
}

/* --------------------------------------------------------------------------
   3. Utilidades
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--sp-4);
}

.is-hidden {
  display: none !important;
}

/* Accesibilidad: elemento oculto visualmente pero presente para
   lectores de pantalla y buscadores (sr-only) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.flex-grow-1 {
  flex-grow: 1;
}

.screen {
  animation: fadeIn var(--transition-normal);
}

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

/* --------------------------------------------------------------------------
   4. Pantalla de inicio (Home)
   -------------------------------------------------------------------------- */
.screen--home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--sp-6) 0;
  padding-bottom: calc(var(--sp-6) + env(safe-area-inset-bottom));
  text-align: center;
}

.brand-title {
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-2);
  background: linear-gradient(
    135deg,
    var(--color-text) 0%,
    var(--color-accent) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  color: var(--color-text-muted);
  font-size: 1rem;
  max-width: 400px;
  margin-bottom: var(--sp-6);
  line-height: 1.6;
}

/* Panel de configuración */
.config-panel {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  text-align: left;
}

.config-field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.config-field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.config-field input {
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  transition: border-color var(--transition-fast),
    box-shadow var(--transition-fast);
  width: 100%;
  color: var(--color-text);
}

.config-field input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.config-field input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.6;
}

/* Hint debajo del formulario */
.screen-hint {
  margin-top: var(--sp-5);
  color: var(--color-text-muted);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  justify-content: center;
}

.screen-hint kbd {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* Texto descriptivo SEO debajo del formulario */
.screen-seo-text {
  margin-top: var(--sp-5);
  max-width: 440px;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
  text-align: center;
}

/* --------------------------------------------------------------------------
   5. Botones
   -------------------------------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  transition: all var(--transition-fast);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.button:active {
  transform: scale(0.97);
}

.button--primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.button--primary:hover {
  background: var(--color-accent-hover);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.45);
  transform: translateY(-1px);
}

.button--secondary {
  background: var(--color-bg-card);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.button--secondary:hover {
  border-color: var(--color-border-light);
  background: var(--color-bg-elevated);
}

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

.button--danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.button--large {
  padding: var(--sp-4) var(--sp-6);
  font-size: 1.125rem;
}

.button--full {
  width: 100%;
}

/* --------------------------------------------------------------------------
   6. Pantalla de entrenamiento (Work)
   -------------------------------------------------------------------------- */
.screen--work {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--sp-5) 0;
  padding-bottom: calc(var(--sp-5) + env(safe-area-inset-bottom));
  text-align: center;
}

.timer-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-5);
  width: 100%;
  max-width: 460px;
}

/* Insignia de fase */
.phase-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-4);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  transition: all var(--transition-normal);
}

.phase-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-idle);
  transition: background var(--transition-normal);
}

body[data-phase="work"] .phase-badge {
  color: var(--color-work);
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.1);
}

body[data-phase="work"] .phase-badge::before {
  background: var(--color-work);
  animation: pulse 1.5s ease-in-out infinite;
}

body[data-phase="break"] .phase-badge {
  color: var(--color-break);
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.1);
}

body[data-phase="break"] .phase-badge::before {
  background: var(--color-break);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.4);
    opacity: 0.7;
  }
}

/* Anillo de progreso */
.progress-ring-wrap {
  position: relative;
  width: 280px;
  height: 280px;
  margin: var(--sp-4) auto;
}

.progress-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-ring__track {
  fill: none;
  stroke: var(--color-bg-card);
  stroke-width: 8;
}

.progress-ring__bar {
  fill: none;
  stroke: var(--color-idle);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 1s linear, stroke var(--transition-normal);
}

body[data-phase="work"] .progress-ring__bar {
  stroke: var(--color-work);
  filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.5));
}

body[data-phase="break"] .progress-ring__bar {
  stroke: var(--color-break);
  filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.5));
}

body[data-phase="precount"] .progress-ring__bar {
  stroke: var(--color-precount);
}

/* Lectura central (número grande) */
.timer-readout {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
}

.timer-number {
  font-family: var(--font-mono);
  font-size: clamp(4rem, 18vw, 7rem);
  font-weight: 200;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--color-text);
  transition: color var(--transition-normal);
  font-variant-numeric: tabular-nums;
}

body[data-phase="work"] .timer-number {
  color: var(--color-work);
  text-shadow: var(--glow-work);
}

body[data-phase="break"] .timer-number {
  color: var(--color-break);
  text-shadow: var(--glow-break);
}

body[data-phase="precount"] .timer-number {
  color: var(--color-precount);
  text-shadow: var(--glow-precount);
}

.timer-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* Título de ronda */
.timer-title {
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Dots de rondas */
.round-dots {
  display: flex;
  gap: var(--sp-2);
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  min-height: 12px;
}

.round-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-border);
  transition: all var(--transition-normal);
}

.round-dot.is-done {
  background: var(--color-accent);
  transform: scale(1.15);
}

.round-dot.is-current {
  background: var(--color-border-light);
  transform: scale(1.5);
}

body[data-phase="work"] .round-dot.is-current {
  background: var(--color-work);
}

body[data-phase="break"] .round-dot.is-current {
  background: var(--color-break);
}

/* Controles */
.timer-controls {
  display: flex;
  gap: var(--sp-3);
  justify-content: center;
  align-items: center;
  margin-top: var(--sp-3);
  width: 100%;
  max-width: 340px;
}

.timer-controls .button {
  flex: 1;
  min-height: 48px;
}

/* --------------------------------------------------------------------------
   7. Overlay de cuenta atrás previa
   -------------------------------------------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 14, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: overlayFadeIn var(--transition-fast);
}

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

.overlay__content {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  align-items: center;
}

.pre-countdown__number {
  font-family: var(--font-mono);
  font-size: clamp(6rem, 30vw, 12rem);
  font-weight: 200;
  color: var(--color-precount);
  text-shadow: var(--glow-precount);
  line-height: 1;
  animation: countNumber var(--transition-slow);
}

@keyframes countNumber {
  0% {
    transform: scale(1.6);
    opacity: 0;
  }
  20% {
    transform: scale(1);
    opacity: 1;
  }
  80% {
    transform: scale(0.9);
    opacity: 1;
  }
  100% {
    transform: scale(0.85);
    opacity: 0;
  }
}

.pre-countdown__text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text);
}

/* --------------------------------------------------------------------------
   8. Modales
   -------------------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
}

.modal.is-open {
  display: flex;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 14, 20, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: overlayFadeIn var(--transition-fast);
}

.modal__dialog {
  position: relative;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 440px;
  width: 100%;
  animation: modalSlideUp var(--transition-normal);
  overflow: hidden;
}

@keyframes modalSlideUp {
  from {
    transform: translateY(24px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.modal__header {
  padding: var(--sp-5) var(--sp-5) 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
}

.modal__header h2 {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.3;
}

.modal__close {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 1.25rem;
  line-height: 1;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.modal__close:hover {
  color: var(--color-text);
  border-color: var(--color-border-light);
  transform: rotate(90deg);
}

.modal__body {
  padding: var(--sp-5);
  color: var(--color-text-muted);
  font-size: 1rem;
}

.modal__body p + p {
  margin-top: var(--sp-2);
}

.modal__body strong {
  color: var(--color-text);
}

.modal__footer {
  padding: 0 var(--sp-5) var(--sp-5);
  display: flex;
  gap: var(--sp-3);
  justify-content: center;
}

.modal__footer .button {
  min-width: 100px;
}

/* Modal de felicitación */
.modal--success .modal__dialog {
  border-color: rgba(34, 197, 94, 0.3);
  text-align: center;
}

.modal--success .modal__header {
  justify-content: center;
}

.modal--success .modal__header h2 {
  font-size: 1.75rem;
}

.modal__emoji {
  font-size: 3rem;
  display: block;
  margin-bottom: var(--sp-3);
}

/* Modal de privacidad — cuerpo con scroll */
.modal--scroll .modal__dialog {
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.modal--scroll .modal__body {
  overflow-y: auto;
  flex: 1;
}

.modal--scroll .modal__body p {
  margin-bottom: var(--sp-3);
  font-size: 0.9rem;
  line-height: 1.7;
}

.modal--scroll .modal__body code {
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
  font-size: 0.85em;
}

/* --------------------------------------------------------------------------
   9. Footer
   -------------------------------------------------------------------------- */
.footer {
  padding: var(--sp-5) var(--sp-4);
  border-top: 1px solid var(--color-border);
  text-align: center;
  margin-top: auto;
}

.footer .container {
  display: flex;
  justify-content: center;
}

.footer button.link {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  transition: color var(--transition-fast);
  background: none;
  border: none;
  cursor: pointer;
}

.footer button.link:hover {
  color: var(--color-text);
}

/* --------------------------------------------------------------------------
   10. Barra representativa superior (opcional)
   -------------------------------------------------------------------------- */
.site-header {
  padding: var(--sp-3) 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-weight: 800;
  font-size: 1.125rem;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.site-logo span {
  color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   11. Pulsador grande central para iniciar (alternativa al botón)
   -------------------------------------------------------------------------- */
.start-button-wrap {
  display: flex;
  justify-content: center;
  margin-top: var(--sp-4);
}

.start-button {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent);
  color: #fff;
  font-size: 2.25rem;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
  transition: transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.start-button:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.5);
}

.start-button:active {
  transform: scale(0.95);
}

/* --------------------------------------------------------------------------
   12. Animaciones adicionales
   -------------------------------------------------------------------------- */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes bounceIn {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.animate-bounce-in {
  animation: bounceIn 0.6s var(--transition-normal);
}

/* Transición al cambiar de pantalla */
.screen {
  transition: opacity var(--transition-normal),
    transform var(--transition-normal);
}

.screen.is-leaving {
  opacity: 0;
  transform: translateY(-12px);
}

/* --------------------------------------------------------------------------
   13. Responsive
   -------------------------------------------------------------------------- */

/* Desktop y tablets: más amplitud vertical y respiración entre bloques */
@media (min-width: 481px) {
  .screen--home {
    padding-top: var(--sp-7);
    padding-bottom: calc(var(--sp-7) + env(safe-area-inset-bottom));
  }

  .brand-subtitle {
    margin-bottom: var(--sp-7);
  }

  .screen-hint {
    margin-top: var(--sp-7);
  }

  .screen-seo-text {
    margin-top: var(--sp-6);
  }

  .screen--work {
    padding-top: var(--sp-6);
    padding-bottom: calc(var(--sp-6) + env(safe-area-inset-bottom));
  }

  .timer-display {
    gap: var(--sp-6);
  }
}

/* Móvil */
@media (max-width: 480px) {
  .screen--home {
    padding: var(--sp-4) 0;
    padding-bottom: calc(var(--sp-4) + env(safe-area-inset-bottom));
  }

  .brand-subtitle {
    margin-bottom: var(--sp-4);
    font-size: 0.9375rem;
  }

  .config-panel {
    padding: var(--sp-4);
    gap: var(--sp-4);
    border-radius: var(--radius-md);
  }

  .config-field input {
    padding: var(--sp-3);
    font-size: 1.125rem;
  }

  .screen-hint {
    margin-top: var(--sp-4);
  }

  /* El texto SEO permanece en el DOM para buscadores y lectores de
     pantalla (sr-only), pero ocupa cero espacio visual en móvil */
  .screen-seo-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  .progress-ring-wrap {
    width: 230px;
    height: 230px;
  }

  .timer-number {
    font-size: clamp(3.5rem, 16vw, 5.5rem);
  }

  .timer-controls {
    flex-direction: column;
  }

  .timer-controls .button {
    width: 100%;
  }

  .modal__dialog {
    border-radius: var(--radius-md);
  }
}

/* Pantallas bajas y estrechas (móviles compactos, iPhone SE, landscape corto) */
@media (max-height: 700px) and (max-width: 480px) {
  .screen--home,
  .screen--work {
    min-height: auto;
    padding: var(--sp-4) 0;
  }

  .brand-subtitle {
    display: none;
  }

  .config-panel {
    padding: var(--sp-4);
    gap: var(--sp-3);
    max-width: 380px;
  }

  .progress-ring-wrap {
    width: 200px;
    height: 200px;
  }

  .timer-display {
    gap: var(--sp-3);
  }

  .timer-number {
    font-size: clamp(3rem, 14vw, 4.5rem);
  }

  .timer-title {
    font-size: 1.1rem;
    min-height: 1.75rem;
  }

  .screen-hint {
    margin-top: var(--sp-3);
  }

  .footer {
    padding: var(--sp-3) var(--sp-4);
  }
}

/* Móvil pequeño */
@media (max-width: 340px) {
  .progress-ring-wrap {
    width: 190px;
    height: 190px;
  }

  .timer-number {
    font-size: 3.25rem;
  }
}

/* Landscape móvil */
@media (max-height: 500px) and (orientation: landscape) {
  .screen--home,
  .screen--work {
    min-height: auto;
    padding: var(--sp-4) 0;
  }

  .config-panel {
    padding: var(--sp-4) var(--sp-5);
    gap: var(--sp-3);
  }

  .progress-ring-wrap {
    width: 180px;
    height: 180px;
  }

  .timer-title {
    font-size: 1.1rem;
    min-height: 1.75rem;
  }

  .timer-display {
    gap: var(--sp-3);
  }

  .footer {
    padding: var(--sp-3) var(--sp-4);
  }
}

/* Accesibilidad: respetar preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .progress-ring__bar {
    transition: stroke-dashoffset var(--transition-normal),
      stroke var(--transition-normal);
  }
}

/* Soporte de contraste alto */
@media (prefers-contrast: more) {
  :root {
    --color-border: #4a5568;
    --color-text-muted: #b9c0cf;
  }
}
