/* Солнечная система — интерактивный урок. Стандартная палитра сайта (крем/зелёный). */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

:root {
  --green: #4a6b2a;
  --green-dark: #3a5520;
  --green-mid: #5a8835;
  --cream: #fffdf5;
  --cream-2: #f3f0e4;
  --border-gold: #b8862c;
  --border-soft: #b8a86c;
  --ink: #3a3320;
  --muted: #8a7a4a;
  --accent: #ea580c;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 24px 14px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: linear-gradient(180deg, var(--cream-2) 0%, #e7e0c8 100%);
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
}

.card {
  width: 100%;
  max-width: 760px;
  background: var(--cream);
  border: 1.5px solid var(--border-gold);
  border-radius: 14px;
  padding: 24px 22px 28px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

h1 { margin: 0 0 6px; color: var(--green); font-size: 28px; }
.subtitle { color: var(--muted); margin: 0 0 18px; font-size: 14.5px; line-height: 1.5; }

/* ---------- Переключатель режима ---------- */
.mode-switch { display: flex; gap: 8px; margin: 14px 0 6px; }
.mode-btn {
  border: 1.5px solid var(--border-soft); background: var(--cream-2); color: var(--ink);
  border-radius: 999px; padding: 10px 18px; font-size: 15px; font-weight: 700; cursor: pointer;
  font-family: inherit;
}
.mode-btn.on { background: var(--green); border-color: var(--green-dark); color: #fff; }
.mode-hint { font-size: 13px; color: var(--muted); margin: 6px 0 14px; }

/* ---------- Карта путешествия ---------- */
.map-title { font-size: 19px; margin: 22px 0 10px; color: var(--green); }
.map { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.stop {
  position: relative; border: 1.5px solid var(--border-soft); background: var(--cream-2);
  border-radius: 14px; padding: 10px 6px 8px; text-align: center; cursor: pointer; color: var(--ink);
  transition: transform .12s, border-color .12s, background .12s; font-family: inherit;
}
.stop:active { transform: scale(0.96); }
.stop:hover { border-color: var(--green-mid); background: #fff; }
.stop svg { width: 56px; height: 56px; display: block; margin: 0 auto; }
.stop-name { font-size: 13px; font-weight: 700; margin-top: 4px; display: block; }
.stop-done { position: absolute; top: -8px; right: -6px; font-size: 20px; }
.stop-rocket { position: absolute; top: -12px; left: -8px; width: 34px; height: 34px; transform: rotate(35deg); }
.stop-rocket svg { width: 34px; height: 34px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 12px; padding: 13px 22px; font-size: 16.5px; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: transform .12s, filter .12s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--green); color: #fff; box-shadow: 0 3px 10px rgba(74,107,42,.25); }
.btn-primary:hover { background: var(--green-mid); }
.btn-secondary { background: var(--cream-2); color: var(--ink); border: 1.5px solid var(--border-soft); }
.btn-secondary:hover { border-color: var(--green-mid); }
.btn-ghost { background: transparent; color: var(--green); border: 1.5px solid var(--border-soft); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 18px 0; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }

/* ---------- Секция заданий на главной ---------- */
.tasks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.task-card {
  border: 1.5px solid var(--border-soft); background: var(--cream-2); color: var(--ink); border-radius: 14px;
  padding: 14px 12px; text-align: left; cursor: pointer; font-family: inherit; font-size: 15px;
  display: flex; align-items: center; gap: 10px; transition: border-color .12s, transform .12s, background .12s;
}
.task-card:hover { border-color: var(--green-mid); background: #fff; }
.task-card:active { transform: scale(0.97); }
.task-emoji { font-size: 26px; }
.task-name { font-weight: 700; }
.task-sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.task-star { margin-left: auto; font-size: 18px; }

/* ---------- Экран главы ---------- */
.lesson-art { width: min(220px, 52vw); margin: 6px auto 4px; }
.lesson-art svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 4px 10px rgba(58,51,32,.18)); }
.lesson-title { text-align: center; font-size: 23px; margin: 6px 0 2px; color: var(--green); }
.lesson-progress { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 8px; }

.speak-bar { display: flex; justify-content: center; gap: 10px; margin: 12px 0; }
.lesson-text { font-size: 19px; line-height: 1.7; margin: 8px 2px; }
.lesson-text p { margin: 0 0 12px; }
.lesson-text p:last-child { margin-bottom: 0; }
.sent { border-radius: 6px; padding: 1px 2px; transition: background .15s; cursor: pointer; }
.sent.hl { background: #ffe08a; box-shadow: 0 0 0 3px #ffe08a; }

.stats-table { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 14px 0 4px; }
.stat-chip {
  background: var(--cream-2); border: 1.5px solid var(--border-soft); border-radius: 12px;
  padding: 7px 12px; font-size: 13.5px; color: var(--ink);
}
.stat-chip b { color: var(--green); }

/* мини-вопрос после главы */
.mini-quiz { margin-top: 18px; background: var(--cream-2); border: 2px dashed var(--border-soft); border-radius: 14px; padding: 16px; }
.mini-quiz h3 { margin: 0 0 12px; font-size: 18px; color: var(--green); }

/* ---------- Общий вид вопросов/вариантов ---------- */
.q-text { font-size: 20px; font-weight: 700; margin: 8px 0 14px; line-height: 1.4; }
.options { display: grid; gap: 10px; }
.opt {
  border: 1.5px solid var(--border-soft); background: #fff; color: var(--ink); border-radius: 12px;
  padding: 13px 16px; font-size: 18px; font-weight: 700; cursor: pointer; text-align: left;
  font-family: inherit; transition: border-color .12s, transform .1s;
}
.opt:hover { border-color: var(--green-mid); }
.opt:active { transform: scale(0.98); }
.opt.correct { background: #e4f0d5; border-color: var(--green-mid); }
.opt.wrong { background: #fbe3df; border-color: #d0654f; animation: shake .35s; }
.opt:disabled { cursor: default; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }

.feedback { text-align: center; font-size: 19px; font-weight: 700; min-height: 28px; margin: 12px 0; }
.feedback.good { color: var(--green); }
.feedback.bad { color: #b3392e; }

/* ---------- Задание «по порядку» ---------- */
.order-slots { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 14px 0; }
.slot {
  width: 72px; height: 92px; border: 2px dashed var(--border-soft); border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--cream-2); position: relative;
}
.slot .num { position: absolute; top: 3px; left: 7px; font-size: 12px; color: var(--muted); font-weight: 700; }
.slot svg { width: 46px; height: 46px; }
.slot.filled { border-style: solid; border-color: var(--green-mid); background: #fff; }
.slot .p-name { font-size: 10.5px; font-weight: 700; }
.pool { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 16px 0; min-height: 96px; }
.pool-item {
  border: 1.5px solid var(--border-soft); background: #fff; border-radius: 14px; cursor: pointer;
  padding: 6px 8px 4px; text-align: center; color: var(--ink); font-family: inherit;
  transition: transform .12s, border-color .12s;
}
.pool-item:hover { border-color: var(--green-mid); }
.pool-item:active { transform: scale(0.94); }
.pool-item svg { width: 52px; height: 52px; display: block; margin: 0 auto; }
.pool-item .p-name { font-size: 11px; font-weight: 700; }
.pool-item.hidden-item { visibility: hidden; }
.pool-item.wrong { border-color: #d0654f; background: #fbe3df; animation: shake .35s; }

/* ---------- «Пропавшая планета» и загадки: ряд планет ---------- */
.planet-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: flex-end; margin: 16px 0; }
.planet-cell { text-align: center; width: 68px; }
.planet-cell svg { width: 100%; height: auto; }
.planet-cell .p-name { font-size: 11px; font-weight: 700; margin-top: 2px; }
.planet-cell.mystery {
  width: 68px; height: 68px; border: 2px dashed var(--accent); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 30px; color: var(--accent);
  align-self: center;
}
.planet-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin: 14px 0; }
.planet-pick .pool-item svg { width: 58px; height: 58px; }

/* ---------- Прогресс-бар викторины ---------- */
.quiz-top { display: flex; align-items: center; gap: 10px; margin: 8px 0 14px; }
.qbar { flex: 1; height: 12px; background: var(--cream-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--border-soft); }
.qbar > div { height: 100%; background: linear-gradient(90deg, var(--green-mid), var(--green)); border-radius: 999px; transition: width .3s; }
.qcount { font-size: 14px; color: var(--muted); font-weight: 700; white-space: nowrap; }

/* ---------- Результат / диплом ---------- */
.result-box { text-align: center; padding: 20px 10px; }
.result-emoji { font-size: 64px; margin: 8px 0; }
.result-line { font-size: 20px; font-weight: 700; margin: 8px 0; color: var(--green-dark); }
.name-input {
  width: 100%; max-width: 340px; font-size: 20px; padding: 12px 16px; border-radius: 12px;
  border: 1.5px solid var(--border-soft); background: #fff; color: var(--ink); text-align: center; font-family: inherit;
}
.name-input::placeholder { color: #b9ac86; }

/* ---------- Печать: блок на главной ---------- */
.print-list { display: grid; gap: 8px; margin: 12px 0; }
.print-item {
  display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--border-soft); background: var(--cream-2);
  border-radius: 12px; padding: 12px 14px; color: var(--ink); cursor: pointer; font-family: inherit;
  font-size: 15px; text-align: left; transition: border-color .12s, background .12s;
}
.print-item:hover { border-color: var(--green-mid); background: #fff; }
.print-item .pi-emoji { font-size: 22px; }
.print-item b { display: block; }
.print-item span { font-size: 12.5px; color: var(--muted); }

.back-row { margin: 4px 0 14px; }

.hr { border: none; border-top: 1.5px solid #e0d8bd; margin: 26px 0 18px; }

/* ====================== ПЕЧАТЬ (A4) ====================== */
#printArea { display: none; }

@media print {
  body { background: #fff !important; display: block; padding: 0; }
  body.printing .card, body.printing .stars-bg,
  body.printing .rz-topbar, body.printing .rz-sidebar, body.printing .rz-backdrop,
  body.printing .rz-seo, body.printing .rz-related, body.printing .rz-footer,
  body.printing .rz-share, body.printing nav, body.printing footer { display: none !important; }
  body.printing #printArea { display: block; }
}

#printArea { color: #222; font-family: Georgia, "Times New Roman", serif; }
.sheet {
  width: 190mm; min-height: 250mm; margin: 0 auto; padding: 6mm 6mm 4mm;
  page-break-after: always; position: relative; background: #fff;
}
.sheet:last-child { page-break-after: auto; }
.sheet-head { text-align: center; margin-bottom: 5mm; }
.sheet-head h2 { font-size: 20px; margin: 0 0 2mm; }
.sheet-head p { font-size: 13px; margin: 0; color: #555; }
.sheet-foot { position: absolute; bottom: 4mm; left: 0; right: 0; text-align: center; font-size: 10px; color: #999; }

/* лист: раскраска (10 клеток должны умещаться на одной странице A4) */
.pr-color-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm 8mm; }
.pr-color-cell { text-align: center; border: 1px dashed #bbb; border-radius: 4mm; padding: 2mm 2mm 1mm; break-inside: avoid; page-break-inside: avoid; }
.pr-color-cell svg { width: 29mm; height: 29mm; }
.pr-color-cell .cap { font-size: 14px; font-weight: 700; letter-spacing: 1px; }

/* лист: по порядку */
.pr-order-row { display: flex; justify-content: space-between; align-items: flex-end; margin: 8mm 0 4mm; break-inside: avoid; page-break-inside: avoid; }
.pr-order-cell { text-align: center; width: 21mm; }
.pr-order-cell svg { width: 100%; height: auto; }
.pr-order-cell .box { width: 10mm; height: 10mm; border: 1.5px solid #333; border-radius: 2mm; margin: 2mm auto 0; }
.pr-order-cell .cap { font-size: 10px; margin-top: 1mm; }

/* лист: карточки */
.pr-cards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm; }
.pr-card { border: 1.5px dashed #999; border-radius: 3mm; padding: 3mm; display: flex; gap: 3mm; align-items: center; break-inside: avoid; page-break-inside: avoid; }
.pr-card svg { width: 22mm; height: 22mm; flex: none; }
.pr-card .t { font-size: 13px; }
.pr-card .t b { font-size: 15px; display: block; margin-bottom: 1mm; }

/* лист: впиши название */
.pr-write-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5mm 8mm; }
.pr-write-cell { display: flex; align-items: center; gap: 4mm; break-inside: avoid; page-break-inside: avoid; }
.pr-write-cell svg { width: 24mm; height: 24mm; flex: none; }
.pr-write-cell .line { flex: 1; border-bottom: 2px solid #333; height: 9mm; font-size: 12px; color: #aaa; }

/* лист: лабиринт */
.pr-maze { display: block; margin: 4mm auto; }

/* диплом */
.pr-diploma { border: 3mm solid #3949ab; border-radius: 6mm; text-align: center; padding: 14mm 10mm; min-height: 240mm; box-sizing: border-box; }
.pr-diploma .d-title { font-size: 34px; font-weight: 800; color: #283593; letter-spacing: 2px; margin: 4mm 0; }
.pr-diploma .d-sub { font-size: 16px; color: #555; }
.pr-diploma .d-name { font-size: 30px; font-weight: 800; margin: 8mm 0 2mm; border-bottom: 2px solid #999; display: inline-block; padding: 0 10mm 2mm; min-width: 60mm; }
.pr-diploma .d-text { font-size: 15px; line-height: 1.7; margin: 6mm auto; max-width: 140mm; }
.pr-diploma svg { width: 40mm; height: 40mm; }
.pr-diploma .d-planets svg { width: 12mm; height: 12mm; margin: 0 1mm; }

@media (max-width: 560px) {
  h1 { font-size: 23px; }
  .card { padding: 18px 14px 22px; }
  .lesson-text { font-size: 17.5px; }
  .slot { width: 62px; height: 84px; }
  .slot svg { width: 38px; height: 38px; }
  .planet-cell { width: 56px; }
  .planet-cell.mystery { width: 56px; height: 56px; }
}
