:root {
  --bg: #081c2d;
  --bg-strong: #0d2438;
  --panel: #132f46;
  --panel-alt: #183d56;
  --panel-soft: #1d4a63;
  --forest: #215b48;
  --forest-soft: #2e7d5a;
  --gold: #d7b25d;
  --gold-soft: #f0d98e;
  --text: #eaf7ff;
  --muted: #b9d3df;
  --danger: #ff6d6d;
  --success: #7ad3a3;
  --warning: #f4be5b;
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 18px 40px rgba(2, 8, 15, 0.4);
  --radius: 18px;
  --pixel-font: "Trebuchet MS", "Segoe UI", sans-serif;
  --body-font: "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body-font);
  background:
    radial-gradient(circle at top, rgba(45, 93, 116, 0.5), transparent 45%),
    linear-gradient(180deg, var(--bg) 0%, #091821 100%);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--gold-soft);
  outline-offset: 2px;
}

.app-shell {
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px 18px 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: rgba(21, 42, 58, 0.92);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 2px solid var(--gold);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--forest) 0%, #163d31 100%);
  color: var(--gold-soft);
  font-weight: 800;
  font-size: 1.3rem;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.brand-copy h1,
.eyebrow {
  margin: 0;
  font-family: var(--pixel-font);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  color: var(--gold-soft);
  opacity: 0.9;
}

.brand-copy h1 {
  font-size: clamp(1.2rem, 2vw, 2rem);
}

.topbar-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-container {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.auth-account {
  display: flex;
  align-items: center;
  gap: 9px;
}

.auth-account__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.auth-account__name {
  max-width: 170px;
  overflow: hidden;
  color: var(--gold-soft);
  font-size: 0.85rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-button {
  padding: 9px 12px;
  white-space: nowrap;
}

.auth-message {
  max-width: 280px;
  margin: 0;
  color: #ffb1b1;
  font-size: 0.75rem;
  text-align: right;
}

.auth-gate {
  display: grid;
  justify-items: center;
  max-width: 680px;
  margin: clamp(40px, 12vh, 120px) auto;
  padding: clamp(24px, 5vw, 52px);
  border: 1px solid rgba(215, 178, 93, 0.48);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(26, 48, 55, 0.97), rgba(13, 28, 35, 0.98));
  box-shadow: var(--shadow);
  text-align: center;
}

.auth-gate h2 {
  margin: 0;
  color: var(--gold-soft);
  font-family: var(--pixel-font);
  font-size: clamp(1.3rem, 3vw, 2rem);
}

.auth-gate > p:not(.auth-message) {
  max-width: 480px;
  color: var(--muted);
  line-height: 1.7;
}

.auth-gate .auth-message {
  max-width: 100%;
  text-align: center;
}

.stat-pill {
  min-width: 90px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.ghost-btn,
.primary-btn,
.secondary-btn,
.nav-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.ghost-btn,
.secondary-btn {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.primary-btn {
  background: linear-gradient(180deg, var(--gold) 0%, #b3852b 100%);
  color: #182330;
  border-color: rgba(0, 0, 0, 0.2);
  font-weight: 700;
}

.ghost-btn:hover,
.primary-btn:hover,
.secondary-btn:hover,
.nav-item:hover {
  transform: translateY(-1px);
}

.ghost-btn {
  padding: 10px 16px;
}

.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.layout.home-layout {
  grid-template-columns: 1fr;
}

.layout.home-layout .main-panel {
  padding: 0;
}

.sidebar,
.main-panel {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: rgba(18, 35, 49, 0.95);
  box-shadow: var(--shadow);
}

.sidebar {
  padding: 16px;
}

.main-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-group--lesson,
.nav-group--other {
  padding-top: 14px;
  border-top: 1px solid rgba(215, 178, 93, 0.28);
}

.nav-item--lesson-step {
  border-color: rgba(215, 178, 93, 0.9);
  background: linear-gradient(180deg, #f0d98e 0%, #d7b25d 100%);
  color: #182330;
  font-weight: 800;
}

.nav-item--flow-next {
  position: relative;
  margin-bottom: 13px;
}

.nav-item--flow-next::after {
  position: absolute;
  top: calc(100% + 1px);
  left: 50%;
  color: var(--gold-soft);
  content: "↓";
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 12px;
  transform: translateX(-50%);
  pointer-events: none;
}

.nav-item--lesson-step:hover {
  border-color: #ffe8a3;
  background: linear-gradient(180deg, #ffe8a3 0%, #e4c46f 100%);
  color: #111b24;
}

.nav-item--lesson-step.active {
  border-color: #f6df9a;
  background: linear-gradient(180deg, #d7b25d 0%, #c49a42 100%);
  color: #111b24;
}

.nav-item--lesson-step.nav-item--locked {
  border-color: rgba(215, 178, 93, 0.35);
  background: rgba(215, 178, 93, 0.08);
  color: rgba(24, 35, 48, 0.55);
  cursor: not-allowed;
  opacity: 0.55;
}

.nav-item {
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  background: transparent;
  color: var(--text);
  font-weight: 600;
}

.nav-item.active {
  background: linear-gradient(180deg, rgba(33, 91, 72, 0.96), rgba(25, 60, 52, 0.9));
  border-color: rgba(143, 200, 162, 0.46);
}

.main-panel {
  min-height: 720px;
  padding: 24px;
}

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600;700;800&display=swap');

.home-screen {
  position: relative;
  min-height: 760px;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(221, 180, 101, 0.45);
  background: #06151c;
  box-shadow: 0 30px 70px rgba(4, 10, 18, 0.48);
}

.home-screen__bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(180deg, rgba(3, 10, 16, 0.26), rgba(3, 10, 16, 0.22)),
    url('https://images.unsplash.com/photo-1506744038136-46273834b3fb?auto=format&fit=crop&w=1800&q=80');
  background-size: cover;
  background-position: center center;
  transform: scale(1.04);
  filter: saturate(1.06) contrast(1.08) brightness(0.8);
}

.home-screen__overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 30%, rgba(246, 230, 157, 0.16), transparent 24%),
    linear-gradient(180deg, rgba(4, 9, 14, 0.12), rgba(4, 9, 14, 0.15) 42%, rgba(3, 10, 15, 0.4));
  pointer-events: none;
}

.home-screen__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 760px;
  padding: 48px 24px 68px;
  text-align: center;
}

.home-screen__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;
}

.home-screen__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  padding: 10px 20px;
  border: 1px solid rgba(234, 197, 96, 0.75);
  border-radius: 16px;
  background: rgba(8, 22, 24, 0.26);
  color: #f8dd92;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(245, 224, 156, 0.18), 0 8px 25px rgba(13, 20, 28, 0.35);
}

.home-screen__title {
  margin: 18px 0 6px;
  color: #f6d77a;
  font-family: "Cinzel", Georgia, serif;
  font-size: clamp(2.6rem, 6vw, 7rem);
  line-height: 0.88;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 0 0 15px rgba(242, 206, 115, 0.38), 0 0 30px rgba(60, 118, 142, 0.3);
}

.home-screen__subtitle {
  margin: 0;
  color: rgba(235, 238, 220, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.38em;
  font-size: 0.7rem;
  font-weight: 600;
}

.home-menu {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: min(440px, 78vw);
}

.auth-container--home {
  position: relative;
  z-index: 2;
  justify-items: center;
  margin-top: 20px;
}

.auth-container--home .auth-account {
  padding: 9px 14px;
  border: 1px solid rgba(234, 194, 98, 0.55);
  border-radius: 12px;
  background: rgba(11, 22, 28, 0.5);
}

.auth-container--home .auth-message {
  text-align: center;
}

.auth-screen .home-screen__content {
  min-height: max(760px, 100vh);
}

.auth-screen__panel {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  width: min(520px, 88vw);
  gap: 12px;
  padding: 24px;
  border: 1px solid rgba(234, 194, 98, 0.72);
  border-radius: 18px;
  background: rgba(11, 22, 28, 0.48);
  box-shadow: inset 0 0 0 1px rgba(237, 208, 130, 0.1), 0 14px 35px rgba(7, 12, 18, 0.3);
  backdrop-filter: blur(3px);
  color: #f8e9be;
  text-align: center;
}

.auth-screen__panel h2 {
  margin: 0;
  color: #f6d77a;
  font-family: "Cinzel", Georgia, serif;
  font-size: clamp(1.15rem, 3vw, 1.65rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-screen__description {
  max-width: 420px;
  margin: 0 0 6px;
  color: rgba(235, 238, 220, 0.9);
  line-height: 1.6;
}

.auth-screen__login {
  width: 100%;
  min-height: 68px;
  color: #f8e9be;
  text-align: left;
}

.auth-screen__status {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #f0d88d;
  font-family: "Cinzel", Georgia, serif;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-screen__spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(240, 216, 141, 0.3);
  border-top-color: #f0d88d;
  border-radius: 50%;
  animation: authSpin 0.8s linear infinite;
}

.auth-screen__message {
  margin: 4px 0 0;
  color: #ffd0c8;
}

.settings-screen__account {
  margin: 0 0 18px;
  color: var(--muted);
}

.settings-screen__reset-heading {
  margin: 30px 0 6px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: #ffd0c8;
}

.settings-screen__reset-description {
  max-width: 620px;
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.6;
}

.settings-screen__reset {
  padding: 11px 16px;
  border: 1px solid rgba(255, 109, 109, 0.72);
  border-radius: 10px;
  background: rgba(132, 39, 43, 0.34);
  color: #ffd0c8;
  font-weight: 700;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.settings-screen__reset:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--danger);
  background: rgba(160, 48, 53, 0.54);
}

.settings-screen__reset:disabled {
  cursor: wait;
  opacity: 0.7;
}

.settings-screen__reset-message {
  margin: 12px 0 0;
  color: var(--success);
}

.tutorial-guidebar {
  position: sticky;
  z-index: 20;
  top: 8px;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: min(980px, 100%);
  margin: 0 auto 22px;
  padding: 12px 16px 12px 10px;
  border: 1px solid rgba(235, 199, 108, 0.74);
  border-radius: 16px;
  background: linear-gradient(115deg, rgba(25, 42, 40, 0.97), rgba(10, 24, 29, 0.98));
  color: var(--text);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3), 0 0 20px rgba(226, 183, 77, 0.16);
}

.tutorial-guidebar__character {
  position: relative;
  display: grid;
  align-items: end;
  justify-items: center;
  align-self: stretch;
  min-height: 92px;
  overflow: hidden;
  border-radius: 10px;
  background: radial-gradient(ellipse at 50% 78%, rgba(229, 190, 96, 0.2), transparent 70%);
}

.tutorial-guidebar__boy {
  width: 64px;
  height: 94px;
  object-fit: contain;
  object-position: center bottom;
  image-rendering: pixelated;
  transform-origin: 50% 90%;
}

.tutorial-guidebar--wave .tutorial-guidebar__boy,
.tutorial-guidebar--cheer .tutorial-guidebar__boy {
  animation: tutorialWave 1.8s ease-in-out infinite alternate;
}

.tutorial-guidebar--walk .tutorial-guidebar__boy,
.tutorial-guidebar--run .tutorial-guidebar__boy,
.tutorial-guidebar--bottle .tutorial-guidebar__boy {
  animation: tutorialBob 1s ease-in-out infinite alternate;
}

.tutorial-guidebar--quiz .tutorial-guidebar__boy {
  animation: tutorialHop 1.25s ease-in-out infinite;
}

.tutorial-guidebar--read .tutorial-guidebar__boy,
.tutorial-guidebar--study .tutorial-guidebar__boy {
  transform: translateY(2px);
}

.tutorial-guidebar__copy {
  min-width: 0;
}

.tutorial-guidebar__progress {
  margin: 0 0 4px;
  color: #e6c879;
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.tutorial-guidebar__title {
  margin: 0;
  color: #f4d77e;
  font-family: "Cinzel", Georgia, serif;
  font-size: 1.08rem;
  line-height: 1.3;
}

.tutorial-guidebar__message {
  margin: 5px 0 0;
  color: #e2e6df;
  font-size: 0.82rem;
  line-height: 1.5;
}

.tutorial-guidebar__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 4px;
}

.tutorial-guidebar__actions .primary-btn,
.tutorial-guidebar__actions .ghost-btn {
  white-space: nowrap;
}

.tutorial-focus {
  position: relative;
  z-index: 1;
  outline: 3px solid rgba(255, 218, 105, 0.95);
  outline-offset: 6px;
  box-shadow: 0 0 0 10px rgba(255, 218, 105, 0.13), 0 0 30px rgba(255, 218, 105, 0.35);
  animation: tutorialTargetPulse 1.8s ease-in-out infinite alternate;
  scroll-margin-block: 145px;
}

@keyframes tutorialWave {
  from { transform: rotate(-2deg) translateY(2px); }
  to { transform: rotate(2deg) translateY(-3px); }
}

@keyframes tutorialBob {
  from { transform: translateY(1px); }
  to { transform: translateY(-3px); }
}

@keyframes tutorialHop {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes tutorialTargetPulse {
  from { outline-color: rgba(255, 218, 105, 0.7); }
  to { outline-color: rgba(255, 244, 183, 1); }
}

@media (max-width: 600px) {
  .tutorial-guidebar {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 8px 11px;
    padding: 9px 10px;
  }

  .tutorial-guidebar__character {
    grid-row: span 2;
    min-height: 76px;
  }

  .tutorial-guidebar__boy {
    width: 50px;
    height: 78px;
  }

  .tutorial-guidebar__message {
    font-size: 0.74rem;
  }

  .tutorial-guidebar__actions {
    grid-column: 2;
    flex-direction: row;
    justify-content: flex-end;
  }
}

@keyframes authSpin {
  to {
    transform: rotate(360deg);
  }
}

.home-menu__button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  width: 100%;
  min-height: 68px;
  padding: 16px 22px;
  border: 1px solid rgba(234, 194, 98, 0.82);
  border-radius: 16px;
  background: rgba(11, 22, 28, 0.35);
  color: #f8e9be;
  box-shadow: inset 0 0 0 1px rgba(237, 208, 130, 0.12), 0 10px 30px rgba(7, 12, 18, 0.28);
  backdrop-filter: blur(1px);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.home-menu__button:hover {
  transform: translateY(-2px);
  border-color: rgba(246, 217, 126, 1);
  background: rgba(13, 24, 28, 0.52);
  box-shadow: inset 0 0 0 1px rgba(246, 217, 126, 0.15), 0 16px 34px rgba(6, 10, 16, 0.32);
}

.home-menu__button:active {
  transform: translateY(0);
}

.home-menu__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(248, 222, 150, 0.1);
  border: 1px solid rgba(241, 214, 145, 0.72);
  color: #f0d88d;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.home-menu__label {
  flex: 1;
  font-family: "Cinzel", Georgia, serif;
  font-size: clamp(0.76rem, 1.2vw, 1.05rem);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  text-align: left;
}

.home-screen__fireflies {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.home-screen__firefly {
  position: absolute;
  left: var(--left);
  top: var(--top);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: rgba(252, 255, 214, 0.95);
  box-shadow: 0 0 12px rgba(255, 246, 162, 0.9), 0 0 18px rgba(255, 255, 255, 0.6);
  opacity: 0.65;
  animation: fireflyFloat 7s ease-in-out infinite;
  animation-delay: var(--delay);
}

@keyframes fireflyFloat {
  0%, 100% {
    opacity: 0.34;
    transform: translate3d(0, 0, 0) scale(0.8);
  }
  50% {
    opacity: 1;
    transform: translate3d(0, -10px, 0) scale(1.08);
  }
}

@media (max-width: 900px) {
  .home-screen,
  .home-screen__content {
    min-height: 720px;
  }

  .home-screen__subtitle {
    letter-spacing: 0.22em;
  }
}

@media (max-width: 560px) {
  .home-screen,
  .home-screen__content {
    min-height: 620px;
  }

  .home-screen__content {
    padding-top: 34px;
    padding-bottom: 42px;
  }

  .home-screen__badge {
    min-width: 128px;
    letter-spacing: 0.2em;
  }

  .home-screen__title {
    letter-spacing: 0.08em;
  }

  .home-screen__subtitle {
    letter-spacing: 0.12em;
    font-size: 0.58rem;
  }

  .home-menu {
    width: min(340px, 82vw);
  }

  .home-menu__button {
    min-height: 60px;
  }

  .home-menu__label {
    letter-spacing: 0.08em;
  }
}

.milestone-screen {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  border: 1px solid rgba(221, 180, 101, 0.46);
  border-radius: 26px;
  background: #0a201f;
  box-shadow: 0 28px 70px rgba(4, 10, 18, 0.42);
  isolation: isolate;
}

.milestone-screen__background,
.milestone-screen__shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.milestone-screen__background {
  z-index: -2;
  background-image: url('https://images.unsplash.com/photo-1506744038136-46273834b3fb?auto=format&fit=crop&w=1800&q=80');
  background-size: cover;
  background-position: center;
  filter: saturate(0.9) contrast(1.06) brightness(0.67);
  transform: scale(1.02);
}

.milestone-screen__shade {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(4, 12, 14, 0.23), transparent 17%, transparent 83%, rgba(4, 12, 14, 0.23)),
    linear-gradient(180deg, rgba(6, 15, 18, 0.12), rgba(5, 16, 18, 0.06) 55%, rgba(4, 14, 16, 0.34));
}

.milestone-screen__content {
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: 36px 30px 42px;
  text-align: center;
}

.milestone-brand {
  display: grid;
  justify-items: center;
}

.milestone-brand p,
.milestone-brand h2 {
  margin: 0;
  font-family: "Cinzel", Georgia, serif;
  text-transform: uppercase;
}

.milestone-brand p:first-child {
  min-width: 150px;
  padding: 7px 18px;
  border: 1px solid rgba(237, 201, 112, 0.72);
  border-radius: 12px;
  background: rgba(27, 36, 33, 0.44);
  color: #f4d67f;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  box-shadow: 0 0 22px rgba(20, 24, 19, 0.28);
}

.milestone-brand h2 {
  margin-top: 14px;
  color: #f4d77e;
  font-size: clamp(1.35rem, 2.8vw, 2.4rem);
  letter-spacing: 0.1em;
  text-shadow: 0 2px 14px rgba(35, 24, 9, 0.8), 0 0 24px rgba(243, 210, 124, 0.32);
}

.milestone-brand p:last-child {
  margin-top: 7px;
  color: rgba(244, 239, 216, 0.88);
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.34em;
}

.milestone-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: min(390px, 100%);
  margin: 20px auto 24px;
  color: #f3e1ac;
  font-family: "Cinzel", Georgia, serif;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.milestone-summary__track {
  display: block;
  width: 120px;
  height: 5px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 240, 179, 0.2);
  box-shadow: 0 0 8px rgba(244, 211, 122, 0.22);
}

.milestone-summary__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #ffe17e;
  box-shadow: 0 0 9px rgba(255, 225, 126, 0.9);
  transition: width 0.35s ease;
}

.milestone-journey {
  padding: 10px 8px 0;
}

.milestone-row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--row-count, 5), minmax(0, 1fr));
  min-height: 172px;
  gap: 12px 0;
}

.milestone-row:not(:last-child) {
  margin-bottom: 12px;
}

.milestone-row::before {
  position: absolute;
  top: 34px;
  right: 6.25%;
  left: 6.25%;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, rgba(255, 225, 126, 0.78), #fff0a1 50%, rgba(255, 225, 126, 0.78));
  box-shadow: 0 0 9px rgba(255, 226, 125, 0.86), 0 0 20px rgba(255, 222, 112, 0.48);
}

.milestone-row:not(:last-child)::after {
  position: absolute;
  top: 35px;
  height: 184px;
  width: 2px;
  content: "";
  background: #ffe58a;
  box-shadow: 0 0 9px rgba(255, 226, 125, 0.9), 0 0 18px rgba(255, 222, 112, 0.48);
}

.milestone-row--final::after {
  display: none;
}

.milestone-row:not(.milestone-row--reverse):not(:last-child)::after {
  right: 6.25%;
}

.milestone-row--reverse {
  direction: rtl;
}

.milestone-row--reverse .milestone-node {
  direction: ltr;
}

.milestone-row--reverse:not(:last-child)::after {
  left: 6.25%;
}

.milestone-node {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  color: #eee3be;
}

.milestone-node__seal {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  padding: 14px;
  border: 2px solid rgba(244, 212, 123, 0.9);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, rgba(72, 67, 46, 0.96), rgba(17, 29, 25, 0.96) 72%);
  color: #f2d77f;
  box-shadow: inset 0 0 0 3px rgba(247, 220, 148, 0.1), 0 0 14px rgba(11, 17, 16, 0.75);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.milestone-node__seal svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.milestone-node__seal:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.04);
  border-color: #fff0ab;
  box-shadow: inset 0 0 0 3px rgba(247, 220, 148, 0.17), 0 0 24px rgba(255, 223, 121, 0.7);
}

.milestone-node__seal:disabled {
  cursor: not-allowed;
}

.milestone-node--completed .milestone-node__seal {
  background: radial-gradient(circle at 35% 25%, rgba(139, 112, 45, 0.98), rgba(37, 39, 24, 0.98) 72%);
}

.milestone-node--current .milestone-node__seal {
  border-width: 3px;
  box-shadow: 0 0 0 6px rgba(255, 224, 124, 0.18), 0 0 26px rgba(255, 226, 127, 0.88);
  animation: milestonePulse 3.6s ease-in-out infinite;
}

.milestone-node--locked {
  color: rgba(238, 227, 190, 0.64);
}

.milestone-node--locked .milestone-node__seal {
  border-color: rgba(212, 190, 132, 0.46);
  background: rgba(17, 29, 26, 0.76);
  color: rgba(240, 218, 154, 0.62);
  box-shadow: inset 0 0 0 3px rgba(247, 220, 148, 0.05), 0 0 12px rgba(11, 17, 16, 0.55);
}

.milestone-node__number,
.milestone-node__title {
  display: block;
  max-width: 100%;
  font-family: "Cinzel", Georgia, serif;
  text-transform: uppercase;
}

.milestone-node__number {
  margin-top: 9px;
  color: #f2d991;
  font-size: 0.57rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.milestone-node__title {
  margin-top: 3px;
  padding: 0 4px;
  color: #f0ebd8;
  font-size: 0.57rem;
  line-height: 1.35;
  letter-spacing: 0.025em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
}

.milestone-details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px 18px;
  width: min(620px, 100%);
  margin: 4px auto 0;
  padding: 15px 22px;
  border: 1px solid rgba(240, 204, 112, 0.84);
  border-radius: 12px;
  background: rgba(25, 31, 25, 0.68);
  color: #f4e8c0;
  box-shadow: 0 0 23px rgba(244, 209, 115, 0.22), inset 0 0 0 1px rgba(251, 226, 154, 0.13);
  backdrop-filter: blur(2px);
  text-align: left;
}

.milestone-details__eyebrow,
.milestone-details__source,
.milestone-details__progress {
  margin: 0;
  font-family: "Cinzel", Georgia, serif;
  text-transform: uppercase;
}

.milestone-details__eyebrow {
  color: #efd27d;
  font-size: 0.61rem;
  letter-spacing: 0.1em;
}

.milestone-details h3 {
  flex: 1 1 150px;
  margin: 0;
  color: #ffebad;
  font-family: "Cinzel", Georgia, serif;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.milestone-details__source,
.milestone-status {
  color: rgba(247, 239, 215, 0.86);
  font-size: 0.68rem;
}

.milestone-status {
  width: 100%;
  margin: 0;
}

.milestone-status--completed {
  color: #f5dc8e;
}

.milestone-status--locked {
  color: rgba(232, 224, 199, 0.68);
}

.milestone-continue {
  padding: 8px 12px;
  border: 1px solid rgba(244, 211, 124, 0.72);
  border-radius: 7px;
  background: rgba(214, 174, 81, 0.16);
  color: #ffebad;
  font-family: "Cinzel", Georgia, serif;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.milestone-continue:hover {
  background: rgba(214, 174, 81, 0.3);
  box-shadow: 0 0 14px rgba(255, 223, 121, 0.3);
}

.milestone-details__note,
.milestone-details__progress {
  width: 100%;
  margin: 0;
  color: rgba(247, 239, 215, 0.8);
  font-size: 0.66rem;
  line-height: 1.55;
}

.milestone-details__progress {
  color: #e9d393;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
}

.source-lesson {
  max-width: 940px;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 42px);
  border: 1px solid rgba(215, 178, 93, 0.35);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(26, 48, 55, 0.97), rgba(13, 28, 35, 0.98));
  box-shadow: var(--shadow);
}

.source-lesson__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(215, 178, 93, 0.3);
}

.source-lesson__header h2 {
  margin: 0;
  color: var(--gold-soft);
  font-family: "Cinzel", Georgia, serif;
  letter-spacing: 0.06em;
}

.source-lesson__header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.source-lesson__notice {
  margin: 18px 0 24px;
  padding: 12px 14px;
  border-left: 3px solid var(--gold);
  background: rgba(215, 178, 93, 0.08);
  color: #e6d7ad;
  font-size: 0.85rem;
  line-height: 1.65;
}

.source-lesson__content {
  color: #e7edf0;
  line-height: 1.8;
}

.source-lesson__section-title {
  margin: 28px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(215, 178, 93, 0.24);
  color: #f0d98e;
  font-family: "Cinzel", Georgia, serif;
  font-size: 1.08rem;
  letter-spacing: 0.035em;
}

.source-lesson__paragraph {
  margin: 0 0 11px;
  white-space: pre-wrap;
}

.source-lesson-loading {
  max-width: 800px;
  margin: 0 auto;
  padding: 34px;
  border: 1px solid rgba(215, 178, 93, 0.35);
  border-radius: 16px;
  background: rgba(18, 35, 49, 0.95);
  color: var(--gold-soft);
  text-align: center;
}

.milestone-error {
  padding: 36px;
  border: 1px solid rgba(255, 215, 120, 0.55);
  border-radius: 14px;
  background: rgba(21, 31, 30, 0.92);
  color: #f5e7c1;
  line-height: 1.6;
}

.milestone-unlock {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 24px;
  background:
    radial-gradient(circle at center, rgba(111, 75, 25, 0.36), transparent 38%),
    rgba(3, 10, 12, 0.82);
  opacity: 0;
  backdrop-filter: blur(0);
  transition: opacity 320ms ease, backdrop-filter 320ms ease;
}

.milestone-unlock--visible {
  opacity: 1;
  backdrop-filter: blur(8px);
}

.milestone-unlock__burst {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.milestone-unlock__burst::before,
.milestone-unlock__burst::after {
  position: absolute;
  inset: -46vmax;
  border-radius: 50%;
  content: "";
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 225, 126, 0.12) 0deg 2deg,
    transparent 2deg 14deg
  );
  mask-image: radial-gradient(circle, #000 0 10%, transparent 68%);
  animation: milestoneUnlockRays 18s linear infinite;
}

.milestone-unlock__burst::after {
  transform: rotate(8deg) scale(0.76);
  opacity: 0.55;
  animation-direction: reverse;
}

.milestone-unlock__spark {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff2b5;
  box-shadow: 0 0 10px 3px rgba(255, 222, 118, 0.9), 0 0 25px rgba(255, 196, 71, 0.75);
  transform: rotate(var(--spark-angle)) translateY(0) scale(0);
  animation: milestoneUnlockSpark 1050ms cubic-bezier(0.16, 0.8, 0.24, 1) var(--spark-delay) both;
}

.milestone-unlock__card {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  width: min(540px, 100%);
  padding: clamp(30px, 6vw, 58px) clamp(22px, 5vw, 52px);
  border: 1px solid rgba(255, 229, 148, 0.92);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(44, 39, 25, 0.97), rgba(9, 26, 25, 0.98) 66%),
    #0d211f;
  box-shadow:
    0 0 0 1px rgba(255, 233, 162, 0.25),
    0 0 48px rgba(255, 207, 82, 0.38),
    0 24px 90px rgba(0, 0, 0, 0.68),
    inset 0 0 36px rgba(255, 217, 111, 0.08);
  text-align: center;
  transform: translateY(26px) scale(0.78);
  opacity: 0;
  transition: transform 700ms cubic-bezier(0.18, 1.35, 0.35, 1) 100ms, opacity 350ms ease 100ms;
}

.milestone-unlock--visible .milestone-unlock__card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.milestone-unlock__crest {
  display: grid;
  place-items: center;
  width: 94px;
  height: 94px;
  margin: -4px 0 21px;
  padding: 20px;
  border: 2px solid #ffe28a;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 228, 143, 0.3), rgba(107, 77, 25, 0.48) 64%, rgba(12, 28, 26, 0.92));
  color: #ffebaa;
  box-shadow: 0 0 0 8px rgba(255, 226, 138, 0.1), 0 0 38px rgba(255, 213, 91, 0.9);
  animation: milestoneUnlockCrest 1600ms ease-in-out infinite alternate;
}

.milestone-unlock__crest svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.milestone-unlock__eyebrow,
.milestone-unlock__card h2,
.milestone-unlock__name {
  margin: 0;
  font-family: "Cinzel", Georgia, serif;
  text-transform: uppercase;
}

.milestone-unlock__eyebrow {
  color: #ffe59a;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.32em;
}

.milestone-unlock__card h2 {
  margin-top: 10px;
  color: #fff0b4;
  font-size: clamp(1.5rem, 5vw, 2.35rem);
  letter-spacing: 0.08em;
  text-shadow: 0 0 18px rgba(255, 218, 105, 0.8);
}

.milestone-unlock__name {
  margin-top: 12px;
  color: rgba(247, 239, 215, 0.88);
  font-size: 0.78rem;
  line-height: 1.7;
  letter-spacing: 0.055em;
}

.milestone-unlock__continue {
  margin-top: 28px;
  padding: 13px 22px;
  border: 1px solid #fff0ac;
  border-radius: 8px;
  background: linear-gradient(135deg, #f7da84, #c69c42);
  color: #211b0e;
  font-family: "Cinzel", Georgia, serif;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  box-shadow: 0 0 22px rgba(255, 219, 106, 0.48);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.milestone-unlock__continue:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 0 32px rgba(255, 219, 106, 0.78);
}

@keyframes milestoneUnlockRays {
  to {
    transform: rotate(360deg);
  }
}

@keyframes milestoneUnlockSpark {
  0% {
    opacity: 0;
    transform: rotate(var(--spark-angle)) translateY(0) scale(0.2);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(var(--spark-angle)) translateY(-min(30vw, 250px)) scale(1.35);
  }
}

@keyframes milestoneUnlockCrest {
  from {
    transform: scale(0.96);
    box-shadow: 0 0 0 6px rgba(255, 226, 138, 0.08), 0 0 24px rgba(255, 213, 91, 0.62);
  }
  to {
    transform: scale(1.06);
    box-shadow: 0 0 0 12px rgba(255, 226, 138, 0.16), 0 0 48px rgba(255, 213, 91, 1);
  }
}

@keyframes milestonePulse {
  0%, 100% {
    box-shadow: 0 0 0 5px rgba(255, 224, 124, 0.13), 0 0 18px rgba(255, 226, 127, 0.7);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(255, 224, 124, 0.2), 0 0 30px rgba(255, 226, 127, 0.95);
  }
}

@media (max-width: 900px) {
  .milestone-screen {
    min-height: 100vh;
  }

  .milestone-screen__content {
    padding-inline: 14px;
  }

  .milestone-journey {
    overflow-x: auto;
    padding-inline: 2px;
  }

  .milestone-row {
    min-width: 760px;
    min-height: 160px;
  }

  .milestone-row:not(:last-child)::after {
    height: 172px;
  }
}

@media (max-width: 560px) {
  .source-lesson__header {
    flex-direction: column;
  }

  .milestone-screen {
    min-height: 100vh;
    border-radius: 18px;
  }

  .milestone-screen__content {
    padding: 28px 10px 30px;
  }

  .milestone-brand p:last-child {
    letter-spacing: 0.2em;
  }

  .milestone-summary {
    font-size: 0.65rem;
  }

  .milestone-node__seal {
    width: 58px;
    height: 58px;
  }

  .milestone-details {
    gap: 8px 12px;
    padding: 13px;
  }
}

body.milestone-mode .app-shell {
  max-width: none;
  min-height: 100vh;
  padding: 0;
}

body.milestone-mode .topbar {
  display: none;
}

body.milestone-mode .layout {
  display: block;
  margin: 0;
}

body.milestone-mode .main-panel {
  min-height: 100vh;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.auth-mode .app-shell {
  max-width: none;
  min-height: 100vh;
  padding: 0;
}

body.auth-mode .topbar {
  display: none;
}

body.auth-mode .layout {
  display: block;
  margin: 0;
}

body.auth-mode .main-panel {
  min-height: 100vh;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .tutorial-guidebar__boy,
  .tutorial-focus {
    animation: none;
  }

  .milestone-node--current .milestone-node__seal {
    animation: none;
  }

  .milestone-unlock,
  .milestone-unlock__card {
    transition: none;
  }

  .milestone-unlock__burst::before,
  .milestone-unlock__burst::after,
  .milestone-unlock__spark,
  .milestone-unlock__crest {
    animation: none;
  }

  .auth-screen__spinner {
    animation: none;
  }

  .vocab-bottle__firefly,
  .vocab-bottle__firefly--released {
    animation: none;
  }
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-header h2,
.panel-header h3,
.card-title,
.metric h3 {
  margin: 0;
  font-family: var(--pixel-font);
}

.hero-grid,
.stats-grid,
.card-grid,
.lesson-list {
  display: grid;
  gap: 18px;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(250px, 0.7fr);
}

.hero-panel,
.metric-card,
.info-card,
.section-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(26, 50, 69, 0.96), rgba(16, 27, 38, 0.96));
  padding: 18px;
}

.hero-panel {
  min-height: 240px;
  background:
    linear-gradient(180deg, rgba(25, 56, 74, 0.9), rgba(15, 27, 34, 0.95)),
    linear-gradient(135deg, rgba(44, 97, 76, 0.6), transparent 40%);
}

.hero-panel h2 {
  font-family: var(--pixel-font);
  font-size: clamp(1.5rem, 2vw, 2.4rem);
  margin: 0 0 8px;
}

.hero-panel p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 18px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.primary-btn,
.secondary-btn {
  padding: 12px 16px;
  font-weight: 700;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.metric-card {
  padding: 18px 16px;
}

.metric-card strong {
  display: block;
  font-size: 1.8rem;
  margin-top: 12px;
}

.progress-shell {
  margin-top: 20px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  height: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--forest-soft), var(--gold));
  border-radius: inherit;
}

.mini-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  gap: 10px;
}

.mini-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.card-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 18px;
}

.info-card {
  min-height: 150px;
}

.section-card {
  margin-top: 20px;
}

.section-card h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.empty-state {
  color: var(--muted);
  line-height: 1.6;
}

.vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.vocab-card {
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.vocab-carousel {
  grid-template-columns: minmax(0, 1fr);
  max-width: 960px;
  margin-inline: auto;
  gap: 14px;
}

.vocab-carousel__card {
  min-height: 360px;
  padding: clamp(24px, 5vw, 48px);
  touch-action: pan-y;
}

.vocab-carousel__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 4px 0 12px;
}

.vocab-carousel__controls button {
  min-width: 140px;
  padding: 12px 18px;
}

.vocab-carousel__controls button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.vocab-carousel__counter {
  min-width: 76px;
  color: var(--gold-soft);
  font-weight: 700;
  text-align: center;
}

.vocab-listen-button {
  border-color: rgba(215, 178, 93, 0.55);
  color: var(--gold-soft);
}

.vocab-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.vocab-card h3 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.word-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(215, 178, 93, 0.45);
  background: rgba(215, 178, 93, 0.1);
  color: var(--gold-soft);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.compact-btn {
  padding: 8px 12px;
  font-size: 0.82rem;
}

.vocab-meaning,
.vocab-example,
.detail-row {
  margin: 0;
  line-height: 1.55;
}

.vocab-meaning {
  font-weight: 700;
  color: var(--gold-soft);
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  line-height: 1.65;
}

.vocab-example {
  color: var(--muted);
  margin-top: 18px;
  font-size: clamp(1rem, 1.7vw, 1.2rem);
  line-height: 1.8;
}

.vocab-example strong {
  color: var(--gold-soft);
  font-weight: 800;
}

.vocab-details {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.vocabulary-review__controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 280px);
  gap: 12px;
  margin-top: 20px;
}

.vocabulary-review__search,
.vocabulary-review__filter {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(215, 178, 93, 0.45);
  border-radius: 12px;
  background: rgba(9, 24, 27, 0.82);
  color: var(--text);
  font: inherit;
}

.vocabulary-review__search::placeholder {
  color: var(--muted);
}

.vocabulary-review__count {
  margin: 14px 0 0;
  color: var(--gold-soft);
  font-size: 0.88rem;
  font-weight: 700;
}

.vocabulary-review__list {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
}

.vocabulary-review__card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vocabulary-review__card .vocab-card-top {
  justify-content: flex-start;
  margin-bottom: 0;
}

.vocabulary-review__card h3 {
  overflow-wrap: anywhere;
}

.vocabulary-review__details {
  margin-top: auto;
  padding-top: 8px;
  color: var(--muted);
}

.vocabulary-review__details summary {
  width: fit-content;
  color: var(--gold-soft);
  cursor: pointer;
  font-weight: 700;
}

.vocabulary-review__details .detail-row {
  margin-top: 8px;
}

.detail-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.vocab-bottle {
  overflow: hidden;
  text-align: center;
}

.vocab-bottle .panel-header {
  text-align: left;
}

.vocab-bottle__intro,
.vocab-bottle__status {
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.65;
}

.vocab-bottle__scene {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 470px;
  margin: 8px auto 0;
  overflow: visible;
  isolation: isolate;
}

.vocab-bottle__jar {
  position: relative;
  z-index: 1;
  width: min(320px, 68vw);
  height: 390px;
  filter: drop-shadow(0 18px 24px rgba(2, 8, 15, 0.5));
}

.vocab-bottle__neck {
  position: absolute;
  z-index: 1;
  top: 26px;
  left: 50%;
  width: 132px;
  height: 58px;
  transform: translateX(-50%);
  border: 3px solid rgba(191, 230, 222, 0.75);
  border-bottom: 0;
  border-radius: 23px 23px 0 0;
  background: linear-gradient(90deg, rgba(94, 156, 148, 0.2), rgba(219, 249, 224, 0.48) 48%, rgba(84, 145, 139, 0.2));
}

.vocab-bottle__cork {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 50%;
  width: 76px;
  height: 43px;
  transform: translateX(-50%);
  border: 2px solid rgba(235, 199, 128, 0.8);
  border-radius: 9px 9px 6px 6px;
  background: linear-gradient(90deg, #76502d, #c49655 48%, #694526);
  box-shadow: inset 0 0 0 3px rgba(49, 29, 14, 0.15), 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: transform 0.65s ease;
}

.vocab-bottle__cork--open {
  transform: translate(58px, -32px) rotate(32deg);
}

.vocab-bottle__glass {
  position: absolute;
  inset: 70px 0 0;
  overflow: hidden;
  border: 3px solid rgba(191, 230, 222, 0.78);
  border-radius: 30% 30% 22% 22% / 17% 17% 11% 11%;
  background: linear-gradient(105deg, rgba(165, 221, 213, 0.18), rgba(211, 246, 224, 0.27) 34%, rgba(74, 134, 131, 0.2) 72%, rgba(211, 246, 224, 0.24));
  box-shadow:
    inset 14px 0 22px rgba(213, 247, 225, 0.13),
    inset -12px 0 18px rgba(30, 78, 83, 0.28),
    0 0 26px rgba(144, 213, 195, 0.15);
}

.vocab-bottle__glass::before {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: calc(var(--fill-ratio, 0) * 100%);
  content: "";
  background: linear-gradient(180deg, rgba(120, 214, 167, 0.06), rgba(36, 119, 112, 0.32));
  transition: height 1s ease;
}

.vocab-bottle__glass::after {
  position: absolute;
  top: 14%;
  bottom: 14%;
  left: 12%;
  width: 8px;
  content: "";
  border-radius: 999px;
  background: linear-gradient(180deg, transparent, rgba(239, 255, 232, 0.28), transparent);
}

.vocab-bottle__fireflies {
  position: absolute;
  z-index: 1;
  inset: 32px 29px 24px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(16, 11px);
  justify-items: center;
  align-content: end;
  gap: 4px 3px;
}

.vocab-bottle__firefly {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff8b0;
  box-shadow: 0 0 5px 2px rgba(255, 241, 147, 0.72), 0 0 13px 4px rgba(247, 224, 97, 0.38);
  animation: bottleFireflyFloat 2.8s ease-in-out infinite alternate;
  animation-delay: var(--fly-delay, 0s);
}

.vocab-bottle__scene--released .vocab-bottle__fireflies {
  z-index: 2;
  inset: 0;
  display: block;
  overflow: visible;
  pointer-events: none;
}

.vocab-bottle__firefly--released {
  position: absolute;
  top: 14%;
  left: 50%;
  animation: bottleFireflyRelease 3.2s ease-out forwards;
}

.vocab-bottle__count {
  margin: 2px 0 10px;
  color: var(--gold-soft);
  font-family: "Cinzel", Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.vocab-bottle__progress {
  width: min(380px, 80%);
  height: 10px;
  margin: 0 auto 12px;
  overflow: hidden;
  border: 1px solid rgba(215, 178, 93, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.vocab-bottle__progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #48a987, #f0d98e);
  box-shadow: 0 0 10px rgba(240, 217, 142, 0.58);
  transition: width 0.7s ease;
}

.vocab-bottle__status {
  color: var(--muted);
}

.vocab-bottle__release {
  display: block;
  margin: 22px auto 0;
  padding-inline: 24px;
}

.firefly-video-dialog {
  width: min(1000px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100% - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(235, 199, 108, 0.82);
  border-radius: 18px;
  background: linear-gradient(145deg, #142725, #081418);
  color: var(--text);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.72), 0 0 38px rgba(226, 183, 77, 0.2);
}

.firefly-video-dialog::backdrop {
  background: rgba(2, 8, 12, 0.84);
  backdrop-filter: blur(7px);
}

.firefly-video-dialog__content {
  padding: clamp(16px, 3vw, 28px);
}

.firefly-video-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.firefly-video-dialog__header h2 {
  margin: 0;
  color: #f4d77e;
  font-family: "Cinzel", Georgia, serif;
  font-size: clamp(1.1rem, 3vw, 1.65rem);
}

.firefly-video-dialog__video {
  display: block;
  width: 100%;
  max-height: 72vh;
  border-radius: 10px;
  background: #030809;
}

.firefly-video-dialog__status {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

@keyframes bottleFireflyFloat {
  from {
    opacity: 0.58;
    transform: translateY(2px) scale(0.78);
  }
  to {
    opacity: 1;
    transform: translateY(-3px) scale(1.08);
  }
}

@keyframes bottleFireflyRelease {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(0.9);
  }
  78% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--release-x, 0), var(--release-y, 0)) scale(0.25);
  }
}

@media (max-width: 620px) {
  .vocabulary-review__controls {
    grid-template-columns: 1fr;
  }
}

.nested-card {
  margin-top: 20px;
}

.quiz-item {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.quiz-item p {
  margin-top: 0;
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.option-btn {
  justify-content: center;
}

.option-btn.correct {
  background: rgba(122, 211, 163, 0.2);
  border-color: rgba(122, 211, 163, 0.84);
}

.option-btn.wrong {
  background: rgba(255, 109, 109, 0.12);
  border-color: rgba(255, 109, 109, 0.7);
}

.success-text {
  color: var(--success);
  font-weight: 700;
  margin-top: 12px;
}

.error-text {
  color: #ffb1b1;
  font-weight: 700;
  margin-top: 12px;
}

.correct-answer-text {
  margin: 8px 0 0;
  color: var(--gold-soft);
  font-weight: 700;
}

.reading-passage {
  margin-top: 14px;
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  line-height: 1.75;
  white-space: pre-line;
}

.reading-passage__paragraph + .reading-passage__paragraph {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid rgba(215, 178, 93, 0.2);
}

.reading-passage__paragraph > p {
  margin: 0;
}

.passage-translation {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.passage-translation summary {
  width: fit-content;
  color: var(--gold-soft);
  cursor: pointer;
}

.passage-translation summary:hover,
.passage-translation summary:focus-visible {
  color: var(--text);
}

.passage-translation__text {
  margin: 8px 0 0;
  padding: 8px 12px;
  border-left: 2px solid var(--border);
  line-height: 1.6;
  white-space: pre-line;
}

.passage-translation__text strong {
  color: var(--gold-soft);
  font-weight: 800;
}

.passage-translation__retry {
  margin-left: 8px;
}

.highlight-word {
  border: none;
  background: rgba(215, 178, 93, 0.18);
  color: var(--gold-soft);
  border-radius: 8px;
  padding: 2px 6px;
  margin: 0 2px;
  font-weight: 700;
  cursor: pointer;
}

.target-vocab {
  margin-top: 22px;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 8px 12px;
}

.word-popover {
  position: fixed;
  z-index: 50;
  width: 260px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(12, 23, 31, 0.98);
  border: 2px solid rgba(215, 178, 93, 0.5);
  box-shadow: var(--shadow);
}

.word-popover h4 {
  margin: 0 0 8px;
  font-family: var(--pixel-font);
}

.word-popover p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.5;
}

.quiz-list {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.quiz-card {
  padding: 18px;
  border: 2px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}

.question-hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.question-hint summary {
  width: fit-content;
  color: var(--gold-soft);
  cursor: pointer;
}

.question-hint summary:hover,
.question-hint summary:focus-visible {
  color: var(--text);
}

.question-hint p {
  margin: 8px 0 0;
  padding-left: 12px;
  border-left: 2px solid var(--border);
  line-height: 1.5;
}

.after-read-vocabulary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin: 18px 0 6px;
  padding: 10px 12px;
  border: 1px solid rgba(215, 178, 93, 0.28);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.after-read-vocabulary__label {
  color: var(--gold-soft);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.after-read-vocabulary__strip {
  display: flex;
  min-width: 0;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 1px 5px;
  scrollbar-width: thin;
}

.after-read-vocabulary__word {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid rgba(215, 178, 93, 0.36);
  border-radius: 999px;
  background: rgba(215, 178, 93, 0.08);
  color: var(--text);
  font-size: 0.75rem;
}

.after-read-vocabulary__word:hover {
  border-color: var(--gold-soft);
  color: var(--gold-soft);
}

.question-options {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.word-bank-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 18px;
}

.word-bank-chip {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(215, 178, 93, 0.5);
  background: rgba(215, 178, 93, 0.12);
  color: var(--gold-soft);
  font-weight: 700;
}

.word-bank-answers {
  display: grid;
  gap: 12px;
}

.word-bank-row {
  display: grid;
  gap: 8px;
}

.word-bank-row label {
  color: var(--muted);
  line-height: 1.5;
}

.text-answer {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(9, 18, 26, 0.65);
  color: var(--text);
}

.text-answer.correct {
  border-color: rgba(122, 211, 163, 0.84);
  background: rgba(122, 211, 163, 0.12);
}

.text-answer.wrong {
  border-color: rgba(255, 109, 109, 0.7);
  background: rgba(255, 109, 109, 0.1);
}

.xp-burst {
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(215, 178, 93, 0.18);
  border: 1px solid rgba(215, 178, 93, 0.55);
  color: var(--gold-soft);
  font-weight: 700;
  animation: floatXp 0.7s ease-out forwards;
}

.quiz-card {
  position: relative;
}

.retry-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 14, 20, 0.72);
  display: grid;
  place-items: center;
  z-index: 100;
}

.retry-modal {
  width: min(420px, calc(100vw - 24px));
  padding: 22px 20px;
  border-radius: 18px;
  border: 2px solid rgba(215, 178, 93, 0.55);
  background: rgba(15, 28, 39, 0.98);
  box-shadow: var(--shadow);
}

.retry-modal h3 {
  margin: 0 0 12px;
  font-family: var(--pixel-font);
}

.retry-modal p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
}

.retry-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.retry-banner {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 109, 109, 0.7);
  background: rgba(255, 109, 109, 0.12);
  color: #ffd8d8;
  font-weight: 700;
}

@keyframes floatXp {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.8);
  }
  20% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-18px) scale(1.08);
  }
}

.small-btn {
  margin-top: 8px;
  padding: 8px 10px;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 12px;
  }

  .main-nav {
    display: flex;
    flex-direction: column;
  }

  .nav-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .nav-group--lesson {
    display: flex;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 14px 12px 24px;
  }

  .topbar {
    flex-wrap: wrap;
    justify-content: center;
  }

  .brand {
    width: 100%;
    justify-content: center;
  }

  .topbar-stats {
    width: 100%;
    justify-content: center;
  }

  .main-panel {
    padding: 16px;
  }

  .after-read-vocabulary {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
