/* ============================================================
   «Гладиаторы - курс по переговорам» — оформление
   Палитра и типографика приближены к glabit.ru:
   бирюзовый акцент #20b9b7 / #00d9e5, тёмный #153239,
   светло-голубой фон #f4f9fb, оранжевый CTA #fa660f,
   шрифт TildaSans / Open Sans.
   ============================================================ */

:root {
  --bg: #f4f9fb;            /* светло-голубой фон glabit */
  --surface: #ffffff;
  --ink: #153239;           /* тёмный бирюзовый (--gh-line) */
  --muted: #5b6b71;
  --line: #dce9ed;          /* светлая линия */
  --accent: #20b9b7;        /* основной бирюзовый glabit */
  --accent-strong: #14908f; /* hover */
  --accent-bright: #00d9e5; /* яркий бирюзовый (--gh-accent) */
  --accent-soft: #e6f7f8;
  --danger: #fa660f;        /* оранжевый CTA glabit */
  --danger-ink: #ffffff;
  --ok: #008d9d;
  --ok-soft: #d9f6f4;
  --radius: 8px;
  --pill: 30px;             /* скругление кнопок как у Tilda */
  --shadow: 0 1px 2px rgba(21, 50, 57, 0.06), 0 8px 24px rgba(21, 50, 57, 0.07);
  --font: "TildaSans", "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; }

/* ---------- HUD: прогресс курса (всегда сверху) ---------- */
.hud {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.hud-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 10px 20px 10px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.hud-right { display: flex; align-items: center; gap: 8px; }
.achievements { display: flex; gap: 6px; }
.statusline { display: flex; justify-content: space-between; gap: 6px; margin-top: 10px; }

.hud-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1 1 0;
  min-width: 0;
}
.hud-badge .badge-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(21, 50, 57, 0.06);
  overflow: hidden;
}
.hud-badge .badge-emoji { font-size: 22px; line-height: 1; }
.hud-badge .badge-img { width: 100%; height: 100%; object-fit: contain; }
.hud-badge .badge-icon.has-img .badge-emoji { display: none; }
.badge-label {
  font-size: 0.66rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.15;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* серые состояния до прохождения практики */
.hud-badge.is-locked .badge-icon { opacity: 0.28; filter: grayscale(1); }
.hud-badge.is-open .badge-icon { opacity: 0.55; filter: grayscale(1); }
/* цветной — практика пройдена */
.hud-badge.is-done .badge-icon {
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.hud-badge.is-current .badge-icon { box-shadow: 0 0 0 3px var(--accent-soft); }

/* дополнительные ачивки — компактнее */
.achievements .hud-badge { flex: 0 0 auto; }
.achievements .badge-icon { width: 34px; height: 34px; border-radius: 10px; }
.achievements .badge-emoji { font-size: 18px; }

@media (max-width: 640px) {
  .badge-label { display: none; }
  .hud-badge .badge-icon { width: 36px; height: 36px; }
}
.brand {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.brand:hover { text-decoration: none; color: var(--accent); }
.reset-link {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 7px 14px;
  border-radius: var(--pill);
}
.reset-link:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }

/* ---------- Контейнер ---------- */
#app {
  max-width: 980px;
  margin: 0 auto;
  padding: 10px 20px 60px;
}
.footer {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px 40px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}
.footer-ver {
  margin-top: 6px;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
}

/* ---------- Кнопки (pill, как у Tilda) ---------- */
.btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: var(--pill);
  transition: transform 0.06s ease, background 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(32, 185, 183, 0.28);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-strong); text-decoration: none; }
.btn-danger { background: var(--danger); color: var(--danger-ink); }
.btn-danger:hover { background: #e0570a; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); border-radius: var(--pill); }
.btn-ghost:hover { background: var(--accent-soft); border-color: var(--accent); }
.is-done { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok); }

/* ---------- Главная ---------- */
.hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 30px;
  margin-bottom: 26px;
  border-top: 4px solid var(--accent);
}
.hero h1 { margin: 0 0 10px; font-size: 2rem; font-weight: 800; letter-spacing: -0.01em; }
.subtitle { margin: 0 0 22px; color: var(--muted); font-size: 1.02rem; max-width: 720px; }

.progress-wrap { margin-bottom: 20px; }
.progress-label { font-size: 0.88rem; color: var(--muted); margin-bottom: 6px; }
.progress-bar { height: 10px; background: #e2eef1; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent-bright), var(--accent)); border-radius: 999px; transition: width 0.4s ease; }

.continue-btn { margin-top: 4px; }
.all-done { color: var(--accent-strong); font-weight: 700; padding: 8px 0; }

/* ---------- Сетка модулей ---------- */
.module-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 680px) {
  .module-grid { grid-template-columns: 1fr 1fr; }
}

.module-card {
  display: flex;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  color: var(--ink);
  transition: border-color 0.15s ease, transform 0.08s ease;
}
a.module-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.module-card.locked { opacity: 0.65; }
.module-num {
  flex: 0 0 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
  border-radius: 10px;
  border: 1px solid #cbeef0;
}
.module-info { flex: 1; min-width: 0; }
.module-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 4px; }
.opt-tag { font-weight: 500; color: var(--muted); font-size: 0.8rem; }
.module-goal { color: var(--muted); font-size: 0.9rem; margin: 0 0 10px; }
.module-goal.big { font-size: 1.02rem; margin: 0 0 18px; }
.module-meta { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Бейджи ---------- */
.badge {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--pill);
  display: inline-block;
}
.badge.new { background: #eef4f6; color: var(--muted); }
.badge.progress { background: #fff4d6; color: #8a5a00; }
.badge.done { background: var(--ok-soft); color: var(--ok); }
.badge.optional { background: #e7f0ff; color: #2f6bff; }
.badge.locked { background: #f0f3f4; color: #6b7b81; }

/* ---------- Страницы ---------- */
.page { padding-top: 4px; }
.back { display: inline-block; margin-bottom: 14px; font-size: 0.9rem; color: var(--muted); font-weight: 600; }
.back:hover { color: var(--accent); }

.module-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.module-header h1 { margin: 0; font-size: 1.65rem; font-weight: 800; }

.locked-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 28px;
  text-align: center;
}
.locked-box h1 { margin: 0 0 10px; }
.locked-box p { color: var(--muted); margin: 0 0 18px; }

/* ---------- Теория ---------- */
.theory { margin: 10px 0 24px; }
.theory h2, .practice-section h2 { font-size: 1.18rem; margin: 0 0 12px; font-weight: 800; }
.hint { font-weight: 500; color: var(--muted); font-size: 0.82rem; }
.theses { display: flex; flex-direction: column; gap: 12px; }
.thesis {
  display: flex;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.thesis-num {
  flex: 0 0 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #ffffff;
  border-radius: 9px;
  font-weight: 800;
}
.thesis h3 { margin: 0 0 6px; font-size: 1.02rem; font-weight: 700; }
.thesis p { margin: 0; color: var(--muted); font-size: 0.94rem; }

.extra {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 4px 18px;
}
.extra summary { cursor: pointer; font-weight: 700; padding: 13px 0; color: var(--accent-strong); }
.extra-body { padding: 0 0 16px; }
.extra-body p { color: var(--muted); margin: 0 0 10px; }
.extra-body p:last-child { margin-bottom: 0; }

/* ---------- Практика ---------- */
.practice-section { border-top: 1px solid var(--line); padding-top: 20px; }
.practice-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}
.practice-card p { margin: 0; }

.exercises { display: flex; flex-direction: column; gap: 16px; }
.exercise {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.exercise h3 { margin: 0 0 8px; font-size: 1.05rem; font-weight: 700; }
.instruction { color: var(--muted); font-size: 0.92rem; margin: 0 0 12px; }
.ex-text {
  width: 100%;
  min-height: 110px;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.55;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  resize: vertical;
  color: var(--ink);
  background: #fbfdfe;
}
.ex-text:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.toggle-done { margin-top: 10px; }

/* ---------- Поединок ---------- */
.duel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.duel-head h1 { margin: 0; font-size: 1.5rem; font-weight: 800; }
.duel-diff { font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.diff-easy { color: var(--ok); }
.diff-medium { color: #b26a00; }
.diff-hard { color: var(--danger); }
.case-title { margin: 14px 0 10px; font-size: 1.25rem; font-weight: 800; }
.situation {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 20px;
}
.duel-step-title { font-weight: 800; font-size: 1.02rem; margin: 6px 0 12px; }

.side-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 16px; }
@media (min-width: 680px) { .side-grid { grid-template-columns: 1fr 1fr; } }
.side-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  font-family: inherit;
  font-size: 1rem;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.side-card:hover { border-color: var(--accent); }
.side-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.side-hint { font-size: 0.82rem; color: var(--muted); }

.duration-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.duration-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--surface);
}
.duration-opt.selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.duration-opt input { accent-color: var(--accent); }

.duel-note { font-size: 0.88rem; color: var(--muted); margin-bottom: 16px; }

.duel-timer-wrap { text-align: center; margin: 8px 0 18px; }
.duel-timer {
  display: inline-block;
  font-size: 3.6rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent-strong);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 32px;
  letter-spacing: 0.02em;
}
.role-banner {
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 0.95rem;
}

.positions { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 18px; }
@media (min-width: 680px) { .positions { grid-template-columns: 1fr 1fr; } }
.pos-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.pos-card.own { border-color: var(--accent); background: #f0fafb; }
.pos-card.hidden { opacity: 0.75; }
.pos-label {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 8px;
}
.pos-card p { margin: 6px 0 0; color: var(--muted); font-size: 0.94rem; }

.solution-box, .debrief-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 14px;
}
.solution-box { border-left: 4px solid var(--ok); }
.debrief-box { border-left: 4px solid var(--accent-bright); }
.solution-box p, .debrief-box p { margin: 6px 0 0; }
.debrief-box p { color: var(--muted); }

.btn-finish, .btn-solution, .btn-start { margin-top: 4px; }

/* ---------- Раскрывающиеся блоки теории ---------- */
.thesis-content { flex: 1; min-width: 0; }
.thesis h3 { margin: 0 0 8px; }
.thesis-summary { color: var(--muted); margin: 0 0 12px; }

.thesis-details, .extra-block {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdfe;
}
.thesis-details summary, .extra-block summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--accent-strong);
  padding: 12px 14px;
  list-style: none;
  user-select: none;
}
.thesis-details summary::-webkit-details-marker,
.extra-block summary::-webkit-details-marker { display: none; }
.thesis-details summary::before, .extra-block summary::before { content: "＋ "; color: var(--accent); }
.thesis-details[open] summary::before, .extra-block[open] summary::before { content: "－ "; }

.details-body, .extra-body { padding: 4px 16px 16px; }
.details-body p, .extra-body p { color: var(--muted); margin: 0 0 12px; }
.details-body p:last-child, .extra-body p:last-child { margin-bottom: 0; }

.extra-wrap { margin-top: 24px; }
.extra-wrap h2 { font-size: 1.18rem; font-weight: 800; margin: 0 0 12px; }
.extra-block { margin-bottom: 10px; }

/* ---------- Слайды (места под картинки) ---------- */
.slides {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}
@media (min-width: 640px) { .slides { grid-template-columns: 1fr 1fr; } }

.slide-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 140px;
  padding: 14px;
  border: 2px dashed var(--line);
  border-radius: 10px;
  background: #f8fbfc;
  color: var(--muted);
  text-align: center;
  font-size: 0.88rem;
}
.slide-icon { font-size: 1.4rem; }
.slide-caption { max-width: 340px; }

.slide { margin: 0; }
.slide-img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.slide figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

/* ---------- Лестница практики (несколько кейсов на модуль) ---------- */
.practice-ladder { display: flex; flex-direction: column; gap: 10px; }
.practice-step {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  color: var(--ink);
  transition: border-color 0.15s ease, transform 0.08s ease;
}
a.practice-step:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.practice-step.locked { opacity: 0.6; }
.practice-step.done { border-color: var(--ok); background: #f4fbfa; }
.step-level {
  flex: 0 0 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid #cbeef0;
  border-radius: 10px;
  font-weight: 800;
}
.practice-step.done .step-level { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.step-body { flex: 1; min-width: 0; }
.step-title { font-weight: 700; font-size: 1rem; margin-bottom: 2px; }
.step-sub { color: var(--muted); font-size: 0.84rem; }
.step-status { font-size: 0.8rem; font-weight: 800; color: var(--accent-strong); white-space: nowrap; }
.step-status.done { color: var(--ok); }
.practice-step.locked .step-status { color: var(--muted); }
