/* ═══════════════════════════════════════════════════════════
   САТТВА — ДОМ. Все стили в одном файле.
   Цвета и настройки — в самом начале (:root). Их можно менять.
   ═══════════════════════════════════════════════════════════ */
:root {
  --gold: #C9A96A;
  --gold-bright: #F5D98A;
  --gold-light: #FFF1C9;
  --text: #EDE6D6;
  --text-dim: rgba(237, 230, 214, .72);
  --night: #0A1030;
  --veil: rgba(5, 8, 26, .52);        /* насколько затемнять мрамор */
  --fog: rgba(200, 214, 255, .12);    /* сила тумана (0 — выключить) */
  --type-speed: 28ms;                 /* скорость печати (меняется в app.js) */
  --hand: 'Caveat', 'Segoe Print', cursive;
  --serif: 'Cormorant Garamond', Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--night); color: var(--text); font-family: var(--hand); }
body { overflow: hidden; }
button, input { font-family: inherit; }
a { color: var(--gold-bright); }

/* ─── Фон: мрамор дышит и перетекает ─── */
.bg { position: fixed; inset: -40px; background-size: cover; background-position: center; transition: opacity 1.6s ease; }
/* Тёмный мрамор f01–f13 сменяется сам (app.js): два слоя по очереди проявляются */
.mA, .mB { transition: opacity 4s ease; animation: kb 46s ease-in-out infinite alternate; }
.mB { animation-direction: alternate-reverse; }
.white { background-image: url(img/bg/white1.webp); opacity: 0; animation: kb 60s ease-in-out infinite alternate; }
body[data-bg="white"] .white { opacity: 1; }
.board { background-image: url(img/board.webp); opacity: 0; animation: kb 40s ease-in-out infinite alternate; }
.arrow { background-image: url(img/arrow.webp); opacity: 0; background-position: center top; animation: rise 30s ease-in-out infinite alternate; }
.snake { background-image: url(img/snake.webp); opacity: 0; animation: kb 24s ease-in-out infinite alternate; }
body[data-bg="board"] .board, body[data-bg="arrow"] .arrow, body[data-bg="snake"] .snake { opacity: 1; }
.veil { position: fixed; inset: 0; background: var(--veil); transition: background 1.6s; }
body[data-bg="arrow"] .veil { background: rgba(20, 10, 4, .45); }
body[data-bg="snake"] .veil { background: rgba(2, 6, 14, .45); }
body[data-bg="board"] .veil { background: rgba(5, 8, 26, .4); }
body[data-bg="white"] .veil { background: rgba(255, 250, 238, .38); }
body[data-bg="white"] .fog { background: rgba(255, 255, 255, .35); }
@keyframes kb { from { transform: scale(1.04) translate(0, 0) rotate(0); } to { transform: scale(1.16) translate(-14px, 12px) rotate(1.5deg); } }
@keyframes rise { from { transform: scale(1.08) translateY(20px); } to { transform: scale(1.18) translateY(-20px); } }
@keyframes swap { 0%, 30% { opacity: 0; } 50%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* ─── Туман ─── */
.fog { position: fixed; border-radius: 50%; background: var(--fog); filter: blur(46px); animation: drift 30s ease-in-out infinite alternate; pointer-events: none; }
.f1 { width: 70vw; height: 22vh; left: -10vw; top: 48vh; }
.f2 { width: 55vw; height: 18vh; left: 45vw; top: 14vh; animation-duration: 38s; }
.f3 { width: 60vw; height: 18vh; left: 10vw; top: 80vh; animation-duration: 34s; }
@keyframes drift { from { transform: translate(-50px, 0) scale(1); } to { transform: translate(70px, -20px) scale(1.25); } }

/* ─── Символ: три твоих слоя ─── */
.sym { position: relative; flex-shrink: 0; }
.sym img { position: absolute; inset: 0; width: 100%; height: 100%; }
.sym .ro { animation: pro 4.8s ease-in-out infinite; }
.sym .ri { animation: pri 4.8s ease-in-out infinite; }
.sym .dt { animation: pdt 4.8s ease-in-out infinite; }
@keyframes pro { 0%, 100% { transform: scale(1); filter: drop-shadow(0 0 6px rgba(245,217,138,.2)); } 50% { transform: scale(1.04); filter: drop-shadow(0 0 18px rgba(245,217,138,.5)); } }
@keyframes pri { 0%, 100% { transform: scale(1); } 50% { transform: scale(.93); } }
@keyframes pdt { 0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px rgba(255,230,160,.4)); } 50% { transform: scale(1.35); filter: drop-shadow(0 0 16px rgba(255,230,160,.95)); } }
.thinking .sym .dt { animation-duration: 1.2s; }
.thinking .sym .ro, .thinking .sym .ri { animation-duration: 1.6s; }

/* ─── Каркас страницы ─── */
.app { position: relative; z-index: 2; height: 100%; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; padding: max(22px, env(safe-area-inset-top)) 22px max(22px, env(safe-area-inset-bottom)); }
.top { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.top .grow { flex-grow: 1; }
.cellhead { display: flex; align-items: center; gap: 12px; }
.cellnum { font-family: var(--serif); font-size: 52px; line-height: .9; color: var(--gold-bright); text-shadow: 0 0 26px rgba(245,217,138,.5); }
.cellname { font-family: var(--serif); font-size: 24px; color: var(--gold-light); }
.cellsub { font-size: 19px; color: var(--gold); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.chip { font-size: 17px; padding: 2px 10px; border-radius: 14px; border: 1px solid rgba(245,217,138,.25); color: rgba(237,230,214,.6); transition: all .6s; }
.chip.on { background: rgba(201,169,106,.3); border-color: var(--gold-bright); color: var(--gold-light); box-shadow: 0 0 14px rgba(245,217,138,.35); }
.chip.done { color: rgba(245,217,138,.75); border-color: rgba(245,217,138,.4); }

.stage { flex-grow: 1; overflow-y: auto; padding: 18px 2px 12px; scrollbar-width: none; display: flex; flex-direction: column; gap: 16px; }
.stage::-webkit-scrollbar { display: none; }
.foot { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }

/* ─── Голос Саттвы: печатается и дышит ─── */
.sattva { font-size: 30px; line-height: 1.18; color: var(--gold-bright); white-space: pre-line; animation: glow 5s ease-in-out infinite, float 7s ease-in-out infinite; cursor: pointer; }
.sattva.small { font-size: 26px; }
@keyframes glow { 0%, 100% { text-shadow: 0 0 8px rgba(245,217,138,.25), 0 2px 6px rgba(0,0,0,.7); } 50% { text-shadow: 0 0 22px rgba(245,217,138,.65), 0 2px 6px rgba(0,0,0,.7); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.caret { display: inline-block; width: 2px; height: .9em; margin-left: 2px; background: var(--gold-bright); vertical-align: -.1em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ─── Тексты клетки ─── */
.sectitle { font-family: var(--serif); font-size: 30px; color: var(--gold-light); text-shadow: 0 0 18px rgba(245,217,138,.4); margin: 6px 0 0; }
.body { font-size: 24px; line-height: 1.32; color: var(--text); white-space: pre-line; text-shadow: 0 2px 8px rgba(0,0,0,.75); animation: float 10s ease-in-out infinite; }
.appear { animation: appear 1.2s ease both; }
@keyframes appear { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

/* ─── Жидкое стекло ─── */
.glass { position: relative; background: rgba(16,24,62,.30); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); border: 1px solid rgba(245,217,138,.55); box-shadow: inset 0 1px 0 rgba(255,255,255,.30), inset 0 -1px 0 rgba(0,0,0,.25), 0 10px 30px rgba(0,0,0,.35); color: var(--gold-bright); transition: transform .3s, box-shadow .3s, background .3s; cursor: pointer; }
.glass:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 0 26px rgba(245,217,138,.35), 0 12px 34px rgba(0,0,0,.4); }
.glass:active { transform: scale(.98); }
.btn { min-height: 56px; padding: 8px 22px; border-radius: 28px; font-size: 26px; display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; }
.btn.main { background: rgba(201,169,106,.22); font-weight: 600; }
.btn.soft { font-size: 23px; min-height: 50px; }
.pane { background: rgba(10,16,44,.38); -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%); border: 1px solid rgba(255,255,255,.14); box-shadow: inset 0 1px 0 rgba(255,255,255,.16); }
body[data-bg="arrow"] .glass { background: rgba(40,22,8,.28); border-color: rgba(255,225,160,.65); color: var(--gold-light); }

/* ─── Поле ввода ─── */
.inputbar { display: flex; align-items: center; gap: 10px; padding: 7px 7px 7px 20px; border-radius: 30px; }
.inputbar input { flex-grow: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--text); font-size: 24px; padding: 6px 0; }
.inputbar input::placeholder { color: rgba(237,230,214,.5); }
.send { width: 48px; height: 48px; border-radius: 24px; display: flex; align-items: center; justify-content: center; padding: 0; flex-shrink: 0; }

/* ─── Ключи ─── */
.key { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 12px 16px; border-radius: 20px; width: 100%; cursor: pointer; color: var(--text); transition: all .35s; }
.key .old { font-size: 19px; color: rgba(237,230,214,.55); text-decoration: line-through; text-decoration-color: rgba(237,230,214,.35); }
.key .new { font-size: 23px; line-height: 1.2; color: var(--gold-bright); }
.key:hover { border-color: var(--gold-bright); box-shadow: 0 0 22px rgba(245,217,138,.3); transform: scale(1.01); }

/* ─── Утверждение ─── */
.svetbox { position: relative; display: flex; align-items: center; justify-content: center; min-height: 330px; }
.svetbox .sym { position: absolute; width: 320px; height: 315px; opacity: .55; }
.svetbox .sym .ro { animation: breathO 8s ease-in-out infinite; }
.svetbox .sym .ri { animation: breathI 8s ease-in-out infinite; }
.svetbox .sym .dt { animation: breathD 8s ease-in-out infinite; }
@keyframes breathO { 0%, 100% { transform: scale(.86); } 50% { transform: scale(1.06); } }
@keyframes breathI { 0%, 100% { transform: scale(1.04); } 50% { transform: scale(.88); } }
@keyframes breathD { 0%, 100% { transform: scale(.8); } 50% { transform: scale(1.6); filter: drop-shadow(0 0 20px #F5D98A); } }
.big { position: relative; text-align: center; font-size: 38px; line-height: 1.12; color: var(--gold-light); padding: 0 6px; animation: glowA 8s ease-in-out infinite, floatA 8s ease-in-out infinite; }
@keyframes glowA { 0%, 100% { text-shadow: 0 0 10px rgba(245,217,138,.3), 0 2px 8px rgba(0,0,0,.7); } 50% { text-shadow: 0 0 30px rgba(245,217,138,.85), 0 2px 8px rgba(0,0,0,.7); } }
@keyframes floatA { 0%, 100% { transform: translateY(3px); } 50% { transform: translateY(-6px); } }
.breath { display: flex; justify-content: center; gap: 28px; font-size: 24px; color: var(--gold-bright); }
.breath span { animation: cue 8s ease-in-out infinite; }
.breath span + span { animation-delay: -4s; }
@keyframes cue { 0%, 45% { opacity: 1; } 50%, 95% { opacity: .3; } 100% { opacity: 1; } }

/* ─── Карточки ─── */
.card { padding: 12px 16px; border-radius: 20px; display: flex; flex-direction: column; gap: 2px; }
.card .lbl { font-size: 18px; color: rgba(237,230,214,.65); }
.card .txt { font-size: 24px; line-height: 1.2; color: var(--gold-bright); white-space: pre-line; }

/* ─── Кубик ─── */
.die { align-self: center; width: 150px; height: 150px; border-radius: 34px; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 96px; color: var(--gold-light); text-shadow: 0 0 26px rgba(245,217,138,.8); margin: 20px 0; }
.die.spin { animation: spin .5s linear infinite; }
.die.land { animation: land .6s cubic-bezier(.2,1.6,.4,1); }
@keyframes spin { 0% { transform: rotate(0) scale(.95); } 50% { transform: rotate(180deg) scale(1.05); } 100% { transform: rotate(360deg) scale(.95); } }
@keyframes land { from { transform: scale(.6); } to { transform: scale(1); } }

/* ─── Стрела / змея ─── */
.trans-title { text-align: center; font-family: var(--serif); font-size: 44px; color: var(--gold-light); text-shadow: 0 0 26px rgba(255,220,150,.6), 0 2px 8px rgba(0,0,0,.7); margin: 10px 0 0; }
.trans-move { text-align: center; font-family: var(--serif); font-size: 26px; color: #FFE2A6; text-shadow: 0 2px 6px rgba(0,0,0,.8); }
.mote { position: fixed; width: 4px; height: 4px; border-radius: 2px; background: #FFF1C9; box-shadow: 0 0 10px #FFE7A8; animation: up 6s linear infinite; opacity: 0; z-index: 1; display: none; }
body[data-bg="arrow"] .mote { display: block; }
@keyframes up { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-50vh); opacity: 0; } }

/* ─── Вход ─── */
.hero { flex-grow: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; }
.hero h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 54px; letter-spacing: .14em; color: var(--gold-bright); text-shadow: 0 0 24px rgba(245,217,138,.45); }
.row { display: flex; gap: 12px; }
.row .grow { flex-grow: 1; }

/* ─── Саттва думает ─── */
.dots { display: flex; gap: 7px; align-items: center; font-size: 22px; color: var(--text-dim); }
.dots i { width: 7px; height: 7px; border-radius: 4px; background: var(--gold-bright); animation: dot 1.2s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes dot { 0%, 100% { opacity: .2; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }

/* ─── Манифест ─── */
.modal { position: fixed; inset: 0; z-index: 10; display: none; align-items: center; justify-content: center; padding: 22px; background: rgba(3,5,18,.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal.open { display: flex; }
.modal .inner { max-width: 480px; width: 100%; max-height: 86vh; overflow-y: auto; padding: 26px 24px; border-radius: 26px; display: flex; flex-direction: column; gap: 16px; }
.small-link { background: none; border: 0; color: var(--text-dim); font-size: 21px; cursor: pointer; padding: 8px 0; }
.hidden { display: none !important; }

/* ═══ Белый мрамор: манифест и итог пути ═══ */
body[data-bg="white"] { --ink: #2B2418; --ink-gold: #7A5A1E; }
body[data-bg="white"] .sattva { color: var(--ink-gold); animation: glowW 5s ease-in-out infinite, float 7s ease-in-out infinite; }
@keyframes glowW { 0%, 100% { text-shadow: 0 0 8px rgba(255,255,255,.9), 0 1px 2px rgba(255,255,255,.9); } 50% { text-shadow: 0 0 22px rgba(255,236,190,1), 0 1px 2px rgba(255,255,255,.9); } }
body[data-bg="white"] .body, body[data-bg="white"] .card .txt { color: var(--ink); text-shadow: 0 1px 2px rgba(255,255,255,.8); }
body[data-bg="white"] .sectitle, body[data-bg="white"] .cellname { color: var(--ink-gold); text-shadow: 0 1px 2px rgba(255,255,255,.9); }
body[data-bg="white"] .card .lbl, body[data-bg="white"] .cellsub { color: #6B5530; }
body[data-bg="white"] .pane { background: rgba(255,252,244,.55); border-color: rgba(176,138,62,.45); box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 6px 20px rgba(80,60,20,.12); }
body[data-bg="white"] .glass, .light .glass { background: rgba(255,250,238,.45); border-color: rgba(176,138,62,.75); color: #5A4114; box-shadow: inset 0 1px 0 rgba(255,255,255,.9), inset 0 -1px 0 rgba(120,90,30,.15), 0 8px 24px rgba(80,60,20,.18); }
body[data-bg="white"] .cellnum { color: var(--ink-gold); text-shadow: 0 0 16px rgba(255,236,190,1); }

/* ═══ Манифест на белом мраморе ═══ */
.modal .inner.light { position: relative; overflow-y: auto; border: 1px solid rgba(176,138,62,.6); padding: 0; gap: 0; background: #F4EEE2 url(img/bg/white2.webp) top center / 100% auto repeat-y; }
.light .content { position: relative; padding: 30px 22px 10px; display: flex; flex-direction: column; gap: 18px; color: #2B2418; background: rgba(255,250,238,.5); }
.mf-title { text-align: center; font-family: var(--serif); font-size: 40px; letter-spacing: .12em; color: #7A5A1E; margin: 0; }
.mf-sub { text-align: center; font-size: 22px; color: #6B5530; margin-top: -8px; }
.mf-part { padding: 16px 18px; border-radius: 22px; background: rgba(255,252,244,.62); border: 1px solid rgba(176,138,62,.35); box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 6px 18px rgba(80,60,20,.10); }
.mf-part h2 { margin: 0 0 6px; font-family: var(--serif); font-weight: 500; font-size: 26px; color: #7A5A1E; display: flex; gap: 10px; align-items: center; }
.mf-part h2 .ico { font-size: 24px; }
.mf-part p { margin: 6px 0; font-size: 22px; line-height: 1.3; }
.mf-part ul { margin: 6px 0; padding-left: 0; list-style: none; }
.mf-part li { font-size: 21px; line-height: 1.3; margin: 4px 0; padding-left: 26px; position: relative; }
.mf-part li::before { content: "✦"; position: absolute; left: 4px; color: #B08A3E; font-size: 15px; top: 4px; }
.mf-quote { text-align: center; font-size: 27px; line-height: 1.2; color: #7A5A1E; padding: 6px 10px; }
.mf-sign { text-align: center; font-family: var(--serif); font-size: 22px; color: #6B5530; }
.mf-close { position: sticky; bottom: 0; padding: 12px 24px 18px; background: linear-gradient(transparent, rgba(255,250,238,.9) 40%); }

/* ═══ Кнопка голоса ═══ */
.sound { position: fixed; z-index: 5; top: max(16px, env(safe-area-inset-top)); right: 16px; width: 48px; height: 48px; border-radius: 24px; display: flex; align-items: center; justify-content: center; padding: 0; }
.sound .on { display: none; } .sound.active .on { display: block; } .sound.active .off { display: none; }
.sound.active { box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 0 22px rgba(245,217,138,.45); }
.sound.speaking .on { animation: pulseS 1.6s ease-in-out infinite; }
@keyframes pulseS { 0%, 100% { opacity: .7; } 50% { opacity: 1; } }
.top { padding-right: 60px; gap: 8px; }

/* ═══ Тихие кнопки в игре: проводник и поддержка ═══ */
.mini-ic { width: 40px; height: 40px; border-radius: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; opacity: .7; text-decoration: none; }
.mini-ic:hover { opacity: 1; }
.hero-wrap .small-link { white-space: nowrap; }

/* ═══ Вход в три шага: символ → имя → приветствие ═══ */
.st { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; }
.st.hidden { display: none !important; }
.tap { background: none; border: 0; padding: 0; cursor: pointer; animation: tapBreath 3.6s ease-in-out infinite; }
@keyframes tapBreath { 0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(245,217,138,.25)); } 50% { transform: scale(1.06); filter: drop-shadow(0 0 34px rgba(245,217,138,.7)); } }
.hint { font-size: 22px; color: var(--text-dim); letter-spacing: .3em; animation: hint 3.6s ease-in-out infinite; }
@keyframes hint { 0%, 100% { opacity: .25; } 50% { opacity: .8; } }
.name { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 64px; letter-spacing: .22em; color: var(--gold-bright); display: flex; }
.name span { display: inline-block; opacity: 0; filter: blur(14px); transform: translateY(18px) scale(1.3); animation: letter 1.6s cubic-bezier(.2,.7,.2,1) forwards; text-shadow: 0 0 30px rgba(245,217,138,.7); }
.name span:nth-child(2) { animation-delay: .18s; } .name span:nth-child(3) { animation-delay: .36s; } .name span:nth-child(4) { animation-delay: .54s; }
.name span:nth-child(5) { animation-delay: .72s; } .name span:nth-child(6) { animation-delay: .9s; }
@keyframes letter { 60% { opacity: 1; filter: blur(0); text-shadow: 0 0 46px rgba(255,236,190,1); } to { opacity: 1; filter: blur(0); transform: none; text-shadow: 0 0 24px rgba(245,217,138,.5); } }
.name-sub { font-size: 26px; color: var(--gold); opacity: 0; animation: appear 1.4s ease 1.8s forwards; }
.st3 { justify-content: space-between; padding: 70px 4px 10px; }
.st3 .hero { flex-grow: 1; justify-content: center; gap: 26px; }
.welcome-btns { display: flex; flex-direction: column; gap: 12px; width: 100%; opacity: 0; transition: opacity 1.2s ease; }
.welcome-btns.show { opacity: 1; }
.welcome-btns .small-link { align-self: center; font-size: 19px; }
.curtain { position: fixed; inset: 0; z-index: 8; background: #03040C; opacity: 0; pointer-events: none; transition: opacity .9s ease; }
.curtain.on { opacity: 1; pointer-events: auto; }

/* ─── вход: Яндекс ID / VK ID / без регистрации ─── */
.login-box { display: flex; flex-direction: column; gap: 12px; }
.login-note { margin: 2px 6px 0; text-align: center; font-size: 19px; line-height: 1.25; color: var(--text-dim); }
.links-row { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; }
.links-row:empty { display: none; }
.welcome-btns .privacy { font-size: 16px; opacity: .7; text-decoration: none; }
a.small-link { text-decoration: none; }
.welcome-msg { text-align: center; font-size: 20px; color: #FFC9A6; }
