/* ===== Дзен — общие стили ===== */
:root {
  --bg1: #fdf6f0;
  --bg2: #f4f0fb;
  --bg3: #eef7f4;
  --card: rgba(255, 255, 255, 0.72);
  --card-solid: #ffffff;
  --ink: #4a4458;
  --ink-soft: #8a8398;
  --accent: #b69ce0;       /* лаванда */
  --accent2: #f5b8c4;      /* нежно-розовый */
  --accent3: #a7d7c5;      /* мята */
  --accent-warm: #f6c89a;  /* персик */
  --line: rgba(150, 140, 170, 0.18);
  --shadow: 0 10px 35px rgba(150, 130, 180, 0.16);
  --shadow-soft: 0 6px 20px rgba(150, 130, 180, 0.12);
  --radius: 22px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 10% -10%, #fbe7e1 0%, transparent 55%),
    radial-gradient(1000px 700px at 100% 0%, #ece3fb 0%, transparent 50%),
    radial-gradient(900px 700px at 50% 110%, #e0f3ec 0%, transparent 55%),
    linear-gradient(160deg, var(--bg1), var(--bg2) 55%, var(--bg3));
  background-attachment: fixed;
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }

/* ===== Шапка комнаты (возврат в дом) ===== */
.room-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 980px; margin: 0 auto; padding: 20px 20px 0;
}
.back-home {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 18px; border-radius: 999px; font-weight: 800; font-size: .92rem;
  color: var(--ink); background: var(--card-solid); box-shadow: var(--shadow-soft);
  transition: transform .18s ease, box-shadow .2s ease;
}
.back-home:hover { transform: translateX(-3px); box-shadow: var(--shadow); }
.room-tag {
  font-family: 'Comfortaa', sans-serif; font-weight: 700;
  color: var(--ink-soft); font-size: .98rem; display: flex; align-items: center; gap: 6px;
}

/* ===== Шапка / навигация ===== */
.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 980px;
  margin: 0 auto;
  padding: 22px 20px 6px;
}
.nav .brand {
  font-family: 'Comfortaa', 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: .5px;
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav .brand .dot { font-size: 1.1rem; }
.nav a.link {
  padding: 8px 15px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .92rem;
  color: var(--ink-soft);
  transition: all .2s ease;
}
.nav a.link:hover { background: var(--card); color: var(--ink); }
.nav a.link.active {
  background: var(--card-solid);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

/* ===== Контейнер ===== */
.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 20px 80px;
}

.page-head { text-align: center; margin: 24px 0 30px; }
.page-head h1 {
  font-family: 'Comfortaa', sans-serif;
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0 0 8px;
}
.page-head p { color: var(--ink-soft); margin: 0; font-size: 1.05rem; }

/* ===== Карточка ===== */
.card {
  background: var(--card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

/* ===== Главная — сетка ===== */
.hero {
  text-align: center;
  padding: 46px 20px 18px;
}
.hero h1 {
  font-family: 'Comfortaa', sans-serif;
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  margin: 0 0 12px;
}
.hero p { color: var(--ink-soft); font-size: 1.15rem; max-width: 560px; margin: 0 auto; }

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 12px;
}
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }

.tile {
  display: block;
  background: var(--card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 28px 26px;
  transition: transform .22s ease, box-shadow .22s ease;
  position: relative;
  overflow: hidden;
}
.tile:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.tile .emoji { font-size: 2.4rem; display: block; margin-bottom: 12px; }
.tile h3 { margin: 0 0 6px; font-size: 1.3rem; font-family: 'Comfortaa', sans-serif; }
.tile p { margin: 0; color: var(--ink-soft); font-size: .98rem; }
.tile::after {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
}
.tile.t1::after { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.tile.t2::after { background: linear-gradient(90deg, var(--accent3), var(--accent-warm)); }
.tile.t3::after { background: linear-gradient(90deg, var(--accent-warm), var(--accent2)); }
.tile.t4::after { background: linear-gradient(90deg, var(--accent2), var(--accent)); }

/* ===== Формы ===== */
label.field { display: block; margin-bottom: 18px; }
label.field .lbl {
  display: block;
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: 7px;
  color: var(--ink);
}
input[type="text"], input[type="time"], textarea, select {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.85);
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(182, 156, 224, 0.18);
}
textarea { resize: vertical; min-height: 110px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  padding: 13px 26px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 8px 22px rgba(182, 156, 224, 0.35);
  transition: transform .15s ease, box-shadow .2s ease, opacity .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(182, 156, 224, 0.42); }
.btn:active { transform: translateY(0); }
.btn.ghost {
  background: var(--card-solid);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}
.btn.small { padding: 8px 16px; font-size: .88rem; }

/* выбор типа аскезы */
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
@media (max-width: 480px) { .choice { grid-template-columns: 1fr; } }
.choice input { position: absolute; opacity: 0; }
.choice label {
  cursor: pointer;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px;
  text-align: center;
  background: rgba(255,255,255,0.6);
  transition: all .2s;
}
.choice label .ico { font-size: 1.8rem; display: block; margin-bottom: 6px; }
.choice label .t { font-weight: 700; }
.choice label .d { font-size: .82rem; color: var(--ink-soft); }
.choice input:checked + label { border-color: var(--accent); background: #fff; box-shadow: var(--shadow-soft); }

/* ===== Банк (список) ===== */
.bank { margin-top: 38px; }
.bank h2 {
  font-family: 'Comfortaa', sans-serif;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.bank .count {
  font-size: .8rem;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--card);
  padding: 3px 11px;
  border-radius: 999px;
}
.bank-list { display: grid; gap: 14px; }
.entry {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  padding: 18px 20px;
  position: relative;
  animation: rise .4s ease;
}
.entry .who { font-weight: 800; }
.entry .meta { font-size: .8rem; color: var(--ink-soft); margin-bottom: 8px; }
.entry .body { white-space: pre-wrap; }
.entry .tag {
  display: inline-block;
  font-size: .76rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.tag.remove { background: #fde2e8; color: #c25b76; }
.tag.do { background: #ddf1ea; color: #43937c; }
.entry .del {
  position: absolute;
  top: 14px; right: 14px;
  border: none; background: transparent;
  cursor: pointer; color: var(--ink-soft);
  font-size: 1.1rem; opacity: .5; transition: opacity .2s;
}
.entry .del:hover { opacity: 1; }
.empty { text-align: center; color: var(--ink-soft); padding: 30px; font-style: italic; }

/* ===== Календарь ===== */
.cal-head {
  display: flex; align-items: center; justify-content: center;
  gap: 18px; margin-bottom: 18px;
}
.cal-head .month {
  font-family: 'Comfortaa', sans-serif;
  font-size: 1.4rem; font-weight: 700; min-width: 220px; text-align: center;
  text-transform: capitalize;
}
.cal-head button {
  border: none; cursor: pointer;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--card-solid); box-shadow: var(--shadow-soft);
  font-size: 1.2rem; color: var(--ink); transition: transform .15s;
}
.cal-head button:hover { transform: scale(1.08); }

.weekdays, .days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.weekdays { margin-bottom: 8px; }
.weekdays span { text-align: center; font-weight: 700; font-size: .8rem; color: var(--ink-soft); }
.day {
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--line);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer; position: relative;
  transition: all .18s; font-weight: 700;
}
.day:hover { background: #fff; transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.day.empty { background: transparent; border: none; cursor: default; }
.day.today { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(182,156,224,.25); }
.day .mark { position: absolute; bottom: 5px; font-size: .85rem; }
.day.has { background: #fff; }
@media (max-width: 480px) {
  .weekdays, .days { gap: 5px; }
  .day { border-radius: 10px; font-size: .85rem; }
}

/* ===== Модалка ===== */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(74, 68, 88, 0.32);
  backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  z-index: 50; padding: 20px;
}
.modal-bg.open { display: flex; animation: fade .2s ease; }
.modal {
  background: var(--card-solid);
  border-radius: var(--radius);
  box-shadow: 0 30px 70px rgba(80,60,110,.3);
  width: 100%; max-width: 560px;
  max-height: 88vh; overflow-y: auto;
  padding: 28px;
  animation: rise .25s ease;
}
.modal h3 {
  font-family: 'Comfortaa', sans-serif;
  margin: 0 0 4px; font-size: 1.35rem; text-transform: capitalize;
}
.modal .sub { color: var(--ink-soft); margin: 0 0 18px; font-size: .92rem; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.modal .close-x {
  float: right; border: none; background: transparent; cursor: pointer;
  font-size: 1.4rem; color: var(--ink-soft); line-height: 1;
}

/* эмоция: одна запись */
.emo-entry {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px; margin-bottom: 12px;
  background: var(--bg1);
}
.emo-entry .row { font-size: .92rem; margin-bottom: 3px; }
.emo-entry .row b { color: var(--ink); }
.emo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .emo-grid { grid-template-columns: 1fr; } }

/* выбор эмоции чипсами */
.emo-picker { margin-bottom: 18px; }
.emo-group-label {
  font-size: .74rem; font-weight: 800; color: var(--ink-soft);
  margin: 12px 0 8px; text-transform: uppercase; letter-spacing: .6px;
}
.emo-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.emo-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 13px; border-radius: 999px;
  border: 2px solid var(--line); background: rgba(255,255,255,0.6);
  cursor: pointer; font-family: inherit; font-weight: 600; font-size: .9rem; color: var(--ink);
  transition: all .15s;
}
.emo-chip:hover { background: #fff; transform: translateY(-1px); }
.emo-chip.sel { border-color: var(--accent); background: #fff; box-shadow: var(--shadow-soft); }
.emo-chip .e { font-size: 1.15rem; }

/* карта настроения (выбор эмоции в дневнике) */
.mood-wrap { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: center; margin-top: 8px; }
.mood-wrap .y-axis {
  writing-mode: vertical-rl; transform: rotate(180deg); text-align: center;
  font-size: .7rem; font-weight: 700; color: var(--ink-soft);
}
.mood-grid {
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
  gap: 6px; border-radius: 16px; overflow: hidden;
}
.quad { padding: 12px; min-height: 124px; }
.quad .qt { font-weight: 800; font-size: .66rem; text-transform: uppercase; opacity: .62; margin-bottom: 8px; }
.q-hu { background: linear-gradient(135deg,#f7b2b2,#f3c0c0); }
.q-hp { background: linear-gradient(135deg,#f7d98a,#fae3a6); }
.q-lu { background: linear-gradient(135deg,#a9c2ea,#bcd0f0); }
.q-lp { background: linear-gradient(135deg,#a7d7c5,#bfe3d5); }
.mood-chip {
  display: inline-block; margin: 0 5px 5px 0; padding: 5px 11px; border-radius: 999px;
  background: rgba(255,255,255,.6); border: 1.5px solid rgba(255,255,255,.7);
  font-weight: 700; font-size: .82rem; cursor: pointer; transition: all .15s; color: #5a4f5e;
}
.mood-chip:hover { background: #fff; transform: translateY(-1px); }
.mood-chip.sel { background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.14); outline: 2px solid rgba(90,79,94,.45); }
.x-axis { display: flex; justify-content: space-between; font-size: .72rem; font-weight: 700; color: var(--ink-soft); margin-top: 6px; }

/* ползунок интенсивности */
.intensity { margin-top: 18px; }
.intensity .lbl { display: flex; justify-content: space-between; font-weight: 700; font-size: .85rem; margin-bottom: 8px; }
.int-range { -webkit-appearance: none; appearance: none; width: 100%; height: 10px; border-radius: 999px;
  background: linear-gradient(90deg, #e6dff5, var(--accent)); cursor: pointer; }
.int-range::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; border: 3px solid var(--accent); box-shadow: 0 2px 6px rgba(0,0,0,.2); cursor: pointer; }
.int-range::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); cursor: pointer; }

/* точка-цвет эмоции в записи */
.emo-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: middle; margin: 0 4px 0 1px; }

/* карта тела (чувство в теле) */
.body-map { display: flex; flex-direction: column; align-items: center; margin-top: 8px; }
.body-figures { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; }
.body-col { display: flex; flex-direction: column; align-items: center; }
.body-figure { width: 112px; height: auto; margin: 4px 0; touch-action: manipulation; }
.body-cap {
  font-size: .72rem; font-weight: 800; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: .5px; margin-top: 2px;
}
.bz { fill: #ece6f6; stroke: #cfc6e6; stroke-width: 1.4; cursor: pointer; transition: fill .15s, stroke .15s; }
.bz:hover { fill: #ddd2f0; }
.bz.sel { fill: var(--mark, #f3a6b4); stroke: rgba(0,0,0,.22); stroke-width: 1.7; }
.body-chosen {
  font-size: .85rem; font-weight: 700; color: var(--ink-soft);
  text-align: center; margin-top: 8px; min-height: 1.3em;
}
.body-chosen b { color: var(--ink); }
.body-hint { font-size: .78rem; color: var(--ink-soft); text-align: center; margin-top: 2px; }

/* благодарность чип */
.grat-chip {
  display: flex; gap: 8px; align-items: flex-start;
  background: var(--bg3); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px;
}
.grat-chip .n { color: var(--accent3); font-weight: 800; }

/* ===== Анимация послания ===== */
.send-fly {
  position: fixed; left: 50%; bottom: 20%;
  transform: translateX(-50%);
  font-size: 2.4rem; z-index: 100; pointer-events: none;
  animation: fly 2s ease-in forwards;
}
@keyframes fly {
  0% { opacity: 0; transform: translate(-50%, 20px) scale(.6); }
  15% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -75vh) scale(.4) rotate(12deg); }
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px;
  font-weight: 600; box-shadow: var(--shadow); opacity: 0;
  transition: all .3s ease; z-index: 120; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

footer.foot { text-align: center; color: var(--ink-soft); font-size: .85rem; padding: 30px 20px 50px; }
