/* ==========================================================================
   Luminova Kids — оформлення v2
   Світлий фон, bento-сітка, об'ємні кнопки, пастельне кодування напрямків.
   Шрифти: Unbounded (заголовки) + Manrope (текст)
   ========================================================================== */

/* --- 1. Токени ----------------------------------------------------------- */
:root {
  --ink:        #1A1B33;
  --ink-2:      #34365C;
  --muted:      #6E718F;
  --white:      #FFFFFF;
  --bg:         #FFFFFF;
  --bg-soft:    #F6F7FC;
  --line:       #E7E8F4;

  /* з логотипа: бірюзовий фон + золоті зірки */
  --teal:       #046B82;
  --teal-deep:  #024E60;
  --teal-dark:  #023642;
  --brand:      #F9BF1A;   /* золото — головна кнопка */
  --brand-deep: #D19A00;

  --coral:      #FF6B5A;
  --coral-deep: #E2492F;
  --mint:       #17C4A6;   /* успіх у грі */
  --mint-deep:  #0FA189;
  --violet:     #8B6BFF;
  --sky:        #3E8FD6;

  --p-yellow:   #FFF3CE;
  --p-teal:     #DCEFF4;
  --p-blue:     #DCEFF4;
  --p-green:    #D8F7EC;
  --p-lilac:    #EDE6FF;
  --p-peach:    #FFE4DC;

  --accent:      var(--brand);
  --accent-deep: var(--brand-deep);

  --r-sm: 14px;
  --r-md: 24px;
  --r-lg: 32px;
  --r-xl: 44px;

  --shadow-sm: 0 2px 10px rgba(26, 27, 51, .05);
  --shadow-md: 0 12px 34px rgba(26, 27, 51, .09);
  --shadow-lg: 0 28px 70px rgba(26, 27, 51, .16);

  --wrap: 1200px;
  --gutter: clamp(20px, 5vw, 56px);

  --f-display: 'Unbounded', 'Trebuchet MS', sans-serif;
  --f-body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

/* --- 2. Скидання --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 6px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--ink); color: var(--white); padding: 12px 20px;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  font-weight: 700; text-decoration: none; transition: top .18s var(--ease);
}
.skip-link:focus { top: 0; }

/* --- 3. Типографіка ------------------------------------------------------ */
h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 700; line-height: 1.1;
  letter-spacing: -.025em; margin: 0 0 .5em;
}
h1 { font-size: clamp(2.3rem, 5.4vw, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 3.8vw, 2.8rem); }
h3 { font-size: clamp(1.1rem, 1.9vw, 1.4rem); }
h4 { font-size: 1.02rem; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

.eyebrow {
  display: inline-block;
  font-family: var(--f-display);
  font-size: .7rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--teal-deep);
  background: var(--p-teal);
  padding: 7px 16px; border-radius: 100px;
  margin: 0 0 1.2rem;
}

.lede {
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
  line-height: 1.6; color: var(--ink-2); max-width: 56ch;
}

/* --- 4. Розкладка -------------------------------------------------------- */
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: 780px; }

.band { padding-block: clamp(60px, 8vw, 110px); }
.band--tight { padding-block: clamp(40px, 5vw, 68px); }
.band--soft { background: var(--bg-soft); }

.band-head { max-width: 60ch; margin-bottom: clamp(30px, 4.5vw, 54px); }
.band-head--center { margin-inline: auto; text-align: center; }

/* --- 5. Кнопки (об'ємні) ------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 32px;
  border: 0; border-radius: 100px;
  font-family: var(--f-display); font-size: .95rem; font-weight: 700;
  text-decoration: none; cursor: pointer;
  transition: transform .14s var(--ease), box-shadow .14s var(--ease),
              background-color .18s var(--ease);
}
.btn--primary {
  background: var(--brand); color: var(--ink);
  box-shadow: 0 6px 0 var(--brand-deep);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--brand-deep); }
.btn--primary:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--brand-deep); }

.btn--coral {
  background: var(--coral); color: var(--white);
  box-shadow: 0 6px 0 var(--coral-deep);
}
.btn--coral:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--coral-deep); }
.btn--coral:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--coral-deep); }

.btn--teal {
  background: var(--teal); color: var(--white);
  box-shadow: 0 6px 0 var(--teal-deep);
}
.btn--teal:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--teal-deep); }
.btn--teal:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--teal-deep); }

.btn--ghost {
  background: var(--white); color: var(--ink);
  box-shadow: 0 0 0 2px var(--line) inset;
}
.btn--ghost:hover { background: var(--bg-soft); transform: translateY(-2px); }

.btn--sm { padding: 11px 22px; font-size: .84rem; box-shadow: 0 4px 0 var(--brand-deep); }
.btn--sm:hover { box-shadow: 0 6px 0 var(--brand-deep); }
.btn--lg { padding: 20px 42px; font-size: 1.05rem; }

/* --- 6. Шапка ------------------------------------------------------------ */
.site-head {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-head__inner { display: flex; align-items: center; gap: 20px; min-height: 76px; }

.logo {
  display: inline-flex; align-items: center; gap: 11px;
  text-decoration: none; font-family: var(--f-display);
  font-weight: 800; font-size: 1.06rem; letter-spacing: -.02em; flex-shrink: 0;
}
.logo__mark { width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 12px; object-fit: cover; }
.logo__text small {
  display: block; font-family: var(--f-body);
  font-size: .62rem; font-weight: 600; letter-spacing: .11em;
  text-transform: uppercase; color: var(--muted); margin-top: -2px;
}

.nav { margin-left: auto; }
.nav__list { display: flex; align-items: center; gap: 3px; list-style: none; margin: 0; padding: 0; }
.nav__link {
  display: block; padding: 9px 15px; border-radius: 100px;
  text-decoration: none; font-size: .92rem; font-weight: 600;
  transition: background-color .16s var(--ease);
}
.nav__link:hover { background: var(--bg-soft); }
.nav__link[aria-current='page'] { background: var(--p-teal); }

.nav-toggle {
  display: none; margin-left: auto; width: 46px; height: 46px;
  align-items: center; justify-content: center;
  background: var(--white); border: 1px solid var(--line);
  border-radius: 14px; cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded='true'] .icon-close { display: block; }
.nav-toggle[aria-expanded='true'] .icon-open { display: none; }

@media (max-width: 980px) {
  .nav-toggle { display: flex; }
  .nav {
    position: fixed; inset: 76px 0 auto; background: var(--white);
    border-bottom: 1px solid var(--line); padding: 12px var(--gutter) 26px;
    margin-left: 0; display: none; box-shadow: var(--shadow-md);
  }
  .nav[data-open='true'] { display: block; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav__link { padding: 14px 16px; border-radius: var(--r-sm); font-size: 1.02rem; }
  .nav__cta { margin-top: 14px; }
  .nav__cta .btn { width: 100%; }
}

/* --- 7. Головний екран (спліт) ------------------------------------------ */
.hero { position: relative; overflow: hidden; padding-block: clamp(40px, 6vw, 80px); }
.hero::before {
  content: ''; position: absolute; inset: -30% -20% auto; height: 130%; z-index: 0;
  background:
    radial-gradient(ellipse 40% 45% at 18% 30%, rgba(249, 191, 26, .30), transparent 65%),
    radial-gradient(ellipse 44% 48% at 84% 58%, rgba(4, 107, 130, .20), transparent 68%);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }

.hero__grid {
  display: grid;
  grid-template-columns: 1.06fr .94fr;
  gap: clamp(28px, 4vw, 60px);
  align-items: center;
}
@media (max-width: 900px) { .hero__grid { grid-template-columns: 1fr; } }

.hero__title { margin-bottom: .45em; }
.hero__title em { font-style: normal; color: var(--coral); }
.hero__lede { margin-bottom: 2rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 1.6rem; }

.hero__note {
  display: flex; align-items: center; gap: 9px;
  font-size: .9rem; color: var(--muted); font-weight: 600;
}
.hero__note svg { width: 19px; height: 19px; color: var(--mint-deep); flex-shrink: 0; }

.hero__stage { position: relative; }

.photo-slot {
  position: relative; aspect-ratio: 4 / 4.4;
  border-radius: var(--r-xl); overflow: hidden;
  background: linear-gradient(150deg, var(--p-blue), var(--p-lilac));
}
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-slot__fallback { display: none; position: absolute; inset: 0; }
.photo-slot.is-empty img { display: none; }
.photo-slot.is-empty .photo-slot__fallback { display: block; }

.photo-slot__hint {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  width: calc(100% - 32px);
  background: rgba(26, 27, 51, .84); color: #fff;
  font-size: .74rem; line-height: 1.45; font-weight: 600;
  padding: 10px 14px; border-radius: var(--r-sm); text-align: center;
}
.photo-slot:not(.is-empty) .photo-slot__hint { display: none; }

.mascot {
  position: absolute; z-index: 2;
  right: -6%; bottom: -4%; width: 46%;
  filter: drop-shadow(0 16px 30px rgba(26, 27, 51, .22));
}
.mascot svg { width: 100%; height: auto; }
@media (max-width: 900px) { .mascot { width: 38%; right: 2%; } }

.js .mascot { animation: bob 4.5s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-11px); } }

/* --- 8. Bento-сітка ------------------------------------------------------ */
.bento {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: clamp(14px, 1.8vw, 22px);
}
.bento__cell {
  border-radius: var(--r-lg);
  padding: clamp(22px, 2.6vw, 34px);
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
}
.bento__cell--game { grid-row: span 2; background: var(--bg-soft); }
.bento__cell--coins { background: linear-gradient(155deg, var(--p-yellow), #FFE59B); }
.bento__cell--stats { background: linear-gradient(155deg, var(--p-green), #C4F1E2); }

.bento__cell h3 { margin-bottom: .4em; }
.bento__cell p { font-size: .94rem; color: var(--ink-2); }

@media (max-width: 860px) {
  .bento { grid-template-columns: 1fr; }
  .bento__cell--game { grid-row: auto; }
}

/* --- 9. Міні-гра --------------------------------------------------------- */
.game { margin-top: auto; padding-top: 20px; }
.game__board { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.game__col { display: grid; gap: 10px; }
.game__col h4 {
  font-size: .68rem; letter-spacing: .13em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 2px;
}

.tile {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 12px 14px;
  background: var(--white); border: 2px solid var(--line);
  border-radius: var(--r-sm); cursor: pointer; text-align: left;
  font-weight: 700; font-size: .95rem;
  box-shadow: 0 3px 0 var(--line);
  transition: transform .12s var(--ease), border-color .16s var(--ease),
              box-shadow .16s var(--ease), background-color .16s var(--ease);
}
.tile:hover:not([disabled]) { transform: translateY(-2px); border-color: var(--ink-2); }
.tile:active:not([disabled]) { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.tile svg { width: 34px; height: 34px; flex-shrink: 0; }

.tile[aria-pressed='true'] {
  border-color: var(--sky); background: var(--p-blue); box-shadow: 0 3px 0 #B8D8FF;
}
.tile.is-right {
  border-color: var(--mint); background: var(--p-green);
  box-shadow: 0 3px 0 var(--mint); color: var(--mint-deep);
}
.tile.is-wrong { border-color: var(--coral); background: var(--p-peach); animation: shake .34s; }
.tile[disabled] { opacity: .45; cursor: default; box-shadow: none; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.game__bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 16px; flex-wrap: wrap;
}
.game__score { font-weight: 800; font-size: .9rem; }
.game__score span { color: var(--mint-deep); }

/* --- 10. Монетки та прогрес --------------------------------------------- */
.coins { display: flex; align-items: center; gap: 10px; margin: 18px 0 6px; }
.coin {
  width: 46px; height: 46px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFE9A8, var(--brand) 62%, var(--brand-deep));
  display: grid; place-items: center;
  font-family: var(--f-display); font-weight: 800; font-size: .95rem; color: #7A5200;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .13);
}
.coin--ghost { background: rgba(255, 255, 255, .5); color: rgba(0, 0, 0, .25); box-shadow: none; }

.progress-chart { margin: 16px 0 6px; }
.progress-chart svg { width: 100%; height: auto; }

/* --- 11. Напрямки навчання ---------------------------------------------- */
.progs { display: grid; grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); gap: clamp(16px, 2vw, 26px); }

.prog {
  --fill: var(--p-yellow);
  position: relative; display: flex; flex-direction: column;
  padding: clamp(26px, 3vw, 36px);
  border-radius: var(--r-lg); background: var(--fill);
  text-decoration: none; overflow: hidden;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}
.prog:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.prog--kids   { --fill: var(--p-yellow); }
.prog--school { --fill: var(--p-blue); }
.prog--solo   { --fill: var(--p-green); }

.prog__icon {
  width: 62px; height: 62px; margin-bottom: 20px;
  background: rgba(255, 255, 255, .72); border-radius: 20px;
  display: grid; place-items: center;
}
.prog__icon svg { width: 34px; height: 34px; }
.prog__age {
  font-family: var(--f-display); font-size: .74rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2);
  margin-bottom: .5em;
}
.prog h3 { margin-bottom: .5em; }
.prog p { font-size: .95rem; color: var(--ink-2); margin-bottom: 1.4em; }
.prog__more {
  margin-top: auto; font-family: var(--f-display);
  font-weight: 700; font-size: .88rem;
  display: inline-flex; align-items: center; gap: 8px;
}
.prog__more svg { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.prog:hover .prog__more svg { transform: translateX(4px); }

/* --- 12. Чому обирають нас ----------------------------------------------- */
.why { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: clamp(24px, 3.4vw, 46px); }
.why__col h3 { margin-bottom: .5em; }
.why__col p { font-size: .95rem; color: var(--ink-2); }
.why__icon {
  width: 58px; height: 58px; margin-bottom: 20px;
  border-radius: 18px; display: grid; place-items: center;
}
.why__icon svg { width: 30px; height: 30px; color: var(--white); }
.why__icon--a { background: var(--coral); }
.why__icon--b { background: var(--teal); }
.why__icon--c { background: var(--mint-deep); }

.teachers { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 22px; }
.teacher {
  position: relative; width: 88px; border: 0; background: none;
  cursor: pointer; padding: 0; text-align: center;
}
.teacher__ring {
  position: relative; width: 88px; height: 88px; border-radius: 50%;
  overflow: hidden; box-shadow: 0 0 0 3px var(--teal);
  background: linear-gradient(150deg, var(--teal), var(--teal-deep));
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.teacher:hover .teacher__ring { transform: scale(1.06); box-shadow: 0 0 0 4px var(--coral); }
.teacher__ring img { width: 100%; height: 100%; object-fit: cover; }
.teacher__play {
  position: absolute; right: 2px; bottom: 2px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--coral); color: #fff;
  display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}
.teacher__play svg { width: 13px; height: 13px; }
.teacher__name { display: block; margin-top: 9px; font-size: .82rem; font-weight: 700; }

/* --- 13. Відгуки у вигляді переписки ------------------------------------- */
.chats { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: clamp(18px, 2.4vw, 28px); }

.chat {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-sm);
}
.chat__head {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line);
}
.chat__ava {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  font-family: var(--f-display); font-weight: 800; font-size: .9rem; color: var(--white);
}
.chat__who { font-weight: 800; font-size: .92rem; }
.chat__when { font-size: .76rem; color: var(--muted); }

.bubble {
  max-width: 88%; padding: 11px 15px; margin-bottom: 9px;
  font-size: .92rem; line-height: 1.5; border-radius: 18px;
}
.bubble--them { background: var(--bg-soft); border-bottom-left-radius: 5px; }
.bubble--me { background: var(--p-green); margin-left: auto; border-bottom-right-radius: 5px; }
.bubble__time {
  display: block; font-size: .68rem; color: var(--muted);
  text-align: right; margin-top: 3px;
}

/* --- 14. Смуга з цифрами ------------------------------------------------- */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: clamp(20px, 3vw, 38px); }
.figure__value {
  font-family: var(--f-display); font-size: clamp(2.2rem, 4.6vw, 3.2rem);
  font-weight: 800; line-height: 1; color: var(--coral); letter-spacing: -.03em;
}
.figure__label { font-size: .92rem; color: var(--ink-2); margin-top: 10px; max-width: 22ch; }

/* --- 15. Смуга заклику --------------------------------------------------- */
.cta-band {
  border-radius: var(--r-xl);
  background: linear-gradient(140deg, #046B82, #023642);
  color: var(--white); padding: clamp(34px, 5vw, 64px);
  position: relative; overflow: hidden;
}
.cta-band::before {
  content: ''; position: absolute; inset: -50% -20% auto; height: 180%;
  background: radial-gradient(ellipse 44% 46% at 74% 42%, rgba(249, 191, 26, .40), transparent 68%);
  pointer-events: none;
}
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { color: var(--white); }
.cta-band p, .cta-band .lede { color: rgba(255, 255, 255, .82); }

/* --- 16. Сторінки вправ -------------------------------------------------- */
.grade-hero {
  position: relative; overflow: hidden;
  padding-block: clamp(40px, 5vw, 68px);
  background: var(--bg-soft);
}
.crumbs { font-size: .84rem; color: var(--muted); margin-bottom: 1rem; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.grade-hero h1 em { font-style: normal; color: var(--coral); }

.toolbar {
  position: sticky; top: 76px; z-index: 60;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line); padding-block: 14px;
}
.toolbar__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 17px; border: 2px solid var(--line); border-radius: 100px;
  background: var(--white); font-size: .88rem; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  transition: background-color .16s var(--ease), border-color .16s var(--ease);
}
.chip:hover { border-color: var(--ink-2); }
.chip[aria-pressed='true'] { background: var(--p-teal); border-color: var(--teal); }
.chip__count { font-size: .76rem; opacity: .6; font-variant-numeric: tabular-nums; }

.search { position: relative; margin-left: auto; flex: 0 1 260px; min-width: 190px; }
.search input {
  width: 100%; padding: 12px 16px 12px 42px; font: inherit; font-size: .9rem;
  border: 2px solid var(--line); border-radius: 100px; background: var(--white); color: var(--ink);
}
.search svg {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--muted); pointer-events: none;
}
@media (max-width: 640px) { .search { flex-basis: 100%; margin-left: 0; } .toolbar { top: 72px; } }

.ex-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: clamp(16px, 2vw, 24px); padding: 0; margin: 0; list-style: none;
}
.ex {
  display: flex; flex-direction: column; height: 100%;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.ex:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.ex__top {
  position: relative; aspect-ratio: 16 / 9;
  background: var(--bg-soft); display: flex; align-items: center; justify-content: center;
  padding: 14px; overflow: hidden;
}
.ex__top svg { position: relative; z-index: 1; width: 62px; height: 62px; }
.ex__tag {
  position: absolute; z-index: 2; top: 12px; left: 12px;
  padding: 5px 12px; border-radius: 100px;
  background: var(--white); color: var(--ink);
  font-size: .72rem; font-weight: 800; box-shadow: var(--shadow-sm);
}
.ex__body { padding: 20px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.ex__title { font-size: 1.05rem; margin-bottom: .4em; }
.ex__desc { font-size: .9rem; color: var(--muted); margin-bottom: 1.2em; }
.ex__foot { margin-top: auto; display: flex; align-items: center; gap: 10px; }
.ex__btn {
  flex: 1; padding: 12px 18px; border: 0; border-radius: 100px;
  background: var(--brand); color: var(--ink);
  font-family: var(--f-display); font-size: .84rem; font-weight: 700;
  cursor: pointer; text-align: center; text-decoration: none;
  box-shadow: 0 4px 0 var(--brand-deep);
  transition: transform .14s var(--ease), box-shadow .14s var(--ease);
}
.ex__btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--brand-deep); }
.ex__btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--brand-deep); }
.ex__ext {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; flex-shrink: 0;
  border: 2px solid var(--line); border-radius: 50%; color: var(--muted);
  text-decoration: none; transition: border-color .18s var(--ease), color .18s var(--ease);
}
.ex__ext:hover { border-color: var(--ink); color: var(--ink); }
.ex__ext svg { width: 17px; height: 17px; }

.empty {
  grid-column: 1 / -1; text-align: center; padding: 60px 20px;
  border: 2px dashed var(--line); border-radius: var(--r-lg);
}
.empty p { color: var(--muted); }

/* --- 17. Модальне вікно -------------------------------------------------- */
.modal {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center;
  padding: clamp(10px, 3vw, 32px);
  background: rgba(26, 27, 51, .76); backdrop-filter: blur(5px);
}
.modal[data-open='true'] { display: flex; }
.modal__panel {
  position: relative; display: flex; flex-direction: column;
  width: min(1080px, 100%); height: min(760px, 100%);
  background: var(--white); border-radius: var(--r-md);
  overflow: hidden; box-shadow: var(--shadow-lg);
}
.modal__panel--video { width: min(420px, 100%); height: auto; aspect-ratio: 9 / 15; }
.modal__head {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 18px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.modal__title { font-size: 1rem; margin: 0; flex: 1; min-width: 0; }
.modal__close {
  width: 40px; height: 40px; flex-shrink: 0;
  display: grid; place-items: center;
  border: 2px solid var(--line); border-radius: 50%;
  background: var(--white); cursor: pointer;
}
.modal__close:hover { background: var(--bg-soft); }
.modal__close svg { width: 18px; height: 18px; }
.modal__frame { flex: 1; border: 0; width: 100%; background: var(--bg-soft); }
.modal__foot {
  padding: 12px 18px; border-top: 1px solid var(--line);
  font-size: .84rem; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; flex-shrink: 0;
}
.modal__foot a { color: var(--ink); font-weight: 700; }
body.is-locked { overflow: hidden; }

/* --- 18. Текстові сторінки ----------------------------------------------- */
.prose { max-width: 68ch; }
.prose h2 { margin-top: 1.8em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.5em; }
.prose ul, .prose ol { padding-left: 1.3em; margin-bottom: 1.2em; }
.prose li { margin-bottom: .5em; }
.prose a { color: var(--ink); text-decoration-color: var(--brand); text-underline-offset: 3px; }

.callout {
  border-left: 5px solid var(--brand); background: var(--bg-soft);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 24px 28px; margin: 2em 0;
}
.callout h3 { margin-bottom: .4em; }
.callout p { font-size: .96rem; }

.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(28px, 5vw, 68px); align-items: center; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }

/* --- 19. Підвал ---------------------------------------------------------- */
.site-foot {
  background: var(--bg-soft); border-top: 1px solid var(--line);
  padding-block: clamp(46px, 6vw, 72px) 30px; font-size: .92rem; color: var(--ink-2);
}
.foot-grid {
  display: grid; grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: clamp(26px, 4vw, 48px); margin-bottom: 40px;
}
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .foot-grid { grid-template-columns: 1fr; } }

.site-foot .logo { margin-bottom: 16px; }
.foot-col h4 {
  font-size: .72rem; letter-spacing: .13em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 1.1em;
}
.foot-col ul { list-style: none; margin: 0; padding: 0; }
.foot-col li { margin-bottom: .6em; }
.foot-col a { text-decoration: none; }
.foot-col a:hover { text-decoration: underline; }

.foot-sub { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.foot-sub input {
  flex: 1 1 160px; padding: 12px 16px; font: inherit; font-size: .9rem;
  border: 2px solid var(--line); border-radius: 100px; background: var(--white);
}

.foot-bottom {
  border-top: 1px solid var(--line); padding-top: 24px;
  display: flex; flex-wrap: wrap; gap: 10px 24px;
  justify-content: space-between; font-size: .84rem; color: var(--muted);
}

/* --- 20. Доступність та друк -------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .js .mascot { animation: none; }
}

@media print {
  .site-head, .toolbar, .site-foot, .modal, .hero__actions { display: none; }
  .ex { break-inside: avoid; }
}

/* --- 21. Підпис розділів на картці класу -------------------------------- */
.prog__meta {
  font-size: .84rem !important;
  color: var(--ink-2);
  opacity: .8;
  margin-bottom: 1.4em;
}
.prog__icon span { display: block; }

/* ==========================================================================
   22. СТОРІНКА УРОКУ
   ========================================================================== */
.lesson-hero {
  background: var(--bg-soft);
  padding-block: clamp(28px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
}
.lesson-hero h1 { margin-bottom: .25em; }
.lesson-hero__en {
  font-family: var(--f-display); font-size: 1.05rem; font-weight: 600;
  color: var(--teal); margin-bottom: 1rem;
}
.lesson-meta { display: flex; flex-wrap: wrap; gap: 8px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 100px;
  background: var(--white); border: 1.5px solid var(--line);
  font-size: .82rem; font-weight: 700;
}
.pill--read   { background: var(--p-teal);   border-color: #B6DDE8; }
.pill--listen { background: var(--p-yellow); border-color: #F2D98A; }
.pill--grammar{ background: var(--p-lilac);  border-color: #CBBCF5; }

/* смуга кроків */
.stage-bar {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding-block: 18px;
}
.stage {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px 9px 9px; border-radius: 100px;
  background: var(--white); border: 1.5px solid var(--line);
  font-size: .86rem; font-weight: 700; text-decoration: none;
  transition: border-color .16s var(--ease), transform .16s var(--ease);
}
.stage:hover { border-color: var(--teal); transform: translateY(-2px); }
.stage__n {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--teal); color: #fff;
  display: grid; place-items: center;
  font-family: var(--f-display); font-size: .78rem; font-weight: 800;
}

.lesson-body { padding-bottom: clamp(40px, 6vw, 80px); }
.lesson-block { padding-block: clamp(26px, 3.4vw, 46px); border-top: 1px solid var(--line); }
.lesson-block:first-of-type { border-top: 0; }
.lesson-h { font-size: clamp(1.35rem, 2.6vw, 1.9rem); margin-bottom: .5em; }
.lesson-note { font-size: .9rem; color: var(--muted); margin-bottom: 1.2em; }

/* --- словничок --- */
.vocab {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px;
}
.vcard {
  position: relative; display: flex; flex-direction: column; align-items: flex-start;
  gap: 2px; padding: 16px 14px 14px; text-align: left;
  background: var(--white); border: 2px solid var(--line);
  border-radius: var(--r-md); cursor: pointer;
  box-shadow: 0 4px 0 var(--line);
  transition: transform .14s var(--ease), border-color .16s var(--ease), box-shadow .14s var(--ease);
}
.vcard:hover { transform: translateY(-3px); border-color: var(--teal); box-shadow: 0 6px 0 #CFE4EA; }
.vcard:active, .vcard.is-said { transform: translateY(2px); box-shadow: 0 2px 0 var(--line); }
.vcard__emoji { font-size: 1.7rem; line-height: 1; margin-bottom: 4px; }
.vcard__w { font-family: var(--f-display); font-weight: 700; font-size: 1.02rem; }
.vcard__ipa { font-size: .78rem; color: var(--muted); }
.vcard__ua { font-size: .92rem; font-weight: 600; color: var(--teal-deep); margin-top: 2px; }
.vcard__ex { font-size: .78rem; color: var(--muted); font-style: italic; margin-top: 5px; }
.vcard__sound {
  position: absolute; top: 10px; right: 10px; width: 17px; height: 17px;
  color: var(--muted); opacity: .5;
}
.vcard:hover .vcard__sound { opacity: 1; color: var(--teal); }

/* --- Quizlet --- */
.quizlet { margin-top: 26px; padding: 20px; background: var(--bg-soft); border-radius: var(--r-md); }
.quizlet h3 { font-size: 1.05rem; margin-bottom: .4em; }
.quizlet__frame { aspect-ratio: 16/10; border-radius: var(--r-sm); overflow: hidden; background: #fff; }
.quizlet__frame iframe { width: 100%; height: 100%; border: 0; }
.quizlet__box {
  width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem;
  padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: var(--white); resize: vertical; margin-bottom: 10px;
}

/* --- аудіоплеєр --- */
.player {
  background: var(--bg-soft); border-radius: var(--r-md);
  padding: 20px; display: flex; flex-direction: column; gap: 14px;
}
.player audio { width: 100%; }
.player__speed { display: flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--muted); }
.chip--mini { padding: 5px 13px; font-size: .8rem; }

.reveal {
  margin-top: 16px; background: var(--white);
  border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 14px 18px;
}
.reveal summary { cursor: pointer; font-weight: 700; font-size: .92rem; }
.reveal[open] summary { margin-bottom: 10px; }
.reveal--sm { padding: 10px 14px; margin-top: 8px; font-size: .9rem; }

/* --- текст --- */
.reader { background: var(--bg-soft); border-radius: var(--r-md); padding: clamp(20px, 3vw, 32px); }
.lesson-text { font-size: clamp(1.05rem, 2vw, 1.28rem); line-height: 2; margin-bottom: 1.2em; }
.lesson-text .w {
  cursor: pointer; border-radius: 5px; padding: 1px 2px;
  transition: background-color .14s var(--ease);
}
.lesson-text .w:hover, .lesson-text .w:focus-visible { background: var(--p-yellow); }

.lesson-table { overflow-x: auto; }
.lesson-table table { width: 100%; border-collapse: collapse; background: var(--white); }
.lesson-table th, .lesson-table td {
  padding: 12px 16px; border: 1px solid var(--line); text-align: left; font-size: .96rem;
}
.lesson-table th { background: var(--p-teal); font-family: var(--f-display); font-weight: 700; }

/* --- вікторина --- */
.quiz { display: grid; gap: 12px; }
.qrow {
  background: var(--white); border: 2px solid var(--line);
  border-radius: var(--r-md); padding: 16px 18px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
}
.qrow__q { flex: 1 1 240px; margin: 0; font-weight: 600; }
.qrow__btns { display: flex; gap: 8px; }
.ans {
  padding: 10px 20px; border: 2px solid var(--line); border-radius: 100px;
  background: var(--white); font-weight: 700; font-size: .92rem; cursor: pointer;
  transition: transform .12s var(--ease), border-color .16s var(--ease);
}
.ans:hover:not([disabled]) { transform: translateY(-2px); border-color: var(--ink-2); }
.ans[disabled] { opacity: .55; cursor: default; }
.ans.is-right { background: var(--p-green); border-color: var(--mint); opacity: 1; }
.ans.is-wrong { background: var(--p-peach); border-color: var(--coral); opacity: 1; }
.qrow__fb { flex: 1 1 100%; margin: 0; font-size: .88rem; font-weight: 700;
            display: flex; align-items: center; gap: 7px; }
.qrow__fb svg { width: 16px; height: 16px; }
.qrow__fb.is-right { color: var(--mint-deep); }
.qrow__fb.is-wrong { color: var(--coral-deep); }

.quiz-result {
  margin-top: 16px; padding: 18px 22px; border-radius: var(--r-md);
  background: var(--p-green); font-size: 1.02rem;
}

.qlist { padding-left: 1.2em; }
.qlist li { margin-bottom: 1em; }
.qlist__q { font-weight: 600; margin-bottom: .3em; }

/* --- ігри --- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tab {
  padding: 10px 20px; border: 2px solid var(--line); border-radius: 100px;
  background: var(--white); font-weight: 700; font-size: .88rem; cursor: pointer;
}
.tab[aria-pressed='true'] { background: var(--p-teal); border-color: var(--teal); }

.game-box { background: var(--bg-soft); border-radius: var(--r-md); padding: clamp(18px, 2.6vw, 28px); }

.match { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.match__col { display: grid; gap: 10px; align-content: start; }
.mtile {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 13px 16px; background: var(--white);
  border: 2px solid var(--line); border-radius: var(--r-sm);
  font-weight: 700; font-size: .95rem; cursor: pointer; text-align: left;
  box-shadow: 0 3px 0 var(--line);
  transition: transform .12s var(--ease), border-color .16s var(--ease);
}
.mtile__e { font-size: 1.2rem; }
.mtile:hover:not([disabled]) { transform: translateY(-2px); border-color: var(--ink-2); }
.mtile[aria-pressed='true'] { border-color: var(--sky); background: var(--p-teal); }
.mtile.is-right { border-color: var(--mint); background: var(--p-green); color: var(--mint-deep); box-shadow: 0 3px 0 var(--mint); }
.mtile.is-wrong { border-color: var(--coral); background: var(--p-peach); animation: shake .34s; }
.mtile[disabled] { cursor: default; }

.game-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin: 16px 0 0; font-weight: 700; font-size: .9rem;
}
.game-bar.is-win { color: var(--mint-deep); }

.flash {
  position: relative; max-width: 380px; margin-inline: auto; aspect-ratio: 4/3;
  cursor: pointer; perspective: 1000px;
}
.flash__side {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  background: var(--white); border: 2px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  backface-visibility: hidden; transition: transform .5s var(--ease);
}
.flash__side--back { transform: rotateY(180deg); background: var(--p-teal); }
.flash.is-flipped .flash__side--front { transform: rotateY(180deg); }
.flash.is-flipped .flash__side--back { transform: rotateY(360deg); }
.flash__e { font-size: 3rem; }
.flash__w { font-family: var(--f-display); font-size: 1.7rem; font-weight: 800; }
.flash__ipa { color: var(--muted); }
.flash__hint { font-size: .76rem; color: var(--muted); margin-top: 10px; }
.flash__ua { font-family: var(--f-display); font-size: 1.5rem; font-weight: 700; }
.flash__ex { font-size: .9rem; font-style: italic; color: var(--ink-2); }

.spell__clue { font-size: 1.1rem; margin-bottom: 14px; }
.spell__slot {
  min-height: 56px; display: flex; align-items: center; justify-content: center;
  font-family: var(--f-display); font-size: 1.6rem; font-weight: 800; letter-spacing: .1em;
  background: var(--white); border: 2px dashed var(--line);
  border-radius: var(--r-sm); margin-bottom: 14px;
}
.spell__pool { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ltile {
  width: 46px; height: 52px; border: 2px solid var(--line); border-radius: var(--r-sm);
  background: var(--white); font-family: var(--f-display); font-size: 1.2rem; font-weight: 800;
  cursor: pointer; box-shadow: 0 3px 0 var(--line);
  transition: transform .12s var(--ease);
}
.ltile:hover:not([disabled]) { transform: translateY(-3px); }
.ltile[disabled] { opacity: .3; cursor: default; box-shadow: none; }
.spell__fb { margin-top: 14px; font-weight: 800; text-align: center; }
.spell__fb.is-right { color: var(--mint-deep); }
.spell__fb.is-wrong { color: var(--coral-deep); }

/* --- завершення --- */
.lesson-done { margin-top: 30px; }
.lesson-done__in {
  background: linear-gradient(140deg, var(--teal), var(--teal-deep));
  color: #fff; border-radius: var(--r-xl);
  padding: clamp(26px, 4vw, 44px); text-align: center;
}
.lesson-done__in h2 { color: #fff; }
.lesson-done__in p { color: rgba(255,255,255,.85); margin-bottom: 1.4em; }
.btn.is-done { background: var(--mint); box-shadow: 0 6px 0 var(--mint-deep); color: #fff; }

.next-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.next-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 20px; background: var(--white);
  border: 2px solid var(--line); border-radius: var(--r-md);
  text-decoration: none; transition: transform .16s var(--ease), border-color .16s var(--ease);
}
.next-card:hover { transform: translateY(-3px); border-color: var(--teal); }
.next-card__t { font-family: var(--f-display); font-weight: 700; }
.next-card__m { font-size: .82rem; color: var(--muted); }

/* лічильник зірочок */
.stars {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 100px;
  background: var(--p-yellow); font-weight: 800; font-size: .84rem;
}

@media (max-width: 560px) {
  .match { grid-template-columns: 1fr; }
  .vocab { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* тривалість і позначка «пройдено» на картці уроку */
.ex__time {
  position: absolute; z-index: 2; top: 12px; right: 12px;
  padding: 5px 11px; border-radius: 100px;
  background: rgba(26,27,51,.72); color: #fff;
  font-size: .72rem; font-weight: 700;
}
.ex__done {
  position: absolute; z-index: 2; bottom: 12px; right: 12px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--mint); color: #fff;
  display: grid; place-items: center; font-weight: 800;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.ex.is-done { border-color: var(--mint); }
.nav__stars { display: flex; align-items: center; }

.bar { height: 12px; background: var(--line); border-radius: 100px; overflow: hidden; margin-bottom: 8px; }
.bar span { display: block; height: 100%; background: var(--mint); border-radius: 100px; }

.player--tts { gap: 16px; }
.tts-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }


/* ==========================================================================
   23. СТОРІНКА УРОКУ — ЖИВА СЦЕНА ДЛЯ ДІТЕЙ
   Небо, пагорби, хмари. Блоки уроку — «острівці» поверх сцени.
   ========================================================================== */
.page-lesson {
  --sky-1: #A8E4F5;
  --sky-2: #CFF0E8;
  --sky-3: #FFF6DC;
  --hill-back: #9BD9A8;
  --hill-front: #6FC98A;
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 34%, var(--sky-3) 100%);
  background-attachment: fixed;
  min-height: 100vh;
}
/* тема за типом уроку */
.page-lesson[data-theme='listen'] {
  --sky-1: #C3D8FF; --sky-2: #E4DDFB; --sky-3: #FFEFD9;
  --hill-back: #A8B6E8; --hill-front: #8B9EDC;
}
.page-lesson[data-theme='read'] {
  --sky-1: #A8E4F5; --sky-2: #CFF0E8; --sky-3: #FFF6DC;
}

/* хмарки та сонце — нерухомий шар позаду */
.scene {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.scene__sun {
  position: absolute; top: 4%; right: 7%;
  width: clamp(70px, 9vw, 120px); height: clamp(70px, 9vw, 120px);
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #FFF3C4, #F9BF1A 62%, #E9A200);
  box-shadow: 0 0 60px rgba(249,191,26,.55);
}
.scene__cloud {
  position: absolute; background: rgba(255,255,255,.86); border-radius: 100px;
  filter: blur(.3px);
}
.scene__cloud::before, .scene__cloud::after {
  content: ''; position: absolute; background: inherit; border-radius: 50%;
}
.scene__cloud--a { width: 132px; height: 40px; top: 11%; left: 6%; animation: drift 46s linear infinite; }
.scene__cloud--a::before { width: 62px; height: 62px; top: -28px; left: 20px; }
.scene__cloud--a::after  { width: 44px; height: 44px; top: -18px; left: 68px; }
.scene__cloud--b { width: 100px; height: 32px; top: 26%; right: 16%; animation: drift 62s linear infinite reverse; }
.scene__cloud--b::before { width: 48px; height: 48px; top: -22px; left: 16px; }
.scene__cloud--b::after  { width: 34px; height: 34px; top: -14px; left: 54px; }
.scene__cloud--c { width: 84px; height: 28px; top: 46%; left: 12%; opacity: .7; animation: drift 78s linear infinite; }
.scene__cloud--c::before { width: 40px; height: 40px; top: -18px; left: 14px; }

@keyframes drift {
  from { transform: translateX(-14vw); }
  to   { transform: translateX(114vw); }
}

/* пагорби внизу */
.scene__hills { position: absolute; left: 0; right: 0; bottom: 0; height: 34vh; min-height: 190px; }
.scene__hills svg { width: 100%; height: 100%; }

.page-lesson > *:not(.scene) { position: relative; z-index: 1; }

/* --- шапка уроку --- */
.page-lesson .lesson-hero {
  background: linear-gradient(150deg, var(--teal) 0%, var(--teal-deep) 100%);
  color: #fff; border: 0;
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  padding-block: clamp(26px, 3.4vw, 46px) clamp(30px, 4vw, 52px);
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(2,78,96,.30);
}
.page-lesson .lesson-hero::after {
  content: ''; position: absolute; inset: -40% -10% auto; height: 160%;
  background: radial-gradient(ellipse 40% 44% at 80% 28%, rgba(249,191,26,.45), transparent 66%);
  pointer-events: none;
}
.page-lesson .lesson-hero .wrap { position: relative; z-index: 1; }
.page-lesson .lesson-hero h1 { color: #fff; }
.page-lesson .lesson-hero__en { color: var(--brand); }
.page-lesson .crumbs { color: rgba(255,255,255,.78); }
.page-lesson .crumbs a { color: #fff; }
.page-lesson .lesson-hero .pill {
  background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.32); color: #fff;
}
.page-lesson .lesson-hero .pill--read,
.page-lesson .lesson-hero .pill--listen { background: var(--brand); color: var(--ink); border-color: transparent; }

/* кільце прогресу в шапці */
.lesson-ring { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.lesson-ring svg { width: 56px; height: 56px; flex-shrink: 0; }
.lesson-ring__track { stroke: rgba(255,255,255,.25); }
.lesson-ring__bar { stroke: var(--brand); transition: stroke-dashoffset .6s var(--ease); }
.lesson-ring__txt { font-size: .88rem; color: rgba(255,255,255,.9); font-weight: 700; }

/* --- смуга кроків --- */
.page-lesson .stage-bar { padding-block: 20px 4px; }
.page-lesson .stage {
  background: #fff; border-color: transparent;
  box-shadow: 0 5px 0 rgba(2,78,96,.20);
}
.page-lesson .stage:hover { box-shadow: 0 7px 0 rgba(2,78,96,.28); }
.page-lesson .stage.is-done { background: var(--p-green); }
.stage:nth-child(1) .stage__n { background: var(--brand); color: var(--ink); }
.stage:nth-child(2) .stage__n { background: var(--coral); }
.stage:nth-child(3) .stage__n { background: var(--mint); }
.stage:nth-child(4) .stage__n { background: var(--violet); }
.stage:nth-child(5) .stage__n { background: var(--sky); }

/* --- блоки-острівці --- */
.page-lesson .lesson-block {
  background: #fff;
  border: 0; border-radius: var(--r-xl);
  padding: clamp(22px, 3vw, 40px);
  margin-block: clamp(16px, 2.2vw, 26px);
  box-shadow: 0 12px 36px rgba(2,78,96,.16);
}
.page-lesson .lesson-h { display: flex; align-items: center; gap: 12px; }
.page-lesson .lesson-h::before {
  content: ''; width: 13px; height: 32px; border-radius: 100px;
  background: var(--brand); flex-shrink: 0;
}
.page-lesson #s-audio .lesson-h::before { background: var(--coral); }
.page-lesson #s-text  .lesson-h::before { background: var(--mint); }
.page-lesson #s-quiz  .lesson-h::before { background: var(--violet); }
.page-lesson #s-play  .lesson-h::before { background: var(--sky); }

/* --- словничок --- */
.page-lesson .vcard {
  border-color: transparent; background: var(--p-yellow);
  box-shadow: 0 6px 0 rgba(0,0,0,.12);
}
.page-lesson .vcard:nth-child(6n+2) { background: var(--p-teal); }
.page-lesson .vcard:nth-child(6n+3) { background: var(--p-green); }
.page-lesson .vcard:nth-child(6n+4) { background: var(--p-lilac); }
.page-lesson .vcard:nth-child(6n+5) { background: var(--p-peach); }
.page-lesson .vcard:nth-child(6n)   { background: #FFE4F0; }
.page-lesson .vcard:hover { box-shadow: 0 9px 0 rgba(0,0,0,.15); border-color: transparent; }
.page-lesson .vcard:active, .page-lesson .vcard.is-said { box-shadow: 0 2px 0 rgba(0,0,0,.12); }
.page-lesson .vcard__emoji { font-size: 2.2rem; }
.page-lesson .vcard__ua { color: var(--ink); }
.vcard.is-said { animation: pop .42s var(--ease); }
@keyframes pop {
  0% { transform: translateY(2px) scale(1); }
  45% { transform: translateY(-6px) scale(1.05); }
  100% { transform: translateY(0) scale(1); }
}

/* --- текст --- */
.page-lesson .reader {
  background: linear-gradient(160deg, #FFFCF2, #FFF3D4);
  border: 4px dashed rgba(249,191,26,.6);
}
.page-lesson .lesson-text { font-size: clamp(1.1rem, 2.1vw, 1.36rem); }
.page-lesson .lesson-text .w:hover,
.page-lesson .lesson-text .w:focus-visible { background: var(--brand); border-radius: 7px; }
.lesson-text .w.is-reading { background: var(--mint); border-radius: 7px; color: #fff; }

/* --- аудіо --- */
.page-lesson .player {
  background: linear-gradient(160deg, #FFF1ED, #FFE0D6);
  border: 4px dashed rgba(255,107,90,.5);
}

/* --- вікторина --- */
.page-lesson .qrow {
  border-color: transparent; background: var(--bg-soft);
  box-shadow: 0 5px 0 rgba(2,78,96,.12);
}
.page-lesson .ans { border-color: transparent; box-shadow: 0 4px 0 rgba(0,0,0,.14); font-size: 1rem; }
.page-lesson .ans:hover:not([disabled]) { box-shadow: 0 6px 0 rgba(0,0,0,.16); }
.qrow__fb.is-right { animation: pop .4s var(--ease); }

/* --- ігри --- */
.page-lesson .game-box {
  background: linear-gradient(160deg, #F0FAFF, #E2F3FC);
  border: 4px dashed rgba(4,107,130,.3);
}
.page-lesson .mtile, .page-lesson .ltile { border-color: transparent; }
.page-lesson .tab { border-color: transparent; box-shadow: 0 4px 0 rgba(2,78,96,.16); }
.page-lesson .tab[aria-pressed='true'] { box-shadow: 0 4px 0 var(--teal); }
.page-lesson .flash__side { border-color: transparent; box-shadow: 0 12px 30px rgba(2,78,96,.20); }
.page-lesson .flash__side--front { background: linear-gradient(160deg, #FFF9E6, #FFEDBB); }
.page-lesson .flash__side--back  { background: linear-gradient(160deg, #E2F7F1, #C2EEE1); }
.page-lesson .quizlet { background: var(--p-lilac); }

/* --- фінал --- */
.page-lesson .lesson-done__in {
  background: linear-gradient(140deg, var(--brand) 0%, #FFA93D 100%);
  color: var(--ink);
}
.page-lesson .lesson-done__in h2 { color: var(--ink); }
.page-lesson .lesson-done__in p { color: rgba(26,27,51,.78); }
.page-lesson .lesson-done__in .btn--primary {
  background: var(--ink); color: #fff; box-shadow: 0 6px 0 #000;
}
.page-lesson .next-card { border-color: transparent; box-shadow: 0 6px 0 rgba(2,78,96,.16); }
.page-lesson .next-card:hover { box-shadow: 0 9px 0 rgba(2,78,96,.22); }

/* --- маскот-помічник --- */
.buddy {
  position: fixed; right: clamp(10px, 2vw, 26px); bottom: clamp(10px, 2vw, 26px);
  z-index: 90; width: clamp(74px, 9vw, 104px);
  border: 0; background: none; padding: 0; cursor: pointer;
  filter: drop-shadow(0 10px 18px rgba(2,78,96,.30));
  transition: transform .25s var(--ease);
}
.buddy:hover { transform: translateY(-5px) rotate(-3deg); }
.buddy.is-cheer { animation: cheer .75s var(--ease); }
@keyframes cheer {
  0%, 100% { transform: translateY(0) rotate(0); }
  25% { transform: translateY(-16px) rotate(-9deg) scale(1.07); }
  60% { transform: translateY(-6px) rotate(7deg) scale(1.03); }
}
.buddy__bubble {
  position: absolute; right: 100%; bottom: 58%;
  margin-right: 12px; padding: 10px 16px;
  background: #fff; border-radius: 18px 18px 4px 18px;
  box-shadow: 0 8px 22px rgba(2,78,96,.22);
  font-size: .86rem; font-weight: 700; white-space: nowrap;
  opacity: 0; transform: translateY(6px) scale(.94);
  transition: opacity .22s var(--ease), transform .22s var(--ease);
  pointer-events: none;
}
.buddy__bubble.is-on { opacity: 1; transform: translateY(0) scale(1); }
@media (max-width: 560px) {
  .buddy { width: 62px; }
  .buddy__bubble { font-size: .78rem; padding: 8px 12px; }
}

/* --- конфеті --- */
.confetti { position: fixed; inset: 0; z-index: 150; pointer-events: none; overflow: hidden; }
.confetti i {
  position: absolute; top: -16px; width: 10px; height: 16px; border-radius: 2px;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(108vh) rotate(760deg); opacity: .15; }
}

/* --- сторінки класів --- */
.page-grade {
  background:
    radial-gradient(circle at 90% 4%, rgba(249,191,26,.22), transparent 26%),
    radial-gradient(circle at 4% 26%, rgba(23,196,166,.18), transparent 24%),
    linear-gradient(180deg, #E6F5FB 0%, #F7FBF4 42%, #FDF9F0 100%);
  background-attachment: fixed;
}
.page-grade .grade-hero { background: transparent; border-bottom: 0; }
.page-grade .toolbar { background: rgba(252,253,255,.94); }
.page-grade .ex { border-color: transparent; box-shadow: 0 10px 26px rgba(2,78,96,.13); }
.page-grade .ex:hover { box-shadow: 0 16px 38px rgba(2,78,96,.20); }
.page-grade .ex__top { background: var(--p-yellow); }
.page-grade .ex:nth-child(5n+2) .ex__top { background: var(--p-teal); }
.page-grade .ex:nth-child(5n+3) .ex__top { background: var(--p-green); }
.page-grade .ex:nth-child(5n+4) .ex__top { background: var(--p-lilac); }
.page-grade .ex:nth-child(5n)   .ex__top { background: var(--p-peach); }

@media (prefers-reduced-motion: reduce) {
  .scene__cloud, .buddy.is-cheer, .vcard.is-said, .qrow__fb.is-right { animation: none; }
  .confetti { display: none; }
}
