/* MARVEL EDUCATIONAL — крупно, контрастно, для 14–15 лет */
:root {
  --red: #E62429;
  --red-dark: #9B1116;
  --navy: #0D1117;
  --panel: #161B22;
  --blue: #1F4E8C;
  --gold: #F5C518;
  --cream: #FFF6E8;
  --paper: #FFFFFF;
  --ink: #141414;
  --muted: #4A4A4A;
  --ok: #1B7A3A;
  --ok-bg: #E7F7EC;
  --hint: #FFF3C4;
  --line: #D8D0C4;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--navy);
  color: var(--ink);
  font-family: "Nunito", "Trebuchet MS", "Segoe UI", sans-serif;
}

/* ========== СЛАЙДЫ ========== */
body.deck {
  height: 100vh;
  overflow: hidden;
  background: #0A0C10;
}

.slides { height: 100vh; }

.slide {
  display: none;
  height: 100vh;
  padding: 28px 48px 56px;
  background:
    linear-gradient(180deg, #FFFDF8 0%, var(--cream) 100%);
  position: relative;
  overflow: hidden;
}

.slide.active { display: flex; flex-direction: column; }

.slide::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 10px;
  background: linear-gradient(90deg, var(--red) 0 38%, var(--gold) 38% 52%, var(--blue) 52% 100%);
}

.slide.dark {
  background:
    radial-gradient(circle at 80% 10%, #3a1518 0%, transparent 40%),
    linear-gradient(160deg, #14080A 0%, #1A0C10 50%, #0D1117 100%);
  color: #FFF8EE;
}

.slide.check {
  background:
    linear-gradient(180deg, #E9F8EE 0%, #F7FFF9 100%);
}

.slide.task {
  background:
    linear-gradient(180deg, #FFF7D6 0%, #FFFCF0 100%);
}

.kicker {
  font-family: "Bangers", "Impact", "Arial Black", sans-serif;
  letter-spacing: 0.08em;
  color: var(--red);
  font-size: 1.35rem;
  margin: 8px 0 0;
}

.slide.dark .kicker { color: var(--gold); }

h1 {
  font-family: "Bangers", "Impact", "Arial Black", sans-serif;
  font-size: clamp(2.6rem, 5.4vw, 4.4rem);
  line-height: 1.05;
  margin: 6px 0 12px;
  letter-spacing: 0.03em;
}

h2 {
  font-family: "Bangers", "Impact", "Arial Black", sans-serif;
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  line-height: 1.1;
  margin: 4px 0 14px;
  letter-spacing: 0.03em;
}

h3 {
  font-size: 1.85rem;
  margin: 0 0 10px;
}

p, li { font-size: 1.7rem; line-height: 1.35; margin: 0 0 10px; }
ul, ol { margin: 0 0 8px 0.3em; padding-left: 1.2em; }

.lead { font-size: 1.9rem; max-width: 22ch; }

.row { display: flex; gap: 18px; align-items: stretch; flex: 1; min-height: 0; }
.row > * { flex: 1; }

.card {
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: 6px 6px 0 var(--ink);
}

.slide.dark .card {
  background: #221116;
  border-color: var(--gold);
  color: #FFF8EE;
  box-shadow: 6px 6px 0 #000;
}

.stamp {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-family: "Bangers", Impact, sans-serif;
  letter-spacing: 0.06em;
  padding: 4px 14px 2px;
  font-size: 1.5rem;
  transform: rotate(-2deg);
  border: 3px solid var(--ink);
}

.stamp.gold { background: var(--gold); color: var(--ink); }
.stamp.blue { background: var(--blue); }
.stamp.green { background: var(--ok); }

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 10px 12px 10px 64px;
  background: #fff;
  border: 3px solid var(--ink);
  margin-bottom: 8px;
  font-size: 1.55rem;
  line-height: 1.3;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 10px; top: 8px;
  width: 42px; height: 42px;
  background: var(--red);
  color: #fff;
  border: 3px solid var(--ink);
  font-family: "Bangers", Impact, sans-serif;
  font-size: 1.7rem;
  display: flex; align-items: center; justify-content: center;
}

.note {
  background: var(--hint);
  border: 3px dashed var(--ink);
  padding: 10px 14px;
  font-size: 1.45rem;
  font-weight: 800;
}

.timebox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--gold);
  font-weight: 900;
  font-size: 1.5rem;
  padding: 6px 14px;
  border-radius: 6px;
}

.latin {
  font-family: "Georgia", "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
}

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; flex: 1; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; flex: 1; }
.grid4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; }

.mini { font-size: 1.35rem; line-height: 1.3; }
.tiny { font-size: 1.2rem; }

.footer-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 44px;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 20;
  font-size: 1.05rem;
  font-weight: 800;
}
.footer-bar b { color: var(--gold); }

.nav-btn {
  background: var(--red);
  color: #fff;
  border: 2px solid #fff;
  font-weight: 900;
  font-size: 1rem;
  padding: 4px 12px;
  cursor: pointer;
}

.hidden-teacher {
  position: absolute;
  right: 16px;
  top: 16px;
  background: #111;
  color: #F5C518;
  font-size: 0.95rem;
  padding: 6px 10px;
  max-width: 280px;
  display: none;
  z-index: 5;
}
body.show-teacher .hidden-teacher { display: block; }

.badge {
  display: inline-block;
  border: 3px solid var(--ink);
  padding: 2px 10px;
  font-weight: 900;
  background: #fff;
}

.ok { color: var(--ok); font-weight: 900; }
.big-num {
  font-family: "Bangers", Impact, sans-serif;
  font-size: 3.2rem;
  color: var(--red);
  line-height: 1;
}

/* кривые */
.chart {
  background: #fff;
  border: 4px solid var(--ink);
  padding: 10px;
  height: 100%;
  min-height: 220px;
}
.chart svg { width: 100%; height: 220px; }

/* определитель / досье */
.dossier {
  border: 4px solid var(--ink);
  background: #fff;
  padding: 12px 14px;
}

/* светофор */
.lights { display: flex; gap: 14px; }
.light {
  flex: 1;
  border: 4px solid var(--ink);
  padding: 16px;
  font-size: 1.45rem;
  font-weight: 800;
  text-align: center;
}
.light.g { background: #B8F0C4; }
.light.y { background: #FFE58A; }
.light.r { background: #FFB4B4; }

/* ========== ПЕЧАТЬ / РАЗДАТКИ ========== */
body.handout {
  background: #f2f2f2;
  color: var(--ink);
}
.sheet {
  width: 210mm;
  min-height: 297mm;
  margin: 16px auto;
  background: #fff;
  padding: 14mm 14mm 16mm;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  border-top: 10px solid var(--red);
}
.sheet + .sheet { page-break-before: always; }
.sheet h1 {
  font-size: 1.8rem;
  margin: 0 0 6px;
}
.sheet h2 { font-size: 1.35rem; margin: 10px 0 6px; }
.sheet p, .sheet li { font-size: 1.05rem; line-height: 1.35; }
.meta {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-weight: 800; font-size: 1rem;
  margin-bottom: 8px;
}
.meta span {
  border: 2px solid var(--ink);
  padding: 3px 8px;
  background: var(--hint);
}
.line {
  border-bottom: 2px solid #bbb;
  min-height: 1.5em;
  margin: 6px 0;
}
.box {
  border: 2px solid var(--ink);
  padding: 8px 10px;
  margin: 8px 0;
}
table.q {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 12px;
}
table.q th, table.q td {
  border: 2px solid var(--ink);
  padding: 8px;
  font-size: 1.02rem;
  vertical-align: top;
}
table.q th { background: #111; color: #fff; }
.slide-ref {
  background: var(--red);
  color: #fff;
  font-weight: 900;
  padding: 8px 10px;
  margin: 0 0 10px;
  font-size: 1.05rem;
}
.no-print { margin: 12px auto; width: 210mm; max-width: 96%; font-family: Nunito, sans-serif; }
.print-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 16px auto;
  width: min(210mm, 96%);
}
.print-bar a, .print-bar button {
  font: inherit;
  font-weight: 900;
  font-size: 1.05rem;
  text-decoration: none;
  color: #fff;
  background: var(--red);
  border: 3px solid #111;
  padding: 10px 16px;
  cursor: pointer;
}
.print-bar a.ghost { background: #111; }
.hub {
  max-width: 920px;
  margin: 0 auto;
  padding: 28px 20px 60px;
  color: #fff;
  font-family: Nunito, sans-serif;
}
.hub h1 {
  font-family: Bangers, Impact, sans-serif;
  font-size: 3.2rem;
  letter-spacing: 0.04em;
  color: var(--gold);
}
.hub-grid { display: grid; gap: 16px; }
.hub-grid.three { grid-template-columns: 1fr; }
@media (min-width: 800px) { .hub-grid.three { grid-template-columns: 1fr 1fr 1fr; } }
.hub a.tile {
  display: block;
  background: #fff;
  color: #111;
  text-decoration: none;
  border: 5px solid #111;
  box-shadow: 8px 8px 0 var(--red);
  padding: 20px 18px;
  font-weight: 800;
}
.hub a.tile h2 { font-family: Bangers, Impact, sans-serif; font-size: 2rem; margin: 0 0 8px; letter-spacing: 0.04em; }
.hub a.tile p { margin: 0; font-size: 1.1rem; }
@media print {
  body.handout { background: #fff; }
  .sheet { box-shadow: none; margin: 0; width: auto; }
  .no-print, .print-bar { display: none !important; }
  .slide { page-break-after: always; }
}

.fill-3 .line { min-height: 2em; }

/* ========== ИГРА-АЛГОРИТМ НА ДОСКЕ ========== */
.algo { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.algo-panel { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.algo-panel.hidden { display: none !important; }
.algo-start {
  margin-top: auto;
  font-family: "Bangers", Impact, sans-serif;
  font-size: 4rem;
  letter-spacing: 0.08em;
  line-height: 1;
  padding: 22px 20px 16px;
  border: 6px solid var(--ink);
  background: var(--red);
  color: #fff;
  cursor: pointer;
  box-shadow: 10px 10px 0 #111;
}
.algo-start:active { transform: translate(3px, 3px); box-shadow: 4px 4px 0 #111; }
.algo-player {
  font-family: "Bangers", Impact, sans-serif;
  font-size: 1.8rem;
  letter-spacing: 0.05em;
  color: var(--red);
  margin: 0 0 6px;
}
.algo-clue {
  background: #111;
  color: var(--gold);
  border: 4px solid var(--gold);
  padding: 10px 14px;
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 10px;
}
.algo-path {
  font-size: 1.35rem;
  font-weight: 900;
  min-height: 1.6em;
  margin-bottom: 8px;
}
.algo-q {
  flex: 1;
  background: #fff;
  border: 5px solid var(--ink);
  box-shadow: 8px 8px 0 var(--red);
  padding: 22px 24px;
  font-size: 2.1rem;
  font-weight: 900;
  line-height: 1.25;
  display: flex;
  align-items: center;
}
.algo-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
}
.algo-yes, .algo-no, .algo-again {
  font-family: "Bangers", Impact, sans-serif;
  font-size: 3rem;
  letter-spacing: 0.06em;
  border: 5px solid var(--ink);
  padding: 12px 10px 6px;
  cursor: pointer;
  color: #fff;
}
.algo-yes { background: var(--ok); }
.algo-no { background: var(--red); }
.algo-again { background: var(--blue); font-size: 2rem; width: 100%; margin-top: 10px; }
.algo-end {
  background: var(--ok-bg);
  border: 5px solid var(--ink);
  padding: 18px 20px;
  flex: 1;
}
.algo-end h3 { font-size: 2.6rem; margin: 0 0 8px; }
.hidden { display: none !important; }
.tree-map { font-size: 1.35rem; line-height: 1.45; }

.hero-pic {
  width: 108px; height: 108px;
  object-fit: cover;
  border: 4px solid var(--ink);
  border-radius: 8px;
  flex-shrink: 0;
}
.slide.dark .hero-pic { border-color: var(--gold); }
.hero-strip { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.hero-strip img {
  width: 92px; height: 92px;
  object-fit: cover;
  border: 4px solid var(--gold);
  border-radius: 8px;
}
.card-hero { display: flex; gap: 10px; align-items: flex-start; }
.card-hero .hero-pic { width: 84px; height: 84px; }

.match-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex: 1; min-height: 0; }
.match-col { display: flex; flex-direction: column; gap: 8px; }
.match-btn {
  font: inherit;
  font-size: 1.25rem;
  font-weight: 800;
  text-align: left;
  line-height: 1.25;
  padding: 10px 12px;
  border: 4px solid var(--ink);
  background: #fff;
  cursor: pointer;
}
.match-btn.on { outline: 5px solid var(--gold); background: #fff6cc; }
.match-btn.ok { background: #d8f5df; border-color: var(--ok); }
.match-btn.bad { background: #ffc9c9; }
.match-score { font-weight: 900; font-size: 1.4rem; margin: 6px 0; }
