/* mirror.css */
/* ===============================
   6. ЭКРАН "ЗЕРКАЛО ДНЯ"
   =============================== */

/* Весь экран зеркала */
#screen-mirror {
  background: var(--ink);
  color: var(--text);
}

/* Заголовок Зеркала — модификатор для общего h1.page-title */
#screen-mirror .page-title-mirror {
  /* шрифты / вес / базовый размер задаются в h1.page-title (app.css) */
  letter-spacing: .2px;
  font-size: 26px; /* чуть крупнее/мельче — по желанию */
  margin: 0;
  color: var(--sand);
}

/* Подпись с датой */
#screen-mirror .subtle {
  color: var(--muted);
  font-size: 13px;
}

/* Шапка: кольцо – заголовок – кнопка месяца */
#screen-mirror .header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

/* Кольцо активности */
#screen-mirror .ring {
  width: 64px;
  height: 64px;
  position: relative;
  display: inline-grid;
  place-items: center;
}
#screen-mirror .ring svg {
  width: 64px;
  height: 64px;
  display: block;
}
#screen-mirror .ring .center-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text);
  opacity: .9;
  box-shadow: 0 0 0 6px rgba(255,255,255,.05);
}

/* Кнопка "Обзор месяца" */
#screen-mirror #btnMonth {
  font-family: var(--font-accent);
  font-weight: 700;
  font-size: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 0;
  background: var(--violet);
  color: #1A1326;
  cursor: pointer;
  transition: .15s ease;
  box-shadow: var(--shadow-soft);
}
#screen-mirror #btnMonth:active {
  transform: translateY(1px);
  box-shadow: none;
}

/* Блок с картинкой и текстом */
#screen-mirror .mirror-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 12px 0 16px;
  text-align: center;
}
#screen-mirror .mirror-img {
  max-width: min(320px, 100%);
  width: 100%;
  height: auto;
}
#screen-mirror .page-desc {
  margin: 6px 0 14px;
  font-size: 14px;
  color: var(--text);
  text-align: left;
}

/* Заголовки секций "Дневники" / "Телесные практики" */
#screen-mirror .section-title {
  margin: 16px 0 12px;
  font-family: var(--font-accent);
  font-size: 16px;
  letter-spacing: .2px;
}

/* Специальный заголовок для блока "Экстренная ситуация" */
#screen-mirror .section-title-panic {
  margin-top: 24px;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--pink);
}

/* ===== Строки элементов (дневники / практики) ===== */

#screen-mirror .row {
  --sidepad: 12px;
  display: grid;
  grid-template-columns: auto minmax(140px, 1fr) auto; /* чекбокс | текст | кнопки */
  align-items: center;                                  /* ВАЖНО: центр по вертикали */
  gap: 10px;
  padding: 10px var(--sidepad);
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
}
#screen-mirror .row + .row {
  margin-top: 8px;
}

#screen-mirror .row .label {
  font-family: var(--font-accent);
  font-size: 13px;
  letter-spacing: .2px;
  display: flex;
  align-items: center;
  gap: 8px;
}



#screen-mirror .row .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-self: end;
}

/* Маленькие кнопки в строках */
#screen-mirror .btn-mini {
  font-family: var(--font-accent);
  font-size: 13px;      /* оставляем: меньше, чем подписи (13px) */
  padding: 6px 10px;     /* было 6px 10px — кнопки станут ниже */
  border-radius: 999px; /* будет более “пилюлька”, но маленькая */
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: .15s ease;
}
#screen-mirror .btn-mini:active {
  transform: translateY(1px);
}

/* Розовые варианты */
#screen-mirror .btn-solid-pink {
  background: var(--pink);
  color: #1A1326;
  border-color: transparent;
  font-weight: 700;
  border-radius: 999px;

}
#screen-mirror .btn-outline-pink {
  background: transparent;
  color: var(--pink);
  border-color: var(--pink);
}

/* Песочные варианты */
#screen-mirror .btn-solid-sand {
  background: var(--sand);
  color: #1A1326;
  border-color: transparent;
  font-weight: 700;
}
#screen-mirror .btn-outline-sand {
  background: transparent;
  color: var(--sand);
  border-color: var(--sand);
}

/* ===== Сердечки-чекбоксы ===== */

#screen-mirror .chk {
  width: 26px;
  height: 26px;
  display: inline-block;
  cursor: pointer;
  transition: transform .15s ease;
  vertical-align: middle;
}

#screen-mirror .chk:hover {
  transform: scale(1.06);
}

#screen-mirror .chk.disabled {
  opacity: .45;
  cursor: not-allowed;
  filter: saturate(.7);
}

#screen-mirror .chk::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background: no-repeat center / contain;

  /* чтобы анимация масштабирования выглядела как "биение" из центра */
  transform-origin: 50% 50%;
}


#screen-mirror .chk-extra {
  width: 26px;
  height: 26px;
  display: inline-block;
  cursor: pointer;
  transition: transform .15s ease;
  vertical-align: middle;
}

/* ===============================
   ПУЛЬСАЦИЯ СЕРДЕЧКА (анимация)
   =============================== */

/* Класс, который мы будем вешать только на нужное сердечко
   (первое — Благодарности) через JS */
#screen-mirror .chk-pulse::before {
  animation: mirror-heart-pulse 3.2s ease-in-out infinite;
}

/* Паттерн: пум-пум, пум-пум, пум-пум, пауза, пум-пум, пауза */
@keyframes mirror-heart-pulse {
  /* старт – обычный размер */
  0%   { transform: scale(1); }

  /* 1-й двойной удар */
  4%   { transform: scale(1.14); }
  8%   { transform: scale(1);    }
  12%  { transform: scale(1.14); }
  16%  { transform: scale(1);    }

  /* 2-й двойной удар */
  22%  { transform: scale(1.14); }
  26%  { transform: scale(1);    }
  30%  { transform: scale(1.14); }
  34%  { transform: scale(1);    }

  /* пауза */
  50%  { transform: scale(1);    }

  /* ещё один мягкий двойной удар */
  56%  { transform: scale(1.12); }
  60%  { transform: scale(1);    }
  66%  { transform: scale(1.12); }
  70%  { transform: scale(1);    }

  /* длинная пауза до следующего цикла */
  100% { transform: scale(1);    }
}

/* Розовое сердце */
#screen-mirror .chk[data-color="pink"]::before {
  background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 21 C12 21 5 16 5 10.5 C5 8.015 6.99 6 9.5 6 11 6 12.5 6.8 13 8 13.5 6.8 15 6 16.5 6 19.01 6 21 8.015 21 10.5 21 16 12 21 12 21 Z" fill="none" stroke="%23F164B3" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
}
#screen-mirror .chk[data-color="pink"].checked::before {
  background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 21 C12 21 5 16 5 10.5 C5 8.015 6.99 6 9.5 6 11 6 12.5 6.8 13 8 13.5 6.8 15 6 16.5 6 19.01 6 21 8.015 21 10.5 21 16 12 21 12 21 Z" fill="%23F164B3" stroke="%23F164B3" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
}

/* Песочное сердце */
#screen-mirror .chk[data-color="sand"]::before {
  background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 21 C12 21 5 16 5 10.5 C5 8.015 6.99 6 9.5 6 11 6 12.5 6.8 13 8 13.5 6.8 15 6 16.5 6 19.01 6 21 8.015 21 10.5 21 16 12 21 12 21 Z" fill="none" stroke="%23F6EFAE" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
}
#screen-mirror .chk[data-color="sand"].checked::before {
  background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 21 C12 21 5 16 5 10.5 C5 8.015 6.99 6 9.5 6 11 6 12.5 6.8 13 8 13.5 6.8 15 6 16.5 6 19.01 6 21 8.015 21 10.5 21 16 12 21 12 21 Z" fill="%23F6EFAE" stroke="%23F6EFAE" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
}

/* ===== Модалка редактирования дневника
   в едином стиле диалогового окна (как "Подробнее"/"Похвала")
   ===== */

.modal-back {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;                 /* центрируем по вертикали, как диалог */
  justify-content: center;
  padding: 16px;
  background: var(--modal-backdrop);   /* тот же тёмный фон, что и у info/praise */
  z-index: 1200;                       /* на одном уровне с другими диалогами */
}

.modal {
  width: 100%;
  max-width: 360px;                    /* компактная карточка-диалог */
  background: #121215;                 /* тот же фон, что и у info/praise/lock */
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, .10);
  padding: 18px 18px 16px;
  position: relative;
}

/* Заголовок – как у диалогового окна, только розовый акцент можно оставить */
.modal h3 {
  margin: 0 0 10px;
  font-family: var(--font-accent);
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: -0.03em;
  font-weight: 600;
  color: #FFFFFF;                      /* белый, как у info-title */
}

/* Текстовое поле дневника */
.modal .ta {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.5;
}

/* Было: дефолтная синяя рамка от браузера */
/* Стало: розовый фокус под стиль Комнаты */
#screen-mirror .modal .ta:focus {
  outline: none;                 /* убираем синюю */
  border-color: var(--pink);     /* розовая граница */
  box-shadow: 0 0 0 1px var(--pink);
}

/* Низ модалки – кнопки "Сохранить" / "Закрыть" в едином стиле */
.modal .controls {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Инфо-модалка "Подробнее" в формате диалога */

.info-back {
  position: fixed;
  inset: 0;
  display: none;

  /* ВАЖНО: центрируем, не растягиваем ребёнка */
  align-items: center;
  justify-content: center;

  padding: 16px;
  background: var(--modal-backdrop);
  z-index: 1100;
}

.info-modal {
  width: 100%;
  max-width: 360px;

  /* 💡 КЛЮЧЕВОЕ: ограничиваем рост по высоте */
  max-height: 80vh;
  height: auto;
  align-self: center;

  background: #121215;
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, .10);
  padding: 18px 18px 16px;
  position: relative;

  /* Чтобы внутренности могли сжаться и прокручиваться */
  display: flex;
  flex-direction: column;
}
/* Заголовок как у k-dialog */
.info-title {
  font-family: var(--font-accent);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: -0.03em;
  color: #FFFFFF;
  margin: 0 32px 8px 0;
}

/* Основной текст */
.info-text {
  white-space: pre-wrap;
  color: rgba(255, 255, 255, .88);
  line-height: 1.5;
  font-size: 13px;

  /* 💡 вот тут магия компактности */
  max-height: 56vh;
  overflow-y: auto;
}

/* Когда внутри info-text лежит наш HTML-блок .info-creators,
   не нужно сохранять все переводы строк из шаблона */
.info-text .info-creators,
.info-text .info-creators * {
  white-space: normal;
}

/* Крестик — как у k-dialog-close */
.info-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .8);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .15s ease, color .15s ease, transform .08s ease, opacity .12s ease;
}

.info-close:hover {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

.info-close:active {
  transform: translateY(1px) scale(.97);
  opacity: .9;
}

/* Кнопка "Спасибо" в едином формате диалоговой кнопки */
.info-controls {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

.info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 36px;
  padding: 8px 22px;

  border-radius: 999px;
  border: none;
  cursor: pointer;

  font-family: var(--font-accent);
  font-size: 13px;
  font-weight: 700;

  background: var(--pink);
  color: #000;

  box-shadow: var(--shadow-soft);
  transition: transform .08s ease, box-shadow .08s ease, opacity .12s ease, background .12s ease;
}

.info-btn:active {
  transform: translateY(1px) scale(.98);
  box-shadow: none;
  opacity: .9;
}

/* Узкие экраны: чуть жмём карточку */
@media (max-width: 360px) {
  .info-modal {
    max-width: 320px;
    border-radius: 16px;
    padding: 16px 14px 14px;
  }
}

/* ===============================
   6.1 МОДАЛКИ ЗЕРКАЛА ДНЯ
   =============================== */

/* Общий фон для полноэкранных оверлеев */
.video-back,
.video-back-hz,
.calendar-back,
.praise-back {
  position: fixed;
  inset: 0;
  display: none;                      /* включаем JS-ом */
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--modal-backdrop);  /* тёмный полупрозрачный фон */
  z-index: 1200;
}

/* ---------- Вертикальная видео-модалка ---------- */

.video-modal {
  width: min(420px, 100%);
  background: #0B0C0E;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 12px;
  position: relative;
}

.video-modal .x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.video-box {
  aspect-ratio: 9 / 16;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.video-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Горизонтальная видео-модалка ---------- */

.video-modal-hz {
  width: min(880px, 100%);
  background: #0B0C0E;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 12px;
  position: relative;
}

.video-modal-hz .x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.video-box-hz {
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.video-box-hz video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Календарь ---------- */

.calendar-back {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--calendar-backdrop);
  z-index: 1200;
}

.calendar {
  width: min(820px, 100%);
  background: var(--bg-elev);
  border-radius: 18px;
  border: 2px solid var(--line);
  box-shadow: var(--shadow);
  padding: 16px 16px 24px;
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cal-title {
  font-family: var(--font-accent);
  font-size: 16px;
}

.cal-nav {
  display: flex;
  gap: 8px;
}

.cal-btn {
  font-family: var(--font-accent);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 0;
  background: var(--violet);
  color: #1A1326;
  cursor: pointer;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 6px;
}

.dow {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.day {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  display: grid;
  place-items: center;
  position: relative;
  cursor: pointer;
  transition: .15s ease;
}

.day:hover {
  background: rgba(255,255,255,.10);
}

.day.disabled {
  opacity: .35;
  cursor: not-allowed;
}

.day .num {
  position: relative;
  z-index: 3;
  font-family: var(--font-accent);
  font-size: 12px;
  color: #000;
  padding: 2px 6px;
  border-radius: 8px;
  background: #fff;
}

.day .base-white {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #fff;
  z-index: 1;
}

.day .pizza-mini,
.day .ring-mini {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  z-index: 2;
}

/* ---------- Похвальная модалка: в формате единого диалога ---------- */

.praise-back {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--modal-backdrop);
  z-index: 1300;
}

.praise-modal {
  width: 100%;
  max-width: 360px;                     /* такая же компактная, как info / lock */
  background: #121215;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .10);
  box-shadow: var(--shadow-soft);
  padding: 18px 18px 16px;
  position: relative;
}

.praise-text {
  white-space: pre-wrap;
  color: rgba(255, 255, 255, .96);
  line-height: 1.5;
  font-size: 14px;
  font-family: var(--font-main);
  text-align: left;
}

/* Кнопка "Благодарю" — в том же стиле, что k-dialog-btn */
.praise-controls {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

.praise-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 36px;
  padding: 8px 22px;

  border-radius: 999px;
  border: none;
  cursor: pointer;

  font-family: var(--font-accent);
  font-size: 13px;
  font-weight: 700;

  background: var(--pink);
  color: #000;

  box-shadow: var(--shadow-soft);
  transition: transform .08s ease, box-shadow .08s ease, opacity .12s ease, background .12s ease;
}

.praise-btn:active {
  transform: translateY(1px) scale(.98);
  box-shadow: none;
  opacity: .9;
}

/* Узкие экраны: чуть сжимаем */
@media (max-width: 360px) {
  .praise-modal {
    max-width: 320px;
    border-radius: 16px;
    padding: 16px 14px 14px;
  }
}