/* Стили экранов и переходы между ними */

/* ──── Базовый экран — скрыт ──── */
.screen {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  padding: 20px 16px;
  text-align: center;

  /* скрыт по умолчанию */
  display: none;
  opacity: 0;
  pointer-events: none;
}

/* Активный экран */
.screen.active {
  display: block;
  pointer-events: auto;
  animation: screenIn 0.45s var(--ease-spring) both;
}

/* Экран уходящий */
.screen.leaving {
  display: block;
  pointer-events: none;
  animation: screenOut 0.3s ease both;
}

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

@keyframes screenOut {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.92) translateY(-8px);
  }
}

/* Для prefers-reduced-motion — убираем анимации экранов, оставляем fade */
@media (prefers-reduced-motion: reduce) {
  .screen.active {
    animation: fadein 0.25s ease both;
  }
  .screen.leaving {
    animation: fadeout 0.2s ease both;
  }
  @keyframes fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
  @keyframes fadeout {
    from { opacity: 1; }
    to   { opacity: 0; }
  }
}

/* ──── Экран 1: Ask ──── */
#screen-ask .card h1 {
  font-size: clamp(26px, 7vw, 34px);
  margin-bottom: 10px;
}

/* ──── Экран 2: Date ──── */
#screen-date .card {
  text-align: left;
}

#screen-date h2 {
  text-align: center;
  margin-bottom: 4px;
}

#screen-date p.sub {
  text-align: center;
}

/* Сообщение валидации (вместо alert) */
#date-error {
  display: none;
}

#date-error.show {
  display: block;
}

/* ──── Экран 3: Slot ──── */
#screen-slot .card {
  overflow: hidden; /* чтобы слот не вылезал за карточку */
}

#screen-slot h2 {
  margin-bottom: 4px;
}

.spin-status {
  min-height: 38px;
  margin: 8px 4px 2px;
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.45;
  text-align: center;
}

.spin-status.is-final {
  color: var(--pink-600);
  font-weight: 700;
}

/* Сохранение — состояния */
.save-status {
  font-size: 13px;
  color: var(--text-soft);
  text-align: center;
  margin-top: 8px;
  min-height: 20px;
}

.save-status.success {
  color: #2d8e4e;
  font-weight: 600;
}

.save-status.error {
  color: #c0392b;
}

.save-status.offline {
  color: var(--pink-600);
}

/* ──── Десктоп — немного больше padding ──── */
@media (min-width: 520px) {
  .screen {
    padding: 28px 20px;
  }

  .card {
    padding: 40px 32px;
  }

  .slot-item .slot-name {
    font-size: 20px;
  }
}
