/*
  Hellada Live — «краснофигурная ваза»: чёрный лак, терракота, кремовый,
  меандр по краям. Alegreya SC для заголовков, Commissioner для интерфейса.
  Оба шрифта знают кириллицу, польские буквы и греческий.
*/
:root {
  --bg: #120e0b;
  --bg-2: #18120e;
  --surface: #201813;
  --surface-2: #2a2019;
  --surface-3: #352920;
  --line: rgba(244, 232, 211, 0.12);
  --line-2: rgba(244, 232, 211, 0.24);
  --clay: #d4703a;
  --clay-hi: #f08e55;
  --clay-lo: #9b4a22;
  --clay-ink: #1b0f08;
  --cream: #f4e8d3;
  --cream-2: rgba(244, 232, 211, 0.78);
  --cream-3: rgba(244, 232, 211, 0.55);
  --aegean: #6fa9ec;
  --olive: #a9c86e;
  --olive-bg: rgba(169, 200, 110, 0.14);
  --wine: #f07081;
  --wine-bg: rgba(240, 112, 129, 0.14);
  --gold: #ecc66b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 26px 60px -28px rgba(0, 0, 0, 0.85);
  --font-display: "Alegreya SC", "Alegreya", Georgia, serif;
  --font-serif: "Alegreya", Georgia, serif;
  --font-ui: "Commissioner", "Segoe UI", system-ui, sans-serif;
  --meander: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'%3E%3Cpath d='M0 1.5H22M0 20.5H22M4 20.5V5.5H17.5V16.5H8.5V9.5H13' fill='none' stroke='%23d4703a' stroke-width='2.2'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--cream);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.5;
  background:
    radial-gradient(1200px 700px at 85% -10%, rgba(212, 112, 58, 0.16), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(111, 169, 236, 0.07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
img, svg, canvas { display: block; }
:focus-visible { outline: 3px solid var(--aegean); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(212, 112, 58, 0.45); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- верхняя панель ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(18, 14, 11, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.topbar-in {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 10px 24px;
}
.meander {
  height: 11px;
  background: var(--meander) repeat-x left center / 11px 11px;
  opacity: 0.85;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  color: var(--cream);
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-name { display: block; font-family: var(--font-display); font-weight: 800; font-size: 1.45rem; line-height: 1; letter-spacing: 0.02em; }
.brand-sub { display: block; margin-top: 3px; font-size: 0.78rem; color: var(--cream-3); letter-spacing: 0.08em; text-transform: uppercase; }
.nav { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-2); }
.nav button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--cream-2);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.nav button svg { width: 18px; height: 18px; }
.nav button:hover { color: var(--cream); background: var(--surface-2); }
.nav button[aria-current="page"] { color: var(--clay-ink); background: var(--clay); }
.tools { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  min-width: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--cream);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { border-color: var(--clay); }
.icon-btn[aria-pressed="false"] { color: var(--cream-3); }
.lang { display: inline-flex; padding: 3px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--bg-2); }
.lang button {
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--cream-2);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--cream); color: var(--clay-ink); }
.student-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px 0 6px;
  border-radius: 999px;
  background: rgba(212, 112, 58, 0.16);
  border: 1px solid rgba(212, 112, 58, 0.55);
  font-size: 0.9rem;
  white-space: nowrap;
}
.student-chip .avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--clay);
  color: var(--clay-ink);
  font-family: var(--font-display);
  font-weight: 800;
}
.student-chip span { color: var(--cream-3); }
.student-chip b { color: var(--cream); }

/* ---------- страница ---------- */
.page {
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 24px 56px;
}
.page.enter { animation: enter 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes enter { from { opacity: 0; transform: translateY(12px); } }
.kicker {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--clay-hi);
}
h1, h2, h3 { margin: 0; font-weight: 800; }
.display {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5.6vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: 0.01em;
  text-wrap: balance;
}
.lead { margin: 0; color: var(--cream-2); font-size: 1.08rem; max-width: 46ch; }
.muted { color: var(--cream-3); }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 20px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--cream);
  font-weight: 650;
  font-size: 1rem;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:hover:not(:disabled) { background: var(--surface-3); border-color: rgba(244, 232, 211, 0.4); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { cursor: default; opacity: 0.5; }
.btn-primary {
  border-color: transparent;
  background: linear-gradient(180deg, var(--clay-hi), var(--clay));
  color: var(--clay-ink);
  font-weight: 800;
  box-shadow: 0 12px 28px -14px rgba(240, 142, 85, 0.9), inset 0 1px 0 rgba(255, 220, 190, 0.6);
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #ffa36e, var(--clay-hi)); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-lg { min-height: 58px; padding: 14px 26px; font-size: 1.12rem; border-radius: 14px; }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 0.9rem; border-radius: 10px; }
.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 2px;
  border: 0;
  background: none;
  color: var(--cream-2);
  font-weight: 600;
  cursor: pointer;
}
.btn-link svg { width: 18px; height: 18px; }
.btn-link:hover { color: var(--cream); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* ---------- панели ---------- */
.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  box-shadow: var(--shadow);
}
.panel-pad { padding: 22px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(111, 169, 236, 0.13);
  color: #a9cbf3;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-done {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--olive-bg);
  color: var(--olive);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-done svg { width: 14px; height: 14px; }

/* ---------- главный экран с колесом ---------- */
.home {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(340px, 620px);
  align-items: center;
  gap: 40px;
}
.home-copy { display: grid; gap: 22px; align-content: center; }
.home-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.home-actions .btn-lg { min-width: 220px; }
.pick-note { display: block; font-size: 0.78rem; font-weight: 600; opacity: 0.7; }
.progress { display: grid; gap: 10px; max-width: 420px; }
.progress-top { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
.progress-top span:last-child { color: var(--cream-3); font-size: 0.9rem; }
.progress-bar { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; }
.progress-bar i { height: 10px; border-radius: 3px; background: var(--surface-3); }
.progress-bar i.on { background: linear-gradient(180deg, var(--clay-hi), var(--clay)); box-shadow: 0 0 10px rgba(240, 142, 85, 0.45); }
.wheel-box { position: relative; width: min(100%, 620px); margin: 0 auto; aspect-ratio: 1; }
.wheel-box canvas { width: 100%; height: 100%; }
.wheel-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--clay-ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1rem, 2.4vw, 1.6rem);
  cursor: pointer;
}
.wheel-hub:disabled { cursor: default; }
.wheel-hub:focus-visible { outline-offset: 6px; border-radius: 50%; }
.landed {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 10px 18px 10px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  width: fit-content;
  max-width: 100%;
}
.landed[hidden] { display: none; }
.landed .roundel { width: 44px; height: 44px; }
.landed small { display: block; color: var(--cream-3); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.landed b { display: block; font-family: var(--font-display); font-size: 1.45rem; line-height: 1.1; }
.home-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); }
.keys { margin: 0; color: var(--cream-3); font-size: 0.86rem; }

/* медальон с иконкой игры */
.roundel {
  display: grid;
  place-items: center;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  color: var(--clay-ink);
  background: radial-gradient(circle at 35% 30%, #ffb27f, var(--clay) 60%, var(--clay-lo));
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px rgba(212, 112, 58, 0.6);
}
.roundel svg { width: 56%; height: 56%; }

/* ---------- все игры ---------- */
.menu-head { display: grid; gap: 12px; margin-bottom: 28px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-3px); border-color: rgba(212, 112, 58, 0.6); box-shadow: 0 22px 40px -24px rgba(212, 112, 58, 0.55); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-num { font-family: var(--font-display); font-size: 1.1rem; color: var(--cream-3); }
.card h3 { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.1; }
.card p { margin: 0; color: var(--cream-2); font-size: 0.97rem; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.card-go { display: inline-flex; align-items: center; gap: 6px; color: var(--clay-hi); font-weight: 700; }
.card-go svg { width: 18px; height: 18px; }
.card.is-done { border-color: rgba(169, 200, 110, 0.35); }

/* ---------- экран игры ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 14px; }
.game-title { display: flex; align-items: center; gap: 18px; }
.game-title .roundel { width: 64px; height: 64px; }
.game-title h1 { font-family: var(--font-display); font-size: clamp(2rem, 4.4vw, 3.2rem); line-height: 1; text-wrap: balance; }
.game-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.game-grid {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  align-items: start;
  gap: 24px;
  margin-top: 24px;
}
.task { position: sticky; top: 90px; display: grid; gap: 14px; padding: 20px; }
.task h2 { font-family: var(--font-display); font-size: 1.35rem; }
.steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { position: relative; padding-left: 40px; color: var(--cream-2); counter-increment: step; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -1px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--cream);
  font-weight: 800;
  font-size: 0.9rem;
}
.steps li.is-now { color: var(--cream); }
.steps li.is-now::before { background: var(--clay); color: var(--clay-ink); }
.steps li.is-done::before { content: "✓"; background: var(--olive); color: #10200a; }
.hint-box { margin: 0; padding: 12px 14px; border-left: 3px solid var(--aegean); border-radius: 0 10px 10px 0; background: rgba(111, 169, 236, 0.09); color: var(--cream-2); font-size: 0.95rem; }
.hint-box[hidden] { display: none; }
.stage { display: grid; gap: 16px; min-width: 0; }
.stage-panel { padding: 14px; overflow: hidden; }
.stage-panel > svg, .stage-panel > canvas { width: 100%; height: auto; }
.feedback {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  margin: 0;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--cream-2);
  font-weight: 600;
  font-size: 1.05rem;
}
.feedback:empty { visibility: hidden; }
.feedback svg { width: 22px; height: 22px; flex: none; }
.feedback.ok { border-color: rgba(169, 200, 110, 0.5); background: var(--olive-bg); color: #d6eab3; }
.feedback.bad { border-color: rgba(240, 112, 129, 0.5); background: var(--wine-bg); color: #ffc4cc; }
.feedback.info { border-color: rgba(111, 169, 236, 0.45); background: rgba(111, 169, 236, 0.1); color: #cfe2fa; }
.feedback.pop { animation: pop 0.35s ease; }
@keyframes pop { 40% { transform: scale(1.02); } }
.shake { animation: shake 0.42s ease; }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.question { margin: 0; font-size: 1.2rem; font-weight: 700; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.choice {
  min-height: 56px;
  padding: 12px 16px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--surface-2);
  font-weight: 650;
  font-size: 1.02rem;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.choice:hover:not(:disabled) { border-color: var(--clay); background: var(--surface-3); }
.choice:disabled { cursor: default; }
.choice.is-right { border-color: var(--olive); background: var(--olive-bg); }
.choice.is-wrong { border-color: var(--wine); background: var(--wine-bg); }
.choices.wide { grid-template-columns: 1fr; }

/* ---------- победа и справка ---------- */
.win {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 26px;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(169, 200, 110, 0.18), rgba(169, 200, 110, 0.04));
  border: 1px solid rgba(169, 200, 110, 0.45);
  animation: enter 0.5s ease both;
}
.win svg { width: 54px; height: 54px; flex: none; color: var(--olive); }
.win b { display: block; font-family: var(--font-display); font-size: 1.6rem; line-height: 1.1; }
.explain { margin-top: 18px; padding: 28px 30px 30px; overflow: hidden; animation: enter 0.55s ease both; }
.explain::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 11px;
  background: var(--meander) repeat-x left center / 11px 11px;
  opacity: 0.7;
}
.explain-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.explain h2 { margin-top: 6px; font-family: var(--font-display); font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
.note { margin: 14px 0 0; padding: 12px 16px; border-radius: 12px; background: rgba(212, 112, 58, 0.12); color: var(--cream); font-weight: 600; }
.paras { margin-top: 16px; }
.para { margin: 0 0 14px; max-width: 70ch; font-family: var(--font-serif); font-size: 1.3rem; line-height: 1.6; }
.paras .para:first-child::first-letter { float: left; margin: 0.06em 0.12em 0 0; font-family: var(--font-display); font-size: 3.3em; line-height: 0.82; color: var(--clay-hi); }
.speech-wait { opacity: 0.18; }
.speech-on { opacity: 1; transition: opacity 0.12s linear; }
.explain-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }

/* ---------- рулетка учеников ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(8, 6, 4, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade 0.25s ease both;
}
@keyframes fade { from { opacity: 0; } }
.dialog {
  position: relative;
  width: min(100%, 460px);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 26px 24px 20px;
  text-align: center;
  border-radius: 22px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, var(--surface-2), var(--bg-2));
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.7);
  animation: rise 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(0.97); } }
.dialog h2 { margin-top: 6px; font-family: var(--font-display); font-size: 2.1rem; }
.student-stage { position: relative; width: min(78vw, 320px); margin: 16px auto 0; }
.student-stage svg { width: 100%; height: auto; }
.student-result { display: grid; place-items: center; min-height: 72px; margin-top: 10px; }
.student-result small { color: var(--cream-3); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.student-result b { font-family: var(--font-display); font-size: 2.3rem; line-height: 1.05; color: var(--clay-hi); animation: rise 0.45s ease both; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }
.dialog-close { position: absolute; top: 12px; right: 12px; }

/* ---------- общие детали схем ---------- */
.svg-label { fill: var(--cream); font-family: var(--font-ui); font-weight: 700; }
.svg-muted { fill: var(--cream-3); font-family: var(--font-ui); }
.svg-serif { font-family: var(--font-display); font-weight: 800; }
.tiles { display: flex; flex-wrap: wrap; gap: 10px; }
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 112px;
  padding: 10px 14px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--surface-2);
  font-weight: 650;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.tile:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--clay); }
.tile.is-on { border-color: var(--clay-hi); background: rgba(212, 112, 58, 0.2); box-shadow: 0 0 0 3px rgba(240, 142, 85, 0.25); }
.tile:disabled { cursor: default; opacity: 0.45; }
.tile svg { width: 64px; height: 64px; }

/* карта */
.map-svg { width: 100%; height: auto; border-radius: 12px; }
.region { cursor: pointer; fill: #5a4636; stroke: rgba(244, 232, 211, 0.55); stroke-width: 1.2; transition: fill 0.15s ease; }
.region:hover, .region:focus-visible { fill: #7a5c43; outline: none; }
.region.is-good { fill: var(--clay); stroke: #ffd3b4; }
.region.is-bad { fill: #8b3a46; }
.region-hit { fill: transparent; cursor: pointer; }
.map-label { pointer-events: none; font-family: var(--font-ui); font-weight: 750; font-size: 15px; fill: var(--cream); paint-order: stroke; stroke: rgba(18, 14, 11, 0.85); stroke-width: 4px; stroke-linejoin: round; }
.map-sea { pointer-events: none; font-family: var(--font-serif); font-style: italic; font-size: 15px; fill: rgba(190, 220, 255, 0.55); letter-spacing: 0.08em; }
.route { fill: none; stroke: var(--gold); stroke-width: 2.4; stroke-dasharray: 2 7; stroke-linecap: round; }
.route-draw { animation: dash 1.2s ease-out both; }
@keyframes dash { from { stroke-dashoffset: 120; opacity: 0; } to { stroke-dashoffset: 0; opacity: 1; } }
.counter { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.counter b { font-family: var(--font-ui); font-weight: 800; font-size: 1.5rem; color: var(--clay-hi); font-variant-numeric: tabular-nums; }
.region-g:focus { outline: none; }
.region-g:focus-visible .region { stroke: var(--aegean); stroke-width: 3; }

/* механизм */
.mech-board svg { max-height: 460px; }
.gear-tile svg { width: 70px; height: 70px; }
.axle-hit { fill: transparent; cursor: pointer; }
.axle-ring { fill: none; stroke: var(--aegean); stroke-width: 2.5; stroke-dasharray: 7 6; }
.axle-ring.is-ready { stroke: var(--clay-hi); animation: breathe 1.3s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.45; } }
.crank-grip { cursor: grab; }
.crank-grip:active { cursor: grabbing; }
.mech-stats { display: flex; flex-wrap: wrap; gap: 12px; }
.stat { flex: 1; min-width: 150px; padding: 12px 16px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.stat small { display: block; color: var(--cream-3); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; }
.stat b { font-family: var(--font-ui); font-weight: 800; font-size: 1.7rem; line-height: 1.15; font-variant-numeric: tabular-nums; }

/* остракизм */
.urn-row { display: flex; align-items: center; gap: 18px; padding: 16px 20px; }
.urn-row svg { width: 72px; height: auto; flex: none; }
.urn-info { flex: 1; display: grid; gap: 8px; }
.urn-info b { font-family: var(--font-ui); font-weight: 800; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.quorum { height: 12px; border-radius: 6px; overflow: hidden; background: var(--surface-3); }
.quorum i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--clay-lo), var(--clay-hi)); transition: width 0.25s ease; }
.quorum.full i { background: linear-gradient(90deg, #6c8c3a, var(--olive)); }
.cands { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.cand { display: grid; justify-items: center; gap: 12px; padding: 18px 16px; text-align: center; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.cand svg.shard { width: 100%; max-width: 250px; height: auto; }
.cand-role { margin: -4px 0 0; color: var(--cream-3); font-size: 0.92rem; }
.cand-score { display: flex; align-items: baseline; gap: 10px; }
.cand-score b { font-family: var(--font-ui); font-weight: 800; font-size: 2.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.cand-score span { color: var(--cream-2); font-weight: 700; }
.cand-share { justify-self: end; margin-top: -6px; color: var(--cream-3); font-size: 0.85rem; font-weight: 700; }
.cand .bar { width: 100%; height: 10px; border-radius: 5px; overflow: hidden; background: var(--surface-3); }
.cand .bar i { display: block; height: 100%; width: 0; background: var(--clay); transition: width 0.25s ease; }
.cand.is-ahead { border-color: rgba(240, 142, 85, 0.7); box-shadow: 0 0 30px -6px rgba(240, 142, 85, 0.45); }
.cand.is-exiled { border-color: var(--wine); }
.cand.is-safe { opacity: 0.7; }
.verdict-stamp { padding: 4px 12px; border: 2px solid currentColor; border-radius: 8px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; transform: rotate(-4deg); }
.verdict-stamp.out { color: var(--wine); }
.verdict-stamp.in { color: var(--olive); }
.fly-shard { position: fixed; z-index: 120; width: 26px; height: 20px; margin: -10px 0 0 -13px; background: var(--clay); clip-path: polygon(8% 20%, 45% 0, 90% 15%, 100% 60%, 60% 100%, 15% 85%); pointer-events: none; }

/* зеркала */
.sea-canvas { width: 100%; height: auto; border-radius: 12px; touch-action: none; cursor: grab; }
.sliders { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.slider { display: grid; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); font-weight: 650; }
.slider-top { display: flex; justify-content: space-between; gap: 10px; }
.slider-top span:last-child { color: var(--cream-3); font-variant-numeric: tabular-nums; }
.slider.is-hit { border-color: rgba(169, 200, 110, 0.6); }
input[type="range"] { width: 100%; height: 28px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--surface-3); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--surface-3); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -9px; border-radius: 50%; background: var(--cream); border: 4px solid var(--clay); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--cream); border: 4px solid var(--clay); }

/* цитаты */
.quote-card { display: grid; place-items: center; min-height: 260px; padding: 40px 28px; text-align: center; }
.quote-card::after {
  content: "“";
  position: absolute;
  left: 18px;
  top: -30px;
  font-family: var(--font-serif);
  font-size: 13rem;
  line-height: 1;
  color: rgba(212, 112, 58, 0.14);
  pointer-events: none;
}
.quote-text { position: relative; z-index: 1; margin: 0; max-width: 30ch; font-family: var(--font-serif); font-style: italic; font-weight: 600; font-size: clamp(1.9rem, 4.2vw, 3.1rem); line-height: 1.18; text-wrap: balance; }
.quote-card.ok { border-color: rgba(169, 200, 110, 0.6); }
.quote-card.no { border-color: rgba(240, 112, 129, 0.6); }
.quote-who { position: relative; z-index: 1; margin: 18px 0 0; color: var(--cream-2); font-size: 1.05rem; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.answer {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 84px;
  padding: 14px 20px;
  border-radius: 16px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  font-weight: 750;
  font-size: 1.15rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.12s ease;
}
.answer:hover:not(:disabled) { border-color: var(--clay); transform: translateY(-2px); }
.answer:disabled { cursor: default; }
.answer svg { width: 46px; height: 46px; flex: none; }
.answer.is-right { border-color: var(--olive); background: var(--olive-bg); }
.answer.is-wrong { border-color: var(--wine); background: var(--wine-bg); }
.dots { display: flex; gap: 6px; }
.dots i { width: 22px; height: 8px; border-radius: 4px; background: var(--surface-3); }
.dots i.ok { background: var(--olive); }
.dots i.no { background: var(--wine); }
.dots i.now { background: var(--cream); }
.score-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.score-list li { display: flex; gap: 12px; align-items: baseline; padding: 10px 14px; border-radius: 10px; background: var(--bg-2); }
.score-list li b { flex: none; width: 1.4em; text-align: center; }
.score-list li.ok b { color: var(--olive); }
.score-list li.no b { color: var(--wine); }
.score-list li span { color: var(--cream-2); }
.score-list li em { font-style: normal; color: var(--cream-3); font-size: 0.92rem; }
.big-score { margin: 0; font-family: var(--font-ui); font-weight: 800; font-size: clamp(2rem, 4.4vw, 3rem); line-height: 1; }

/* Эратосфен */
.earth-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 14px; }
.earth-grid .stage-panel { display: grid; gap: 8px; align-content: start; }
.panel-cap { margin: 0; color: var(--cream-3); font-size: 0.85rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.measure-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
.measure-row output { font-family: var(--font-ui); font-weight: 800; font-size: 1.6rem; min-width: 4.2ch; text-align: right; font-variant-numeric: tabular-nums; }

/* Евклид */
.papyrus { background: linear-gradient(180deg, #efe1c4, #e2cfa8); border-color: rgba(120, 80, 40, 0.4); }
.papyrus svg { cursor: crosshair; }

/* Аристотель */
.animal-pool { display: flex; flex-wrap: wrap; gap: 10px; min-height: 70px; padding: 14px; }
.animal {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface-2);
  font-weight: 700;
  font-size: 1.02rem;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.animal:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--clay); }
.animal .emoji { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(244, 232, 211, 0.08); font-size: 1.8rem; line-height: 1; }
.animal.is-on { border-color: var(--clay-hi); background: rgba(212, 112, 58, 0.22); box-shadow: 0 0 0 3px rgba(240, 142, 85, 0.25); }
.animal.is-wrong { border-color: var(--wine); background: var(--wine-bg); }
.animal.is-right { border-color: rgba(169, 200, 110, 0.6); }
.baskets { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.basket { display: grid; align-content: start; gap: 12px; min-height: 230px; padding: 16px; cursor: pointer; transition: border-color 0.15s ease, background-color 0.15s ease; }
.basket:hover, .basket.is-target { border-color: rgba(240, 142, 85, 0.7); }
.basket-head { display: flex; align-items: center; gap: 12px; }
.basket-head svg { width: 44px; height: 44px; color: var(--clay-hi); }
.basket-head b { font-family: var(--font-display); font-size: 1.6rem; }
.basket-items { display: flex; flex-wrap: wrap; gap: 8px; }
.basket-drop { padding: 10px; border: 1.5px dashed var(--line-2); border-radius: 12px; color: var(--cream-3); text-align: center; font-size: 0.92rem; }
.why { margin: 6px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--wine-bg); color: #ffd0d6; font-size: 0.95rem; }

/* Гиппократ */
.patient { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; padding: 22px; }
.patient svg { width: 110px; height: 110px; }
.patient-text { margin: 6px 0 0; font-family: var(--font-serif); font-size: clamp(1.4rem, 2.6vw, 1.9rem); line-height: 1.3; }
.humors { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.humor {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 14px 10px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, background-color 0.15s ease;
}
.humor:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--clay); }
.humor svg { width: 48px; height: 58px; }
.humor b { font-size: 1.02rem; }
.humor small { color: var(--cream-3); font-size: 0.82rem; text-align: center; }
.humor.is-right { border-color: var(--olive); background: var(--olive-bg); }
.humor.is-wrong { border-color: var(--wine); background: var(--wine-bg); }
.humor:disabled { cursor: default; }
.patients { display: flex; gap: 8px; }
.patients i { width: 34px; height: 8px; border-radius: 4px; background: var(--surface-3); }
.patients i.done { background: var(--olive); }
.patients i.now { background: var(--cream); }

/* Демокрит */
.taste-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.taste { display: grid; justify-items: center; align-content: start; gap: 8px; padding: 16px 12px; text-align: center; cursor: pointer; transition: border-color 0.15s ease, transform 0.15s ease; }
.taste:hover { border-color: rgba(240, 142, 85, 0.7); }
.taste .emoji { font-size: 2.6rem; line-height: 1; }
.taste b { font-family: var(--font-display); font-size: 1.45rem; }
.taste small { color: var(--cream-3); }
.taste-slot { display: grid; place-items: center; width: 100%; min-height: 104px; border: 1.5px dashed var(--line-2); border-radius: 12px; color: var(--cream-3); font-size: 0.86rem; padding: 6px; }
.taste-slot svg { width: 90px; height: 90px; }
.taste.is-right { border-color: var(--olive); }
.taste.is-wrong { border-color: var(--wine); }
.atom-tile { min-width: 150px; }
.atom-tile svg { width: 96px; height: 96px; }
.atom-tile.is-used { opacity: 0.45; }

/* Архимед */
.vessels { width: 100%; height: auto; touch-action: none; }
.level-grip { cursor: ns-resize; }

/* ---------- адаптивность ---------- */
@media (max-width: 1100px) {
  .home { grid-template-columns: 1fr; gap: 26px; }
  .home-copy { justify-items: center; text-align: center; }
  .home-copy .lead { margin: 0 auto; }
  .progress { width: 100%; margin: 0 auto; }
  .home-actions { justify-content: center; }
  .game-grid { grid-template-columns: 1fr; }
  .task { position: static; }
  .earth-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .topbar { position: static; }
  .topbar-in { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .brand-sub { display: none; }
  .nav { order: 3; width: 100%; justify-content: center; }
  .nav button { flex: 1; justify-content: center; }
  .page { padding: 20px 16px 44px; }
  .icon-btn .label { display: none; }
  .student-chip span { display: none; }
  .answers, .baskets, .sliders { grid-template-columns: 1fr; }
  .humors, .taste-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .explain { padding: 22px 18px; }
  .para { font-size: 1.15rem; }
  .patient { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .home-actions .btn-lg { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
