/* «Сказительница земли сибирской» — стили */
:root {
  --taiga: #134832;
  --taiga-2: #0d3324;
  --teal: #1f6e62;
  --teal-soft: #3d8b7c;
  --mist: #e6f1ec;
  --gold: #d6a426;
  --gold-2: #e8b94a;
  --gold-deep: #a97a14;
  --wood: #7a4a22;
  --wood-dark: #4a2b12;
  --paper: #fbfaf4;
  --ink: #1d2a24;
  --ink-soft: #4b5a52;
  --line: rgba(19, 72, 50, .16);

  --f-title: 'NK123', 'Monomakh', Georgia, serif;
  --f-ui: 'Monomakh', Georgia, serif;
  --f-text: 'Golos Text', 'Segoe UI', Arial, sans-serif;

  --gutter: clamp(12px, 3vw, 40px);
  --radius: 14px;
  --shadow: 0 18px 50px -18px rgba(8, 36, 25, .55);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--f-text);
  color: var(--ink);
  background: var(--taiga-2);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
a { color: var(--teal); }
:focus-visible { outline: 3px solid var(--gold-2); outline-offset: 3px; border-radius: 6px; }
[tabindex="-1"]:focus { outline: none; }

/* ---------- Фоны сцен ---------- */
.stage {
  position: fixed; inset: 0;
  background: var(--taiga-2) center / cover no-repeat;
  transition: opacity .6s var(--ease);
}
.stage::after { /* лёгкая дымка поверх леса */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 50% 0%, rgba(230,241,236,.0) 40%, rgba(13,51,36,.35) 100%);
  pointer-events: none;
}
.stage[data-bg="mist"] { background-image: url(../assets/img/forest-mist.webp); background-position: center bottom; }
.stage[data-bg="mist"]::after { background: linear-gradient(#fff0 55%, rgba(19,72,50,.15)); }
.stage[data-bg="deep"] { background-image: url(../assets/img/forest-deep.webp); }
.stage[data-bg="light"] { background-image: url(../assets/img/forest-lighthouse.webp); }

#app { position: fixed; inset: 0; overflow: hidden; }
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding: var(--gutter);
  animation: screen-in .45s var(--ease) both;
}
@keyframes screen-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Кнопки ---------- */
.btn {
  --b: var(--paper);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 46px; padding: .55em 1.4em;
  font-family: var(--f-ui); font-size: 1.15rem; line-height: 1.1;
  color: var(--taiga); background: var(--b);
  border: 2px solid var(--gold); border-radius: 999px;
  box-shadow: 0 3px 0 var(--gold-deep), 0 10px 24px -12px rgba(0,0,0,.5);
  cursor: pointer; text-decoration: none;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .2s;
}
.btn:hover { background: #fff; transform: translateY(-1px); box-shadow: 0 4px 0 var(--gold-deep), 0 14px 26px -12px rgba(0,0,0,.55); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--gold-deep); }
.btn[disabled] { opacity: .45; cursor: default; transform: none; }
.btn--gold { --b: linear-gradient(var(--gold-2), var(--gold)); background: var(--b); color: var(--taiga-2); border-color: var(--gold-deep); }
.btn--gold:hover { background: linear-gradient(#f2c95f, var(--gold-2)); }
.btn--big { font-size: 1.6rem; min-height: 64px; padding: .5em 2em; }
.btn--small { font-size: 1rem; min-height: 38px; padding: .35em 1em; }
.btn--ghost { background: rgba(251,250,244,.12); color: var(--paper); border-color: rgba(232,185,74,.7); box-shadow: none; backdrop-filter: blur(6px); }
.btn--ghost:hover { background: rgba(251,250,244,.22); box-shadow: none; }
.icon-btn {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper); border: 2px solid var(--gold); color: var(--taiga);
  box-shadow: 0 3px 0 var(--gold-deep); cursor: pointer;
  transition: transform .15s var(--ease);
}
.icon-btn:hover { transform: scale(1.06); }
.icon-btn:disabled { opacity: .35; cursor: default; transform: none; }
.icon-btn svg { width: 24px; height: 24px; }

/* ---------- Верхняя панель экранов ---------- */
.topbar {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: clamp(10px, 2vh, 20px);
  color: var(--paper);
  flex-wrap: wrap;
}
.topbar h1 {
  font-family: var(--f-title); font-weight: normal;
  font-size: clamp(1.6rem, 3.4vw, 2.7rem); margin: 0; line-height: 1.1;
  color: var(--taiga);
  text-shadow: 0 1px 0 rgba(255,255,255,.7), 0 0 22px rgba(230,241,236,.9);
  flex: 1; min-width: 0;
}
.topbar .crumb { font-family: var(--f-ui); font-size: 1.05rem; opacity: .85; }

/* ---------- «Доска» — основной контейнер (золотая рамка как в оригинале) ---------- */
.board {
  position: relative; flex: 1; min-height: 0;
  background: rgba(251, 250, 244, .94);
  border: 4px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 0 0 6px rgba(214,164,38,.12);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.board__scroll {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: clamp(18px, 3vw, 44px);
  scrollbar-width: thin; scrollbar-color: var(--teal-soft) transparent;
}
.board__scroll::-webkit-scrollbar { width: 10px; }
.board__scroll::-webkit-scrollbar-thumb { background: var(--teal-soft); border-radius: 10px; border: 3px solid var(--paper); }

.ornament-rule {
  height: 14px; margin: 18px auto; width: min(320px, 70%);
  background:
    radial-gradient(circle at 50% 50%, var(--gold) 0 4px, transparent 5px),
    linear-gradient(var(--gold), var(--gold)) left 50% / calc(50% - 14px) 2px no-repeat,
    linear-gradient(var(--gold), var(--gold)) right 50% / calc(50% - 14px) 2px no-repeat;
}

/* ================= ВХОД ================= */
.welcome { align-items: center; text-align: center; color: var(--taiga); }
.logos {
  display: flex; justify-content: center; align-items: center; flex-wrap: wrap;
  gap: clamp(10px, 2vw, 28px);
  padding: 10px 16px;
}
.logos img { height: clamp(42px, 8vh, 84px); width: auto; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(255,255,255,.6)); }
.welcome__center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; min-height: 0; }
.welcome__title { width: min(900px, 92vw); height: auto; animation: title-in 1.4s var(--ease) both .15s; }
@keyframes title-in { from { opacity: 0; filter: blur(8px); transform: scale(.97); } }
.welcome__sub { font-family: var(--f-ui); font-size: clamp(1.1rem, 2.2vw, 1.7rem); margin: 0; color: var(--taiga); animation: title-in 1.2s var(--ease) both .7s; }
.welcome__cta { margin-top: 10px; animation: title-in 1s var(--ease) both 1.1s; }
.welcome__grant { max-width: 900px; font-size: clamp(.8rem, 1.2vw, .95rem); line-height: 1.45; color: var(--taiga-2); margin: 0 auto; opacity: .85; }

/* ================= О ПРОЕКТЕ ================= */
.prose { max-width: 72ch; margin: 0 auto; font-size: clamp(1rem, 1.25vw, 1.15rem); line-height: 1.7; }
.prose p { margin: 0 0 .9em; text-indent: 1.6em; }
.prose p.noindent { text-indent: 0; }
.prose h2 { font-family: var(--f-title); font-weight: normal; color: var(--taiga); font-size: clamp(1.5rem, 2.6vw, 2.2rem); text-align: center; margin: 0 0 .4em; }
.prose ul.sections { list-style: none; padding: 0; margin: .4em 0 1.2em; display: grid; gap: 10px; }
.prose ul.sections li { padding: 12px 16px; background: var(--mist); border-left: 4px solid var(--teal); border-radius: 0 10px 10px 0; text-indent: 0; }
.prose ul.sections b { font-family: var(--f-ui); font-weight: normal; color: var(--taiga); font-size: 1.15em; }
.prose blockquote {
  margin: 0 0 1.4em; padding: 18px 22px; text-indent: 0;
  font-style: italic; color: var(--taiga);
  background: var(--mist); border-radius: 12px; border-left: 4px solid var(--gold);
}
.prose blockquote footer { font-style: normal; margin-top: 8px; color: var(--ink-soft); font-size: .92em; }
.credits { margin-top: 1.6em; padding-top: 1em; border-top: 1px dashed var(--line); font-size: .92em; color: var(--ink-soft); text-indent: 0 !important; }
.board__foot { display: flex; justify-content: flex-end; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); background: rgba(230,241,236,.6); flex-wrap: wrap; }

/* ================= ЗАЛ С ДВЕРЯМИ ================= */
.hall { align-items: center; color: var(--paper); }
.hall__head { text-align: center; margin-top: clamp(4px, 3vh, 36px); }
.hall__title {
  font-family: var(--f-title); font-weight: normal; margin: 0;
  font-size: clamp(2rem, 5.6vw, 4.6rem); line-height: 1;
  color: #ddad71;
  text-shadow: 3px 3px 0 #184416, 0 0 30px rgba(0,0,0,.35);
  animation: title-in 1.2s var(--ease) both;
}
.hall__dedication { font-family: var(--f-title); font-size: clamp(1rem, 2vw, 1.6rem); color: #dcae72; text-shadow: 2px 2px 0 #133e13; margin: .5em 0 0; }

.doors {
  flex: 1; width: 100%; max-width: 1400px;
  display: flex; align-items: flex-end; justify-content: center;
  gap: clamp(10px, 2.4vw, 40px);
  padding-bottom: clamp(56px, 8vh, 90px);
  perspective: 1400px;
}
.door {
  --w: clamp(120px, 15vw, 210px);
  position: relative; width: var(--w); flex: 0 0 auto;
  background: none; border: 0; padding: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center;
  animation: door-in .8s var(--ease) both;
  animation-delay: calc(var(--i) * 90ms + 300ms);
}
@keyframes door-in { from { opacity: 0; transform: translateY(30px); } }
.door__sign, .door__frame, .door__opening, .door__leaf, .door__knob, .door__label { display: block; }
.door__sign {
  width: 62%; aspect-ratio: 1; margin-bottom: 10px; display: grid;
  background: var(--paper); border-radius: 50%;
  border: 3px solid var(--gold);
  box-shadow: 0 6px 18px -6px rgba(0,0,0,.6);
  display: grid; place-items: center;
  transition: transform .4s var(--ease);
}
.door__sign img { width: 72%; }
.door__frame {
  position: relative; width: 100%; aspect-ratio: 1 / 2;
  border-radius: calc(var(--w) / 2) calc(var(--w) / 2) 8px 8px;
  padding: 10px 10px 0;
  background: linear-gradient(90deg, var(--wood-dark), #6a3f1b 18%, #8a5a2c 50%, #6a3f1b 82%, var(--wood-dark));
  box-shadow: 0 30px 50px -20px rgba(0,0,0,.8), inset 0 0 0 2px rgba(0,0,0,.35);
}
.door__opening { /* тёплый свет за дверью */
  position: relative; width: 100%; height: 100%;
  border-radius: calc(var(--w) / 2 - 10px) calc(var(--w) / 2 - 10px) 0 0;
  background: radial-gradient(70% 60% at 50% 70%, #fff3cf 0%, #f2c76a 45%, #8a5a1a 100%);
  overflow: visible; transform-style: preserve-3d;
}
.door__leaf {
  position: absolute; inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(0,0,0,.25), rgba(0,0,0,0) 12%, rgba(255,255,255,.06) 50%, rgba(0,0,0,.2)),
    url(../assets/img/wood.webp) center / 220% auto;
  box-shadow: inset 0 0 0 2px rgba(60,30,8,.6);
  transform-origin: left center;
  transition: transform .7s var(--ease);
  backface-visibility: hidden;
}
.door__leaf::before, .door__leaf::after { /* филёнки */
  content: ""; position: absolute; left: 16%; right: 16%;
  border: 3px solid rgba(60,30,8,.45);
  box-shadow: inset 0 0 0 2px rgba(255,220,160,.12), 0 0 0 2px rgba(255,220,160,.08);
}
.door__leaf::before { top: 14%; height: 34%; border-radius: calc(var(--w) / 3) calc(var(--w) / 3) 6px 6px; }
.door__leaf::after { bottom: 8%; height: 34%; border-radius: 6px; }
.door__knob { position: absolute; right: 12%; top: 54%; width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe7a3, var(--gold) 50%, var(--gold-deep)); box-shadow: 0 2px 3px rgba(0,0,0,.6); }
.door__label {
  margin-top: 12px;
  font-family: var(--f-ui); font-size: clamp(1.05rem, 1.7vw, 1.5rem);
  color: var(--paper);
  text-shadow: 0 2px 6px rgba(0,0,0,.8);
}
.door:hover .door__leaf, .door:focus-visible .door__leaf, .door.is-open .door__leaf { transform: rotateY(-62deg); }
.door.is-open .door__leaf { transform: rotateY(-100deg); transition-duration: .55s; }
.door:hover .door__sign, .door:focus-visible .door__sign { transform: translateY(-6px); }
.door:focus-visible { outline: none; }
.door:focus-visible .door__frame { outline: 3px solid var(--gold-2); outline-offset: 4px; }
.hall__foot { position: absolute; left: var(--gutter); right: var(--gutter); bottom: var(--gutter); display: flex; justify-content: space-between; gap: 12px; pointer-events: none; }
.hall__foot > * { pointer-events: auto; }

.fade-out { animation: fade-out .5s var(--ease) forwards; }
@keyframes fade-out { to { opacity: 0; } }

/* ================= СПИСКИ (видео) ================= */
.media-list { list-style: none; margin: 0 auto; padding: 0; max-width: 1100px; display: grid; gap: 4px; }
.media-item {
  display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 18px;
  padding: 12px 16px; border-radius: 12px;
  text-decoration: none; color: var(--ink);
  transition: background .2s;
}
.media-item:hover { background: var(--mist); }
.media-item img { width: 64px; height: 64px; }
.media-item__title { font-size: clamp(1rem, 1.3vw, 1.15rem); line-height: 1.45; }
.media-item__title q { font-family: var(--f-ui); font-size: 1.15em; color: var(--taiga); quotes: "«" "»"; }
.media-item__go { font-family: var(--f-ui); color: var(--teal); white-space: nowrap; }
.media-item + .media-item { border-top: 1px solid var(--line); }

/* ================= АУДИО ================= */
.tracks { list-style: none; margin: 0 auto; padding: 0; max-width: 1100px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 16px; }
.track {
  position: relative; padding: 18px 20px 16px;
  background: #fff; border-radius: 14px; border: 1px solid var(--line);
  display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-items: center;
  transition: box-shadow .25s, border-color .25s;
}
.track.is-active { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(214,164,38,.25), 0 14px 30px -18px rgba(0,0,0,.45); }
.track__play {
  grid-row: span 2;
  width: 58px; height: 58px; border-radius: 50%;
  border: 2px solid var(--gold); background: var(--taiga); color: var(--paper);
  display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 3px 0 var(--gold-deep);
  transition: transform .15s;
}
.track__play:hover { transform: scale(1.05); }
.track__play svg { width: 24px; height: 24px; }
.track__title { font-family: var(--f-title); font-size: 1.45rem; line-height: 1.1; color: var(--taiga); margin: 0; }
.track__reader { font-size: .95rem; color: var(--ink-soft); margin: 0; }
.track__bar { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr auto auto auto; gap: 12px; align-items: center; margin-top: 8px; font-variant-numeric: tabular-nums; font-size: .9rem; color: var(--ink-soft); }
.track__stop { background: none; border: 0; padding: 4px; cursor: pointer; color: var(--ink-soft); display: grid; place-items: center; }
.track__stop svg { width: 18px; height: 18px; }
.track__stop:hover { color: var(--taiga); }
.track__vol { display: flex; align-items: center; gap: 6px; }
.track__vol svg { width: 18px; height: 18px; flex: none; }
.track__vol input { width: 72px; }
.track__loading { font-size: .85rem; color: var(--teal); }

input[type=range] {
  -webkit-appearance: none; appearance: none; height: 6px; border-radius: 6px; cursor: pointer;
  background: linear-gradient(var(--teal), var(--teal)) 0 / var(--p, 0%) 100% no-repeat, #dbe6e1;
}
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--gold); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--gold); border: 2px solid #fff; }

/* ================= АЛЬБОМ (книга) ================= */
.album { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.book {
  --pw: min(40vw, calc((100vh - 230px) * .78), 560px);
  position: relative; display: flex; perspective: 2200px;
  padding: 14px; border-radius: 10px;
  background: linear-gradient(#5b3618, #3e230d);
  box-shadow: 0 30px 60px -25px rgba(0,0,0,.8), inset 0 0 0 2px rgba(255,210,140,.15);
}
.page {
  width: var(--pw); aspect-ratio: 4 / 5;
  background: #fbf7ec;
  padding: 7% 7% 4%;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.page--l { border-radius: 6px 0 0 6px; box-shadow: inset -26px 0 30px -24px rgba(80,50,10,.45); }
.page--r { border-radius: 0 6px 6px 0; box-shadow: inset 26px 0 30px -24px rgba(80,50,10,.45); }
.page figure { margin: 0; flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.page img {
  flex: 1; min-height: 0; width: 100%; object-fit: contain;
  background: #fff; padding: 8px; border: 1px solid #e3dcc6;
  box-shadow: 0 6px 14px -8px rgba(0,0,0,.4);
  cursor: zoom-in;
}
.page figcaption { font-family: var(--f-ui); font-size: clamp(.9rem, 1.3vw, 1.15rem); text-align: center; color: var(--wood-dark); min-height: 2.6em; display: flex; align-items: center; }
.page__num { font-size: .8rem; color: #a99a76; }
.leaf { position: absolute; top: 14px; width: var(--pw); height: calc(100% - 28px); transform-style: preserve-3d; transition: transform .8s var(--ease); z-index: 3; }
.leaf--next { left: calc(14px + var(--pw)); transform-origin: left center; }
.leaf--prev { left: 14px; transform-origin: right center; }
.leaf .page { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; backface-visibility: hidden; }
.leaf .page--back { transform: rotateY(180deg); }
.album__nav { display: flex; align-items: center; gap: 18px; color: var(--paper); font-family: var(--f-ui); font-size: 1.1rem; }

.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(6, 22, 15, .9);
  display: grid; place-items: center; padding: var(--gutter);
  animation: screen-in .3s var(--ease);
}
.lightbox img { max-width: 92vw; max-height: 80vh; object-fit: contain; border: 6px solid #fff; box-shadow: var(--shadow); }
.lightbox p { color: var(--paper); font-family: var(--f-ui); font-size: 1.3rem; text-align: center; margin: 14px 0 0; }
.lightbox .icon-btn { position: absolute; top: var(--gutter); right: var(--gutter); }

/* ================= ПОЧИТАТЬ ================= */
.index { display: grid; grid-template-columns: minmax(200px, 340px) 1fr; gap: clamp(20px, 4vw, 56px); align-items: start; max-width: 1200px; margin: 0 auto; }
.index__portrait { position: sticky; top: 0; text-align: center; }
.index__portrait img { width: 100%; border: 6px solid #fff; outline: 3px solid var(--gold); box-shadow: var(--shadow); border-radius: 4px; }
.index__portrait p { font-family: var(--f-ui); color: var(--ink-soft); margin: 14px 0 0; }
.index h2 { font-family: var(--f-title); font-weight: normal; font-size: clamp(1.5rem, 2.6vw, 2.3rem); color: var(--taiga); margin: 0 0 .2em; line-height: 1.15; }
.index__lead { color: var(--ink-soft); margin: 0 0 1.2em; font-size: 1.05rem; }
.toc { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc button {
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  display: grid; grid-template-columns: 2.4em 1fr auto; align-items: baseline; gap: 10px;
  padding: 14px 10px; border-bottom: 1px solid var(--line);
  font-family: var(--f-ui); font-size: clamp(1.05rem, 1.5vw, 1.3rem); color: var(--taiga);
  transition: background .2s, padding .2s;
  border-radius: 8px;
}
.toc li { counter-increment: toc; }
.toc button::before { content: counter(toc, upper-roman) "."; color: var(--gold-deep); font-size: .9em; }
.toc button::after { content: "›"; color: var(--gold-deep); font-size: 1.4em; line-height: .6; }
.toc button:hover { background: var(--mist); padding-left: 16px; }

.biblio { max-width: 80ch; margin: 0 auto; padding-left: 0; list-style: none; counter-reset: b; }
.biblio li { counter-increment: b; position: relative; padding: 14px 0 14px 3.2em; border-bottom: 1px solid var(--line); line-height: 1.6; }
.biblio li::before { content: counter(b); position: absolute; left: 0; top: 12px; width: 2.2em; height: 2.2em; border-radius: 50%; display: grid; place-items: center; background: var(--mist); color: var(--taiga); font-family: var(--f-ui); font-size: .95em; }
.biblio .link { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-family: var(--f-ui); font-size: 1.05em; color: var(--teal); text-decoration: none; border-bottom: 1px solid rgba(31,110,98,.35); word-break: break-all; }
.biblio .link:hover { color: var(--taiga); border-bottom-color: var(--gold); }
.url-inline { word-break: break-all; color: var(--ink-soft); }
.bio-photo { float: right; width: min(220px, 40%); margin: 0 0 16px 24px; border: 5px solid #fff; outline: 2px solid var(--gold); box-shadow: var(--shadow); }

/* ---------- Презентация ---------- */
.slides { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 16px; }
.slides__frame { flex: 0 1 auto; max-width: min(1200px, 100%); border: 6px solid #fff; outline: 3px solid var(--gold); box-shadow: var(--shadow); background: #fff; }
.slides__frame img { max-height: calc(100vh - 200px); width: auto; animation: screen-in .35s var(--ease); }

/* ================= ПОИГРАТЬ ================= */
.games { flex: 1; display: flex; align-items: center; justify-content: center; gap: clamp(14px, 3vw, 40px); flex-wrap: wrap; padding: 10px; }
.game-card {
  position: relative; width: clamp(240px, 26vw, 360px); min-height: clamp(300px, 46vh, 440px);
  padding: 34px 26px 26px; cursor: pointer; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 18px;
  color: var(--paper);
  background:
    linear-gradient(rgba(19,72,50,.86), rgba(13,51,36,.94)),
    url(../assets/img/ornament.webp) center / 340px;
  border: 3px solid var(--gold); border-radius: 18px 18px 18px 18px;
  box-shadow: var(--shadow), inset 0 0 0 6px rgba(214,164,38,.2);
  transition: transform .3s var(--ease), box-shadow .3s;
}
.game-card:hover { transform: translateY(-6px); box-shadow: 0 30px 60px -20px rgba(0,0,0,.7), inset 0 0 0 6px rgba(214,164,38,.35); }
.game-card h2 { font-family: var(--f-title); font-weight: normal; font-size: clamp(1.8rem, 2.8vw, 2.6rem); margin: 0; color: #f0d39a; line-height: 1.1; }
.game-card p { margin: 0; line-height: 1.5; opacity: .92; font-size: 1rem; }
.game-card .btn { pointer-events: none; }
.game-card__mark { font-family: var(--f-title); font-size: 4rem; line-height: 1; color: var(--gold-2); }

/* ---------- Общие элементы игр ---------- */
.game { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.intro { max-width: 780px; margin: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 24px; }
.intro h2 { font-family: var(--f-title); font-weight: normal; font-size: clamp(2rem, 4vw, 3.2rem); color: var(--taiga); margin: 0; }
.intro p { font-size: clamp(1.05rem, 1.5vw, 1.25rem); line-height: 1.65; margin: 0; }
.hud { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-family: var(--f-ui); font-size: 1.2rem; color: var(--taiga); margin-bottom: 18px; }
.hud .score b { font-size: 1.5em; color: var(--gold-deep); font-weight: normal; }
.progress { flex: 1; min-width: 120px; max-width: 420px; height: 8px; border-radius: 8px; background: #dbe6e1; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--teal); transition: width .4s var(--ease); }
.question { font-size: clamp(1.2rem, 2vw, 1.75rem); line-height: 1.45; text-align: center; max-width: 900px; margin: 0 auto 26px; color: var(--ink); }
.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 900px; width: 100%; margin: 0 auto; }
.option {
  min-height: 74px; padding: 14px 20px; text-align: left; cursor: pointer;
  font-size: clamp(1rem, 1.4vw, 1.2rem); line-height: 1.35;
  background: #fff; border: 2px solid var(--line); border-radius: 14px;
  display: flex; align-items: center; gap: 14px;
  transition: border-color .2s, background .2s, transform .15s;
}
.option:hover:not(:disabled) { border-color: var(--teal); transform: translateY(-1px); }
.option__key { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--mist); color: var(--taiga); font-family: var(--f-ui); }
.option.is-right { border-color: #2e8b57; background: #e3f4ea; }
.option.is-right .option__key { background: #2e8b57; color: #fff; }
.option.is-wrong { border-color: #c0492b; background: #fbe9e4; }
.option.is-wrong .option__key { background: #c0492b; color: #fff; }
.option:disabled { cursor: default; }
.timer { position: relative; width: 58px; height: 58px; flex: none; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 6; }
.timer .t-bg { stroke: #dbe6e1; }
.timer .t-fg { stroke: var(--teal); stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke .3s; }
.timer.is-low .t-fg { stroke: #c0492b; }
.timer span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-ui); font-size: 1.3rem; }
.feedback { min-height: 3em; text-align: center; margin: 18px auto 0; max-width: 820px; line-height: 1.5; font-size: 1.05rem; }
.feedback.ok { color: #22744a; }
.feedback.bad { color: #a63b21; }
.feedback .comment { display: block; margin-top: 8px; color: var(--ink-soft); font-size: .95em; }
.answer-form { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; max-width: 720px; margin: 0 auto; width: 100%; }
.answer-form input {
  flex: 1 1 280px; min-height: 54px; padding: 10px 18px; font: inherit; font-size: 1.15rem;
  border: 2px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink);
}
.answer-form input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(31,110,98,.15); }
.result { text-align: center; margin: auto; display: flex; flex-direction: column; align-items: center; gap: 18px; max-width: 640px; }
.result h2 { font-family: var(--f-title); font-weight: normal; font-size: clamp(2rem, 4vw, 3rem); color: var(--taiga); margin: 0; }
.result__score { font-family: var(--f-title); font-size: clamp(3.5rem, 8vw, 6rem); color: var(--gold-deep); line-height: 1; }
.result p { margin: 0; font-size: 1.15rem; line-height: 1.5; }
.result .row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ---------- Карта «Волшебное слово Сибири» ---------- */
.mapgame { flex: 1; min-height: 0; display: grid; grid-template-columns: auto minmax(280px, 1fr); gap: clamp(16px, 3vw, 40px); align-items: center; }
.map { position: relative; height: min(calc(100vh - 220px), 64vw); aspect-ratio: 512 / 362; max-width: 100%; border: 5px solid #fff; outline: 3px solid var(--gold); box-shadow: var(--shadow); border-radius: 4px; overflow: hidden; }
.map > img { width: 100%; height: 100%; object-fit: fill; }
.map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map .trail { fill: none; stroke: var(--gold-2); stroke-width: .5; stroke-dasharray: 1 1.2; stroke-linecap: round; opacity: .95; }
.map .done { fill: var(--gold-2); }
.token {
  position: absolute; width: 4.4%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff9b8a, #d6281a 55%, #8e1208);
  border: 2px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,.6);
  transform: translate(-50%, -50%);
  transition: left .9s var(--ease), top .9s var(--ease);
  z-index: 2;
}
.token.hop { animation: hop .9s var(--ease); }
@keyframes hop { 40% { transform: translate(-50%, -110%) scale(1.15); } }
.mapgame__panel { display: flex; flex-direction: column; gap: 16px; max-width: 560px; }
.mapgame__panel .question { margin: 0; text-align: left; font-size: clamp(1.15rem, 1.8vw, 1.6rem); }
.mapgame__panel .answer-form { justify-content: flex-start; margin: 0; }
.mapgame__panel .feedback { text-align: left; margin: 0; }
.attempts { display: flex; gap: 6px; align-items: center; font-size: .95rem; color: var(--ink-soft); }
.attempts i { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); }
.attempts i.used { background: #d8d2c0; }

/* ---------- Адаптив ---------- */
@media (max-width: 900px) {
  .doors { flex-wrap: wrap; align-items: flex-end; overflow-y: auto; padding-top: 10px; }
  .door { --w: clamp(96px, 26vw, 150px); }
  .index { grid-template-columns: 1fr; }
  .index__portrait { position: static; max-width: 240px; margin: 0 auto; }
  .mapgame { grid-template-columns: 1fr; overflow-y: auto; }
  .map { height: auto; width: 100%; }
  .book { --pw: min(44vw, 300px); padding: 8px; }
}
@media (max-width: 640px) {
  :root { --gutter: 12px; }
  .options { grid-template-columns: 1fr; }
  .media-item { grid-template-columns: 44px 1fr; }
  .media-item img { width: 44px; height: 44px; }
  .media-item__go { display: none; }
  .book { flex-direction: column; --pw: min(78vw, 360px); }
  .page--r, .leaf { display: none; }
  .page--l { border-radius: 6px; box-shadow: none; }
  .bio-photo { float: none; margin: 0 auto 16px; }
  .slides .icon-btn { position: absolute; bottom: calc(var(--gutter) + 70px); }
  .slides .icon-btn:first-child { left: var(--gutter); }
  .slides .icon-btn:last-child { right: var(--gutter); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}
