/* ГРАФ — масло, свеча и деньги */
:root {
  --bg: #0d0a08;
  --bg2: #15110d;
  --bg3: #1d1712;
  --ink: #efe6d6;
  --ink2: #cdbfa9;
  --mute: #988a76;
  --dim: #5f5446;
  --line: rgba(239, 230, 214, .12);
  --line2: rgba(239, 230, 214, .22);
  --gold: #c9a35a;
  --gold2: #e3c27f;
  --red: #b4513f;
  --green: #8fa67a;
  --serif: 'Cormorant Garamond', 'Lora', Georgia, serif;
  --sans: 'Manrope', 'Inter', system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --pad: clamp(16px, 3vw, 48px);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; min-height: 100dvh; overflow-x: hidden; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: .06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence baseFrequency='.85' numOctaves='3'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
::selection { background: var(--gold); color: var(--bg); }
.serif { font-family: var(--serif); }
.k { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--mute); }
.gold { color: var(--gold); }
.neg { color: var(--red); }
.pos { color: var(--green); }

/* ---------- картины ---------- */
.paint { position: relative; overflow: hidden; background:
  radial-gradient(60% 70% at 72% 45%, rgba(201, 163, 90, .28), transparent 60%),
  radial-gradient(40% 50% at 30% 80%, rgba(120, 60, 30, .25), transparent 70%),
  linear-gradient(160deg, #241a12, #0b0806 70%); }
.paint img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s var(--ease), transform 8s linear; }
.paint img.ok { opacity: 1; }

/* ---------- титул ---------- */
.title { position: relative; min-height: 100vh; min-height: 100dvh; display: grid; align-items: end; }
.title .paint { position: absolute; inset: 0; }
.title .paint img.ok { transform: scale(1.04); }
.title::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(13, 10, 8, .96) 0%, rgba(13, 10, 8, .7) 38%, rgba(13, 10, 8, .1) 75%), linear-gradient(0deg, rgba(13, 10, 8, .9), transparent 40%); }
.title-in { position: relative; z-index: 2; padding: var(--pad); padding-bottom: calc(var(--pad) + env(safe-area-inset-bottom)); max-width: 640px; }
.word { font-family: var(--serif); font-weight: 500; font-size: clamp(92px, 17vw, 210px); line-height: .82; letter-spacing: .02em; animation: rise 1.6s var(--ease) both; }
.tag { font-family: var(--serif); font-style: italic; font-size: clamp(20px, 2.4vw, 28px); color: var(--ink2); margin: 18px 0 44px; animation: rise 1.6s .15s var(--ease) both; }
.menu { display: flex; flex-direction: column; gap: 4px; border-left: 1px solid var(--line2); animation: rise 1.6s .3s var(--ease) both; }
.menu button { text-align: left; padding: 9px 0 9px 22px; font-size: 17px; color: var(--ink2); position: relative; transition: color .3s, padding .3s var(--ease); }
.menu button::before { content: ""; position: absolute; left: -1px; top: 50%; width: 1px; height: 0; background: var(--gold); transition: height .3s var(--ease), top .3s var(--ease); }
.menu button:hover, .menu button:focus-visible { color: var(--ink); padding-left: 28px; outline: none; }
.menu button:hover::before, .menu button:focus-visible::before { height: 100%; top: 0; }
.menu button[disabled] { color: var(--dim); pointer-events: none; }
.meta { margin-top: 36px; color: var(--mute); font-size: 13px; }

/* ---------- новая жизнь ---------- */
.screen { min-height: 100vh; min-height: 100dvh; padding: var(--pad); max-width: 1180px; margin: 0 auto; }
.back { color: var(--mute); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 40px; display: inline-block; }
.back:hover { color: var(--ink); }
.h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(44px, 6vw, 84px); line-height: .95; letter-spacing: -.01em; }
.lead { color: var(--ink2); max-width: 560px; margin: 18px 0 40px; font-size: 16px; }
.origins { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.origin { text-align: left; padding: 28px 28px 32px 0; border-bottom: 1px solid var(--line); transition: background .3s; position: relative; }
.origin + .origin { padding-left: 28px; border-left: 1px solid var(--line); }
.origin .n { font-family: var(--serif); font-size: 32px; line-height: 1.05; margin: 10px 0 12px; }
.origin p { color: var(--mute); font-size: 14px; }
.origin .sk { margin-top: 18px; display: flex; gap: 14px; font-size: 12px; color: var(--ink2); flex-wrap: wrap; }
.origin.on { background: linear-gradient(180deg, rgba(201, 163, 90, .08), transparent); }
.origin.on .n { color: var(--gold2); }
.origin.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--gold); }
.namerow { display: flex; gap: 24px; align-items: end; margin-top: 40px; flex-wrap: wrap; }
.field { border-bottom: 1px solid var(--line2); padding: 8px 0; min-width: 260px; background: none; border-top: 0; border-left: 0; border-right: 0; font-family: var(--serif); font-size: 28px; outline: none; }
.field:focus { border-color: var(--gold); }
.cta { background: var(--ink); color: var(--bg); padding: 15px 30px; font-weight: 600; letter-spacing: .04em; transition: background .3s, transform .2s; }
.cta:hover { background: var(--gold2); }
.cta:active { transform: scale(.98); }
.cta[disabled] { background: var(--dim); color: var(--bg2); pointer-events: none; }
.ghost { border: 1px solid var(--line2); padding: 13px 22px; color: var(--ink2); transition: border-color .3s, color .3s; }
.ghost:hover { border-color: var(--gold); color: var(--ink); }

/* ---------- игра ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 28px; padding: 14px var(--pad); padding-top: calc(14px + env(safe-area-inset-top)); background: linear-gradient(180deg, rgba(13, 10, 8, .98), rgba(13, 10, 8, .88)); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.logo { font-family: var(--serif); font-size: 24px; letter-spacing: .32em; }
.tabs { display: flex; gap: 4px; flex: 1; }
.tab { padding: 8px 14px; font-size: 13px; color: var(--mute); letter-spacing: .04em; position: relative; transition: color .2s; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); }
.tab.on::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -15px; height: 1px; background: var(--gold); }
.tab .dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); margin-left: 6px; vertical-align: middle; }
.path { font-size: 12px; color: var(--mute); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.iconbtn { width: 34px; height: 34px; display: grid; place-items: center; color: var(--mute); }
.iconbtn:hover { color: var(--ink); }

.wrap { padding: 28px var(--pad) 120px; display: grid; grid-template-columns: 300px minmax(0, 1fr) 280px; gap: 48px; max-width: 1560px; margin: 0 auto; }
.col-l .month { font-family: var(--serif); font-size: 168px; line-height: .78; letter-spacing: -.04em; }
.col-l .month small { display: block; font-family: var(--sans); font-size: 11px; letter-spacing: .22em; color: var(--mute); text-transform: uppercase; margin: 18px 0 0 6px; }
.life { margin: 28px 0 0 4px; color: var(--mute); font-size: 13px; line-height: 1.9; }
.life b { color: var(--ink); font-weight: 500; }
.cap { margin-top: 38px; }
.cap .v { font-family: var(--serif); font-size: 46px; line-height: 1.1; letter-spacing: -.01em; margin-top: 6px; }
.cap .v i { font-style: normal; color: var(--gold); }
.cap .sub { font-size: 12px; color: var(--mute); margin-top: 4px; }
.spark { width: 100%; height: 70px; margin-top: 14px; display: block; }
.timeline { margin-top: 30px; }
.timeline svg { width: 100%; height: 22px; display: block; margin-top: 10px; }

.event { position: relative; }
.event .paint { aspect-ratio: 16 / 8; border: 1px solid var(--line); }
.event .paint::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(13, 10, 8, .55), transparent 45%); }
.event .body { padding: 26px 0 0; animation: rise .7s var(--ease) both; }
.event h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(32px, 3.3vw, 50px); line-height: 1.02; letter-spacing: -.01em; margin: 12px 0 14px; max-width: 760px; }
.event p.t { color: var(--ink2); font-size: 16px; max-width: 640px; }
.choices { margin-top: 26px; border-top: 1px solid var(--line); }
.choice { width: 100%; display: grid; grid-template-columns: 44px 1fr auto; align-items: baseline; text-align: left; padding: 16px 4px 16px 0; border-bottom: 1px solid var(--line); transition: background .25s, padding .3s var(--ease); font-size: 16px; }
.choice .n { font-family: var(--serif); color: var(--dim); font-size: 19px; transition: color .25s; }
.choice .c { font-size: 12px; color: var(--mute); text-align: right; padding-left: 16px; }
.choice:hover, .choice:focus-visible { background: linear-gradient(90deg, rgba(201, 163, 90, .07), transparent); padding-left: 8px; outline: none; }
.choice:hover .n, .choice:focus-visible .n { color: var(--gold); }
.outcome { margin-top: 22px; padding: 18px 0 18px 22px; border-left: 2px solid var(--gold); font-family: var(--serif); font-size: 22px; line-height: 1.35; color: var(--ink); animation: rise .6s var(--ease) both; }
.outcome small { display: block; font-family: var(--sans); font-size: 12px; color: var(--mute); margin-bottom: 6px; letter-spacing: .06em; }

.acts { margin-top: 46px; }
.acts-h { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; flex-wrap: wrap; }
.slots { display: flex; gap: 8px; }
.slot { width: 34px; height: 4px; background: var(--line2); transition: background .3s; }
.slot.f { background: var(--gold); }
.agrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0; margin-top: 18px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.act { text-align: left; padding: 16px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background .25s; position: relative; min-height: 98px; }
.act .an { font-size: 15px; font-weight: 500; }
.act .an span { display: block; font-size: 11px; color: var(--mute); font-weight: 400; letter-spacing: .04em; margin-top: 2px; }
.act .ah { font-size: 12.5px; color: var(--mute); margin-top: 6px; line-height: 1.45; }
.act:hover { background: rgba(239, 230, 214, .03); }
.act.on { background: linear-gradient(180deg, rgba(201, 163, 90, .12), rgba(201, 163, 90, .03)); }
.act.on .an { color: var(--gold2); }
.act.on::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--gold); }
.act.off { opacity: .38; pointer-events: none; }
.act .why { color: var(--red); font-size: 11.5px; margin-top: 6px; }
.endrow { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 26px; flex-wrap: wrap; }
.endrow .hint { color: var(--mute); font-size: 13px; }

.col-r .st { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.col-r .st .row { display: flex; justify-content: space-between; align-items: baseline; }
.col-r .st b { font-weight: 500; font-size: 14px; }
.bar { height: 1px; background: var(--line2); margin-top: 11px; position: relative; }
.bar i { position: absolute; left: 0; top: -1px; height: 3px; background: var(--ink); transition: width .8s var(--ease); }
.bar.g i { background: var(--gold); }
.bar.red i { background: var(--red); }
.skills { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin-top: 4px; }
.mentor { margin-top: 30px; }
.mentor .face { width: 100%; aspect-ratio: 4 / 3; border: 1px solid var(--line); }
.mentor q { display: block; font-family: var(--serif); font-style: italic; font-size: 21px; line-height: 1.35; color: var(--ink); margin-top: 16px; quotes: "«" "»"; }
.mentor .who { margin-top: 12px; }
.mentor .src { font-size: 11px; color: var(--dim); margin-top: 4px; }

/* панели вкладок */
.panel { padding: 30px var(--pad) 120px; max-width: 1180px; margin: 0 auto; }
.panel .h1 { margin-bottom: 10px; }
.sec { margin-top: 46px; }
.sec > .k { margin-bottom: 14px; display: block; }
.rows { border-top: 1px solid var(--line); }
.r { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.r .l { color: var(--ink2); }
.r .l small { display: block; color: var(--mute); font-size: 12.5px; margin-top: 2px; }
.r .v { font-family: var(--serif); font-size: 22px; text-align: right; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.card { padding: 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.card h3 { font-family: var(--serif); font-weight: 500; font-size: 30px; line-height: 1.05; margin: 8px 0 14px; }
.card .r { padding: 9px 0; }
.card .r .v { font-size: 18px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.sbtn { border: 1px solid var(--line2); padding: 8px 14px; font-size: 13px; color: var(--ink2); transition: border-color .2s, color .2s, background .2s; }
.sbtn:hover { border-color: var(--gold); color: var(--ink); }
.sbtn.pri { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.sbtn.pri:hover { background: var(--gold2); border-color: var(--gold2); }
.levers { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.lever { padding: 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lever .ln { font-family: var(--serif); font-size: 24px; color: var(--dim); }
.lever.on .ln { color: var(--gold2); }
.lever p { font-size: 12.5px; color: var(--mute); margin-top: 6px; }
.lever .stt { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; margin-top: 12px; color: var(--dim); }
.lever.on .stt { color: var(--gold); }
.inrow { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.num { width: 150px; background: transparent; border: 0; border-bottom: 1px solid var(--line2); padding: 6px 0; font-family: var(--serif); font-size: 20px; outline: none; }
.num:focus { border-color: var(--gold); }
.logl { border-top: 1px solid var(--line); }
.logi { display: grid; grid-template-columns: 90px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink2); }
.logi .m { color: var(--mute); font-size: 12px; }
.logi.mistake { color: var(--ink); }
.logi.mistake .m { color: var(--red); }
.logi.milestone { color: var(--gold2); }
.lesson { padding: 18px 0; border-bottom: 1px solid var(--line); }
.lesson b { font-family: var(--serif); font-size: 22px; font-weight: 500; }
.lesson p { color: var(--ink2); margin-top: 4px; }
.lesson small { color: var(--mute); font-size: 12px; }
.real { padding: 20px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
.real .t { font-size: 16px; }
.real .p { font-size: 12.5px; color: var(--mute); margin-top: 4px; }
.real.done .t { color: var(--gold2); }
.note { color: var(--mute); font-size: 13px; max-width: 640px; margin-top: 10px; }

/* итог */
.end { position: relative; min-height: 100vh; min-height: 100dvh; }
.end .paint { position: absolute; inset: 0; }
.end::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(13, 10, 8, .97) 30%, rgba(13, 10, 8, .55) 70%, rgba(13, 10, 8, .3)); }
.end-in { position: relative; z-index: 2; padding: var(--pad); padding-top: 18vh; max-width: 1180px; margin: 0 auto; }
.end .word { font-size: clamp(84px, 14vw, 180px); }
.end h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 3.6vw, 48px); margin-top: 18px; color: var(--gold2); }
.end p.t { color: var(--ink2); max-width: 620px; margin-top: 10px; font-size: 17px; }
.scores { display: grid; grid-template-columns: repeat(6, 1fr); border-top: 1px solid var(--line2); margin-top: 44px; }
.score { padding: 18px 16px 18px 0; }
.score + .score { padding-left: 16px; border-left: 1px solid var(--line); }
.score .sv { font-family: var(--serif); font-size: 48px; line-height: 1; margin-top: 8px; }
.score .bar { margin-top: 12px; }

/* модальное окно отчёта */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: rgba(8, 6, 5, .78); backdrop-filter: blur(6px); animation: fade .35s both; }
.sheet { width: min(620px, 100%); background: var(--bg2); border: 1px solid var(--line2); padding: 34px; max-height: 88vh; overflow: auto; animation: rise .5s var(--ease) both; }
.sheet h3 { font-family: var(--serif); font-weight: 500; font-size: 40px; line-height: 1; margin: 8px 0 18px; }
.sheet ul { list-style: none; border-top: 1px solid var(--line); }
.sheet li { padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink2); font-size: 14.5px; }
.sheet .tot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 18px 0 24px; }
.sheet .tot div { font-family: var(--serif); font-size: 26px; }
.sheet .tot small { display: block; font-family: var(--sans); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--mute); }
.sheet p { color: var(--ink2); margin-bottom: 12px; }
.sheet .rows { margin: 14px 0 24px; }

#toast { position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 11px 18px; font-size: 14px; opacity: 0; pointer-events: none; transition: all .35s var(--ease); z-index: 60; max-width: calc(100% - 32px); }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

.monthflash { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; background: var(--bg); pointer-events: none; animation: flash 1.1s var(--ease) forwards; }
.monthflash div { font-family: var(--serif); font-size: clamp(54px, 9vw, 120px); letter-spacing: .02em; animation: rise .9s var(--ease) both; }
.monthflash small { display: block; text-align: center; font-family: var(--sans); font-size: 12px; letter-spacing: .24em; color: var(--mute); text-transform: uppercase; margin-top: 10px; }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes flash { 0% { opacity: 1; } 60% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }

/* ---------- планшет и телефон ---------- */
@media (max-width: 1180px) {
  .wrap { grid-template-columns: 1fr 260px; }
  .col-l { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr 1fr; gap: 32px; align-items: end; }
  .col-l .month { font-size: 120px; }
  .cap { margin-top: 0; }
  .timeline { margin-top: 0; }
  .levers { grid-template-columns: repeat(3, 1fr); }
  .scores { grid-template-columns: repeat(3, 1fr); }
  .score:nth-child(4) { padding-left: 0; border-left: 0; }
}
@media (max-width: 760px) {
  html, body { font-size: 14px; }
  .title::after { background: linear-gradient(0deg, rgba(13, 10, 8, .97) 25%, rgba(13, 10, 8, .55) 60%, rgba(13, 10, 8, .15)); }
  .top { gap: 12px; padding-bottom: 10px; backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(13, 10, 8, .97); }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; justify-content: space-around; padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); background: rgba(13, 10, 8, .97); border-top: 1px solid var(--line); backdrop-filter: blur(10px); }
  .tab { padding: 8px 6px; font-size: 11.5px; }
  .tab.on::after { bottom: -2px; left: 6px; right: 6px; }
  .path { flex: 1; text-align: right; font-size: 10.5px; }
  .wrap { grid-template-columns: 1fr; gap: 30px; padding-top: 18px; }
  .col-l { grid-template-columns: auto 1fr; gap: 18px 22px; }
  .col-l .month { font-size: 92px; }
  .life { margin-top: 0; }
  .timeline { grid-column: 1 / -1; }
  .cap { grid-column: 1 / -1; }
  .cap .v { font-size: 38px; }
  .event .paint { aspect-ratio: 16 / 10; margin: 0 calc(var(--pad) * -1); border-left: 0; border-right: 0; }
  .choice { grid-template-columns: 32px 1fr; }
  .choice .c { grid-column: 2; text-align: left; padding: 4px 0 0; }
  .agrid { grid-template-columns: 1fr 1fr; }
  .act { min-height: 0; padding: 14px; }
  .origins { grid-template-columns: 1fr; }
  .origin + .origin { padding-left: 0; border-left: 0; }
  .origin { padding: 22px 0; }
  .levers { grid-template-columns: 1fr 1fr; }
  .cards { grid-template-columns: 1fr; }
  .scores { grid-template-columns: 1fr 1fr; }
  .score:nth-child(odd) { padding-left: 0; border-left: 0; }
  .score:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line); }
  .sheet { padding: 24px; }
  .logi { grid-template-columns: 1fr; gap: 2px; }
  .real { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
