/* Компоненты: .card, кнопки, поля ввода, слот-машина */

/* ──── Карточка (glassmorphism) ──── */
.card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  padding: 34px 24px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(255, 255, 255, 0.5);
  text-align: center;
}

/* ──── Кнопки ──── */
button {
  font-family: 'Comfortaa', sans-serif;
  font-weight: 700;
  cursor: pointer;
  border: none;
  border-radius: 50px;
  padding: 16px 30px;
  font-size: 18px;
  transition: transform 0.15s ease;
  min-height: var(--min-touch); /* доступность: минимум 44px */
  line-height: 1.2;
}

button:focus-visible {
  outline: 3px solid var(--pink-400);
  outline-offset: 3px;
}

button:active {
  transform: scale(0.96);
}

/* Primary: розовый, белый текст */
.btn-primary {
  background: var(--pink-500);
  color: var(--white);
  box-shadow: var(--shadow-btn);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary:hover {
  box-shadow: 0 10px 28px rgba(232, 77, 150, 0.65);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: scale(0.96) translateY(0);
}

/* Ширина на всю карточку (для экранов Date/Slot) */
.btn-primary.full {
  width: 100%;
  margin-top: 22px;
}

/* Secondary: белый фон, розовая обводка */
.btn-secondary {
  background: var(--white);
  color: var(--pink-500);
  border: 2px solid var(--pink-200);
  transition: transform 0.25s ease, border-color 0.15s ease;
}

.btn-secondary:hover {
  border-color: var(--pink-400);
}

/* Ghost: прозрачный, только текст */
.btn-ghost {
  background: transparent;
  color: var(--text-soft);
  text-decoration: underline;
  font-size: 14px;
  padding: 10px 16px;
  font-weight: 600;
  min-height: var(--min-touch);
}

.btn-ghost:hover {
  color: var(--text);
}

/* ──── Кнопка «Да» (с эффектом роста) ──── */
.btn-yes {
  background: var(--pink-500);
  color: var(--white);
  box-shadow: var(--shadow-btn);
  transition: transform 0.3s var(--ease-spring), box-shadow 0.15s ease;
  transform-origin: center;
}

.btn-yes:hover {
  box-shadow: 0 10px 28px rgba(232, 77, 150, 0.65);
}

/* ──── Кнопка «Нет» (убегающая) ──── */
.btn-no {
  background: var(--white);
  color: var(--pink-500);
  border: 2px solid var(--pink-200);
  /* переход только для нормального состояния (до detach) */
  transition: transform 0.25s ease, border-color 0.15s ease;
  white-space: nowrap;
}

/* После detach — фиксированная позиция, быстрый «перескок» в новое место */
.btn-no.runaway {
  position: fixed;
  z-index: 100;
  margin: 0;
  transition:
    left 0.07s ease-out,
    top  0.07s ease-out,
    transform 0.07s ease-out;
}

/* ──── Группа кнопок на экране Ask ──── */
.ask-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  margin-top: 26px;
  min-height: 70px;
  position: relative;
}

/* ──── Поля ввода ──── */
.field {
  margin: 14px 0;
  text-align: left;
}

.field label {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--text);
}

.field input[type="date"],
.field input[type="time"] {
  width: 100%;
  font-family: 'Comfortaa', sans-serif;
  font-size: 16px;
  padding: 13px 14px;
  border-radius: 14px;
  border: 2px solid var(--pink-200);
  background: var(--white);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease;
  min-height: var(--min-touch);
  -webkit-appearance: none;
  appearance: none;
}

.field input[type="date"]:focus,
.field input[type="time"]:focus {
  border-color: var(--pink-500);
  box-shadow: 0 0 0 3px rgba(232, 77, 150, 0.15);
}

.field input.error {
  border-color: #e84d4d;
}

/* ──── Календарь в стиле сайта ──── */
.date-picker {
  position: relative;
}

.date-picker__toggle {
  width: 100%;
  display: grid;
  grid-template-columns: 36px 1fr 24px;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 2px solid var(--pink-200);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), var(--pink-50));
  color: var(--text);
  box-shadow: 0 7px 20px rgba(232, 77, 150, 0.12);
  text-align: left;
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.date-picker__toggle:hover,
.date-picker.is-open .date-picker__toggle {
  border-color: var(--pink-400);
  box-shadow: 0 0 0 3px rgba(232, 77, 150, 0.12), 0 9px 24px rgba(232, 77, 150, 0.16);
}

.date-picker__toggle.error {
  border-color: #e84d4d;
}

.date-picker__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--pink-100), var(--pink-200));
  font-size: 18px;
}

.date-picker__value {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.date-picker__chevron {
  color: var(--pink-500);
  font-size: 22px;
  text-align: center;
  transition: transform 0.2s ease;
}

.date-picker.is-open .date-picker__chevron {
  transform: rotate(180deg);
}

.date-calendar {
  position: absolute;
  z-index: 20;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  padding: 14px;
  border: 2px solid rgba(255, 179, 214, 0.85);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 36px rgba(122, 43, 84, 0.2);
  animation: calendarIn 0.22s var(--ease-spring) both;
}

.date-calendar[hidden] {
  display: none;
}

@keyframes calendarIn {
  from { opacity: 0; transform: translateY(-7px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.date-calendar__header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.date-calendar__month {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}

.date-calendar__nav {
  width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 14px;
  background: var(--pink-50);
  color: var(--pink-600);
  font-size: 28px;
  line-height: 1;
}

.date-calendar__nav:hover:not(:disabled) {
  background: var(--pink-100);
}

.date-calendar__nav:disabled {
  cursor: default;
  opacity: 0.28;
}

.date-calendar__weekdays,
.date-calendar__days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.date-calendar__weekdays {
  margin-bottom: 5px;
}

.date-calendar__weekdays span {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.date-calendar__empty {
  min-height: 40px;
}

.date-calendar__day {
  width: 100%;
  min-height: 40px;
  padding: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  box-shadow: none;
}

.date-calendar__day:hover:not(:disabled):not(.is-selected) {
  background: var(--pink-50);
  color: var(--pink-600);
}

.date-calendar__day.is-today:not(.is-selected) {
  box-shadow: inset 0 0 0 2px var(--pink-200);
}

.date-calendar__day.is-selected {
  background: linear-gradient(135deg, var(--pink-400), var(--pink-500));
  color: var(--white);
  box-shadow: 0 6px 14px rgba(232, 77, 150, 0.38);
}

.date-calendar__day:disabled {
  cursor: default;
  color: rgba(168, 96, 137, 0.28);
}

/* ──── Слот-машина ──── */
.slot {
  height: 90px;
  overflow: hidden;
  border-radius: 18px;
  background: var(--white);
  border: 3px solid var(--pink-200);
  margin: 22px 0;
  position: relative;
  box-shadow: inset 0 0 18px rgba(255, 158, 201, 0.4);
}

/* Градиентные «шторки» сверху и снизу */
.slot::before,
.slot::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 32px;
  z-index: 2;
  pointer-events: none;
}

.slot::before {
  top: 0;
  background: linear-gradient(to bottom, var(--white), transparent);
}

.slot::after {
  bottom: 0;
  background: linear-gradient(to top, var(--white), transparent);
}

/* Центральная ячейка — подсветка */
.slot-highlight {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 90px;
  background: linear-gradient(135deg, rgba(255, 180, 214, 0.2), rgba(232, 77, 150, 0.1));
  border-top: 2px solid rgba(232, 77, 150, 0.3);
  border-bottom: 2px solid rgba(232, 77, 150, 0.3);
  z-index: 1;
  pointer-events: none;
}

.slot-track {
  position: absolute;
  width: 100%;
  will-change: transform;
}

.slot-item {
  height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  gap: 4px;
}

.slot-item .slot-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.slot-item .slot-meta {
  font-size: 12px;
  color: var(--text-soft);
  opacity: 0.8;
}

/* ──── Итоговая карточка результата ──── */
.result-card {
  display: none;
  margin-top: 20px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius);
  border: 2px solid var(--pink-200);
  text-align: center;
  animation: pop 0.5s var(--ease-spring) both;
}

.result-card.show {
  display: block;
}

.result-poster {
  display: block;
  width: 160px;
  max-width: 60%;
  border-radius: 14px;
  margin: 10px auto 6px;
  box-shadow: 0 8px 22px rgba(232, 77, 150, 0.4);
}
.result-poster[hidden] { display: none; }

.result-poster--place {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.result-place {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin: 6px 0 4px;
}

.result-category {
  font-size: 14px;
  color: var(--text-soft);
  margin-bottom: 8px;
}

.result-addr {
  font-size: 14px;
  color: var(--text-soft);
  opacity: 0.85;
}

.result-when {
  font-size: 14px;
  color: var(--pink-600);
  font-weight: 600;
  margin-top: 10px;
}

.result-rating {
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 4px;
}

.result-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--pink-500);
  text-decoration: none;
}

.result-link:hover {
  text-decoration: underline;
}

/* ──── Кнопки слота ──── */
.slot-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

/* ──── Кнопка звука ──── */
.mute-btn {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 200;
  width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  border-radius: 50%;
  font-size: 22px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 6px 16px rgba(232, 77, 150, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

/* ──── Анимированная кошка ──── */
.cat-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 6px;
}
.cat {
  width: 120px;
  height: 120px;
  transform-origin: 60px 100px;
  animation: cat-bounce 2.2s ease-in-out infinite;
}
.cat-fur { fill: #f7d9b0; }
.cat-ear-in { fill: #ffb3d6; }
.cat-body { fill: #fff; stroke: #f3c9a0; stroke-width: 2; }
.cat-cheek { fill: #ffc2da; opacity: 0.8; }
.cat-eye { fill: #3a2a32; }
.cat-mouth { fill: none; stroke: #3a2a32; stroke-width: 2.4; stroke-linecap: round; }
.cat-paw {
  fill: #fff;
  stroke: #f3c9a0;
  stroke-width: 2;
  transform-origin: 92px 92px;
  animation: cat-wave 0.9s ease-in-out infinite;
}
@keyframes cat-bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-6px) rotate(-2deg); }
}
@keyframes cat-wave {
  0%, 100% { transform: rotate(0deg); }
  50%      { transform: rotate(-28deg); }
}
/* сердечки, которые пускает кошка */
.cat-heart {
  position: absolute;
  right: 6px;
  top: 30px;
  font-size: 18px;
  opacity: 0;
  animation: cat-heart-float 3s ease-in infinite;
}
.cat-heart:nth-child(3) { animation-delay: 0s; }
.cat-heart:nth-child(4) { animation-delay: 1s; right: 14px; }
.cat-heart:nth-child(5) { animation-delay: 2s; right: 0; }
@keyframes cat-heart-float {
  0%   { opacity: 0; transform: translate(0, 0) scale(0.5); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: translate(26px, -50px) scale(1.1); }
}

/* ──── Чипсы времени ──── */
.time-chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 4px;
}
.time-chip {
  padding: 11px 4px;
  font-size: 15px;
  font-weight: 600;
  min-height: 44px;
  border-radius: 12px;
  background: var(--white);
  color: var(--text);
  border: 2px solid var(--pink-200);
  transition: all 0.15s ease;
}
.time-chip:hover { border-color: var(--pink-400); }
.time-chip.active {
  background: var(--pink-500);
  color: var(--white);
  border-color: var(--pink-500);
  box-shadow: var(--shadow-btn);
}
.time-chips.error { outline: 2px solid #e84d4d; outline-offset: 4px; border-radius: 12px; }
.time-custom-toggle {
  margin-top: 10px;
  background: transparent;
  color: var(--pink-500);
  text-decoration: underline;
  font-size: 13px;
  font-weight: 600;
  padding: 6px;
  min-height: auto;
}
.time-custom-input {
  display: block;
  width: 100%;
  margin-top: 8px;
  font-family: 'Comfortaa', sans-serif;
  font-size: 16px;
  padding: 13px 14px;
  border-radius: 14px;
  border: 2px solid var(--pink-200);
  background: var(--white);
  color: var(--text);
}
.time-custom-input[hidden] { display: none; }

/* ──── Сетка категорий ──── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 8px;
}
.cat-btn {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 10px;
  min-height: 110px;
  border-radius: 18px;
  background: var(--white);
  border: 2px solid var(--pink-200);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.cat-btn:nth-child(n + 4) { grid-column: span 3; }
.cat-btn:hover { border-color: var(--pink-400); box-shadow: var(--shadow-btn); transform: translateY(-2px); }
.cat-btn .cat-emoji { font-size: 32px; line-height: 1; }
.cat-btn .cat-label { font-size: 14px; font-weight: 700; color: var(--text); }
.cat-btn .cat-sub   { font-size: 11px; color: var(--text-soft); }

/* ──── Заглушка пустой рулетки ──── */
.slot-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-soft);
  background: var(--white);
}

/* ──── Финальный экран ──── */
.final-emoji {
  font-size: 56px;
  animation: cat-bounce 1.8s ease-in-out infinite;
  margin-bottom: 6px;
}
.final-summary {
  margin: 18px 0 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius);
  border: 2px solid var(--pink-200);
}
.final-place {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.final-line {
  font-size: 14px;
  color: var(--text-soft);
  margin-top: 4px;
}

/* ──── Летящий самолётик ──── */
.plane {
  display: none;
  position: fixed;
  left: 50%;
  top: 55%;
  z-index: 300;
  font-size: 52px;
  pointer-events: none;
}

.result-lead {
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 4px;
}

/* ──── Виджет погоды ──── */
.weather-widget {
  margin: 16px auto 6px;
  padding: 12px 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, #ffe3f1, #ffd0e6);
  display: inline-flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 6px 16px rgba(232, 77, 150, 0.25);
}
.weather-widget[hidden] { display: none; }
.weather-emoji { font-size: 42px; line-height: 1; display: inline-block; }
.weather-info { text-align: left; }
.weather-temp { font-size: 22px; font-weight: 700; color: var(--text); }
.weather-label { font-size: 12px; color: var(--text-soft); }

.weather-emoji.sun   { animation: w-pulse 2.4s ease-in-out infinite; }
.weather-emoji.rain,
.weather-emoji.snow  { animation: w-bob 1.6s ease-in-out infinite; }
.weather-emoji.cloud { animation: w-drift 3s ease-in-out infinite; }
@keyframes w-pulse { 0%,100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.18) rotate(10deg); } }
@keyframes w-bob   { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes w-drift { 0%,100% { transform: translateX(-5px); } 50% { transform: translateX(5px); } }

/* ──── Подсказка (напоминание) ──── */
.final-tip {
  margin: 12px auto 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--pink-600);
  max-width: 92%;
  line-height: 1.4;
}
.final-tip:empty { display: none; }

/* Уважаем настройку «меньше движения» */
@media (prefers-reduced-motion: reduce) {
  .cat, .cat-paw, .cat-heart, .final-emoji, .weather-emoji { animation: none !important; }
}
