/* ===== Тема: «тетрадка с наклейками» =====
   Бумага, чернильные контуры, жёсткие тени, пастельные наклейки, рукописные пометки. */
:root {
  --bg: #fbf3e4;
  --bg2: #f4e8d2;
  --panel: #fffdf8;
  --panel2: #fbf0dc;
  --line: #e4d5b8;
  --edge: #2a2233;
  --ink: #2a2233;
  --ink2: #51465a;
  --muted: #8b7f8f;
  --dot: rgba(42, 34, 51, .09);
  --accent: #ff7f50;
  --accent-soft: color-mix(in srgb, var(--accent) 55%, #fff);
  --accent-wash: color-mix(in srgb, var(--accent) 13%, var(--panel));
  --accent2: color-mix(in srgb, var(--accent) 72%, #2a1030);
  --accent-ink: #2a2233;
  --on-pastel: #2a2233;
  --ok: #24935a;
  --ok-bg: #dcf5e3;
  --bad: #d9472f;
  --bad-bg: #ffe4dc;
  --info: #3b82c4;
  --peach: #ffd0b0;
  --mint: #bfe8cc;
  --lilac: #d9cdf7;
  --butter: #ffe58f;
  --sky: #bfe0f7;
  --pink: #ffc6d6;
  --shadow: 4px 4px 0 var(--edge);
  --shadow-sm: 3px 3px 0 var(--edge);
  --radius: 20px;
  --serif: "Yeseva One", Georgia, "Times New Roman", serif;
  --sans: "Nunito", "Segoe UI", system-ui, -apple-system, "Roboto", Arial, sans-serif;
  --hand: "Caveat", "Segoe Print", "Comic Sans MS", cursive;
  --map-sea: #cfe8f3;
  --map-land: #fdf3da;
  --map-line: #c7b189;
  --map-arrow: #d9661a;
  --map-water: #2f78b8;
}
:root[data-theme="dark"] {
  --bg: #1f1a27;
  --bg2: #272030;
  --panel: #2f2739;
  --panel2: #3a3046;
  --line: #4a3e58;
  --edge: #0d0a11;
  --ink: #f6eee0;
  --ink2: #d6cad9;
  --muted: #a094a8;
  --dot: rgba(255, 255, 255, .05);
  --accent-soft: color-mix(in srgb, var(--accent) 78%, #fff);
  --accent-wash: color-mix(in srgb, var(--accent) 16%, var(--panel));
  --accent2: color-mix(in srgb, var(--accent) 62%, #fff);
  --ok: #62d08c;
  --ok-bg: rgba(98, 208, 140, .15);
  --bad: #ff8672;
  --bad-bg: rgba(255, 134, 114, .14);
  --info: #86bdf0;
  --map-sea: #24323f;
  --map-land: #3d3548;
  --map-line: #62566e;
  --map-arrow: #f0a83e;
  --map-water: #7fb3e0;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  background-image: radial-gradient(var(--dot) 1.3px, transparent 1.4px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--accent2); }
img { max-width: 100%; display: block; }
mark, .hl {
  background: linear-gradient(transparent 52%, var(--butter) 52%, var(--butter) 94%, transparent 94%);
  color: inherit; padding: 0 3px; border-radius: 2px;
}
:root[data-theme="dark"] mark, :root[data-theme="dark"] .hl { background: linear-gradient(transparent 52%, rgba(255, 229, 143, .28) 52%); }
b, strong { color: var(--accent2); font-weight: 800; }
::selection { background: var(--butter); color: #2a2233; }

/* ===== Каркас плеера ===== */
.app { height: calc(100vh / var(--z, 1)); height: calc(100dvh / var(--z, 1)); display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px 12px;
  border-bottom: 2px solid var(--edge); background: var(--panel); z-index: 20; position: relative;
}
.topbar .t-title { font-family: var(--serif); font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .t-section { color: var(--muted); font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.icon-btn {
  border: 2px solid var(--edge); background: var(--panel); border-radius: 12px;
  min-width: 40px; height: 40px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform .12s, box-shadow .12s, background .2s; font-size: 15px; font-weight: 700; text-decoration: none; color: var(--ink);
  box-shadow: 2px 2px 0 var(--edge);
}
.icon-btn:hover { background: var(--butter); color: var(--on-pastel); transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--edge); }
.icon-btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--edge); }
.icon-btn svg { width: 18px; height: 18px; }
.score-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 999px;
  background: var(--butter); color: var(--on-pastel); border: 2px solid var(--edge); font-weight: 800; font-size: 15px; white-space: nowrap;
}
.score-pill .star { color: #e8607a; }
.streak { color: #d9472f; font-weight: 800; display: none; }
.streak.on { display: inline; animation: pop .4s; }
.progress { position: absolute; left: 0; bottom: -2px; height: 6px; max-width: calc(100% - 17px); background: var(--accent); border-right: 2px solid var(--edge); border-top: 0; transition: width .5s cubic-bezier(.3, 1.4, .5, 1); z-index: 2; }
.progress::after {
  content: ""; position: absolute; right: -15px; top: -13px; width: 30px; height: 28px;
  background: var(--cat) center / contain no-repeat; filter: drop-shadow(1px 2px 0 rgba(0, 0, 0, .18));
}

.stage { flex: 1; position: relative; overflow: hidden; }
.slide {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden;
  padding: 30px 18px 44px; display: flex; flex-direction: column; align-items: center;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.slide > .inner { width: 100%; max-width: 1120px; margin: auto 0; }
.slide.enter-right { animation: enterRight .5s cubic-bezier(.2, .8, .2, 1) both; }
.slide.enter-left { animation: enterLeft .5s cubic-bezier(.2, .8, .2, 1) both; }
.slide.leave-left { animation: leaveLeft .35s ease both; pointer-events: none; }
.slide.leave-right { animation: leaveRight .35s ease both; pointer-events: none; }
@keyframes enterRight { from { opacity: 0; transform: translateX(60px) rotate(1deg); } to { opacity: 1; transform: none; } }
@keyframes enterLeft { from { opacity: 0; transform: translateX(-60px) rotate(-1deg); } to { opacity: 1; transform: none; } }
@keyframes leaveLeft { to { opacity: 0; transform: translateX(-60px) rotate(-1deg); } }
@keyframes leaveRight { to { opacity: 0; transform: translateX(60px) rotate(1deg); } }

.bottombar {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px 12px; border-top: 2px solid var(--edge);
  background: var(--panel); z-index: 20;
}
.nav-btn {
  border: 2px solid var(--edge); background: var(--panel); color: var(--ink); border-radius: 14px; padding: 10px 18px; font-weight: 800;
  display: inline-flex; align-items: center; gap: 8px; transition: transform .12s, box-shadow .12s, background .2s; box-shadow: var(--shadow-sm);
}
.nav-btn:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--edge); }
.nav-btn:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--edge); }
.nav-btn:disabled { opacity: .4; cursor: default; box-shadow: none; }
.nav-btn.primary { background: var(--accent-soft); color: var(--accent-ink); }
.nav-btn.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 70%, #fff); }
.nav-btn.pulse { animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 0%, 70%, 100% { transform: none; } 78% { transform: translateY(-4px) rotate(-1.5deg); } 86% { transform: translateY(0) rotate(1deg); } 93% { transform: translateY(-2px); } }
.counter { color: var(--muted); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hint-keys { color: var(--muted); font-size: 13px; margin-left: auto; margin-right: auto; text-align: center; }
.hint-keys kbd { border: 1.5px solid var(--edge); border-bottom-width: 3px; border-radius: 6px; padding: 0 5px; font-size: 12px; background: var(--panel); font-family: var(--sans); font-weight: 700; color: var(--ink2); }

/* ===== Общие элементы слайдов ===== */
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--hand); font-size: 27px; font-weight: 700; line-height: 1.1; color: var(--accent2); margin-bottom: 6px;
}
.kicker::before { content: ""; width: 22px; height: 12px; flex: 0 0 22px; background: currentColor; -webkit-mask: var(--squig) center / contain no-repeat; mask: var(--squig) center / contain no-repeat; }
:root { --squig: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 12'%3E%3Cpath d='M1 8c3-8 5-8 7-2s4 6 6 0 4-4 7-1' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E"); }
h1.s-title, h2.s-title {
  font-family: var(--serif); font-weight: 400; line-height: 1.15; margin: 0 0 20px; letter-spacing: -.005em;
}
h2.s-title { font-size: clamp(27px, 3.7vw, 44px); }
.lead { font-size: 19px; color: var(--ink2); }
.card {
  background: var(--panel); border: 2px solid var(--edge); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.grid2 { display: grid; grid-template-columns: 1.15fr .85fr; gap: 34px; align-items: center; }
.grid2.img-left { grid-template-columns: .85fr 1.15fr; }
.grid2.img-left .media { order: -1; }
@media (max-width: 820px) {
  .grid2, .grid2.img-left { grid-template-columns: 1fr; gap: 20px; }
  .grid2 .media, .grid2.img-left .media { order: -1; }
}

/* картинки — как вклеенные в тетрадь фотографии */
.media { position: relative; }
.media figure {
  margin: 0; background: #fffdf8; padding: 9px 9px 8px; border: 2px solid var(--edge); border-radius: 10px; box-shadow: var(--shadow);
  transform: rotate(1.1deg); transition: transform .35s cubic-bezier(.3, 1.5, .5, 1); position: relative;
}
.grid2.img-left .media figure { transform: rotate(-1.3deg); }
.media figure:hover { transform: rotate(0) scale(1.01); }
.media figure::before {
  content: ""; position: absolute; left: 50%; top: -13px; width: 92px; height: 24px; transform: translateX(-50%) rotate(-3deg);
  background: color-mix(in srgb, var(--accent) 45%, #fff6d8); opacity: .82; border-left: 2px dashed rgba(255, 255, 255, .7); border-right: 2px dashed rgba(255, 255, 255, .7); z-index: 1;
}
.media img { width: 100%; max-height: calc(60vh / var(--z, 1)); object-fit: cover; object-position: center 22%; border-radius: 5px; cursor: zoom-in; }
.media figcaption { color: #51465a; font-family: var(--hand); font-size: 20px; line-height: 1.15; margin-top: 7px; text-align: center; padding: 0 6px; }
@media (max-width: 820px) { .media img { max-height: calc(34vh / var(--z, 1)); } .media figure { max-width: 520px; margin: 0 auto; } }

.points { list-style: none; padding: 0; margin: 0; display: grid; gap: 11px; }
.points li {
  position: relative; padding: 12px 14px 12px 50px; background: var(--panel); border: 1.5px solid var(--edge); border-radius: 14px;
}
.points li::before {
  content: attr(data-n); position: absolute; left: 12px; top: 11px; width: 27px; height: 27px; border-radius: 50%;
  background: var(--butter); color: var(--on-pastel); border: 1.5px solid var(--edge); font-weight: 900; font-size: 13px; display: grid; place-items: center;
}
.points li:nth-child(4n+2)::before { background: var(--mint); }
.points li:nth-child(4n+3)::before { background: var(--sky); }
.points li:nth-child(4n+4)::before { background: var(--pink); }
.points li .ico { position: absolute; left: 13px; top: 10px; font-size: 21px; }
.points li.has-ico::before { display: none; }

/* «Запомни» — жёлтый стикер */
.remember {
  margin-top: 22px; padding: 16px 18px 15px; border-radius: 4px 4px 16px 4px; position: relative; color: var(--on-pastel);
  background: var(--butter); border: 2px solid var(--edge); box-shadow: var(--shadow-sm); transform: rotate(-.6deg);
}
.remember b, .remember strong { color: #a8331c; }
.remember::before { content: ""; position: absolute; left: 22px; top: -12px; width: 74px; height: 22px; background: rgba(255, 255, 255, .72); border: 1px solid rgba(42, 34, 51, .16); transform: rotate(-4deg); }
.remember .r-label { font-family: var(--hand); font-size: 25px; line-height: 1; color: #a8331c; font-weight: 700; display: block; margin-bottom: 3px; }

.quote {
  font-family: var(--sans); font-size: 20px; font-weight: 700; font-style: italic; padding: 14px 18px 14px 52px; margin: 16px 0; color: var(--on-pastel);
  background: var(--lilac); border: 2px solid var(--edge); border-radius: 16px 16px 16px 4px; position: relative;
}
.quote::before { content: "“"; position: absolute; left: 12px; top: -4px; font-family: var(--serif); font-style: normal; font-size: 62px; line-height: 1; color: #7a5fd0; }

/* шаги появления */
.step { opacity: 0; transform: translateY(14px); transition: opacity .45s ease, transform .45s ease; }
.step.shown { opacity: 1; transform: none; }
.step-hint { margin-top: 16px; color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; justify-content: center; }
.step-hint .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 1.5px solid var(--edge); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* ===== Обложка ===== */
.s-cover { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.s-cover .bg { position: absolute; inset: 0; background-size: cover; background-position: center 25%; transform: scale(1.08); animation: kenburns 18s ease-out forwards; }
.s-cover .bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(32, 22, 40, .5), rgba(26, 18, 34, .9)); }
@keyframes kenburns { to { transform: scale(1); } }
.s-cover .c-inner { position: relative; max-width: 900px; color: #fff7e6; }
.s-cover .kicker { color: #2a2233; background: var(--butter); padding: 4px 16px 6px; border: 2px solid #2a2233; border-radius: 4px; transform: rotate(-2deg); box-shadow: 3px 3px 0 rgba(0, 0, 0, .45); margin-bottom: 18px; }
.s-cover .kicker::before { display: none; }
.s-cover h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(48px, 9vw, 110px); margin: 0; line-height: 1.02; text-shadow: 4px 4px 0 rgba(0, 0, 0, .45); }
.s-cover h1 span { display: inline-block; opacity: 0; transform: translateY(30px) rotate(6deg); animation: letterIn .7s cubic-bezier(.2, 1.4, .4, 1) forwards; }
@keyframes letterIn { to { opacity: 1; transform: none; } }
.s-cover .sub { font-size: clamp(17px, 2.2vw, 22px); font-weight: 600; color: #f1e4cd; margin-top: 18px; opacity: 0; animation: fadeUp .8s 1s forwards; }
.s-cover .chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 28px; opacity: 0; animation: fadeUp .8s 1.3s forwards; }
.s-cover .chips span { border: 2px solid #fff7e6; padding: 6px 14px; border-radius: 999px; font-size: 14px; background: rgba(0, 0, 0, .3); }
.s-cover .start { margin-top: 34px; opacity: 0; animation: fadeUp .8s 1.6s forwards; }
.s-cover .start .nav-btn { font-size: 19px; padding: 14px 26px; border-color: #2a2233; box-shadow: 4px 4px 0 #2a2233; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ===== Раздел ===== */
.s-section { text-align: center; }
.s-section .num {
  display: inline-grid; place-items: center; min-width: clamp(110px, 17vw, 170px); height: clamp(110px, 17vw, 170px); padding: 0 22px;
  font-family: var(--serif); font-size: clamp(54px, 8.5vw, 92px); line-height: 1; color: var(--on-pastel);
  background: var(--accent-soft); border: 3px solid var(--edge); border-radius: 44% 56% 52% 48% / 52% 46% 54% 48%; box-shadow: 6px 6px 0 var(--edge);
  transform: rotate(-4deg); animation: pop .7s both;
}
.s-section .num:empty { display: none; }
.s-section h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 5vw, 56px); margin: 22px 0 10px; line-height: 1.1; animation: fadeUp .6s .2s both; }
.s-section p { color: var(--ink2); font-size: 19px; max-width: 640px; margin: 0 auto; animation: fadeUp .6s .35s both; }
.s-section .goals { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 26px; animation: fadeUp .6s .5s both; }
.s-section .goals span { background: var(--panel); border: 2px solid var(--edge); border-radius: 999px; padding: 6px 14px; font-size: 14px; }

/* ===== Большая дата ===== */
.bigdate .year {
  font-family: var(--serif); font-weight: 400; font-size: clamp(80px, 14vw, 160px); line-height: .95; color: var(--accent2);
  text-shadow: 5px 5px 0 var(--butter); font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
:root[data-theme="dark"] .bigdate .year { text-shadow: 5px 5px 0 var(--edge); }
.bigdate .year-label { font-family: var(--serif); font-size: clamp(22px, 3vw, 34px); line-height: 1.15; margin: 14px 0 18px; }

/* ===== Личность ===== */
.person { display: grid; grid-template-columns: 320px 1fr; gap: 40px; align-items: start; }
.person .portrait { position: relative; background: #fffdf8; padding: 10px 10px 30px; border: 2px solid var(--edge); border-radius: 8px; box-shadow: var(--shadow); transform: rotate(-2deg); }
.person .portrait::before { content: ""; position: absolute; left: 50%; top: -13px; width: 96px; height: 24px; transform: translateX(-50%) rotate(3deg); background: color-mix(in srgb, var(--accent) 45%, #fff6d8); opacity: .85; z-index: 1; }
.person .portrait img {
  width: 100%; aspect-ratio: 3/4; object-fit: cover; object-position: center 20%; border-radius: 4px; cursor: zoom-in; animation: portraitIn .9s both;
}
@keyframes portraitIn { from { opacity: 0; filter: grayscale(1); } to { opacity: 1; filter: none; } }
.person .years {
  position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%) rotate(2deg); background: var(--butter); color: var(--on-pastel);
  font-weight: 900; padding: 5px 16px; border-radius: 999px; border: 2px solid var(--edge); white-space: nowrap; box-shadow: 2px 2px 0 var(--edge); font-variant-numeric: tabular-nums;
}
.person .role { color: var(--ink2); font-size: 18px; font-weight: 600; margin: -10px 0 16px; }
.tagrow { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tag { font-size: 13px; font-weight: 700; padding: 3px 11px; border-radius: 999px; background: var(--panel2); border: 1.5px solid var(--edge); color: var(--ink2); }
.tag.gold { background: var(--butter); color: var(--on-pastel); }
@media (max-width: 820px) {
  .person { grid-template-columns: 1fr; gap: 30px; }
  .person .portrait { max-width: 240px; margin: 0 auto; }
}

/* ===== Определение ===== */
.definition { max-width: 860px; margin: 0 auto; text-align: center; }
.definition .term {
  font-family: var(--serif); font-size: clamp(38px, 6vw, 68px); font-weight: 400; color: var(--ink); line-height: 1.1;
  display: inline-block; position: relative; margin-bottom: 6px; z-index: 0;
}
.definition .term::after { content: ""; position: absolute; left: -2%; right: -2%; bottom: .08em; height: .36em; background: var(--butter); border-radius: 4px; transform-origin: left; animation: drawLine .8s .3s both; z-index: -1; }
:root[data-theme="dark"] .definition .term::after { background: color-mix(in srgb, var(--accent) 45%, transparent); }
@keyframes drawLine { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.definition .def { font-size: clamp(19px, 2.3vw, 25px); font-weight: 600; line-height: 1.45; margin: 26px 0 10px; }
.definition .def-card { text-align: left; }
.definition .media { max-width: 420px; margin: 26px auto 0; }
.definition .media img { max-height: calc(36vh / var(--z, 1)); }
.def-list { display: grid; gap: 14px; text-align: left; }
.def-item { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: center; }
.def-item .t { font-family: var(--serif); font-size: 22px; color: var(--accent2); }
@media (max-width: 720px) { .def-item { grid-template-columns: 1fr; gap: 4px; } }

/* ===== Лента времени ===== */
.timeline { position: relative; margin: 10px 0 24px; padding: 30px 0 10px; }
.timeline .track { position: absolute; left: 0; right: 0; top: 79px; height: 0; border-top: 3px dashed var(--line); background: none; }
.timeline .track .fill { height: 5px; margin-top: -4px; background: var(--accent); border-radius: 4px; width: 0; transition: width .6s ease; }
.timeline .nodes { display: flex; justify-content: space-between; position: relative; gap: 8px; }
.tl-node { background: none; border: none; display: flex; flex-direction: column; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 0; }
.tl-node .date { font-family: var(--serif); font-size: 20px; color: var(--muted); transition: color .3s, transform .3s; font-variant-numeric: tabular-nums; }
.tl-node .dot { width: 22px; height: 22px; border-radius: 50%; background: var(--panel); border: 2.5px solid var(--edge); transition: all .3s cubic-bezier(.3, 1.6, .5, 1); }
.tl-node .lbl { font-size: 13px; font-weight: 600; color: var(--muted); text-align: center; line-height: 1.3; max-width: 140px; }
.tl-node.seen .dot { background: var(--butter); }
.tl-node.seen .date { color: var(--ink); }
.tl-node.active .dot { background: var(--accent); box-shadow: 2px 2px 0 var(--edge); transform: scale(1.3) rotate(8deg); border-radius: 7px; }
.tl-node.active .date { color: var(--accent2); transform: scale(1.14); }
.tl-node.active .lbl { color: var(--ink); }
.tl-detail { display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: center; min-height: 200px; }
.tl-detail.no-img { grid-template-columns: 1fr; }
.tl-detail .d-date { font-family: var(--serif); font-size: 44px; color: var(--accent2); line-height: 1; }
.tl-detail h3 { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 8px 0 10px; }
.tl-detail p { margin: 0 0 8px; color: var(--ink2); }
.tl-detail img { border-radius: 10px; border: 2px solid var(--edge); box-shadow: var(--shadow-sm); max-height: 240px; width: 100%; object-fit: cover; cursor: zoom-in; transform: rotate(1.2deg); }
.tl-detail.anim { animation: fadeUp .45s both; }
@media (max-width: 820px) {
  .timeline .track { display: none; }
  .timeline .nodes { overflow-x: auto; justify-content: flex-start; padding-bottom: 8px; }
  .tl-node { flex: 0 0 84px; }
  .tl-node .lbl { display: none; }
  .tl-detail { grid-template-columns: 1fr; }
  .tl-detail img { max-height: 180px; }
}

/* ===== Генеалогическое древо ===== */
.ftree-wrap { overflow-x: auto; padding: 4px 0 6px; }
.ftree, .ftree ul { display: flex; justify-content: center; margin: 0; padding: 22px 0 0; position: relative; }
.ftree { padding-top: 0; min-width: max-content; margin: 0 auto; }
.ftree li { list-style: none; position: relative; padding: 22px 7px 0; display: flex; flex-direction: column; align-items: center; opacity: 0; transform: translateY(10px); transition: opacity .45s ease, transform .45s ease; }
.ftree li.shown { opacity: 1; transform: none; }
.ftree > li { padding-top: 0; }
.ftree li::before, .ftree li::after { content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 22px; border-top: 2px solid var(--edge); }
.ftree li::after { right: auto; left: 50%; border-left: 2px solid var(--edge); }
.ftree li:first-child::before, .ftree li:last-child::after { border: 0 none; }
.ftree li:last-child::before { border-right: 2px solid var(--edge); border-radius: 0 10px 0 0; }
.ftree li:first-child::after { border-radius: 10px 0 0 0; }
.ftree li:only-child::before { display: none; }
.ftree li:only-child::after { border-top: 0; border-left: 2px solid var(--edge); border-radius: 0; left: 50%; width: 0; }
.ftree > li::before, .ftree > li::after { display: none; }
.ftree ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 22px; border-left: 2px solid var(--edge); transition: opacity .3s; }
.ftree ul:not(.open)::before { opacity: 0; }
.fnode { background: var(--panel); border: 1.5px solid var(--edge); border-radius: 12px; padding: 7px 10px; min-width: 112px; max-width: 168px; text-align: center; font-size: 13.5px; line-height: 1.25; box-shadow: var(--shadow); }
.fnode b { display: block; font-size: 14.5px; color: var(--ink); }
.fnode .yrs { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.fnode .sp { display: block; color: var(--ink2); font-size: 12px; margin-top: 2px; }
.fnode .nt { display: block; margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--accent); }
.fnode.fr { background: color-mix(in srgb, #4a7de0 20%, var(--panel)); border-color: #2f5bb5; }
.fnode.en { background: color-mix(in srgb, #e0574a 22%, var(--panel)); border-color: #b5342f; }
.fnode.key { border-width: 2.5px; box-shadow: 0 0 0 4px var(--butter), var(--shadow); transform: rotate(-1deg); }
.fnode.end { border-style: dashed; }
.ftree-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; margin-top: 12px; font-size: 13.5px; color: var(--ink2); }
.ftree-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.ftree-legend .lg i { width: 16px; height: 12px; border-radius: 4px; border: 1.5px solid var(--edge); background: var(--panel); }
.ftree-legend .lg.fr i { background: color-mix(in srgb, #4a7de0 20%, var(--panel)); border-color: #2f5bb5; }
.ftree-legend .lg.en i { background: color-mix(in srgb, #e0574a 22%, var(--panel)); border-color: #b5342f; }
.ftree-legend .lg.end i { border-style: dashed; }
.ftree-legend .lg.key i { box-shadow: 0 0 0 3px var(--butter); }

/* ===== Причины — следствия ===== */
.ce { display: grid; grid-template-columns: 1fr 60px 1fr 60px 1fr; align-items: center; gap: 0; }
.ce .col h4 { font-family: var(--hand); font-size: 24px; font-weight: 700; margin: 0 0 8px; color: var(--ink2); text-align: center; }
.ce .box { background: var(--panel); border: 1.5px solid var(--edge); border-radius: 14px; padding: 11px 14px; margin-bottom: 10px; font-size: 16px; }
.ce .col.cause .box { background: color-mix(in srgb, var(--pink) 45%, var(--panel)); }
.ce .col.effect .box { background: color-mix(in srgb, var(--mint) 45%, var(--panel)); }
.ce .col.event .box { border-width: 2px; text-align: center; font-family: var(--serif); font-size: 20px; line-height: 1.2; padding: 20px 14px; background: var(--butter); color: var(--on-pastel); box-shadow: var(--shadow); transform: rotate(-1deg); }
.ce .col.event .box b { color: #a8331c; }
.ce .arrow { display: flex; justify-content: center; color: var(--edge); }
:root[data-theme="dark"] .ce .arrow { color: var(--ink2); }
.ce .arrow svg { width: 44px; height: 44px; }
.ce .arrow svg path { stroke-dasharray: 60; stroke-dashoffset: 60; }
.ce .arrow.shown svg path { animation: dash .8s forwards; }
@keyframes dash { to { stroke-dashoffset: 0; } }
@media (max-width: 860px) {
  .ce { grid-template-columns: 1fr; }
  .ce .arrow { transform: rotate(90deg); margin: 4px 0; }
}

/* ===== Карта ===== */
.mapwrap { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: stretch; }
.mapbox { position: relative; background: var(--map-sea); border-radius: 18px; border: 2px solid var(--edge); overflow: hidden; align-self: start; box-shadow: var(--shadow); }
.mapbox svg { display: block; width: 100%; height: auto; max-height: calc(66vh / var(--z, 1)); --k: 1; }
.map-land { fill: var(--map-land); stroke: var(--map-line); stroke-width: .6; stroke-opacity: .55; }
.map-land.noborder { stroke: var(--map-land); stroke-opacity: 1; }
.map-grid { stroke: rgba(42, 34, 51, .06); stroke-width: 1; fill: none; }
:root[data-theme="dark"] .map-grid { stroke: rgba(255, 255, 255, .05); }
.map-region { fill-opacity: 0; stroke-opacity: 0; transition: fill-opacity .8s, stroke-opacity .8s; stroke-width: 2; stroke-dasharray: 6 4; }
.map-region.on { fill-opacity: .42; stroke-opacity: .9; }
.map-region.by-country { stroke-opacity: 0 !important; }
.map-region path { vector-effect: non-scaling-stroke; }
.map-region-label { font-family: var(--serif); font-size: calc(16px * var(--k)); fill: var(--ink); opacity: 0; transition: opacity .8s; pointer-events: none; paint-order: stroke; stroke: var(--map-land); stroke-width: calc(4px * var(--k)); letter-spacing: .03em; }
.map-region-label.on { opacity: .95; }
.map-city { opacity: 0; transition: opacity .5s; cursor: pointer; }
.map-city.on { opacity: 1; }
.map-city circle.core { fill: var(--accent); stroke: var(--edge); r: calc(6px * var(--k)); stroke-width: calc(2px * var(--k)); }
.map-city circle.halo { fill: var(--accent); opacity: .35; transform-box: fill-box; transform-origin: center; r: calc(6.5px * var(--k)); }
.map-city.on.fresh circle.halo { animation: halo 1.6s ease-out 3; }
@keyframes halo { from { transform: scale(1); opacity: .6; } to { transform: scale(4); opacity: 0; } }
.map-city text { font-family: var(--sans); font-size: calc(14px * var(--k)); font-weight: 800; fill: var(--ink); paint-order: stroke; stroke: var(--map-land); stroke-width: calc(4px * var(--k)); pointer-events: none; transform: translate(calc(var(--dx, 12) * 1px * var(--k)), calc(var(--dy, 5) * 1px * var(--k))); }
.map-city text.yr { font-size: calc(11.5px * var(--k)); fill: var(--accent2); font-weight: 900; }
.map-city:hover circle.core { r: 9; }
.map-arrow { fill: none; stroke: var(--map-arrow); stroke-width: calc(3px * var(--k)); stroke-linecap: round; opacity: 0; }
.map-arrow.on { opacity: 1; animation: drawArrow 1.4s ease forwards; }
.map-arrow.money { stroke: #b8901c; stroke-dasharray: 2 9 !important; }
.map-arrow.danger { stroke: var(--bad); }
.map-arrow.alt { stroke: #3d7fd6; }
@keyframes drawArrow { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }
.map-arrow-label { font-family: var(--sans); font-size: calc(12.5px * var(--k)); font-weight: 800; fill: var(--accent2); opacity: 0; transition: opacity .6s .9s; paint-order: stroke; stroke: var(--map-sea); stroke-width: calc(4px * var(--k)); font-style: italic; }
.map-arrow-label.on { opacity: 1; }
.map-tip {
  position: absolute; pointer-events: none; background: var(--panel); border: 2px solid var(--edge); border-radius: 12px; padding: 8px 12px;
  font-size: 14px; max-width: 240px; box-shadow: var(--shadow-sm); opacity: 0; transition: opacity .2s; z-index: 5;
}
.map-tip.on { opacity: 1; }
.map-tip b { display: block; margin-bottom: 2px; }
.map-side { display: flex; flex-direction: column; gap: 12px; }
.map-steps { display: grid; gap: 10px; }
.map-step { padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--panel); color: var(--muted); transition: all .35s; cursor: pointer; text-align: left; }
.map-step.done { color: var(--ink2); border-color: var(--edge); }
.map-step.active { color: var(--on-pastel); border: 2px solid var(--edge); background: var(--accent-soft); box-shadow: var(--shadow-sm); transform: translateX(-4px) rotate(-.5deg); }
.map-step.active b { color: #7a1f10; }
.map-step .ms-n { font-weight: 900; color: var(--accent2); margin-right: 6px; }
.map-step.active .ms-n { color: inherit; }
.map-legend { font-size: 13px; color: var(--muted); }
@media (max-width: 900px) {
  .mapwrap { grid-template-columns: 1fr; }
  .map-steps { grid-template-columns: 1fr; }
  .map-step:not(.active) { display: none; }
}
.map-river { fill: none; stroke: #4a90d0; stroke-width: calc(2.6px * var(--k)); stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.map-river-label { font-size: calc(12px * var(--k)); fill: var(--map-water); font-style: italic; font-weight: 800; paint-order: stroke; stroke: var(--map-land); stroke-width: calc(3px * var(--k)); }
.map-sea-label { font-size: calc(13px * var(--k)); font-style: italic; fill: var(--map-water); font-weight: 700; letter-spacing: .06em; paint-order: stroke; stroke: var(--map-sea); stroke-width: calc(3px * var(--k)); pointer-events: none; }
.map-sea-label.land { fill: var(--muted); font-style: normal; text-transform: uppercase; letter-spacing: .14em; stroke: var(--map-land); }
.map-sea-label.country { fill: var(--ink); font-style: normal; font-weight: 800; stroke: var(--map-land); }
.map-region.frame { fill-opacity: 0 !important; stroke-dasharray: 10 6; stroke-width: calc(3px * var(--k)); }
.map-region.pulse.on { fill-opacity: .9 !important; }
.map-region.pulse.on path { animation: regPulse2 1.8s ease-in-out infinite; }
@keyframes regPulse2 { 50% { opacity: .55; } }
.map-region.outline.on { fill-opacity: .2 !important; stroke-opacity: 1 !important; stroke-width: 4; stroke-dasharray: none; }
/* слайд «где это на карте» */
.loc-stack { display: grid; }
.loc-stack > .mapbox { grid-area: 1 / 1; align-self: center; opacity: 0; visibility: hidden; transform: scale(.96); transition: opacity .6s, transform .6s, visibility 0s .6s; }
.loc-stack > .mapbox.on { opacity: 1; visibility: visible; transform: none; transition: opacity .6s, transform .6s; }

/* ===== Сравнение ===== */
.compare { width: 100%; border-collapse: separate; border-spacing: 8px; table-layout: fixed; }
.compare th { font-family: var(--serif); font-weight: 400; font-size: 20px; padding: 6px; vertical-align: bottom; }
.compare th img { width: 78px; height: 78px; border-radius: 50%; object-fit: cover; object-position: center 20%; margin: 0 auto 8px; border: 2px solid var(--edge); box-shadow: 3px 3px 0 var(--edge); }
.compare td.rl { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; width: 150px; vertical-align: middle; }
.cmp-cell {
  width: 100%; min-height: 64px; height: 100%; border-radius: 14px; border: 2px dashed var(--muted); background: var(--panel2);
  padding: 10px 12px; text-align: left; font-size: 15px; position: relative; transition: all .3s; color: transparent;
}
.cmp-cell::after { content: "нажми, чтобы вспомнить"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-family: var(--hand); font-size: 20px; }
.cmp-cell.open { color: var(--ink); background: var(--panel); border: 2px solid var(--edge); box-shadow: 2px 2px 0 var(--edge); animation: flipIn .45s; }
.cmp-cell.open::after { display: none; }
@keyframes flipIn { from { transform: rotateX(80deg); opacity: .3; } to { transform: none; opacity: 1; } }
.cmp-scroll { overflow-x: auto; margin: 0 -8px; padding: 0 8px 6px; }
@media (max-width: 600px) { .compare { min-width: calc(90px + var(--cols, 2) * 120px); } }
.compare-actions { display: flex; justify-content: center; margin-top: 10px; gap: 10px; }
@media (max-width: 820px) {
  .compare { border-spacing: 4px; }
  .compare td.rl { width: 76px; font-size: 10.5px; letter-spacing: 0; }
  .compare th { font-size: 14px; }
  .compare th img { width: 48px; height: 48px; }
  .cmp-cell { font-size: 13px; padding: 8px; min-height: 54px; }
  .cmp-cell::after { content: "?"; font-size: 22px; }
}

/* ===== Тест (формат как в ЕНТ) ===== */
.quiz { max-width: 860px; margin: 0 auto; }
.quiz .q-badge { display: inline-flex; align-items: center; gap: 8px; width: 100%; flex-wrap: wrap; row-gap: 6px; font-family: var(--hand); font-size: 25px; font-weight: 700; line-height: 1; color: var(--info); margin-bottom: 12px; }
.quiz .q-badge .q-ico { width: 30px; height: 30px; border-radius: 10px; background: var(--sky); color: var(--on-pastel); border: 2px solid var(--edge); display: grid; place-items: center; font-family: var(--sans); font-size: 15px; font-weight: 900; transform: rotate(-6deg); }
.quiz .q-text, .think .q-text {
  font-family: var(--serif); font-weight: 400; font-size: clamp(21px, 2.6vw, 28px); line-height: 1.3; padding-bottom: 14px; margin: 0 0 18px;
  border-bottom: 2.5px dashed var(--line);
}
.quiz .q-multi { font-size: 14px; color: var(--accent2); margin: -8px 0 14px; font-weight: 800; }
.opts { display: grid; gap: 12px; }
.opt {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 15px 18px; border-radius: 16px;
  background: var(--panel); border: 2px solid var(--edge); box-shadow: var(--shadow-sm); transition: transform .14s, box-shadow .14s, background .2s; position: relative;
  font-family: var(--sans); font-size: 18px; font-weight: 600;
}
.opt:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--edge); background: var(--accent-wash); }
.opt:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--edge); }
.opt:disabled { cursor: default; }
.opt .box { width: 20px; height: 20px; flex: 0 0 20px; border: 2px solid var(--edge); border-radius: 6px; background: var(--bg); display: grid; place-items: center; transition: all .2s; }
.opt .box svg { width: 14px; height: 14px; opacity: 0; transform: scale(.4); transition: all .2s; }
.opt .letter { font-family: var(--serif); font-size: 19px; min-width: 26px; color: var(--accent2); }
.opt.sel { background: var(--accent-wash); }
.opt.sel .box { background: var(--accent); }
.opt.sel .box svg { opacity: 1; transform: none; color: var(--accent-ink); }
.opt.right { border-color: var(--ok); background: var(--ok-bg); box-shadow: 3px 3px 0 var(--ok); }
.opt.right .box { background: var(--ok); border-color: var(--ok); }
.opt.right .box svg { opacity: 1; transform: none; color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); box-shadow: 3px 3px 0 var(--bad); animation: shake .45s; }
.opt.wrong .box { background: var(--bad); border-color: var(--bad); }
.opt.wrong .box svg { opacity: 1; transform: none; color: #fff; }
.opt.missed { border-style: dashed; box-shadow: none; }
.opt .verdict { margin-left: auto; font-family: var(--hand); font-size: 22px; font-weight: 700; white-space: nowrap; }
.opt.right .verdict { color: var(--ok); }
.opt.wrong .verdict { color: var(--bad); }
.opt.dim { opacity: .5; box-shadow: none; }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
.q-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.explain {
  margin-top: 20px; padding: 16px 18px 16px 70px; border-radius: 18px 18px 18px 4px; position: relative; animation: fadeUp .4s both; font-size: 16.5px; min-height: 68px;
  border: 2px solid var(--edge);
}
.explain.ok { background: var(--ok-bg); }
.explain.bad { background: var(--bad-bg); }
.explain::before { content: ""; position: absolute; left: 12px; top: 12px; width: 46px; height: 43px; background: var(--cat) center / contain no-repeat; animation: pop .5s both; }
.explain.bad::before { background-image: var(--cat-think, var(--cat)); }
.explain .ex-title { font-weight: 900; display: block; margin-bottom: 4px; }
.explain.ok .ex-title { color: var(--ok); }
.explain.bad .ex-title { color: var(--bad); }
@media (max-width: 600px) {
  .opt { padding: 13px 13px; gap: 11px; font-size: 16.5px; }
  .opt .verdict { display: none; }
  .explain { padding-left: 16px; padding-top: 58px; }
}

/* ===== Порядок / сопоставление ===== */
.order-list { display: grid; gap: 10px; max-width: 760px; margin: 0 auto; }
.order-item {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-radius: 14px; border: 2px solid var(--edge); background: var(--panel); text-align: left; transition: all .2s; box-shadow: 2px 2px 0 var(--edge); font-weight: 600;
}
.order-item:hover:not(:disabled) { background: var(--accent-wash); transform: translate(-1px, -1px); }
.order-item .num { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; border: 2px dashed var(--muted); display: grid; place-items: center; font-weight: 900; transition: all .25s; }
.order-item.picked .num { background: var(--butter); color: var(--on-pastel); border: 2px solid var(--edge); animation: pop .3s; }
.order-item.right { border-color: var(--ok); background: var(--ok-bg); box-shadow: 2px 2px 0 var(--ok); }
.order-item.right .num { background: var(--ok); border-color: var(--ok); color: #fff; }
.order-item.wrong { border-color: var(--bad); background: var(--bad-bg); box-shadow: 2px 2px 0 var(--bad); }
.order-item.wrong .num { background: var(--bad); border-color: var(--bad); color: #fff; }
.order-item .when { margin-left: auto; color: var(--accent2); font-family: var(--serif); opacity: 0; transition: opacity .4s; }
.order-item.reveal .when { opacity: 1; }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }

.match { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 40px; max-width: 900px; margin: 0 auto; }
.match .mcol { display: grid; gap: 10px; align-content: start; }
.m-item {
  padding: 13px 14px; border-radius: 14px; border: 2px solid var(--edge); background: var(--panel); text-align: left; transition: all .2s; min-height: 52px; font-size: 16px; box-shadow: 2px 2px 0 var(--edge);
}
.m-item.left { font-weight: 800; font-size: 17px; background: var(--panel2); }
.m-item:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--edge); }
.m-item.sel { background: var(--butter); color: var(--on-pastel); transform: rotate(-1deg) scale(1.02); }
.m-item.done { border-color: var(--ok); background: var(--ok-bg); box-shadow: none; opacity: .9; }
.m-item.err { border-color: var(--bad); background: var(--bad-bg); animation: shake .4s; }
.m-item .pair-tag { float: right; font-size: 12px; font-weight: 900; color: var(--ok); }
@media (max-width: 640px) { .match { gap: 10px 10px; } .m-item { font-size: 14px; padding: 10px; } .m-item.left { font-size: 15px; } }

/* ===== Карточки ===== */
.flash { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.fc { perspective: 900px; height: 170px; background: none; border: none; padding: 0; }
.fc:nth-child(odd) { transform: rotate(-.8deg); } .fc:nth-child(even) { transform: rotate(.9deg); }
.fc .fc-in { position: relative; width: 100%; height: 100%; transition: transform .6s cubic-bezier(.2, .8, .2, 1); transform-style: preserve-3d; }
.fc.flipped .fc-in { transform: rotateY(180deg); }
.fc .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 16px; padding: 16px; display: flex; align-items: center; justify-content: center; text-align: center; border: 2px solid var(--edge); box-shadow: var(--shadow-sm); }
.fc .front { background: var(--panel); font-family: var(--serif); font-size: 22px; line-height: 1.15; flex-direction: column; gap: 6px; }
.fc:nth-child(4n+1) .front { background: color-mix(in srgb, var(--sky) 55%, var(--panel)); }
.fc:nth-child(4n+2) .front { background: color-mix(in srgb, var(--pink) 55%, var(--panel)); }
.fc:nth-child(4n+3) .front { background: color-mix(in srgb, var(--mint) 55%, var(--panel)); }
.fc:nth-child(4n+4) .front { background: color-mix(in srgb, var(--lilac) 55%, var(--panel)); }
.fc .front small { font-family: var(--hand); font-size: 18px; color: var(--muted); }
.fc .back { background: var(--butter); color: var(--on-pastel); transform: rotateY(180deg); font-size: 15.5px; font-weight: 600; }
.fc .back b { color: #a8331c; }
/* обратный режим карточек: спереди определение, сзади термин */
.fc.rev .front { font-family: var(--sans); font-size: 15.5px; font-weight: 600; line-height: 1.35; }
.fc.rev .back { font-family: var(--serif); font-size: 22px; line-height: 1.15; flex-direction: column; gap: 6px; font-weight: 400; }
.fc.rev .back small { font-family: var(--hand); font-size: 18px; color: var(--muted); }
.fc-tools { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fc-mode { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-weight: 700; font-size: 14px; color: var(--muted); user-select: none; }
.fc-mode input { position: absolute; opacity: 0; pointer-events: none; }
.fc-mode .fm-sw { position: relative; width: 44px; height: 24px; border: 2px solid var(--edge); border-radius: 999px; background: var(--panel); transition: background .2s; flex: none; }
.fc-mode .fm-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--edge); transition: transform .2s; }
.fc-mode input:checked + .fm-sw { background: var(--accent); }
.fc-mode input:checked + .fm-sw::after { transform: translateX(20px); }
.fc-mode input:focus-visible + .fm-sw { outline: 3px solid var(--accent); outline-offset: 2px; }
.fc-mode .fm-l { color: var(--ink); } .fc-rev .fc-mode .fm-l { color: var(--muted); } .fc-rev .fc-mode .fm-r { color: var(--ink); }
.flash-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 10px; flex-wrap: wrap; }

/* ===== Итоги ===== */
.results { text-align: center; max-width: 820px; margin: 0 auto; }
.ring { width: 200px; height: 200px; margin: 0 auto 10px; position: relative; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-bg { stroke: var(--line); }
.ring .ring-fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1.6s cubic-bezier(.2, .8, .2, 1); }
.ring .ring-txt { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: 50px; }
.ring .ring-txt small { display: block; font-size: 20px; color: var(--muted); font-family: var(--hand); margin-top: -6px; }
.res-msg { font-family: var(--serif); font-size: 28px; line-height: 1.2; margin: 6px 0 4px; }
.res-stats { display: flex; gap: 14px; justify-content: center; margin: 18px 0; flex-wrap: wrap; }
.res-stats .st { background: var(--panel); border: 2px solid var(--edge); border-radius: 16px; padding: 10px 18px; min-width: 120px; box-shadow: var(--shadow-sm); }
.res-stats .st:nth-child(1) { background: var(--mint); color: var(--on-pastel); transform: rotate(-1.5deg); }
.res-stats .st:nth-child(2) { background: var(--pink); color: var(--on-pastel); transform: rotate(1deg); }
.res-stats .st:nth-child(3) { background: var(--sky); color: var(--on-pastel); transform: rotate(-.6deg); }
.res-stats .st:nth-child(4) { background: var(--butter); color: var(--on-pastel); transform: rotate(1.4deg); }
.res-stats .st b { display: block; font-size: 28px; font-family: var(--serif); font-weight: 400; color: inherit; }
.res-stats .st span, .res-stats .st small { font-size: 13px; font-weight: 700; color: inherit !important; opacity: .75; }
.mistakes { text-align: left; display: grid; gap: 8px; margin: 12px 0 18px; }
.mistake { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; background: var(--bad-bg); border: 1.5px solid var(--bad); text-align: left; width: 100%; font-weight: 600; }
.mistake.reread { background: var(--panel); border-color: var(--edge); }
.mistake:hover { transform: translateX(3px); }
.mistake .go { margin-left: auto; font-size: 13px; color: var(--bad); font-weight: 800; white-space: nowrap; }
.mistake.reread .go { color: var(--accent2); }
.res-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 22px; }

/* ===== Оглавление ===== */
.drawer-bg { position: fixed; inset: 0; background: rgba(42, 34, 51, .45); opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 40; }
.drawer-bg.on { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; width: min(380px, 88vw); background: var(--bg); border-right: 2px solid var(--edge); z-index: 41;
  transform: translateX(-102%); transition: transform .35s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column; box-shadow: 8px 0 0 rgba(42, 34, 51, .12);
}
.drawer.on { transform: none; }
.drawer header { padding: 16px; border-bottom: 2px solid var(--edge); display: flex; align-items: center; gap: 10px; background: var(--butter); color: var(--on-pastel); }
.drawer header h3 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 22px; flex: 1; }
.drawer .modes { display: flex; gap: 8px; padding: 12px 16px; border-bottom: 2px dashed var(--line); flex-wrap: wrap; }
.drawer .modes a { font-size: 13px; height: 36px; }
.toc { overflow-y: auto; padding: 8px 8px 30px; flex: 1; }
.toc .sec { font-family: var(--hand); font-size: 22px; line-height: 1.1; color: var(--accent2); font-weight: 700; padding: 16px 10px 4px; }
.toc button { display: flex; width: 100%; align-items: center; gap: 10px; text-align: left; padding: 8px 10px; border: 1.5px solid transparent; background: none; border-radius: 10px; font-size: 14.5px; font-weight: 600; color: var(--ink2); }
.toc button:hover { background: var(--panel); }
.toc button.cur { background: var(--panel); color: var(--ink); font-weight: 800; border-color: var(--edge); box-shadow: 2px 2px 0 var(--edge); }
.toc .ti { width: 20px; text-align: center; flex: 0 0 20px; font-size: 13px; }
.toc .ok { color: var(--ok); }
.toc .bad { color: var(--bad); }

/* ===== Прочее ===== */
.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px) rotate(-1deg); background: var(--butter); color: var(--on-pastel); border: 2px solid var(--edge);
  padding: 10px 18px; border-radius: 14px; box-shadow: var(--shadow); opacity: 0; transition: all .3s cubic-bezier(.3, 1.5, .5, 1); z-index: 60; pointer-events: none; font-weight: 800; max-width: 92vw; text-align: center;
}
.toast.on { opacity: 1; transform: translateX(-50%) rotate(-1deg); }
.lightbox { position: fixed; inset: 0; background: rgba(26, 18, 34, .9); display: none; align-items: center; justify-content: center; z-index: 70; cursor: zoom-out; padding: 20px; flex-direction: column; gap: 10px; }
.lightbox.on { display: flex; animation: fadeUp .25s; }
.lightbox img { max-width: 100%; max-height: calc(86vh / var(--z, 1)); border-radius: 6px; border: 8px solid #fffdf8; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.lightbox .cap { color: #f1e4cd; font-size: 14px; text-align: center; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; }
.center { text-align: center; }
.mt { margin-top: 18px; }
.muted { color: var(--muted); }
.shake { animation: shake .45s; }
.stat-chip { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; background: var(--butter); color: var(--on-pastel); border: 2px solid var(--edge); border-radius: 16px; padding: 12px 20px; margin: 6px; box-shadow: var(--shadow-sm); }
.stat-chip:nth-child(even) { background: var(--sky); transform: rotate(1.5deg); }
.stat-chip:nth-child(odd) { transform: rotate(-1.5deg); }
.stat-chip b { font-family: var(--serif); font-weight: 400; font-size: 38px; line-height: 1; color: inherit; }
.stat-chip span { font-size: 13px; font-weight: 700; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .topbar { padding: 8px 12px 10px; gap: 6px; }
  .topbar .t-section, .hint-keys, .hide-sm { display: none !important; }
  .slide { padding: 20px 16px 30px; }
  .nav-btn { padding: 10px 14px; }
  .bottombar { padding: 8px 12px 10px; justify-content: space-between; }
  .points li { padding: 10px 12px 10px 46px; }
  .kicker { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ===== Вопросы ЕНТ: контекст, карта, картинка, уровень ===== */
.q-level { margin-left: 4px; font-family: var(--sans); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 9px; border-radius: 999px; border: 1.5px solid var(--edge); color: var(--on-pastel); }
.q-level.A { background: var(--mint); } .q-level.B { background: var(--butter); } .q-level.C { background: var(--pink); }
.q-points { margin-left: auto; font-family: var(--sans); font-size: 12.5px; color: var(--muted); font-weight: 700; }
.source {
  position: relative; margin: 0 0 20px; padding: 18px 22px 16px; border-radius: 4px 14px 14px 4px;
  background: var(--panel); border: 2px solid var(--edge); border-left: 10px solid var(--accent-soft); box-shadow: var(--shadow-sm);
  font-size: 17px; line-height: 1.55; color: var(--ink);
}
.source::before { content: "“"; position: absolute; right: 14px; top: -2px; font-size: 70px; line-height: 1; color: var(--accent-soft); font-family: var(--serif); }
.source .src-title { font-family: var(--hand); font-size: 23px; line-height: 1.1; color: var(--accent2); font-weight: 700; margin-bottom: 6px; }
.source .src-text { font-style: italic; max-height: calc(34vh / var(--z, 1)); overflow-y: auto; }
.q-map { margin: 0 0 18px; }
.q-map svg { max-height: calc(40vh / var(--z, 1)); }
.q-img { margin: 0 0 18px; display: flex; justify-content: center; }
.q-img img { max-height: calc(34vh / var(--z, 1)); border-radius: 6px; border: 7px solid #fffdf8; outline: 2px solid var(--edge); box-shadow: var(--shadow); cursor: zoom-in; transform: rotate(-1deg); }

/* ===== Соответствие в формате ЕНТ ===== */
.mc-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.mc-col { background: var(--panel); border: 2px solid var(--edge); border-radius: 14px; padding: 12px 14px; }
.mc-col h4 { margin: 0 0 6px; font-family: var(--hand); font-size: 22px; line-height: 1.1; color: var(--ink2); }
.mc-col div { padding: 6px 0; border-bottom: 1.5px dashed var(--line); font-size: 16px; }
.mc-col div:last-child { border-bottom: none; }
.mc-col b.k { display: inline-block; min-width: 26px; color: var(--accent2); }
@media (max-width: 640px) { .mc-lists { grid-template-columns: 1fr; } }

.ce.three { grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 860px) { .ce.three { grid-template-columns: 1fr; } }

/* ===================== Формат 2.0: самообучение ===================== */
/* словарь */
.gl { border-bottom: 2.5px dotted var(--accent); cursor: help; color: inherit; font-weight: inherit; border-radius: 3px; transition: background .2s; }
.gl:hover, .gl:focus { background: var(--butter); color: var(--on-pastel); outline: none; }
.gl-pop { position: fixed; z-index: 90; background: var(--panel); border: 2px solid var(--edge); border-radius: 18px 18px 18px 4px; padding: 14px 16px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(6px) rotate(-.5deg); transition: opacity .2s, transform .2s; font-size: 16px; line-height: 1.5; }
.gl-pop.on { opacity: 1; pointer-events: auto; transform: rotate(-.5deg); }
.gl-k { font-family: var(--hand); font-size: 20px; line-height: 1; color: var(--muted); font-weight: 700; }
.gl-t { font-family: var(--serif); font-size: 23px; color: var(--accent2); margin: 2px 0 6px; text-transform: capitalize; }
.gl-ex { margin-top: 8px; color: var(--muted); font-size: 14px; font-style: italic; }
.gl-x { position: absolute; top: 8px; right: 10px; background: none; border: 0; color: var(--muted); font-size: 16px; cursor: pointer; }

/* рассказ */
.story-paras .sp { font-size: 19px; line-height: 1.65; margin: 0 0 14px; opacity: 0; transform: translateY(10px); transition: opacity .45s, transform .45s; }
.story-paras .sp.shown { opacity: 1; transform: none; }
.story-paras .sp.now { border-left: 5px solid var(--accent-soft); padding-left: 14px; margin-left: -19px; }
@media (max-width: 700px) { .story-paras .sp { font-size: 17px; } .story-paras .sp.now { margin-left: 0; } }

/* вход в урок */
.hook .lead { font-size: 21px; font-weight: 600; }
.hook-recall, .hook-q { margin: 16px 0; padding: 16px 20px; }
.hook-recall { background: color-mix(in srgb, var(--sky) 50%, var(--panel)); transform: rotate(-.4deg); }
.hook-q { transform: rotate(.3deg); }
.hk-l { font-family: var(--hand); font-size: 24px; line-height: 1.1; font-weight: 700; color: var(--accent2); margin-bottom: 4px; }
.hook-q ol { margin: 4px 0 0; padding-left: 24px; font-size: 18px; }
.hook-q li { margin: 6px 0; }
.hook-q li::marker { font-family: var(--serif); color: var(--accent2); }
.hook-why { padding: 12px 16px; border-radius: 14px; background: var(--panel2); border: 2px dashed var(--muted); font-size: 17px; }

/* пауза «как думаешь» */
.think { max-width: 860px; margin: 0 auto; }
.think-pad { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 18px 20px; border: 2px dashed var(--muted); border-radius: 18px; color: var(--ink2); font-family: var(--hand); font-size: 23px; line-height: 1.2; margin-top: 14px; }
.think-pad .nav-btn { font-family: var(--sans); font-size: 16px; }
.think-ans { display: none; margin-top: 16px; font-size: 18px; }
.think-ans.shown { display: block; animation: fadeUp .5s both; }

/* аналогия */
.analogy-box { font-size: 20px; line-height: 1.55; padding: 20px 24px; border-radius: 22px 22px 22px 6px; background: color-mix(in srgb, var(--lilac) 55%, var(--panel)); border: 2px solid var(--edge); box-shadow: var(--shadow); margin-bottom: 16px; }
.analogy-back { margin-top: 16px; padding: 12px 16px; border-left: 6px solid var(--accent-soft); background: var(--panel2); border-radius: 0 14px 14px 0; }

/* мнемоника */
.mn-list { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.mn { padding: 16px 18px; color: var(--on-pastel); border-radius: 6px 6px 18px 6px; }
.mn b { color: #a8331c; }
.mn:nth-child(4n+1) { background: var(--butter); transform: rotate(-1deg); }
.mn:nth-child(4n+2) { background: var(--mint); transform: rotate(.8deg); }
.mn:nth-child(4n+3) { background: var(--pink); transform: rotate(-.5deg); }
.mn:nth-child(4n+4) { background: var(--sky); transform: rotate(1.1deg); }
.mn-k { font-family: var(--serif); font-size: 26px; line-height: 1.1; color: var(--on-pastel); margin-bottom: 6px; }
.mn-t { font-size: 16px; font-weight: 600; }

/* главное за минуту */
.sum-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.sum-list li { position: relative; padding: 10px 14px 10px 46px; background: var(--panel); border: 1.5px solid var(--edge); border-radius: 14px; font-size: 17px; }
.sum-list li::before { content: "✓"; position: absolute; left: 12px; top: 9px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; background: var(--mint); color: var(--on-pastel); border: 1.5px solid var(--edge); font-weight: 900; font-size: 14px; transform: rotate(-6deg); }
.sum-ans { margin: 12px 0; }
.sum-ans details { background: var(--panel); border: 1.5px solid var(--edge); border-radius: 14px; padding: 10px 14px; margin: 8px 0; }
.sum-ans summary { cursor: pointer; font-weight: 800; }
.sum-ans details[open] summary { margin-bottom: 6px; color: var(--accent2); }

/* тесты: подсказка, разбор, возврат */
.hint-btn.open { border-style: dashed; cursor: default; text-align: left; white-space: normal; background: var(--butter); color: var(--on-pastel); box-shadow: none; }
.explain .why { margin: 8px 0; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--bad) 10%, transparent); }
.explain .why-main { margin-top: 8px; }
.ref-btn { margin-top: 12px; white-space: normal; text-align: left; }

/* освоение */
.mastery { margin: 10px auto 18px; padding: 10px 16px; border-radius: 14px; max-width: 620px; background: var(--panel2); border: 2px dashed var(--muted); font-weight: 600; }
.mastery.ok { border: 2px solid var(--ok); background: var(--ok-bg); }

/* заголовки без переноса по буквам */
h1, h2, h3, .s-title, .q-text, .kicker { hyphens: manual; word-break: normal; overflow-wrap: normal; }
.s-cover h1 .w { display: inline-block; white-space: nowrap; }
.s-cover h1 span.w { opacity: 1; transform: none; animation: none; }

/* ===================== Игровая часть (engine/fun.js) ===================== */
.cat { display: block; width: 100%; height: auto; overflow: visible; }
.xpbar { height: 14px; background: var(--panel); border: 2px solid var(--edge); border-radius: 999px; overflow: hidden; }
.xpbar i { display: block; height: 100%; min-width: 6px; background: repeating-linear-gradient(-45deg, var(--accent-soft) 0 9px, color-mix(in srgb, var(--accent) 80%, #fff) 9px 18px); border-right: 2px solid var(--edge); border-radius: 0 999px 999px 0; transition: width 1s cubic-bezier(.2, .8, .2, 1); }

.sticker { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; transform: rotate(var(--r, 0deg)); transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); outline: none; }
.sticker .s-ico { width: 74px; height: 74px; display: grid; place-items: center; font-size: 34px; border-radius: 50%; border: 2px solid var(--edge); box-shadow: 0 0 0 5px #fffdf8, 0 0 0 7px var(--edge), 5px 8px 0 5px rgba(42, 34, 51, .16); margin: 7px; }
.sticker .s-name { font-size: 13px; font-weight: 800; line-height: 1.15; max-width: 104px; }
.sticker .s-how { position: absolute; left: 50%; bottom: calc(100% - 2px); transform: translateX(-50%) scale(.8); width: 160px; padding: 7px 10px; background: var(--edge); color: #fff7e6; font-size: 12.5px; font-weight: 600; line-height: 1.25; border-radius: 10px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 5; }
:root[data-theme="dark"] .sticker .s-how { background: #f6eee0; color: #2a2233; }
.sticker:hover, .sticker:focus { transform: rotate(0) scale(1.07); z-index: 4; }
.sticker:hover .s-how, .sticker:focus .s-how { opacity: 1; transform: translateX(-50%); }
.sticker.c-mint .s-ico { background: var(--mint); } .sticker.c-peach .s-ico { background: var(--peach); } .sticker.c-sky .s-ico { background: var(--sky); }
.sticker.c-butter .s-ico { background: var(--butter); } .sticker.c-lilac .s-ico { background: var(--lilac); } .sticker.c-pink .s-ico { background: var(--pink); }
.sticker.off .s-ico { background: transparent; border: 2px dashed var(--muted); box-shadow: none; color: var(--muted); font-family: var(--hand); font-size: 36px; }
.sticker.off .s-name { color: var(--muted); }

.xp-pop { position: fixed; z-index: 95; transform: translate(-50%, 0); font-family: var(--serif); font-size: 22px; color: var(--ok); text-shadow: 2px 2px 0 var(--panel); pointer-events: none; animation: xpUp 1.25s ease-out forwards; white-space: nowrap; }
@keyframes xpUp { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 20% { opacity: 1; transform: translate(-50%, 26px) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, 64px) scale(1); } }

.sticker-toast { position: fixed; right: 16px; top: 70px; z-index: 96; display: grid; gap: 10px; pointer-events: none; }
.st-card { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 2px solid var(--edge); border-radius: 18px; box-shadow: var(--shadow); padding: 8px 18px 8px 8px; animation: stIn .6s cubic-bezier(.3, 1.5, .5, 1) both; transition: opacity .5s, transform .5s; }
.st-card.out { opacity: 0; transform: translateX(40px); }
.st-card .sticker .s-name, .st-card .sticker .s-how { display: none; }
.st-card .sticker .s-ico { width: 54px; height: 54px; font-size: 26px; }
.st-card small { display: block; font-family: var(--hand); font-size: 20px; line-height: 1; color: var(--accent2); }
.st-card b { color: var(--ink); font-size: 17px; }
@keyframes stIn { from { opacity: 0; transform: translateX(60px) rotate(6deg); } to { opacity: 1; transform: none; } }

.res-fun { display: flex; align-items: center; gap: 16px; text-align: left; max-width: 620px; margin: 6px auto 4px; padding: 12px 18px 12px 12px; background: var(--panel); border: 2px solid var(--edge); border-radius: 20px; box-shadow: var(--shadow); }
.rf-cat { width: 78px; flex: 0 0 78px; animation: catBob 2.6s ease-in-out infinite; }
.rf-body { flex: 1; min-width: 0; }
.rf-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; margin-bottom: 6px; }
.rf-top b { font-family: var(--serif); font-weight: 400; font-size: 20px; color: var(--ink); }
.rf-top span { font-weight: 800; font-size: 14px; color: var(--ink2); }
.rf-top i { font-style: normal; color: var(--ok); }
.rf-sub { font-size: 13.5px; font-weight: 600; color: var(--muted); margin-top: 6px; }
@keyframes catBob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-5px) rotate(2deg); } }

/* ===================== Подписка ===================== */
.paywall { max-width: 640px; margin: 0 auto; text-align: center; position: relative; padding-top: 64px; }
.paywall .pw-cat { position: absolute; left: 50%; top: -52px; width: 104px; transform: translateX(-50%); animation: catBob 2.6s ease-in-out infinite; }
.paywall .kicker { justify-content: center; }
.pw-list { list-style: none; padding: 0; margin: 14px auto 6px; display: inline-grid; gap: 8px; text-align: left; font-weight: 700; }
.pw-list li { position: relative; padding-left: 34px; }
.pw-list li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; background: var(--mint); color: var(--on-pastel); border: 1.5px solid var(--edge); font-weight: 900; font-size: 14px; transform: rotate(-6deg); }

/* окно «продолжить урок или начать сначала» */
.resume-wrap { position: fixed; inset: 0; z-index: 200; isolation: isolate; will-change: opacity; display: grid; place-items: center; padding: 18px; background: color-mix(in srgb, var(--ink) 55%, transparent); opacity: 0; transition: opacity .25s; }
.resume-wrap.on { opacity: 1; }
.resume { position: relative; width: min(500px, 100%); padding: 28px 28px 22px; text-align: center; transform: translateY(18px) rotate(-1deg) scale(.97); transition: transform .35s cubic-bezier(.3, 1.4, .5, 1); background: var(--panel); will-change: transform; }
.resume-wrap.on .resume { transform: none; }
.resume .kicker { justify-content: center; }
.resume h2 { font-family: var(--serif); font-weight: 400; font-size: 28px; margin: 6px 0 14px; line-height: 1.15; }
.rs-cat { position: absolute; top: -46px; left: 50%; transform: translateX(-50%); }
.rs-cat:empty { display: none; }
.rs-cat img, .rs-cat svg { width: 78px; height: auto; }
.resume:has(.rs-cat:not(:empty)) { padding-top: 40px; }
.rs-where { display: flex; flex-direction: column; gap: 5px; align-items: center; background: color-mix(in srgb, var(--butter) 38%, var(--panel)); border: 2px dashed var(--edge); border-radius: 16px; padding: 14px 16px; margin-bottom: 16px; }
.rs-where b { font-size: 18px; color: var(--ink); line-height: 1.3; }
.rs-sec { font-size: 13px; font-weight: 800; color: var(--accent2); text-transform: uppercase; letter-spacing: .04em; }
.rs-meta { font-size: 13.5px; color: var(--muted); font-weight: 700; }
.rs-bar { width: 100%; height: 10px; border: 2px solid var(--edge); border-radius: 999px; background: var(--panel); overflow: hidden; margin-top: 4px; }
.rs-bar i { display: block; height: 100%; background: var(--accent); }
.rs-acts { display: flex; flex-direction: column; gap: 10px; }
.rs-acts .nav-btn { justify-content: center; font-size: 16.5px; padding: 12px 16px; }
.rs-hint { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.rs-note { font-size: 12.5px; color: var(--muted); font-weight: 700; margin-top: -4px; }
body.wait-map, body.wait-map * { cursor: progress !important; }   /* слайд с картой ждёт контуры стран */

/* ===== подсказки при первом открытии (engine/tour.js) ===== */
.tour { position: fixed; inset: 0; z-index: 300; opacity: 0; transition: opacity .25s; pointer-events: auto; }
.tour.on { opacity: 1; }
.tour-spot { position: fixed; border-radius: 16px; box-shadow: 0 0 0 4px var(--accent), 0 0 0 9999px rgba(30, 24, 40, .62); transition: left .35s, top .35s, width .35s, height .35s; cursor: pointer; }
.tour-card { position: fixed; background: var(--panel); color: var(--ink); border: 2px solid var(--edge); border-radius: 18px; box-shadow: 5px 5px 0 var(--edge); padding: 16px 18px 14px; opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
.tour-card.in { opacity: 1; transform: none; }
.tour-n { font-family: var(--hand); font-size: 20px; color: var(--accent2); line-height: 1; margin-bottom: 4px; }
.tour-card b { display: block; font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1.15; margin-bottom: 4px; }
.tour-card p { margin: 0 0 12px; font-size: 15px; line-height: 1.45; color: var(--ink2); }
.tour-acts { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tour-acts .linkish { background: none; border: 0; padding: 4px 0; font: inherit; font-size: 14px; font-weight: 700; color: var(--muted); cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }

/* ===== окно подтверждения (Fun.ask / Fun.say) ===== */
.ask-wrap { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 18px; background: color-mix(in srgb, var(--ink) 50%, transparent); opacity: 0; transition: opacity .2s; }
.ask-wrap.on { opacity: 1; }
.ask-box { width: min(540px, 100%); padding: 24px 24px 20px; text-align: center; background: var(--panel); color: var(--ink); border: 2px solid var(--edge); border-radius: 20px; box-shadow: 6px 6px 0 var(--edge); transform: translateY(14px) scale(.97) rotate(-.6deg); transition: transform .3s cubic-bezier(.3, 1.4, .5, 1); }
.ask-wrap.on .ask-box { transform: none; }
.ask-ic { font-size: 34px; line-height: 1; margin-bottom: 6px; }
.ask-box h3 { font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1.15; margin: 0 0 8px; }
.ask-box p { margin: 0 0 18px; font-size: 16px; line-height: 1.45; color: var(--ink2); }
.ask-acts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.ask-acts .nav-btn { min-width: 120px; justify-content: center; }
.ask-acts .nav-btn.danger { background: var(--bad-bg); color: var(--bad); }
@media (max-width: 480px) { .ask-acts .nav-btn { flex: 1 1 100%; } }
