/* Усвойка — «Акварельная тетрадь». Общие стили оболочки и модулей.
   Ничего внешнего: шрифты системные, декор — CSS-градиенты и инлайн-SVG (data-URI).
   Хуки разметки: data-subject="ru|en|math|read" на плитках каталога и на <main>, шапка .brand-*, .chip-profile.
   Шрифт Nunito (OFL) можно позже положить в проект локально — см. design/v2/DESIGN.md, раздел «Типографика». */

/* ===================== 1. Токены ===================== */
:root {
  color-scheme: light;
  --bg: #FFF7EC;
  --surface: #FFFFFF;
  --surface-2: #FFF2E3;
  --surface-glass: rgba(255, 255, 255, .62);
  --text: #2E2A47;
  --muted: #6C6884;
  --line: #F0E2CF;
  --line-strong: #E3CFB4;
  --lip: #EBDCC6;
  --accent: #6A5AE0;
  --accent-hi: #7E6FF0;
  --accent-ink: #FFFFFF;
  --accent-soft: #EEEBFF;
  --accent-lip: #4B3DB8;
  --accent-glow: rgba(106, 90, 224, .38);
  --good: #2E9E62;
  --good-hi: #5CC98A;
  --good-ink: #1E7347;
  --good-soft: #E3F6EA;
  --good-lip: #A9DDBF;
  --bad: #CF5B43;
  --bad-ink: #A3412C;
  --bad-soft: #FFEEE8;
  --bad-line: #F2B4A4;
  --bad-lip: #F0C9BD;
  --warn: #C27A00;
  --star: #FFC23D;
  --sun-soft: #FFF4D1;
  --sun-line: #F7DD94;
  --sun-ink: #8A5A00;
  --lvl0: #CFC8DA;
  --lvl1: #8CC8F2;
  --lvl2: #FFD45C;
  --lvl3: #FFA45B;
  --lvl4: #5CC98A;
  /* Цвета предметов: основной, светлый блик, фон, линия, «ступенька» под плиткой, текст */
  --ru: #FFA867; --ru-hi: #FFC48F; --ru-soft: #FFEBDA; --ru-line: #F9CDA8; --ru-lip: #EDB78C; --ru-ink: #A84E14;
  --en: #6FAEEF; --en-hi: #9CCBFA; --en-soft: #E4F1FF; --en-line: #BBD8F6; --en-lip: #9DC2EA; --en-ink: #24609E;
  --math: #7FCBA3; --math-hi: #A8E0C2; --math-soft: #E2F5EA; --math-line: #B9E2CB; --math-lip: #98CDB0; --math-ink: #23794E;
  --read: #F28DB2; --read-hi: #F7B0CA; --read-soft: #FDE6EF; --read-line: #F5C2D6; --read-lip: #E39BB8; --read-ink: #A3285A;
  --lilac: #A99BF5; --lilac-hi: #C4B9FA; --lilac-soft: #EFEBFF; --lilac-line: #D6CEFA; --lilac-lip: #C2B7F2; --lilac-ink: #5243C2;
  --grid-line: rgba(110, 150, 210, .11);
  --toast-bg: #2E2A47;
  --toast-ink: #FFF7EC;
  --topbar-bg: rgba(255, 247, 236, .8);

  --shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 2px 4px rgba(120, 80, 40, .05), 0 12px 28px -12px rgba(120, 80, 40, .2);
  --shadow-sm: 0 1px 2px rgba(120, 80, 40, .06), 0 4px 12px -6px rgba(120, 80, 40, .18);
  --shadow-lg: 0 2px 6px rgba(120, 80, 40, .06), 0 22px 40px -16px rgba(120, 80, 40, .3);
  --radius: 24px;
  --radius-sm: 16px;
  --radius-lg: 30px;
  --radius-btn: 20px;
  --font: "Nunito", ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", "Segoe UI", Roboto, "Noto Sans", "PT Sans", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-word: "Andika", "Nunito", ui-rounded, "SF Pro Rounded", "Segoe UI", Roboto, "Noto Sans", "PT Sans", system-ui, sans-serif;
  --fs-xs: .8125rem;
  --fs-s: .9375rem;
  --fs-m: 1.125rem;
  --fs-l: 1.375rem;
  --fs-xl: 1.75rem;
  --fs-word: clamp(2.5rem, 1.9rem + 2.4vw, 3.4rem);
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --topbar-h: 68px;
  --decor-scale: 1;

  --owl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 128'%3E %3Cdefs%3E %3CradialGradient id='b' cx='.38' cy='.28' r='.85'%3E%3Cstop offset='0' stop-color='%23E7B184'/%3E%3Cstop offset='.7' stop-color='%23C98A58'/%3E%3Cstop offset='1' stop-color='%23B37444'/%3E%3C/radialGradient%3E %3CradialGradient id='f' cx='.5' cy='.4' r='.6'%3E%3Cstop offset='0' stop-color='%23FFF8EE'/%3E%3Cstop offset='1' stop-color='%23F5DCBE'/%3E%3C/radialGradient%3E %3C/defs%3E %3Cpath d='M60 19 C55 9 60 2 69 1 C70 10 66 16 60 19 Z' fill='%238CC084'/%3E %3Cpath d='M61 16 C63 11 65 7 68 4' fill='none' stroke='%236EA866' stroke-width='1.5' stroke-linecap='round'/%3E %3Cpath d='M29 34 L23 9 L48 24 Z M91 34 L97 9 L72 24 Z' fill='%23A86C42' stroke='%23A86C42' stroke-width='5' stroke-linejoin='round'/%3E %3Cpath d='M60 17 C92 17 106 42 106 72 C106 104 86 120 60 120 C34 120 14 104 14 72 C14 42 28 17 60 17 Z' fill='url(%23b)'/%3E %3Cellipse cx='60' cy='95' rx='28' ry='21' fill='url(%23f)'/%3E %3Cpath d='M47 89 q4.5 4 9 0 M64 89 q4.5 4 9 0 M55.5 99 q4.5 4 9 0' fill='none' stroke='%23E2B68A' stroke-width='2.4' stroke-linecap='round'/%3E %3Cpath d='M16 64 C3 83 9 106 30 112 C24 96 24 80 16 64 Z M104 64 C117 83 111 106 90 112 C96 96 96 80 104 64 Z' fill='%239C6238'/%3E %3Ccircle cx='42' cy='56' r='20' fill='url(%23f)'/%3E%3Ccircle cx='78' cy='56' r='20' fill='url(%23f)'/%3E %3Ccircle cx='42' cy='56' r='12.5' fill='%23fff'/%3E%3Ccircle cx='78' cy='56' r='12.5' fill='%23fff'/%3E%3Ccircle cx='44' cy='57.5' r='8' fill='%232E2A47'/%3E%3Ccircle cx='76' cy='57.5' r='8' fill='%232E2A47'/%3E%3Ccircle cx='47' cy='54' r='2.8' fill='%23fff'/%3E%3Ccircle cx='79' cy='54' r='2.8' fill='%23fff'/%3E%3Ccircle cx='41.5' cy='60.5' r='1.3' fill='%23fff' opacity='.8'/%3E%3Ccircle cx='73.5' cy='60.5' r='1.3' fill='%23fff' opacity='.8'/%3E %3Cpath d='M54 70 Q60 82 66 70 Q60 66 54 70 Z' fill='%23F4A340' stroke='%23E0892A' stroke-width='1.5' stroke-linejoin='round'/%3E %3Ccircle cx='25' cy='74' r='6' fill='%23FF9C9C' opacity='.42'/%3E%3Ccircle cx='95' cy='74' r='6' fill='%23FF9C9C' opacity='.42'/%3E %3Cpath d='M48 119 l-3 6 M52.5 119 v7 M57 119 l3 6 M63 119 l-3 6 M67.5 119 v7 M72 119 l3 6' stroke='%23F09A35' stroke-width='3.6' stroke-linecap='round'/%3E %3C/svg%3E");
  --owl-happy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 128'%3E %3Cdefs%3E %3CradialGradient id='b' cx='.38' cy='.28' r='.85'%3E%3Cstop offset='0' stop-color='%23E7B184'/%3E%3Cstop offset='.7' stop-color='%23C98A58'/%3E%3Cstop offset='1' stop-color='%23B37444'/%3E%3C/radialGradient%3E %3CradialGradient id='f' cx='.5' cy='.4' r='.6'%3E%3Cstop offset='0' stop-color='%23FFF8EE'/%3E%3Cstop offset='1' stop-color='%23F5DCBE'/%3E%3C/radialGradient%3E %3C/defs%3E %3Cpath d='M60 19 C55 9 60 2 69 1 C70 10 66 16 60 19 Z' fill='%238CC084'/%3E %3Cpath d='M61 16 C63 11 65 7 68 4' fill='none' stroke='%236EA866' stroke-width='1.5' stroke-linecap='round'/%3E %3Cpath d='M29 34 L23 9 L48 24 Z M91 34 L97 9 L72 24 Z' fill='%23A86C42' stroke='%23A86C42' stroke-width='5' stroke-linejoin='round'/%3E %3Cpath d='M60 17 C92 17 106 42 106 72 C106 104 86 120 60 120 C34 120 14 104 14 72 C14 42 28 17 60 17 Z' fill='url(%23b)'/%3E %3Cellipse cx='60' cy='95' rx='28' ry='21' fill='url(%23f)'/%3E %3Cpath d='M47 89 q4.5 4 9 0 M64 89 q4.5 4 9 0 M55.5 99 q4.5 4 9 0' fill='none' stroke='%23E2B68A' stroke-width='2.4' stroke-linecap='round'/%3E %3Cpath d='M16 64 C3 83 9 106 30 112 C24 96 24 80 16 64 Z M104 64 C117 83 111 106 90 112 C96 96 96 80 104 64 Z' fill='%239C6238'/%3E %3Ccircle cx='42' cy='56' r='20' fill='url(%23f)'/%3E%3Ccircle cx='78' cy='56' r='20' fill='url(%23f)'/%3E %3Cpath d='M30 58 Q42 45 54 58 M66 58 Q78 45 90 58' fill='none' stroke='%232E2A47' stroke-width='5' stroke-linecap='round'/%3E %3Cpath d='M53 70 Q60 86 67 70 Q60 66 53 70 Z' fill='%23F4A340' stroke='%23E0892A' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M56 75 Q60 79 64 75' fill='none' stroke='%23C9701E' stroke-width='1.6' stroke-linecap='round'/%3E %3Ccircle cx='25' cy='74' r='6' fill='%23FF9C9C' opacity='.6'/%3E%3Ccircle cx='95' cy='74' r='6' fill='%23FF9C9C' opacity='.6'/%3E %3Cpath d='M48 119 l-3 6 M52.5 119 v7 M57 119 l3 6 M63 119 l-3 6 M67.5 119 v7 M72 119 l3 6' stroke='%23F09A35' stroke-width='3.6' stroke-linecap='round'/%3E %3C/svg%3E");
  --star-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E %3Cdefs%3E%3ClinearGradient id='s' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23FFE07A'/%3E%3Cstop offset='1' stop-color='%23FFB224'/%3E%3C/linearGradient%3E%3C/defs%3E %3Cpolygon points='50.0,14.0 61.2,38.6 88.0,41.6 68.1,59.9 73.5,86.4 50.0,73.0 26.5,86.4 31.9,59.9 12.0,41.6 38.8,38.6' fill='url(%23s)' stroke='%23F3A516' stroke-width='8' stroke-linejoin='round'/%3E %3Cellipse cx='39' cy='42' rx='8' ry='4.5' fill='%23fff' opacity='.6' transform='rotate(-35 39 42)'/%3E %3C/svg%3E");
  --star-off-day: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E %3Cpolygon points='50.0,14.0 61.2,38.6 88.0,41.6 68.1,59.9 73.5,86.4 50.0,73.0 26.5,86.4 31.9,59.9 12.0,41.6 38.8,38.6' fill='%23F6EEE2' stroke='%23E2CFB4' stroke-width='6' stroke-linejoin='round' stroke-dasharray='2 9' stroke-linecap='round'/%3E %3C/svg%3E");
  --star-off-night: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E %3Cpolygon points='50.0,14.0 61.2,38.6 88.0,41.6 68.1,59.9 73.5,86.4 50.0,73.0 26.5,86.4 31.9,59.9 12.0,41.6 38.8,38.6' fill='%23262859' stroke='%234A4E96' stroke-width='6' stroke-linejoin='round' stroke-dasharray='2 9' stroke-linecap='round'/%3E %3C/svg%3E");
  --star-off-img: var(--star-off-day);
  --sun-ray: rgba(255, 194, 61, .2);
  --bg-art:
    radial-gradient(60vmax 45vmax at 0% 0%, rgba(255, 210, 165, .5), transparent 70%),
    radial-gradient(55vmax 42vmax at 100% 6%, rgba(186, 218, 255, .5), transparent 70%),
    radial-gradient(50vmax 40vmax at 6% 100%, rgba(198, 232, 196, .45), transparent 70%),
    radial-gradient(56vmax 46vmax at 100% 100%, rgba(228, 214, 255, .48), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E %3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E %3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .33 0 0 0 0 .2 0 0 0 .07 0'/%3E%3C/filter%3E %3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  /* Декор по краям экрана: день — облака, звёзды, листики; ночь — луна, звёзды, тёмные облака */
  --decor-day: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 260'%3E%3Cdefs%3E%3ClinearGradient id='c1' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23FFFFFF'/%3E%3Cstop offset='1' stop-color='%23E6F0FB'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg transform='translate(70 18) scale(1.05)' opacity='0.95'%3E%3Cpath d='M40 95 C14 95 8 66 31 59 C28 35 60 26 76 42 C84 15 129 11 139 40 C153 25 186 34 183 59 C207 61 211 95 185 95 Z' fill='url(%23c1)' stroke='%23D3E3F5' stroke-width='2.5'/%3E%3C/g%3E%3Cpolygon points='51.8,146.3 55.9,160.4 69.8,164.9 57.7,173.2 57.6,187.8 46.1,178.8 32.2,183.3 37.1,169.5 28.6,157.7 43.2,158.1' fill='%23FFD27A' stroke='%23FFD27A' stroke-width='7.0' stroke-linejoin='round' opacity='0.85'/%3E%3Cpolygon points='259.9,184.2 264.6,190.6 272.6,190.4 267.9,196.8 270.6,204.3 263.0,201.9 256.7,206.8 256.7,198.8 250.1,194.3 257.7,191.8' fill='%23FFD27A' stroke='%23FFD27A' stroke-width='3.8' stroke-linejoin='round' opacity='0.8'/%3E%3Ccircle cx='150' cy='172' r='4' fill='%23F7C3A3' opacity='0.8'/%3E%3Ccircle cx='30' cy='96' r='3' fill='%23B9D5F5' opacity='0.9'/%3E%3Ccircle cx='296' cy='132' r='3.5' fill='%23F7C3A3' opacity='0.7'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 380 300'%3E%3Cdefs%3E%3ClinearGradient id='c2' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23FFFFFF'/%3E%3Cstop offset='1' stop-color='%23E9F1FA'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg transform='translate(-10 170) scale(1.45)' opacity='0.9'%3E%3Cpath d='M40 95 C14 95 8 66 31 59 C28 35 60 26 76 42 C84 15 129 11 139 40 C153 25 186 34 183 59 C207 61 211 95 185 95 Z' fill='url(%23c2)' stroke='%23D6E4F4' stroke-width='2.5'/%3E%3C/g%3E%3Cg transform='translate(250 120) rotate(-35) scale(0.9)' opacity='0.9'%3E%3Cpath d='M0 0 C18 -26 64 -30 92 0 C64 30 18 26 0 0 Z' fill='%23BEDCB0'/%3E%3Cpath d='M4 0 L84 0 M30 0 L44 -10 M30 0 L44 10 M54 0 L66 -9 M54 0 L66 9' fill='none' stroke='%239FC991' stroke-width='2.4' stroke-linecap='round'/%3E%3C/g%3E%3Cg transform='translate(300 168) rotate(20) scale(0.55)' opacity='0.85'%3E%3Cpath d='M0 0 C18 -26 64 -30 92 0 C64 30 18 26 0 0 Z' fill='%23CFE6C4'/%3E%3Cpath d='M4 0 L84 0 M30 0 L44 -10 M30 0 L44 10 M54 0 L66 -9 M54 0 L66 9' fill='none' stroke='%239FC991' stroke-width='2.4' stroke-linecap='round'/%3E%3C/g%3E%3Cpolygon points='335.1,35.9 336.2,45.8 345.0,50.5 335.9,54.6 334.1,64.4 327.4,57.0 317.6,58.4 322.5,49.7 318.2,40.8 327.9,42.8' fill='%23FFD27A' stroke='%23FFD27A' stroke-width='4.8' stroke-linejoin='round' opacity='0.8'/%3E%3Ccircle cx='200' cy='80' r='4' fill='%23B9D5F5' opacity='0.8'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 240'%3E%3Cpolygon points='147.9,36.1 156.2,49.7 172.1,50.6 161.7,62.7 165.7,78.1 151.0,72.0 137.6,80.6 139.0,64.7 126.6,54.6 142.1,50.9' fill='%23FFD27A' stroke='%23FFD27A' stroke-width='7.7' stroke-linejoin='round' opacity='0.75'/%3E%3Cpolygon points='64.0,139.0 67.2,145.6 74.5,146.6 69.2,151.7 70.5,158.9 64.0,155.5 57.5,158.9 58.8,151.7 53.5,146.6 60.8,145.6' fill='%23FFD27A' stroke='%23FFD27A' stroke-width='3.5' stroke-linejoin='round' opacity='0.7'/%3E%3Cg transform='translate(90 210) rotate(-150) scale(0.7)' opacity='0.85'%3E%3Cpath d='M0 0 C18 -26 64 -30 92 0 C64 30 18 26 0 0 Z' fill='%23BEDCB0'/%3E%3Cpath d='M4 0 L84 0 M30 0 L44 -10 M30 0 L44 10 M54 0 L66 -9 M54 0 L66 9' fill='none' stroke='%239FC991' stroke-width='2.4' stroke-linecap='round'/%3E%3C/g%3E%3Ccircle cx='196' cy='140' r='3.5' fill='%23F7C3A3' opacity='0.8'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 120'%3E%3Cg transform='translate(12 40) rotate(25) scale(0.8)' opacity='0.85'%3E%3Cpath d='M0 0 C18 -26 64 -30 92 0 C64 30 18 26 0 0 Z' fill='%23BEDCB0'/%3E%3Cpath d='M4 0 L84 0 M30 0 L44 -10 M30 0 L44 10 M54 0 L66 -9 M54 0 L66 9' fill='none' stroke='%239FC991' stroke-width='2.4' stroke-linecap='round'/%3E%3C/g%3E%3Ccircle cx='70' cy='100' r='3' fill='%23F7C3A3' opacity='0.7'/%3E%3C/svg%3E");
  --decor-night: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 260 240'%3E%3Cdefs%3E%3CradialGradient id='m'%3E%3Cstop offset='0' stop-color='%23FFE9B0' stop-opacity='.35'/%3E%3Cstop offset='1' stop-color='%23FFE9B0' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Ccircle cx='170' cy='80' r='72' fill='url(%23m)'/%3E%3Cpath d='M170 38 A42 42 0 1 0 212 92 A34 34 0 1 1 170 38 Z' fill='%23FFE7A8'/%3E%3Cpolygon points='56.0,136.0 60.1,144.3 69.3,145.7 62.7,152.2 64.2,161.3 56.0,157.0 47.8,161.3 49.3,152.2 42.7,145.7 51.9,144.3' fill='%23FFE3A1' stroke='%23FFE3A1' stroke-width='4.5' stroke-linejoin='round' opacity='0.9'/%3E%3Cpolygon points='242.7,182.5 243.3,187.8 248.0,190.3 243.2,192.5 242.2,197.7 238.6,193.8 233.4,194.5 236.0,189.9 233.7,185.1 238.9,186.2' fill='%23FFE3A1' stroke='%23FFE3A1' stroke-width='2.6' stroke-linejoin='round' opacity='0.8'/%3E%3Cpolygon points='96.0,37.0 98.1,41.2 102.7,41.8 99.3,45.1 100.1,49.7 96.0,47.5 91.9,49.7 92.7,45.1 89.3,41.8 93.9,41.2' fill='%23FFE3A1' stroke='%23FFE3A1' stroke-width='2.2' stroke-linejoin='round' opacity='0.7'/%3E%3Ccircle cx='20' cy='80' r='2' fill='%23fff' opacity='0.8'/%3E%3Ccircle cx='130' cy='200' r='1.6' fill='%23fff' opacity='0.7'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 380 300'%3E%3Cdefs%3E%3ClinearGradient id='c3' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%232B2F6B'/%3E%3Cstop offset='1' stop-color='%231F2254'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg transform='translate(-10 170) scale(1.45)' opacity='0.9'%3E%3Cpath d='M40 95 C14 95 8 66 31 59 C28 35 60 26 76 42 C84 15 129 11 139 40 C153 25 186 34 183 59 C207 61 211 95 185 95 Z' fill='url(%23c3)' stroke='%233A3F84' stroke-width='2.5'/%3E%3C/g%3E%3Cpolygon points='322.1,48.2 324.3,55.8 331.9,58.3 325.3,62.8 325.3,70.8 319.0,65.9 311.4,68.3 314.1,60.8 309.4,54.4 317.4,54.6' fill='%23FFE3A1' stroke='%23FFE3A1' stroke-width='3.8' stroke-linejoin='round' opacity='0.85'/%3E%3Cpolygon points='240.0,124.0 241.8,127.6 245.7,128.1 242.9,130.9 243.5,134.9 240.0,133.0 236.5,134.9 237.1,130.9 234.3,128.1 238.2,127.6' fill='%23FFE3A1' stroke='%23FFE3A1' stroke-width='1.9' stroke-linejoin='round' opacity='0.7'/%3E%3Ccircle cx='150' cy='70' r='2' fill='%23fff' opacity='0.8'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 240'%3E%3Cpolygon points='148.6,44.1 154.1,53.1 164.7,53.7 157.8,61.8 160.5,72.1 150.7,68.0 141.8,73.7 142.6,63.1 134.4,56.4 144.8,54.0' fill='%23FFE3A1' stroke='%23FFE3A1' stroke-width='5.1' stroke-linejoin='round' opacity='0.8'/%3E%3Cpolygon points='70.0,142.0 72.4,146.8 77.6,147.5 73.8,151.2 74.7,156.5 70.0,154.0 65.3,156.5 66.2,151.2 62.4,147.5 67.6,146.8' fill='%23FFE3A1' stroke='%23FFE3A1' stroke-width='2.6' stroke-linejoin='round' opacity='0.7'/%3E%3Ccircle cx='196' cy='140' r='2' fill='%23fff' opacity='0.8'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 120'%3E%3Cpolygon points='40.0,41.0 42.6,46.4 48.6,47.2 44.3,51.4 45.3,57.3 40.0,54.5 34.7,57.3 35.7,51.4 31.4,47.2 37.4,46.4' fill='%23FFE3A1' stroke='%23FFE3A1' stroke-width='2.9' stroke-linejoin='round' opacity='0.75'/%3E%3Ccircle cx='76' cy='98' r='1.8' fill='%23fff' opacity='0.8'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 320'%3E%3Ccircle cx='169' cy='81' r='0.9' fill='%23fff' opacity='0.27'/%3E%3Ccircle cx='278' cy='52' r='0.9' fill='%23fff' opacity='0.28'/%3E%3Ccircle cx='263' cy='113' r='0.5' fill='%23fff' opacity='0.47'/%3E%3Ccircle cx='39' cy='127' r='0.6' fill='%23fff' opacity='0.46'/%3E%3Ccircle cx='293' cy='67' r='1.4' fill='%23fff' opacity='0.57'/%3E%3Ccircle cx='302' cy='35' r='1.1' fill='%23fff' opacity='0.45'/%3E%3Ccircle cx='117' cy='27' r='1.1' fill='%23fff' opacity='0.32'/%3E%3Ccircle cx='218' cy='77' r='1.0' fill='%23fff' opacity='0.54'/%3E%3Ccircle cx='290' cy='96' r='0.6' fill='%23fff' opacity='0.54'/%3E%3Ccircle cx='100' cy='194' r='0.6' fill='%23fff' opacity='0.61'/%3E%3Ccircle cx='292' cy='34' r='1.1' fill='%23fff' opacity='0.5'/%3E%3Ccircle cx='276' cy='222' r='1.3' fill='%23fff' opacity='0.48'/%3E%3Ccircle cx='236' cy='189' r='0.8' fill='%23fff' opacity='0.65'/%3E%3Ccircle cx='128' cy='45' r='1.1' fill='%23fff' opacity='0.51'/%3E%3Ccircle cx='179' cy='233' r='0.8' fill='%23fff' opacity='0.74'/%3E%3Ccircle cx='64' cy='266' r='0.9' fill='%23fff' opacity='0.63'/%3E%3Ccircle cx='81' cy='254' r='0.9' fill='%23fff' opacity='0.73'/%3E%3Ccircle cx='43' cy='289' r='1.1' fill='%23fff' opacity='0.69'/%3E%3Ccircle cx='164' cy='178' r='1.2' fill='%23fff' opacity='0.55'/%3E%3Ccircle cx='300' cy='237' r='0.6' fill='%23fff' opacity='0.3'/%3E%3Ccircle cx='142' cy='246' r='1.2' fill='%23fff' opacity='0.28'/%3E%3Ccircle cx='162' cy='299' r='1.5' fill='%23fff' opacity='0.66'/%3E%3Ccircle cx='149' cy='201' r='1.4' fill='%23fff' opacity='0.42'/%3E%3Ccircle cx='240' cy='185' r='0.7' fill='%23fff' opacity='0.31'/%3E%3Ccircle cx='34' cy='115' r='1.3' fill='%23fff' opacity='0.31'/%3E%3Ccircle cx='130' cy='207' r='0.9' fill='%23fff' opacity='0.69'/%3E%3Ccircle cx='45' cy='89' r='0.9' fill='%23fff' opacity='0.52'/%3E%3Ccircle cx='74' cy='224' r='1.4' fill='%23fff' opacity='0.39'/%3E%3Ccircle cx='216' cy='187' r='1.2' fill='%23fff' opacity='0.44'/%3E%3Ccircle cx='122' cy='81' r='0.6' fill='%23fff' opacity='0.33'/%3E%3Ccircle cx='123' cy='10' r='1.0' fill='%23fff' opacity='0.54'/%3E%3Ccircle cx='138' cy='148' r='0.5' fill='%23fff' opacity='0.46'/%3E%3Ccircle cx='193' cy='316' r='1.1' fill='%23fff' opacity='0.73'/%3E%3Ccircle cx='267' cy='31' r='1.0' fill='%23fff' opacity='0.69'/%3E%3C/svg%3E");
  --decor: var(--decor-day);
  --decor-pos: right -24px top 64px, left -40px bottom -24px, right -8px bottom 40px, left -10px top 44%;
  --decor-size: calc(320px * var(--decor-scale)) auto, calc(380px * var(--decor-scale)) auto, calc(220px * var(--decor-scale)) auto, calc(100px * var(--decor-scale)) auto;
  --decor-repeat: no-repeat;

  /* Предмет по умолчанию (главная, настройки) — сиреневый */
  --subj: var(--lilac); --subj-hi: var(--lilac-hi); --subj-soft: var(--lilac-soft);
  --subj-line: var(--lilac-line); --subj-lip: var(--lilac-lip); --subj-ink: var(--lilac-ink);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #15163A;
    --surface: #222452;
    --surface-2: #2A2C5E;
    --surface-glass: rgba(34, 36, 82, .62);
    --text: #F4F1FF;
    --muted: #B3AFD8;
    --line: #34376D;
    --line-strong: #474B8A;
    --lip: #0F1030;
    --accent: #A99BFF;
    --accent-hi: #BDB2FF;
    --accent-ink: #17163A;
    --accent-soft: #312D6C;
    --accent-lip: #6A5BD6;
    --accent-glow: rgba(169, 155, 255, .35);
    --good: #62D69C;
    --good-hi: #8BE6B7;
    --good-ink: #9FECC4;
    --good-soft: #193F38;
    --good-lip: #0E2925;
    --bad: #FF9C88;
    --bad-ink: #FFC1B3;
    --bad-soft: #43273A;
    --bad-line: #8E4F5A;
    --bad-lip: #2A1828;
    --warn: #FFC56B;
    --star: #FFD166;
    --sun-soft: #3A3428;
    --sun-line: #6B5A33;
    --sun-ink: #FFE09A;
    --lvl0: #59567F;
    --lvl1: #79BFF5;
    --lvl2: #FFD45C;
    --lvl3: #FFA45B;
    --lvl4: #5CD392;
    --ru: #FFA867; --ru-hi: #FFC28F; --ru-soft: #3B2D45; --ru-line: #6B4C58; --ru-lip: #22182C; --ru-ink: #FFCBA3;
    --en: #6FB2F5; --en-hi: #9ACBFF; --en-soft: #1F3263; --en-line: #36538F; --en-lip: #121C40; --en-ink: #B0D7FF;
    --math: #6FCF9E; --math-hi: #98E2BB; --math-soft: #1B3B40; --math-line: #2F625C; --math-lip: #0E2427; --math-ink: #A7E9C6;
    --read: #F59BC0; --read-hi: #F9BCD4; --read-soft: #42274A; --read-line: #74476A; --read-lip: #26162C; --read-ink: #FFC4DB;
    --lilac: #A99BFF; --lilac-hi: #C3B8FF; --lilac-soft: #2E2A66; --lilac-line: #4A4495; --lilac-lip: #19173F; --lilac-ink: #D3CBFF;
    --grid-line: rgba(160, 170, 255, .08);
    --toast-bg: #F4F1FF;
    --toast-ink: #1A1B40;
    --topbar-bg: rgba(21, 22, 58, .78);
    --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 2px 4px rgba(0, 0, 0, .25), 0 14px 30px -12px rgba(0, 0, 0, .55);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 12px -6px rgba(0, 0, 0, .5);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .3), 0 24px 44px -16px rgba(0, 0, 0, .7);
    --star-off-img: var(--star-off-night);
    --sun-ray: rgba(255, 209, 102, .16);
    --bg-art:
      radial-gradient(60vmax 45vmax at 0% 0%, rgba(120, 96, 230, .34), transparent 70%),
      radial-gradient(55vmax 42vmax at 100% 6%, rgba(64, 120, 230, .28), transparent 70%),
      radial-gradient(50vmax 40vmax at 6% 100%, rgba(40, 140, 170, .2), transparent 70%),
      radial-gradient(56vmax 46vmax at 100% 100%, rgba(170, 90, 210, .22), transparent 70%),
      linear-gradient(180deg, #191A45 0%, #131433 100%);
    --decor: var(--decor-night);
    --decor-pos: right 8px top 70px, left -40px bottom -30px, right -6px bottom 60px, left -6px top 44%, 0 0;
    --decor-size: calc(240px * var(--decor-scale)) auto, calc(380px * var(--decor-scale)) auto, calc(200px * var(--decor-scale)) auto, calc(90px * var(--decor-scale)) auto, 320px 320px;
    --decor-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat;
  }
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #15163A;
    --surface: #222452;
    --surface-2: #2A2C5E;
    --surface-glass: rgba(34, 36, 82, .62);
    --text: #F4F1FF;
    --muted: #B3AFD8;
    --line: #34376D;
    --line-strong: #474B8A;
    --lip: #0F1030;
    --accent: #A99BFF;
    --accent-hi: #BDB2FF;
    --accent-ink: #17163A;
    --accent-soft: #312D6C;
    --accent-lip: #6A5BD6;
    --accent-glow: rgba(169, 155, 255, .35);
    --good: #62D69C;
    --good-hi: #8BE6B7;
    --good-ink: #9FECC4;
    --good-soft: #193F38;
    --good-lip: #0E2925;
    --bad: #FF9C88;
    --bad-ink: #FFC1B3;
    --bad-soft: #43273A;
    --bad-line: #8E4F5A;
    --bad-lip: #2A1828;
    --warn: #FFC56B;
    --star: #FFD166;
    --sun-soft: #3A3428;
    --sun-line: #6B5A33;
    --sun-ink: #FFE09A;
    --lvl0: #59567F;
    --lvl1: #79BFF5;
    --lvl2: #FFD45C;
    --lvl3: #FFA45B;
    --lvl4: #5CD392;
    --ru: #FFA867; --ru-hi: #FFC28F; --ru-soft: #3B2D45; --ru-line: #6B4C58; --ru-lip: #22182C; --ru-ink: #FFCBA3;
    --en: #6FB2F5; --en-hi: #9ACBFF; --en-soft: #1F3263; --en-line: #36538F; --en-lip: #121C40; --en-ink: #B0D7FF;
    --math: #6FCF9E; --math-hi: #98E2BB; --math-soft: #1B3B40; --math-line: #2F625C; --math-lip: #0E2427; --math-ink: #A7E9C6;
    --read: #F59BC0; --read-hi: #F9BCD4; --read-soft: #42274A; --read-line: #74476A; --read-lip: #26162C; --read-ink: #FFC4DB;
    --lilac: #A99BFF; --lilac-hi: #C3B8FF; --lilac-soft: #2E2A66; --lilac-line: #4A4495; --lilac-lip: #19173F; --lilac-ink: #D3CBFF;
    --grid-line: rgba(160, 170, 255, .08);
    --toast-bg: #F4F1FF;
    --toast-ink: #1A1B40;
    --topbar-bg: rgba(21, 22, 58, .78);
    --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 2px 4px rgba(0, 0, 0, .25), 0 14px 30px -12px rgba(0, 0, 0, .55);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 12px -6px rgba(0, 0, 0, .5);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .3), 0 24px 44px -16px rgba(0, 0, 0, .7);
    --star-off-img: var(--star-off-night);
    --sun-ray: rgba(255, 209, 102, .16);
    --bg-art:
      radial-gradient(60vmax 45vmax at 0% 0%, rgba(120, 96, 230, .34), transparent 70%),
      radial-gradient(55vmax 42vmax at 100% 6%, rgba(64, 120, 230, .28), transparent 70%),
      radial-gradient(50vmax 40vmax at 6% 100%, rgba(40, 140, 170, .2), transparent 70%),
      radial-gradient(56vmax 46vmax at 100% 100%, rgba(170, 90, 210, .22), transparent 70%),
      linear-gradient(180deg, #191A45 0%, #131433 100%);
    --decor: var(--decor-night);
    --decor-pos: right 8px top 70px, left -40px bottom -30px, right -6px bottom 60px, left -6px top 44%, 0 0;
    --decor-size: calc(240px * var(--decor-scale)) auto, calc(380px * var(--decor-scale)) auto, calc(200px * var(--decor-scale)) auto, calc(90px * var(--decor-scale)) auto, 320px 320px;
    --decor-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat;
}

[data-subject="ru"] { --subj: var(--ru); --subj-hi: var(--ru-hi); --subj-soft: var(--ru-soft); --subj-line: var(--ru-line); --subj-lip: var(--ru-lip); --subj-ink: var(--ru-ink); }
[data-subject="en"] { --subj: var(--en); --subj-hi: var(--en-hi); --subj-soft: var(--en-soft); --subj-line: var(--en-line); --subj-lip: var(--en-lip); --subj-ink: var(--en-ink); }
[data-subject="math"] { --subj: var(--math); --subj-hi: var(--math-hi); --subj-soft: var(--math-soft); --subj-line: var(--math-line); --subj-lip: var(--math-lip); --subj-ink: var(--math-ink); }
[data-subject="read"] { --subj: var(--read); --subj-hi: var(--read-hi); --subj-soft: var(--read-soft); --subj-line: var(--read-line); --subj-lip: var(--read-lip); --subj-ink: var(--read-ink); }

/* ===================== 2. Основа и фон ===================== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 12px); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.25rem;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
/* Акварельные пятна и бумага; поверх — облака, звёзды, листики по краям. Слои фиксированы и не ловят нажатия. */
body::before, body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
body::before { background: var(--bg-art); }
body::after {
  background-image: var(--decor);
  background-position: var(--decor-pos);
  background-size: var(--decor-size);
  background-repeat: var(--decor-repeat);
}

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: 2rem; font-weight: 900; }
h2 { font-size: 1.4rem; font-weight: 850; }
h3 { font-size: 1.2rem; font-weight: 800; }
p { margin: 0 0 .8em; }
ul { padding-left: 1.2em; }
li { margin-bottom: .35em; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-s); }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); }

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

/* ===================== 3. Шапка ===================== */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: var(--topbar-h);
  padding: 8px max(20px, env(safe-area-inset-right)) 8px max(20px, env(safe-area-inset-left));
  position: sticky; top: 0; z-index: 10;
  background: var(--topbar-bg);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 var(--line), 0 10px 24px -20px rgba(120, 80, 40, .4);
}
.brand {
  position: relative; display: inline-flex; align-items: center; gap: 10px; min-width: 0;
  font-weight: 900; font-size: 1.2rem; text-decoration: none; color: var(--text); white-space: nowrap;
}
.brand-logo {
  flex: none; width: 46px; height: 49px;
  background: var(--owl) center bottom / contain no-repeat;
  transform-origin: 50% 100%;
  transition: transform .4s var(--ease-spring);
}
.brand:hover .brand-logo { transform: rotate(-8deg) translateY(-2px); }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.05; }
.brand-name { font-size: 1.45rem; font-weight: 900; letter-spacing: -.02em; }
.brand-tld { color: var(--muted); font-weight: 800; }
.brand-sub { margin-top: 3px; font-size: var(--fs-xs); font-weight: 750; color: var(--muted); letter-spacing: .01em; }
.brand-ai {
  flex: none; display: grid; place-items: center;
  width: 56px; height: 37px; padding-top: 5px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 42'%3E %3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%234C9DFF'/%3E%3Cstop offset='.5' stop-color='%238B6BFF'/%3E%3Cstop offset='1' stop-color='%23FF6FB8'/%3E%3C/linearGradient%3E %3ClinearGradient id='h' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23fff' stop-opacity='.3'/%3E%3Cstop offset='.6' stop-color='%23fff' stop-opacity='0'/%3E%3C/linearGradient%3E%3C/defs%3E %3Cpath d='M15 39 C5 39 2 28 9.5 24 C7.5 13 19 7 26.5 13 C30 4 45 3 48.5 13.5 C57 12 63 20 59.5 27 C64 30 62 39 53 39 Z' fill='url(%23g)'/%3E %3Cpath d='M15 39 C5 39 2 28 9.5 24 C7.5 13 19 7 26.5 13 C30 4 45 3 48.5 13.5 C57 12 63 20 59.5 27 C64 30 62 39 53 39 Z' fill='url(%23h)'/%3E %3Ccircle cx='56' cy='9' r='2.2' fill='%23FFD45C'/%3E%3Ccircle cx='5' cy='14' r='1.5' fill='%239DD0FF'/%3E %3C/svg%3E") center / contain no-repeat;
  color: #fff; font-size: .95rem; font-weight: 900; letter-spacing: .04em;
  text-shadow: 0 1px 2px rgba(60, 40, 160, .35);
  filter: drop-shadow(0 4px 8px rgba(140, 110, 255, .35));
  animation: ai-float 4s ease-in-out infinite;
}

/* Навигация: одна капсула «⭐ 🔥 🏅» и кружок профиля в конце */
.topnav {
  display: flex; align-items: center; gap: 2px; flex-wrap: nowrap; justify-content: flex-end;
  padding: 4px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.topnav:empty { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 40px; padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-weight: 800; font-size: 1rem; color: var(--text); text-decoration: none; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
button.chip { cursor: pointer; font-family: inherit; }
.topnav .chip { background: transparent; border: 0; padding: 6px 11px; transition: background-color .2s; }
.topnav a.chip:hover { background: var(--surface-2); }
.topnav .chip-profile, .topnav a.chip[href="#/settings"] {
  margin-left: 2px; padding: 4px 12px 4px 4px; gap: 6px;
  background: var(--accent-soft); color: var(--text);
}
.topnav .chip-profile:hover, .topnav a.chip[href="#/settings"]:hover { background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent) inset; }
.chip-avatar {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface); font-size: 1.2rem; box-shadow: var(--shadow-sm);
}
.chip-nick { max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
.chip-gear { font-size: .85em; opacity: .7; }

/* ===================== 4. Раскладка ===================== */
main { max-width: 1000px; margin: 0 auto; padding: 24px 20px 96px; overflow-x: clip; }
main:focus, main:focus-visible { outline: none; }
.stack > * + * { margin-top: 16px; }
.section { margin-top: 28px; }

/* «← Наборы», «← Все тренажёры»: ссылка-таблетка */
main > a:first-child {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 18px 8px 14px;
  border-radius: 999px; background: var(--surface-glass); border: 1px solid var(--line);
  color: var(--text); font-weight: 800; font-size: var(--fs-s); text-decoration: none;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background-color .2s, transform .2s var(--ease-spring);
}
main > a:first-child:hover { background: var(--surface); transform: translateX(-2px); }

/* ===================== 5. Кнопки ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; padding: 12px 24px; border-radius: var(--radius-btn);
  border: 2px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 800; line-height: 1.2; cursor: pointer; text-decoration: none; text-align: center;
  box-shadow: 0 4px 0 var(--lip), var(--shadow-sm);
  transition: transform .14s var(--ease-out), box-shadow .14s var(--ease-out), background-color .2s, border-color .2s, color .2s, opacity .2s;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
  /* Safari рисует <button type="submit"> системным видом и может не показать градиент («Поехали!» на знакомстве) */
  -webkit-appearance: none; appearance: none;
}
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 var(--lip), 0 1px 2px rgba(0, 0, 0, .06); transition-duration: .05s; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary {
  /* Сплошной цвет под градиентом: если градиент не нарисуется, белый текст всё равно виден */
  background: linear-gradient(180deg, var(--accent-hi), var(--accent)) var(--accent); color: var(--accent-ink); border-color: transparent;
  box-shadow: 0 4px 0 var(--accent-lip), 0 10px 22px -8px var(--accent-glow);
}
.btn.primary:active:not(:disabled) { box-shadow: 0 0 0 var(--accent-lip), 0 2px 6px -2px var(--accent-glow); }
.btn.good { background: linear-gradient(180deg, var(--good-hi), var(--good)) var(--good); color: #fff; border-color: transparent; box-shadow: 0 4px 0 var(--good-lip); }
.btn.danger { color: var(--bad-ink); }
.btn.small { min-height: 44px; padding: 8px 16px; font-size: var(--fs-s); border-radius: 14px; box-shadow: 0 3px 0 var(--lip); }
.btn.small:active:not(:disabled) { transform: translateY(3px); }
.btn.wide { width: 100%; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 48px; height: 48px; min-width: 48px; padding: 0; border-radius: 50%;
  border: 2px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-size: 1.3rem; line-height: 1; cursor: pointer;
  box-shadow: 0 3px 0 var(--lip);
  transition: transform .14s var(--ease-out), box-shadow .14s, background-color .2s;
  touch-action: manipulation;
  -webkit-appearance: none; appearance: none;
}
.icon-btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--lip); }
@media (hover: hover) {
  .btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 0 var(--lip), var(--shadow); }
  .btn.primary:hover:not(:disabled) { box-shadow: 0 6px 0 var(--accent-lip), 0 14px 26px -8px var(--accent-glow); }
  .btn.good:hover:not(:disabled) { box-shadow: 0 6px 0 var(--good-lip); }
  .btn.danger:hover:not(:disabled) { background: var(--bad-soft); border-color: var(--bad-line); }
  .btn.small:hover:not(:disabled) { box-shadow: 0 4px 0 var(--lip), var(--shadow-sm); transform: translateY(-1px); }
  .icon-btn:hover { background: var(--surface-2); }
}

/* ===================== 6. Карточки, сетки, плитки ===================== */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
/* Служебные карточки (настройки, импорт, конфиденциальность): мягкое акварельное пятно в углу, по кругу пяти оттенков */
.card.stack {
  --wash: var(--lilac-soft);
  background: radial-gradient(360px 180px at 100% 0%, var(--wash), transparent 72%), var(--surface);
}
.card.stack:nth-child(5n+2) { --wash: var(--en-soft); }
.card.stack:nth-child(5n+3) { --wash: var(--ru-soft); }
.card.stack:nth-child(5n+4) { --wash: var(--math-soft); }
.card.stack:nth-child(5n+5) { --wash: var(--sun-soft); }
.card:not(.question) > h2:first-child, .card.stack > h2 { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; }
.card:has(> table) { overflow-x: auto; }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.tile {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; gap: 6px;
  min-height: 168px; padding: 20px;
  text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 5px 0 var(--lip), var(--shadow);
  transition: transform .25s var(--ease-spring), box-shadow .25s var(--ease-out);
}
a.tile:active { transform: translateY(3px) scale(.99); box-shadow: 0 2px 0 var(--lip), var(--shadow-sm); transition-duration: .08s; }
@media (hover: hover) {
  a.tile:hover { transform: translateY(-4px) rotate(-.5deg); box-shadow: 0 7px 0 var(--lip), var(--shadow-lg); }
}
.tile .tile-emoji {
  display: grid; place-items: center; flex: none;
  width: 64px; height: 64px; margin-bottom: 8px;
  font-size: 2.2rem; line-height: 1;
  border-radius: 46% 54% 50% 50% / 54% 48% 52% 46%;
  background: var(--subj-soft);
}
.tile .tile-title { font-weight: 850; font-size: 1.2rem; line-height: 1.25; text-wrap: pretty; }
.tile .small { font-weight: 650; }
.tile .progress { flex: 0 0 auto; height: 12px; margin-top: auto; }
.tile.active { background: var(--accent-soft); border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset, 0 5px 0 var(--accent-lip); }

/* Плитки предметов в каталоге: акварельная заливка, пятно и крупная буква-водяной знак */
.tile[data-subject] {
  min-height: 210px; padding: 22px;
  background: linear-gradient(165deg, var(--subj-soft) 0%, var(--surface) 78%);
  border-color: var(--subj-line);
  box-shadow: 0 6px 0 var(--subj-lip), var(--shadow);
}
.tile[data-subject]::before {
  content: ""; position: absolute; z-index: -1; top: -70px; right: -60px; width: 220px; height: 220px;
  border-radius: 44% 56% 62% 38% / 50% 40% 60% 50%;
  background: radial-gradient(circle at 40% 45%, var(--subj-hi), transparent 68%);
  opacity: .55;
}
.tile[data-subject]::after {
  position: absolute; z-index: -1; right: 14px; bottom: -18px;
  font-size: 6.5rem; font-weight: 900; line-height: 1; letter-spacing: -.04em;
  color: var(--subj); opacity: .2; transform: rotate(-8deg); pointer-events: none;
}
.tile[data-subject="ru"]::after { content: "Аа"; }
.tile[data-subject="en"]::after { content: "Aa"; }
.tile[data-subject="math"]::after { content: "×÷"; }
.tile[data-subject="read"]::after { content: "Ба"; }
.tile[data-subject] .tile-emoji { width: 72px; height: 72px; font-size: 2.5rem; background: var(--surface); box-shadow: 0 6px 14px -6px var(--subj-lip), 0 0 0 4px var(--surface-glass); }
.tile[data-subject] .tile-title { font-size: 1.35rem; }
.tile[data-subject] .small { color: var(--subj-ink); opacity: .85; }
@media (hover: hover) {
  a.tile[data-subject]:hover { box-shadow: 0 8px 0 var(--subj-lip), var(--shadow-lg); }
  a.tile[data-subject]:hover .tile-emoji { transform: rotate(-8deg) scale(1.06); }
}
.tile[data-subject] .tile-emoji { transition: transform .35s var(--ease-spring); }

.tile.soon {
  background: var(--surface-glass); border: 2px dashed var(--line-strong); box-shadow: none;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.tile.soon::before { opacity: .18; }
.tile.soon::after { opacity: .09; color: var(--muted); }
.tile.soon > :not(.badge) { opacity: .62; }
.tile.soon .tile-emoji { filter: grayscale(.8); background: var(--surface-2); box-shadow: none; }
.tile.soon .small { color: var(--muted); }

.tile.add {
  justify-content: center; align-items: flex-start;
  background: var(--surface-glass); border: 2.5px dashed var(--subj-line); box-shadow: none;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.tile.add .tile-emoji { background: var(--subj-soft); border-radius: 50%; }
.tile.add .tile-title { color: var(--subj-ink); }
@media (hover: hover) {
  a.tile.add:hover { background: var(--subj-soft); border-color: var(--subj); box-shadow: none; }
}

.badge {
  position: absolute; top: 14px; right: 14px; z-index: 1;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-xs); font-weight: 850; letter-spacing: .02em;
  padding: 4px 12px; border-radius: 999px;
  background: var(--surface); color: var(--muted); border: 1px solid var(--line);
}
.tile.soon .badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--subj); opacity: .8; }

/* ===================== 7. Совушка ===================== */
.mascot { position: relative; display: flex; align-items: flex-end; gap: 12px; }
.mascot .face {
  flex: none; display: block; width: 74px; height: 79px;
  font-size: 0; color: transparent; overflow: hidden;
  background: var(--owl) center bottom / contain no-repeat;
  transform-origin: 50% 100%;
  animation: owl-idle 5s ease-in-out infinite;
  /* Сова — кнопка: нажмёшь — заговорит */
  padding: 0; border: 0; background-color: transparent; cursor: pointer;
  -webkit-appearance: none; appearance: none; -webkit-tap-highlight-color: transparent;
}
.mascot .face:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 50%; }
.mascot .face.jump { background-image: var(--owl-happy); animation: jump .7s var(--ease-out), owl-idle 5s .7s ease-in-out infinite; }
/* Необязательный хук: ui.js mascot().say() ставит el.dataset.mood = k → сочувствующий наклон при ошибке */
.mascot[data-mood="bad"] .face { animation: owl-tilt .6s var(--ease-out) both; }
.mascot .bubble {
  position: relative; margin-bottom: 18px; max-width: 560px;
  padding: 12px 20px; border-radius: 24px 24px 24px 8px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  font-weight: 750; font-size: var(--fs-m); line-height: 1.35; text-wrap: pretty;
  transform-origin: 0 100%;
  animation: bubble-in .45s var(--ease-spring) both;
}
.mascot .bubble::before {
  content: ""; position: absolute; left: -7px; bottom: 10px; width: 16px; height: 16px;
  background: var(--surface); border-left: 1px solid var(--line); border-bottom: 1px solid var(--line);
  border-radius: 0 0 0 4px; transform: rotate(45deg) skew(10deg, 10deg);
}

/* ===================== 8. Игровой экран ===================== */
/* Экран игры занимает высоту окна; Совушка «сидит» внизу на облачке и не болтается под заданием. */
main:has(> .play-head) {
  max-width: 800px; display: flex; flex-direction: column;
  min-height: calc(100vh - var(--topbar-h));
  min-height: calc(100dvh - var(--topbar-h));
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}
main:has(> .play-head) > .section:last-child { margin-top: auto; padding-top: 28px; }
main:has(> .play-head) > .section:last-child .mascot { padding-left: 6px; }
main:has(> .play-head) > .section:last-child .mascot::before {
  content: ""; position: absolute; left: -10px; bottom: -6px; width: 120px; height: 34px; z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--subj-soft), transparent);
}
main:has(> .play-head) > .section:last-child .face { width: 88px; height: 94px; }
main:has(> .play-head) > .section:last-child .bubble { margin-bottom: 30px; }
main:has(> .play-head) p.section.muted {
  padding: 12px 18px; border-radius: var(--radius-sm); text-align: center;
  background: var(--surface-glass); border: 1px dashed var(--line-strong); font-size: var(--fs-s); font-weight: 650;
}

.play-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.progress {
  flex: 1; height: 16px; overflow: hidden; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, .05);
}
.progress > span {
  position: relative; display: block; height: 100%; min-width: 0; border-radius: 999px;
  background: linear-gradient(180deg, var(--good-hi), var(--good));
  transition: width .5s var(--ease-out);
}
.progress > span::after {
  content: ""; position: absolute; left: 6px; right: 6px; top: 3px; height: 30%;
  border-radius: 999px; background: rgba(255, 255, 255, .45);
}
.play-head .progress { height: 22px; background: var(--surface); }
.play-head .progress > span { background: linear-gradient(180deg, var(--subj-hi), var(--subj)); }
.play-head .chip {
  min-height: 44px; padding: 8px 14px; font-size: 1.05rem;
  background: var(--sun-soft); border-color: var(--sun-line); color: var(--sun-ink);
}

/* Карточка задания */
.question {
  position: relative; isolation: isolate; overflow: hidden;
  text-align: center; padding: 28px 24px 32px;
}
.card.question, .card.flash { border-radius: var(--radius-lg); animation: card-in .42s var(--ease-out) both; }
.card.question::before {
  content: ""; position: absolute; z-index: -1; inset: 0 0 auto 0; height: 70%;
  background: radial-gradient(120% 100% at 50% 0%, var(--subj-soft) 0%, transparent 70%);
}
.question > h2 { font-size: var(--fs-xl); margin-top: 6px; }
.question > p { font-size: var(--fs-l); font-weight: 750; }
.question > p.muted { font-size: var(--fs-m); font-weight: 650; }
.question .btn-row { justify-content: center; }
.q-hint {
  display: inline-block; margin-bottom: 14px; padding: 6px 18px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--subj-line); color: var(--subj-ink);
  font-weight: 850; font-size: 1.05rem; letter-spacing: .01em;
  box-shadow: 0 2px 0 var(--subj-line);
}
.q-emoji {
  display: grid; place-items: center;
  width: 1.65em; height: 1.65em; margin: 2px auto 10px;
  font-size: 4.5rem; line-height: 1;
  border-radius: 47% 53% 44% 56% / 52% 46% 54% 48%;
  background: radial-gradient(circle at 42% 38%, var(--surface) 0 18%, var(--subj-soft) 62%, transparent 72%);
}
.q-word {
  font-family: var(--font-word); font-size: var(--fs-word); font-weight: 900;
  letter-spacing: .01em; line-height: 1.15; word-break: break-word;
}
.q-word .icon-btn, .question > .icon-btn { width: 52px; height: 52px; vertical-align: middle; margin-left: 6px; background: var(--subj-soft); border-color: var(--subj-line); box-shadow: 0 3px 0 var(--subj-lip); font-size: 1.4rem; }
.q-sub { font-size: var(--fs-l); font-weight: 750; color: var(--muted); }
/* Большая кнопка «Послушать» в задании: круглая, с мягкой волной */
.card.question > .btn.primary {
  position: relative; width: 112px; height: 112px; min-height: 0; padding: 0; margin: 6px auto 0;
  border-radius: 50%; display: grid; place-items: center;
}
.card.question > .btn.primary::after {
  content: ""; position: absolute; inset: -8px; border-radius: 50%;
  border: 3px solid var(--accent); opacity: 0; animation: ring 2.2s var(--ease-out) infinite;
}

/* Варианты ответа */
.options { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 20px; }
.options.one { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* Нечётное число вариантов: последний занимает всю строку — пустой ячейки нет */
.options > .option:last-child:nth-child(odd) { grid-column: 1 / -1; }
.option {
  position: relative; min-height: 80px; padding: 14px 54px;
  font-size: 1.55rem; font-weight: 850; border-radius: 22px;
  animation: opt-in .38s var(--ease-out) both;
}
.option:nth-child(2) { animation-delay: .05s; }
.option:nth-child(3) { animation-delay: .1s; }
.option:nth-child(4) { animation-delay: .15s; }
.option .key {
  position: absolute; left: 14px; top: 50%; translate: 0 -50%;
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-2); color: var(--muted); font-size: var(--fs-xs); font-weight: 850;
}
@media (hover: none) { .option .key { display: none; } }
.option:disabled { opacity: .45; box-shadow: 0 2px 0 var(--lip); }
.option.right, .option.wrong { opacity: 1; }
.option.right {
  background: var(--good-soft); border-color: var(--good); color: var(--good-ink);
  box-shadow: 0 4px 0 var(--good-lip), 0 10px 24px -10px rgba(46, 158, 98, .45);
  animation: pop .5s var(--ease-spring);
}
.option.right::after, .option.wrong::after {
  position: absolute; right: 14px; top: 50%; margin-top: -16px;
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  font-size: 1.05rem; font-weight: 900; color: #fff;
  animation: badge-pop .4s .08s var(--ease-spring) both;
}
.option.right::after { content: "✓"; background: var(--good); }
.option.right::before {
  content: ""; position: absolute; inset: -16px -10px; pointer-events: none; border-radius: 30px;
  background:
    radial-gradient(circle, var(--star) 0 4px, transparent 5px) 6% 18% / 22px 22px no-repeat,
    radial-gradient(circle, var(--good-hi) 0 3px, transparent 4px) 94% 12% / 22px 22px no-repeat,
    radial-gradient(circle, var(--en) 0 3px, transparent 4px) 98% 86% / 22px 22px no-repeat,
    radial-gradient(circle, var(--ru) 0 4px, transparent 5px) 3% 88% / 22px 22px no-repeat,
    radial-gradient(circle, var(--star) 0 3px, transparent 4px) 52% 0% / 22px 22px no-repeat,
    radial-gradient(circle, var(--lilac) 0 3px, transparent 4px) 48% 100% / 22px 22px no-repeat;
  animation: sparkle .8s var(--ease-out) forwards;
}
.option.wrong {
  background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad-ink);
  box-shadow: 0 4px 0 var(--bad-lip);
  animation: wobble .5s ease-in-out;
}
.option.wrong::after { content: "×"; background: var(--bad-line); font-size: 1.35rem; }

/* Трудные буквы */
.gap {
  display: inline-block; min-width: .72em; padding: 0 .08em; margin: 0 .03em;
  line-height: 1.08; text-align: center; border-radius: .16em;
  background: var(--accent-soft); color: var(--accent);
  box-shadow: inset 0 -.09em 0 var(--accent);
}
.gap.filled-right { background: var(--good-soft); color: var(--good); box-shadow: inset 0 -.09em 0 var(--good); animation: pop .45s var(--ease-spring); }
.gap.filled-wrong { background: var(--bad-soft); color: var(--bad); box-shadow: inset 0 -.09em 0 var(--bad-line); animation: wobble .45s; }
.flash button.q-word { transition: transform .2s var(--ease-spring); padding: 4px 8px; border-radius: 16px; }
.flash button.q-word:hover { transform: scale(1.03); }
.flash button.q-word:hover .gap { background: var(--accent); color: var(--accent-ink); }
/* Правильная буква — маркером, неправильная — «красной ручкой» сверху, крупно */
.letter-right { color: var(--good); background: linear-gradient(transparent 64%, var(--good-soft) 64%, var(--good-soft) 94%, transparent 94%); border-radius: 2px; }
.strike {
  /* Нулевая ширина: буква не раздвигает слово, а «висит» над правильной, как исправление учителя */
  display: inline-block; width: 0; overflow: visible; white-space: nowrap;
  position: relative; left: -.6em; top: -1.02em;
  font-size: .62em; font-weight: 900; line-height: 1;
  color: var(--bad); opacity: 1;
  text-decoration: line-through; text-decoration-thickness: .12em; text-decoration-color: var(--bad);
  transform: rotate(-8deg);
}
.result-list .strike, .feedback .strike { font-size: .7em; top: -.9em; left: -.62em; }
.result-list li:has(.strike), .feedback:has(.strike) { padding-top: 18px; }

/* Буквы-плитки */
.slots { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; min-height: 76px; }
.slot {
  display: grid; place-items: center; width: 64px; height: 76px; padding: 0;
  border-radius: 18px; border: 2.5px dashed var(--subj-line); background: var(--surface-2);
  font: inherit; font-family: var(--font-word); font-size: 2.2rem; font-weight: 900; color: var(--text);
}
.slot:disabled { cursor: default; }
.slot.full {
  border-style: solid; border-color: var(--subj); background: var(--subj-soft); color: var(--subj-ink);
  box-shadow: 0 3px 0 var(--subj-lip); cursor: pointer;
  animation: drop-in .3s var(--ease-spring);
}
.tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 24px; }
.tiles .btn {
  width: 72px; min-width: 72px; height: 78px; min-height: 0; padding: 0;
  font-family: var(--font-word); font-size: 2.1rem; font-weight: 900;
  border-radius: 18px; border-color: var(--subj-line); color: var(--subj-ink);
  box-shadow: 0 5px 0 var(--subj-lip), var(--shadow-sm);
}
.tiles .btn:nth-child(3n+1) { rotate: -2deg; }
.tiles .btn:nth-child(3n+2) { rotate: 1.5deg; }
.tiles .btn:active:not(:disabled) { box-shadow: 0 0 0 var(--subj-lip); }

/* Ввод слова */
.answer-input, input.answer-input {
  width: 100%; min-height: 76px; padding: 14px 18px;
  font: inherit; font-family: var(--font-word); font-size: 2.25rem; font-weight: 850; text-align: center;
  border-radius: 22px; border: 2px solid var(--line-strong); background: var(--surface); color: var(--text);
  box-shadow: inset 0 3px 0 rgba(0, 0, 0, .03);
  transition: border-color .2s, box-shadow .2s;
}
.answer-input:focus, input.answer-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.answer-input:disabled { opacity: 1; background: var(--surface-2); }

/* Ответ: «верно» — праздник, «ошибка» — спокойная подсказка */
.feedback {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 10px;
  margin-top: 18px; padding: 16px 22px; border-radius: 22px;
  font-weight: 850; font-size: 1.3rem; text-align: center;
  animation: rise-in .4s var(--ease-out) both;
}
.feedback.good { background: var(--good-soft); color: var(--good-ink); border: 1px solid var(--good-lip); }
.feedback.good::before { content: "✨"; }
.feedback.bad { background: var(--bad-soft); color: var(--text); border: 1.5px dashed var(--bad-line); }
.feedback.bad::before { content: "💡"; }

/* Карточка знакомства — как лист в клетку */
.flash {
  min-height: 340px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  text-align: center; padding: 32px 24px;
  background-color: var(--surface);
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 26px 26px; background-position: center;
}
.flash .q-emoji { background: radial-gradient(circle at 42% 38%, var(--surface) 0 30%, var(--subj-soft) 64%, transparent 72%); }
.flash .hidden-word { font-size: 2.6rem; font-weight: 900; letter-spacing: .3em; color: var(--subj); }
.flash > .muted { font-weight: 700; }
.transcription { font-size: var(--fs-l); color: var(--muted); font-weight: 700; }
.flash + .btn-row .btn, .flash ~ .btn-row .btn { min-width: 240px; min-height: 64px; font-size: 1.3rem; }

/* ===================== 9. Итог проверки ===================== */
.stars {
  position: relative; display: flex; justify-content: center; align-items: flex-end; gap: 10px;
  margin: 10px 0 16px; font-size: 0; line-height: 0;
}
.stars > span {
  display: block; width: 76px; height: 76px;
  background: var(--star-img) center / contain no-repeat;
  filter: drop-shadow(0 6px 8px rgba(243, 165, 22, .3));
  animation: star-in .6s var(--ease-spring) both;
}
.stars > span:nth-child(2) { width: 96px; height: 96px; margin-bottom: 14px; animation-delay: .15s; }
.stars > span:nth-child(3) { animation-delay: .3s; }
.stars > .off { background-image: var(--star-off-img); filter: none; animation-name: fade-in; }
/* Три звезды из трёх — лучики солнца за звёздами */
.stars:not(:has(.off))::before {
  content: ""; position: absolute; z-index: -1; left: 50%; top: 50%;
  width: 320px; height: 320px; margin: -160px 0 0 -160px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, var(--sun-ray) 0deg 9deg, transparent 9deg 24deg);
  -webkit-mask: radial-gradient(circle, #000 22%, transparent 68%);
  mask: radial-gradient(circle, #000 22%, transparent 68%);
  animation: spin 30s linear infinite;
}
/* Колонки «Знает» / «Ошибки» делят ширину поровну, без пустой третьей */
.question + .grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.question + .grid > .card { animation: rise-in .45s .2s var(--ease-out) both; }
.question + .grid > .card + .card { animation-delay: .3s; }
.question + .grid h3 { display: flex; align-items: center; gap: 8px; }
.result-list { list-style: none; padding: 0; margin: 0; }
.result-list li {
  padding: 10px 14px; border-radius: 14px; margin-bottom: 8px;
  font-weight: 750; font-size: 1.1rem; line-height: 1.35;
}
.result-list.good li { background: var(--good-soft); color: var(--good-ink); }
.result-list.bad li { background: var(--bad-soft); color: var(--bad-ink); }
.result-list s { text-decoration-thickness: 2px; opacity: .8; }
.result-list .right-answer { color: var(--text); font-weight: 800; }

/* ===================== 10. Страница набора ===================== */
.stages { display: grid; gap: 22px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.btn.stage {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 4px;
  min-height: 210px; padding: 20px 18px 18px; text-align: left; white-space: normal;
  border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: 0 5px 0 var(--lip), var(--shadow);
  --stage: var(--lilac-soft);
}
.stage:nth-child(2) { --stage: var(--subj-soft); }
.stage:nth-child(3) { --stage: var(--good-soft); }
.stage .num {
  display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 10px;
  font-size: 2.1rem; line-height: 1; border-radius: 50%; background: var(--stage);
}
.stage > span:nth-child(2) { font-size: 1.3rem; font-weight: 900; }
.stage > span:nth-child(3) { color: var(--muted); font-size: var(--fs-s); line-height: 1.35; }
.stage > span:last-child {
  margin-top: auto; padding: 4px 12px; border-radius: 999px;
  background: var(--stage); font-size: .875rem; font-weight: 800 !important;
}
/* Пунктир-тропинка между этапами */
.stage:not(:last-child)::after {
  content: ""; position: absolute; top: 50px; right: -23px; width: 24px; height: 6px;
  background: radial-gradient(circle, var(--line-strong) 2.5px, transparent 3px) 0 50% / 8px 6px repeat-x;
}
.btn.stage.primary {
  background: var(--surface); color: var(--text); border: 2px solid var(--accent);
  box-shadow: 0 5px 0 var(--accent-lip), 0 16px 30px -12px var(--accent-glow);
}
.btn.stage.primary::before {
  content: ""; position: absolute; inset: -7px; border-radius: 30px;
  border: 3px solid var(--accent); opacity: 0; pointer-events: none;
  animation: ring 2.6s var(--ease-out) infinite;
}
.btn.stage.primary > span:last-child { background: var(--accent); color: var(--accent-ink); opacity: 1 !important; }

/* Уровни слов */
.lvl {
  display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 50%;
  vertical-align: middle; margin-right: 6px;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px rgba(0, 0, 0, .07);
}
.lvl-0 { background: var(--lvl0); } .lvl-1 { background: var(--lvl1); } .lvl-2 { background: var(--lvl2); }
.lvl-3 { background: var(--lvl3); } .lvl-4 { background: var(--lvl4); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: var(--fs-s); color: var(--muted); font-weight: 650; }
.word-dots { display: flex; flex-wrap: wrap; gap: 10px; }
.word-dot {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 8px 16px 8px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-weight: 800; font-size: 1.05rem;
}

/* ===================== 11. Формы и служебные экраны ===================== */
label { font-weight: 800; display: block; margin-bottom: 6px; }
input[type="text"], input[type="search"], input[type="number"], textarea, select {
  width: 100%; font: inherit; padding: 12px 16px; border-radius: var(--radius-sm);
  border: 2px solid var(--line); background: var(--surface); color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
input[type="text"]:focus, input[type="search"]:focus, input[type="number"]:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
::placeholder { color: var(--muted); opacity: .7; }
/* Поле для слов — как разлинованная тетрадь */
textarea {
  min-height: 200px; resize: vertical; line-height: 32px; padding: 10px 16px;
  background-image: linear-gradient(var(--surface) 31px, var(--grid-line) 31px, var(--grid-line) 32px, var(--surface) 32px);
  background-size: 100% 32px; background-position: 0 10px; background-attachment: local;
}
input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--accent); vertical-align: middle; }
/* Флажок в настройках — переключатель */
.stack > label > input[type="checkbox"] {
  -webkit-appearance: none; appearance: none; position: relative; flex: none;
  width: 52px; height: 32px; margin: 0 10px 0 0; border-radius: 999px; cursor: pointer;
  background: var(--line-strong); transition: background-color .25s;
}
.stack > label > input[type="checkbox"]::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2);
  transition: transform .3s var(--ease-spring);
}
.stack > label > input[type="checkbox"]:checked { background: var(--good); }
.stack > label > input[type="checkbox"]:checked::before { transform: translateX(20px); }
.stack > label:has(> input[type="checkbox"]) { display: flex; align-items: center; min-height: 44px; cursor: pointer; }

.seg {
  display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px;
  border-radius: 24px; background: var(--surface-2); border: 1px solid var(--line);
}
.seg button {
  font: inherit; font-weight: 800; font-size: 1rem; min-height: 44px; padding: 8px 18px;
  border: 0; border-radius: 999px; background: transparent; color: var(--muted);
  cursor: pointer; white-space: nowrap; transition: background-color .2s, color .2s, box-shadow .2s;
}
.seg button:hover { color: var(--text); background: var(--surface); }
.seg button[aria-pressed="true"] {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent)); color: var(--accent-ink);
  box-shadow: 0 3px 0 var(--accent-lip), 0 8px 16px -8px var(--accent-glow);
}

details.card > summary {
  display: flex; align-items: center; gap: 8px; min-height: 40px; list-style: none; cursor: pointer;
}
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "›"; margin-left: auto; font-size: 1.6rem; line-height: 1; color: var(--muted); transition: transform .25s var(--ease-out); }
details.card[open] > summary::after { transform: rotate(90deg); }

.preview-word { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px dashed var(--line-strong); }
.letters { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.letter {
  min-width: 40px; min-height: 48px; font: inherit; font-family: var(--font-word); font-size: 1.35rem; font-weight: 850;
  border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer;
  box-shadow: 0 3px 0 var(--lip); transition: transform .12s, background-color .2s;
}
.letter:active { transform: translateY(3px); box-shadow: none; }
.letter.marked { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 3px 0 var(--accent-lip); }
.alt-pick { font-size: var(--fs-s); color: var(--muted); }
.alt-pick select { width: auto; padding: 4px 10px; border-radius: 10px; }
.warn { color: var(--warn); font-weight: 750; }

.en-row { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line-strong); }
.emoji-btn {
  width: 56px; height: 56px; font-size: 1.8rem; border-radius: 16px; cursor: pointer;
  border: 2px solid var(--line); background: var(--surface-2); box-shadow: 0 3px 0 var(--lip);
}
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 8px; max-height: 280px; overflow: auto; padding: 2px; }
.emoji-grid button {
  height: 54px; font-size: 1.7rem; border-radius: 14px; cursor: pointer;
  border: 2px solid transparent; background: var(--surface-2); transition: transform .15s var(--ease-spring), border-color .2s;
}
.emoji-grid button:hover { transform: scale(1.08); border-color: var(--accent); }

dialog {
  width: 100%; max-width: min(560px, calc(100vw - 32px)); padding: 26px;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
dialog[open] { animation: card-in .35s var(--ease-out); }
dialog::backdrop { background: rgba(30, 24, 60, .45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: var(--fs-s); }
th { color: var(--muted); font-weight: 800; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; }
tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }

.avatars { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 72px)); gap: 10px; }
.avatars button {
  aspect-ratio: 1; width: 100%; height: auto; font-size: 2.2rem; border-radius: 50%; cursor: pointer;
  border: 2px solid var(--line); background: var(--surface); box-shadow: 0 3px 0 var(--lip);
  transition: transform .25s var(--ease-spring), box-shadow .2s, background-color .2s;
}
.avatars button:hover { transform: translateY(-2px) rotate(-6deg); }
.avatars button[aria-pressed="true"] {
  border-color: var(--accent); background: var(--accent-soft); transform: scale(1.08);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 3px 0 var(--accent-lip);
}

/* Наклейки: вырезанные по контуру кружки; закрытые — силуэт */
.stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
.card.sticker { text-align: center; padding: 18px 10px 16px; --tint: var(--lilac-soft); }
.sticker:nth-child(5n+2) { --tint: var(--ru-soft); }
.sticker:nth-child(5n+3) { --tint: var(--en-soft); }
.sticker:nth-child(5n+4) { --tint: var(--math-soft); }
.sticker:nth-child(5n+5) { --tint: var(--sun-soft); }
.sticker .s-emoji {
  display: grid; place-items: center; width: 88px; height: 88px; margin: 0 auto 10px;
  font-size: 3.1rem; line-height: 1; border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, var(--surface) 0 22%, var(--tint) 70%);
  box-shadow: 0 0 0 5px var(--surface), 0 0 0 6px var(--line), 0 10px 18px -8px rgba(120, 80, 40, .35);
  rotate: -5deg; transition: rotate .3s var(--ease-spring);
}
.sticker:nth-child(even) .s-emoji { rotate: 5deg; }
.sticker:hover .s-emoji { rotate: 0deg; }
.sticker .s-name { font-weight: 900; font-size: 1.1rem; }
.sticker.locked { background: var(--surface-glass); border: 2px dashed var(--line-strong); box-shadow: none; }
.sticker.locked .s-emoji {
  color: transparent; text-shadow: 0 0 0 var(--line-strong);
  background: var(--surface-2); box-shadow: 0 0 0 5px var(--surface-glass);
}
.sticker.locked .s-name { color: var(--muted); letter-spacing: .1em; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 50;
  transform: translateX(-50%) translateY(140px);
  max-width: calc(100vw - 32px); padding: 14px 24px; border-radius: 999px;
  background: var(--toast-bg); color: var(--toast-ink); font-weight: 800; text-align: center;
  box-shadow: var(--shadow-lg);
  transition: transform .45s var(--ease-spring);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* Конфетти: цвета задаёт JS, здесь делаем их пастельнее и разнообразнее по форме */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.confetti i {
  position: absolute; top: -20px; width: 11px; height: 15px; border-radius: 3px;
  filter: saturate(.72) brightness(1.1);
  animation: fall linear forwards;
}
.confetti i:nth-child(3n) { width: 10px; height: 10px; border-radius: 50%; }
.confetti i:nth-child(4n+1) { width: 7px; height: 18px; border-radius: 4px; --sway: -40px; }
.confetti i:nth-child(5n+2) { --sway: 50px; }

/* ===================== 12. Анимации ===================== */
@keyframes card-in { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes opt-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
@keyframes bubble-in { from { opacity: 0; transform: translateY(6px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes badge-pop { from { transform: scale(0) rotate(-30deg); } to { transform: none; } }
@keyframes wobble {
  0%, 100% { transform: none; }
  20% { transform: translateX(-5px) rotate(-1.5deg); }
  40% { transform: translateX(5px) rotate(1deg); }
  60% { transform: translateX(-3px) rotate(-.5deg); }
  80% { transform: translateX(2px); }
}
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
.shake, .card.question.shake, .card.flash.shake { animation: shake .45s ease-in-out; }
@keyframes sparkle { 0% { opacity: 1; transform: scale(.7); } 100% { opacity: 0; transform: scale(1.18); } }
@keyframes drop-in { from { transform: translateY(-10px) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes star-in { 0% { opacity: 0; transform: scale(.2) rotate(-50deg); } 70% { opacity: 1; transform: scale(1.15) rotate(8deg); } 100% { transform: none; } }
@keyframes spin { to { transform: rotate(1turn); } }
@keyframes ring { 0% { opacity: .55; transform: scale(.97); } 100% { opacity: 0; transform: scale(1.06); } }
@keyframes ai-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes owl-idle { 0%, 100% { transform: none; } 50% { transform: translateY(-2px) rotate(-1.5deg); } }
@keyframes jump {
  0% { transform: none; }
  30% { transform: translateY(-20px) rotate(-8deg) scale(1.04); }
  55% { transform: translateY(0) scale(1.07, .93); }
  75% { transform: translateY(-6px) rotate(3deg); }
  100% { transform: none; }
}
@keyframes owl-tilt { 0% { transform: none; } 60% { transform: rotate(-10deg); } 100% { transform: rotate(-7deg); } }
@keyframes fall { to { transform: translate3d(var(--sway, 20px), 110vh, 0) rotate(720deg); } }

/* ===================== 13. Адаптив ===================== */
/* Планшет и выше, высокий экран: карточка задания занимает треть высоты, содержимое — по центру. Низ не пустеет. */
@media (min-width: 601px) and (min-height: 760px) {
  main:has(> .play-head) .card.question, main:has(> .play-head) .card.flash {
    min-height: clamp(240px, 34vh, 380px);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
  }
  main:has(> .play-head) .card.question > .section, main:has(> .play-head) .card.question > .btn-row { align-self: stretch; }
  main:has(> .play-head) .card.question > .q-word { margin-top: 2px; }
}
@media (min-width: 1100px) {
  .grid > .tile[data-subject] { min-height: 230px; }
}
@media (max-width: 760px) {
  .stages { gap: 14px; grid-template-columns: 1fr; }
  .btn.stage {
    display: grid; grid-template-columns: 60px 1fr; column-gap: 16px; row-gap: 2px; align-items: center;
    min-height: 0; padding: 16px;
  }
  .stage .num { grid-row: 1 / span 3; width: 60px; height: 60px; margin: 0; }
  .stage > span:last-child { justify-self: start; margin-top: 6px; }
  .stage:not(:last-child)::after {
    top: auto; right: auto; left: 44px; bottom: -17px; width: 6px; height: 20px;
    background: radial-gradient(circle, var(--line-strong) 2.5px, transparent 3px) 50% 0 / 6px 8px repeat-y;
  }
}
@media (max-width: 600px) {
  :root { --topbar-h: 60px; --decor-scale: .62; --fs-word: clamp(2.25rem, 1.6rem + 3.5vw, 2.6rem); }
  body { font-size: 1.125rem; }
  h1 { font-size: 1.65rem; }
  main { padding: 16px 16px 80px; }
  .section { margin-top: 22px; }
  .card { padding: 18px; }
  .grid { gap: 14px; }

  /* Шапка в одну строку: без подзаголовка, AI — облачком на сове, профиль — только зверёк */
  .topbar { gap: 8px; padding: 6px max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left)); }
  .brand { gap: 6px; }
  .brand-logo { width: 38px; height: 40px; }
  .brand-name { font-size: 1.2rem; }
  .brand-sub { display: none; }
  .brand-ai { position: absolute; left: 22px; top: -6px; width: 30px; height: 20px; padding-top: 2px; font-size: .56rem; }
  .topnav { padding: 3px; }
  .topnav .chip { min-height: 38px; padding: 4px 7px; font-size: .95rem; gap: 2px; }
  .topnav .chip-profile { padding: 3px; margin-left: 0; }
  .chip-nick, .chip-gear { display: none; }
  .topnav a.chip[href="#/settings"]:not(.chip-profile) { display: inline-block; max-width: 6.2em; overflow: hidden; text-overflow: ellipsis; line-height: 30px; }

  .tile { min-height: 140px; padding: 18px; }
  /* Каталог на телефоне: плитки-строки, все три видны без прокрутки */
  .tile[data-subject] {
    display: grid; grid-template-columns: 64px 1fr; column-gap: 16px; row-gap: 2px; align-content: center;
    min-height: 116px; padding: 16px 18px;
  }
  .tile[data-subject] .tile-emoji { grid-row: 1 / span 2; width: 64px; height: 64px; margin: 0; font-size: 2.1rem; align-self: center; }
  .tile[data-subject] .tile-title { font-size: 1.2rem; align-self: end; padding-right: 48px; }
  .tile[data-subject] .small { align-self: start; }
  .tile[data-subject] .badge { top: 12px; right: 12px; }
  .tile[data-subject]::after { font-size: 4.2rem; bottom: -12px; }

  .options:not(.one) { grid-template-columns: 1fr; gap: 12px; }
  .option { min-height: 66px; font-size: 1.4rem; padding: 12px 48px; }
  .options.one .option { padding: 12px 20px; }
  .options.one .option.right::after, .options.one .option.wrong::after { right: 8px; top: 8px; margin-top: 0; width: 26px; height: 26px; font-size: .95rem; }
  .card.question { padding: 22px 16px 24px; }
  .q-emoji { font-size: 3.6rem; }
  .q-hint { font-size: .95rem; padding: 5px 14px; }
  .card.question > .btn.primary { width: 96px; height: 96px; }
  .slot { width: 46px; height: 56px; font-size: 1.65rem; border-radius: 13px; }
  .slots { gap: 6px; }
  .tiles { gap: 10px; }
  .tiles .btn { width: 56px; min-width: 56px; height: 60px; font-size: 1.65rem; border-radius: 15px; }
  .answer-input, input.answer-input { font-size: 1.9rem; min-height: 68px; }
  .feedback { font-size: 1.15rem; padding: 14px 16px; }
  .flash { min-height: 290px; }

  .mascot .face { width: 60px; height: 64px; }
  main:has(> .play-head) > .section:last-child { padding-top: 20px; }
  main:has(> .play-head) > .section:last-child .face { width: 68px; height: 73px; }
  main:has(> .play-head) > .section:last-child .bubble { margin-bottom: 22px; }
  .mascot .bubble { font-size: 1.02rem; padding: 10px 16px; }

  .stars > span { width: 62px; height: 62px; }
  .stars > span:nth-child(2) { width: 80px; height: 80px; }
  .seg button { padding: 8px 12px; font-size: .92rem; }
  .stickers { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
}
@media (max-width: 370px) {
  .brand-name { font-size: 1.05rem; }
  .topnav .chip { padding: 4px 5px; font-size: .9rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Код набора: крупно и с разрядкой, чтобы его было легко продиктовать */
.share-code {
  margin: 4px 0 12px; padding: 14px 18px; text-align: center;
  font-size: 2.4rem; font-weight: 900; letter-spacing: .28em; font-variant-numeric: tabular-nums;
  color: var(--accent); background: var(--accent-soft); border: 2px dashed var(--accent); border-radius: var(--radius);
}
.code-form .btn-row { flex-wrap: nowrap; }
.code-form input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .18em; font-weight: 800; }

/* «← Назад» под заданием знакомства и проверки */
.play-nav { display: flex; justify-content: flex-start; margin-top: 14px; }
.play-nav .nav-back { opacity: .85; }
.play-nav .nav-back:hover { opacity: 1; }

/* Поиск по наборам в тренажёре */
.set-search { margin-top: 14px; -webkit-appearance: none; appearance: none; }

/* Страница набора: один понятный следующий шаг */
.next-step {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  border: 2px solid var(--accent-soft);
}
.next-step .mascot { flex: 1 1 280px; }
.next-cta { min-height: 64px; padding: 14px 30px; font-size: 1.25rem; flex: 0 0 auto; }

/* Состояние этапов: пройден — галочка на значке, текущий — рамка, будущие — приглушены */
.btn.stage.is-done .num { position: relative; }
.btn.stage.is-done .num::after {
  content: "✓"; position: absolute; right: -4px; bottom: -4px;
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--good); color: #fff; font-size: .95rem; font-weight: 900;
  box-shadow: 0 0 0 3px var(--surface);
}
.btn.stage.is-done > span:last-child { background: var(--good-soft); color: var(--good-ink); }
.btn.stage.is-later { opacity: .72; }
.btn.stage.is-later:hover { opacity: 1; }

.set-actions { margin-top: 28px; }
@media (max-width: 600px) {
  .next-cta { width: 100%; }
}

/* ===================== Читаем по слогам (js/modules/read) ===================== */
/* Программа: плитки занятий */
.day-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); margin-top: 12px; }
.day {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 112px; padding: 10px 8px 12px; cursor: pointer;
  font: inherit; color: var(--text); text-align: center;
  background: var(--surface); border: 2px solid var(--line); border-radius: 22px;
  box-shadow: 0 4px 0 var(--lip), var(--shadow-sm);
  transition: transform .15s var(--ease-out);
}
.day:hover { transform: translateY(-2px); }
.day-n { font-size: .85rem; font-weight: 850; color: var(--muted); }
.day-letters { font-family: var(--font-word); font-size: 1.7rem; font-weight: 900; line-height: 1.2; color: var(--subj-ink); }
.day-stars { min-height: 1.2em; font-size: .85rem; }
.day.is-done { background: var(--subj-soft); border-color: var(--subj-line); }
.day.is-current { border-color: var(--subj); box-shadow: 0 0 0 3px var(--subj) inset, 0 4px 0 var(--subj-lip); animation: pop .5s var(--ease-spring); }
.day.is-locked { opacity: .55; }
.day.is-locked:hover { opacity: .85; }
.parent-tip { border-left: 6px solid var(--subj); }
details.card summary { cursor: pointer; }
details.card ul { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 8px; }

/* Буква крупно: большая и маленькая */
.big-letter {
  font-family: var(--font-word); font-size: clamp(5rem, 4rem + 6vw, 8rem); font-weight: 900; line-height: 1;
  color: var(--subj-ink); letter-spacing: .02em;
}
.big-letter > span { margin-left: .15em; font-size: .7em; color: var(--muted); }
.big-letter.solo { margin: 6px 0 4px; }
.big-letter.seq { font-size: clamp(3.5rem, 3rem + 4vw, 5.5rem); }
/* Подсветка буквы в слове без отступов: слово не должно распадаться («с ы р») */
.hl { color: var(--subj-ink); background: var(--subj-soft); border-radius: 4px; }
.q-hint .hint-say { all: unset; cursor: pointer; margin-left: 8px; }
.letters-inline { font-family: var(--font-word); font-size: 1.4rem; letter-spacing: .1em; }

/* Картинки со словами (знакомство, азбука) */
.pic-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }
.pic {
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 96px; padding: 10px 12px;
  font: inherit; font-weight: 750; color: var(--text); cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--subj-line); border-radius: 18px; box-shadow: 0 3px 0 var(--subj-line);
}
.pic-emoji { font-size: 2.6rem; line-height: 1.1; }

/* Варианты-буквы и варианты-картинки */
.options.opt-letters .option { font-family: var(--font-word); font-size: 2.4rem; padding: 10px 40px; }
.options.pics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.options.pics > .option:last-child:nth-child(odd) { grid-column: auto; }
.options.pics .option { min-height: 108px; font-size: 3.4rem; padding: 10px; }
.options.pics .option .key { display: none; }

/* Слово по слогам: дужки под слогами, чередование цвета */
.syl-word { display: inline-flex; gap: .06em; font-family: var(--font-word); font-weight: 900; white-space: nowrap; }
button.syl-word { all: unset; display: inline-flex; gap: .06em; cursor: pointer; font-family: var(--font-word); font-weight: 900; border-radius: 12px; padding: 2px 6px; }
button.syl-word:hover { background: var(--subj-soft); }
button.syl-word.read { background: var(--good-soft); }
.syl { position: relative; padding-bottom: .16em; }
.syl::after {
  content: ""; position: absolute; left: 8%; right: 8%; bottom: 0; height: .2em;
  border: .07em solid currentColor; border-top: 0; border-radius: 0 0 1em 1em; opacity: .55;
}
.syl.s0 { color: var(--subj-ink); }
.syl.s1 { color: var(--accent); }
.q-word .syl-word { font-size: var(--fs-word); }
.read-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 22px; margin-top: 14px; font-size: 2.2rem; }
.question > p.sentence { display: flex; flex-wrap: wrap; justify-content: center; gap: .15em .55em; margin: 14px 0; font-size: 2.4rem; line-height: 1.5; font-weight: 800; }
.question > p.small-sentence { font-size: 1.2rem; color: var(--muted); }
.story { display: grid; gap: 6px; text-align: left; margin-top: 10px; }
.story-line { all: unset; display: flex; flex-wrap: wrap; gap: .1em .45em; cursor: pointer; padding: 6px 10px; border-radius: 14px; font-size: 1.7rem; line-height: 1.6; }
.story-line:hover { background: var(--subj-soft); }

/* Слоговая таблица и цепочки */
.syl-table { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); margin-top: 16px; }
.syl-cell {
  min-height: 84px; font: inherit; font-family: var(--font-word); font-size: 2.3rem; font-weight: 900; cursor: pointer;
  color: var(--subj-ink); background: var(--surface); border: 2px solid var(--subj-line); border-radius: 20px;
  box-shadow: 0 4px 0 var(--subj-lip);
}
.syl-cell.read { background: var(--good-soft); border-color: var(--good); color: var(--good-ink); box-shadow: 0 4px 0 var(--good-lip); }

/* Слияние: первая буква едет по дорожке ко второй */
.slide-track {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; max-width: 420px; margin: 22px auto 8px; font-family: var(--font-word); font-size: clamp(3.5rem, 3rem + 4vw, 5.5rem); font-weight: 900;
}
.slide-a, .slide-b {
  position: relative; z-index: 1; display: grid; place-items: center; width: 1.4em; height: 1.4em;
  border-radius: 24px; background: var(--subj-soft); color: var(--subj-ink); box-shadow: 0 4px 0 var(--subj-lip);
}
.slide-b { background: var(--accent-soft); color: var(--accent); box-shadow: 0 4px 0 var(--accent-lip); }
.slide-road { flex: 1; min-width: 60px; height: 6px; border-radius: 3px; background: repeating-linear-gradient(90deg, var(--subj-line) 0 14px, transparent 14px 24px); }
.slide-track.go .slide-a { animation: slide-run 1.2s var(--ease-out) forwards; }
/* --dx считает lesson.js: первая буква встаёт вплотную ко второй */
@keyframes slide-run { to { transform: translateX(var(--dx, 0)); } }
.slide-result { min-height: 1.3em; font-family: var(--font-word); font-size: clamp(3rem, 2.6rem + 3vw, 4.5rem); font-weight: 900; color: var(--good); animation: pop .5s var(--ease-spring); }

/* Сборка слога и слова */
.slot.right { border-color: var(--good); background: var(--good-soft); color: var(--good-ink); }
.slot.wrong { border-color: var(--bad-line); background: var(--bad-soft); }
.syl-slots .slot { width: auto; min-width: 104px; padding: 0 12px; }
.syl-slots.right .slot { border-color: var(--good); background: var(--good-soft); color: var(--good-ink); }
.syl-slots.wrong .slot { border-color: var(--bad-line); background: var(--bad-soft); }
.syl-tiles .btn { width: auto; min-width: 96px; padding: 0 14px; }

/* Азбука */
.abc-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
.abc {
  height: 72px; font: inherit; font-family: var(--font-word); font-size: 2.1rem; font-weight: 900; cursor: pointer;
  color: var(--muted); background: var(--surface-2); border: 2px solid var(--line); border-radius: 18px;
}
.abc.is-known { color: var(--subj-ink); background: var(--subj-soft); border-color: var(--subj-line); box-shadow: 0 3px 0 var(--subj-lip); }
.abc-card { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.abc-card > .big-letter { flex: 0 0 auto; }
.abc-card > div { flex: 1 1 240px; }
.abc-card .pic-row { justify-content: flex-start; }

@media (max-width: 600px) {
  .options.opt-letters .option { font-size: 2rem; padding: 10px; }
  .options.pics .option { font-size: 2.6rem; min-height: 92px; }
  .read-list { font-size: 1.8rem; }
  .question > p.sentence { font-size: 1.8rem; }
  .story-line { font-size: 1.35rem; }
  .day-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .slide-track.go .slide-a { animation-duration: .01s; }
}
