/* Страница «Комикс» в дизайне сайта НЕУРОК: бумага, чернила, бирюза, рукописные акценты.
   Только светлая тема, как на основном сайте. */
:root {
  --paper: #F7F3EA;
  --card: #FFFDF8;
  --ink: #1F2A44;
  --muted: #4A5266;
  --line: #C9C2B2;
  --teal: #2E6F6A;
  --teal-dark: #1F4F4B;
  --teal-soft: #CFE3DF;
  --hatch-a: #5FA59B;
  --hatch-b: #86C0B6;
  --sand: #F2D9A0;
  --peach: #F1C6B8;
  --r: 16px 12px 18px 12px;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --hand: 'Caveat', cursive;
  --sans: 'Golos Text', system-ui, sans-serif;
  /* имена, которые использует код страницы */
  --accent: var(--sand);
  --accent-ink: var(--ink);
  --panel: var(--card);
  --lock: #EEE8DA;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5;
  padding: 20px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px)); overflow-x: hidden; }
@media (min-width: 600px) { body { background: linear-gradient(90deg, #EFE9DB 0, var(--paper) 18%, var(--paper) 82%, #EFE9DB 100%); } }
.wrap { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; min-width: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; margin: 0; line-height: 1.1; text-wrap: balance; }
p { margin: 0; }
a { color: var(--teal); text-underline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
svg, img { max-width: 100%; }

/* Шапка */
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.logo img { width: 56px; height: 63px; object-fit: contain; }
.logo span { font-family: var(--serif); font-weight: 700; font-size: 22px; letter-spacing: 3px; }
.top small { font-family: var(--hand); font-size: 19px; color: var(--teal); text-align: right; max-width: 150px; line-height: 1.1; text-wrap: balance; }

/* Карточки-блоки */
.panel { position: relative; background: var(--card); border: 1.5px solid var(--ink); border-radius: 20px 14px 22px 12px;
  box-shadow: 4px 5px 0 var(--teal); padding: 22px 20px; animation: unfold .35s; }
.cap, .show .cap, .hero .cap { display: inline-block; padding: 4px 10px; border: 1px solid var(--ink); border-radius: 14px 10px 14px 10px;
  font-size: 13px; background: var(--paper); color: var(--ink); }
.hero h1 { font-size: clamp(36px, 10vw, 46px); line-height: .98; margin: 14px 0 10px; }
.hero p { font-size: 16px; }
.show { background: var(--teal-soft); }
.show h2 { font-size: clamp(30px, 8vw, 36px); margin: 12px 0 8px; }
.show .cap { background: var(--card); }

/* Кнопки как на основном сайте */
.btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 10px 20px;
  border: 1.5px solid var(--teal); border-radius: 16px 12px 18px 12px; background: var(--teal); color: var(--card);
  font-size: 17px; font-weight: 600; line-height: 1.2; text-align: center; box-shadow: 0 3px 0 var(--teal-dark);
  transition: transform .15s, box-shadow .15s, background .2s; max-width: 100%; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--teal-dark); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--teal-dark); }
.btn.alt { background: transparent; color: var(--teal); box-shadow: none; min-height: 48px; font-size: 16px; }
.btn.alt:hover { background: var(--teal-soft); transform: none; }
.btn.ghost { align-self: flex-start; min-height: 40px; padding: 6px 2px; border: 0; background: none; box-shadow: none; color: var(--teal);
  font-size: 16px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.btn.ghost:hover { transform: none; color: var(--teal-dark); }

/* Пара «ты + взрослый» */
.duo { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; text-align: center; }
.duo .who { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.duo .who b { font-size: 15px; }
.duo .who span { font-size: 13px; color: var(--muted); }
.plus { font-family: var(--hand); font-size: 36px; font-weight: 700; color: var(--teal); }
.duo-note { margin-top: 14px; font-size: 14px; text-align: center; color: var(--muted); }
.duo-note.ready { color: var(--teal); font-family: var(--hand); font-size: 22px; font-weight: 700; }

/* Медальоны героев */
.medal { width: 96px; height: 96px; color: var(--ink); }
.medal.big { width: 132px; height: 132px; }

/* Советы героев */
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sec-h h2 { font-family: var(--hand); font-size: 32px; color: var(--teal); }
.tabs { display: flex; gap: 8px; }
.tabs button { flex: 1; min-height: 44px; padding: 8px 10px; border: 1.5px solid var(--teal); border-radius: 20px 16px 20px 14px;
  background: transparent; color: var(--teal); font-weight: 600; font-size: 15px; transition: background .2s, color .2s; }
.tabs button[aria-selected="true"] { background: var(--teal); color: var(--card); }
.cards { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.card { background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--r); overflow: hidden; }
.card summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; }
.card summary::-webkit-details-marker { display: none; }
.card .ini { width: 48px; height: 48px; border: 1.5px solid var(--ink); border-radius: 50%; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 18px; background: var(--sand); color: var(--ink); }
.card .t { min-width: 0; }
.card .t b { display: block; font-size: 15px; font-weight: 600; line-height: 1.3; }
.card .t span { font-size: 13px; color: var(--muted); }
.card .arr { font-family: var(--hand); font-size: 30px; font-weight: 700; color: var(--teal); line-height: 1; transition: transform .2s; }
.card[open] .arr { transform: rotate(45deg); }
.card .body { padding: 0 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.say { font-family: var(--hand); font-size: 21px; line-height: 1.3; border: 1.5px solid var(--ink); border-radius: 18px 14px 20px 12px;
  padding: 12px 14px; background: var(--paper); }
.say ul { margin: 6px 0 0; padding-left: 20px; }
.say li { margin: 4px 0; }
.src { font-size: 12.5px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 8px; }
.src b { color: var(--ink); font-weight: 600; }

/* Тест */
.quiz-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; }
.quiz-top span { font-family: var(--hand); font-size: 22px; font-weight: 700; color: var(--teal); }
.bar { height: 14px; margin-top: 8px; border: 1.5px solid var(--ink); border-radius: 12px 8px 14px 9px; overflow: hidden; background: var(--card); }
.bar i { display: block; height: 100%; background: repeating-linear-gradient(-45deg, var(--hatch-a) 0 6px, var(--hatch-b) 6px 12px); transition: width .3s; }
.q { position: relative; margin-bottom: 14px; padding: 16px 18px; font-family: var(--hand); font-size: clamp(24px, 6.4vw, 29px); font-weight: 700; line-height: 1.2;
  background: var(--card); border: 1.5px solid var(--ink); border-radius: 22px 16px 24px 14px; animation: unfold .3s; }
.q::after { content: ''; position: absolute; left: 34px; bottom: -9px; width: 16px; height: 16px; background: var(--card);
  border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); transform: rotate(45deg); }
.opts { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.opt { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 13px 14px; font-size: 16px; line-height: 1.35;
  background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--r); transition: background .15s, transform .15s; }
.opt .k { flex: none; width: 28px; height: 28px; border: 1.5px solid var(--teal); border-radius: 50%; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 16px; color: var(--teal); }
.opt:hover { background: var(--teal-soft); }
.opt:active { transform: scale(.99); }
.opt.ok { background: var(--teal-soft); border-color: var(--teal); }
.opt.ok .k { background: var(--teal); color: var(--card); }
.opt.no { text-decoration: line-through; opacity: .55; }
.opt[disabled] { cursor: default; color: inherit; }
.opt[disabled]:hover { background: var(--card); }
.opt.ok[disabled]:hover { background: var(--teal-soft); }
.who-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 14px; }
.explain { margin-top: 12px; padding: 14px 16px; font-size: 15px; background: var(--teal-soft); border: 1.5px solid var(--ink); border-radius: var(--r); animation: unfold .3s; }
.explain b { display: block; margin-bottom: 2px; font-family: var(--hand); font-size: 24px; color: var(--teal); }

/* Результат */
.res { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.res .lbl { font-family: var(--hand); font-size: 22px; font-weight: 700; color: var(--teal); }
.res h2 { font-size: clamp(34px, 9vw, 42px); }
.res .as { font-family: var(--serif); font-weight: 600; font-size: 24px; }
.res .txt { text-align: left; display: flex; flex-direction: column; gap: 12px; width: 100%; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; width: 100%; padding-top: 12px; font-size: 15px; text-align: left; border-top: 1px dashed var(--line); }
.kv dt { font-weight: 600; }
.kv dd { margin: 0; min-width: 0; }
.fact { width: 100%; padding: 12px 14px; font-size: 14.5px; text-align: left; background: var(--teal-soft); border-left: 4px solid var(--teal); border-radius: 4px 12px 12px 4px; }
.score { font-family: var(--serif); font-size: 52px; font-weight: 700; line-height: 1; }

/* Общая история */
.pair-pics { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.pair-pics figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.pair-pics figure b { font-size: 15px; color: var(--ink); }
.pair-pics .amp { font-family: var(--hand); font-size: 40px; font-weight: 700; color: var(--teal); }
.pair h2 { font-size: clamp(28px, 7.5vw, 34px); text-align: center; }
.pair .story { display: flex; flex-direction: column; gap: 12px; }
.pair .story p { font-size: 16px; }
.task { padding: 14px 16px; background: var(--sand); border: 1.5px solid var(--ink); border-radius: var(--r); }
.task b { display: block; margin-bottom: 4px; font-family: var(--hand); font-size: 22px; }
.hint { font-size: 13px; color: var(--muted); text-align: center; }

/* Мультик */
.film { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; width: 100%; overflow: hidden;
  background: var(--ink); color: var(--card); border: 1.5px solid var(--ink); border-radius: 20px 14px 22px 12px; box-shadow: 4px 5px 0 var(--teal); }
.film::before { content: ''; position: absolute; inset: 0; opacity: .35;
  background: repeating-linear-gradient(-45deg, var(--hatch-a) 0 6px, transparent 6px 18px); animation: drift 6s linear infinite; }
.film .play { position: relative; width: 74px; height: 74px; border-radius: 50%; background: var(--sand); display: grid; place-items: center; border: 2px solid var(--card); }
.film .play::after { content: ''; margin-left: 6px; border-left: 24px solid var(--ink); border-top: 15px solid transparent; border-bottom: 15px solid transparent; }
.film figcaption { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; font-family: var(--hand); font-size: 22px; font-weight: 700; }
.film-video::before { display: none; }
.film video, .film iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
@keyframes drift { to { background-position: 25px 0; } }

/* Подвал и сообщение */
.foot { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; font-size: 12.5px; color: var(--muted); border-top: 1px dashed var(--line); }
.foot ul { margin: 0; padding-left: 18px; }
.toast { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 10;
  max-width: calc(100% - 32px); padding: 12px 16px; font-size: 14px; background: var(--ink); color: var(--card); border-radius: 12px; box-shadow: 0 8px 24px rgba(31,42,68,.25); }
.toast[hidden] { display: none; }

@keyframes unfold { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Портреты героев в кружках */
.hero-pic { display: inline-block; flex: none; border: 2px solid var(--ink); border-radius: 50%; overflow: hidden; background: var(--sand);
  box-shadow: 3px 3px 0 var(--teal); }
.hero-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card .ini { overflow: hidden; padding: 0; }
.card .ini img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Узкие экраны и крупный шрифт: длинные слова переносятся */
h1, h2, .q, .opt, .card .t b, .say, .res .txt, .pair .story, .task, .fact, .explain { overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }

/* Блок 3D/AR-игры */
.game { background: var(--sand); overflow: hidden; }
.game .cap { background: var(--card); }
.game h2 { font-size: clamp(30px, 8vw, 36px); margin: 12px 0 8px; }
.game-pic { display: flex; justify-content: center; margin: -6px 0 10px; }
.game-pic img { width: 190px; height: auto; filter: drop-shadow(5px 6px 0 rgba(31,42,68,.18)); }
.game .btn { text-decoration: none; }
.game-note { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
@media (min-width: 480px) {
  .game { display: grid; grid-template-columns: 1fr 150px; column-gap: 14px; }
  .game > * { grid-column: 1; }
  .game > .cap { justify-self: start; }
  .game-pic { grid-column: 2; grid-row: 1 / span 5; align-items: center; margin: 0; }
  .game-pic img { width: 150px; }
}

/* Карта открытий */
.map h1 { font-size: clamp(34px, 9vw, 42px); line-height: 1; margin: 12px 0 8px; }
.map > p { font-size: 15.5px; }
.steps { list-style: none; margin: 18px 0 0; padding: 0; position: relative; display: flex; flex-direction: column; gap: 12px; }
.steps::before { content: ''; position: absolute; left: 19px; top: 20px; bottom: 20px; border-left: 2px dashed var(--line); }
.step { position: relative; display: flex; gap: 12px; align-items: flex-start; }
.step .dot { flex: none; position: relative; z-index: 1; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--ink); background: var(--card); font-weight: 700; font-size: 17px; }
.step.done .dot { background: var(--teal); color: var(--card); border-color: var(--teal); }
.step.lock .dot { background: var(--lock); font-size: 15px; }
.step.cur .dot { background: var(--sand); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(46, 111, 106, .45); } 50% { box-shadow: 0 0 0 9px rgba(46, 111, 106, 0); } }
.sbody { flex: 1; min-width: 0; padding: 8px 12px 10px; border: 1.5px solid var(--line); border-radius: 14px 10px 16px 10px; background: var(--card); }
.step.cur .sbody { border-color: var(--ink); box-shadow: 3px 4px 0 var(--teal); }
.step.lock .sbody { background: transparent; border-style: dashed; }
.step.lock .sbody b, .step.lock .sd { color: #8b8f99; }
.sbody > b { display: block; font-size: 17px; line-height: 1.25; }
.sd { display: block; font-size: 14px; line-height: 1.4; color: var(--muted); margin-top: 3px; }
.sbody .btns { margin-top: 10px; }
.sbody .btn { min-height: 46px; font-size: 16px; text-decoration: none; }
.lockmsg { margin: 6px 0 0; font-size: 13px; color: #8b8f99; }
.duo.mini { margin-top: 10px; }
.duo.mini .medal, .duo.mini .hero-pic { width: 56px; height: 56px; }
.game-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.game-row img { width: 74px; height: auto; flex: none; filter: drop-shadow(3px 4px 0 rgba(31, 42, 68, .18)); }
.game-row .btns { margin-top: 0; }
.unlock { position: fixed; inset: 0; z-index: 90; background: rgba(31, 42, 68, .45); display: grid; place-items: center; padding: 18px; animation: unfold .25s; }
.unlock-in { width: min(400px, 100%); background: var(--card); border: 2px solid var(--ink); border-radius: 22px 14px 24px 14px; box-shadow: 5px 6px 0 var(--teal); padding: 20px 18px; text-align: center; animation: popin .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes popin { from { transform: scale(.5); opacity: 0; } }
.ul-praise { font-family: var(--hand); font-size: 40px; color: var(--teal); line-height: 1; margin-top: 8px; }
.ul-key { font-size: 44px; margin: 6px 0 2px; animation: wiggle .8s ease-in-out 2; }
@keyframes wiggle { 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }
.unlock-in h2 { font-size: 28px; margin: 4px 0 6px; }
.unlock-in p { margin: 0; color: var(--muted); }
.confetti { position: fixed; inset: 0; z-index: 95; pointer-events: none; }

/* Компьютер: шире, советы в две колонки */
@media (min-width: 1000px) {
  body { background: var(--paper); padding-top: 32px; }
  .wrap { max-width: 920px; gap: 28px; }
  .hero h1 { font-size: 60px; }
  .map h1 { font-size: 52px; }
  .steps { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; }
  .steps::before { display: none; }
  .cards { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .panel { padding: 30px 32px; }
}
