:root {
  --bg: #14110f; --bg2: #1d1916; --card: #221d19; --line: #3a322b;
  --text: #ece4d8; --muted: #a2978a; --accent: #dba84a; --accent-ink: #1b1509;
  --good: #86bd7f; --bad: #d0705a; --lock: #6f665c;
  --serif: Georgia, "Times New Roman", "PT Serif", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }
#app { min-height: 100%; }
.screen { min-height: 100vh; min-height: 100dvh; }

/* ---------- кнопки ---------- */
.btn { border: 1px solid var(--line); background: transparent; padding: 14px 26px; border-radius: 12px; font-size: 17px; transition: transform .12s, background .2s, border-color .2s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 650; }
.btn.primary:hover { background: #e9b95f; }
.btn.ghost:hover { border-color: var(--accent); }
.chip { border: 1px solid var(--line); background: rgba(20, 17, 15, .55); padding: 6px 12px; border-radius: 999px; font-size: 13px; color: var(--muted); }
.chip:hover { color: var(--text); border-color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- начало ---------- */
#start { display: grid; place-items: center; padding: 24px 16px 48px; background: radial-gradient(1200px 700px at 50% -10%, #2b3550 0%, #191a22 45%, var(--bg) 75%); }
.start-inner { width: 100%; max-width: 560px; text-align: center; }
.start-scene { height: 250px; position: relative; margin-bottom: 4px; }
.start-scene img { position: absolute; left: 50%; top: 0; height: 100%; transform: translateX(-50%); animation: bob 7s ease-in-out infinite; filter: drop-shadow(0 22px 26px rgba(0, 0, 0, .45)); }
.logo { font-family: var(--serif); font-size: clamp(56px, 16vw, 92px); letter-spacing: .04em; margin: 0; font-weight: 400; line-height: 1; }
.tagline { font-family: var(--serif); font-size: 18px; line-height: 1.5; color: #d6cdbf; margin: 18px 0 26px; }
.start-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.fineprint { color: var(--muted); font-size: 13px; line-height: 1.5; margin-top: 22px; }
.past { margin-top: 34px; text-align: left; border-top: 1px solid var(--line); padding-top: 18px; }
.past h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; margin: 0 0 10px; }
.past ul { list-style: none; margin: 0; padding: 0; }
.past li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #2a2420; font-size: 14px; }
.past li b { font-family: var(--serif); font-weight: 400; font-size: 16px; }
.past li span { color: var(--muted); text-align: right; }
.past-note { color: var(--muted); font-size: 12.5px; margin-top: 12px; }

/* ---------- игра: раскладка ---------- */
#game { display: flex; flex-direction: column; max-width: 1180px; margin: 0 auto; }
.stage { position: sticky; top: 0; z-index: 5; background: var(--bg); }
.panel { padding: 12px 16px 40px; flex: 1; }
@media (min-width: 920px) {
  #game { flex-direction: row; gap: 28px; padding: 24px; align-items: flex-start; }
  .stage { flex: 0 0 54%; top: 24px; background: transparent; }
  .panel { padding: 0; }
  .scene { border-radius: 18px; }
}

/* ---------- сцена ---------- */
.scene { position: relative; overflow: hidden; height: min(42vh, 380px); isolation: isolate; }
@media (min-width: 920px) { .scene { height: min(62vh, 560px); } }
.sky, .stars, .flash { position: absolute; inset: 0; }
.sky { transition: background 1.6s ease; z-index: -3; }
.t-dawn .sky { background: linear-gradient(#5b6b9c 0%, #c98f8a 55%, #f1c48a 100%); }
.t-day .sky { background: linear-gradient(#4f8fd0 0%, #8fc2ea 55%, #d9ecf5 100%); }
.t-dusk .sky { background: linear-gradient(#3a3566 0%, #a8587a 55%, #f0a060 100%); }
.t-night .sky { background: linear-gradient(#0b1026 0%, #1b2450 60%, #33406e 100%); }
.stars { z-index: -2; opacity: 0; transition: opacity 1.6s; background-image: radial-gradient(1.5px 1.5px at 12% 18%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 28% 9%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 44% 24%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 63% 12%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 78% 21%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 90% 8%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 7% 36%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 55% 5%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 95% 34%, #fff 50%, transparent 51%); }
.t-night .stars { opacity: .9; animation: twinkle 4s ease-in-out infinite; }
.sun { position: absolute; z-index: -2; width: 70px; height: 70px; border-radius: 50%; left: 12%; top: 12%; background: radial-gradient(#fff6d6 0 35%, rgba(255, 240, 190, .45) 36% 60%, transparent 61%); transition: all 1.6s ease; }
.t-dawn .sun { top: 46%; left: 8%; background: radial-gradient(#ffd9a0 0 35%, rgba(255, 190, 130, .4) 36% 60%, transparent 61%); }
.t-dusk .sun { top: 50%; left: 80%; background: radial-gradient(#ffb070 0 35%, rgba(255, 150, 90, .4) 36% 60%, transparent 61%); }
.t-night .sun { top: 10%; left: 76%; width: 46px; height: 46px; background: radial-gradient(#eef2ff 0 60%, rgba(220, 230, 255, .25) 61% 100%); box-shadow: 0 0 30px rgba(200, 215, 255, .35); }
.cloud { position: absolute; z-index: -1; width: 34%; opacity: .92; pointer-events: none; }
.cloud.c1 { top: 6%; animation: drift 70s linear infinite; }
.cloud.c2 { top: 24%; width: 24%; opacity: .75; animation: drift 105s linear infinite -40s; }
.t-night .cloud { filter: brightness(.45) saturate(.7); opacity: .6; }
.t-dusk .cloud { filter: sepia(.5) saturate(1.5) hue-rotate(-20deg) brightness(.95); }

.dio-wrap { position: absolute; left: 50%; bottom: -3%; height: 96%; aspect-ratio: 1024 / 860; transform: translateX(-50%); animation: bob 8s ease-in-out infinite; transition: filter 1.6s ease; }
.dio { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 18px 18px rgba(0, 0, 0, .28)); transition: opacity .5s; }
.char { position: absolute; left: 50%; bottom: 33.2%; height: 39%; transform: translateX(-50%); transform-origin: 50% 91%; transition: opacity .45s; animation: breathe 3.6s ease-in-out infinite; }
.char-shadow { position: absolute; left: 50%; bottom: 35%; width: 9%; height: 2.6%; transform: translateX(-50%); border-radius: 50%; background: rgba(0, 0, 0, .28); filter: blur(2px); }
.t-night .dio-wrap { filter: brightness(.58) saturate(.8) contrast(1.05); }
.t-dusk .dio-wrap { filter: brightness(.93) saturate(1.12) sepia(.16); }
.t-dawn .dio-wrap { filter: brightness(.97) saturate(.95); }
.scene.dead .dio-wrap { filter: grayscale(1) brightness(.6); transition: filter 3s; }
.scene.dead .char { opacity: 0; transition: opacity 3s; }
.char.hop { animation: hop .6s ease 2; }
.char.shake { animation: shake .5s linear 2; }
.scene.quake .dio-wrap { animation: quake .5s linear 2; }
#fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.flash { pointer-events: none; opacity: 0; }
.flash.go { animation: flash 1.1s ease-out; }
.scene::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(rgba(20, 17, 15, .5) 0%, transparent 22%, transparent 70%, rgba(20, 17, 15, .75) 100%); }

.hud-top { position: absolute; left: 0; right: 0; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 14px; text-shadow: 0 1px 4px rgba(0, 0, 0, .7); }
.who b { font-family: var(--serif); font-weight: 400; font-size: 22px; display: block; line-height: 1.1; }
.who span { font-size: 14px; color: #f3ead9; }
.where { text-align: right; font-size: 13px; line-height: 1.35; color: #f3ead9; }
.where span { display: block; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 10px 16px 12px; border-bottom: 1px solid var(--line); }
@media (min-width: 920px) { .stats { padding: 14px 4px 0; border-bottom: 0; } }
.stat-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stat-head em { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--text); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) { .stats { gap: 10px; padding: 9px 14px 11px; } .stat-head { flex-direction: column; align-items: flex-start; gap: 1px; font-size: 10.5px; } .stat-head em { font-size: 13px; max-width: 100%; } .who b { font-size: 20px; } .card { padding: 17px 16px 16px; } .text { font-size: 17.5px; } }
.bar { height: 5px; background: #2e2823; border-radius: 3px; margin-top: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 50%; border-radius: 3px; background: var(--accent); transition: width .8s cubic-bezier(.2, .7, .2, 1), background .5s; }
#s-health .bar i { background: #c9665a; }
#s-wealth .bar i { background: #dba84a; }
#s-status .bar i { background: #7f9fd0; }
.stat.pulse-up .bar { box-shadow: 0 0 0 2px rgba(134, 189, 127, .45); }
.stat.pulse-down .bar { box-shadow: 0 0 0 2px rgba(208, 112, 90, .5); }
.bar { transition: box-shadow .4s; }

/* ---------- карточка ---------- */
.meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.job { font-size: 13.5px; color: var(--muted); }
.job b { color: var(--text); font-weight: 600; }
.meta-buttons { display: flex; gap: 6px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px 20px 18px; animation: rise .45s ease both; }
.card h2 { font-family: var(--serif); font-weight: 400; font-size: 25px; margin: 0 0 10px; color: var(--accent); }
.narr { list-style: none; margin: 0 0 12px; padding: 0 0 12px; border-bottom: 1px dashed var(--line); }
.narr:empty { display: none; }
.narr li { font-size: 14.5px; color: var(--muted); line-height: 1.5; padding: 2px 0 2px 14px; position: relative; }
.narr li::before { content: ""; position: absolute; left: 0; top: .72em; width: 6px; height: 1px; background: var(--muted); }
.text { font-family: var(--serif); font-size: 18.5px; line-height: 1.62; margin: 0 0 18px; white-space: pre-line; }
.opts { display: grid; gap: 9px; }
.opt { text-align: left; border: 1px solid var(--line); background: var(--bg2); padding: 13px 15px; border-radius: 12px; font-size: 16px; line-height: 1.35; transition: border-color .15s, background .15s, transform .1s; display: flex; gap: 10px; align-items: baseline; }
.opt:hover:not(:disabled) { border-color: var(--accent); background: #2a231d; }
.opt:active:not(:disabled) { transform: scale(.985); }
.opt .n { color: var(--muted); font-size: 12px; min-width: 12px; font-variant-numeric: tabular-nums; }
.opt.next { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 650; justify-content: center; }
.opt.next:hover:not(:disabled) { background: #e9b95f; }
.opt:disabled { cursor: default; color: var(--lock); border-style: dashed; }
.opt small { display: block; font-size: 12.5px; color: var(--bad); margin-top: 3px; }
.opt small.price { color: var(--accent); }
.opt-tags { display: flex; gap: 10px; flex-wrap: wrap; }
.opt-tags small { display: inline-block; }
.opt small.risk { font-weight: 600; }
.opt small.risk.r-0 { color: #9fd59a; }
.opt small.risk.r-1 { color: #e3c06a; }
.opt small.risk.r-2 { color: #e8956a; }
.opt small.risk.r-3 { color: #e0605a; }
/* острые сцены */
.sheet.drama { background: rgba(5, 3, 3, .78); }
.sheet.drama .card { border-color: rgba(200, 80, 60, .45); box-shadow: 0 0 0 1px rgba(200, 80, 60, .15), 0 30px 90px rgba(0, 0, 0, .75), 0 0 80px rgba(160, 40, 30, .18); }
.sheet.drama #card-title { color: #e88f7a; letter-spacing: .02em; }
.sheet.drama #card-text { font-size: 1.12em; line-height: 1.55; }
.card.reveal #card-text { animation: revealText 1.6s ease-out both; }
.card.reveal #card-deltas, .card.reveal #card-opts { animation: revealText 1s ease-out 1.2s both; }
@keyframes revealText { from { opacity: 0; filter: blur(3px); transform: translateY(4px); } to { opacity: 1; filter: none; transform: none; } }
.deltas { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 16px; }
.deltas:empty { display: none; }
.delta { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.delta.up { color: var(--good); border-color: rgba(134, 189, 127, .4); }
.delta.down { color: var(--bad); border-color: rgba(208, 112, 90, .4); }

/* ---------- окна ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(8, 7, 6, .72); display: grid; place-items: end center; }
@media (min-width: 640px) { .modal { place-items: center; } }
.modal-box { width: 100%; max-width: 560px; max-height: 84vh; background: var(--card); border: 1px solid var(--line); border-radius: 18px 18px 0 0; display: flex; flex-direction: column; animation: rise .3s ease both; }
@media (min-width: 640px) { .modal-box { border-radius: 18px; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 21px; }
.modal-body { padding: 8px 18px 20px; overflow: auto; }
.person { padding: 12px 0; border-bottom: 1px solid #2c2621; }
.person:last-child { border-bottom: 0; }
.person-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.person-top b { font-family: var(--serif); font-weight: 400; font-size: 18px; }
.person-top span { font-size: 13px; color: var(--muted); }
.person .rel { font-size: 13px; margin-top: 2px; }
.rel.warm { color: var(--good); } .rel.cold { color: var(--bad); } .rel.dead { color: var(--lock); }
.person p { margin: 6px 0 0; font-size: 14px; color: var(--muted); line-height: 1.45; }
.chron-row { display: grid; grid-template-columns: 62px 1fr; gap: 10px; padding: 7px 0; font-size: 14.5px; border-bottom: 1px solid #2c2621; }
.chron-row span { color: var(--muted); }
.rumor { font-family: var(--serif); font-size: 16px; color: #d6cdbf; padding: 10px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-list { display: grid; gap: 10px; padding-top: 10px; }
#start { position: relative; }
.sound-chip { position: absolute; top: 14px; right: 16px; }
.chip.off { color: var(--lock); border-style: dashed; }
.vol { display: grid; gap: 14px; padding: 12px 0 16px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.vol label { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.vol input[type="range"] { width: 100%; accent-color: var(--accent); }

/* ---------- титры ---------- */
#credits { background: radial-gradient(900px 600px at 50% 0%, #1c2033 0%, #0b0a0a 70%); position: relative; }
.credits-scroll { height: 100vh; height: 100dvh; overflow-y: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(transparent 0, #000 12%, #000 88%, transparent 100%); mask-image: linear-gradient(transparent 0, #000 12%, #000 88%, transparent 100%); }
.credits-scroll::-webkit-scrollbar { display: none; }
.credits-body { max-width: 620px; margin: 0 auto; padding: 100vh 22px 40vh; text-align: center; font-family: var(--serif); }
.cr { margin-bottom: 110px; }
.cr h3 { font-family: var(--sans); font-size: 12.5px; letter-spacing: .28em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin: 0 0 26px; }
.cr-head .name { font-size: clamp(44px, 12vw, 72px); line-height: 1.05; margin: 0; font-weight: 400; }
.cr-head .years { font-size: 22px; color: #d6cdbf; margin-top: 12px; }
.cr-head .sub { font-family: var(--sans); font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-top: 14px; }
.cr-head .line { font-size: 17px; color: var(--muted); margin-top: 22px; line-height: 1.5; }
.cast-row { margin-bottom: 24px; }
.cast-row .role { font-family: var(--sans); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.cast-row .nm { font-size: 24px; margin: 3px 0 5px; }
.cast-row .ln { font-size: 15.5px; color: #bdb2a3; line-height: 1.45; max-width: 460px; margin: 0 auto; }
.num-row { margin-bottom: 26px; }
.num-row b { display: block; font-size: 58px; font-weight: 400; line-height: 1; }
.num-row.bad b { color: var(--bad); } .num-row.good b { color: var(--good); }
.num-row span { font-size: 17px; color: #bdb2a3; }
.cr .foot { color: var(--muted); font-size: 16px; margin-top: 8px; }
.list-row { font-size: 18px; line-height: 1.55; margin: 0 auto 20px; max-width: 500px; color: #ddd3c5; }
.fate-row { margin-bottom: 26px; }
.fate-row .nm { font-size: 21px; }
.fate-row .role { font-family: var(--sans); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 2px 0 6px; }
.fate-row .ln { font-size: 16.5px; line-height: 1.5; max-width: 480px; margin: 0 auto; }
.fate-row.good .ln { color: #b9d9b3; } .fate-row.bad .ln { color: #e2a999; }
.cr-verdict .vname { font-size: clamp(38px, 10vw, 60px); margin: 0 0 18px; font-weight: 400; }
.cr-verdict .vtext { font-size: 19px; line-height: 1.6; color: #ddd3c5; max-width: 520px; margin: 0 auto; }
.karma { margin: 38px auto 0; max-width: 420px; }
.karma-bar { position: relative; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #5a1f1a, #4a443e 50%, #e9d9a0); }
.karma-bar i { position: absolute; top: -7px; width: 4px; height: 20px; background: #fff; border-radius: 2px; transform: translateX(-2px); box-shadow: 0 0 12px rgba(255, 255, 255, .7); }
.karma-ends { display: flex; justify-content: space-between; font-family: var(--sans); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 12px; }
.carry { font-size: 15px; color: var(--muted); margin-top: 26px; font-style: italic; }
.cr-rare { font-size: 19px; color: #d6cdbf; }
/* последний кадр, график, письмо, надгробие */
.last-frame { margin: 0 auto 26px; max-width: 360px; padding: 10px 10px 8px; background: #efe6d2; border-radius: 4px; box-shadow: 0 18px 40px rgba(0, 0, 0, .55); transform: rotate(-1.5deg); }
.last-frame img { display: block; width: 100%; border-radius: 2px; }
.last-frame figcaption { font-family: var(--serif, Georgia, serif); font-size: 13px; color: #5a4a38; margin-top: 6px; text-align: center; font-style: italic; }
.last-frame.small { max-width: 280px; margin: 4px auto 14px; }
.cr-chart .life-chart { width: 100%; max-width: 640px; height: auto; display: block; margin: 0 auto; }
.life-chart .lc-grid { stroke: rgba(255, 255, 255, .07); stroke-width: 1; }
.life-chart .lc-ax { fill: #8a8070; font-size: 11px; text-anchor: middle; }
.life-chart .lc-mark line { stroke: rgba(219, 168, 74, .25); stroke-dasharray: 2 3; }
.life-chart .lc-mark circle { fill: var(--accent); }
.life-chart .lc-mark:hover line { stroke: var(--accent); }
.lc-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 10px; font-size: 12.5px; color: #b8ad9a; }
.lc-legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.lc-legend i.mk { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.cr-letter .letter-text { font-family: var(--serif, Georgia, serif); font-style: italic; font-size: 22px; color: #efe2c8; max-width: 520px; margin: 0 auto 10px; line-height: 1.45; }
.cr-grave .stone { position: relative; width: 230px; margin: 0 auto 18px; padding: 34px 18px 26px; border-radius: 110px 110px 8px 8px; background: linear-gradient(180deg, #8d8a84, #6c6964 70%, #5a5752); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .25), inset 0 -8px 18px rgba(0, 0, 0, .3), 0 20px 40px rgba(0, 0, 0, .55); color: #2a2622; display: grid; gap: 4px; text-align: center; }
.cr-grave .stone::after { content: ''; position: absolute; left: -24px; right: -24px; bottom: -10px; height: 14px; border-radius: 50%; background: radial-gradient(ellipse, rgba(80, 110, 50, .7), transparent 70%); }
.cr-grave .st-sym { font-size: 20px; color: #3a3632; opacity: .7; }
.cr-grave .stone b { font-family: var(--serif, Georgia, serif); font-size: 22px; color: #1e1b18; text-shadow: 0 1px 0 rgba(255, 255, 255, .25); }
.cr-grave .stone small { font-size: 13px; letter-spacing: .08em; }
.cr-grave .stone em { font-family: var(--serif, Georgia, serif); font-size: 14.5px; line-height: 1.4; margin-top: 8px; color: #24201c; }
.ep-opts { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.ep-opt { max-width: 420px; white-space: normal; text-align: center; line-height: 1.35; padding: 7px 14px; }
.ep-opt.on { border-color: var(--accent); color: var(--accent); }
.album-ep { text-align: center; font-family: var(--serif, Georgia, serif); font-style: italic; color: #d8c9ac; margin: 0 0 10px; }
.lc-img.snap img { object-fit: cover; }
.photo-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; max-width: 760px; margin: 0 auto; }
.photo { margin: 0; width: 190px; padding: 8px 8px 6px; background: #efe6d2; border-radius: 3px; box-shadow: 0 12px 26px rgba(0, 0, 0, .5); transform: rotate(var(--r)); transition: transform .2s; }
.photo:hover { transform: rotate(0) scale(1.06); z-index: 1; }
.photo img { display: block; width: 100%; border-radius: 2px; }
.photo figcaption { font-family: var(--serif, Georgia, serif); font-size: 13px; color: #4a3b2b; margin-top: 5px; text-align: center; display: grid; }
.photo figcaption small { font-size: 11px; color: #7a6a58; }
.photo-row.small { gap: 10px; margin-bottom: 14px; }
.photo-row.small .photo { width: 130px; }
.next-hint { font-family: var(--serif, Georgia, serif); font-style: italic; color: #cdbf9f; font-size: 17px; max-width: 460px; margin: 6px auto 18px; line-height: 1.5; animation: hintGlow 3.5s ease-in-out infinite; }
@keyframes hintGlow { 50% { color: #f0dcae; } }
.card-dl { margin: 0 auto 18px; display: block; }
.order-line { padding: 6px 14px; font-size: 12.5px; color: #c9d8b0; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, rgba(120, 160, 80, .12), transparent 70%); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 920px) { .order-line { padding: 7px 6px; border-bottom: 0; border-radius: 8px; margin-top: 6px; } }
.gift-opt.on { border-color: var(--accent); background: rgba(219, 168, 74, .1); }
.gift-opt.weekly b { color: var(--accent); }
.speed .ff { font-size: 12px; }
.speed .ff.on { background: #c85a3a; color: #fff; }
.life-card.special { border-color: #d9a84a; box-shadow: 0 0 0 1px rgba(217, 168, 74, .35), 0 0 24px rgba(217, 168, 74, .15); }
.lc-special { font-size: 12px; color: #d9a84a; font-weight: 600; }
.title-card.on b { color: var(--accent); }
.live-tags .tag.thing { background: rgba(30, 40, 30, .62); color: #d8e6c8; font-weight: 500; }
.cr-score .sc-total { font-family: var(--serif, Georgia, serif); font-size: 72px; line-height: 1; margin: 0; color: #f3e6cc; }
.cr-score .sc-rank { font-size: 15px; letter-spacing: .3em; text-transform: uppercase; color: var(--accent); margin: 8px 0 26px; }
.cr-score .sc-parts { max-width: 360px; margin: 0 auto 18px; display: grid; gap: 6px; }
.cr-score .sc-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; color: #cfc5b4; border-bottom: 1px dashed rgba(255, 255, 255, .08); padding-bottom: 4px; }
.cr-score .sc-row b { color: #9fd59a; font-weight: 600; }
.cr-score .sc-row.bad b { color: #e08a7a; }
.cr-score .sc-pts { font-size: 14px; color: var(--accent); margin-top: 14px; }
.cr-score .sc-pts small { color: var(--muted); }
.cr-end { margin-bottom: 0; }
.cr-end .logo { font-size: 54px; margin-bottom: 26px; }
.cr-end .start-buttons { margin-top: 8px; }
.skip { position: absolute; right: 14px; bottom: 14px; z-index: 3; }

/* ---------- движение ---------- */
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -1.4%; } }
@keyframes breathe { 0%, 100% { scale: 1 1; } 50% { scale: 1 1.018; } }
@keyframes hop { 0%, 100% { translate: 0 0; } 40% { translate: 0 -9%; } }
@keyframes shake { 0%, 100% { translate: 0 0; } 25% { translate: -3% 0; } 75% { translate: 3% 0; } }
@keyframes quake { 0%, 100% { translate: 0 0; } 20% { translate: -1.2% .6%; } 40% { translate: 1% -.6%; } 60% { translate: -.8% .4%; } 80% { translate: .8% -.3%; } }
@keyframes drift { from { left: -40%; } to { left: 110%; } }
@keyframes twinkle { 0%, 100% { opacity: .9; } 50% { opacity: .55; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes flash { 0% { opacity: .0; } 12% { opacity: .55; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .dio-wrap, .char, .cloud, .start-scene img, .t-night .stars { animation: none !important; }
}

/* ================= летопись и течение времени ================= */
#game { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; display: flex; flex-direction: column; max-width: 1240px; }
.stage { position: relative; top: auto; flex: none; background: var(--bg); }
.scene { height: min(34vh, 300px); }
.panel { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0; position: relative; }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; flex-wrap: wrap; }
.speed { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: rgba(20, 17, 15, .55); }
.speed button { border: 0; background: transparent; color: var(--muted); padding: 6px 10px; min-width: 36px; font-size: 13px; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.speed button + button { border-left: 1px solid var(--line); }
.speed button.on { background: var(--accent); color: var(--accent-ink); font-weight: 650; }
.speed button:hover:not(.on) { color: var(--text); }
.meta-buttons { display: flex; gap: 6px; }
.h-job { display: block; font-size: 12.5px; color: #e6dccb; margin-top: 1px; }
.paused-badge { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 4; padding: 7px 16px; border-radius: 999px; background: rgba(15, 12, 10, .72); color: var(--text); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; pointer-events: none; }
.yearbar { height: 3px; background: #2a2420; overflow: hidden; }
.yearbar i { display: block; height: 100%; background: var(--accent); opacity: .85; transform-origin: 0 50%; transform: scaleX(0); }
.stats { border-bottom: 1px solid var(--line); }

.log-head { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 16px 4px; }
.log-head h2 { font-family: var(--serif); font-weight: 400; font-size: 19px; margin: 0; color: var(--accent); }
.log { flex: 1; min-height: 0; overflow-y: auto; padding: 0 16px 28px; overscroll-behavior: contain; }
.log-now { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 3; background: var(--card); color: var(--text); box-shadow: 0 6px 18px rgba(0, 0, 0, .4); }
.yr { display: grid; grid-template-columns: 50px 1fr; gap: 10px; padding: 10px 0 6px; border-top: 1px solid #2a2420; animation: rise .45s ease both; }
.yr:first-child { border-top: 0; }
.yr-age { font-family: var(--serif); font-size: 21px; line-height: 1.05; }
.yr-age small { display: block; font-family: var(--sans); font-size: 11px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.ln { margin: 0 0 6px; font-size: 15px; line-height: 1.5; color: #d9cfc1; animation: rise .45s ease both; }
.ln.news { color: #c7bcae; }
.ln.mile { color: var(--accent); }
.ln.hist { font-style: italic; color: #b6a68a; }
.ln.hist::before { content: "В мире · "; font-style: normal; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #8e7f66; }
.ln.birth, .ln.death { font-family: var(--serif); font-size: 17px; color: var(--text); }
.ln.death { color: #e2b4a6; }
.ln.good::before, .ln.bad::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin: 0 8px 2px 0; vertical-align: middle; }
.ln.good::before { background: var(--good); }
.ln.bad::before { background: var(--bad); }
.ln.choice { background: #201b17; border-left: 2px solid var(--accent); padding: 8px 11px; border-radius: 0 10px 10px 0; }
.ln.choice b { display: block; font-family: var(--serif); font-weight: 400; font-size: 16px; color: var(--accent); }
.ln.choice em { display: block; font-style: normal; color: var(--text); font-size: 14px; margin: 2px 0 4px; }
.ln.choice em::before { content: "→ "; color: var(--muted); }

.sheet { position: fixed; inset: 0; z-index: 40; display: grid; place-items: end center; background: rgba(8, 7, 6, .5); animation: fadein .25s ease both; }
.sheet .card { width: 100%; max-width: 580px; max-height: 86vh; max-height: 86dvh; overflow-y: auto; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .5); padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
@media (min-width: 640px) { .sheet { place-items: center; } .sheet .card { border-radius: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .55); } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 400px) {
  .topbar { padding: 7px 10px; }
  .speed button { min-width: 31px; padding: 6px 7px; font-size: 12.5px; }
  .meta-buttons .chip { padding: 5px 9px; font-size: 12px; }
}
@media (min-width: 920px) {
  #game { flex-direction: row; gap: 28px; padding: 20px 24px; align-items: stretch; }
  .stage { flex: 0 0 54%; display: flex; flex-direction: column; background: transparent; top: auto; }
  .topbar { padding: 0 2px 12px; }
  .scene { height: auto; flex: 1; min-height: 0; border-radius: 18px; }
  .yearbar { margin: 8px 4px 0; border-radius: 2px; }
  .stats { border-bottom: 0; }
  .log-head { padding: 2px 0 8px; }
  .log { padding: 0 8px 28px 0; }
  .sheet { background: rgba(8, 7, 6, .42); }
}

/* сцена всегда вписывает остров целиком */
.scene { container-type: size; }
.dio-wrap { height: min(96cqh, 80cqw); }
@media (min-width: 920px) { .stage { justify-content: flex-start; } .scene { flex: 1 1 auto; max-height: 600px; } }

/* ================= заставка перед рождением ================= */
#intro { position: relative; display: grid; place-items: center; padding: 56px 16px 32px; background: radial-gradient(1100px 700px at 50% 30%, #1d2742 0%, #12131c 55%, var(--bg) 80%); overflow: hidden; }
#intro::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .55; background-image: radial-gradient(1.2px 1.2px at 8% 14%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 22% 72%, #fff 50%, transparent 51%), radial-gradient(1.4px 1.4px at 36% 30%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 58% 8%, #fff 50%, transparent 51%), radial-gradient(1.3px 1.3px at 74% 64%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 88% 22%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 93% 86%, #fff 50%, transparent 51%), radial-gradient(1.2px 1.2px at 12% 92%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 48% 94%, #fff 50%, transparent 51%); animation: twinkle 5s ease-in-out infinite; }
.intro-skip { position: absolute; top: 14px; right: 16px; z-index: 2; }
.intro-inner { position: relative; width: 100%; max-width: 560px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.intro-step { font-family: var(--serif); font-size: clamp(26px, 7vw, 38px); margin: 0; min-height: 1.2em; animation: rise .5s ease both; }
.intro-stage { width: 100%; height: min(54vh, 440px); display: grid; place-items: center; }
.intro-stage > .hidden { display: none !important; }

.intro-year { display: flex; flex-direction: column; align-items: center; gap: 18px; width: 100%; }
.eras { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.eras { gap: 6px; }
.eras span { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 13px; transition: all .12s; }
.eras span.on { color: var(--text); border-color: var(--muted); }
.eras span.lock { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 650; }
.reel { position: relative; width: min(320px, 86vw); height: 258px; overflow: hidden; border-radius: 18px; background: linear-gradient(#0d0c0b, #1a1613 50%, #0d0c0b); border: 1px solid var(--line); -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); }
.reel::after { content: ""; position: absolute; left: 10px; right: 10px; top: 86px; height: 86px; border-top: 1px solid rgba(219, 168, 74, .55); border-bottom: 1px solid rgba(219, 168, 74, .55); pointer-events: none; }
.reel-strip { position: absolute; left: 0; right: 0; top: 86px; will-change: transform; }
.reel-item { height: 86px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.reel-item .y { font-family: var(--serif); font-size: 52px; font-variant-numeric: tabular-nums; }
.reel-item .y small { font-size: 18px; margin-left: 6px; color: var(--muted); }
.reel-item .en { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.reel-item.e-antiq .y { color: #e3c98c; } .reel-item.e-bronze .y { color: #e8b866; } .reel-item.e-viking .y { color: #b8d0e0; } .reel-item.e-medieval .y { color: #d8c8a8; } .reel-item.e-renaiss .y { color: #e8c08a; } .reel-item.e-c19 .y { color: #c8b8e0; } .reel-item.e-c20 .y { color: #d0d0c8; } .reel-item.e-sail .y { color: #9fc4e8; } .reel-item.e-modern .y { color: #e8e2d6; }
.reel-item.won .y { color: var(--accent); text-shadow: 0 0 24px rgba(219, 168, 74, .55); }

.intro-globe { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
#globe { width: min(420px, 84vw, 46vh); height: min(420px, 84vw, 46vh); }
.globe-label { font-family: var(--serif); font-size: 24px; min-height: 1.3em; color: #e9dcbd; }
.globe-label.won { color: var(--accent); text-shadow: 0 0 22px rgba(219, 168, 74, .5); animation: rise .4s ease both; }

.intro-family { width: min(380px, 92vw); display: flex; flex-direction: column; gap: 16px; }
.fam-list { display: grid; gap: 8px; }
.fam { display: flex; justify-content: space-between; align-items: baseline; padding: 11px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); transition: background .08s, border-color .08s, transform .08s; }
.fam span { font-size: 16px; }
.fam em { font-style: normal; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fam.on { border-color: var(--muted); background: #2a231d; transform: scale(1.02); }
.fam.won { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.fam.won em { color: var(--accent-ink); }
.sexes { display: flex; gap: 10px; justify-content: center; }
.sexes span { flex: 1; padding: 11px; border-radius: 12px; border: 1px solid var(--line); color: var(--muted); font-size: 16px; }
.sexes span.on { color: var(--text); border-color: var(--muted); }
.sexes span.won { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 650; }

.intro-res { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 52px; }
.res-chip { padding: 8px 14px; border-radius: 12px; background: rgba(34, 29, 25, .85); border: 1px solid var(--line); text-align: left; animation: rise .4s ease both; }
.res-chip b { display: block; font-family: var(--serif); font-weight: 400; font-size: 17px; }
.res-chip span { font-size: 12px; color: var(--muted); }
.intro-go { min-width: 200px; animation: rise .4s ease both; }
@media (max-height: 700px) { .intro-stage { height: 48vh; } .reel { height: 210px; } .reel::after { top: 62px; } .reel-strip { top: 62px; } }

.reel-item.e-medieval .y { color: #c9b6e0; } .reel-item.e-c20 .y { color: #e3a89a; }

/* ================= восемь показателей, фокус, кошелёк, лавка ================= */
.stats { grid-template-columns: repeat(4, 1fr); gap: 8px 12px; padding: 9px 14px 10px; }
.stat-head { font-size: 10.5px; letter-spacing: .05em; }
.stat-head em { font-size: 12px; }
.bar { height: 4px; margin-top: 4px; }
#s-spirit .bar i { background: #8fb3d9; }
#s-know .bar i { background: #b59ad6; }
#s-skill .bar i { background: #c99a6b; }
#s-net .bar i { background: #7fbfb0; }
#s-love .bar i { background: #d98a9a; }
@media (max-width: 560px) {
  .stats { gap: 7px 10px; padding: 8px 12px 9px; }
  .stat-head { font-size: 9.5px; }
  .stat-head em { font-size: 11.5px; }
}
@media (min-width: 920px) { .stats { padding: 12px 4px 0; gap: 10px 16px; } }

.ctl { display: flex; align-items: stretch; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
@media (min-width: 920px) { .ctl { padding: 12px 4px 0; border-bottom: 0; } }
.ctl-focus { flex: 1 1 0; min-width: 0; text-align: left; border: 1px solid var(--accent); background: rgba(219, 168, 74, .08); border-radius: 12px; padding: 6px 12px; display: flex; flex-direction: column; justify-content: center; }
.ctl-focus small, .purse small { font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctl-focus b { font-weight: 650; font-size: 15px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctl-focus b::after { content: " ▾"; font-size: 11px; color: var(--muted); }
.ctl-focus:hover { background: rgba(219, 168, 74, .16); }
.ctl-focus.locked { border-color: var(--line); background: transparent; }
.ctl-focus.locked b { color: var(--text); }
.ctl-focus.locked b::after { content: ""; }
.purse { flex: 1.15 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 2px 4px; }
.purse b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.purse span { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.purse span.up { color: var(--good); }
.purse span.down { color: var(--bad); }
.purse.in-debt small { color: var(--bad); }
.ctl-shop { flex: none; border: 1px solid var(--line); background: var(--bg2); border-radius: 12px; padding: 0 16px; font-size: 14px; font-weight: 600; }
.ctl-shop:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 400px) { .ctl { gap: 6px; padding: 7px 10px; } .ctl-focus { padding: 5px 9px; } .ctl-focus b, .purse b { font-size: 14px; } .ctl-shop { padding: 0 9px; font-size: 13px; } }
@media (max-width: 520px) { .purse #purse-net { display: none; } }

.f-note { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 6px 0 12px; }
.focus-list, .gift-list { display: grid; gap: 8px; }
.focus-opt, .gift-opt { text-align: left; border: 1px solid var(--line); background: var(--bg2); border-radius: 12px; padding: 11px 14px; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: baseline; }
.focus-opt b, .gift-opt b { font-size: 16px; font-weight: 600; }
.focus-opt small { grid-column: 1 / -1; font-size: 13px; color: var(--muted); line-height: 1.4; }
.focus-opt span, .gift-opt span { font-size: 12px; color: var(--muted); }
.gift-opt span { grid-column: 1 / -1; }
.focus-opt:hover:not(:disabled), .gift-opt:hover { border-color: var(--accent); }
.focus-opt.on { border-color: var(--accent); background: rgba(219, 168, 74, .1); }
.focus-opt.on b { color: var(--accent); }
.focus-opt:disabled { opacity: .55; cursor: default; }
.gift-back { margin-top: 12px; width: 100%; }
.gift-opt:disabled { opacity: .5; cursor: default; }
.estate-open { width: 100%; margin: 8px 0 4px; }
@media (max-width: 520px) { .si-btns.wrap { max-width: 50%; } .si-btns.wrap .buy { white-space: normal; text-align: center; } }
.traits { display: grid; gap: 6px; margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); }
.traits small { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.trait { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.trait b { font-size: 15px; font-weight: 600; color: var(--accent); }
.trait span { font-size: 13px; color: var(--muted); }
.shop-msg .deltas { margin-top: 8px; }
.f-sec { margin: 16px 0 8px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.f-sec:first-of-type { margin-top: 4px; }
.focus-list .f2 { padding: 8px 12px; }
.focus-list .f2 b { font-size: 15px; }
.f-done { width: 100%; margin-top: 12px; }
/* поступки */
.ctl-acts { position: relative; }
.ctl-acts .pts { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--accent); color: #1b140c; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; padding: 0 4px; }
.ctl-acts.spent .pts { display: none; }
#btn-shop { position: relative; }
#btn-shop.need-fix::after { content: '!'; position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 9px; background: #c8553d; color: #fff; font-size: 12px; font-weight: 700; line-height: 18px; text-align: center; }
.estate-open.need-fix { border-color: #c8553d; color: #e8a08e; }
.act-list { display: grid; gap: 8px; }
.act-opt { text-align: left; border: 1px solid var(--line); background: var(--bg2); border-radius: 12px; padding: 10px 14px; display: grid; gap: 2px; }
.act-opt b { font-size: 15px; font-weight: 600; }
.act-opt small { font-size: 13px; color: var(--muted); line-height: 1.4; }
.act-opt em { font-style: normal; font-size: 12px; color: var(--lock); }
.act-opt:hover:not(:disabled) { border-color: var(--accent); }
.act-opt:disabled { opacity: .55; cursor: default; }
.act-opt.whim { border-color: #b88ad8; background: linear-gradient(135deg, rgba(184,138,216,.14), transparent 60%), var(--bg2); }
.whim-tag { font-style: normal; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: #c9a4e6; }
.act-pts { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.act-pts i { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--accent); }
.act-pts i.on { background: var(--accent); }

.shop-purse { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 6px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.shop-purse b { font-size: 22px; font-family: var(--serif); font-weight: 400; color: var(--accent); }
.shop-purse .bad { color: var(--bad); font-size: 13px; }
.shop-purse small { flex-basis: 100%; color: var(--muted); font-size: 12.5px; }
.shop-msg { margin: 10px 0 4px; padding: 9px 12px; border-left: 2px solid var(--accent); background: #201b17; border-radius: 0 10px 10px 0; font-size: 14px; line-height: 1.45; }
.shop-item { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid #2a2420; }
.shop-item:last-child { border-bottom: 0; }
.si-text { flex: 1; min-width: 0; }
.si-text b { display: block; font-size: 15px; font-weight: 600; }
.si-text small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.si-text em { display: block; font-style: normal; font-size: 12px; color: var(--bad); margin-top: 2px; }
.shop-item.off .si-text b { color: var(--muted); }
.si-btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; max-width: 58%; }
.buy { border: 1px solid var(--accent); color: var(--accent); background: transparent; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.buy:hover:not(:disabled) { background: var(--accent); color: var(--accent-ink); }
.buy.ghost { border-color: var(--line); color: var(--text); }
.buy:disabled { border-color: var(--line); color: var(--lock); cursor: default; }
.delta.money { font-variant-numeric: tabular-nums; }

.spent-row { display: grid; grid-template-columns: 9em 1fr 5.5em; gap: 10px; align-items: center; margin: 7px 0; font-size: 15px; }
.spent-row .sn { color: var(--text); }
.spent-row .sy { color: var(--muted); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.spent-row .sb { height: 6px; background: #2e2823; border-radius: 3px; overflow: hidden; }
.spent-row .sb i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.spent-row.dim .sn, .spent-row.dim .sy { color: var(--lock); }
.spent-row.dim .sb i { background: var(--lock); }
.spent-notes { margin-top: 12px; }

/* ================= мечта, альбом, судьбы ================= */
.dream-line { display: flex; align-items: baseline; gap: 8px; width: 100%; text-align: left; padding: 7px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; font-size: 13px; color: var(--muted); min-width: 0; }
.dream-line small { flex: none; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: #d98a9a; }
.dream-line span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dream-line b { color: var(--text); font-weight: 600; }
.dream-line:hover b { color: var(--accent); }
.project-line { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 7px 14px; border: 0; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, rgba(224, 182, 74, .10), transparent 70%); font-size: 13px; color: var(--text); min-width: 0; cursor: pointer; }
.project-line small { flex: none; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: #e0b64a; }
.project-line span { min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.project-line .pj-bar { flex: none; width: 70px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; }
.project-line .pj-bar b { display: block; height: 100%; background: #e0b64a; transition: width .4s; }
.project-line em { flex: none; font-style: normal; font-size: 12px; color: var(--muted); min-width: 32px; text-align: right; }
.project-line:hover span { color: var(--accent); }
.shop-item.mk { border-color: rgba(224, 182, 74, .35); }
@media (min-width: 920px) { .dream-line { padding: 10px 4px 0; border-bottom: 0; } }
.threat-line { display: flex; align-items: baseline; gap: 8px; padding: 7px 14px; border-bottom: 1px solid var(--line); font-size: 13px; color: #e8b4a6; min-width: 0; background: linear-gradient(90deg, rgba(200, 70, 50, .14), transparent 70%); animation: threatPulse 2.6s ease-in-out infinite; }
.threat-line small { flex: none; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: #e0705a; font-weight: 700; }
.threat-line span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes threatPulse { 50% { background-color: rgba(200, 70, 50, .08); } }
@media (min-width: 920px) { .threat-line { padding: 8px 6px; border-bottom: 0; border-radius: 8px; margin-top: 6px; } }
.dream-now { border: 1px solid #d98a9a; border-radius: 12px; padding: 11px 14px; margin: 6px 0 12px; display: grid; gap: 2px; background: rgba(217, 138, 154, .07); }
.dream-now small { font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: #d98a9a; }
.dream-now b { font-size: 17px; font-weight: 600; }
.dream-now span { font-size: 13px; color: var(--muted); }
.f-note.dim { color: var(--lock); font-size: 13px; }
.goal-row { margin: 10px 0; }
.goal-row b { display: block; font-weight: 400; font-size: 18px; }
.goal-row.good b { color: var(--good); }
.goal-row.bad b { color: #c9a39a; }
.goal-row span { display: block; color: var(--muted); font-size: 14px; }
.album-btn { margin: 4px auto 0; display: block; }

#album { min-height: 100vh; min-height: 100dvh; }
.album-inner { max-width: 980px; margin: 0 auto; padding: 14px 16px 48px; }
.album-top { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.album-top h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 28px; color: var(--accent); }
.album-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 16px; }
.album-tabs button { border: 0; background: transparent; color: var(--muted); padding: 8px 18px; font-size: 14px; }
.album-tabs button + button { border-left: 1px solid var(--line); }
.album-tabs button.on { background: var(--accent); color: var(--accent-ink); font-weight: 650; }
.album-tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.album-tabs::-webkit-scrollbar { display: none; }
.album-tabs button { white-space: nowrap; flex: none; }
@media (max-width: 520px) { .album-tabs button { padding: 7px 12px; font-size: 13px; } }
/* жизнь дня */
.daily-btn { display: grid; gap: 2px; margin: 14px auto 0; padding: 10px 18px; border: 1px dashed var(--accent); border-radius: 14px; background: rgba(219, 168, 74, .06); color: var(--text); text-align: center; max-width: 360px; width: 100%; }
.daily-btn b { font-size: 15px; color: var(--accent); font-weight: 650; }
.daily-btn span { font-size: 12.5px; color: var(--muted); }
.daily-btn:hover { background: rgba(219, 168, 74, .14); }
.daily-btn.done { border-style: solid; border-color: var(--line); background: transparent; }
.daily-btn.done b { color: var(--text); }
.daily-cal { margin: 4px 0 18px; }
.dc-head { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.dc-head b { color: var(--text); }
.dc-grid { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; max-width: 420px; }
.dc-grid i { aspect-ratio: 1; border-radius: 4px; background: var(--bg2); border: 1px solid var(--line); }
.dc-grid i.on { background: var(--accent); border-color: var(--accent); }
.dc-grid i.half { background: rgba(219, 168, 74, .35); }
.dc-grid i.today { outline: 1.5px solid var(--text); outline-offset: 1px; }
.past-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.past-btns .album-btn { margin: 4px 0 0; }
.g-own { font-size: 13px; color: var(--accent); font-weight: 600; padding: 0 6px; }
/* род */
.tree { margin-bottom: 22px; }
.tree-head { display: grid; gap: 2px; margin-bottom: 10px; }
.tree-head b { font-size: 16px; }
.tree-head span { font-size: 13px; color: var(--muted); }
.tree-node { position: relative; display: flex; gap: 12px; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--bg2); border-radius: 12px; padding: 10px 12px; margin-left: 0; }
.tree-node + .tree-node { margin-top: 18px; }
.tree-node + .tree-node::before { content: ''; position: absolute; left: 25px; top: -19px; height: 18px; border-left: 2px solid var(--accent); }
.tree-node:hover { border-color: var(--accent); }
.tn-gen { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; display: grid; place-items: center; font-size: 14px; }
.tn-body { display: grid; gap: 2px; }
.tn-body b { font-size: 15px; }
.tn-body small { font-size: 12.5px; color: var(--muted); }
.tn-body .tn-tr { color: var(--accent); }
.album-empty { color: var(--muted); font-size: 15px; line-height: 1.6; }
.life-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.life-card { display: flex; gap: 12px; text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 10px; align-items: stretch; transition: border-color .15s, transform .1s; }
.life-card:hover { border-color: var(--accent); }
.life-card:active { transform: scale(.99); }
.lc-img { flex: none; width: 92px; height: 92px; border-radius: 10px; overflow: hidden; background: radial-gradient(circle at 50% 40%, #33476a, #141a28); display: grid; place-items: center; }
.lc-img img { width: 118%; height: 118%; object-fit: contain; }
.lc-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lc-body b { font-family: var(--serif); font-weight: 400; font-size: 19px; }
.lc-sub { font-size: 12.5px; color: var(--muted); }
.lc-verdict { font-size: 13.5px; color: var(--accent); }
.lc-dyn { font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.cr-heirs { margin: 6px auto 18px; max-width: 420px; display: grid; gap: 8px; }
.cr-heirs p { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 4px; text-align: center; }
.cr-heirs .btn { width: 100%; }
.cr-heirs .btn small { display: block; font-size: 12px; font-weight: 400; opacity: .75; margin-top: 2px; }
.lc-dream { font-size: 12.5px; }
.lc-dream.ok { color: var(--good); }
.lc-dream.no { color: #b8948b; }
.lc-tally { font-size: 12px; color: var(--muted); margin-top: auto; }
.lc-tally i { font-style: normal; font-weight: 700; }
.lc-tally .g { color: var(--good); } .lc-tally .r { color: var(--bad); }
.album-log { padding: 0; overflow: visible; }
.w-count { font-size: 15px; color: var(--muted); margin-bottom: 8px; }
.w-count b { color: var(--accent); font-size: 20px; }
.w-globe { position: relative; height: min(70vw, 460px); margin: 0 auto 14px; }
.w-globe canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.w-globe canvas:active { cursor: grabbing; }
.w-hint { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-size: 12px; color: var(--lock); pointer-events: none; }
.w-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px 18px; }
.w-era h4, .fate-group { margin: 0 0 6px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.w-era ul { list-style: none; margin: 0; padding: 0; }
.w-era li { font-size: 14px; color: var(--lock); padding: 2px 0; }
.w-era li.on { color: var(--text); }
.w-era li.on::before { content: "● "; color: #ffc955; }
.w-era li small { color: var(--muted); }
.fate-group { margin-top: 18px; }
.fate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.fate-card { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 3px; }
.fate-card b { font-size: 15px; color: var(--lock); font-weight: 600; }
.fate-card span { font-size: 12.5px; color: var(--lock); line-height: 1.4; }
.fate-card.on { border-style: solid; border-color: rgba(219, 168, 74, .55); background: rgba(219, 168, 74, .06); }
.fate-card.on b { color: var(--accent); }
.fate-card.on span { color: var(--muted); }
.fate-card small { font-size: 12px; color: var(--text); }
@media (max-width: 560px) { .life-grid { grid-template-columns: 1fr; } .lc-img { width: 78px; height: 78px; } .fate-grid { grid-template-columns: 1fr 1fr; } }

/* ================= живая 3D-сцена ================= */
.live3d { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.dio-wrap.live-on .char, .dio-wrap.live-on .char-shadow { display: none; }
.live3d { transition: opacity .4s; }
.live-tags { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.live-tags .tag { position: absolute; left: 0; top: 0; white-space: nowrap; font-size: 11px; line-height: 16px; padding: 0 6px; border-radius: 8px; background: rgba(20, 17, 15, .62); color: #efe6d6; font-weight: 500; letter-spacing: .01em; will-change: transform; }
.live-tags .tag.guest { background: rgba(60, 40, 22, .78); color: #ffe2b0; }
.live-tags .tag.me { background: var(--accent, #d9a441); color: #1b140c; font-weight: 700; padding: 0 8px; }
.live-tags .tag.me::after { content: ''; position: absolute; left: 50%; bottom: -4px; margin-left: -4px; border: 4px solid transparent; border-bottom: 0; border-top-color: var(--accent, #d9a441); }
.live-tags .tag.dead { opacity: .6; text-decoration: line-through; }
@media (max-width: 520px) { .live-tags .tag { font-size: 10px; line-height: 14px; padding: 0 5px; } }
.simple-gfx { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.simple-gfx input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; }
.simple-gfx b { display: block; font-size: 15px; font-weight: 600; }
.simple-gfx small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.4; margin-top: 2px; }

/* ================= погода по летописи ================= */
.scene::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 2.5s ease, background 2.5s ease; z-index: 2; }
.scene.w-snow .dio-wrap { filter: saturate(.55) brightness(1.06) contrast(.95); }
.scene.w-snow::after { opacity: 1; background: linear-gradient(180deg, rgba(225, 235, 250, .28), rgba(255, 255, 255, .12) 60%, rgba(255, 255, 255, 0)); }
.scene.w-drought .dio-wrap { filter: sepia(.5) saturate(.85) hue-rotate(-12deg) brightness(1.04); }
.scene.w-drought::after { opacity: 1; background: radial-gradient(ellipse at 50% 20%, rgba(255, 200, 120, .22), transparent 70%); }
.scene.w-haze .dio-wrap { filter: saturate(.3) brightness(.86); }
.scene.w-rain .dio-wrap { filter: saturate(.6) brightness(.82); }
.scene.w-rain::after { opacity: 1; background: linear-gradient(180deg, rgba(70, 85, 110, .38), rgba(60, 70, 90, .18)); }
.scene.w-haze::after { opacity: 1; background: linear-gradient(180deg, rgba(120, 120, 110, .35), rgba(90, 95, 85, .25)); }
.scene.w-golden .dio-wrap { filter: sepia(.22) saturate(1.3) brightness(1.06); }
.scene.w-golden::after { opacity: 1; background: radial-gradient(ellipse at 40% 15%, rgba(255, 210, 120, .3), transparent 65%); }
.scene.w-smoke::after { opacity: 1; background: linear-gradient(0deg, rgba(60, 50, 45, .25), transparent 55%); }
.scene.w-smoke .dio-wrap { filter: saturate(.75) brightness(.95); }
.scene.t-night.w-snow .dio-wrap, .scene.t-night.w-haze .dio-wrap, .scene.t-night.w-drought .dio-wrap, .scene.t-night.w-golden .dio-wrap, .scene.t-night.w-smoke .dio-wrap { filter: brightness(.58) saturate(.6); }

/* испытание жизни, задачи года */
.trial-line { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 7px 14px; border: 0; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, rgba(200, 70, 60, .13), transparent 70%); font-size: 13px; color: var(--text); min-width: 0; cursor: pointer; }
.trial-line small { flex: none; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: #e27a6a; }
.trial-line span { min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.trial-line .tr-bar { flex: none; width: 60px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; }
.trial-line .tr-bar b { display: block; height: 100%; background: #c9a35a; transition: width .4s; }
.trial-line .tr-bar b.warm { background: #e0873a; } .trial-line .tr-bar b.hot { background: #e0453a; }
.trial-line em { flex: none; font-style: normal; font-size: 11.5px; color: var(--muted); }
.tasks-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 14px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.tasks-line small { font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: #8fb0d8; margin-right: 2px; }
.tasks-line .tk.ok { color: #9fd08a; }
.p-char { font-size: 12.5px; color: #c9b48a; margin-top: 2px; }
/* развилки и оценка в титрах */
.cr-forks .fork-row { text-align: left; margin: 0 auto 14px; max-width: 520px; padding: 10px 14px; border-left: 2px solid var(--accent); background: rgba(255,255,255,.03); border-radius: 0 8px 8px 0; }
.fk-head { display: flex; gap: 10px; align-items: baseline; } .fk-age { font-size: 12px; color: var(--muted); flex: none; } .fk-head b { font-size: 15px; }
.fk-pick { margin: 4px 0 0; font-size: 13.5px; } .fk-echo { margin: 4px 0 0; font-size: 13px; color: #9fd08a; } .fk-alt { margin: 4px 0 0; font-size: 13px; color: var(--muted); font-style: italic; }
.sc-grade { font-size: 64px; font-weight: 800; line-height: 1; margin: 6px 0 0; letter-spacing: .02em; }
.sc-grade.g-S { color: #ffd76a; text-shadow: 0 0 24px rgba(255, 200, 80, .55); } .sc-grade.g-A { color: #9fd08a; } .sc-grade.g-B { color: #8fb0d8; } .sc-grade.g-C { color: #c9b48a; } .sc-grade.g-D { color: #a8a29a; }
/* мини-апп Telegram и телефон */
.goals-strip { display: none; }
.goal-list { display: grid; gap: 8px; }
.goal-opt { display: grid; gap: 2px; text-align: left; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); color: var(--text); }
.goal-opt:disabled { opacity: 1; cursor: default; } .goal-opt small { font-size: 11px; color: var(--muted); } .goal-opt b { font-weight: 600; font-size: 14.5px; line-height: 1.45; }
.goal-opt .tk.ok { color: #9fd08a; }
.vs-box { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; padding: 12px 16px; margin: 12px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); }
.vs-box span { color: var(--muted); } .vs-box b { color: var(--accent); }
.card-img { display: block; width: 100%; border-radius: 12px; -webkit-touch-callout: default; user-select: auto; }
.share-text { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); color: var(--text); font: inherit; font-size: 14px; }
.boot-note { display: none; color: var(--muted); font-size: 14px; }
.booting .boot-note { display: block; } .booting .start-buttons, .booting .daily-btn, .booting .past { visibility: hidden; }
.in-tg, .in-tg body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
@media (max-width: 919px) {
  .goals-strip:not(.hidden) { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 40px; padding: 6px 12px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); overflow: hidden; text-align: left; }
  .goals-strip i { margin-left: auto; font-style: normal; color: var(--muted); font-size: 18px; flex: none; }
  .gs-chip { flex: none; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; }
  .gs-chip.red { color: #f0a093; border-color: #a8483c; } .gs-chip.orange { color: #f0c090; border-color: #a8703c; } .gs-chip.gold { color: #e6cc8a; border-color: #8a7440; } .gs-chip.blue { color: #a9c6e8; border-color: #4a6480; } .gs-chip.pink { color: #e8b0bc; border-color: #84505c; }
  .stage > .dream-line, .stage > .project-line, .stage > .trial-line, .stage > .tasks-line, .stage > .order-line, .stage > .threat-line { display: none; }
}
@media (max-width: 560px) {
  #btn-sound { display: none; }
  .topbar { flex-wrap: nowrap; padding: 6px 8px; gap: 6px; }
  .topbar .speed button { min-width: 0; padding-left: 8px; padding-right: 8px; }
  .topbar .chip { padding-left: 10px; padding-right: 10px; white-space: nowrap; }
  .goals-strip:not(.hidden) { gap: 5px; padding: 6px 10px; }
  .gs-chip { padding: 3px 8px; font-size: 11.5px; }
}
