/* WordKids — новый чистый дизайн (в стиле Duolingo, для детей 6–8 лет). */

:root {
  --green: #58cc02;
  --green-dark: #46a302;
  --green-light: #d7ffb8;
  --blue: #1cb0f6;
  --blue-dark: #1899d6;
  --blue-light: #ddf4ff;
  --red: #ff4b4b;
  --red-dark: #d33131;
  --red-light: #ffdfe0;
  --yellow: #ffc800;
  --yellow-light: #fff4cc;
  --ink: #3c3c3c;
  --muted: #afafaf;
  --border: #e5e5e5;
  --cream: #fff8ee;
  --white: #ffffff;
  --shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  font-family: "Segoe UI", "Nunito", system-ui, -apple-system, sans-serif;
  background: var(--cream);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Верхняя панель урока ─────────────────────────────────────────────── */

.top-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--white);
  border: 2px solid var(--border);
  font-size: 20px;
  color: var(--muted);
  flex: none;
}

.icon-btn:active {
  transform: translateY(2px);
}

.progress-track {
  flex: 1;
  height: 14px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--green);
  transition: width 0.3s ease;
}

.counter {
  font-weight: 700;
  color: var(--muted);
  font-size: 14px;
  flex: none;
}

/* ── Кнопки ───────────────────────────────────────────────────────────── */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  border-radius: 18px;
  font-size: 16px;
  font-weight: 800;
  padding: 12px 20px;
  transition: transform 0.05s ease;
}

.btn:active {
  transform: translateY(3px);
}

.btn-primary {
  background: var(--green);
  color: var(--white);
  box-shadow: 0 4px 0 var(--green-dark);
}

.btn-blue {
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 4px 0 var(--blue-dark);
}

.btn-outline {
  background: var(--white);
  color: var(--muted);
  border: 2px solid var(--border);
  box-shadow: none;
}

.btn-danger {
  background: var(--red);
  color: var(--white);
  box-shadow: 0 4px 0 var(--red-dark);
}

.btn[disabled] {
  opacity: 0.55;
  cursor: default;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--blue-light);
  color: var(--blue-dark);
  font-weight: 700;
  font-size: 14px;
}

/* ── Главная ──────────────────────────────────────────────────────────── */

.home-body {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 20px 150px;
}

.home-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.logo-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  flex: none;
}

.home-title {
  font-size: 26px;
  font-weight: 900;
  margin: 0;
}

.home-subtitle {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.xp-chip {
  margin-left: auto;
  background: var(--yellow-light);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

.card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 24px;
  padding: 18px;
}

.progress-card {
  margin-bottom: 18px;
}

.progress-card .row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-card .stars {
  font-weight: 800;
  font-size: 18px;
  white-space: nowrap;
}

.section-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--muted);
  margin: 18px 4px 8px;
}

.path-title {
  font-size: 20px;
  font-weight: 900;
  margin: 6px 4px 4px;
}

.lesson-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 24px;
  padding: 14px;
  margin-bottom: 12px;
  text-align: left;
}

.lesson-card.locked {
  background: #f5f5f5;
}

.lesson-card .emoji-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(88, 204, 2, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  flex: none;
}

.lesson-card.locked .emoji-circle {
  background: rgba(0, 0, 0, 0.06);
}

.lesson-card .info {
  flex: 1;
  min-width: 0;
}

.lesson-card .name {
  font-size: 17px;
  font-weight: 800;
  margin: 0;
}

.lesson-card .name.locked {
  color: var(--muted);
}

.lesson-card .desc {
  color: var(--muted);
  font-size: 14px;
  margin: 2px 0 0;
}

.lesson-card .stars {
  font-size: 14px;
  margin-top: 5px;
}

.lesson-card .action {
  flex: none;
  font-size: 22px;
  color: var(--muted);
}

.start-chip {
  background: var(--green);
  color: var(--white);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.home-footer {
  display: flex;
  justify-content: center;
  padding: 22px 0 8px;
}

.reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  color: var(--muted);
  border: 2px solid var(--border);
  border-radius: 999px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.05s;
}

.reset-btn:hover {
  color: var(--red);
  border-color: #FFC9C9;
  background: var(--red-light);
}

.reset-btn:active {
  transform: translateY(2px);
}

.reset-btn-icon {
  font-size: 17px;
  line-height: 1;
  transition: transform 0.25s;
}

.reset-btn:hover .reset-btn-icon {
  transform: rotate(-90deg);
}

/* ── Нижняя панель ────────────────────────────────────────────────────── */

.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--white);
  box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.08);
  z-index: 30;
}

.bottom-bar .tabs {
  display: flex;
  gap: 10px;
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 16px calc(10px + env(safe-area-inset-bottom));
}

.tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 18px;
  font-weight: 700;
  font-size: 15px;
  color: var(--muted);
}

.tab.active {
  background: var(--green-light);
  color: var(--green-dark);
}

.tab .badge {
  background: var(--yellow-light);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
}

/* ── Панель ответа в уроке ────────────────────────────────────────────── */

.answer-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--white);
  box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.08);
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  z-index: 30;
}

.answer-bar .inner {
  max-width: 640px;
  margin: 0 auto;
}

.answer-bar .feedback {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 10px;
}

.answer-bar .feedback.good {
  color: var(--green-dark);
}

.answer-bar .feedback.bad {
  color: var(--red-dark);
}

.answer-bar .hint-line {
  color: var(--muted);
  font-size: 14px;
}

.wrong-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 223, 224, 0.55);
  border: 1px solid rgba(255, 75, 75, 0.35);
  border-radius: 16px;
  padding: 8px 8px 8px 12px;
  margin-bottom: 12px;
}

.wrong-card .words {
  flex: 1;
  min-width: 0;
}

.wrong-card .pair {
  font-weight: 800;
  font-size: 15px;
}

.wrong-card .example {
  font-size: 13px;
}

.wrong-card .example-ru {
  font-size: 12px;
  color: var(--muted);
}

.speak-mini {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--blue-light);
  color: var(--blue-dark);
  font-size: 18px;
  flex: none;
}

/* ── Урок: задания ────────────────────────────────────────────────────── */

.lesson-body {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 10px 20px 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.exercise-title {
  font-size: 22px;
  font-weight: 900;
  text-align: center;
  margin: 8px 0 0;
}

.exercise-subtitle {
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  margin: 6px 0 0;
}

.question-card {
  width: 100%;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 28px;
  padding: 24px;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.big-word {
  font-size: 40px;
  font-weight: 900;
  margin: 0;
}

.big-word.medium {
  font-size: 34px;
}

.big-word.small {
  font-size: 28px;
}

.big-word.tiny {
  font-size: 24px;
}

.speak-circle {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue);
  font-size: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.speak-circle:active {
  transform: scale(0.96);
}

.options {
  width: 100%;
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 18px;
  padding: 12px 18px;
  font-size: 19px;
  font-weight: 600;
  text-align: left;
}

.option.selected {
  background: var(--blue-light);
  border-color: var(--blue);
}

.option.correct {
  background: var(--green-light);
  border-color: var(--green);
}

.option.wrong {
  background: var(--red-light);
  border-color: var(--red);
}

.option .mark {
  margin-left: auto;
  font-size: 20px;
  flex: none;
}

.option .perch {
  position: relative;
  height: 92px;
}

.lurking {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 118px;
  pointer-events: none;
}

/* Сборка слова */

.slots {
  display: flex;
  gap: 6px;
  width: 100%;
  margin-bottom: 18px;
}

.slot {
  flex: 1;
  height: 52px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
}

.slot.filled {
  background: var(--blue-light);
  border-color: var(--blue);
}

.slot.good {
  background: var(--green-light);
  border-color: var(--green);
}

.slot.bad {
  background: var(--red-light);
  border-color: var(--red);
}

.letters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 8px 0 12px;
}

.letter-tile {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--white);
  border: 2px solid rgba(28, 176, 246, 0.45);
  font-size: 21px;
  font-weight: 900;
}

.letter-tile.used {
  background: #f1f1f1;
  border-color: var(--border);
  color: var(--muted);
}

/* Соединение пар */

.match-columns {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-top: 20px;
}

.match-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.match-card {
  min-height: 58px;
  border: 2px solid var(--border);
  border-radius: 16px;
  background: var(--white);
  padding: 10px 8px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.match-card.selected {
  background: var(--blue-light);
  border-color: var(--blue);
}

.match-card.good {
  background: var(--green-light);
  border-color: var(--green);
  color: var(--green-dark);
}

.match-card.bad {
  background: var(--red-light);
  border-color: var(--red);
}

.match-card.done {
  visibility: hidden;
}

/* ── Знакомство со словами ────────────────────────────────────────────── */

.intro-body {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 20px 20px;
  display: flex;
  flex-direction: column;
}

.intro-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 28px;
  padding: 24px;
  min-height: 300px;
}

.intro-card .ru {
  font-size: 22px;
  font-weight: 800;
  color: var(--green-dark);
  margin: 10px 0 0;
}

.intro-card .hint {
  color: var(--muted);
  margin-top: 10px;
}

.dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 16px 0;
}

.dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}

.dots span.active {
  width: 10px;
  height: 10px;
  background: var(--green);
}

.nav-row {
  display: flex;
  gap: 12px;
  padding-bottom: 16px;
}

.nav-row .btn-outline {
  flex: 0.42;
}

.nav-row .btn-primary {
  flex: 1;
}

/* ── Результат ────────────────────────────────────────────────────────── */

.result-body {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 24px 40px;
  text-align: center;
}

.result-face {
  font-size: 64px;
  margin-top: 24px;
}

.result-title {
  font-size: 30px;
  font-weight: 900;
  margin: 8px 0 0;
}

.result-lesson {
  color: var(--muted);
  font-weight: 700;
}

.result-stars {
  font-size: 42px;
  letter-spacing: 6px;
  margin: 16px 0 6px;
}

.result-stars .off {
  color: #e3e3e3;
}

.xp-pill {
  display: inline-block;
  background: var(--yellow-light);
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 900;
  font-size: 18px;
  margin: 8px 0 20px;
}

.words-card {
  text-align: left;
  margin-bottom: 22px;
}

.words-card .title {
  font-weight: 800;
  margin-bottom: 8px;
}

.word-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(229, 229, 229, 0.6);
}

.word-row:last-child {
  border-bottom: none;
}

.word-row .en {
  font-weight: 800;
  font-size: 16px;
  flex: 1;
}

.word-row .ru {
  color: var(--muted);
  font-size: 14px;
  flex: 1;
  text-align: right;
}

.word-row .example {
  font-size: 13px;
  color: var(--muted);
  flex-basis: 100%;
}

.word-row .speak-mini {
  width: 38px;
  height: 38px;
}

/* ── Магазин ──────────────────────────────────────────────────────────── */

.shop-body {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 20px 120px;
}

.shop-card {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 14px;
}

.shop-card img {
  width: 84px;
  height: 84px;
  object-fit: contain;
  flex: none;
}

.shop-card .info {
  flex: 1;
}

.shop-card .price {
  font-weight: 900;
  font-size: 18px;
  white-space: nowrap;
}

/* ── Котик ────────────────────────────────────────────────────────────── */

.cat-widget {
  position: fixed;
  right: 10px;
  bottom: 78px;
  z-index: 40;
  width: 132px;
  user-select: none;
}

.cat-widget.in-lesson {
  position: static;
  width: auto;
  margin-top: 14px;
  align-self: center;
  pointer-events: auto;
}

.cat-meow-area {
  display: flex;
  justify-content: flex-end;
  min-height: 46px;
  padding-bottom: 4px;
}

.cat-meow-anchor {
  position: relative;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 15px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.cat-meow-anchor.show {
  opacity: 1;
  transform: translateY(0);
}

.cat-meow-anchor::after {
  content: "";
  position: absolute;
  bottom: -7px;
  right: 22px;
  width: 12px;
  height: 12px;
  background: var(--white);
  border-right: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
  transform: rotate(45deg);
}

.cat-img {
  display: block;
  width: 100%;
  cursor: pointer;
}

.cat-img:active {
  transform: translateY(2px);
}

/* ── Прочее ───────────────────────────────────────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: modal-fade 0.15s ease;
}

@keyframes modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--white);
  border-radius: 24px;
  padding: 22px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  animation: modal-pop 0.2s ease;
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to { opacity: 1; transform: none; }
}

.modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--red-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
}

.modal h3 {
  margin: 0 0 8px;
}

.modal p {
  color: var(--muted);
  margin: 0 0 16px;
}

.modal .nav-row {
  padding-bottom: 0;
}

.splash {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 700;
}

/* ── Подарочный код и админка ─────────────────────────────────────────── */

.gift-box {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.gift-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.gift-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.gift-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--white);
  outline: none;
}

.gift-input:focus {
  border-color: var(--blue);
}

.gift-input::placeholder {
  color: #c9c9c9;
}

.gift-btn {
  width: auto;
  min-height: 44px;
  padding: 0 18px;
  flex: none;
}

.gift-note {
  min-height: 18px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.gift-note.bad {
  color: var(--red);
}

.admin-list {
  display: grid;
  gap: 8px;
  margin: 4px 0 12px;
}

.admin-btn {
  text-align: left;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}

.admin-btn:hover {
  border-color: var(--green);
  background: #f6fff0;
}

.admin-note {
  min-height: 18px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--green-dark);
}

.modal-admin {
  text-align: left;
}

.cat-img.cat-gone {
  filter: grayscale(1) brightness(0.6);
  opacity: 0.5;
}

.empty-bowl-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  opacity: 0.75;
}

.empty-bowl {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  font-size: 34px;
  filter: grayscale(1);
  flex: none;
}

.cat-missing {
  position: relative;
  width: 150px;
  height: 90px;
  margin: 28px auto 0;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.055), transparent 70%);
}

.cat-missing span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  letter-spacing: 0.18em;
  color: rgba(0, 0, 0, 0.14);
}

.cat-hint-dark {
  background: #141416;
  border-color: #2a2a2c;
  color: #b9b9b9;
}

.cat-hint-dark::after {
  background: #141416;
  border-color: #2a2a2c;
}

/* ── Тёмная часть ─────────────────────────────────────────────────────── */

body.dark-active {
  background: #050506;
  overflow: hidden;
}

body.dark-active .cat-widget {
  display: none;
}

.dark-screen {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #050506;
  color: #b9b9b9;
  overflow: hidden;
  font-family: "Segoe UI", "Nunito", system-ui, sans-serif;
}

.dark-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  opacity: 0.55;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.03) 0 1px,
    transparent 1px 3px
  );
}

.dark-fx::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.75) 100%);
}

.dark-stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  z-index: 2;
}

.dark-screen.blackout .dark-stage {
  opacity: 0;
  transition: opacity 0.7s ease;
}

.dark-screen.blackout {
  background: #000;
}

.dark-screen.glitch .dark-stage {
  animation: darkShake 0.28s steps(2) 2;
}

.dark-screen.flicker .dark-fx {
  animation: darkFlicker 0.16s steps(2) 4;
}

@keyframes darkShake {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-7px, 2px); }
  50% { transform: translate(6px, -3px); }
  75% { transform: translate(-3px, 1px); }
  100% { transform: translate(0, 0); }
}

@keyframes darkFlicker {
  0% { opacity: 0.2; }
  50% { opacity: 0.9; }
  100% { opacity: 0.3; }
}

@keyframes darkBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes darkLogoQ {
  0%, 70% { opacity: 1; }
  71%, 100% { opacity: 0; }
}

@keyframes darkPulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.8; }
}

.dark-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #161618;
  flex: none;
}

.dark-logo {
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 0.04em;
  color: #7d7d7d;
}

.dark-logo-q {
  animation: darkLogoQ 5s steps(1) infinite;
  color: #b33;
}

.dark-top-title {
  font-weight: 700;
  font-size: 15px;
  color: #6f6f6f;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dark-xp {
  margin-left: auto;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #8a8a8a;
}

.dark-xp.neg {
  color: #d33;
  text-shadow: 0 0 12px rgba(200, 0, 0, 0.5);
}

.dark-home {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 18px 18px 40px;
  overflow-y: auto;
}

.dark-progress {
  height: 10px;
  border-radius: 6px;
  background: #101012;
  overflow: hidden;
}

.dark-progress-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #2a2a2c, #5a1010);
  animation: darkPulse 4s ease-in-out infinite;
}

.dark-path-title {
  margin: 22px 0 4px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #4d4d4f;
}

.dark-lesson {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 10px;
  padding: 13px 14px;
  border: 1px solid #171719;
  border-radius: 16px;
  background: #0a0a0b;
  color: #5f5f61;
  text-align: left;
  font: inherit;
}

.dark-lesson .dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #111113;
  display: grid;
  place-items: center;
  font-size: 17px;
  flex: none;
}

.dark-lesson .name {
  display: block;
  font-weight: 800;
  font-size: 15px;
  color: #6a6a6c;
}

.dark-lesson .sub {
  display: block;
  font-size: 12px;
  color: #3f3f41;
  margin-top: 2px;
}

.dark-lesson.void {
  border-color: #2a0c0c;
  background: #0b0708;
  cursor: pointer;
}

.dark-lesson.void .dot {
  background: #000;
  color: #8a1a1a;
  box-shadow: inset 0 0 16px rgba(160, 0, 0, 0.35);
  animation: darkPulse 3.2s ease-in-out infinite;
}

.dark-lesson.void .name {
  color: #a33;
}

.dark-cat-gap {
  position: relative;
  width: 160px;
  height: 90px;
  margin: 30px auto 0;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.025), transparent 70%);
}

.dark-cat-gap span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.1);
  animation: darkPulse 6s ease-in-out infinite;
}

.dark-bubbles {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  z-index: 4;
}

.dark-bubble {
  max-width: min(560px, 86vw);
  padding: 10px 15px;
  border: 1px solid #202022;
  border-radius: 14px;
  background: rgba(10, 10, 12, 0.92);
  color: #b9b9b9;
  font-size: 15px;
  line-height: 1.45;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
}

.dark-boot {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 28px;
}

.dark-question {
  min-height: 2.4em;
  font-size: clamp(21px, 5.4vw, 32px);
  line-height: 1.3;
  color: #d6d6d6;
  letter-spacing: 0.01em;
}

.dark-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 2px;
  background: #8a8a8a;
  vertical-align: -0.14em;
  animation: darkBlink 1s steps(1) infinite;
}

.dark-boot-input {
  margin-top: 26px;
  min-height: 52px;
}

.dark-boot-row {
  display: flex;
  gap: 8px;
}

.dark-boot-row .dark-input {
  width: 100%;
}

.dark-boot-log {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dark-boot-msg {
  color: #9a9a9a;
  font-size: 16px;
}

.dark-boot-answer {
  color: #d0d0d0;
  font-size: 18px;
  letter-spacing: 0.02em;
  border-bottom: 1px solid #222;
  padding-bottom: 8px;
}

.dark-room {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}

.dark-chat {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
}

.dark-msg {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.45;
  word-wrap: break-word;
}

.dark-msg.app {
  align-self: flex-start;
  background: #0c0c0e;
  border: 1px solid #1c1c1f;
  color: #c4c4c4;
}

.dark-msg.me {
  align-self: flex-end;
  background: #151517;
  border: 1px solid #202023;
  color: #8c8c8e;
}

.dark-msg.sys {
  align-self: center;
  background: none;
  border: none;
  color: #4a4a4c;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 4px;
}

.dark-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid #141416;
  background: #070708;
  flex: none;
}

.dark-input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #232326;
  border-radius: 12px;
  background: #0c0c0e;
  color: #d0d0d0;
  font: inherit;
  font-size: 15px;
  outline: none;
}

.dark-input:focus {
  border-color: #4a1010;
  box-shadow: 0 0 0 3px rgba(120, 0, 0, 0.12);
}

.dark-input:disabled {
  opacity: 0.4;
}

.dark-input::placeholder {
  color: #4a4a4c;
}

.dark-send {
  flex: none;
  width: 48px;
  border-radius: 12px;
  background: #1a0d0d;
  border: 1px solid #3a1212;
  color: #a33;
  font-size: 20px;
  cursor: pointer;
}

.dark-send:active {
  transform: translateY(1px);
}

.dark-result {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px;
  text-align: center;
}

.dark-result-face {
  font-size: 54px;
  filter: grayscale(1) brightness(0.45);
}

.dark-result h1 {
  margin: 4px 0 0;
  font-size: 26px;
  color: #9a9a9a;
}

.dark-result-lesson {
  color: #4d4d4f;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}

.dark-stars {
  font-size: 34px;
  letter-spacing: 8px;
  color: #111;
  text-shadow: 0 0 10px rgba(120, 0, 0, 0.35);
}

.dark-xp-pill {
  padding: 6px 14px;
  border-radius: 999px;
  background: #140808;
  border: 1px solid #2a0c0c;
  color: #a33;
  font-weight: 900;
}

.dark-result-note {
  color: #4a4a4c;
  font-size: 13px;
  letter-spacing: 0.12em;
}

.dark-dead-btn {
  margin-top: 14px;
  padding: 13px 22px;
  border-radius: 14px;
  border: 1px solid #1e1e20;
  background: #0b0b0d;
  color: #6a6a6c;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
