/* =========================================================
   ОБЛАКО СКАЗОК — небесная книга снов
   палитра: лаванда · роза · персик · мятный акцент
   ========================================================= */

:root {
  --lav-1:   #c8b6ff;
  --lav-2:   #b79cff;
  --rose-1:  #ffc4e1;
  --rose-2:  #ff9ecb;
  --peach:   #ffe2c9;
  --mint:    #bff5e6;
  --sky-blue:#bcd9ff;

  --ink:      #5b4a86;   /* основной текст — мягкий чернильно-фиолетовый */
  --ink-soft: #8b7bb5;
  --cream:    #fff7fc;

  --glass:        rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --glass-line:   rgba(255, 255, 255, 0.85);

  --shadow-soft: 0 18px 50px -22px rgba(123, 86, 170, 0.55);
  --shadow-lift: 0 30px 70px -28px rgba(123, 86, 170, 0.70);
  --radius:    28px;
  --radius-sm: 18px;

  --font-d: 'Fredoka', sans-serif;
  --font-b: 'Nunito', sans-serif;
}

/* У Fredoka нет полноценной кириллицы: для русского интерфейса
   используем близкий по мягкости Rubik, английский сохраняет Fredoka. */
html[lang="ru"] {
  --font-d: 'Rubik', 'Nunito', sans-serif;
}

/* акценты «мальчиковой» темы — бирюзово-голубые */
body[data-theme="boy"] {
  --lav-1:  #9bd8ef;
  --lav-2:  #4aa3e0;
  --rose-1: #a9e7d6;
  --rose-2: #25b4a2;
  --ink:      #2f5b6e;
  --ink-soft: #5c8499;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; background: #f3e8ff; }

body {
  font-family: var(--font-b);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  background: #f3e8ff;          /* база; основной фон рисует фиксированный слой .atmo--girl */
  position: relative;
}

/* =========================================================
   АТМОСФЕРА
   ========================================================= */
.sky { position: fixed; inset: -2px; z-index: 0; pointer-events: none; overflow: hidden; }

/* когда вкладка не видна — гасим фоновые анимации (экономия CPU/GPU) */
body.tab-hidden .cloud,
body.tab-hidden .bubble,
body.tab-hidden .plane,
body.tab-hidden .twinkle,
body.tab-hidden .sky__glow { animation-play-state: paused !important; }

body.tab-hidden .clouds,
body.tab-hidden .bubbles,
body.tab-hidden .planes,
body.tab-hidden .stars {
  display: none !important;
}

body.perf-idle .cloud,
body.perf-idle .bubble,
body.perf-idle .plane,
body.perf-idle .twinkle,
body.perf-idle .sky__glow { animation-play-state: paused !important; }

/* два слоя атмосферы — плавно перетекают при смене темы */
.atmo { position: absolute; inset: 0; transition: opacity 1.2s ease; }
.atmo--girl {
  opacity: 1;
  background:
    radial-gradient(120% 90% at 15% 0%,  #ffd9ec 0%, transparent 55%),
    radial-gradient(120% 90% at 95% 10%, #cddefff0 0%, transparent 50%),
    radial-gradient(140% 120% at 50% 110%, #ffe6d2 0%, transparent 55%),
    linear-gradient(165deg, #efe2ff 0%, #ffe3f2 45%, #fff0e6 100%);
}
.atmo--boy  {
  opacity: 0;
  background:
    radial-gradient(120% 90% at 15% 0%,  #bfeef0 0%, transparent 55%),
    radial-gradient(120% 90% at 95% 10%, #b9d4ff 0%, transparent 50%),
    radial-gradient(140% 120% at 50% 110%, #c9f4e6 0%, transparent 55%),
    linear-gradient(165deg, #d7ecff 0%, #cdeef0 45%, #e6fbf2 100%);
}
body[data-theme="boy"] .atmo--girl { opacity: 0; }
body[data-theme="boy"] .atmo--boy  { opacity: 1; }

/* На карте акварельная подложка продолжает её облачный край под таббаром и по бокам. */
body.map-screen .atmo {
  background: #dcecff url('assets/map/map-sky-wide-v2.jpg') center bottom / cover no-repeat;
}
body.map-screen .clouds,
body.map-screen .bubbles,
body.map-screen .planes { display: none; }

.sky__glow {
  position: absolute; border-radius: 50%;
  filter: blur(70px); opacity: .55;
  animation: drift 22s ease-in-out infinite alternate;
  will-change: transform;            /* GPU-слой: размытие растрируется один раз */
}
.sky__glow--1 { width: 50vw; height: 50vw; left: -12vw; top: -10vw;
  background: radial-gradient(circle, var(--lav-1), transparent 70%); }
.sky__glow--2 { width: 46vw; height: 46vw; right: -14vw; top: 8vh;
  background: radial-gradient(circle, var(--rose-1), transparent 70%); animation-delay: -7s; }
.sky__glow--3 { width: 52vw; height: 52vw; left: 25vw; bottom: -22vw;
  background: radial-gradient(circle, var(--peach), transparent 70%); animation-delay: -13s; }

/* свечения «мальчиковой» темы — сине-зелёные */
.sky__glow--b1 { width: 50vw; height: 50vw; left: -12vw; top: -10vw;
  background: radial-gradient(circle, #8fe3da, transparent 70%); }
.sky__glow--b2 { width: 46vw; height: 46vw; right: -14vw; top: 8vh;
  background: radial-gradient(circle, #9cc6ff, transparent 70%); animation-delay: -7s; }
.sky__glow--b3 { width: 52vw; height: 52vw; left: 25vw; bottom: -22vw;
  background: radial-gradient(circle, #aef0d6, transparent 70%); animation-delay: -13s; }

@keyframes drift {
  /* только translate — без scale, чтобы размытие не пересчитывалось каждый кадр */
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(4vw, 3vh, 0); }
}

/* декоративные PNG-облака — генерируются в JS */
.cloud {
  position: absolute;
  height: auto;
  display: block;
  animation: float-across linear infinite;
  will-change: transform;
  contain: layout paint style;
  user-select: none;
}

@keyframes float-across {
  from { transform: translateX(-30vw); }
  to   { transform: translateX(130vw); }
}

/* старые пузырьки отключены, контейнер оставлен для совместимости */
.bubbles { display: none !important; }

/* пузыри */
.bubble {
  position: absolute; bottom: -12vh; border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,.95), rgba(255,255,255,.15) 42%, transparent 60%),
    radial-gradient(circle at 70% 75%, rgba(255,196,225,.5), transparent 60%);
  border: 1px solid rgba(255,255,255,.6);
  box-shadow: inset 0 0 14px rgba(255,255,255,.6), 0 6px 18px -8px rgba(160,120,210,.4);
  animation: rise linear infinite;
  will-change: transform, opacity;
}
@keyframes rise {
  0%   { transform: translateY(0) translateX(0) scale(.6); opacity: 0; }
  12%  { opacity: .9; }
  90%  { opacity: .85; }
  100% { transform: translateY(-118vh) translateX(var(--sway, 4vw)) scale(1); opacity: 0; }
}

/* самолёты перетекают при смене темы */
.planes  { opacity: 0; transition: opacity .9s ease; }
body[data-theme="boy"] .planes  { opacity: 1; }

.plane {
  position: absolute; height: auto;
  display: block;
  animation: float-across linear infinite;
  will-change: transform;
  contain: layout paint style;
  user-select: none;
}
html.is-pwa .cloud,
html.is-pwa .plane {
  contain: none;
  will-change: auto;
  image-rendering: auto;
  -webkit-backface-visibility: visible;
  backface-visibility: visible;
}

/* мерцающие звёздочки */
.twinkle {
  position: absolute; color: #fff;
  text-shadow: 0 0 10px rgba(255,255,255,.9);
  animation: twinkle 3.5s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: .15; transform: scale(.7); }
  50%      { opacity: 1;   transform: scale(1.15); }
}

/* =========================================================
   КАРКАС
   ========================================================= */
.topbar {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px clamp(18px, 4vw, 54px);
}
.brand {
  display: flex; align-items: center; gap: 11px; font-family: var(--font-d); position: relative;
  padding: 0; border: 0; background: transparent; cursor: pointer;
}
.brand:focus-visible { outline: 3px solid rgba(183,156,255,.55); outline-offset: 5px; border-radius: 18px; }
.brand__mark {
  width: 218px; height: 83px; color: var(--lav-2);
  display: inline-flex; align-items: center;
  filter: drop-shadow(0 4px 8px rgba(160,120,210,.4));
}
.brand__mark svg { width: 100%; height: 100%; }
.brand__mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.brand__name {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
@keyframes bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-5px)} }

.topbar__right { display: flex; align-items: center; gap: 10px; position: relative; }
.topbar__actions { display: flex; align-items: center; gap: 10px; }
.topbar__menu { display: none; }
.hello {
  font-family: var(--font-d); font-weight: 500; font-size: 15px;
  padding: 9px 18px; border-radius: 999px;
  background: var(--glass-strong); border: 1.5px solid var(--glass-line);
  box-shadow: var(--shadow-soft); color: var(--ink);
  backdrop-filter: blur(10px);
}
.iconbtn {
  width: 44px; height: 44px; flex: 0 0 auto; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--ink);
  background: var(--glass-strong); border: 1.5px solid var(--glass-line);
  box-shadow: var(--shadow-soft); backdrop-filter: blur(10px);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), color .2s, background .2s;
}
.iconbtn:hover { transform: translateY(-2px) scale(1.06); background: #fff; }
.iconbtn:active { transform: scale(.94); }
.iconbtn svg { width: 22px; height: 22px; }
.iconbtn--profile { color: var(--rose-2); }
.iconbtn.is-off { color: #c0b2dd; }
.iconbtn.is-on { color: #f0a020; background: #fff; }
.langbtn {
  font-family: var(--font-d);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0;
}

/* ЛЁГКИЙ РЕЖИМ: убираем дорогие размытия и лишние частицы */
body.lite *,
body.lite *::before,
body.lite *::after { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
body.lite .sky__glow,
body.lite .bubbles,
body.lite .planes,
body.lite .stars { display: none !important; }
body.lite .atmo { transition: none; }
/* чуть плотнее стекло, чтобы текст оставался контрастным без блюра */
body.lite .namebox,
body.lite .page,
body.lite .ending,
body.lite .card,
body.lite .kidcard,
body.lite .profile__hero,
body.lite .stat,
body.lite .collstory,
body.lite .ach,
body.lite .searchbox,
body.lite .hello,
body.lite .kidchip,
body.lite .iconbtn { background: rgba(255, 255, 255, 0.92); }

.stage { position: relative; z-index: 4; }

.screen {
  display: none;
  min-height: calc(100vh - 150px);
  padding: clamp(16px, 4vw, 40px);
  align-items: center; justify-content: center;
}
.screen.is-active { display: flex; animation: screen-in .7s cubic-bezier(.22,1,.36,1) both; }
@keyframes screen-in {
  from { opacity: 0; transform: translateY(26px) scale(.98); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}

.foot {
  position: relative; z-index: 4; text-align: center;
  padding: 26px 16px 34px; color: var(--ink-soft);
  font-size: 13px; letter-spacing: .2px;
}
.foot__heart {
  width: 14px; height: 14px; vertical-align: -2px;
  color: var(--rose-2); margin: 0 1px;
}

/* кнопки */
.btn {
  font-family: var(--font-d); font-weight: 600; cursor: pointer;
  border: none; border-radius: 999px; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s, filter .25s;
}
.btn:active { transform: scale(.95); }

.btn--go {
  padding: 0 26px; height: 60px; font-size: 19px;
  background: linear-gradient(135deg, var(--lav-2), var(--rose-2));
  box-shadow: 0 16px 32px -12px rgba(183,124,255,.75);
}
.btn--go:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 22px 40px -12px rgba(183,124,255,.85); }
.btn--go svg { transition: transform .25s; }
.btn--go:hover svg { transform: translateX(4px); }

.ghostback {
  font-family: var(--font-d); font-weight: 500; font-size: 15px; cursor: pointer;
  color: var(--ink); background: var(--glass); border: 1.5px solid var(--glass-line);
  padding: 9px 18px; border-radius: 999px; backdrop-filter: blur(8px);
  transition: transform .2s, background .2s;
}
.ghostback:hover { transform: translateX(-3px); background: var(--glass-strong); }

/* =========================================================
   ЭКРАН: ПРИВЕТСТВИЕ
   ========================================================= */
.welcome { max-width: 660px; text-align: center; }
.welcome__eyebrow {
  font-family: var(--font-d); font-weight: 500; letter-spacing: 3px;
  text-transform: uppercase; font-size: 13px; color: var(--rose-2);
  margin-bottom: 18px; animation: pop .7s .1s both;
}
.welcome__title {
  font-family: var(--font-d); font-weight: 600;
  font-size: clamp(40px, 8vw, 76px); line-height: 1.08;
  letter-spacing: -1px; color: var(--ink); padding-bottom: 4px;
  animation: pop .8s .18s both;
}
.welcome__title .grad {
  background: linear-gradient(100deg, var(--lav-2), var(--rose-2) 55%, #ff8db0);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.welcome__lead {
  font-size: clamp(16px, 2.4vw, 20px); line-height: 1.6; color: var(--ink-soft);
  max-width: 500px; margin: 22px auto 0; font-weight: 600;
  animation: pop .8s .28s both;
}
@keyframes pop {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

.namebox {
  margin: 40px auto 0; max-width: 520px;
  background: var(--glass-strong); border: 1.5px solid var(--glass-line);
  border-radius: var(--radius); padding: 26px 24px 22px;
  box-shadow: var(--shadow-lift); backdrop-filter: blur(16px);
  animation: pop .8s .36s both;
}
.namebox__label {
  display: block; font-family: var(--font-d); font-weight: 500;
  font-size: 15px; color: var(--ink); margin-bottom: 12px;
}
.namebox__row { display: flex; gap: 12px; }
.namebox__input {
  flex: 1; min-width: 0; height: 60px; padding: 0 22px;
  font-family: var(--font-d); font-size: 19px; color: var(--ink);
  border: 2px solid rgba(183,156,255,.4); border-radius: 999px;
  background: rgba(255,255,255,.85); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.namebox__input::placeholder { color: #c5b6e0; }
.namebox__input:focus {
  border-color: var(--rose-2);
  box-shadow: 0 0 0 5px rgba(255,158,203,.22);
}
.gender { display: flex; gap: 10px; margin-top: 14px; }
.gender__pill {
  flex: 1; cursor: pointer; font-family: var(--font-d); font-weight: 500; font-size: 15px;
  color: var(--ink-soft); padding: 11px 10px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(255,255,255,.6); border: 2px solid rgba(183,156,255,.3);
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), border-color .2s, color .2s, background .2s;
}
.gender__pill .gi { display: inline-flex; width: 20px; height: 20px; }
.gender__pill .gi svg { width: 100%; height: 100%; }
.gender__pill[data-g="f"] .gi { color: var(--rose-2); }
.gender__pill[data-g="m"] .gi { color: var(--lav-2); }
.gender__pill:hover { transform: translateY(-2px); }
.gender__pill.is-on {
  color: var(--ink); background: #fff; border-color: var(--rose-2);
  box-shadow: 0 10px 22px -12px rgba(255,158,203,.7);
}

.namebox__hint {
  min-height: 18px; margin-top: 12px; font-size: 14px; font-weight: 700;
  color: var(--rose-2); transition: opacity .2s;
}

.welcome__feats {
  list-style: none; display: flex; flex-wrap: wrap; gap: 12px;
  justify-content: center; margin-top: 30px; animation: pop .8s .46s both;
}
.welcome__feats li {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-d); font-weight: 500; font-size: 14px; color: var(--ink);
  padding: 9px 16px; border-radius: 999px;
  background: var(--glass); border: 1.5px solid var(--glass-line);
}
.welcome__feats .fi { display: inline-flex; width: 19px; height: 19px; color: var(--rose-2); }
.welcome__feats .fi svg { width: 100%; height: 100%; }

/* =========================================================
   ЭКРАН: БИБЛИОТЕКА
   ========================================================= */
.screen--library { flex-direction: column; }
.library__head { text-align: center; margin-bottom: 38px; padding-top: 12px; }
.ghostback { align-self: flex-start; }
.library__head .ghostback { margin-bottom: 16px; }
.library__title {
  font-family: var(--font-d); font-weight: 600; line-height: 1.16;
  font-size: clamp(28px, 5vw, 46px); color: var(--ink); letter-spacing: -.5px;
  padding: 4px 0;
}
.library__title span {
  background: linear-gradient(100deg, var(--lav-2), var(--rose-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.library__sub { margin-top: 10px; color: var(--ink-soft); font-weight: 600; font-size: 17px; }

.cards {
  display: grid; gap: 24px; width: 100%; max-width: 1040px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
  position: relative; cursor: pointer; text-align: left;
  display: flex; flex-direction: column;
  border: none; border-radius: var(--radius); overflow: hidden;
  padding: 0; background: var(--glass-strong);
  border: 1.5px solid var(--glass-line);
  box-shadow: var(--shadow-soft); backdrop-filter: blur(12px);
  transition: transform .35s cubic-bezier(.22,1,.36,1), box-shadow .35s;
  animation: card-in .7s both;
}
.card:hover { transform: translateY(-10px) rotate(-.6deg); box-shadow: var(--shadow-lift); }
@keyframes card-in {
  from { opacity: 0; transform: translateY(30px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
.card__cover {
  height: 172px; position: relative; overflow: hidden;
  display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: stretch; flex: 0 0 auto;
  isolation: isolate;
}
.card__cover::after { /* блик стекла */
  content: ''; position: absolute; inset: 0;
  z-index: 2; pointer-events: none;
  background: radial-gradient(120% 80% at 20% 0%, rgba(255,255,255,.55), transparent 55%);
}
.card__art {
  grid-area: 1 / 1; place-self: center;
  width: 138px; height: 138px; display: block; z-index: 1;
  transition: transform .4s cubic-bezier(.34,1.56,.64,1);
}
.card__art svg { width: 100%; height: 100%; display: block; }
.card:hover .card__art { transform: scale(1.12) rotate(-5deg); }
.card__image {
  position: relative; grid-area: 1 / 1; z-index: 1;
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .55s cubic-bezier(.22,1,.36,1), filter .3s;
}
.card:hover .card__image { transform: scale(1.06); }
.card__body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.card__kicker {
  font-family: var(--font-d); font-weight: 500; font-size: 12px;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--rose-2);
}
.card__title {
  font-family: var(--font-d); font-weight: 600; font-size: 25px; line-height: 1.12;
  color: var(--ink); margin: 5px 0 8px; min-height: 2.24em;
  display: flex; align-items: flex-start;
}
.card__blurb { color: var(--ink-soft); font-weight: 600; font-size: 14.5px; line-height: 1.5; }
.card__go {
  display: inline-flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 16px;
  font-family: var(--font-d); font-weight: 600; font-size: 15px; color: var(--ink);
}
.card__go svg { transition: transform .25s; }
.card:hover .card__go svg { transform: translateX(5px); }

/* =========================================================
   БЫТОВАЯ ЗАЩИТА КОНТЕНТА
   ========================================================= */
.page,
.scene,
.card__cover,
.contcard__cover,
.collstory__cover {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.page img,
.scene img,
.card__cover img,
.contcard__cover img,
.collstory__cover img {
  -webkit-user-drag: none;
  user-drag: none;
}

.page > * { position: relative; z-index: 1; }

/* =========================================================
   ЭКРАН: ЧТЕНИЕ
   ========================================================= */
.reader { width: 100%; max-width: 720px; }
.reader__bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.reader__dots { display: inline-flex; gap: 7px; align-items: center; }
.reader__dots i {
  width: 9px; height: 9px; border-radius: 50%;
  background: rgba(183,156,255,.35); transition: all .3s;
}
.reader__dots i.on {
  background: linear-gradient(135deg, var(--lav-2), var(--rose-2));
  transform: scale(1.25); box-shadow: 0 0 0 4px rgba(255,158,203,.18);
}

.page {
  position: relative;
  background: var(--glass-strong); border: 1.5px solid var(--glass-line);
  border-radius: var(--radius); padding: clamp(26px, 5vw, 46px);
  box-shadow: var(--shadow-lift); backdrop-filter: blur(16px);
}
.page__emoji {
  display: flex; justify-content: center; margin-bottom: 10px;
  animation: bob 4.5s ease-in-out infinite;
}
.page__emoji svg { width: 104px; height: 104px; display: block; }
.page__text p {
  font-size: clamp(17px, 2.5vw, 21px); line-height: 1.72;
  color: var(--ink); font-weight: 600; text-align: center;
  margin-bottom: 16px;
}
.page__text p .name-hl {
  font-family: var(--font-d); font-weight: 600;
  color: var(--rose-2);
  display: inline-block;
  border-radius: 12px;
  padding: 0 3px;
  transition: color .25s ease, background .25s ease, transform .25s ease;
}
.name-hl--swap {
  animation: name-swap .68s cubic-bezier(.22,1,.36,1);
}
@keyframes name-swap {
  0% {
    transform: translateY(4px) scale(.96);
    color: var(--lav-2);
    background: rgba(255,255,255,.72);
    box-shadow: 0 0 0 0 rgba(255,158,203,.28);
  }
  48% {
    transform: translateY(-2px) scale(1.08);
    color: var(--rose-2);
    background: rgba(255,255,255,.9);
    box-shadow: 0 0 0 10px rgba(255,158,203,.16);
  }
  100% {
    transform: none;
    background: transparent;
    box-shadow: 0 0 0 0 rgba(255,158,203,0);
  }
}
/* появление абзацев */
.page__text p { opacity: 0; transform: translateY(12px); animation: para-in .6s forwards; }

@keyframes para-in { to { opacity: 1; transform: none; } }

.page__choices { display: grid; gap: 13px; margin-top: 28px; }
.choice {
  font-family: var(--font-d); font-weight: 500; font-size: 17.5px;
  cursor: pointer; text-align: left; color: var(--ink);
  padding: 16px 20px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.7);
  border: 2px solid rgba(183,156,255,.32);
  display: flex; align-items: center; gap: 13px;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), border-color .25s, background .25s, box-shadow .25s;
  opacity: 0; transform: translateY(14px); animation: para-in .55s forwards;
}
.choice:hover {
  transform: translateY(-3px) scale(1.015);
  border-color: var(--rose-2);
  background: #fff;
  box-shadow: 0 16px 30px -16px rgba(183,124,255,.6);
}
.choice:active { transform: scale(.98); }
.choice__mk {
  flex: 0 0 auto; width: 27px; height: 27px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--lav-2); transition: transform .35s cubic-bezier(.34,1.56,.64,1), color .3s;
}
.choice__mk svg { width: 100%; height: 100%; }
.choice__tx { flex: 1; }
.choice:hover .choice__mk { color: var(--rose-2); transform: rotate(90deg) scale(1.12); }
.choice--final { justify-content: center; }
.choice--final .choice__tx { flex: 0 0 auto; }
.choice--final .choice__mk { color: var(--rose-2); }

/* =========================================================
   ЭКРАН: КОНЦОВКА
   ========================================================= */
.ending {
  position: relative; text-align: center; max-width: 540px;
  background: var(--glass-strong); border: 1.5px solid var(--glass-line);
  border-radius: var(--radius); padding: clamp(34px, 6vw, 56px) clamp(24px, 5vw, 48px);
  box-shadow: var(--shadow-lift); backdrop-filter: blur(16px); overflow: hidden;
}
.ending__burst { position: absolute; inset: 0; pointer-events: none; }
.ending__badge {
  width: 164px; height: 164px; margin: 0 auto;
  animation: badge-in 1s cubic-bezier(.34,1.56,.64,1) both;
}
.ending__badge .sticker3d { width: 100%; height: 100%; }
@keyframes badge-in {
  0%   { opacity: 0; transform: scale(.2) rotate(-40deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
.ending__title {
  font-family: var(--font-d); font-weight: 600;
  font-size: clamp(28px, 6vw, 42px); color: var(--ink);
  margin: 16px 0 6px; animation: pop .7s .2s both;
}
.ending__sub {
  font-family: var(--font-d); font-weight: 500; font-size: 19px;
  color: var(--rose-2); margin-bottom: 30px; animation: pop .7s .3s both;
}
.reflection {
  margin: 22px auto 24px;
  text-align: left;
  animation: pop .7s .35s both;
  transform-origin: center top;
}
.reflection.is-done {
  pointer-events: none;
  overflow: hidden;
  animation: reflection-done .62s cubic-bezier(.22,1,.36,1) forwards;
}
@keyframes reflection-done {
  0% {
    opacity: 1;
    max-height: 520px;
    margin-top: 22px;
    margin-bottom: 24px;
    transform: translateY(0) scale(1);
  }
  45% {
    opacity: 0;
    transform: translateY(-10px) scale(.98);
  }
  100% {
    opacity: 0;
    max-height: 0;
    margin-top: 0;
    margin-bottom: 0;
    transform: translateY(-12px) scale(.98);
  }
}
.reflection__step {
  width: fit-content;
  margin: 0 auto 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.68);
  border: 1.5px solid rgba(183,156,255,.28);
  color: var(--rose-2);
  font-family: var(--font-d);
  font-weight: 800;
  font-size: 12.5px;
}
.reflection__lead {
  text-align: center;
  color: var(--ink);
  font-family: var(--font-d);
  font-weight: 800;
  font-size: 18px;
  line-height: 1.35;
  margin-bottom: 12px;
}
.reflection__text {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  border: 2px solid rgba(183,156,255,.25);
  border-radius: 16px;
  background: rgba(255,255,255,.82);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.45;
  padding: 13px 14px;
  outline: none;
}
.reflection__text:focus {
  border-color: var(--rose-2);
  box-shadow: 0 0 0 4px rgba(255,158,203,.18);
}
.reflection__actions {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}
.reflection__record {
  position: relative;
  width: 100%;
  min-height: 46px;
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff8fbc, #ffc39b);
  color: #fff;
  font-family: var(--font-d);
  font-weight: 800;
  font-size: 15px;
  padding: 11px 18px 11px 48px;
  box-shadow: 0 16px 28px -18px rgba(255,129,168,.9);
  overflow: hidden;
  transition: transform .2s, filter .2s, box-shadow .2s;
}
.reflection__record::before {
  content: '●';
  position: absolute;
  left: 15px;
  top: 50%;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: rgba(255,255,255,.26);
  color: #fff;
  font-size: 10px;
  line-height: 23px;
  text-align: center;
  transform: translateY(-50%);
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.38);
}
.reflection__record::after {
  display: none;
}
.reflection__record:hover {
  transform: translateY(-2px);
  filter: saturate(1.04);
  box-shadow: 0 20px 32px -20px rgba(255,129,168,.95);
}
.reflection__record:disabled {
  cursor: wait;
  opacity: .76;
  transform: none;
}
.reflection__record.is-recording {
  color: #fff;
  background: linear-gradient(135deg, #ff6b9f, #ff9c6b);
  animation: record-pulse 1.45s ease-in-out infinite;
}
.reflection__record.is-recording::before {
  background: rgba(255,255,255,.95);
  color: #ff6b9f;
  box-shadow: 0 0 0 8px rgba(255,255,255,.18);
}
@keyframes record-pulse {
  0%, 100% { box-shadow: 0 12px 24px -18px rgba(255,107,159,.8), 0 0 0 0 rgba(255,107,159,.0); }
  50% { box-shadow: 0 18px 30px -18px rgba(255,107,159,.95), 0 0 0 7px rgba(255,107,159,.12); }
}
.reflection__status {
  min-height: 18px;
  color: var(--ink-soft);
  font-family: var(--font-d);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
.reflection__cloud {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-radius: 28px 28px 22px 22px;
  background: rgba(255,255,255,.78);
  border: 1.5px solid rgba(183,156,255,.28);
  box-shadow: var(--shadow-soft);
}
.reflection__cloud[hidden] { display: none !important; }
.reflection__cloud::before,
.reflection__cloud::after {
  content: '';
  position: absolute;
  top: -8px;
  border-radius: 50%;
  background: inherit;
  border-top: 1.5px solid rgba(183,156,255,.20);
}
.reflection__cloud::before { left: 22px; width: 34px; height: 24px; }
.reflection__cloud::after { left: 48px; width: 44px; height: 32px; }
.reflection__cloudic {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--lav-2), var(--rose-2));
  color: #fff;
  font-family: var(--font-d);
  font-weight: 800;
}
.reflection__play {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  cursor: pointer;
  border: 0;
  border-radius: 50%;
  background: rgba(183,156,255,.18);
  color: var(--lav-2);
  font-family: var(--font-d);
  font-weight: 900;
  font-size: 14px;
  display: grid;
  place-items: center;
}
.reflection__sound {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-width: 0;
}
.reflection__soundtitle {
  display: block;
  color: var(--ink);
  font-family: var(--font-d);
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 6px;
}
.reflection__bar {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(183,156,255,.18);
}
.reflection__bar i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #57c6c0, var(--rose-2));
}
.reflection__time {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-family: var(--font-d);
  font-size: 12px;
  font-weight: 800;
}
.reflection__audio {
  display: none;
}
.reflectionitem__audio {
  width: 100%;
  display: block;
  margin: 10px 0;
}
.btn--save-reflection {
  width: 100%;
  min-height: 48px;
  font-size: 15px;
  background: linear-gradient(135deg, #57c6c0, #b79cff);
}
.ending__btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  animation: pop .7s .4s both; }
.btn--again {
  padding: 0 26px; height: 56px; font-size: 17px;
  background: linear-gradient(135deg, var(--lav-2), var(--rose-2));
  box-shadow: 0 16px 30px -14px rgba(183,124,255,.7);
}
.btn--again:hover { transform: translateY(-3px) scale(1.03); }
.btn--lib {
  padding: 0 26px; height: 56px; font-size: 17px; color: var(--ink);
  background: rgba(255,255,255,.8); border: 2px solid rgba(183,156,255,.4);
}
.btn--lib:hover { transform: translateY(-3px) scale(1.03); background: #fff; }

/* конфетти */
.confetti {
  position: absolute; top: -10px; width: 11px; height: 11px; border-radius: 3px;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0%   { transform: translateY(-20px) rotate(0); opacity: 1; }
  100% { transform: translateY(120vh) rotate(720deg); opacity: 0; }
}

/* =========================================================
   ПЛЕЕР ОЗВУЧКИ
   ========================================================= */
.voicebar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.voicebtn {
  font-family: var(--font-d); font-weight: 500; font-size: 15px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 9px; color: #fff;
  padding: 11px 20px 11px 16px; border-radius: 999px; border: none;
  background: linear-gradient(135deg, var(--lav-2), var(--rose-2));
  box-shadow: 0 12px 24px -12px rgba(183,124,255,.7);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s, filter .2s;
}
.voicebtn:hover { transform: translateY(-2px); }
.voicebtn:active { transform: scale(.96); }
.voicebtn.is-playing { background: linear-gradient(135deg, #ff9ecb, #ffb15a); }
.voicebtn__ic { display: inline-flex; width: 20px; height: 20px; }
.voicebtn__ic svg { width: 100%; height: 100%; }

.voicestop {
  min-height: 38px; flex: 0 0 auto; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 8px 12px 8px 10px;
  border-radius: 999px; color: var(--rose-2);
  font-family: var(--font-d); font-weight: 500; font-size: 13px;
  background: var(--glass-strong); border: 1.5px solid var(--glass-line);
  box-shadow: var(--shadow-soft); backdrop-filter: blur(10px);
  transition: transform .2s, background .2s, color .2s;
}
.voicestop:hover { transform: translateY(-2px); background: #fff; color: var(--ink); }
.voicestop:active { transform: scale(.94); }
.voicestop__ic { display: inline-flex; width: 16px; height: 16px; }
.voicestop svg { width: 100%; height: 100%; }
.voicestop[hidden],
.chipbtn[hidden] { display: none !important; }

.learnbtn {
  min-height: 38px; flex: 0 0 auto; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; padding: 8px 13px 8px 10px;
  border-radius: 999px; color: var(--ink);
  font-family: var(--font-d); font-weight: 600; font-size: 13px;
  background: var(--glass); border: 1.5px solid var(--glass-line);
  box-shadow: var(--shadow-soft);
  transition: transform .2s, background .2s, color .2s, border-color .2s;
}
.learnbtn:hover { transform: translateY(-2px); background: var(--glass-strong); }
.learnbtn.is-on {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, #57c6c0, #b79cff);
}
.learnbtn__ic {
  width: 22px; height: 22px; display: grid; place-items: center;
  border-radius: 50%; background: rgba(255,255,255,.72); color: var(--lav-2);
  font-family: var(--font-d); font-size: 13px; font-weight: 800;
}
.learnbtn.is-on .learnbtn__ic { color: #1f8f88; }

.chipbtn {
  font-family: var(--font-d); font-weight: 500; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; color: var(--ink);
  padding: 10px 15px; border-radius: 999px;
  background: var(--glass); border: 1.5px solid var(--glass-line);
  transition: transform .2s, background .2s;
}
.chipbtn:hover { transform: translateY(-2px); background: var(--glass-strong); }
.chipbtn__ic { display: inline-flex; width: 17px; height: 17px; color: var(--lav-2); }
.chipbtn__ic svg { width: 100%; height: 100%; }

.autoread {
  font-family: var(--font-d); font-weight: 500; font-size: 14px; color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 9px 15px; border-radius: 999px;
  background: var(--glass); border: 1.5px solid var(--glass-line); user-select: none;
}
.autoread input { width: 17px; height: 17px; accent-color: var(--rose-2); cursor: pointer; }
.voicebar.is-unsupported { display: none; }

/* подсветка читаемого абзаца */
.page__text p.reading {
  color: #4a3a78;
}
.page__text p.reading::after {
  content: ''; position: absolute;
}
.page__text p { position: relative; transition: color .3s; border-radius: 12px; }
.page__text p.reading {
  background: linear-gradient(90deg, rgba(255,196,225,.0), rgba(255,196,225,.35), rgba(255,196,225,.0));
  box-shadow: 0 0 0 8px rgba(255,196,225,.10);
}

.page__text p.is-learning-text,
.choice__tx.is-learning-text {
  word-spacing: .12em;
}
.syllable {
  display: inline-block;
  white-space: nowrap;
  border-radius: 7px;
  padding: 0 .02em;
}
.syllable__dash {
  color: rgba(117,91,170,.46);
  font-weight: 800;
  padding: 0 .03em;
}
.syllable__letter {
  display: inline-block;
  border-radius: .32em;
  padding: 0 .01em;
}
.syllable__letter--vowel {
  color: #e45388;
  font-weight: 800;
}
.syllable__letter--consonant {
  color: #4269b9;
  font-weight: 700;
}
.syllable__letter--soft {
  color: #159f86;
  font-weight: 800;
  box-shadow: inset 0 -0.18em rgba(116, 216, 190, .32);
}
.syllable__letter--sign {
  color: #9d8fc0;
  font-weight: 800;
}

/* =========================================================
   ЛИЧНЫЙ КАБИНЕТ
   ========================================================= */
.screen--profile { flex-direction: column; align-items: stretch; }
.profile { width: 100%; max-width: 860px; margin: 0 auto; }
.profile .ghostback { margin-bottom: 18px; }

.profile__hero {
  display: flex; align-items: center; gap: 20px; margin-bottom: 26px;
  background: var(--glass-strong); border: 1.5px solid var(--glass-line);
  border-radius: var(--radius); padding: 22px 26px;
  box-shadow: var(--shadow-soft); backdrop-filter: blur(14px);
}
.profile__ava {
  width: 84px; height: 84px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(150deg, #e7dcff, #ffd9ec);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.7), var(--shadow-soft);
}
.profile__ava svg { width: 66px; height: 66px; }
.profile__ava img { width: 100%; height: 100%; display: block; border-radius: 50%; object-fit: cover; }
.profile__name {
  font-family: var(--font-d); font-weight: 600; font-size: clamp(26px, 5vw, 38px);
  color: var(--ink); line-height: 1.1;
}
.profile__role { font-family: var(--font-d); font-weight: 500; color: var(--rose-2); font-size: 16px; margin-top: 2px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 30px; }
.stat {
  background: var(--glass-strong); border: 1.5px solid var(--glass-line);
  border-radius: var(--radius-sm); padding: 18px 16px; text-align: center;
  box-shadow: var(--shadow-soft); backdrop-filter: blur(10px);
}
.stat__num {
  font-family: var(--font-d); font-weight: 700; font-size: 32px; line-height: 1;
  background: linear-gradient(135deg, var(--lav-2), var(--rose-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.stat__lbl { font-family: var(--font-d); font-weight: 500; color: var(--ink-soft); font-size: 13.5px; margin-top: 6px; }
.stat__bar { height: 7px; border-radius: 999px; background: rgba(183,156,255,.22); margin-top: 12px; overflow: hidden; }
.stat__fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--lav-2), var(--rose-2)); transition: width .8s cubic-bezier(.22,1,.36,1); }

.profile__h {
  font-family: var(--font-d); font-weight: 600; font-size: 22px; color: var(--ink);
  margin: 6px 0 16px;
}

/* коллекция концовок */
.collection { display: grid; gap: 22px; margin-bottom: 34px; }
.collstory {
  background: var(--glass-strong); border: 1.5px solid var(--glass-line);
  border-radius: var(--radius); padding: 18px 20px 22px;
  box-shadow: var(--shadow-soft); backdrop-filter: blur(10px);
}
.collstory__top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.collstory__cover {
  width: 86px; height: 58px; flex: 0 0 auto; overflow: hidden;
  border-radius: 14px; border: 1.5px solid rgba(255,255,255,.75);
  box-shadow: 0 10px 22px -18px rgba(70,46,120,.7);
}
.collstory__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.collstory__meta { flex: 1; min-width: 0; display: grid; gap: 5px; }
.collstory__name { font-family: var(--font-d); font-weight: 700; font-size: 18px; color: var(--ink); }
.collstory__sub { font-family: var(--font-d); font-weight: 600; font-size: 13px; color: var(--ink-soft); }
.collstory__bar { height: 7px; border-radius: 999px; background: rgba(183,156,255,.18); overflow: hidden; }
.collstory__bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--lav-2), var(--rose-2)); }
.collstory__count {
  font-family: var(--font-d); font-weight: 600; font-size: 14px; color: var(--rose-2);
  padding: 5px 12px; border-radius: 999px; background: rgba(255,158,203,.14);
}
.collstory__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); gap: 12px; }
.endcard {
  width: 100%; font: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  min-height: 142px; padding: 16px 12px; border-radius: var(--radius-sm);
  border: 1.5px dashed rgba(183,156,255,.4); background: rgba(255,255,255,.4);
  transition: transform .25s;
}
.endcard.is-open { border-style: solid; border-color: rgba(255,158,203,.5); background: linear-gradient(180deg, #fff, rgba(255,244,250,.96)); box-shadow: 0 12px 26px -18px rgba(183,124,255,.6); }
.endcard.is-open:hover { transform: translateY(-4px); }
.endcard:focus-visible { outline: 3px solid rgba(183,124,255,.55); outline-offset: 3px; }
.endcard__ic { width: 52px; height: 52px; display: grid; place-items: center; color: #c7b8e6; }
.endcard__ic svg { width: 100%; height: 100%; }
.endcard.is-open .endcard__ic { width: 92px; height: 92px; color: var(--rose-2); }
.endcard__name { font-family: var(--font-d); font-weight: 700; font-size: 13.5px; color: var(--ink); }
.endcard__state { margin-top: auto; font-family: var(--font-d); font-weight: 600; font-size: 12px; color: var(--ink-soft); }
.endcard:not(.is-open) .endcard__name { color: #b3a4d4; }

/* объёмные коллекционные стикеры */
.sticker3d { --rx: -7deg; --ry: 0deg; position: relative; width: 100%; height: 100%; display: block; perspective: 700px; cursor: grab; touch-action: none; user-select: none; outline: none; -webkit-tap-highlight-color: transparent; }
.sticker3d:focus-visible { filter: drop-shadow(0 0 0.35rem rgba(183,124,255,.65)); }
.sticker3d.is-dragging { cursor: grabbing; }
.sticker3d__body { position: absolute; inset: 2%; transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(var(--ry)) rotateZ(var(--sticker-turn)); transition: transform .18s ease-out; will-change: transform; }
.sticker3d.is-dragging .sticker3d__body { transition: none; }
.sticker3d__face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; border: 4px solid #fff; border-radius: 42% 48% 44% 50% / 46% 42% 52% 45%; box-shadow: 0 13px 18px -11px rgba(55,32,94,.55), inset 0 2px 3px rgba(255,255,255,.82); }
.sticker3d__front { transform: translateZ(3px); background: radial-gradient(circle at 32% 22%, #fff 0 3%, transparent 4%), linear-gradient(145deg, color-mix(in srgb, var(--sticker-accent) 38%, white), #fff0f7 72%); }
.sticker3d__front::after { content: ''; position: absolute; inset: 5px; z-index: -1; border-radius: inherit; border: 1px solid color-mix(in srgb, var(--sticker-accent) 42%, transparent); }
.sticker3d__shine { position: absolute; inset: -35%; pointer-events: none; background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.7) 48%, transparent 57%); transform: translateX(-28%) rotate(8deg); mix-blend-mode: screen; }
.sticker3d__symbol { font-size: 32px; line-height: 1; filter: drop-shadow(0 4px 3px rgba(85,53,116,.18)); }
.sticker3d__title { max-width: 78%; margin-top: 5px; font-family: var(--font-d); font-size: 9px; line-height: 1.05; font-weight: 800; color: var(--ink); }
.sticker3d__story { max-width: 76%; margin-top: 3px; font-family: var(--font-d); font-size: 6px; line-height: 1; color: var(--ink-soft); }
.sticker3d__back { transform: rotateY(180deg) translateZ(3px); color: rgba(69,63,83,.7); background: linear-gradient(135deg, #fbfbff 0%, #bfc2cc 34%, #fff 52%, #aaaeba 72%, #f8f8fb 100%); box-shadow: 0 13px 18px -11px rgba(55,32,94,.55), inset 0 0 0 1px rgba(255,255,255,.65); }
.sticker3d__mirror { position: absolute; inset: 0; background: repeating-linear-gradient(112deg, transparent 0 9px, rgba(255,255,255,.23) 10px 11px); }
.sticker3d__cloud { position: relative; font-size: 24px; text-shadow: 0 1px rgba(255,255,255,.8); }
.sticker3d__backname { position: relative; margin-top: 2px; font-family: var(--font-d); font-size: 7px; font-weight: 800; letter-spacing: .03em; }
.sticker3d--large .sticker3d__face { border-width: 7px; box-shadow: 0 24px 32px -18px rgba(55,32,94,.65), inset 0 3px 5px rgba(255,255,255,.9); }
.sticker3d--large .sticker3d__symbol { font-size: 56px; }
.sticker3d--large .sticker3d__title { margin-top: 8px; font-size: 14px; }
.sticker3d--large .sticker3d__story { margin-top: 5px; font-size: 9px; }
.sticker3d--large .sticker3d__cloud { font-size: 42px; }
.sticker3d--large .sticker3d__backname { font-size: 11px; }
@media (prefers-reduced-motion: reduce) { .sticker3d__body { transition: none; } }

/* достижения */
.achievements { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; padding-bottom: 12px; }
.ach {
  width: 100%; text-align: left; font: inherit; cursor: pointer;
  display: flex; align-items: center; gap: 14px;
  background: var(--glass-strong); border: 1.5px solid var(--glass-line);
  border-radius: var(--radius-sm); padding: 16px 18px;
  box-shadow: var(--shadow-soft); backdrop-filter: blur(10px);
  opacity: .55; filter: grayscale(.5); transition: opacity .3s, filter .3s, transform .25s;
}
.ach.is-open { opacity: 1; filter: none; }
.ach.is-open:hover { transform: translateY(-3px); }
.ach:focus-visible { outline: 3px solid rgba(183,124,255,.55); outline-offset: 3px; }
.ach__ic {
  width: 58px; height: 58px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: transparent;
}
.ach:not(.is-open) .ach__ic { background: transparent; }
.ach__ic svg { width: 26px; height: 26px; }
.ach__ic img { width: 58px; height: 58px; display: block; border-radius: 50%; object-fit: cover; }
.ach__title { font-family: var(--font-d); font-weight: 600; font-size: 15.5px; color: var(--ink); }
.ach__desc { font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-top: 2px; line-height: 1.35; }

.reflections {
  display: grid;
  gap: 12px;
  margin-bottom: 28px;
}
.reflectionempty {
  color: var(--ink-soft);
  font-family: var(--font-d);
  font-weight: 700;
  text-align: center;
  padding: 20px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.58);
  border: 1.5px dashed rgba(183,156,255,.35);
}
.reflectionitem {
  text-align: left;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.72);
  border: 1.5px solid var(--glass-line);
  padding: 15px 16px;
  box-shadow: var(--shadow-soft);
}
.reflectionitem__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.reflectionitem__story {
  font-family: var(--font-d);
  font-weight: 800;
  color: var(--ink);
}
.reflectionitem__date {
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-family: var(--font-d);
  font-size: 12px;
  font-weight: 700;
}
.reflectionitem__badge {
  color: var(--rose-2);
  font-family: var(--font-d);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
}
.reflectionitem__q {
  color: var(--ink-soft);
  font-weight: 800;
  font-size: 13.5px;
}
.reflectionitem__answer + .reflectionitem__answer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1.5px dashed rgba(183,156,255,.28);
}
.reflectionitem__text {
  margin-top: 8px;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.5;
}

/* плашка «новая концовка» */
.ending__new {
  display: inline-block; margin: 0 auto 14px;
  font-family: var(--font-d); font-weight: 600; font-size: 14px; color: #fff;
  padding: 8px 18px; border-radius: 999px;
  background: linear-gradient(135deg, #ff9ecb, #ffb15a);
  box-shadow: 0 12px 24px -12px rgba(255,140,90,.7);
  animation: newpop .6s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes newpop { 0% { opacity: 0; transform: scale(.6) translateY(-6px); } 100% { opacity: 1; transform: none; } }

/* бейдж прогресса на карточке сказки */
.card__progress {
  position: absolute; top: 14px; right: 14px; z-index: 4;
  font-family: var(--font-d); font-weight: 600; font-size: 12.5px; color: var(--ink);
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px; border-radius: 999px;
  background: rgba(255,255,255,.85); border: 1.5px solid var(--glass-line);
  box-shadow: var(--shadow-soft); backdrop-filter: blur(6px);
}
.card__progress svg { width: 14px; height: 14px; color: var(--rose-2); }

/* =========================================================
   ПРОФИЛИ + БИБЛИОТЕКА 2.0
   ========================================================= */
/* чип активного ребёнка в шапке */
.kidchip {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: var(--font-d); font-weight: 600; font-size: 14px; color: var(--ink);
  padding: 5px 13px 5px 5px; border-radius: 999px;
  background: var(--glass-strong); border: 1.5px solid var(--glass-line);
  box-shadow: var(--shadow-soft); backdrop-filter: blur(10px);
  transition: transform .2s, background .2s;
}
.kidchip:hover { transform: translateY(-2px); background: #fff; }
.kidchip__ava { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(150deg, #e7dcff, #ffd9ec); flex: 0 0 auto; }
.kidchip__ava svg { width: 24px; height: 24px; }
.kidchip__ava img { width: 100%; height: 100%; display: block; border-radius: 50%; object-fit: cover; }
.kidchip__swap { width: 15px; height: 15px; color: var(--ink-soft); display: inline-flex; }
.kidchip__swap svg { width: 100%; height: 100%; }

/* экран «кто читает» */
.kids { text-align: center; max-width: 780px; }
.kids__title { font-family: var(--font-d); font-weight: 600; font-size: clamp(32px, 6vw, 54px);
  color: var(--ink); margin-bottom: 34px; letter-spacing: -.5px; }
.kids__title .grad { background: linear-gradient(100deg, var(--lav-2), var(--rose-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.kids__grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; }
.kidcard { width: 162px; cursor: pointer; text-align: center;
  background: var(--glass-strong); border: 1.5px solid var(--glass-line); border-radius: var(--radius);
  padding: 22px 16px; box-shadow: var(--shadow-soft); backdrop-filter: blur(12px);
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .3s; animation: card-in .6s both; }
.kidcard:hover { transform: translateY(-8px) scale(1.03); box-shadow: var(--shadow-lift); }
.kidcard__ava { width: 90px; height: 90px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(150deg, #e7dcff, #ffd9ec); box-shadow: inset 0 0 0 3px rgba(255,255,255,.7); }
.kidcard__ava svg { width: 70px; height: 70px; }
.kidcard__ava img { width: 100%; height: 100%; display: block; border-radius: 50%; object-fit: cover; }
.kidcard__name { font-family: var(--font-d); font-weight: 600; font-size: 20px; color: var(--ink); }
.kidcard__age { font-family: var(--font-d); font-weight: 500; font-size: 13px; color: var(--rose-2); }
.kidcard--add { border-style: dashed; border-color: rgba(183,156,255,.5); }
.kidcard--add .kidcard__ava { background: rgba(255,255,255,.5); color: var(--lav-2); }
.kidcard--add .kidcard__ava svg { width: 40px; height: 40px; }

/* форма регистрации */
.namebox--reg { text-align: left; max-width: 480px; }
.namebox__input--full { width: 100%; }
.reg__field { margin-top: 18px; }
.reg__lbl { display: block; font-family: var(--font-d); font-weight: 500; font-size: 14px;
  color: var(--ink-soft); margin-bottom: 9px; }
.agepick { display: flex; gap: 10px; }
.agechip { flex: 1; cursor: pointer; font-family: var(--font-d); font-weight: 600; font-size: 15px;
  color: var(--ink-soft); padding: 11px 8px; border-radius: 999px;
  background: rgba(255,255,255,.6); border: 2px solid rgba(183,156,255,.3);
  transition: transform .2s, border-color .2s, color .2s, background .2s; }
.agechip:hover { transform: translateY(-2px); }
.agechip.is-on { color: var(--ink); background: #fff; border-color: var(--rose-2);
  box-shadow: 0 10px 22px -12px rgba(255,158,203,.7); }
.avapick { display: flex; gap: 12px; }
.ava { flex: 1; cursor: pointer; border: 2px solid rgba(183,156,255,.3); background: rgba(255,255,255,.55);
  border-radius: var(--radius-sm); padding: 10px; display: grid; place-items: center;
  transition: transform .2s, border-color .2s, background .2s; }
.ava svg { width: 54px; height: 54px; }
.ava:hover { transform: translateY(-3px); }
.ava.is-on { border-color: var(--rose-2); background: #fff; box-shadow: 0 12px 24px -14px rgba(183,124,255,.6); }
.btn--block { width: 100%; margin-top: 22px; }
.linkback { display: block; margin: 14px auto 0; background: none; border: none; cursor: pointer;
  font-family: var(--font-d); font-weight: 600; font-size: 14px; color: var(--ink-soft); }
.linkback:hover { color: var(--rose-2); }

/* подшапка библиотеки: поиск + фильтры */
.libbar { width: 100%; max-width: 1080px; margin: 0 auto 14px; display: flex; gap: 14px;
  align-items: center; flex-wrap: wrap; }
.searchbox { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 10px;
  padding: 0 16px; height: 48px; border-radius: 999px;
  background: var(--glass-strong); border: 1.5px solid var(--glass-line);
  box-shadow: var(--shadow-soft); backdrop-filter: blur(10px); }
.searchbox__ic { width: 18px; height: 18px; color: var(--ink-soft); display: inline-flex; flex: 0 0 auto; }
.searchbox__ic svg { width: 100%; height: 100%; }
.searchbox input { flex: 1; min-width: 0; border: none; background: none; outline: none;
  font-family: var(--font-b); font-weight: 600; font-size: 15px; color: var(--ink); }
.searchbox input::placeholder { color: #b9a9dd; }
.ages { display: flex; gap: 6px; flex-wrap: wrap; }
.agetab { cursor: pointer; font-family: var(--font-d); font-weight: 600; font-size: 14px;
  color: var(--ink-soft); padding: 10px 14px; border-radius: 999px;
  background: var(--glass); border: 1.5px solid var(--glass-line);
  transition: transform .2s, color .2s, background .2s; }
.agetab:hover { transform: translateY(-2px); }
.agetab.is-on { color: #fff; background: linear-gradient(135deg, var(--lav-2), var(--rose-2)); border-color: transparent; }

.cats { width: 100%; max-width: 1080px; margin: 0 auto 24px; display: flex; gap: 10px; flex-wrap: wrap; }
.cattab { cursor: pointer; font-family: var(--font-d); font-weight: 600; font-size: 14px; color: var(--ink);
  padding: 9px 18px; border-radius: 999px; background: var(--glass-strong);
  border: 1.5px solid var(--glass-line); transition: transform .2s, background .2s; }
.cattab:hover { transform: translateY(-2px); }
.cattab.is-on { color: #fff; background: linear-gradient(135deg, #ff9ecb, #b79cff); border-color: transparent; }

/* UX v2: левое меню библиотеки */
body.ux-v2 .libbar,
body.ux-v2 .library__main {
  max-width: 1180px;
}
body.ux-v2 .library__main {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 240px;
  gap: 24px;
}
body.ux-v2 .v2bookmenu {
  position: sticky;
  top: 18px;
  align-self: start;
  padding: 12px;
  border-radius: 24px;
  background: rgba(255,255,255,.72);
  border: 1.5px solid var(--glass-line);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}
body.ux-v2 .v2bookmenu__head {
  width: 100%;
  min-height: 62px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 18px;
  padding: 10px 12px;
  text-align: left;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(246,238,255,.84));
  box-shadow: 0 12px 28px -20px rgba(100,70,150,.45);
  transition: transform .2s, box-shadow .2s;
}
body.ux-v2 .v2bookmenu__head:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -22px rgba(100,70,150,.62);
}
body.ux-v2 .v2bookmenu__head.is-on {
  background: linear-gradient(135deg, rgba(255,158,203,.92), rgba(183,156,255,.92));
  color: #fff;
}
body.ux-v2 .v2bookmenu__ic {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255,255,255,.65);
  color: var(--lav-2);
}
body.ux-v2 .v2bookmenu__ic svg {
  width: 21px;
  height: 21px;
}
body.ux-v2 .v2bookmenu__text {
  min-width: 0;
  display: grid;
  gap: 1px;
  font-family: var(--font-d);
}
body.ux-v2 .v2bookmenu__text b {
  font-size: 15px;
  line-height: 1.05;
  font-weight: 700;
}
body.ux-v2 .v2bookmenu__text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.1;
  font-weight: 600;
  opacity: .78;
}
body.ux-v2 .v2bookmenu__chev {
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform .2s;
  opacity: .8;
}
body.ux-v2 .v2bookmenu.is-open .v2bookmenu__chev {
  transform: translateY(3px) rotate(225deg);
}
body.ux-v2 .v2bookmenu .cats,
body.ux-v2 .v2bookmenu .ages {
  width: auto;
  max-width: none;
  display: grid;
  gap: 8px;
  margin: 0;
}
body.ux-v2 .v2bookmenu .cats {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .24s ease, opacity .18s ease, margin-top .24s ease;
}
body.ux-v2 .v2bookmenu.is-open .cats {
  max-height: 380px;
  opacity: 1;
  margin-top: 12px;
}
body.ux-v2 .v2bookmenu__section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1.5px solid rgba(183,156,255,.22);
}
body.ux-v2 .v2bookmenu__section h3 {
  margin: 0 0 9px;
  padding: 0 4px;
  font-family: var(--font-d);
  font-size: 13px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--ink-soft);
}
body.ux-v2 .v2bookmenu .cattab,
body.ux-v2 .v2bookmenu .agetab {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 14px;
  text-align: left;
  background: rgba(255,255,255,.58);
}
body.ux-v2 .v2bookmenu .cattab.is-on,
body.ux-v2 .v2bookmenu .agetab.is-on {
  background: #fff;
  color: var(--rose-2);
  border-color: rgba(255,158,203,.58);
  box-shadow: 0 10px 22px -17px rgba(255,105,170,.72);
}
body.ux-v2 .v2mobiletabs {
  display: none;
}
body.ux-v2.is-phone .v2mobiletabs {
  position: fixed;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 45;
  min-height: 66px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  padding: 7px;
  border-radius: 24px;
  background: rgba(255,255,255,.9);
  border: 1.5px solid rgba(183,156,255,.34);
  box-shadow: 0 18px 44px -24px rgba(72,45,110,.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
body.ux-v2.is-phone .v2mobiletab {
  min-width: 0;
  min-height: 52px;
  cursor: pointer;
  display: grid;
  place-items: center;
  gap: 2px;
  border: 0;
  border-radius: 18px;
  color: var(--ink-soft);
  background: transparent;
  font-family: var(--font-d);
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  transition: color .18s, background .18s, transform .18s;
}
body.ux-v2.is-phone .v2mobiletab__ic {
  width: 21px;
  height: 21px;
  display: inline-flex;
}
body.ux-v2.is-phone .v2mobiletab__ic svg {
  width: 100%;
  height: 100%;
}
body.ux-v2.is-phone .v2mobiletab.is-on {
  color: #fff;
  background: linear-gradient(135deg, var(--lav-2), var(--rose-2));
  box-shadow: 0 10px 22px -15px rgba(183,124,255,.82);
}

/* раскладка библиотеки */
.library__main { width: 100%; max-width: 1080px; margin: 0 auto; display: flex; gap: 28px; align-items: flex-start; }
.library__col { flex: 1; min-width: 0; }
.library__col .library__title { text-align: left; }
.library__col .library__sub { text-align: left; margin: 8px 0 22px; }
.cards__empty { text-align: center; color: var(--ink-soft); font-weight: 600; padding: 36px; }

/* название на обложке + мета */
.card__name { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 16px 16px 13px; text-align: left;
  font-family: var(--font-d); font-weight: 600; font-size: 19px; line-height: 1.1; color: #fff;
  text-shadow: 0 2px 10px rgba(70,40,110,.55);
  background: linear-gradient(transparent, rgba(55,35,95,.42)); }
.card__meta { font-family: var(--font-d); font-weight: 500; font-size: 13px; color: var(--ink-soft);
  display: flex; align-items: center; gap: 8px; }
.card__meta b { color: var(--rose-2); font-weight: 700; }

/* «Продолжить» */
.continue { width: 240px; flex: 0 0 auto; position: sticky; top: 20px; }
.continue__h { font-family: var(--font-d); font-weight: 600; font-size: 18px; color: var(--ink); margin-bottom: 14px; }
.contcard { cursor: pointer; border: none; text-align: left; width: 100%; padding: 0; overflow: hidden;
  background: var(--glass-strong); border: 1.5px solid var(--glass-line); border-radius: var(--radius);
  box-shadow: var(--shadow-soft); backdrop-filter: blur(10px); transition: transform .3s; }
.contcard:hover { transform: translateY(-4px); }
.contcard__cover {
  position: relative; aspect-ratio: 16 / 9; height: auto;
  display: grid; place-items: center; overflow: hidden;
}
.contcard__cover svg { width: 88px; height: 88px; }
.contcard__image { width: 100%; height: 100%; object-fit: cover; display: block; }
.contcard__body {
  position: relative; z-index: 1;
  padding: 17px 15px 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.82));
}
.contcard__title {
  font-family: var(--font-d); font-weight: 600; font-size: 16px;
  line-height: 1.12; color: var(--ink);
}
.contcard__sub { font-family: var(--font-d); font-weight: 500; font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.contcard__bar { height: 6px; border-radius: 999px; background: rgba(183,156,255,.22); margin-top: 11px; overflow: hidden; }
.contcard__fill { height: 100%; background: linear-gradient(90deg, var(--lav-2), var(--rose-2)); }

@media (max-width: 820px) {
  .library__main { flex-direction: column; }
  .continue { width: 100%; position: static; }
  body.ux-v2 .library__main {
    display: grid;
    grid-template-columns: 1fr;
  }
  body.ux-v2 .v2bookmenu {
    position: static;
    width: 100%;
  }
  body.ux-v2 .v2bookmenu .cats,
  body.ux-v2 .v2bookmenu .ages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.ux-v2.is-phone .app,
  body.ux-v2.is-phone .screen {
    padding-bottom: 96px;
  }
  body.ux-v2.is-phone .foot {
    margin-bottom: 82px;
  }
}

/* =========================================================
   РЕЖИМ ЧТЕНИЯ (фокус)
   ========================================================= */
.iconbtn--sm { width: 40px; height: 40px; }
.iconbtn--sm svg { width: 19px; height: 19px; }

.focusveil {
  position: fixed; inset: 0; z-index: 3; opacity: 0; pointer-events: none;
  transition: opacity .6s ease;
  background: radial-gradient(120% 92% at 50% 38%, transparent 34%, rgba(70,46,120,.18) 78%, rgba(58,36,104,.34) 100%);
}
body.focus .focusveil { opacity: 1; }

/* плавно убираем «лишний» интерфейс */
.topbar, .foot { transition: opacity .4s ease, transform .4s ease, max-height .5s ease, padding .4s ease; max-height: 220px; }
.reader__bar, .voicebar { transition: opacity .35s ease, transform .35s ease, max-height .45s ease, margin .35s ease; max-height: 240px; }
body.focus .topbar, body.focus .foot {
  opacity: 0; pointer-events: none; max-height: 0; padding-top: 0; padding-bottom: 0; overflow: hidden;
}
body.focus .topbar { transform: translateY(-14px); }
body.focus .foot   { transform: translateY(14px); }
body.focus .reader__bar, body.focus .voicebar {
  opacity: 0; pointer-events: none; max-height: 0; margin: 0; overflow: hidden; transform: translateY(-8px);
}

/* укрупняем сцену */
.screen--reader .reader { transition: max-width .5s ease; }
body.focus .reader { max-width: 770px; }
body.focus .page {
  padding: clamp(34px, 6vw, 64px) clamp(28px, 6vw, 68px);
  box-shadow: 0 42px 95px -32px rgba(80,50,140,.62);
  animation: focus-breathe 8s ease-in-out infinite;
}
body.focus .page__emoji svg { width: 90px; height: 90px; }
body.focus .page__text p {
  font-size: clamp(20px, 3vw, 27px); line-height: 1.95; margin-bottom: 22px;
}
@keyframes focus-breathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

/* мягкое появление текста при входе в режим чтения (задаётся из JS) */
@keyframes focus-in {
  0%   { opacity: 0; transform: translateY(16px); filter: blur(9px); }
  100% { opacity: 1; transform: none; filter: blur(0); }
}

.focusexit {
  position: fixed; top: 22px; right: 22px; z-index: 8;
  width: 50px; height: 50px; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink); background: var(--glass-strong);
  border: 1.5px solid var(--glass-line); box-shadow: var(--shadow-lift);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; transform: scale(.6) rotate(-30deg); pointer-events: none;
  transition: opacity .4s ease, transform .4s cubic-bezier(.34,1.56,.64,1), background .2s;
}
.focusexit svg { width: 22px; height: 22px; }
.focusexit:hover { background: #fff; transform: scale(1.08) rotate(90deg); }
body.focus .focusexit { opacity: 1; transform: none; pointer-events: auto; }

/* в лёгком режиме без «дыхания» */
body.lite.focus .page { animation: none; }

/* =========================================================
   PAYWALL (симуляция подписки)
   ========================================================= */
.paywall { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; }
.paywall[hidden] { display: none; }
.paywall__backdrop {
  position: absolute; inset: 0; background: rgba(58,36,100,.5);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .3s ease;
}
.paywall.is-open .paywall__backdrop { opacity: 1; }
.paywall__sheet {
  position: relative; z-index: 1; width: 100%; max-width: 430px;
  max-height: calc(100vh - 40px); overflow-y: auto;
  background: linear-gradient(170deg, #ffffff 0%, #fdf3fb 100%);
  border: 1.5px solid var(--glass-line); border-radius: var(--radius);
  box-shadow: 0 50px 110px -30px rgba(70,40,120,.7);
  padding: clamp(26px, 5vw, 36px) clamp(22px, 4vw, 32px);
  transform: translateY(26px) scale(.96); opacity: 0;
  transition: transform .42s cubic-bezier(.22,1,.36,1), opacity .35s ease;
}
.paywall.is-open .paywall__sheet { transform: none; opacity: 1; }
.paywall__x {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-soft); background: rgba(255,255,255,.7);
  border: 1.5px solid var(--glass-line); transition: background .2s, transform .2s, color .2s;
}
.paywall__x svg { width: 18px; height: 18px; }
.paywall__x:hover { background: #fff; transform: rotate(90deg); color: var(--rose-2); }

.pwstep { display: none; text-align: center; }
.pwstep.is-active { display: block; animation: pwstep-in .45s cubic-bezier(.22,1,.36,1) both; }
@keyframes pwstep-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.pwcrown { width: 64px; height: 64px; margin: 4px auto 14px; color: #ffb15a;
  filter: drop-shadow(0 8px 16px rgba(255,160,60,.5)); animation: crown-pop .7s cubic-bezier(.34,1.56,.64,1) both; }
.pwcrown svg { width: 100%; height: 100%; }
@keyframes crown-pop { 0% { opacity: 0; transform: translateY(-8px) scale(.5) rotate(-12deg); } 100% { opacity: 1; transform: none; } }

.pwtitle { font-family: var(--font-d); font-weight: 600; font-size: 27px; color: var(--ink); line-height: 1.1; }
.pwtitle span { background: linear-gradient(100deg, #ffb15a, var(--rose-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.pwlead { color: var(--ink-soft); font-weight: 600; font-size: 15px; margin-top: 8px; }
.pwlead b { color: var(--rose-2); }

.pwperks { list-style: none; text-align: left; margin: 20px 0 22px; display: grid; gap: 11px; }
.pwperks li { display: flex; align-items: center; gap: 11px;
  font-family: var(--font-d); font-weight: 500; font-size: 15px; color: var(--ink); }
.pwperks__ic { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; color: #fff;
  background: linear-gradient(135deg, #6dd6b6, #44b89a); }
.pwperks__ic svg { width: 15px; height: 15px; }

.pwplans { display: flex; gap: 12px; margin-bottom: 20px; }
.pwplan { position: relative; flex: 1; cursor: pointer; text-align: center;
  padding: 16px 10px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.7); border: 2px solid rgba(183,156,255,.3);
  display: flex; flex-direction: column; gap: 4px; align-items: center;
  transition: transform .2s, border-color .2s, box-shadow .2s, background .2s; }
.pwplan:hover { transform: translateY(-2px); }
.pwplan.is-on { border-color: var(--rose-2); background: #fff; box-shadow: 0 14px 28px -14px rgba(255,158,203,.7); }
.pwplan__name { font-family: var(--font-d); font-weight: 500; font-size: 14px; color: var(--ink-soft); }
.pwplan__price { font-family: var(--font-d); font-weight: 700; font-size: 21px; color: var(--ink); }
.pwplan__price small { font-weight: 500; font-size: 12px; color: var(--ink-soft); }
.pwplan__off { position: absolute; top: -10px; right: -8px;
  font-family: var(--font-d); font-weight: 700; font-size: 11px; color: #fff;
  padding: 3px 8px; border-radius: 999px; background: linear-gradient(135deg, #ff9ecb, #ffb15a);
  box-shadow: 0 6px 14px -6px rgba(255,140,90,.8); }
.pwnote { font-size: 12px; color: var(--ink-soft); margin-top: 12px; opacity: .85; }

.pwback { background: none; border: none; cursor: pointer; float: left;
  font-family: var(--font-d); font-weight: 600; font-size: 14px; color: var(--ink-soft); margin-bottom: 6px; }
.pwback:hover { color: var(--rose-2); }

.pwcard { position: relative; text-align: left; color: #fff; margin: 18px 0 20px; height: 162px;
  border-radius: 18px; padding: 18px 20px 16px; overflow: hidden;
  background: linear-gradient(135deg, #7d6bd6 0%, #b06bb8 52%, #ff9ecb 100%);
  box-shadow: 0 22px 44px -20px rgba(110,70,170,.8); }
.pwcard::after { content: ''; position: absolute; right: -44px; top: -44px; width: 168px; height: 168px;
  border-radius: 50%; background: rgba(255,255,255,.12); }
.pwcard__chip { position: absolute; top: 52px; left: 20px; width: 42px; height: 32px; border-radius: 7px;
  background: linear-gradient(135deg, #ffe39a, #ffb15a); box-shadow: inset 0 0 0 1px rgba(255,255,255,.4); }
.pwcard__brand { position: absolute; top: 15px; right: 18px; width: 30px; height: 30px; color: #fff; opacity: .92; }
.pwcard__brand svg { width: 100%; height: 100%; }
.pwcard__num { position: absolute; left: 20px; right: 20px; top: 96px; z-index: 1;
  font-family: var(--font-d); font-weight: 600; font-size: 21px; letter-spacing: 2px; }
.pwcard__row { position: absolute; left: 20px; right: 20px; bottom: 14px; z-index: 1;
  display: flex; justify-content: space-between; gap: 10px;
  font-family: var(--font-d); font-weight: 500; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; opacity: .94; }
.pwcard__row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pwfield { display: block; text-align: left; margin-bottom: 13px; }
.pwfield > span { display: block; font-family: var(--font-d); font-weight: 500; font-size: 13px;
  color: var(--ink-soft); margin-bottom: 6px; }
.pwfield input { width: 100%; height: 50px; padding: 0 16px;
  font-family: var(--font-d); font-size: 16px; color: var(--ink);
  border: 2px solid rgba(183,156,255,.4); border-radius: 14px; background: #fff; outline: none;
  transition: border-color .2s, box-shadow .2s; }
.pwfield input:focus { border-color: var(--rose-2); box-shadow: 0 0 0 4px rgba(255,158,203,.2); }
.pwfield__row { display: flex; gap: 12px; }
.pwfield__row .pwfield { flex: 1; }
.pwhint { min-height: 18px; margin-top: 6px; font-size: 13.5px; font-weight: 700; color: var(--rose-2); }
#pwForm .btn--go { margin-top: 6px; }
#pwForm .btn--go i { font-style: normal; }

.pwstep--proc { padding: 34px 0 24px; }
.pwspin { width: 56px; height: 56px; margin: 0 auto 20px; border-radius: 50%;
  border: 5px solid rgba(183,156,255,.25); border-top-color: var(--rose-2);
  animation: pwspin .85s linear infinite; }
@keyframes pwspin { to { transform: rotate(360deg); } }
.pwproc { font-family: var(--font-d); font-weight: 600; font-size: 17px; color: var(--ink); }

.pwstep--done { position: relative; }
.pwdone__burst { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.pwdone__ring { width: 84px; height: 84px; margin: 8px auto 16px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #6dd6b6, #44b89a);
  box-shadow: 0 18px 36px -14px rgba(60,180,150,.8);
  animation: badge-in .8s cubic-bezier(.34,1.56,.64,1) both; }
.pwdone__ring svg { width: 42px; height: 42px; }

/* =========================================================
   ЗАМКИ И КОРОНЫ НА КАРТОЧКАХ
   ========================================================= */
.card__crown { position: absolute; top: 14px; left: 14px; z-index: 4;
  width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; background: linear-gradient(135deg, #ffb15a, #ff9ecb);
  box-shadow: 0 8px 18px -8px rgba(255,140,90,.9); }
.card__crown svg { width: 17px; height: 17px; }
.card__crown.is-on { background: linear-gradient(135deg, #6dd6b6, #44b89a); }
.card__lockover { position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: #fff; background: rgba(70,46,120,.42);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  font-family: var(--font-d); font-weight: 600; font-size: 14px; letter-spacing: .5px;
  opacity: 0; transition: opacity .3s; }
.card.is-locked:hover .card__lockover { opacity: 1; }
.card__lockover svg { width: 30px; height: 30px; }
.card.is-locked .card__art,
.card.is-locked .card__image { filter: saturate(.55) opacity(.92); }

/* =========================================================
   ПРЕМИУМ-БЛОК В КАБИНЕТЕ
   ========================================================= */
.prem:empty { display: none; }
.prem { margin-bottom: 26px; }
.prem--cta, .prem--on { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left;
  border-radius: var(--radius); padding: 18px 22px; border: 1.5px solid var(--glass-line);
  box-shadow: var(--shadow-soft); }
.prem--cta { cursor: pointer; background: linear-gradient(120deg, #fff4e8, #ffe9f4);
  transition: transform .25s, box-shadow .25s; }
.prem--cta:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.prem--on { background: linear-gradient(120deg, #eafaf3, #e9f3ff); }
.prem__ic { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  color: #fff; background: linear-gradient(135deg, #ffb15a, #ff9ecb); }
.prem--on .prem__ic { background: linear-gradient(135deg, #6dd6b6, #44b89a); }
.prem__ic svg { width: 26px; height: 26px; }
.prem__tx { flex: 1; }
.prem__tx b { display: block; font-family: var(--font-d); font-weight: 600; font-size: 17px; color: var(--ink); }
.prem__tx span { font-family: var(--font-d); font-weight: 500; font-size: 13.5px; color: var(--ink-soft); }
.prem__go { font-family: var(--font-d); font-weight: 600; font-size: 14px; color: var(--rose-2); flex: 0 0 auto; }
.prem__manage { flex: 0 0 auto; cursor: pointer; font-family: var(--font-d); font-weight: 600; font-size: 13px;
  color: var(--ink-soft); background: rgba(255,255,255,.7); border: 1.5px solid var(--glass-line);
  padding: 8px 14px; border-radius: 999px; transition: background .2s, color .2s; }
.prem__manage:hover { background: #fff; color: var(--rose-2); }

/* =========================================================
   КОНСТРУКТОР ГЕРОЯ
   ========================================================= */
.herobuild { display: flex; gap: 16px; align-items: center; }
.herobuild__preview {
  flex: 0 0 auto; width: 96px; height: 96px; border-radius: 22px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, #f3ecff, #ffe9f4);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.7), var(--shadow-soft);
  overflow: hidden;
}
.herobuild__preview .hero {
  width: 84px; height: 84px;
  filter: drop-shadow(0 6px 10px rgba(150,120,200,.32));
  animation: bob 4s ease-in-out infinite;
}
.herobuild__preview img {
  width: 100%; height: 100%; display: block; object-fit: cover;
}
.herobuild__controls { flex: 1; min-width: 0; display: grid; gap: 9px; }
.herorow { display: flex; gap: 8px; flex-wrap: wrap; }
.avatarpick { display: grid; grid-template-columns: repeat(4, 54px); gap: 9px; }
.avatarpick__btn {
  width: 54px; height: 54px; cursor: pointer; padding: 0; overflow: hidden;
  border-radius: 18px; background: rgba(255,255,255,.62);
  border: 2px solid rgba(183,156,255,.28);
  box-shadow: 0 8px 18px -16px rgba(90,60,150,.7);
  transition: transform .18s, border-color .18s, box-shadow .18s, background .18s;
}
.avatarpick__btn:hover { transform: translateY(-2px); background: #fff; }
.avatarpick__btn.is-on {
  border-color: var(--rose-2);
  background: #fff;
  box-shadow: 0 12px 24px -14px rgba(255,120,180,.72);
}
.avatarpick__btn img { width: 100%; height: 100%; display: block; object-fit: cover; }
.herochip {
  width: 46px; height: 46px; flex: 0 0 auto; cursor: pointer; padding: 4px;
  border-radius: 13px; background: rgba(255,255,255,.6);
  border: 2px solid rgba(183,156,255,.3);
  display: grid; place-items: center;
  transition: transform .18s, border-color .18s, background .18s;
}
.herochip:hover { transform: translateY(-2px); }
.herochip.is-on { border-color: var(--rose-2); background: #fff; box-shadow: 0 10px 20px -12px rgba(183,124,255,.6); }
.herochip .hero { width: 100%; height: 100%; }
.herochip__none { font-family: var(--font-d); font-weight: 600; font-size: 12px; color: var(--ink-soft); }
.swatch {
  width: 30px; height: 30px; flex: 0 0 auto; cursor: pointer; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 1.5px rgba(183,156,255,.4);
  transition: transform .18s, box-shadow .18s;
}
.swatch:hover { transform: translateY(-2px) scale(1.05); }
.swatch.is-on { box-shadow: 0 0 0 3px var(--rose-2); transform: scale(1.08); }

/* герой на сцене чтения */
.page__emoji .hero { width: 116px; height: 116px; filter: drop-shadow(0 10px 16px rgba(150,120,200,.34)); }

/* детальная иллюстрация-сцена */
.scene {
  position: relative; width: 100%; aspect-ratio: 760 / 460;
  border-radius: 20px; overflow: hidden; margin: 0 auto 22px;
  background: #cdbbe8;
  box-shadow: 0 24px 50px -26px rgba(90,60,150,.55), inset 0 0 0 1.5px rgba(255,255,255,.5);
  animation: scene-in .7s cubic-bezier(.22,1,.36,1) both;
}
@keyframes scene-in { from { opacity: 0; transform: scale(.97) translateY(10px); } to { opacity: 1; transform: none; } }
.scene__bg { position: absolute; inset: 0; }
.scene__bg svg { width: 100%; height: 100%; display: block; }
.scene__image { width: 100%; height: 100%; object-fit: cover; display: block; }
.scene__hero { position: absolute; transform: translate(-50%, -50%); pointer-events: none; }
.scene__hero .hero {
  width: 100%; height: auto; display: block;
  filter: drop-shadow(0 12px 14px rgba(40,25,75,.35));
  animation: bob 4.5s ease-in-out infinite;
}
body.lite .scene, body.lite .scene__hero .hero { animation: none; }

/* =========================================================
   ВХОД ЧЕРЕЗ АККАУНТЫ
   ========================================================= */
.authbox { text-align: left; max-width: 480px; }
.authbox .namebox__label b { color: var(--rose-2); }
.authpath { padding: 18px; border: 1.5px solid rgba(183,156,255,.22); border-radius: 21px; background: rgba(255,255,255,.56); }
.authpath--account { box-shadow: inset 0 1px rgba(255,255,255,.9); }
.authpath--guest { background: linear-gradient(135deg,rgba(255,247,229,.8),rgba(255,239,247,.75)); }
.authpath__label { display: inline-flex; padding: 5px 9px; border-radius: 999px; color: #73589a; background: #eee5f8; font: 800 10px var(--font-d); text-transform: uppercase; letter-spacing: .08em; }
.authpath h2 { margin: 9px 0 4px; color: var(--ink); font: 800 20px var(--font-d); }
.authpath > p { margin: 0 0 13px; color: var(--ink-soft); font-size: 12px; font-weight: 650; line-height: 1.45; }
.authdivider { position: relative; height: 33px; display: grid; place-items: center; color: #9a8ca3; font: 800 11px var(--font-d); }
.authdivider:before { content:""; position:absolute; left:0; right:0; top:50%; height:1px; background:#e6dced; }
.authdivider span { position:relative; padding:0 10px; background:#fffafc; }
.authregion {
  margin-bottom: 14px;
  color: var(--ink-soft);
  font-family: var(--font-d);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}
.oauthlist {
  display: grid;
  gap: 10px;
}
.oauthbtn {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  border: 2px solid rgba(183,156,255,.28);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.86);
  color: var(--ink);
  font-family: var(--font-d);
  font-weight: 700;
  font-size: 15px;
  text-align: left;
  padding: 10px 16px 10px 12px;
  box-shadow: 0 12px 26px -22px rgba(62, 42, 120, .45);
  transition: transform .18s, border-color .18s, background .18s, box-shadow .18s;
}
.oauthbtn:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--provider-color) 45%, rgba(183,156,255,.28));
  background: #fff;
  box-shadow: 0 18px 34px -24px rgba(62, 42, 120, .58);
}
.oauthbtn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255,158,203,.28), 0 18px 34px -24px rgba(62, 42, 120, .58);
}
.oauthbtn__mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--provider-color);
  color: #fff;
  font-family: var(--font-d);
  font-weight: 800;
  font-size: 14px;
  line-height: 1;
}
.guestbtn {
  width: 100%;
  margin-top: 2px;
  padding: 13px 15px;
  border: 1.5px solid #dfd3e9;
  border-radius: 14px;
  background: #fff;
  color: #675476;
  font-family: var(--font-d);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.guestbtn:hover { color: var(--lav-2); border-color: #bea9d3; }
.linkback--left { text-align: left; margin: 0 0 12px; }

.otp { display: flex; gap: 12px; justify-content: space-between; margin: 6px 0 2px; }
.otp__box {
  flex: 1; min-width: 0; height: 64px; text-align: center;
  font-family: var(--font-d); font-weight: 600; font-size: 28px; color: var(--ink);
  border: 2px solid rgba(183,156,255,.4); border-radius: 16px;
  background: rgba(255,255,255,.85); outline: none;
  transition: border-color .2s, box-shadow .2s, transform .15s;
}
.otp__box:focus { border-color: var(--rose-2); box-shadow: 0 0 0 4px rgba(255,158,203,.22); transform: translateY(-2px); }
.otp.shake { animation: otp-shake .45s; }
@keyframes otp-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); } 40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); } 80% { transform: translateX(5px); }
}

.authnote { margin-top: 14px; font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.authdemo {
  margin: 14px 0 4px; padding: 12px 14px; border-radius: 14px; text-align: center;
  font-family: var(--font-d); font-weight: 500; font-size: 15px; color: var(--ink);
  background: rgba(191,245,230,.45); border: 1.5px dashed rgba(80,180,150,.5);
}
.authdemo b { font-weight: 700; letter-spacing: 4px; color: #1f9f86; font-size: 19px; margin-left: 4px; }
#codeResend { margin-top: 14px; }
#codeResend:disabled { color: #b9a9dd; cursor: default; }

.logout {
  display: block; margin: 28px auto 8px; cursor: pointer;
  font-family: var(--font-d); font-weight: 600; font-size: 14px; color: var(--ink-soft);
  background: rgba(255,255,255,.6); border: 1.5px solid var(--glass-line);
  padding: 11px 24px; border-radius: 999px; transition: background .2s, color .2s, transform .2s;
}
.logout:hover { background: #fff; color: var(--rose-2); transform: translateY(-2px); }

/* =========================================================
   РЕЖИМ СНА
   ========================================================= */
.screen--sleep { flex-direction: column; }
.sleep { width: 100%; max-width: 480px; text-align: center; }
.sleep .ghostback { align-self: flex-start; margin-bottom: 14px; }
.sleep__moon { width: 62px; height: 62px; margin: 4px auto 12px; color: #b79cff;
  filter: drop-shadow(0 8px 16px rgba(160,120,210,.5)); animation: bob 4.5s ease-in-out infinite; }
.sleep__moon svg { width: 100%; height: 100%; }
.sleep__title { font-family: var(--font-d); font-weight: 600; font-size: clamp(28px, 6vw, 40px); color: var(--ink); }
.sleep__sub { color: var(--ink-soft); font-weight: 600; margin: 8px auto 24px; max-width: 380px; line-height: 1.5; }
.sleep__scapes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 24px; }
.scape { cursor: pointer; display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--glass-strong); border: 2px solid rgba(183,156,255,.3);
  box-shadow: var(--shadow-soft); backdrop-filter: blur(10px);
  transition: transform .2s, border-color .2s, background .2s; }
.scape:hover { transform: translateY(-2px); }
.scape.is-on { border-color: var(--rose-2); background: #fff; box-shadow: 0 12px 24px -14px rgba(183,124,255,.6); }
.scape__ic { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  color: #fff; background: linear-gradient(135deg, var(--lav-2), var(--rose-2)); }
.scape__ic svg { width: 22px; height: 22px; }
.scape__name { font-family: var(--font-d); font-weight: 600; font-size: 16px; color: var(--ink); }
.scape__desc { font-family: var(--font-d); font-weight: 500; font-size: 12px; color: var(--ink-soft); display: block; }
.sleep__tlabel { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-d); font-weight: 600;
  font-size: 14px; color: var(--ink-soft); margin-bottom: 12px; }
.sleep__tlabel span { width: 17px; height: 17px; display: inline-flex; color: var(--lav-2); }
.sleep__tlabel svg { width: 100%; height: 100%; }
.sleep__timers { display: flex; gap: 8px; justify-content: center; margin-bottom: 26px; flex-wrap: wrap; }
.tchip { cursor: pointer; font-family: var(--font-d); font-weight: 600; font-size: 14px; color: var(--ink-soft);
  padding: 10px 16px; border-radius: 999px; background: var(--glass); border: 2px solid rgba(183,156,255,.3);
  transition: transform .2s, color .2s, background .2s, border-color .2s; }
.tchip:hover { transform: translateY(-2px); }
.tchip.is-on { color: #fff; background: linear-gradient(135deg, var(--lav-2), var(--rose-2)); border-color: transparent; }

/* ночной оверлей засыпания */
.sleepnight { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px; text-align: center;
  background: radial-gradient(120% 100% at 50% 32%, #3a2c6e 0%, #241a4e 55%, #160f33 100%);
  animation: night-in 1.4s ease both; }
.sleepnight[hidden] { display: none; }
@keyframes night-in { from { opacity: 0; } to { opacity: 1; } }
.sleepnight__stars { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.nstar { position: absolute; background: #fff; border-radius: 50%; animation: ntwinkle ease-in-out infinite; }
@keyframes ntwinkle { 0%, 100% { opacity: .15; transform: scale(.6); } 50% { opacity: 1; transform: scale(1); } }
.sleepnight__moon { width: 120px; height: 120px; color: #fff2c6; z-index: 1;
  filter: drop-shadow(0 0 42px rgba(255,235,170,.55)); animation: bob 6s ease-in-out infinite; }
.sleepnight__moon svg { width: 100%; height: 100%; }
.sleepnight__name { font-family: var(--font-d); font-weight: 600; font-size: 22px; color: #ece5ff; z-index: 1; }
.sleepnight__timer { font-family: var(--font-d); font-weight: 500; font-size: 16px; color: #b9aee6; z-index: 1; }
.sleepnight__stop { z-index: 1; margin-top: 10px; cursor: pointer; font-family: var(--font-d); font-weight: 600;
  font-size: 15px; color: #cdbcff; background: rgba(255,255,255,.08); border: 1.5px solid rgba(255,255,255,.2);
  padding: 12px 28px; border-radius: 999px; transition: background .2s, color .2s; }
.sleepnight__stop:hover { background: rgba(255,255,255,.16); color: #fff; }
/* плавное затемнение всего оверлея к концу таймера */
.sleepnight.is-dimming { transition: filter 50s linear; filter: brightness(.2); }

/* =========================================================
   ПОЛЬЗА ДЛЯ РОДИТЕЛЕЙ
   ========================================================= */
.talkcard { display: flex; align-items: center; gap: 13px; text-align: left; margin: 0 0 24px;
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: linear-gradient(120deg, #fff4e8, #ffe9f4); border: 1.5px solid var(--glass-line);
  animation: pop .7s .35s both; }
.talkcard__ic { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  color: #fff; background: linear-gradient(135deg, #ffb15a, #ff9ecb); }
.talkcard__ic svg { width: 21px; height: 21px; }
.talkcard__lbl { display: block; font-family: var(--font-d); font-weight: 600; font-size: 12px; letter-spacing: .5px;
  text-transform: uppercase; color: var(--rose-2); }
.talkcard__q { display: block; font-family: var(--font-d); font-weight: 500; font-size: 15.5px; color: var(--ink);
  margin-top: 3px; line-height: 1.35; }

.parent { display: grid; gap: 12px; margin-bottom: 28px; }
.parent__row { display: flex; align-items: center; gap: 12px; background: var(--glass-strong);
  border: 1.5px solid var(--glass-line); border-radius: var(--radius-sm); padding: 14px 16px; box-shadow: var(--shadow-soft); }
.parent__row--tip { background: linear-gradient(135deg, rgba(255,255,255,.86), rgba(255,244,250,.78)); }
.parent__ic { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  color: #fff; background: linear-gradient(135deg, #6dd6b6, #44b89a); }
.parent__ic svg { width: 21px; height: 21px; }
.parent__tx b { display: block; font-family: var(--font-d); font-weight: 600; font-size: 15px; color: var(--ink); }
.parent__tx span { font-family: var(--font-d); font-weight: 500; font-size: 13px; color: var(--ink-soft); }
.parent__lessons { display: flex; flex-wrap: wrap; gap: 8px; }
.parententry { margin-bottom: 30px; }
.parententry .parent { margin-bottom: 12px; }
.parententry__open {
  width: 100%; display: flex; align-items: center; gap: 13px; text-align: left; cursor: pointer;
  padding: 16px 18px; border: 0; border-radius: var(--radius-sm); color: #fff;
  background: linear-gradient(135deg, #6e57b8, #a15ea8 58%, #dc7fa8); box-shadow: 0 16px 30px -18px rgba(78,47,130,.75);
}
.parententry__open > span:first-child { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.16); }
.parententry__open > span:nth-child(2) { flex: 1; display: grid; gap: 2px; }
.parententry__open b { font-family: var(--font-d); font-size: 15px; }
.parententry__open small { color: rgba(255,255,255,.75); font-size: 12px; font-weight: 700; }
.parententry__open i { font-size: 27px; font-style: normal; }

.parentgate, .parentcabinet, .timelimit { position: fixed; inset: 0; z-index: 3000; }
.parentgate[hidden], .parentcabinet[hidden], .timelimit[hidden] { display: none; }
.parentgate { display: grid; place-items: center; padding: 20px; }
.parentgate__backdrop { position: absolute; inset: 0; border: 0; background: rgba(35,23,57,.58); backdrop-filter: blur(10px); }
.parentgate__card {
  position: relative; width: min(420px, 100%); padding: 30px; text-align: center; border-radius: 28px;
  background: #fffafc; border: 1.5px solid rgba(255,255,255,.75); box-shadow: 0 30px 80px rgba(38,23,65,.3);
}
.parentgate__close { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: #f0e9f8; color: var(--ink); cursor: pointer; }
.parentgate__close svg { width: 18px; }
.parentgate__icon { width: 58px; height: 58px; margin: 0 auto 13px; display: grid; place-items: center; border-radius: 18px; color: #fff; font-size: 27px; background: linear-gradient(135deg,var(--lav-2),var(--rose-2)); }
.parentgate h2 { font-family: var(--font-d); font-size: 25px; color: var(--ink); }
.parentgate p { margin: 8px auto 18px; max-width: 300px; color: var(--ink-soft); font-weight: 600; line-height: 1.45; }
.parentgate__task { font-family: var(--font-d); font-size: 28px; color: var(--ink); margin-bottom: 13px; }
.parentgate form { display: grid; grid-template-columns: 95px 1fr; gap: 9px; }
.parentgate.is-setup form { grid-template-columns: 1fr; }
.parentgate input[hidden] { display: none; }
.parentgate input { min-width: 0; padding: 13px; text-align: center; font: 700 18px var(--font-d); color: var(--ink); border: 2px solid #e4d9f2; border-radius: 14px; background: #fff; }
.parentgate form button { border: 0; border-radius: 14px; color: #fff; font: 700 14px var(--font-d); background: linear-gradient(135deg,#765fc0,#ce75a5); cursor: pointer; }
.parentpin__step { margin: -3px 0 12px; color: #927ea3; font: 800 11px var(--font-d); text-transform: uppercase; letter-spacing: .08em; }
.parentpin__dots { display: flex; justify-content: center; gap: 13px; margin: 0 0 19px; }
.parentpin__dots i { width: 16px; height: 16px; border: 2px solid #cdbbe0; border-radius: 50%; background: #fff; transition: transform .16s, background .16s, border-color .16s; }
.parentpin__dots i.is-filled { border-color: #8669b9; background: linear-gradient(135deg,#8065bd,#d37daa); transform: scale(1.08); box-shadow: 0 4px 10px rgba(111,77,151,.2); }
.parentpin__pad { width: min(260px,100%); display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin: 0 auto; }
.parentpin__pad button { min-height: 52px; border: 1.5px solid #e8deef; border-radius: 16px; color: #584667; background: #fff; box-shadow: 0 7px 16px -13px rgba(67,45,93,.7); font: 700 21px var(--font-d); cursor: pointer; transition: transform .12s, background .12s; -webkit-tap-highlight-color: transparent; }
.parentpin__pad button:active { transform: scale(.93); background: #f1e9f7; }
.parentpin__pad button:focus-visible { outline: 3px solid rgba(132,99,185,.35); outline-offset: 2px; }
.parentpin__pad [data-pin-delete] { color: #9a789c; font-size: 20px; background: #f7f1f7; }
.parentpin__intro { display: grid; gap: 10px; }
.parentpin__intro[hidden] { display: none; }
.parentpin__intro button { display: grid; gap: 3px; width: 100%; padding: 14px 16px; text-align: left; border: 1.5px solid #e6dcef; border-radius: 16px; color: #5a4968; background: #fff; cursor: pointer; }
.parentpin__intro button:first-child { color: #fff; border-color: transparent; background: linear-gradient(135deg,#765fc0,#ce75a5); }
.parentpin__intro b { font: 800 14px var(--font-d); }
.parentpin__intro small { color: inherit; font-size: 11px; font-weight: 700; opacity: .75; }
.parentgate.is-intro .parentpin__entry { display: none !important; }
.parentgate.is-error .parentpin__dots { animation: parentPinShake .38s ease; }
@keyframes parentPinShake { 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
#parentMathError { display: block; min-height: 18px; margin-top: 9px; color: #c74b70; font-weight: 700; }

.parentcabinet { overflow: hidden; background: rgba(32,24,48,.52); backdrop-filter: blur(9px); }
.parentcabinet__sheet { position: absolute; inset: 3vh max(3vw, 12px); display: flex; flex-direction: column; max-width: 1000px; margin: auto; border-radius: 30px; overflow: hidden; background: #f9f6fb; box-shadow: 0 35px 100px rgba(28,17,48,.38); }
.parentcabinet__head { flex: 0 0 auto; display: flex; justify-content: space-between; gap: 15px; padding: 24px 28px 20px; color: #fff; background: linear-gradient(125deg,#51427f,#765895 60%,#a76589); }
.parentcabinet__head span { font: 800 11px var(--font-d); text-transform: uppercase; letter-spacing: .1em; color: #e7d8ff; }
.parentcabinet__head h2 { margin: 3px 0; font: 700 clamp(24px,4vw,34px) var(--font-d); }
.parentcabinet__head p { color: rgba(255,255,255,.75); font-weight: 700; }
.parentcabinet__head button { flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; color: #fff; background: rgba(255,255,255,.1); cursor: pointer; }
.parentcabinet__head button svg { width: 19px; }
.parentcabinet__body { overflow-y: auto; padding: 22px 26px 34px; }
.parenttab__head {
  position: relative; overflow: hidden; min-height: 170px; margin-bottom: 18px; padding: 31px 28px 24px; border-radius: 25px; color: #fff;
  background: linear-gradient(125deg,#6c519d,#a66eae 58%,#e69aba);
  box-shadow: 0 18px 42px -26px rgba(50,31,78,.65);
}
.parenttab__head > span,.parenttab__head h2,.parenttab__head p { position: relative; z-index: 2; max-width: 68%; }
.parenttab__head > span { display: block; font: 800 11px var(--font-d); text-transform: uppercase; letter-spacing: .1em; color: #e7d8ff; }
.parenttab__head h2 { margin: 4px 0 3px; font: 700 clamp(25px,4vw,35px) var(--font-d); }
.parenttab__head p { color: rgba(255,255,255,.75); font-weight: 700; }
.parenttab__cloud,.parenttab__star { position: absolute; pointer-events: none; }
.parenttab__cloud { z-index: 0; width: 190px; filter: drop-shadow(0 12px 15px rgba(61,44,94,.18)); }
.parenttab__cloud--one { right: -44px; bottom: -35px; }
.parenttab__cloud--two { right: 67px; bottom: -57px; width: 138px; opacity: .88; }
.parenttab__cloud--three { right: -28px; top: -48px; width: 120px; opacity: .6; }
.parenttab__star { z-index: 1; right: 37px; top: 37px; width: 68px; transform: rotate(7deg); filter: drop-shadow(0 8px 13px rgba(91,59,113,.3)); }
.parenttab__body { padding-bottom: 24px; }
.pdash__summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 14px; }
.pdash__summary article { min-width: 0; display: grid; justify-items: center; padding: 16px 8px; border: 1px solid #ebe3f2; border-radius: 18px; text-align: center; background: #fff; }
.pdash__summary article > span { width: 30px; height: 30px; color: #8c69ae; }
.pdash__summary svg { width: 100%; height: 100%; }
.pdash__summary b { margin-top: 5px; font: 700 27px var(--font-d); color: #55446d; }
.pdash__summary small { color: #83778e; font-weight: 700; font-size: 11px; }
.pdash__tabs { display: grid; grid-template-columns: repeat(2,1fr); gap: 5px; margin-bottom: 14px; padding: 5px; border-radius: 16px; background: #eee6f4; }
.pdash__tabs button { padding: 10px 5px; border: 0; border-radius: 12px; color: #71627d; background: transparent; font: 800 12px var(--font-d); cursor: pointer; }
.pdash__tabs button.is-on { color: #fff; background: linear-gradient(135deg,#765cb0,#c4729d); box-shadow: 0 7px 15px -10px #503663; }
.pdash__panel { display: none; }
.pdash__panel.is-on { display: block; animation: fadeIn .22s ease both; }
.pdash__section { margin-top: 14px; padding: 19px; border: 1px solid #ebe3f2; border-radius: 20px; background: #fff; }
.pdash__title { display: flex; justify-content: space-between; align-items: start; }
.pdash__title h3, .pdash__recommendation h3 { font: 700 17px var(--font-d); color: #4d405d; }
.pdash__title p { margin-top: 2px; color: #94889c; font-size: 12px; font-weight: 700; }
.weekchart { height: 150px; display: grid; grid-template-columns: repeat(7,1fr); gap: 9px; align-items: end; margin-top: 16px; }
.weekchart__day { height: 100%; display: grid; grid-template-rows: 18px 1fr 18px; justify-items: center; align-items: end; }
.weekchart__day b { font-size: 10px; color: #7d6e88; }
.weekchart__day i { width: min(30px,75%); min-height: 4px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg,#cb80af,#8065bd); }
.weekchart__day span { font-size: 11px; font-weight: 800; color: #94889c; }
.pdash__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pdash__chips span { display: inline-flex; align-items: center; gap: 5px; padding: 8px 11px; border-radius: 999px; font-size: 12px; font-weight: 800; color: #655178; background: #f4eef8; }
.pdash__chips svg { width: 14px; color: #55ad8f; }
.pdash__chips em, .choicehistory em { color: #a095a7; font-style: normal; font-weight: 700; font-size: 13px; }
.certificate-tasks { display: grid; gap: 12px; margin-top: 15px; }
.certificate-task { --task-accent:#6d91b5; display: grid; grid-template-columns: 48px 1fr; gap: 12px; padding: 14px; border: 1px solid color-mix(in srgb,var(--task-accent) 25%,#fff); border-radius: 17px; background: linear-gradient(135deg,color-mix(in srgb,var(--task-accent) 10%,#fff),#fff 72%); }
.certificate-task--night { --task-accent:#546f9d; }
.certificate-task--cozy { --task-accent:#a16991; }
.certificate-task.is-done { box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--task-accent) 28%,transparent); }
.certificate-task__icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; color: #fff; background: var(--task-accent); box-shadow: 0 9px 18px -12px var(--task-accent); font-size: 23px; }
.certificate-task__copy { min-width: 0; }
.certificate-task__top { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.certificate-task__top h4 { color: #51445d; font: 800 14px/1.25 var(--font-d); }
.certificate-task__top span { flex: 0 0 auto; padding: 4px 7px; border-radius: 999px; color: var(--task-accent); background: #fff; font: 800 10px var(--font-d); }
.certificate-task p { margin-top: 5px; color: #796d80; font-size: 11.5px; font-weight: 650; line-height: 1.42; }
.certificate-task__bar { height: 6px; margin: 10px 0; overflow: hidden; border-radius: 99px; background: rgba(92,74,110,.1); }
.certificate-task__bar i { display: block; height: 100%; border-radius: inherit; background: var(--task-accent); }
.certificate-task a { color: var(--task-accent); font: 800 11px var(--font-d); text-decoration: none; }
.certificate-task a:hover { text-decoration: underline; }
.certificate-tasks__note { margin-top: 13px; color: #9a8da2; font-size: 10.5px; font-weight: 700; line-height: 1.45; }
.pdash__recommendation { display: flex; gap: 14px; background: linear-gradient(135deg,#fff8eb,#fff4f8); }
.pdash__recommendation > span { flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; color: #fff; background: #dd8b67; }
.pdash__recommendation svg { width: 22px; }
.pdash__recommendation p { margin: 4px 0; color: #6e606f; font-weight: 650; line-height: 1.45; }
.pdash__recommendation small { color: #aa99a4; }
.parenttimer { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.parenttimer button { padding: 9px 13px; border: 1.5px solid #dfd4e9; border-radius: 999px; color: #655678; background: #fff; font: 800 12px var(--font-d); cursor: pointer; }
.parenttimer button.is-on { color: #fff; border-color: transparent; background: linear-gradient(135deg,#7660bb,#c574a2); }
.parenttimer__note { margin-top: 11px; color: #8b7d93; font-size: 12px; font-weight: 700; }
.choicehistory { display: grid; gap: 9px; margin-top: 13px; }
.choicehistory > div { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 13px; background: #faf7fc; }
.choicehistory i { flex: 0 0 auto; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; color: #8a6aa5; background: #eee6f4; font-style: normal; }
.choicehistory i.is-kind { color: #3e9c7d; background: #e2f5ee; }
.choicehistory span { display: grid; gap: 2px; min-width: 0; }
.choicehistory b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #594c62; font-size: 13px; }
.choicehistory small { color: #9b8da3; font-weight: 700; font-size: 10px; }
.parentanswers { display: grid; gap: 9px; margin-top: 13px; }
.parentanswers article { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; padding: 12px 13px; border-radius: 14px; background: #faf7fc; }
.parentanswers b { color: #594c62; font-size: 13px; }
.parentanswers small { color: #9b8da3; font-size: 10px; font-weight: 700; }
.parentanswers p { grid-column: 1 / -1; color: #74677d; font-size: 12px; font-weight: 650; line-height: 1.4; }
.parentanswers em { color: #a095a7; font-style: normal; font-weight: 700; font-size: 13px; }
.parentsettings { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin-top: 14px; }
.parentsettings button { min-width: 0; display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 9px; padding: 11px; text-align: left; border: 1px solid #e9e0ef; border-radius: 14px; color: #5f506b; background: #faf8fc; cursor: pointer; }
.parentsettings button > span { grid-row: 1 / 3; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: #fff; background: linear-gradient(135deg,#8066bd,#c579a5); }
.parentsettings svg { width: 18px; height: 18px; }
.parentsettings b { align-self: end; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 800 12px var(--font-d); }
.parentsettings small { align-self: start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #9a8ca2; font-size: 10px; font-weight: 750; }
.timelimit { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 25px; text-align: center; color: #fff; background: radial-gradient(circle at 50% 30%,#6e619a,#332b52 70%); }
.timelimit__cloud { font-size: 72px; filter: drop-shadow(0 12px 18px rgba(0,0,0,.2)); }
.timelimit h2 { margin-top: 14px; font: 700 clamp(27px,6vw,40px) var(--font-d); }
.timelimit p { max-width: 430px; margin: 9px 0 22px; color: #ded6f0; font-weight: 650; line-height: 1.5; }
.timelimit button { padding: 13px 20px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; color: #433858; background: #fff; font: 800 14px var(--font-d); cursor: pointer; }
body.parent-cabinet-open { overflow: hidden; }
@media (max-width: 620px) {
  .parentcabinet__sheet { inset: 0; border-radius: 0; }
  .parentcabinet__head { padding: calc(18px + env(safe-area-inset-top)) 18px 17px; }
  .parentcabinet__body { padding: 15px 13px calc(24px + env(safe-area-inset-bottom)); }
  .pdash__summary { grid-template-columns: repeat(2,1fr); }
  .weekchart { gap: 4px; height: 125px; }
  .pdash__section { padding: 15px; }
  .parentsettings { grid-template-columns: 1fr; }
  .parenttab__head { margin: -2px -2px 14px; padding: 20px 18px; border-radius: 22px; }
}
.lchip { font-family: var(--font-d); font-weight: 600; font-size: 12.5px; color: var(--ink);
  padding: 7px 13px; border-radius: 999px; background: rgba(255,255,255,.7); border: 1.5px solid var(--glass-line);
  display: inline-flex; align-items: center; gap: 6px; }
.lchip span { width: 14px; height: 14px; display: inline-flex; color: #44b89a; }
.lchip span svg { width: 100%; height: 100%; }

/* тег-урок на карточке сказки */
.card__lesson { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-d); font-weight: 600;
  font-size: 12px; color: var(--rose-2); margin-top: 8px; }
.card__lesson span { width: 14px; height: 14px; display: inline-flex; }
.card__lesson span svg { width: 100%; height: 100%; }

.offlinegroup {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 12px;
}
.offlinebtn,
.offlinebadge {
  width: fit-content; max-width: 100%;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 32px; padding: 7px 12px; border-radius: 999px;
  font-family: var(--font-d); font-weight: 600; font-size: 12.5px;
  border: 1.5px solid rgba(183,156,255,.34);
}
.offlinebtn {
  cursor: pointer; color: var(--ink);
  background: rgba(255,255,255,.7);
  transition: transform .2s, background .2s, border-color .2s;
}
.offlinebtn:hover { transform: translateY(-1px); background: #fff; border-color: var(--rose-2); }
.offlinebtn--danger { color: #b45f80; }
.offlinebtn.is-busy { cursor: wait; color: var(--ink-soft); }
.offlinebadge {
  color: #3d8e78;
  background: rgba(191,245,230,.55);
  border-color: rgba(109,214,182,.48);
}

/* =========================================================
   АДАПТИВ
   ========================================================= */
/* бренд сжимается, правый блок шапки держит размер */
.brand { min-width: 0; }
.brand__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__right { flex: 0 0 auto; }

@media (max-width: 760px) {
  .topbar { padding: 14px 16px; gap: 8px; }
  .topbar__right { gap: 7px; }
  .topbar__menu { display: inline-flex; }
  .topbar__actions {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 20;
    display: none;
    grid-template-columns: repeat(3, 42px);
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: max-content;
    padding: 12px;
    border-radius: 26px;
    background: rgba(255,255,255,.72);
    border: 1.5px solid var(--glass-line);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(16px);
  }
  body.lite .topbar__actions { background: rgba(255, 255, 255, 0.92); }
  .topbar__right.is-open .topbar__actions { display: grid; animation: menu-pop .18s ease-out both; }
  .iconbtn { width: 42px; height: 42px; }
  .topbar__actions .kidchip {
    width: 42px;
    height: 42px;
    padding: 4px;
    justify-content: center;
  }
  .topbar__actions #kidChipName,
  .topbar__actions .kidchip__swap { display: none; }
  .hello { display: none; }

  /* фильтры — горизонтальная лента вместо переноса */
  .libbar { gap: 10px; }
  .ages, .cats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .ages::-webkit-scrollbar, .cats::-webkit-scrollbar { display: none; }
  .agetab, .cattab { flex: 0 0 auto; }
}

@keyframes menu-pop {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 560px) {
  .screen { padding: 14px; min-height: calc(100vh - 116px); }
  .namebox__row { flex-direction: column; }
  .btn--go { width: 100%; }
  /* бренд компактнее, чтобы название влезало целиком */
  .brand { gap: 8px; }
  .brand__mark { width: 156px; height: 59px; }
  .iconbtn { width: 40px; height: 40px; }
  .iconbtn svg { width: 20px; height: 20px; }
  .topbar__actions { grid-template-columns: repeat(3, 40px); gap: 8px; padding: 11px; }

  /* чип ребёнка в шапке — только аватар, чтобы влезало */
  #kidChipName, .kidchip__swap { display: none; }
  .kidchip { padding: 4px; }

  /* выбор детей — две колонки */
  .kids__grid { gap: 14px; }
  .kidcard { width: 142px; padding: 18px 12px; }
  .kidcard__ava { width: 76px; height: 76px; }
  .kidcard__ava svg { width: 58px; height: 58px; }

  /* карточки сказок — компактная сетка по две */
  .cards { gap: 10px; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .card { min-width: 0; border-radius: 18px; }
  .card__cover { height: 112px; }
  .card__image { width: calc(100% + 2px); height: calc(100% + 2px); margin: -1px; max-width: none; }
  .card__art { width: 92px; height: 92px; }
  .card__name { padding: 22px 10px 9px; font-size: 14px; line-height: 1.08; }
  .card__body { padding: 11px 10px 13px; }
  .card__meta { display: block; font-size: 10px; line-height: 1.25; }
  .card__lesson { display: none; }
  .card__go { padding-top: 10px; font-size: 11px; }
  .card__go svg { width: 14px; height: 14px; }
  .offlinebtn,.offlinebadge { min-height: 25px; margin-top: 8px; padding: 5px 8px; font-size: 9px; }
  .offlinegroup { gap: 4px; margin-top: 8px; }
  .card__progress { top: 7px; right: 7px; padding: 4px 7px; font-size: 9px; }
  .card__progress svg { width: 10px; height: 10px; }
  .card__crown { top: 7px; left: 7px; width: 28px; height: 28px; }

  /* читалка */
  .page { padding: 24px 18px; border-radius: 22px; }
  .page__emoji svg { width: 84px; height: 84px; }
  .page__text p { font-size: 17px; line-height: 1.66; margin-bottom: 14px; }
  .choice { font-size: 16px; padding: 14px 16px; }
  .voicebar { gap: 7px; }
  .voicebtn { font-size: 14px; padding: 10px 16px 10px 13px; }
  .chipbtn, .autoread { padding: 9px 12px; font-size: 13px; }

  /* концовка — кнопки в столбик */
  .ending { padding: 32px 22px; }
  .ending__btns { flex-direction: column; }
  .btn--again, .btn--lib, .btn--map-reward { width: 100%; }

  /* кабинет */
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat:last-child { grid-column: 1 / -1; }
  .profile__hero { flex-direction: column; text-align: center; gap: 14px; }
  .collstory { padding: 16px; }
  .collstory__top { align-items: flex-start; }
  .collstory__cover { width: 72px; height: 52px; }
  .collstory__count { font-size: 12px; padding: 5px 9px; }
  .collstory__grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .endcard { min-height: 132px; padding: 14px 10px; }
  .achievements { grid-template-columns: 1fr; }
  .avatarpick { grid-template-columns: repeat(4, minmax(44px, 54px)); justify-content: center; }
  .prem--cta, .prem--on { padding: 16px; gap: 13px; }

  /* paywall — нижний лист на всю ширину */
  .paywall { padding: 0; place-items: end center; }
  .paywall__sheet { max-width: none; width: 100%; border-radius: 26px 26px 0 0;
    max-height: 94vh; padding: 26px 20px 24px; }
  .pwcard { height: 152px; }
  .pwcard__num { font-size: 19px; }
  .pwtitle { font-size: 24px; }

  /* режим чтения */
  .focusexit { top: 14px; right: 14px; width: 46px; height: 46px; }
  body.focus .reader { max-width: 100%; }
  body.focus .page { padding: 26px 20px; }
  body.focus .page__text p { font-size: 19px; line-height: 1.8; }
}

@media (max-width: 340px) {
  .brand__name { font-size: 15px; }    /* самый узкий экран — название всё равно видно */
  .topbar__right { gap: 6px; }
}

/* Основная карта и единая адаптивная навигация */
.screen--map { width: 100%; padding: 0; align-items: flex-start; background: #dcecff; }
.storyworld { position: relative; width: 100%; margin: 0 auto; padding-bottom: calc(110px + env(safe-area-inset-bottom)); display: grid; overflow: hidden; background: #dcecff url('assets/map/map-sky-long-v1.jpg') center top / cover no-repeat; box-shadow: 0 24px 70px rgba(74,58,116,.2); }
.storymap {
  position: relative;
  width: 100%;
  height: calc(min(100vw,941px) * 1672 / 941 * 1.14);
  margin: 0;
  overflow: visible;
  border-radius: 0;
  --parallax-y: 0px;
  background: transparent;
}
.storymap__sky { display: none; }
.storymap__bg { position: absolute; z-index: 1; left: 50%; top: 0; width: min(114%,1073px); height: 100%; object-fit: contain; transform: translate3d(-50%,var(--parallax-y),0); will-change: transform; filter: drop-shadow(0 18px 28px rgba(83,76,128,.12)); }
.storymap__objects { position: absolute; z-index: 2; left: 50%; top: 0; width: min(114%,1073px); height: 100%; transform: translateX(-50%); }
.storymap__fog { position: absolute; z-index: 10; inset: 0; overflow: visible; background: transparent; transition: visibility 0s linear 1.95s; }
.storymap__fog > img { position: absolute; left: 50%; width: min(88%,820px); filter: none; transition: transform 1.9s cubic-bezier(.18,.72,.18,1), opacity 1.65s ease; }
.storymap__fog > img:nth-child(1) { top: -4%; transform: translateX(-82%) scale(1.3); }
.storymap__fog > img:nth-child(2) { top: 16%; transform: translateX(-18%) scale(1.35) scaleX(-1); }
.storymap__fog > img:nth-child(3) { top: 38%; transform: translateX(-72%) scale(1.42); }
.storymap__fog > img:nth-child(4) { top: 59%; transform: translateX(-24%) scale(1.38) scaleX(-1); }
.storymap__gate { position: absolute; z-index: 2; left: 50%; top: 50%; width: min(82%,360px); padding: 18px; transform: translate(-50%,-50%); text-align: center; border: 2px solid rgba(255,255,255,.92); border-radius: 24px; color: #5f547d; background: rgba(255,255,255,.88); box-shadow: 0 18px 45px rgba(65,51,101,.2); font-family: var(--font-d); }
.storymap__gate:disabled { cursor: default; }
.storymap.is-zone-ready .storymap__gate { color: #765314; border-color: rgba(255,244,184,.96); background: linear-gradient(145deg,rgba(255,252,224,.97),rgba(255,220,119,.95)); box-shadow: 0 0 0 8px rgba(255,221,111,.16),0 18px 50px rgba(151,106,25,.3); cursor: pointer; animation: zone-ready-glow 1.8s ease-in-out infinite; }
.storymap.is-zone-ready .storymap__gate span { color: #89651c; }
.storymap.is-zone-ready::after { content: '✦  ✧  ✦'; position: absolute; z-index: 11; left: 50%; top: 39%; transform: translateX(-50%); color: #fff7bb; font-size: clamp(22px,5vw,42px); letter-spacing: 18px; text-shadow: 0 0 12px #ffc949,0 0 24px #fff; pointer-events: none; animation: zone-sparkles 1.5s ease-in-out infinite; }
.storymap__gate b, .storymap__gate span { display: block; }
.storymap__gate b { font-size: 19px; }
.storymap__gate span { margin-top: 5px; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.storymap.is-clearing .storymap__fog { visibility: hidden; pointer-events: none; }
.storymap.is-unlocked:not(.is-clearing) .storymap__fog { display: none; }
.storymap.is-clearing .storymap__fog > img:nth-child(1) { opacity: 0; transform: translate3d(-125%,-20%,0) scale(1.3); }
.storymap.is-clearing .storymap__fog > img:nth-child(2) { opacity: 0; transform: translate3d(55%,-12%,0) scale(1.35) scaleX(-1); }
.storymap.is-clearing .storymap__fog > img:nth-child(3) { opacity: 0; transform: translate3d(-115%,5%,0) scale(1.42); }
.storymap.is-clearing .storymap__fog > img:nth-child(4) { opacity: 0; transform: translate3d(52%,12%,0) scale(1.38) scaleX(-1); }
.storymap.is-clearing .storymap__gate { opacity: 0; transform: translate(-50%,-58%) scale(.88); transition: opacity .45s ease, transform .6s ease; }
.storymap__progress { position: absolute; z-index: 4; left: 50%; top: 18px; padding: 9px 14px; display: grid; grid-template-columns: auto auto; column-gap: 6px; transform: translateX(-50%); border: 2px solid rgba(255,255,255,.9); border-radius: 18px; color: #66567f; background: rgba(255,255,255,.9); box-shadow: 0 10px 25px rgba(61,48,92,.16); font-family: var(--font-d); }
.storymap__progress b { font-size: 14px; }
.storymap__progress small { grid-column: 1 / 3; color: var(--ink-soft); font-size: 9px; font-weight: 700; }
.storymap__sticker {
  position: absolute;
  left: calc(var(--mx) * 1%);
  top: calc(var(--my) * 1%);
  width: clamp(68px, 14vw, 112px);
  padding: 0;
  border: 0;
  background: transparent;
  transform: translate(-50%,-50%);
  cursor: pointer;
  font-family: var(--font-d);
}
.storymap__sticker > span { position: relative; display: block; aspect-ratio: 1; border: 6px solid #fff; border-radius: 50%; overflow: hidden; background: #fff; box-shadow: 0 9px 16px rgba(64,49,96,.27); }
.storymap__sticker img { width: 100%; height: 100%; object-fit: cover; }
.storymap__sticker em { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 26px; background: rgba(91,82,111,.28); }
.storymap__sticker b { display: block; width: max-content; max-width: 150%; margin: -2px 50% 0; padding: 5px 9px; transform: translateX(-50%); overflow: hidden; color: #62557e; background: rgba(255,255,255,.94); border-radius: 12px; box-shadow: 0 5px 12px rgba(69,52,99,.15); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.storymap__sticker.is-locked > span { filter: grayscale(1); opacity: .78; }
.storymap__sticker.is-locked { animation: map-invite 2.4s ease-in-out infinite; }
.storymap__sticker.is-unlocking { z-index: 4; animation: map-stick .85s cubic-bezier(.18,1.4,.36,1); }
.storymap__sticker.is-unlocking > span { filter: none; opacity: 1; }
.storymap__sticker--character { width: min(22%,224px); transform: translate(-50%,-72%) scale(var(--map-item-scale,1)); }
.storymap__sticker--scene.is-open { width: min(38%,370px); transform: translate(-50%,-58%) scale(var(--map-item-scale,1)); }
.storymap__sticker--scene.is-locked { width: min(38%,370px); transform: translate(-50%,-58%) scale(var(--map-item-scale,1)); }
.storymap__sticker--scene.is-ready { z-index: 6; width: min(38%,370px); transform: translate(-50%,-58%) scale(var(--map-item-scale,1)); }
.storymap__sticker--scene.is-ready img { filter: saturate(1.08) drop-shadow(0 0 9px rgba(255,224,111,.8)) drop-shadow(0 10px 9px rgba(91,67,30,.25)); animation: map-ready-glow 1.65s ease-in-out infinite; }
.storymap__name-ribbon { position: absolute; z-index: 7; left: 50%; bottom: -2%; width: 82%; aspect-ratio: 1000/217; display: grid; place-items: center; padding: 0 15%; transform: translateX(-50%); color: #66547b; background: url('assets/map/labels/name-ribbon-parchment-ui-v1.webp') center / contain no-repeat; filter: drop-shadow(0 5px 5px rgba(62,48,82,.2)); font-style: normal; pointer-events: none; }
.storymap__name-ribbon b { display: block; width: auto; max-width: 100%; margin: 0; padding: 0; transform: none; overflow: hidden; border-radius: 0; color: inherit; background: transparent; box-shadow: none; font-family: var(--font-d); font-size: clamp(7px,1.4vw,13px); font-weight: 800; line-height: 1.05; text-align: center; text-overflow: ellipsis; text-shadow: 0 1px rgba(255,255,255,.8); white-space: nowrap; }
.storymap__sticker.is-locked .storymap__name-ribbon { color: #736b80; filter: grayscale(.25) drop-shadow(0 5px 5px rgba(62,48,82,.17)); }
.storymap__sticker.is-ready .storymap__name-ribbon { filter: saturate(1.1) drop-shadow(0 0 7px rgba(255,218,94,.65)) drop-shadow(0 5px 5px rgba(62,48,82,.2)); }
.storymap__ready-label { position: absolute; z-index: 8; left: 50%; bottom: 17%; width: max-content; padding: 6px 11px; transform: translateX(-50%); border: 2px solid rgba(255,255,255,.92); border-radius: 16px; color: #775616; background: linear-gradient(145deg,#fff9ce,#ffd875); box-shadow: 0 8px 22px rgba(120,82,22,.28); font-size: clamp(8px,1.6vw,11px); font-style: normal; font-weight: 900; }
.storymap__sparkles::before,.storymap__sparkles::after { content: '✦'; position: absolute; z-index: 7; color: #fff7ae; text-shadow: 0 0 8px #ffbd39,0 0 15px #fff; animation: map-ready-spark 1.25s ease-in-out infinite; }
.storymap__sparkles::before { left: 18%; top: 20%; font-size: 24px; }
.storymap__sparkles::after { right: 18%; top: 38%; font-size: 17px; animation-delay: -.55s; }
.storymap__sticker.is-arrival-focus { z-index: 8; }
.storymap__sticker.is-arrival-focus::before { content: ''; position: absolute; inset: 7% 10%; border: 4px solid rgba(255,239,146,.9); border-radius: 50%; box-shadow: 0 0 18px #ffd75c,0 0 42px rgba(255,225,109,.9); animation: map-arrival-ring 1s ease-out 3; }
.storymap__sticker.is-revealing { pointer-events: none; animation: map-reward-reveal .9s cubic-bezier(.2,.9,.25,1) both; }
.storymap__sticker.is-revealing::before { content: ''; position: absolute; z-index: 8; inset: -18%; border-radius: 50%; background: radial-gradient(circle,rgba(255,255,255,.98) 0,rgba(255,226,102,.75) 25%,rgba(255,210,73,.18) 55%,transparent 72%); mix-blend-mode: screen; animation: map-reveal-light .9s ease-out both; }
.storymap__sticker.is-materializing { z-index: 9; pointer-events: none; }
.storymap__sticker.is-materializing img { animation: map-reward-land 1.08s cubic-bezier(.16,1.25,.3,1) both; transform-origin: 50% 68%; }
.storymap__sticker.is-materializing::before { content: '✦  ✧  ✦'; position: absolute; z-index: 10; left: 50%; top: 42%; width: 130%; transform: translate(-50%,-50%); color: #fff3a4; font-size: clamp(20px,4vw,34px); letter-spacing: 18px; text-align: center; text-shadow: 0 0 10px #ffc743,0 0 24px #fff; pointer-events: none; animation: map-materialize-sparks 1.05s ease-out both; }
.storymap__sticker--character::after { content: ''; position: absolute; z-index: -1; left: 19%; right: 19%; bottom: 13%; height: 13%; border-radius: 50%; background: rgba(80,91,92,.16); filter: blur(7px); transform: scaleY(.45); }
.storymap__sticker--character > span { border: 0; border-radius: 0; overflow: visible; background: transparent; box-shadow: none; }
.storymap__sticker--character img { object-fit: contain; transform: translate(var(--reward-art-x,0),var(--reward-art-y,0)) scale(var(--reward-art-scale,1)); transform-origin: 50% 50%; filter: saturate(.88) contrast(.96) drop-shadow(0 7px 5px rgba(70,73,92,.18)); }
.storymap__sticker--character.is-locked { animation: none; }
.storymap__sticker--character.is-locked > span { filter: none; opacity: 1; }
.storymap__sticker--character.is-locked::after { left: 23%; right: 23%; bottom: 16%; opacity: .52; }
.storymap__sticker--character.is-locked img { opacity: 1; filter: saturate(.88) contrast(.96) drop-shadow(0 7px 5px rgba(48,43,59,.2)); }
.storymap__sticker--character.is-locked img { animation: map-locked-shimmer 3.6s ease-in-out infinite; }
.storymap__speech { position: absolute; left: 50%; bottom: 94%; width: max-content; max-width: min(210px,64vw); padding: 8px 11px; transform: translate(-50%,8px) scale(.9); border: 2px solid rgba(255,255,255,.95); border-radius: 15px; color: #62557e; background: rgba(255,255,255,.96); box-shadow: 0 9px 22px rgba(61,48,92,.2); font-size: 11px; font-style: normal; font-weight: 800; opacity: 0; pointer-events: none; }
.storymap__sticker.is-reacting { z-index: 7; }
.storymap__sticker.is-reacting > span { animation: map-character-wave .7s ease-in-out 2; }
.storymap__sticker.is-reacting .storymap__speech { animation: map-speech 2.1s ease both; }
@keyframes map-invite { 50% { transform: translate(-50%,-55%) rotate(2deg) scale(1.035); } }
@keyframes map-stick { 0% { transform: translate(-50%,80%) scale(.2) rotate(-15deg); opacity: 0; } 60% { transform: translate(-50%,-56%) scale(1.22) rotate(6deg); } 100% { transform: translate(-50%,-50%) scale(1); opacity: 1; } }
@keyframes map-character-wave { 50% { transform: translateY(-4%) rotate(-2deg) scale(1.045); } }
@keyframes map-speech { 10%,82% { opacity: 1; transform: translate(-50%,0) scale(1); } 100% { opacity: 0; transform: translate(-50%,-5px) scale(.96); } }
@keyframes map-locked-shimmer { 0%,100% { opacity: .92; filter: saturate(.78) brightness(.9) drop-shadow(0 7px 5px rgba(48,43,59,.18)); } 50% { opacity: 1; filter: saturate(.92) brightness(1.08) drop-shadow(0 7px 9px rgba(154,135,205,.32)); } }
@keyframes map-ready-glow { 50% { filter: saturate(1.18) brightness(1.1) drop-shadow(0 0 16px rgba(255,224,111,.98)) drop-shadow(0 12px 11px rgba(91,67,30,.3)); } }
@keyframes map-ready-spark { 0%,100% { opacity: .35; transform: scale(.65) rotate(0); } 50% { opacity: 1; transform: scale(1.25) rotate(25deg); } }
@keyframes map-arrival-ring { 0% { opacity: 0; transform: scale(.7); } 35% { opacity: 1; } 100% { opacity: 0; transform: scale(1.22); } }
@keyframes map-reward-reveal { 0% { filter: brightness(1); } 45% { transform: translate(-50%,-58%) scale(calc(var(--map-item-scale,1) * 1.12)); filter: brightness(1.45); } 100% { transform: translate(-50%,-58%) scale(var(--map-item-scale,1)); filter: brightness(1); } }
@keyframes map-reveal-light { 0% { opacity: 0; transform: scale(.4); } 45% { opacity: 1; } 100% { opacity: 0; transform: scale(1.35); } }
@keyframes map-reward-land { 0% { opacity: 0; transform: translate(var(--reward-art-x,0),calc(var(--reward-art-y,0) - 34%)) scale(var(--reward-art-scale,1)) scale(.28) rotate(-14deg); filter: brightness(2.2) saturate(.5) blur(4px); } 48% { opacity: 1; transform: translate(var(--reward-art-x,0),calc(var(--reward-art-y,0) + 5%)) scale(var(--reward-art-scale,1)) scale(1.13) rotate(4deg); filter: brightness(1.35) saturate(1.15) blur(0); } 72% { transform: translate(var(--reward-art-x,0),calc(var(--reward-art-y,0) - 2%)) scale(var(--reward-art-scale,1)) scale(.96) rotate(-1.5deg); } 100% { opacity: 1; transform: translate(var(--reward-art-x,0),var(--reward-art-y,0)) scale(var(--reward-art-scale,1)); filter: none; } }
@keyframes map-materialize-sparks { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.3) rotate(-12deg); } 32% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.45) rotate(18deg); } }
@keyframes zone-ready-glow { 50% { transform: translate(-50%,-52%) scale(1.025); box-shadow: 0 0 0 12px rgba(255,221,111,.12),0 22px 56px rgba(151,106,25,.38); } }
@keyframes zone-sparkles { 50% { opacity: .45; transform: translateX(-50%) translateY(-7px) scale(.92); } }

.btn--map-reward { flex-basis: 100%; color: #765314; border: 2px solid rgba(255,244,184,.95); background: linear-gradient(145deg,#fff9d7,#ffd669); box-shadow: 0 10px 25px rgba(148,101,25,.24); animation: map-button-glow 1.8s ease-in-out infinite; }
@keyframes map-button-glow { 50% { transform: translateY(-2px); box-shadow: 0 0 0 7px rgba(255,219,91,.12),0 14px 30px rgba(148,101,25,.32); } }

.mapeditor { position: fixed; z-index: 90; right: max(12px,env(safe-area-inset-right)); bottom: max(96px,calc(env(safe-area-inset-bottom) + 88px)); width: min(310px,calc(100vw - 24px)); padding: 14px; display: grid; gap: 9px; border: 1px solid rgba(151,130,192,.28); border-radius: 18px; color: #5f547d; background: rgba(255,255,255,.94); box-shadow: 0 18px 45px rgba(55,42,83,.24); backdrop-filter: blur(16px); font-family: var(--font-d); }
.mapeditor b, .mapeditor span, .mapeditor small { display: block; }
.mapeditor label { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; }
.mapeditor input { width: 100%; }
.mapeditor div { display: flex; gap: 6px; }
.mapeditor button { flex: 1; padding: 8px 6px; border: 0; border-radius: 10px; color: #fff; background: #8f7ac2; font-family: inherit; font-size: 11px; font-weight: 800; cursor: pointer; }
.mapeditor small { color: var(--ink-soft); font-size: 10px; }
.map-editor-active .storymap__sticker--scene { touch-action: none; cursor: move; }
.map-editor-active .storymap__sticker--scene.is-editor-selected { outline: 3px dashed rgba(139,112,193,.72); outline-offset: 5px; }
@media (prefers-reduced-motion: reduce) { .storymap__sticker--character.is-locked img,.storymap__sticker--scene.is-ready img,.storymap__sparkles::before,.storymap__sparkles::after,.storymap.is-zone-ready .storymap__gate,.storymap.is-zone-ready::after,.btn--map-reward { animation: none; } }

.maprewardpreview { position: fixed; z-index: 120; inset: 0; width: 100%; height: 100dvh; min-height: 100svh; box-sizing: border-box; display: grid; place-items: center; padding: max(18px,env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left)); overflow: hidden; visibility: hidden; opacity: 0; transition: opacity .25s ease,visibility 0s linear .25s; }
.maprewardpreview.is-open { visibility: visible; opacity: 1; transition-delay: 0s; }
.maprewardpreview__backdrop { position: absolute; inset: 0; border: 0; background: rgba(42,34,60,.68); backdrop-filter: blur(12px); cursor: pointer; }
.maprewardpreview__panel { position: relative; width: min(680px,100%); max-height: 100%; box-sizing: border-box; padding: 20px 20px 18px; overflow: auto; overscroll-behavior: contain; text-align: center; border: 1px solid rgba(255,255,255,.72); border-radius: 28px; color: #5f547d; background: linear-gradient(160deg,rgba(255,255,255,.97),rgba(239,232,252,.96)); box-shadow: 0 28px 80px rgba(28,20,45,.42); font-family: var(--font-d); }
.maprewardpreview__close { position: absolute; z-index: 4; top: 10px; right: 12px; width: 38px; height: 38px; border: 0; border-radius: 50%; color: #6e6286; background: rgba(255,255,255,.86); box-shadow: 0 5px 16px rgba(58,44,84,.16); font-size: 27px; cursor: pointer; }
.maprewardpreview__art { --preview-rx: -6deg; --preview-ry: 0deg; --shine-x: 50%; --shine-y: 55%; position: relative; width: min(100%,600px); margin: 0 auto 6px; aspect-ratio: 4/3; transform: perspective(900px) rotateX(var(--preview-rx)) rotateY(var(--preview-ry)); transform-style: preserve-3d; transition: transform .16s ease-out; touch-action: none; cursor: grab; user-select: none; }
.maprewardpreview__art.is-dragging { cursor: grabbing; transition: none; }
.maprewardpreview__art img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 20px 18px rgba(55,43,82,.28)); }
.maprewardpreview__art i { position: absolute; inset: 5%; border-radius: 38%; background: radial-gradient(circle at var(--shine-x) var(--shine-y),rgba(255,255,255,.82) 0,rgba(255,230,255,.28) 13%,rgba(175,225,255,.12) 25%,transparent 44%); mix-blend-mode: screen; opacity: .72; pointer-events: none; transform: translateZ(12px); }
.maprewardpreview__panel > b { display: block; font-size: clamp(21px,4vw,30px); }
.maprewardpreview__panel > p { margin: 6px auto 0; color: var(--ink-soft); font-size: 14px; font-weight: 700; }
.maprewardpreview__panel > small { display: block; margin-top: 7px; color: #9a8fad; font-size: 10px; font-weight: 700; }
body.map-preview-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .maprewardpreview__art { transition: none; transform: none; } }

.orientationguard { position: fixed; z-index: 1000; inset: 0; width: 100%; height: 100dvh; box-sizing: border-box; display: none; place-items: center; padding: max(18px,env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left)); color: #5f547d; background: radial-gradient(circle at 50% 35%,rgba(255,255,255,.98),rgba(239,229,255,.98) 48%,rgba(215,233,255,.98)); font-family: var(--font-d); }
body.orientation-blocked { overflow: hidden !important; }
body.orientation-blocked .orientationguard { display: grid; }
.orientationguard__card { width: min(420px,88vw); padding: 24px; text-align: center; border: 2px solid rgba(255,255,255,.9); border-radius: 30px; background: rgba(255,255,255,.72); box-shadow: 0 24px 70px rgba(68,49,103,.2); backdrop-filter: blur(14px); }
.orientationguard__phone { position: relative; width: 64px; height: 106px; margin: 0 auto 17px; border: 5px solid #8c79b6; border-radius: 15px; background: linear-gradient(150deg,#fff7fd,#dbeeff); box-shadow: 0 13px 25px rgba(83,62,126,.22); animation: orientation-phone 1.7s ease-in-out infinite; }
.orientationguard__phone i { position: absolute; left: 50%; bottom: 6px; width: 12px; height: 4px; transform: translateX(-50%); border-radius: 4px; background: #a795c9; }
.orientationguard__phone span { position: absolute; left: calc(100% + 14px); top: 34%; color: #e5a63e; font-size: 32px; font-weight: 900; text-shadow: 0 2px #fff; }
.orientationguard h2 { margin: 0; font-size: clamp(24px,7vw,34px); }
.orientationguard p { margin: 7px auto 0; color: #897ba3; font-size: clamp(13px,4vw,17px); font-weight: 700; line-height: 1.35; }
@keyframes orientation-phone { 0%,100% { transform: rotate(0deg); } 45%,60% { transform: rotate(-90deg); } }
@media (prefers-reduced-motion: reduce) { .orientationguard__phone { animation: none; } }

.mainnav {
  position: fixed;
  z-index: 46;
  top: auto;
  left: 50%;
  bottom: 18px;
  display: none;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 4px;
  width: min(520px, calc(100vw - 32px));
  padding: 6px;
  transform: translateX(-50%);
  border: 1px solid rgba(170,145,218,.25);
  border-radius: 22px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 14px 35px -24px rgba(66,43,103,.6);
  backdrop-filter: blur(18px);
}
body.has-main-nav .mainnav { display: grid; }
body.has-main-nav .topbar__right { display: none; }
body.has-main-nav .foot { display: none; }
body.has-main-nav #screen-profile .ghostback,
body.has-main-nav #screen-rewards .ghostback { display: none; }
body.map-screen .topbar { position: fixed; z-index: 50; top: 0; left: 0; padding: 8px 12px; pointer-events: none; }
body.map-screen .brand { pointer-events: auto; }
body.map-screen .brand__mark { width: 170px; height: 66px; }
@media (min-width: 761px) { body.has-main-nav .stage { padding-bottom: 92px; } }
.mainnav__item { position: relative; min-width: 0; min-height: 48px; display: grid; place-items: center; align-content: center; gap: 1px; border: 0; border-radius: 16px; color: var(--ink-soft); background: transparent; cursor: pointer; font-family: var(--font-d); }
.mainnav__item span { font-size: 20px; line-height: 1; }
.mainnav__item span svg { width: 23px; height: 23px; display: block; }
.mainnav__item .mainnav__mapicon svg { stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.mainnav__item b { font-size: 11px; }
.mainnav__item.is-on { color: #fff; background: linear-gradient(135deg,var(--lav-2),var(--rose-2)); }
.mainnav__item i { position: absolute; top: 5px; left: calc(50% + 10px); width: 8px; height: 8px; border: 2px solid #fff; border-radius: 50%; background: #ff6e9f; }

@media (max-width: 760px) {
  body.has-main-nav .stage { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
  .storyworld, .storymap { width: 100%; margin: 0; border-radius: 0; box-shadow: none; }
  .storymap { height: calc(100vw * 1672 / 941); }
  .storymap__bg { width: calc(100% + 6px); max-width: none; }
  .storymap__objects { width: 100%; }
  .storymap__sticker { width: clamp(62px,20vw,90px); }
  .storymap__sticker--character { width: 22%; }
  .storymap__sticker--scene.is-open { width: 34%; }
  .storymap__sticker--scene.is-locked { width: 34%; }
  .storymap__sticker--scene.is-ready { width: 34%; }
  .storymap__name-ribbon { bottom: -5%; width: 94%; padding-inline: 13%; }
  .storymap__name-ribbon b { max-width: 100%; font-size: clamp(6px,1.7vw,9px); white-space: normal; line-height: .95; }
  .mainnav { top: auto; left: max(8px,env(safe-area-inset-left)); right: max(8px,env(safe-area-inset-right)); bottom: max(10px,env(safe-area-inset-bottom)); width: auto; min-height: 72px; padding: 7px 8px; transform: none; border-width: 1px; border-radius: 22px; }
  .mainnav__item { min-height: 58px; }
  .mainnav__item span { font-size: 22px; }
  .mainnav__item span svg { width: 25px; height: 25px; }
  .mainnav__item b { font-size: 11px; }
  .maprewardpreview { padding: max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left)); }
  .maprewardpreview__panel { width: 100%; max-height: 100%; padding: 14px 14px 12px; border-radius: 24px; }
  .maprewardpreview__art { width: min(100%,72dvh,600px); margin-bottom: 2px; }
  .maprewardpreview__close { top: 8px; right: 8px; }
  .maprewardpreview__panel > b { font-size: clamp(20px,6vw,27px); }
  .maprewardpreview__panel > p { margin-top: 4px; font-size: clamp(12px,3.7vw,14px); line-height: 1.25; }
  .maprewardpreview__panel > small { margin-top: 5px; font-size: 9px; }
}
@media (max-width: 760px) and (max-height: 620px) {
  .maprewardpreview__art { width: min(88%,62dvh); }
  .maprewardpreview__panel { padding-top: 10px; padding-bottom: 9px; }
  .maprewardpreview__panel > p { font-size: 12px; }
  .maprewardpreview__panel > small { display: none; }
}
body.map-screen.has-main-nav .stage { padding-bottom: 0; }

/* В установленном PWA не показываем системное выделение и callout по долгому нажатию. */
@media (display-mode: standalone) {
  html, body {
    overscroll-behavior: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }
  button, a, img, .card, .storymap__sticker {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  input, textarea, [contenteditable="true"] {
    -webkit-user-select: text;
    user-select: text;
  }
}
html.is-pwa, html.is-pwa body {
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
html.is-pwa button, html.is-pwa a, html.is-pwa img,
html.is-pwa .card, html.is-pwa .storymap__sticker {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
html.is-pwa input, html.is-pwa textarea, html.is-pwa [contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}

.screen--rewards { width: 100%; }
.rewards-page__head { display: flex; align-items: center; gap: 16px; margin: 0 0 22px; padding: 18px 20px; border-radius: var(--radius); background: var(--glass-strong); border: 1.5px solid var(--glass-line); box-shadow: var(--shadow-soft); }
.rewards-page__head > span { width: 58px; height: 58px; flex: 0 0 auto; display: grid; place-items: center; color: #fff; border-radius: 18px; background: linear-gradient(135deg,var(--lav-2),var(--rose-2)); }
.rewards-page__head > span svg { width: 32px; height: 32px; }
.rewards-page__head h2, .rewards-page__head p { margin: 0; }
.rewardtabs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: 0 0 18px; }
.rewardtabs__item { min-width: 0; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 10px; padding: 12px; text-align: left; border: 1.5px solid var(--glass-line); border-radius: 18px; color: var(--ink); background: rgba(255,255,255,.62); box-shadow: 0 11px 24px -22px rgba(71,48,100,.8); cursor: pointer; transition: transform .2s,background .2s,border-color .2s; }
.rewardtabs__item:hover { transform: translateY(-2px); }
.rewardtabs__item.is-on { color: #fff; border-color: transparent; background: linear-gradient(135deg,#7863b7,#cf79a6); box-shadow: 0 14px 28px -18px rgba(89,55,126,.8); }
.rewardtabs__icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: #8166a6; background: #f2eafa; font-size: 20px; }
.rewardtabs__item.is-on .rewardtabs__icon { color: #fff; background: rgba(255,255,255,.17); }
.rewardtabs__item > span:nth-child(2) { min-width: 0; display: grid; }
.rewardtabs__item b { overflow: hidden; text-overflow: ellipsis; font: 800 13px var(--font-d); white-space: nowrap; }
.rewardtabs__item small { overflow: hidden; text-overflow: ellipsis; color: #94869d; font-size: 9.5px; font-weight: 700; white-space: nowrap; }
.rewardtabs__item.is-on small { color: rgba(255,255,255,.72); }
.rewardtabs__item i { padding: 5px 7px; border-radius: 999px; color: #826b91; background: #f4edf7; font: 800 9px var(--font-d); font-style: normal; }
.rewardtabs__item.is-on i { color: #fff; background: rgba(255,255,255,.17); }
.rewardpanel { display: none; }
.rewardpanel.is-on { display: block; animation: fadeIn .22s ease both; }
.rewardpanel__head { position: relative; overflow: hidden; margin-bottom: 14px; padding: 18px 20px; border: 1.5px solid var(--glass-line); border-radius: 20px; background: linear-gradient(130deg,rgba(255,255,255,.9),rgba(246,238,252,.84)); }
.rewardpanel__head::after { content:'✦'; position:absolute; right:18px; top:11px; color:rgba(183,124,255,.2); font-size:53px; transform:rotate(13deg); }
.rewardpanel__head span { color: #a36f9e; font: 800 10px var(--font-d); letter-spacing: .1em; text-transform: uppercase; }
.rewardpanel__head h3 { margin: 3px 0; color: var(--ink); font: 700 23px var(--font-d); }
.rewardpanel__head p { max-width: 620px; color: var(--ink-soft); font-size: 12px; font-weight: 650; line-height: 1.45; }
.reward-challenges { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; padding-bottom: 12px; }
.rewardtask { --rewardtask-accent:#6298b3; min-width: 0; overflow: hidden; border: 1.5px solid color-mix(in srgb,var(--rewardtask-accent) 24%,#fff); border-radius: 22px; background: #fff; box-shadow: 0 16px 32px -25px rgba(63,43,82,.65); }
.rewardtask--night { --rewardtask-accent:#526e9e; }
.rewardtask--cozy { --rewardtask-accent:#a26990; }
.rewardtask.is-done { box-shadow: 0 16px 34px -22px color-mix(in srgb,var(--rewardtask-accent) 65%,transparent); }
.rewardtask__preview { position: relative; height: 132px; background-position: center 35%; background-size: cover; }
.rewardtask__preview::after { content:''; position:absolute; inset:0; background:linear-gradient(180deg,transparent 35%,rgba(31,24,48,.42)); }
.rewardtask__preview > span { position:absolute; z-index:1; left:14px; bottom:12px; width:38px; height:38px; display:grid; place-items:center; border:1px solid rgba(255,255,255,.45); border-radius:13px; color:#fff; background:rgba(67,48,88,.38); backdrop-filter:blur(7px); font-size:19px; }
.rewardtask__body { padding: 14px 15px 16px; }
.rewardtask__status { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.rewardtask__status span { color:var(--rewardtask-accent); font:800 9px var(--font-d); letter-spacing:.08em; text-transform:uppercase; }
.rewardtask__status b { padding:4px 7px; border-radius:999px; color:var(--rewardtask-accent); background:color-mix(in srgb,var(--rewardtask-accent) 10%,#fff); font:800 10px var(--font-d); }
.rewardtask h4 { min-height:38px; margin:8px 0 5px; color:#51445d; font:800 15px/1.25 var(--font-d); }
.rewardtask p { min-height:52px; color:#7c7082; font-size:11px; font-weight:650; line-height:1.45; }
.rewardtask__progress { height:7px; margin:12px 0; overflow:hidden; border-radius:99px; background:#eee8f1; }
.rewardtask__progress i { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--rewardtask-accent),color-mix(in srgb,var(--rewardtask-accent) 55%,#f2a6c7)); }
.rewardtask__foot { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.rewardtask__foot > span { color:#95889b; font-size:9.5px; font-weight:750; }
.rewardtask__foot a { flex:0 0 auto; padding:8px 10px; border-radius:11px; color:#fff; background:var(--rewardtask-accent); font:800 10px var(--font-d); text-decoration:none; }
.rewardtask__foot a:hover { filter:brightness(1.06); }
@media (max-width: 760px) {
  .rewardtabs { gap:6px; }
  .rewardtabs__item { grid-template-columns:1fr; justify-items:center; gap:5px; padding:9px 5px; text-align:center; }
  .rewardtabs__item > span:nth-child(2) small { display:none; }
  .rewardtabs__item i { padding:3px 6px; }
  .reward-challenges { grid-template-columns:1fr; }
  .rewardtask { display:grid; grid-template-columns:112px 1fr; }
  .rewardtask__preview { height:100%; min-height:190px; }
  .rewardtask h4,.rewardtask p { min-height:0; }
}
@media (max-width: 470px) {
  .rewardtask { grid-template-columns:1fr; }
  .rewardtask__preview { min-height:0; height:112px; }
}

.profilesettings { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-bottom: 28px; }
.profilesettings button { min-height: 82px; padding: 14px 16px; display: grid; grid-template-columns: 38px 1fr; grid-template-rows: auto auto; column-gap: 11px; align-items: center; text-align: left; border: 1.5px solid var(--glass-line); border-radius: var(--radius-sm); color: var(--ink); background: var(--glass-strong); box-shadow: var(--shadow-soft); cursor: pointer; font-family: var(--font-d); }
.profilesettings button > span { grid-row: 1 / 3; width: 38px; height: 38px; display: grid; place-items: center; color: #fff; border-radius: 12px; background: linear-gradient(135deg,var(--lav-2),var(--rose-2)); }
.profilesettings button > span svg { width: 21px; height: 21px; }
.profilesettings button b { align-self: end; font-size: 14px; }
.profilesettings button small { align-self: start; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.profilesettings button:active { transform: scale(.98); }

.card, .collstory, .ach, .reflectionitem { content-visibility: auto; contain-intrinsic-size: auto 260px; }
@media (max-width: 520px) { .profilesettings { grid-template-columns: 1fr; } }

body.medal-open { overflow: hidden; }
.medalview { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; }
.medalview[hidden] { display: none; }
.medalview__backdrop { position: absolute; inset: 0; border: 0; background: rgba(47,33,76,.52); backdrop-filter: blur(12px); cursor: pointer; }
.medalview__card { position: relative; width: min(430px,100%); padding: 42px 30px 32px; overflow: hidden; text-align: center; border: 2px solid rgba(255,255,255,.88); border-radius: 34px; background: linear-gradient(155deg,rgba(255,255,255,.98),rgba(255,240,249,.96)); box-shadow: 0 35px 90px rgba(40,25,72,.38); animation: medal-view-in .45s cubic-bezier(.18,1.35,.36,1); }
.medalview__close { position: absolute; z-index: 3; top: 14px; right: 14px; width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(157,132,204,.2); border-radius: 50%; color: var(--ink); background: rgba(255,255,255,.82); cursor: pointer; }
.medalview__close svg { width: 21px; height: 21px; }
.medalview__glow { position: absolute; left: 50%; top: 36px; width: 260px; height: 260px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle,rgba(255,220,115,.55),rgba(224,181,255,.22) 45%,transparent 70%); }
.medalview__image { position: relative; z-index: 1; width: min(230px,66vw); aspect-ratio: 1; display: block; margin: 0 auto 14px; object-fit: contain; filter: drop-shadow(0 20px 18px rgba(91,59,129,.25)); }
.medalview__image[hidden], .medalview__sticker[hidden] { display: none; }
.medalview__sticker { position: relative; z-index: 1; width: min(250px,68vw); aspect-ratio: 1; margin: 0 auto 16px; }
.medalview__locked-ending { width: 100%; height: 100%; display: grid; place-items: center; color: #a99bc4; border: 7px solid rgba(255,255,255,.9); border-radius: 50%; background: linear-gradient(145deg,#ebe7f1,#cfc7dc); box-shadow: 0 20px 35px rgba(68,54,87,.2); }
.medalview__locked-ending svg { width: 42%; height: 42%; }
.medalview.is-ending .medalview__card { background: linear-gradient(155deg,rgba(255,255,255,.98),rgba(242,236,255,.97)); }
.medalview.is-locked .medalview__image { filter: grayscale(1) opacity(.55) drop-shadow(0 15px 14px rgba(75,65,88,.18)); }
.medalview__state { position: relative; z-index: 1; display: inline-block; padding: 7px 13px; border-radius: 999px; color: #8b4d70; background: #ffe1ee; font-family: var(--font-d); font-size: 12px; font-weight: 800; }
.medalview.is-locked .medalview__state { color: #746b86; background: #ece8f2; }
.medalview h2 { position: relative; z-index: 1; margin: 14px 0 7px; color: var(--ink); font-family: var(--font-d); font-size: 27px; }
.medalview p { position: relative; z-index: 1; margin: 0; color: var(--ink-soft); font-weight: 600; line-height: 1.5; }
@keyframes medal-view-in { from { opacity: 0; transform: translateY(28px) scale(.88); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
