:root {
  --night: #121c36;
  --night-2: #1b2848;
  --night-3: #24345a;
  --frost: #eef4f8;
  --ice: #a7bccd;
  --rime: rgba(238, 244, 248, 0.09);
  --rime-edge: rgba(238, 244, 248, 0.22);
  --aurora: #9be7cf;
  --ember: #f3c27e;
  --danger: #ffb4a8;

  --serif: Georgia, "Noto Serif", "PT Serif", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Noto Sans", sans-serif;

  --measure: 34rem;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--night);
  color: var(--frost);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--aurora); outline-offset: 3px; border-radius: 6px; }

.screen { min-height: 100dvh; max-width: 30rem; margin: 0 auto; }

/* ---------- кнопки ---------- */
.btn {
  display: block; width: 100%;
  border: 1px solid var(--rime-edge); border-radius: 14px;
  background: var(--rime); padding: 0.78rem 1rem;
  text-align: left; cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-primary {
  background: var(--frost); color: var(--night); border-color: var(--frost);
  font-weight: 600; text-align: center; font-size: 1.05rem;
}

/* ---------- обложка ---------- */
.cover { display: flex; flex-direction: column; }
.cover { position: relative; }
.cover-art { position: relative; aspect-ratio: 3 / 4; max-height: 62dvh; overflow: hidden; background: var(--night-2); }
.cover-art img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.6s ease; }
.cover-art.ready img { opacity: 1; }
.cover-art::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 55%, var(--night));
}
.cover-body { padding: 0 1.5rem calc(2rem + var(--safe-bottom)); margin-top: -3.5rem; position: relative; }
.cover-genre { margin: 0 0 0.4rem; color: var(--aurora); font-size: 0.9rem; letter-spacing: 0.02em; }
.cover-title { margin: 0 0 0.8rem; font-family: var(--serif); font-weight: 400; font-size: 2.35rem; line-height: 1.08; letter-spacing: -0.01em; }
.cover-tagline { margin: 0 0 1.6rem; font-family: var(--serif); font-size: 1.08rem; line-height: 1.6; color: var(--ice); }
.cover-note { margin: 0.8rem 0 0; text-align: center; color: var(--ice); font-size: 0.9rem; }

/* ---------- настройка героини ---------- */
.setup { display: flex; align-items: flex-end; padding: 1.5rem 1.25rem calc(1.5rem + var(--safe-bottom)); }
.setup-card { width: 100%; }
.setup-title { font-family: var(--serif); font-weight: 400; font-size: 1.9rem; line-height: 1.15; margin: 0 0 1.75rem; }
.field { border: 0; padding: 0; margin: 0 0 1.5rem; display: block; }
.field-label { display: block; color: var(--ice); margin-bottom: 0.55rem; padding: 0; }
.field input[type="text"] {
  width: 100%; padding: 0.85rem 1rem; border-radius: 14px;
  border: 1px solid var(--rime-edge); background: var(--rime);
  font-size: 1.1rem; outline: none;
}
.field input[type="text"]:focus { border-color: var(--aurora); }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  border: 1px solid var(--rime-edge); background: transparent; border-radius: 999px;
  padding: 0.55rem 1rem; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--frost); color: var(--night); border-color: var(--frost); }
.field-error { color: var(--danger); margin: -0.5rem 0 1rem; }

/* ---------- чтение ---------- */
.reader { display: flex; flex-direction: column; }
.reader-bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: calc(0.7rem + var(--safe-top)) 1.25rem 0.7rem;
  background: rgba(18, 28, 54, 0.88);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(238, 244, 248, 0.08);
}
.reader-bar-text p { margin: 0; }
.reader-story { font-family: var(--serif); font-size: 1rem; }
.reader-episode { color: var(--ice); font-size: 0.82rem; }
/* «Эпизод 1 из 10» не рвём; длинная шкала уходит на вторую строку целиком */
#reader-episode { white-space: nowrap; }
@media (max-width: 420px) {
  .reader-episode.stack { display: flex; flex-direction: column; gap: 0.05rem; }
  .reader-episode.stack .reader-score { margin-left: 0; padding-left: 0; border-left: 0; }
}
.scene-dots { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.scene-dots li { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--ice); }
.scene-dots li.done { background: var(--ice); }
.scene-dots li.now { background: var(--aurora); border-color: var(--aurora); }

.feed { flex: 1; padding: 1.25rem 1.25rem 1rem; }
.feed > * { scroll-margin-top: 5rem; }

.scene-image {
  margin: 0.5rem -1.25rem 1.4rem; aspect-ratio: 16 / 10; background: var(--night-2);
  position: relative; overflow: hidden;
}
.scene-image img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.6s ease; }
.scene-image.ready img { opacity: 1; }
.scene-image:not(.ready)::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(238, 244, 248, 0.07) 50%, transparent 70%);
  background-size: 200% 100%; animation: shimmer 1.6s linear infinite;
}
.scene-image figcaption { position: absolute; left: 1.25rem; bottom: 0.8rem; color: var(--ice); font-size: 0.85rem; }
.scene-image.ready figcaption { display: none; }
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }

.beat-title { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--ice); font-size: 1.05rem; margin: 2.2rem 0 0.5rem; }
.feed > .beat-title:first-child { margin-top: 0; }

.narration, .thought {
  font-family: var(--serif); font-size: 1.12rem; line-height: 1.65;
  margin: 0 0 1rem; max-width: var(--measure);
}
.thought { font-style: italic; color: var(--ice); }

.line {
  position: relative; margin: 0 0 1rem; padding-left: 3.6rem; min-height: 2.9rem; max-width: var(--measure);
}
.line-face {
  position: absolute; left: 0; top: 0.1rem; width: 2.75rem; height: 2.75rem; border-radius: 50%; overflow: hidden;
  border: 2px solid var(--who, var(--ice)); background: var(--night-2);
  display: grid; place-items: center;
}
.line-face-initial { font-family: var(--serif); font-size: 1.2rem; color: var(--who, var(--ice)); }
.line-face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.4s ease; }
.line-face.ready img { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .line-face img { transition: none; } }
.line-name { display: block; color: var(--who, var(--ice)); font-size: 0.88rem; font-weight: 600; margin-bottom: 0.15rem; }
.line-text { font-family: var(--serif); font-size: 1.12rem; line-height: 1.6; margin: 0; }
.line-share {
  border: 0; background: none; color: var(--ice); font-size: 0.8rem; padding: 0.3rem 0 0; cursor: pointer; opacity: 0.75;
}

.player {
  margin: 0.3rem 0 1.2rem auto; width: fit-content; max-width: 85%;
  padding: 0.65rem 0.95rem; border-radius: 16px 16px 4px 16px;
  background: var(--rime); border: 1px solid var(--rime-edge);
}
.player-name { display: block; font-size: 0.8rem; color: var(--ice); margin-bottom: 0.1rem; }

.memory-note { margin: -0.4rem 0 1rem; font-size: 0.85rem; color: var(--who, var(--ice)); font-style: italic; font-family: var(--serif); }

.system-card {
  margin: 1rem 0; padding: 1rem 1.1rem; border-radius: 14px;
  background: var(--night-2); border: 1px solid var(--rime-edge); line-height: 1.55;
}

.error-card { margin: 1rem 0; color: var(--danger); }
.error-card button { margin-top: 0.6rem; }

/* ---------- конец эпизода: надпись на заиндевевшем зеркале ---------- */
.mirror {
  margin: 2rem 0 1.5rem; padding: 2.2rem 1.4rem 1.8rem; border-radius: 120px 120px 18px 18px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(238, 244, 248, 0.16), transparent 70%),
    var(--night-2);
  border: 1px solid var(--rime-edge); text-align: center;
}
.mirror-words {
  font-family: var(--serif); font-style: italic; font-size: 1.55rem; line-height: 1.4; margin: 0 0 1.4rem;
  color: var(--frost);
  text-shadow: 0 0 12px rgba(238, 244, 248, 0.55), 0 0 2px rgba(238, 244, 248, 0.9);
  animation: frost-in 2.4s ease-out both;
}
.mirror-end { margin: 0; color: var(--ice); }
.mirror-next { margin: 0.4rem 0 0; font-family: var(--serif); font-size: 1.05rem; }
@keyframes frost-in {
  from { opacity: 0; filter: blur(6px); letter-spacing: 0.06em; }
  to { opacity: 1; filter: blur(0); letter-spacing: 0; }
}

/* ---------- панель ответа ---------- */
.dock {
  position: sticky; bottom: 0; z-index: 5;
  padding: 0.5rem 1.25rem calc(0.8rem + var(--safe-bottom));
  background: var(--night);
}
.dock::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1.5rem; height: 1.5rem; pointer-events: none;
  background: linear-gradient(to bottom, rgba(18, 28, 54, 0), var(--night));
}
.dock:empty { display: none; }
/* Пока рассказчик пишет — панель с вариантами убираем, чтобы индикатор и свой ответ были видны */
.dock.busy { display: none; }
.player.pending { opacity: 0.75; }
/* Текст, который рассказчик ещё пишет: как обычная лента, без кнопок */
.live > * { scroll-margin-top: 5rem; }
.opening-tip {
  margin: 1.2rem 0 0.4rem; padding: 0.9rem 1rem; border-radius: 14px;
  background: var(--night-2); color: var(--ice); font-size: 0.95rem; line-height: 1.45;
}
.typing { scroll-margin-bottom: 1rem; }
.choices { display: grid; gap: 0.45rem; margin-bottom: 0.5rem; }
.choice { font-size: 1rem; background: var(--night-2); }
.say { display: flex; gap: 0.5rem; align-items: center; }
.tones { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; margin: 0 0 0.5rem; }
.tones-label { color: var(--ice); font-size: 0.8rem; margin-right: 0.2rem; }
.chip.tone { padding: 0.28rem 0.62rem; font-size: 0.86rem; background: rgba(18, 28, 54, 0.6); }
.say input {
  flex: 1; min-width: 0; padding: 0.75rem 1rem; border-radius: 14px;
  border: 1px solid var(--rime-edge); background: var(--night-2); font-size: 1rem; outline: none;
}
.say input:focus { border-color: var(--aurora); }
.say button {
  flex: none; width: 2.9rem; height: 2.9rem; border-radius: 14px; border: 0;
  background: var(--frost); color: var(--night); font-size: 1.2rem; cursor: pointer;
}
.say button:disabled { opacity: 0.4; }
.end-actions { display: grid; gap: 0.5rem; }
.end-actions .btn { text-align: center; }

.typing { display: flex; align-items: center; gap: 5px; padding: 0 1.25rem 0.8rem; color: var(--ice); }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ice); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
.typing em { font-style: italic; font-family: var(--serif); margin-left: 0.4rem; font-size: 0.95rem; }
@keyframes blink { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

.toast {
  position: fixed; left: 50%; bottom: calc(6.5rem + var(--safe-bottom)); transform: translateX(-50%);
  background: var(--frost); color: var(--night); padding: 0.6rem 1rem; border-radius: 999px;
  font-size: 0.92rem; z-index: 20; max-width: 90vw; text-align: center;
}

/* ---------- общие мелочи ---------- */
.link-btn {
  display: block; margin: 0.6rem auto 0; padding: 0.4rem 0.6rem; border: 0; background: none;
  color: var(--ice); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 0.95rem;
}
.back-link {
  position: absolute; z-index: 3; top: calc(0.8rem + var(--safe-top)); left: 0.9rem;
  padding: 0.35rem 0.8rem; border-radius: 999px; text-decoration: none; font-size: 0.92rem;
  background: rgba(18, 28, 54, 0.6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.back-link.inline { position: static; display: inline-block; margin-bottom: 1.2rem; padding-left: 0; background: none; color: var(--ice); }
.page-title { font-family: var(--serif); font-weight: 400; font-size: 1.85rem; line-height: 1.15; margin: 0 0 1.25rem; }
.field textarea {
  width: 100%; padding: 0.8rem 1rem; border-radius: 14px; resize: vertical;
  border: 1px solid var(--rime-edge); background: var(--rime); font-size: 1.02rem; line-height: 1.5; outline: none;
}
.field textarea:focus { border-color: var(--aurora); }
.field-count { display: block; text-align: right; color: var(--ice); font-size: 0.78rem; margin-top: 0.25rem; opacity: 0.8; }
.field-optional { font-size: 0.82rem; opacity: 0.7; margin-left: 0.35rem; }
.field-hint { display: block; color: var(--ice); font-size: 0.82rem; line-height: 1.4; margin-top: 0.4rem; opacity: 0.85; }

/* ---------- библиотека ---------- */
.library { padding-bottom: calc(2rem + var(--safe-bottom)); }
.lib-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: calc(1rem + var(--safe-top)) 1.25rem 1rem;
}
.brand { font-family: var(--serif); font-size: 1.35rem; text-decoration: none; letter-spacing: -0.01em; }
.lib-head-link { color: var(--ice); font-size: 0.95rem; text-decoration: none; }
.lib-section { padding: 0 1.25rem; margin-top: 2rem; }
.lib-promise { margin: -0.35rem 1.25rem 1.1rem; color: var(--ice); font-size: 0.95rem; line-height: 1.45; max-width: 26rem; }
.lib-promise b { color: var(--ember); font-weight: 600; }
.lib-h { font-family: var(--serif); font-weight: 400; font-size: 1.35rem; margin: 0 0 0.9rem; }
.lib-foot { text-align: center; color: var(--ice); font-size: 0.85rem; margin: 2.5rem 0 0; }

.feature { display: block; position: relative; text-decoration: none; margin: 0 1.25rem; border-radius: 22px; overflow: hidden; background: var(--night-2); }
.feature-art { aspect-ratio: 4 / 5; position: relative; }
.feature-art img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.6s ease; }
.feature-art.ready img { opacity: 1; }
.feature-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 35%, rgba(18, 28, 54, 0.92) 78%); }
.feature-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.25rem 1.25rem 1.3rem; }
.feature-badge { margin: 0 0 0.35rem; color: var(--ember); font-size: 0.92rem; }
.feature-title { font-family: var(--serif); font-weight: 400; font-size: 2rem; line-height: 1.08; margin: 0 0 0.5rem; }
.feature-tagline { margin: 0 0 1rem; color: var(--frost); opacity: 0.88; font-family: var(--serif); font-size: 1rem; line-height: 1.5; }
.feature-cta { pointer-events: none; }

.continue-list { display: grid; gap: 0.6rem; }
.continue {
  display: flex; align-items: center; gap: 0.85rem; text-decoration: none;
  padding: 0.55rem; border-radius: 16px; background: var(--night-2); border: 1px solid rgba(238, 244, 248, 0.08);
}
.continue-art { flex: none; width: 3.3rem; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: var(--night-3); }
.continue-art img { width: 100%; height: 100%; object-fit: cover; }
.continue-text { flex: 1; min-width: 0; display: grid; }
.continue-title { font-family: var(--serif); font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.continue-meta { color: var(--ice); font-size: 0.85rem; }
.continue-go { flex: none; color: var(--aurora); font-size: 0.92rem; padding-right: 0.4rem; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 0.85rem; }
.card { display: block; text-decoration: none; }
.card-art { position: relative; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; background: var(--night-2); }
.card-art img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.5s ease; }
.card-art.ready img { opacity: 1; }
.card-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(18, 28, 54, 0.7); }
.card-bar::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--done, 0%); background: var(--aurora); }
.card-body { padding: 0.55rem 0.1rem 0; }
.card-genre { margin: 0; color: var(--ice); font-size: 0.78rem; }
.card-badge { color: var(--ember); margin-right: 0.4rem; }
.card-badge::after { content: ' ·'; color: var(--ice); }
.card-title { margin: 0.1rem 0 0.15rem; font-family: var(--serif); font-weight: 400; font-size: 1.08rem; line-height: 1.2; }
.card-meta { margin: 0; color: var(--ice); font-size: 0.8rem; }

.create-card {
  display: grid; gap: 0.45rem; padding: 1.3rem 1.25rem; border-radius: 20px; text-decoration: none;
  border: 1px solid var(--rime-edge);
  background: radial-gradient(120% 120% at 100% 0%, rgba(155, 231, 207, 0.12), transparent 60%), var(--night-2);
}
.create-title { font-family: var(--serif); font-size: 1.4rem; }
.create-text { color: var(--ice); line-height: 1.5; }
.create-cta { color: var(--aurora); margin-top: 0.3rem; }

/* ---------- страница истории ---------- */
.story-actions { display: grid; gap: 0.5rem; }
.story-actions .btn { text-align: center; }
.story-ending { margin: 0 0 0.5rem; font-family: var(--serif); font-size: 1.05rem; color: var(--aurora); }
.story-h { font-family: var(--serif); font-weight: 400; font-size: 1.25rem; margin: 2.2rem 0 0.8rem; }
.episode-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.episode { display: flex; align-items: baseline; gap: 0.8rem; padding: 0.45rem 0; color: var(--ice); }
.episode-n { flex: none; width: 1.6rem; text-align: right; font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.episode-title { flex: 1; font-family: var(--serif); font-size: 1.05rem; }
.episode.done { color: var(--frost); }
.episode.done .episode-n { color: var(--aurora); }
.episode.now { color: var(--frost); }
.episode.now .episode-title::after { content: " — ты здесь"; color: var(--aurora); font-family: var(--sans); font-size: 0.85rem; }
.episode-replay {
  flex: none; align-self: center; border: 0; background: none; cursor: pointer;
  color: var(--ice); font-size: 0.85rem; padding: 0.35rem 0 0.35rem 0.5rem;
  text-decoration: underline; text-decoration-color: var(--rime-edge); text-underline-offset: 3px;
}
.replay-confirm { border: 1px solid var(--rime-edge); border-radius: 14px; background: var(--rime); padding: 0.85rem 0.95rem; margin: 0.35rem 0 0.6rem; text-align: left; }
.replay-text { margin: 0 0 0.75rem; color: var(--frost); font-size: 0.92rem; line-height: 1.45; }
.replay-row { display: flex; align-items: center; gap: 1rem; }
.replay-row .btn { width: auto; padding: 0.55rem 1.1rem; font-size: 0.95rem; }
.replay-row .link-btn { margin: 0; }
.replay-link { display: block; margin: 0.9rem auto 0; color: var(--ice); font-size: 0.9rem; }
.cast { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.8rem; }
.cast-item { display: grid; padding-left: 0.85rem; border-left: 2px solid var(--who, var(--ice)); }
.cast-name { color: var(--who, var(--frost)); font-weight: 600; font-size: 0.95rem; }
.cast-role { color: var(--ice); font-size: 0.92rem; line-height: 1.45; }
.story-foot { margin-top: 2.2rem; }
.story-foot .btn { text-align: center; }

.setup-story { margin: 0 0 0.3rem; color: var(--aurora); }

/* ---------- чтение: эпизод, концовка, отзыв ---------- */
.reader-bar { justify-content: flex-start; }
.reader-back { flex: none; text-decoration: none; font-size: 1.6rem; line-height: 1; padding: 0 0.3rem 0.15rem 0; color: var(--ice); }
.reader-bar-text { flex: 1; min-width: 0; }
.reader-story { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chapter { margin: 0.5rem 0 1.6rem; }
.chapter-n { margin: 0; color: var(--aurora); font-size: 0.9rem; }
.chapter-title { margin: 0.15rem 0 0; font-family: var(--serif); font-weight: 400; font-size: 1.7rem; line-height: 1.15; }
.chapter-trial {
  margin: 0.9rem 0 0; padding: 0.55rem 0.8rem; border-left: 2px solid var(--ember);
  background: rgba(243, 194, 126, 0.08); border-radius: 0 10px 10px 0; line-height: 1.45; font-size: 0.95rem;
}
.chapter-trial-label { display: block; color: var(--ember); font-size: 0.8rem; margin-bottom: 0.1rem; }
.reader-score { color: var(--ember); margin-left: 0.5rem; padding-left: 0.5rem; border-left: 1px solid rgba(238, 244, 248, 0.2); white-space: nowrap; }
.reader-score.flash { animation: score-flash 1.2s ease-out; }
@keyframes score-flash {
  0% { text-shadow: 0 0 0 rgba(243, 194, 126, 0); }
  30% { text-shadow: 0 0 10px rgba(243, 194, 126, 0.9); color: #ffe2b4; }
  100% { text-shadow: 0 0 0 rgba(243, 194, 126, 0); }
}
.score-note { margin: -0.4rem 0 1rem; font-size: 0.85rem; color: var(--ember); }
.score-note.minus { color: var(--danger); }
.trial-result { margin: 1.1rem auto 0.2rem; max-width: 26rem; padding-top: 1rem; border-top: 1px solid rgba(238, 244, 248, 0.14); }
.trial-verdict { margin: 0; font-size: 1rem; }
.trial-verdict.passed { color: var(--ember); }
.trial-verdict.failed { color: var(--ice); }
.trial-text { margin: 0.25rem 0 0; font-family: var(--serif); font-size: 0.98rem; line-height: 1.45; color: var(--frost); opacity: 0.85; }
.trial-score { margin: 0.6rem 0 0; color: var(--ice); font-size: 0.85rem; }
.ending-trial { margin: 0.2rem 0 0.3rem; padding-top: 0.9rem; border-top: 1px solid rgba(238, 244, 248, 0.14); font-size: 0.92rem; }
.ending-goals { margin: 0.2rem 0 0.9rem; color: var(--ember); font-size: 0.92rem; }
.endings-collection { margin: 0.6rem 0 0.8rem; }
.endings-count { margin: 0 0 0.5rem; color: var(--ice); font-size: 0.88rem; }
.endings-row { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; }
.ending-chip {
  padding: 0.3rem 0.75rem; border-radius: 999px; font-size: 0.88rem;
  border: 1px solid rgba(155, 231, 207, 0.45); color: var(--frost);
}
.ending-chip.now { background: rgba(155, 231, 207, 0.16); }
.ending-chip.locked { border-style: dashed; border-color: var(--rime-edge); color: var(--ice); letter-spacing: 0.15em; }
.story-actions .endings-collection { margin: 0.2rem 0 0.4rem; }
.story-actions .endings-row { justify-content: flex-start; }

.ending {
  margin: 1.5rem 0; padding: 1.8rem 1.4rem; border-radius: 22px; text-align: center;
  background:
    radial-gradient(90% 70% at 50% 0%, rgba(155, 231, 207, 0.22), transparent 70%),
    radial-gradient(70% 60% at 85% 10%, rgba(201, 179, 240, 0.16), transparent 70%),
    var(--night-2);
  border: 1px solid rgba(155, 231, 207, 0.35);
}
.ending-words {
  margin: 0 0 1.4rem; font-family: var(--serif); font-style: italic; font-size: 1.3rem; line-height: 1.45;
  text-shadow: 0 0 12px rgba(238, 244, 248, 0.45);
  animation: frost-in 2.4s ease-out both;
}
.ending-label { margin: 0; color: var(--aurora); }
.ending-title { margin: 0.3rem 0 0.7rem; font-family: var(--serif); font-weight: 400; font-size: 2rem; line-height: 1.1; }
.ending-summary { margin: 0 0 0.9rem; font-family: var(--serif); font-size: 1.08rem; line-height: 1.55; }
.ending-count { margin: 0; color: var(--ice); font-size: 0.88rem; }

/* Зеркало: овальная рама, как у надписи в конце эпизода */
.portrait {
  margin: 1.5rem 0; padding: 2.4rem 1.4rem 1.5rem; text-align: center;
  border-radius: 50% 50% 22px 22px / 150px 150px 22px 22px;
  background: radial-gradient(110% 70% at 50% 0%, rgba(238, 244, 248, 0.14), transparent 70%), var(--night-2);
  border: 1px solid var(--rime-edge);
}
.portrait-label { margin: 0; color: var(--aurora); font-size: 0.9rem; }
.portrait-title {
  margin: 0.35rem 0 0.8rem; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 2.1rem; line-height: 1.12;
  text-shadow: 0 0 14px rgba(238, 244, 248, 0.5);
  animation: frost-in 2.2s ease-out both;
}
.portrait-text { margin: 0 0 1rem; font-family: var(--serif); font-size: 1.08rem; line-height: 1.6; }
.portrait-moments { list-style: none; margin: 0 0 1.1rem; padding: 0; display: grid; gap: 0.55rem; text-align: left; }
.portrait-moments li { padding-left: 0.9rem; border-left: 2px solid var(--rime-edge); color: var(--ice); line-height: 1.5; }
.portrait-voice { text-align: left; margin: 0 0 1rem; }
.portrait-friend { margin: 0 0 1rem; padding: 0.7rem 0.9rem; border-radius: 12px; background: var(--rime); line-height: 1.5; }
.portrait-note { margin: 0 0 1rem; color: var(--ice); font-size: 0.88rem; }

.friend-banner { margin: 0 0 1rem; padding: 0.9rem 1rem; border-radius: 16px; border: 1px solid rgba(155, 231, 207, 0.35); background: var(--night-2); }
.friend-title { margin: 0; font-family: var(--serif); font-size: 1.15rem; }
.friend-text { margin: 0.3rem 0 0; color: var(--ice); line-height: 1.5; }

.feedback { margin: 0 0 1.5rem; padding: 1rem 0 0; border-top: 1px solid rgba(238, 244, 248, 0.08); }
.feedback-q { margin: 0 0 0.6rem; color: var(--ice); }
.feedback-say { margin-top: 0.5rem; }
.end-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.end-row .btn { text-align: center; padding-left: 0.5rem; padding-right: 0.5rem; }

/* ---------- своя история ---------- */
.create-wrap { padding: 0 1.25rem calc(2rem + var(--safe-bottom)); }
.create-head { margin: 0.2rem 0 1.4rem; }
.create-step { margin: 0 0 0.5rem; color: var(--aurora); font-size: 0.9rem; }
.create-bar { height: 3px; border-radius: 3px; background: var(--rime); position: relative; overflow: hidden; }
.create-bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--done, 0%); background: var(--aurora); transition: width 0.3s ease; }
.create-hint { color: var(--ice); line-height: 1.5; margin: -0.4rem 0 1.2rem; }
.create-modes { display: flex; gap: 0.5rem; margin: 0 0 1.4rem; }
.create-nav { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem; margin-top: 1.5rem; }
.create-nav .btn { text-align: center; }
.create-nav .btn:only-child { grid-column: 1 / -1; }
.hero-card { border: 1px solid var(--rime-edge); border-radius: 18px; padding: 0.4rem 1rem 1rem; margin: 0 0 1rem; }
.hero-legend { padding: 0 0.4rem; color: var(--aurora); font-size: 0.9rem; }
.hero-card .field { margin-bottom: 0.9rem; }
.hero-card .link-btn { margin: 0.6rem 0 0; padding-left: 0; }
.add-hero { text-align: center; }
.create-wait { padding-top: 2rem; }
.create-wait-line {
  font-family: var(--serif); font-style: italic; font-size: 1.3rem; margin: 0 0 1.2rem;
  animation: frost-in 1.6s ease-out both;
}
.author-story .cover-tagline { margin-top: 1rem; }
.author-status { margin: -0.6rem 0 1rem; color: var(--aurora); }
.author-cover { aspect-ratio: 3 / 4; max-width: 16rem; border-radius: 16px; overflow: hidden; background: var(--night-2); }
.author-cover img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.5s ease; }
.author-cover.ready img { opacity: 1; }
.author-story .cast, .author-story .episode-list { margin: 1.4rem 0; }
.author-story .end-actions { margin-top: 1.5rem; }

.my { padding-bottom: calc(2rem + var(--safe-bottom)); }
.my .page-title { padding: 0 1.25rem; }
.my-list { display: grid; gap: 0.6rem; padding: 0 1.25rem; }
.my-item {
  display: grid; gap: 0.15rem; text-align: left; padding: 0.9rem 1rem; border-radius: 16px; cursor: pointer;
  background: var(--night-2); border: 1px solid rgba(238, 244, 248, 0.08);
}
.my-title { font-family: var(--serif); font-size: 1.1rem; }
.my-status { color: var(--ice); font-size: 0.88rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (min-width: 40rem) {
  .scene-image { margin-left: 0; margin-right: 0; border-radius: 16px; }
  .screen.library, .screen.create, .screen.my { max-width: 46rem; }
  .library .grid { grid-template-columns: repeat(3, 1fr); }
  .feature { display: grid; grid-template-columns: 1fr 1fr; }
  .feature-art::after { display: none; }
  .feature-body { position: static; align-self: end; padding: 1.75rem; }
}


/* ---------- новогодний календарь ----------
   Окошки — как окна зимнего дома ночью: закрытые тёмные, пропущенные заиндевели,
   сегодняшнее мерцает, открытое горит тёплым светом, а подоконник — цвета героя, который написал. */
.cal-banner {
  display: flex; gap: 1rem; align-items: center; margin: 1rem 1.25rem 0; padding: 1rem 1.1rem;
  border-radius: 20px; text-decoration: none; border: 1px solid var(--rime-edge);
  background: radial-gradient(90% 130% at 0% 50%, rgba(243, 194, 126, 0.14), transparent 62%), var(--night-2);
}
.cal-banner-window, .cal-window, .cal-reward-at { border-radius: 999px 999px 6px 6px; }
.cal-banner-window {
  flex: none; position: relative; width: 2.7rem; height: 3.5rem; overflow: hidden;
  border: 1px solid var(--rime-edge); background: var(--night-3);
}
.cal-banner-window::after, .cal-window::before {
  content: ""; position: absolute; left: 0; right: 0; top: 60%; height: 1.5px;
  background: rgba(18, 28, 54, 0.5); pointer-events: none;
}
.cal-banner-window.lit, .cal-day.opened .cal-window, .cal-reward:not(.locked) .cal-reward-at {
  background: radial-gradient(120% 90% at 50% 30%, #ffe8b8 0%, #f3c27e 48%, #c98b42 100%);
  border-color: rgba(255, 232, 184, 0.6); color: var(--night);
}
.cal-banner-window.waiting { border-color: var(--ember); animation: cal-breathe 3.2s ease-in-out infinite; }
.cal-banner-text { display: grid; gap: 0.2rem; min-width: 0; }
.cal-banner-title { font-family: var(--serif); font-size: 1.25rem; line-height: 1.2; }
.cal-banner-line { color: var(--frost); opacity: 0.9; font-size: 0.95rem; line-height: 1.4; }
.cal-banner-meta { color: var(--ice); font-size: 0.85rem; }
.cal-banner-cta { color: var(--ember); font-size: 0.95rem; margin-top: 0.2rem; }

.cal-wrap { padding: 0 1.25rem 3rem; }
.cal-lead { color: var(--ice); margin: 0 0 0.6rem; line-height: 1.5; max-width: 30rem; }
.cal-who { color: var(--frost); }
.cal-grid { list-style: none; margin: 1.4rem 0 0.5rem; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.45rem; }
.cal-window {
  position: relative; display: block; width: 100%; aspect-ratio: 3 / 4; padding: 0; overflow: hidden;
  border: 1px solid rgba(238, 244, 248, 0.14); background: var(--night-2); color: var(--ice); cursor: pointer;
}
.cal-window:disabled { cursor: default; }
.cal-num { position: absolute; left: 0; right: 0; bottom: 0.28rem; text-align: center; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.cal-month { position: absolute; left: 0; right: 0; top: 0.7rem; text-align: center; font-size: 0.62rem; opacity: 0.85; }
.cal-initial { position: absolute; left: 0; right: 0; top: 24%; text-align: center; font-family: var(--serif); font-size: 1.15rem; line-height: 1; }
.cal-day.future .cal-window { color: rgba(167, 188, 205, 0.6); }
.cal-day.missed .cal-window {
  color: rgba(167, 188, 205, 0.45);
  background: radial-gradient(circle at 30% 30%, rgba(238, 244, 248, 0.13) 0 1px, transparent 1.6px) 0 0 / 7px 7px, var(--night-2);
}
.cal-day.today .cal-window {
  border-color: var(--ember); background: var(--night-3); color: var(--frost);
  animation: cal-breathe 3.2s ease-in-out infinite;
}
.cal-day.opened .cal-window { box-shadow: inset 0 -3px 0 var(--who, var(--ember)); }
.cal-day.opened .cal-month { color: var(--night); }
.cal-day.selected .cal-window { outline: 2px solid var(--frost); outline-offset: 2px; }
.cal-day.opening .cal-window { animation: cal-flicker 0.8s ease-in-out infinite; }
.cal-day.just-lit .cal-window { animation: cal-light 1.2s ease-out; }
.cal-count { color: var(--ice); font-size: 0.88rem; text-align: right; margin: 0 0 1.4rem; }

.cal-invite { text-align: center; padding: 1.2rem 1rem; border-radius: 18px; border: 1px dashed rgba(243, 194, 126, 0.45); }
.cal-invite-text { font-family: var(--serif); font-size: 1.15rem; margin: 0 0 1rem; }
.cal-hint { color: var(--ice); text-align: center; font-size: 0.9rem; margin: 0; }
.cal-letter {
  border-radius: 18px; padding: 1.1rem 1.15rem 1.2rem; border: 1px solid rgba(243, 194, 126, 0.28);
  background: linear-gradient(180deg, rgba(243, 194, 126, 0.1), rgba(243, 194, 126, 0.02) 70%), var(--night-2);
}
.cal-letter-head { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 0.85rem; }
.cal-letter-head .line-face { position: relative; top: auto; left: auto; flex: none; }
.cal-letter-who { display: grid; min-width: 0; }
.cal-letter-name { color: var(--who, var(--frost)); font-weight: 600; font-size: 0.95rem; margin: 0 0 0.4rem; }
.cal-letter-head .cal-letter-name { margin: 0; }
.cal-letter-date { color: var(--ice); font-size: 0.82rem; }
.cal-letter-text { font-family: var(--serif); font-size: 1.12rem; line-height: 1.6; margin: 0; white-space: pre-line; }
.cal-letter-sign { font-family: var(--serif); font-style: italic; text-align: right; margin: 0.75rem 0 0; color: var(--who, var(--frost)); }
.cal-letter-go { margin-top: 1.1rem; text-align: center; }
.cal-letter-next { color: var(--ice); font-size: 0.85rem; text-align: center; margin: 0.8rem 0 0; }

.cal-rewards { margin-top: 2.4rem; }
.cal-reward { display: flex; gap: 0.9rem; padding: 0.95rem 0; border-top: 1px solid var(--rime); }
.cal-reward-at {
  flex: none; width: 2.2rem; height: 2.9rem; display: grid; place-items: end center; padding-bottom: 0.35rem;
  font-family: var(--serif); font-size: 0.95rem; background: var(--night-2); border: 1px solid var(--rime-edge); color: var(--ice);
}
.cal-reward-body { flex: 1; min-width: 0; }
.cal-reward-title { margin: 0; font-weight: 600; }
.cal-reward-text { margin: 0.15rem 0 0; color: var(--ice); font-size: 0.92rem; line-height: 1.45; }
.cal-reward-state { margin: 0.35rem 0 0; color: var(--ember); font-size: 0.88rem; }
.cal-reward.locked .cal-reward-state { color: var(--ice); }
.cal-reward-art { position: relative; margin: 0.85rem 0 0; border-radius: 14px; overflow: hidden; background: var(--night-2); aspect-ratio: 3 / 4; max-width: 18rem; }
.cal-reward-art img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.6s ease; }
.cal-reward-art.ready img { opacity: 1; }
.cal-reward-wait { position: absolute; left: 0; right: 0; bottom: 0; padding: 0.8rem; color: var(--ice); font-size: 0.85rem; }
.cal-reward-art.ready .cal-reward-wait { display: none; }
.cal-reward-save { width: auto; margin-top: 0.75rem; padding: 0.55rem 1.1rem; }
.cal-letter-long { margin-top: 0.85rem; }

@keyframes cal-breathe { 0%, 100% { box-shadow: 0 0 8px rgba(243, 194, 126, 0.22); } 50% { box-shadow: 0 0 20px rgba(243, 194, 126, 0.55); } }
@keyframes cal-flicker { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@keyframes cal-light {
  0% { filter: brightness(0.3) saturate(0.3); box-shadow: 0 0 0 rgba(243, 194, 126, 0); }
  55% { box-shadow: 0 0 30px rgba(243, 194, 126, 0.75); }
  100% { filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cal-window, .cal-banner-window, .cal-reward-art img { animation: none !important; transition: none; }
}

/* ---------- «Помоги выбрать» ---------- */
.choice { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.choice-text { flex: 1; }
.choice-votes { flex: none; color: var(--aurora); font-size: 0.82rem; }
.choice-votes:empty { display: none; }
.choice.leading { border-color: rgba(155, 231, 207, 0.55); }
.poll-bar { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.2rem 0.8rem; margin: -0.1rem 0 0.55rem; }
.poll-status { color: var(--ice); font-size: 0.82rem; }
.poll-ask {
  border: 0; background: none; padding: 0.2rem 0; cursor: pointer; color: var(--aurora); font-size: 0.88rem;
  text-decoration: underline; text-decoration-color: rgba(155, 231, 207, 0.4); text-underline-offset: 3px;
}
.poll-bar .poll-ask:only-child { margin: 0 auto; }
.poll-note { margin: -0.4rem 0 1rem; font-size: 0.85rem; color: var(--aurora); }

.vote-wrap { padding: 0 1.25rem 3rem; }
.vote-from { margin: 0 0 0.4rem; color: var(--ice); font-size: 0.92rem; }
.vote-title { margin-bottom: 1rem; }
.vote-scene { margin: 0 -1.25rem 1.1rem; border-radius: 0; }
.vote-lines { display: grid; gap: 0.75rem; margin: 0 0 1.3rem; }
.vote-line { border-left: 2px solid var(--who, var(--rime-edge)); padding-left: 0.8rem; }
.vote-line .line-name { margin-bottom: 0.1rem; }
.vote-line-text { margin: 0; font-family: var(--serif); font-size: 1.05rem; line-height: 1.5; }
.vote-line.narration { border-left: 0; padding-left: 0; }
.vote-line.narration .vote-line-text { color: var(--ice); font-style: italic; }
.vote-q { margin: 0 0 0.6rem; font-family: var(--serif); font-size: 1.25rem; }
.vote-hint, .vote-status { margin: 0.5rem 0 0; color: var(--ice); font-size: 0.88rem; line-height: 1.45; }
.vote-results { display: grid; gap: 0.45rem; }
.vote-row {
  position: relative; display: grid; grid-template-columns: 1fr auto; gap: 0.15rem 0.8rem; align-items: baseline;
  padding: 0.7rem 0.9rem; border-radius: 14px; border: 1px solid var(--rime-edge); overflow: hidden;
  background: linear-gradient(90deg, rgba(155, 231, 207, 0.16) var(--pct, 0%), transparent var(--pct, 0%)), var(--night-2);
}
.vote-row.final { border-color: var(--ember); }
.vote-row-text { font-size: 0.98rem; }
.vote-row-n { color: var(--frost); font-variant-numeric: tabular-nums; font-weight: 600; }
.vote-row-tag { grid-column: 1 / -1; color: var(--aurora); font-size: 0.8rem; }
.vote-row.final .vote-row-tag { color: var(--ember); }
.vote-mine { display: grid; gap: 0.5rem; margin-top: 1.4rem; }
.vote-mine .btn { text-align: center; }
.vote-cta { margin-top: 1.8rem; }

/* ---------- проценты: испытание и редкие концовки ---------- */
.trial-share { margin: 0.35rem 0 0; color: var(--ice); font-size: 0.85rem; }
.ending-rarity { margin: -0.4rem 0 0.9rem; color: var(--ice); font-size: 0.92rem; }
.ending-rarity.rare { color: var(--ember); }
.ending-chip-pct { color: var(--ice); letter-spacing: 0; }
.ending-chip-pct.rare { color: var(--ember); }

/* ---------- команды героев ---------- */
.teams-bar { display: flex; gap: 2px; height: 0.7rem; border-radius: 999px; overflow: hidden; margin: 0 0 0.7rem; background: var(--night-2); }
.teams-seg { display: block; min-width: 4px; }
.teams-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
.teams-item { display: flex; justify-content: space-between; gap: 1rem; color: var(--ice); }
.teams-item::before { content: ""; flex: none; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--who); align-self: center; margin-right: -0.45rem; }
.teams-name { flex: 1; }
.teams-item.mine { color: var(--frost); font-weight: 600; }
.teams-pct { font-variant-numeric: tabular-nums; color: var(--frost); }
.teams-mine { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.2rem 1rem; margin-top: 0.6rem; }
.teams-note { margin: 0.6rem 0 0; color: var(--ice); font-size: 0.9rem; }
.teams-mine .teams-note { margin: 0; color: var(--frost); }
.teams-share { margin: 0; padding: 0.2rem 0; }

/* ---------- «Мой год в Главной роли» ---------- */
.wr-banner {
  display: flex; gap: 1rem; align-items: center; margin: 1rem 1.25rem 0; padding: 1rem 1.1rem;
  border-radius: 20px; text-decoration: none; border: 1px solid rgba(155, 231, 207, 0.35);
  background: radial-gradient(100% 140% at 0% 0%, rgba(155, 231, 207, 0.16), transparent 62%), var(--night-2);
}
.wr-banner-year { flex: none; font-family: var(--serif); font-size: 2.3rem; line-height: 1; color: var(--aurora); }
.wr-banner-text { display: grid; gap: 0.2rem; min-width: 0; }
.wr-banner-title { font-family: var(--serif); font-size: 1.2rem; line-height: 1.2; }
.wr-banner-line { color: var(--ice); font-size: 0.92rem; }
.wr-banner-cta { color: var(--aurora); font-size: 0.95rem; margin-top: 0.2rem; }

.wrapped { position: relative; display: flex; flex-direction: column; min-height: 100dvh; }
.wr-progress { display: flex; gap: 4px; padding: calc(0.9rem + var(--safe-top)) 3.6rem 0 1rem; }
.wr-progress span { flex: 1; height: 3px; border-radius: 2px; background: rgba(238, 244, 248, 0.22); }
.wr-progress span.on { background: var(--frost); }
.wr-close {
  position: absolute; z-index: 2; top: calc(0.2rem + var(--safe-top)); right: 0.6rem; width: 2.75rem; height: 2.75rem;
  display: grid; place-items: center; font-size: 1.7rem; line-height: 1; text-decoration: none; color: var(--frost);
}
.wr-stage { flex: 1; display: flex; cursor: pointer; -webkit-user-select: none; user-select: none; }
.wr-card {
  flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 2.5rem 1.75rem calc(3rem + var(--safe-bottom)); text-align: center;
  animation: wr-in 0.5s ease-out;
}
.wr-intro { background: radial-gradient(90% 55% at 50% 38%, rgba(155, 231, 207, 0.18), transparent 72%); }
.wr-numbers { background: radial-gradient(90% 55% at 50% 42%, rgba(243, 194, 126, 0.16), transparent 72%); }
.wr-hero, .wr-q { background: radial-gradient(90% 55% at 50% 38%, color-mix(in srgb, var(--who) 24%, transparent), transparent 72%); }
.wr-rare { background: radial-gradient(90% 55% at 50% 42%, rgba(243, 194, 126, 0.24), transparent 72%); }
.wr-persona { background: radial-gradient(90% 55% at 50% 40%, rgba(238, 244, 248, 0.1), transparent 72%); }
.wr-final { align-items: stretch; text-align: left; justify-content: flex-end; cursor: default; }
.wr-kicker { margin: 0 0 0.9rem; color: var(--aurora); font-size: 0.95rem; }
.wr-year { margin: 0 0 1rem; font-family: var(--serif); font-weight: 400; font-size: clamp(5rem, 28vw, 8rem); line-height: 1; letter-spacing: -0.02em; }
.wr-lead { margin: 0 auto 0.8rem; max-width: 22rem; font-family: var(--serif); font-size: 1.3rem; line-height: 1.45; }
.wr-hint { margin: 2rem 0 0; color: var(--ice); font-size: 0.85rem; }
.wr-big { margin: 0; font-family: var(--serif); font-size: clamp(5rem, 30vw, 8.5rem); line-height: 1; }
.wr-sub { margin: 0.4rem 0 0; color: var(--ice); line-height: 1.45; }
.wr-row { margin: 1.6rem 0 0; color: var(--frost); font-size: 0.98rem; }
.wr-row + .wr-row { margin-top: 0.4rem; color: var(--ice); }
.wr-face {
  position: relative; width: 9rem; height: 9rem; margin: 0 auto 1.5rem; border-radius: 50%; overflow: hidden;
  border: 3px solid var(--who); background: var(--night-2); display: grid; place-items: center;
}
.wr-face-initial { font-family: var(--serif); font-size: 3.5rem; color: var(--who); }
.wr-face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.4s ease; }
.wr-face.ready img { opacity: 1; }
.wr-name { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 2.3rem; line-height: 1.15; color: var(--who, var(--frost)); }
.wr-rare .wr-name { color: var(--ember); }
blockquote.wr-quote { margin: 0 0 1rem; font-family: var(--serif); font-style: italic; font-size: 1.55rem; line-height: 1.45; }
h2.wr-title { margin: 0 0 1rem; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 2.9rem; line-height: 1.1; text-shadow: 0 0 24px rgba(238, 244, 248, 0.5); }
.wr-summary { list-style: none; margin: 0 0 1.6rem; padding: 0; display: grid; gap: 0.7rem; }
.wr-summary li { display: grid; gap: 0.1rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--rime); }
.wr-summary-label { color: var(--ice); font-size: 0.85rem; }
.wr-summary-value { font-family: var(--serif); font-size: 1.2rem; }
.wr-actions { display: grid; gap: 0.5rem; }
.wr-btn { text-align: center; }
@keyframes wr-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .wr-card { animation: none; } .wr-face img { transition: none; } }

/* ---------- мини-приложение ВКонтакте ---------- */
.lib-invite { margin: -0.6rem 1.25rem 1rem; }
.poll-links { display: inline-flex; gap: 1rem; }
.rules-consent { margin: 0.4rem 0 1rem; }
.rules-list summary { cursor: pointer; color: var(--aurora); font-size: 0.92rem; }
.rules-list ul { margin: 0.5rem 0; padding-left: 1.2rem; color: var(--frost); font-size: 0.9rem; line-height: 1.45; }
.rules-check { display: flex; gap: 0.6rem; align-items: center; margin-top: 0.7rem; font-size: 0.95rem; cursor: pointer; }
.rules-check input { width: 1.2rem; height: 1.2rem; accent-color: var(--aurora); }

/* Правый верхний угол во ВК занят служебными кнопками */
html.in-vk .lib-head { padding-right: 6.75rem; }
html.in-vk .reader-bar { padding-right: 6.75rem; }
html.in-vk .wr-close { right: auto; left: 0.4rem; }
html.in-vk .wr-progress { padding-left: 3.4rem; padding-right: 6.75rem; }

.age-gate { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 1.5rem; background: rgba(18, 28, 54, 0.94); }
.age-gate-card { max-width: 22rem; text-align: center; }
.age-gate-title { margin: 0 0 0.8rem; font-family: var(--serif); font-weight: 400; font-size: 1.7rem; line-height: 1.2; }
.age-gate-text { margin: 0 0 1.4rem; color: var(--ice); line-height: 1.5; }

/* ---------- сцена с героем ---------- */
.lib-sub { margin: -0.4rem 0 0.8rem; color: var(--ice); font-size: 0.9rem; }
.heroes-row {
  display: flex; gap: 0.9rem; overflow-x: auto; margin: 0 -1.25rem; padding: 0.2rem 1.25rem 0.6rem;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.heroes-row::-webkit-scrollbar { display: none; }
.hero-chip {
  flex: none; width: 5.4rem; display: grid; justify-items: center; gap: 0.3rem; text-align: center;
  color: inherit; text-decoration: none; scroll-snap-align: start;
}
.hero-face {
  position: relative; width: 4.6rem; height: 4.6rem; border-radius: 50%; overflow: hidden;
  background: var(--night-3); border: 2px solid var(--who, var(--rime-edge));
  display: grid; place-items: center; font-family: var(--serif); font-size: 1.6rem; color: var(--who, var(--ice));
}
.hero-face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.3s; }
.hero-face.ready img { opacity: 1; }
.hero-face.ready { color: transparent; }
.hero-chip:focus-visible .hero-face { outline: 2px solid var(--aurora); outline-offset: 2px; }
.hero-name { font-size: 0.92rem; line-height: 1.2; }
.hero-story { color: var(--ice); font-size: 0.72rem; line-height: 1.2; }
.meet-count { margin: 0; color: var(--ice); font-size: 0.8rem; white-space: nowrap; }
.meet-end { display: grid; gap: 0.5rem; }
.meet-end-title { margin: 0 0 0.2rem; font-family: var(--serif); font-size: 1.1rem; }
.story-hero-meet { margin-top: 0.35rem; }
@media (prefers-reduced-motion: reduce) { .hero-face img { transition: none; } }

/* ---------- герои читательниц ---------- */
.lib-h-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.hero-chip.create-chip .hero-face { border-style: dashed; font-family: var(--sans, inherit); font-size: 2rem; color: var(--aurora); }
.uh-tabs { display: flex; gap: 0.4rem; padding: 0 1.25rem; margin: 0 0 1rem; }
.uh-tabs .chip[aria-selected="true"] { background: var(--frost); color: var(--night); }
.uh-list { display: grid; gap: 0.6rem; padding: 0 1.25rem 2rem; }
.uh-item {
  display: flex; gap: 0.9rem; align-items: center; padding: 0.75rem 0.9rem; border-radius: 16px;
  background: var(--night-2); color: inherit; text-decoration: none; border: 1px solid var(--rime);
}
.uh-item .hero-face { width: 3.6rem; height: 3.6rem; flex: none; font-size: 1.3rem; }
.uh-text { flex: 1; min-width: 0; display: grid; gap: 0.15rem; }
.uh-name { font-family: var(--serif); font-size: 1.08rem; }
.uh-who { color: var(--ice); font-size: 0.88rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.uh-meta { color: var(--ice); font-size: 0.8rem; }
.uh-empty { padding: 0 1.25rem; color: var(--ice); }
.hero-status { display: grid; gap: 0.7rem; justify-items: start; }
.hero-status .hero-face { width: 6rem; height: 6rem; font-size: 2.2rem; }
.meet-vote { margin: 0 0 0.5rem; }
.meet-report { display: block; margin: 0.6rem auto 0; }
.report-form { display: grid; gap: 0.5rem; margin-top: 0.5rem; }
.report-form textarea { width: 100%; min-height: 4rem; padding: 0.6rem 0.8rem; border-radius: 12px; border: 1px solid var(--rime-edge); background: var(--night-2); color: inherit; font: inherit; }

/* ---------- история по картинке ---------- */
.from-image { display: flex; gap: 0.9rem; align-items: flex-start; margin: -0.6rem 0 1.5rem; }
.from-image-thumb { width: 4.75rem; height: 4.75rem; flex: none; object-fit: cover; border-radius: 14px; border: 1px solid var(--rime-edge); }
.from-image-side { display: grid; gap: 0.45rem; justify-items: start; min-width: 0; }
.from-image-side .create-hint, .from-image-side .field-error { margin: 0; }
.from-image-pick { width: auto; padding: 0.55rem 1.1rem; }
