@font-face { font-family: "Logo"; src: url("fonts/greatvibes-cyrillic-400.woff2") format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; font-display: swap; }
@font-face { font-family: "Logo"; src: url("fonts/greatvibes-latin-400.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Title"; src: url("fonts/cormorant-cyrillic-600.woff2") format("woff2"); font-weight: 600; unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; font-display: swap; }
@font-face { font-family: "Title"; src: url("fonts/cormorant-latin-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Title"; src: url("fonts/cormorant-cyrillic-500.woff2") format("woff2"); font-weight: 500; unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; font-display: swap; }
@font-face { font-family: "Title"; src: url("fonts/cormorant-latin-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Prata"; src: url("fonts/prata-cyrillic-400.woff2") format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; font-display: swap; }
@font-face { font-family: "Prata"; src: url("fonts/prata-latin-400.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/manrope-cyrillic-400.woff2") format("woff2"); font-weight: 400; unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/manrope-cyrillic-700.woff2") format("woff2"); font-weight: 700; unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/manrope-latin-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/manrope-latin-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --wine: #2B0B1E;
  --plum: #4A1736;
  --velvet: #6B2148;
  --blush: #F6D3CB;
  --rose: #E07A8F;
  --gold: #E8BE68;
  --gold-deep: #B8862F;
  --ivory: #FFF4EE;
  --display: "Prata", "DejaVu Serif", Georgia, serif;
  --body: "Manrope", "Inter", "Roboto", system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--wine); color: var(--ivory); font-family: var(--body); font-size: 16px; overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
#app { min-height: 100%; }
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }

/* ---------- Верхняя панель ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(14px + var(--safe-top)) 16px 10px; }
.topbar.over { position: absolute; inset: 0 0 auto 0; z-index: 5; background: linear-gradient(rgba(20,4,14,.55), transparent); }
.topbar.slim { padding-bottom: 18px; }
.brand { font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1.1; margin: 0; letter-spacing: .01em; color: var(--blush); }
.wallet { display: flex; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 17px; background: rgba(255,244,238,.09); border: 1px solid rgba(255,244,238,.14); font-size: 14px; }
.pill b { font-weight: 700; }
.pill small { font-size: 11px; opacity: .65; font-variant-numeric: tabular-nums; }
.pill.gem { color: var(--gold); }
.pill.gem b { color: var(--ivory); }
.pill.ticket { color: var(--rose); }
.pill.ticket b { color: var(--ivory); }
.icon-btn { width: 40px; height: 40px; border-radius: 20px; display: grid; place-items: center; background: rgba(20,4,14,.45); font-size: 20px; }
.icon-btn.flip .ic { transform: scaleX(-1); }

/* ---------- Главная ---------- */
.home { padding-bottom: calc(32px + var(--safe-bot)); background:
  radial-gradient(90% 50% at 100% 0%, rgba(224,122,143,.22), transparent 70%),
  radial-gradient(70% 40% at 0% 30%, rgba(107,33,72,.5), transparent 70%), var(--wine); min-height: 100vh; }
.daily { margin: 6px 16px 4px; width: calc(100% - 32px); display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; text-align: left;
  background: linear-gradient(100deg, rgba(232,190,104,.22), rgba(232,190,104,.06)); border: 1px solid rgba(232,190,104,.45); color: var(--gold); font-size: 22px; }
.daily span { display: flex; flex-direction: column; color: var(--ivory); font-size: 15px; }
.daily small { opacity: .7; font-size: 13px; }
.shelf { display: grid; gap: 22px; padding: 18px 16px 0; }
.cover-card { display: block; text-align: left; width: 100%; }
.cover-art { aspect-ratio: 3 / 4; border-radius: 6px 6px 22px 6px; background-size: cover; background-position: center; position: relative; overflow: hidden;
  box-shadow: 0 18px 40px -18px rgba(0,0,0,.8), inset 0 0 0 1px rgba(255,244,238,.08); }
.cover-title-ph { position: absolute; left: 22px; right: 22px; bottom: 26px; font-family: var(--display); font-size: 40px; line-height: 1.05; color: var(--blush); text-shadow: 0 2px 20px rgba(0,0,0,.4); }
.cover-meta { padding: 12px 4px 0; }
.cover-meta h2 { font-family: var(--display); font-weight: 400; font-size: 24px; margin: 2px 0 4px; }
.genre { font-size: 13px; color: var(--rose); }
.status { font-size: 13px; opacity: .7; }
.status.going { color: var(--gold); opacity: 1; }

/* ---------- Страница истории ---------- */
.story-page { position: relative; min-height: 100vh; }
.hero-cover { height: 62vh; background-size: cover; background-position: center top; mask-image: linear-gradient(#000 55%, transparent); -webkit-mask-image: linear-gradient(#000 55%, transparent); }
.story-body { position: relative; margin-top: -18vh; padding: 0 20px calc(28px + var(--safe-bot)); }
.story-body h1 { font-family: var(--display); font-weight: 400; font-size: 38px; line-height: 1.05; margin: 4px 0 12px; color: var(--blush); }
.desc { font-size: 16px; line-height: 1.6; opacity: .88; margin: 0 0 18px; max-width: 60ch; }
.chapters { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 2px; }
.chapters li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid rgba(255,244,238,.08); font-size: 15px; }
.ch-n { width: 28px; height: 28px; border-radius: 14px; display: grid; place-items: center; font-size: 13px; font-weight: 700; border: 1px solid rgba(255,244,238,.25); }
.chapters li.done .ch-n { background: var(--rose); border-color: var(--rose); color: var(--wine); }
.chapters li.next .ch-n { border-color: var(--gold); color: var(--gold); }
.chapters li.locked { opacity: .45; }
.story-actions { display: grid; gap: 10px; }

.rels { display: grid; gap: 8px; margin: 0 0 20px; }
.rel { display: grid; grid-template-columns: 74px 1fr 30px; align-items: center; gap: 10px; font-size: 14px; }
.rel-name { font-weight: 700; }
.rel-bar { height: 6px; border-radius: 3px; background: rgba(255,244,238,.1); overflow: hidden; }
.rel-bar i { display: block; height: 100%; border-radius: 3px; transition: width .6s ease; }
.rel-v { text-align: right; opacity: .7; font-variant-numeric: tabular-nums; }

/* ---------- Кнопки ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 22px; border-radius: 27px; font-weight: 700; font-size: 16px; width: 100%; }
.btn em { font-style: normal; display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 12px; background: rgba(43,11,30,.25); font-size: 14px; }
.btn.primary { background: linear-gradient(180deg, #F08DA0, var(--rose)); color: var(--wine); box-shadow: 0 10px 24px -10px rgba(224,122,143,.8); }
.btn.ghost { background: rgba(255,244,238,.07); border: 1px solid rgba(255,244,238,.16); }
.btn.danger { background: rgba(255,90,90,.12); border: 1px solid rgba(255,110,110,.4); color: #FFB3B3; }
.btn:active { transform: scale(.98); }

/* ---------- Читалка ---------- */
.reader { position: fixed; inset: 0; overflow: hidden; background: #000; }
.bg { position: absolute; inset: 0; opacity: 0; transition: opacity .7s ease; }
.bg.on { opacity: 1; }
.reader .stage { transition: opacity .3s ease; }
.reader.bg-changing .stage { opacity: 0; transition: opacity .3s ease; }
.bg::after { content: attr(data-ph); position: absolute; top: calc(70px + var(--safe-top)); left: 20px; right: 20px; font-size: 12px; opacity: .35; text-align: center; }
.sprite-wrap { position: absolute; inset: 0; pointer-events: none; }
.sprite { position: absolute; bottom: 0; height: 78%; width: 100%; display: flex; justify-content: center; align-items: flex-end; opacity: 0; transform: translateY(16px); transition: opacity .3s ease, transform .3s ease; }
.sprite.on { opacity: 1; transform: none; }
.sprite.leaving { opacity: 0; }
.sprite img, .sprite .silhouette { height: 100%; max-width: 92%; object-fit: contain; object-position: bottom; }
.sprite.left { justify-content: flex-start; padding-left: 4%; }
.sprite.right { justify-content: flex-end; padding-right: 4%; }
.ch-label { flex: 1; text-align: center; font-family: var(--display); font-size: 15px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.stage { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 14px calc(18px + var(--safe-bot)); z-index: 4; }
.line { position: relative; padding: 22px 20px 26px; border-radius: 4px 22px 22px 22px; background: rgba(255,244,238,.94); color: #2A1220; min-height: 120px;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,.7); animation: rise .25s ease; }
.line.narr { background: rgba(28,8,20,.86); color: var(--ivory); border-radius: 18px; border: 1px solid rgba(255,244,238,.12); }
.line.narr .txt { font-family: var(--display); font-size: 18px; line-height: 1.55; }
.line.thought { background: rgba(246,211,203,.86); border-radius: 26px; }
.line.thought .txt { font-style: italic; }
.who { position: absolute; top: -15px; left: 16px; padding: 5px 14px; border-radius: 14px; background: var(--c); color: #2A1220; font-weight: 700; font-size: 14px; box-shadow: 0 6px 14px -6px rgba(0,0,0,.5); }
.txt { margin: 0; font-size: 17px; line-height: 1.5; max-width: 62ch; }
.tap-hint { position: absolute; right: 18px; bottom: 10px; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); opacity: 0; }
.line.done .tap-hint { opacity: .45; animation: nudge 1.2s ease-in-out infinite; }

.choices { display: grid; gap: 10px; animation: rise .25s ease; }
.prompt { margin: 0 0 4px; text-align: center; font-family: var(--display); font-size: 19px; text-shadow: 0 2px 12px rgba(0,0,0,.7); }
.choice { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; min-height: 56px; padding: 14px 18px; border-radius: 16px;
  background: rgba(255,244,238,.94); color: #2A1220; font-size: 16px; line-height: 1.35; font-weight: 600; box-shadow: 0 10px 26px -14px rgba(0,0,0,.7); }
.choice em { font-style: normal; flex: none; display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 14px; }
/* Премиум-выбор — главная «драгоценность» интерфейса */
.choice.premium { position: relative; overflow: hidden; color: #3A2205;
  background: linear-gradient(115deg, #F7DD9C 0%, var(--gold) 45%, #F4D488 60%, var(--gold-deep) 100%);
  box-shadow: 0 0 0 1px rgba(255,236,190,.8) inset, 0 12px 30px -10px rgba(232,190,104,.75); }
.choice.premium::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%); transform: translateX(-120%); animation: shine 3.2s ease-in-out infinite; }
.choice.premium em { padding: 4px 10px; border-radius: 12px; background: rgba(58,34,5,.14); }

.ask { padding: 18px; border-radius: 22px; background: rgba(28,8,20,.88); border: 1px solid rgba(255,244,238,.12); }
.name-input { width: 100%; height: 54px; border-radius: 14px; border: 1px solid rgba(255,244,238,.25); background: rgba(255,244,238,.08); color: var(--ivory); font: inherit; font-size: 20px; text-align: center; padding: 0 14px; -webkit-user-select: text; user-select: text; }
.name-input.shake { animation: shake .35s; border-color: #ff8a8a; }
.look-row { display: flex; align-items: center; justify-content: space-between; }
.look-n { font-size: 15px; opacity: .8; }
.sprite.center { justify-content: center; }

/* ---------- Конец главы ---------- */
.chapter-end { position: fixed; inset: 0; display: flex; align-items: flex-end; }
.chapter-end .bg { filter: blur(6px) brightness(.55); transform: scale(1.06); }
.ce-card { position: relative; width: 100%; padding: 30px 20px calc(24px + var(--safe-bot)); border-radius: 28px 28px 0 0; background: rgba(43,11,30,.92); border-top: 1px solid rgba(255,244,238,.12); animation: rise .5s ease; }
.ce-card h1 { font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.15; margin: 6px 0 4px; color: var(--blush); }
.ce-sub { margin: 0 0 16px; opacity: .7; }
.ce-reward { display: inline-flex; align-items: center; gap: 8px; color: var(--gold); font-weight: 700; font-size: 18px; margin-bottom: 18px; }

/* ---------- Модальные окна ---------- */
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(10,2,8,.6); display: flex; align-items: flex-end; opacity: 0; transition: opacity .2s; }
.modal.on { opacity: 1; }
.sheet { width: 100%; max-height: 90vh; overflow: auto; padding: 24px 20px calc(20px + var(--safe-bot)); border-radius: 26px 26px 0 0; background: var(--plum); display: grid; gap: 12px; transform: translateY(30px); transition: transform .25s ease; }
.modal.on .sheet { transform: none; }
.sheet h2 { font-family: var(--display); font-weight: 400; font-size: 24px; margin: 0 0 4px; color: var(--blush); }
.m-text { margin: 0; line-height: 1.5; opacity: .9; }
.m-note { margin: 0; font-size: 14px; opacity: .7; line-height: 1.45; }
.m-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shop-row { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 14px; background: rgba(255,244,238,.06); font-size: 22px; }
.shop-row:first-of-type { color: var(--gold); }
.shop-row:nth-of-type(2) { color: var(--rose); }
.shop-row span { display: flex; flex-direction: column; font-size: 15px; color: var(--ivory); }
.shop-row small { opacity: .65; font-size: 13px; }
.switch { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; background: rgba(255,244,238,.06); }
.switch input { appearance: none; -webkit-appearance: none; width: 48px; height: 28px; border-radius: 14px; background: rgba(255,244,238,.2); position: relative; flex: none; transition: background .2s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 11px; background: var(--ivory); transition: transform .2s; }
.switch input:checked { background: var(--gold); }
.switch input:checked::after { transform: translateX(20px); }
.switch span { display: flex; flex-direction: column; }
.switch small { opacity: .65; font-size: 13px; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.admin-grid .btn { min-height: 48px; font-size: 14px; padding: 0 10px; }
.m-errors { font-size: 13px; line-height: 1.5; padding: 12px; border-radius: 12px; background: rgba(255,90,90,.12); color: #FFC9C9; }

/* ---------- Уведомления ---------- */
#toast-root { position: fixed; top: calc(64px + var(--safe-top)); left: 0; right: 0; z-index: 30; display: grid; justify-items: center; gap: 8px; pointer-events: none; }
.toast { padding: 10px 16px; border-radius: 20px; background: rgba(28,8,20,.92); border: 1px solid rgba(255,244,238,.15); font-size: 14px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; animation: drop .3s ease; transition: opacity .4s, transform .4s; }
.toast.out { opacity: 0; transform: translateY(-8px); }
.toast.gold { color: var(--gold); }
.toast .cold { color: #8FA7C9; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes drop { from { opacity: 0; transform: translateY(-10px); } }
@keyframes shine { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
@keyframes nudge { 50% { transform: rotate(45deg) translate(2px, 2px); } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (min-width: 640px) { .shelf { grid-template-columns: repeat(2, 1fr); } }
.story-body .m-note { margin: -6px 0 18px; }

.wardrobe .look-n { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; opacity: 1; }
.wardrobe .ward-n { font-style: normal; font-size: 12px; opacity: .55; letter-spacing: .04em; }
.wardrobe .look-n b { font-family: var(--display); font-weight: 400; font-size: 18px; }
.wardrobe .look-n small { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--gold); }
.btn.gold { background: linear-gradient(115deg, #F7DD9C 0%, var(--gold) 45%, #F4D488 60%, var(--gold-deep) 100%); color: #3A2205; box-shadow: 0 12px 30px -10px rgba(232,190,104,.75); }

/* ---------- Новые элементы ---------- */
.top-right { display: flex; align-items: center; gap: 6px; }
.icon-btn.plain { background: none; width: 36px; color: var(--blush); }
.txt { font-size: var(--txt-size, 17px); }
.line.narr .txt { font-size: calc(var(--txt-size, 17px) + 1px); }

.cg { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; }
.cg.on { opacity: 1; }
.cg::after { content: attr(data-ph); position: absolute; top: 45%; left: 20px; right: 20px; text-align: center; font-family: var(--display); font-size: 18px; opacity: .5; }
.fx { position: absolute; inset: 0; pointer-events: none; z-index: 3; opacity: 0; }
.fx.flash { background: #fff; }
.fx.flash.go { animation: flash .6s ease-out; }
.fx.fade { background: #000; }
.fx.fade.go { animation: fadeblack 1.6s ease-in-out; }
.reader.shake { animation: shake2 .5s; }
@keyframes flash { 0% { opacity: .95; } 100% { opacity: 0; } }
@keyframes fadeblack { 0%, 100% { opacity: 0; } 45%, 55% { opacity: 1; } }
@keyframes shake2 { 10%, 90% { transform: translate(-2px, 1px); } 20%, 80% { transform: translate(4px, -2px); } 30%, 50%, 70% { transform: translate(-7px, 2px); } 40%, 60% { transform: translate(7px, -1px); } }

.tools { position: absolute; z-index: 5; right: 12px; top: calc(64px + var(--safe-top)); display: flex; gap: 6px; }
.tool { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 10px; border-radius: 16px; background: rgba(20,4,14,.5); color: var(--ivory); font-size: 12px; font-weight: 700; opacity: .8; }
.tool.on { background: var(--gold); color: #3A2205; opacity: 1; }

.line.recap { background: rgba(43,11,30,.92); color: var(--ivory); border: 1px solid rgba(232,190,104,.4); border-radius: 18px; }
.line.recap .txt { font-style: italic; }

.log { max-height: 58vh; overflow: auto; display: grid; gap: 10px; padding-right: 4px; }
.log p { margin: 0; line-height: 1.45; font-size: 15px; }
.log p b { display: block; font-size: 13px; color: var(--rose); margin-bottom: 2px; }
.log p.pick { padding: 8px 12px; border-radius: 12px; background: rgba(232,190,104,.12); }
.log p.pick b { color: var(--gold); }

.set-row { display: grid; gap: 8px; padding: 6px 0; }
.set-row > span { font-weight: 700; font-size: 15px; display: flex; justify-content: space-between; }
.set-row i { font-style: normal; opacity: .6; font-weight: 400; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(255,244,238,.07); }
.seg button { height: 38px; border-radius: 10px; font-size: 13px; font-weight: 600; opacity: .75; }
.seg button.on { background: var(--rose); color: var(--wine); opacity: 1; }
.set-row input[type=range] { width: 100%; accent-color: var(--rose); height: 28px; }

.extras { display: flex; gap: 8px; margin: 0 0 16px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 20px; background: rgba(255,244,238,.07); border: 1px solid rgba(255,244,238,.14); font-size: 14px; font-weight: 600; color: var(--blush); }
.chapters li { position: relative; }
.chapters .replay { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--gold); padding: 6px 10px; border-radius: 12px; border: 1px solid rgba(232,190,104,.35); }

.heroes { display: grid; gap: 10px; max-height: 60vh; overflow: auto; }
.hero-card { display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: center; padding: 10px; border-radius: 16px; background: rgba(255,244,238,.06); }
.hero-pic { width: 76px; height: 96px; border-radius: 12px; background-size: 180% auto; background-position: 50% 4%; display: grid; place-items: center; font-family: var(--display); font-size: 30px; color: rgba(255,244,238,.5); }
.hero-card.unknown { opacity: .6; }
.hero-info b { font-size: 16px; }
.hero-info p { margin: 4px 0 8px; font-size: 13px; line-height: 1.4; opacity: .8; }
.hero-info .rel-bar { display: block; }

.cg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cg-th { aspect-ratio: 9 / 16; border-radius: 10px; background-size: cover; background-position: center; background-color: rgba(255,244,238,.06); font-family: var(--display); font-size: 26px; color: rgba(255,244,238,.35); }
.end-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.end-list li { padding: 10px 14px; border-radius: 12px; background: rgba(232,190,104,.12); color: var(--gold); font-weight: 600; font-size: 14px; }
.end-list li.locked { background: rgba(255,244,238,.05); color: rgba(255,244,238,.4); font-weight: 400; }
.cg-view { position: fixed; inset: 0; z-index: 40; background-color: #000; background-size: contain; background-repeat: no-repeat; background-position: center; }
#toast-root { top: calc(112px + var(--safe-top)); }
.home .brand { font-size: 24px; }

.ic.img { width: 1.35em; height: 1.35em; object-fit: contain; vertical-align: -0.3em; }
.ic.img.gift { width: 1.7em; height: 1.7em; }
.home { background: linear-gradient(rgba(43,11,30,.15), rgba(43,11,30,.35)), center top / cover no-repeat url("ui/home_bg.jpg"), var(--wine); background-attachment: fixed; }
.chapters li.locked { opacity: .6; }
.chapters li.locked .ch-n { border: 0; }
.chapters .ch-n img { width: 26px; height: 26px; object-fit: contain; }
.toast .ic.img { width: 1.2em; height: 1.2em; }
.cold .ic.img { filter: grayscale(1) brightness(.8); }

#splash { position: fixed; inset: 0; z-index: 100; background: var(--wine) center / cover no-repeat url("ui/splash.jpg"); display: flex; justify-content: center; padding-top: calc(16vh + var(--safe-top)); transition: opacity .7s ease; }
#splash h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 46px; line-height: 1.05; text-align: center; color: var(--blush); text-shadow: 0 0 24px rgba(232,190,104,.55), 0 2px 10px rgba(0,0,0,.6); opacity: 0; transform: translateY(10px); transition: opacity 1s ease .2s, transform 1s ease .2s; }
#splash.ready h1 { opacity: 1; transform: none; }
#splash.out { opacity: 0; pointer-events: none; }

/* Крупные персонажи сбоку, как в «Клубе» */
.sprite { height: 94%; }
.sprite img, .sprite .silhouette { position: absolute; bottom: 0; height: 100%; width: auto; max-width: none; }
.sprite.right img, .sprite.right .silhouette { right: -34%; }
.sprite.left img, .sprite.left .silhouette { left: -34%; }
.sprite.center img, .sprite.center .silhouette { left: 50%; transform: translateX(-50%); }
.sprite.left, .sprite.right { padding: 0; }
.sprite.right { transform: translateX(24px); }
.sprite.left { transform: translateX(-24px); }
.sprite.on.right, .sprite.on.left { transform: none; }
.sprite { height: 125%; bottom: -33%; }
.sprite.right img, .sprite.right .silhouette { right: -46%; }
.sprite.left img, .sprite.left .silhouette { left: -46%; }
.sprite[data-key^="ward"], .sprite[data-key^="look"] { height: 88%; bottom: 0; }
.scr-read ~ #toast-root, body:has(.reader) #toast-root { top: auto; bottom: calc(190px + var(--safe-bot)); }

/* ---------- Шрифты интерфейса (диалоги не трогаем) ---------- */
:root { --logo: "Logo", "Title", Georgia, serif; --title: "Title", "Prata", Georgia, serif; }
#splash h1 { font-family: var(--logo); font-weight: 400; font-size: 64px; line-height: 1.05; letter-spacing: 0; }
.home .brand { font-family: var(--logo); font-weight: 400; font-size: 36px; line-height: 1; padding-top: 2px; }
.cover-title-ph, .cover-meta h2, .story-body h1, .ce-card h1, .sheet h2, .ch-label, .prompt, .wardrobe .look-n b, .hero-info b {
  font-family: var(--title); font-weight: 600; letter-spacing: .005em; }
.cover-meta h2 { font-size: 27px; line-height: 1.1; }
.story-body h1 { font-size: 44px; line-height: 1; }
.ce-card h1 { font-size: 34px; }
.sheet h2 { font-size: 28px; }
.ch-label { font-size: 17px; font-weight: 500; }
.prompt { font-size: 22px; }
.wardrobe .look-n b { font-size: 21px; }
.hero-info b { font-size: 19px; }
.cover-title-ph { font-size: 44px; }
/* рассказчик остаётся прежним шрифтом */
.line.narr .txt { font-family: "Prata", "DejaVu Serif", Georgia, serif; }
.home .brand { font-size: 31px; white-space: nowrap; }
.home .topbar { gap: 6px; }
.home .brand { min-width: 0; overflow: visible; }
@media (max-width: 400px) { .home .brand { font-size: 25px; } .home .pill { padding: 0 9px; gap: 4px; } .home .icon-btn.plain { width: 30px; } }

/* ---------- Важный выбор и таймер ---------- */
.important { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; align-self: center; padding: 6px 14px; border-radius: 16px; background: rgba(28,8,20,.82); border: 1px solid rgba(232,190,104,.5); color: var(--gold); font-size: 13px; font-weight: 700; animation: rise .3s ease; }
.timer { height: 6px; border-radius: 3px; background: rgba(255,244,238,.18); overflow: hidden; margin: 0 4px 2px; }
.timer i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--rose)); transform-origin: left; }
.choices.hurry .timer i { background: #ff6b6b; }
.choices.hurry .prompt { color: #ffb3b3; }
/* ---------- Лесенка подарков ---------- */
.ladder { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px; background: rgba(255,244,238,.06); border: 1px solid rgba(255,244,238,.1); color: var(--gold); font-size: 20px; }
.day span { font-size: 11px; color: var(--ivory); opacity: .7; }
.day b { font-size: 15px; color: var(--ivory); }
.day small { font-size: 11px; color: var(--rose); display: flex; align-items: center; gap: 2px; }
.day.big { grid-column: span 2; background: linear-gradient(135deg, rgba(232,190,104,.25), rgba(224,122,143,.15)); border-color: rgba(232,190,104,.5); }
.day.got { opacity: .45; }
.day.got b::after { content: " ✓"; color: var(--gold); }
.day.today { border: 2px solid var(--gold); box-shadow: 0 0 18px rgba(232,190,104,.4); }
.m-note.center { text-align: center; }
/* ---------- Анонс ---------- */
.teaser { margin: 0 0 18px; padding: 16px; border-radius: 18px; background: linear-gradient(135deg, rgba(232,190,104,.16), rgba(224,122,143,.1)); border: 1px solid rgba(232,190,104,.35); display: grid; gap: 10px; }
.teaser span { font-family: var(--title); font-weight: 600; font-size: 20px; color: var(--gold); }
.teaser p { margin: 0; line-height: 1.5; font-size: 15px; }
.status.fresh { color: var(--gold); opacity: 1; font-weight: 700; }
.choices .important { justify-self: center; }
.teaser span { font-family: inherit; font-size: inherit; color: inherit; }
.teaser > span { font-family: var(--title); font-weight: 600; font-size: 20px; color: var(--gold); }
body:has(.reader .choices) #toast-root { top: calc(108px + var(--safe-top)); bottom: auto; }

.rel-d { margin-left: 4px; font-size: 11px; }
.rel-d.up { color: #9BD6A3; }
.rel-d.down { color: #E58C8C; }
.rel-v { min-width: 42px; }
.ce-h { margin: 14px 0 8px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .6; }
.ce-ach { display: grid; gap: 4px; margin: 10px 0; padding: 10px 12px; border-radius: 14px; background: rgba(246,211,203,.08); font-size: 14px; }
.ce-ach span { font-size: 12px; opacity: .6; text-transform: uppercase; letter-spacing: .08em; }

.sheet [hidden] { display: none !important; }
.seg.tabs { margin: 0 0 14px; }
.seg.tabs button { height: 42px; font-size: 12px; line-height: 1.15; }

.wardrobe .ward-event { display: inline-block; margin-top: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; letter-spacing: .02em; color: var(--gold); border: 1px solid var(--gold); background: rgba(255,255,255,.06); }

/* ---------- Лента / плитки ---------- */
.viewbar { display: flex; gap: 4px; margin: 14px 16px 0; padding: 3px; width: max-content; border-radius: 999px; background: rgba(255,244,238,.08); }
.viewbar button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--ivory); opacity: .65; }
.viewbar button.on { background: var(--rose); color: var(--wine); opacity: 1; }
.viewbar .ic { width: 16px; height: 16px; }
.shelf.v-tiles { grid-template-columns: repeat(2, 1fr); gap: 18px 14px; }
.shelf.v-tiles .cover-meta h2 { font-size: 19px; }
.shelf.v-tiles .cover-meta .status, .shelf.v-tiles .cover-meta .genre { font-size: 12px; }
.shelf.v-tiles .cover-title-ph { font-size: 24px; left: 14px; right: 14px; bottom: 16px; }
@media (min-width: 640px) { .shelf.v-feed { grid-template-columns: repeat(2, 1fr); } .shelf.v-tiles { grid-template-columns: repeat(3, 1fr); } }

/* Веер сезонов: обложки веером, закрытые сезоны размыты */
.fan { position: relative; aspect-ratio: 3 / 4; }
.fan-c { position: absolute; left: 2%; top: 3%; bottom: 0; width: 70%;
  transform-origin: 50% 100%; transform: translateX(calc(var(--i) * 15%)) rotate(calc(var(--i) * 6deg - 5deg));
  z-index: calc(10 - var(--i)); filter: drop-shadow(0 12px 16px rgba(0,0,0,.55)); }
.fan-art { width: 100%; height: 100%; border-radius: 6px 6px 18px 6px; background-size: cover; background-position: center; box-shadow: inset 0 0 0 1px rgba(255,244,238,.12); }
.fan-c.wip .fan-art { filter: blur(7px) brightness(.7); transform: scale(1.06); clip-path: inset(0 round 6px 6px 18px 6px); }
.fan-c.wip { overflow: hidden; border-radius: 6px 6px 18px 6px; }
.fan-badge { position: absolute; right: 8px; bottom: 8px; z-index: 20; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(43,11,30,.82); color: var(--gold); border: 1px solid rgba(232,190,104,.4); }
.v-tiles .fan-badge { font-size: 11px; padding: 3px 8px; }

/* Сезоны на странице истории */
.chapters.by-season { gap: 0; }
.chapters li.season-head { display: flex; align-items: center; gap: 14px; padding: 18px 0 10px; border-bottom: 1px solid rgba(255,244,238,.16); opacity: 1; }
.season-head .s-art { flex: none; width: 54px; aspect-ratio: 3 / 4; border-radius: 4px 4px 12px 4px; background-size: cover; background-position: center; overflow: hidden; box-shadow: 0 6px 14px -6px rgba(0,0,0,.7); }
.season-head.wip .s-art { filter: blur(5px) brightness(.75); }
.season-head .s-txt { display: flex; flex-direction: column; gap: 1px; }
.season-head small { font-size: 12px; color: var(--rose); letter-spacing: .06em; text-transform: uppercase; }
.season-head b { font-family: var(--display); font-weight: 400; font-size: 21px; color: var(--blush); }
.season-head em { font-style: normal; font-size: 13px; opacity: .7; }
.season-head.wip em { color: var(--gold); opacity: 1; font-weight: 700; }
.chapters li.soon { opacity: .55; font-size: 14px; font-style: italic; padding-left: 4px; }

.cover-card.locked { cursor: default; }
.cover-card.locked .cover-art { filter: blur(9px) brightness(.65); transform: scale(1.04); }
.cover-card { position: relative; }
.cover-card.locked .cover-meta { opacity: .75; }
.cover-card.locked .status { color: var(--gold); opacity: 1; font-weight: 700; }
.cover-art { position: relative; }
.lock-badge { position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%); padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 700; white-space: nowrap; background: rgba(43,11,30,.88); color: var(--gold); border: 1px solid rgba(232,190,104,.5); }
.cover-card.locked .cover-art { clip-path: inset(0 round 6px 6px 22px 6px); }
