/* Иврит с Туки — стили. Правила §9–§10: тёплый светлый фон, почти чёрный текст, кнопки ≥ 64dp, отступы ≥ 16dp,
   ивритский шрифт крупный с увеличенным межбуквенным интервалом, никуд не уменьшается. */
@font-face { font-family: 'Ktav Yad CLM'; src: url('assets/fonts/KtavYadCLM-MediumItalic.ttf') format('truetype'); font-display: swap; }
:root {
  --bg: #FBF6EC; --bg2: #F3EAD8; --ink: #2B2622; --muted: #7A6F63; --accent: #F6C453; --accent2: #4A90D9;
  --ok: #58B368; --warn: #F28B82; --hint: #FFE08A; --card: #FFFFFF; --radius: 22px;
  --he-font: 'Noto Sans Hebrew', 'Arial Hebrew', 'David CLM', 'Frank Ruehl CLM', 'David', sans-serif;
  --ru-font: 'Nunito', 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--ru-font); font-size: 18px; overscroll-behavior: none; }
button { font-family: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
.app { min-height: 100%; max-width: 720px; margin: 0 auto; padding: 12px 16px 24px; }
.screen { min-height: calc(100vh - 36px); display: flex; flex-direction: column; gap: 16px; }
.hidden { display: none !important; }

/* --- иврит --- */
.he { font-family: var(--he-font); font-weight: 500; letter-spacing: 0.07em; line-height: 1.5; direction: rtl; unicode-bidi: isolate; color: var(--ink); }
.he-sm { font-size: 28px; } .he-md { font-size: 36px; } .he-lg { font-size: 48px; } .he-xl { font-size: 64px; line-height: 1.4; }
.syl { padding: 0 0.15em; } .syl-dot { color: var(--muted); padding: 0 0.15em; }
.dagesh-hl { color: #D9534F; text-shadow: 0 0 6px #D9534F; }
.read-box { background: var(--card); border-radius: var(--radius); padding: 16px 24px; text-align: center; box-shadow: 0 2px 0 var(--bg2); }
.read-box.text .he { margin: 6px 0; }
.ru-caption { background: none; border: none; font-size: 28px; font-weight: 800; color: var(--ink); padding: 8px 12px; border-radius: 12px; }
.ru-caption.small { font-size: 18px; font-weight: 600; color: var(--muted); }
.ru-big { font-size: 40px; font-weight: 800; text-align: center; padding: 24px; background: var(--card); border-radius: var(--radius); }
.instr { font-size: 22px; font-weight: 800; color: var(--muted); text-align: center; }
.hint-text { font-size: 16px; color: var(--muted); text-align: center; }

/* --- картинки --- */
/* Картинки заданий. max-width: 100% обязателен: слоты фиксированного размера иначе вылезают
   из узких карточек в сетке на телефоне. */
.pic { width: 144px; height: 144px; max-width: 100%; display: flex; align-items: center; justify-content: center; object-fit: contain; }
.pic.emoji { font-size: 100px; line-height: 1; }
.pic-sm { width: 92px; height: 92px; } .pic-sm.emoji { font-size: 64px; }
.pic-md { width: 168px; height: 168px; } .pic-md.emoji { font-size: 120px; }
.pic-lg { width: 216px; height: 216px; } .pic-lg.emoji { font-size: 156px; }
.pic-xl { width: 288px; height: 288px; } .pic-xl.emoji { font-size: 200px; }
.pic-empty { background: var(--bg2); border-radius: 16px; }

/* --- кнопки --- */
.btn-play { font-size: 28px; font-weight: 800; padding: 20px 32px; border-radius: 999px; border: 4px solid var(--ink); background: var(--accent); min-height: 72px; align-self: center; box-shadow: 0 6px 0 #c99a2e; }
.btn-play:active { transform: translateY(4px); box-shadow: 0 2px 0 #c99a2e; }
.btn-big { font-size: 24px; font-weight: 800; min-width: 96px; min-height: 72px; padding: 12px 24px; border-radius: 20px; border: 4px solid var(--ink); background: var(--card); margin: 8px; }
.btn-big.danger { background: var(--warn); }
.btn-icon { font-size: 30px; min-width: 64px; min-height: 64px; border-radius: 18px; border: 3px solid var(--ink); background: var(--card); }
.btn-next { font-size: 40px; min-width: 96px; min-height: 80px; border-radius: 999px; border: 4px solid var(--ink); background: var(--ok); align-self: center; margin-top: auto; }
.btn-skip { background: none; border: none; color: var(--muted); font-size: 16px; text-decoration: underline; align-self: center; }
.btn-speaker { font-size: 34px; min-width: 64px; min-height: 64px; border-radius: 999px; border: 3px solid var(--ink); background: var(--card); }
.btn-speaker.big { font-size: 40px; min-width: 80px; min-height: 80px; }
.btn-speaker.small { font-size: 26px; }
.btn-speaker.late { align-self: center; background: var(--hint); }
.btn-mic { font-size: 56px; width: 128px; height: 128px; border-radius: 999px; border: 5px solid var(--ink); background: var(--card); align-self: center; }
.btn-mic.recording { background: var(--warn); animation: pulse 1s infinite; }
.btn-exit { font-size: 22px; min-width: 64px; min-height: 64px; border-radius: 18px; border: 3px solid var(--muted); background: transparent; color: var(--muted); position: relative; overflow: hidden; }
/* Подтверждение выхода: накрывает сцену, чтобы случайный тап по заданию не увёл из урока. */
.exit-ask { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; background: rgba(251, 246, 236, 0.96); padding: 24px; }
.exit-ask .instr { font-size: 24px; font-weight: 800; }
@keyframes fill { from { width: 0 } to { width: 100% } }
@keyframes pulse { 50% { transform: scale(1.06) } }
@keyframes pop { 0% { transform: scale(0.6); opacity: 0 } 60% { transform: scale(1.15) } 100% { transform: scale(1); opacity: 1 } }
.pop { animation: pop 0.5s ease-out; }
@keyframes shake { 0%, 100% { transform: translateX(0) } 25% { transform: translateX(-8px) } 75% { transform: translateX(8px) } }

/* --- шапка урока --- */
.lesson-top { display: flex; align-items: center; gap: 16px; }
.bar-wrap { flex: 1; display: flex; align-items: center; gap: 8px; }
.progress { flex: 1; height: 16px; background: var(--bg2); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--ok); transition: width 0.4s; }
.block-tag { font-size: 12px; color: var(--muted); min-width: 32px; }
.stars-badge { font-size: 22px; font-weight: 800; background: var(--card); border-radius: 999px; padding: 8px 14px; border: 3px solid var(--ink); }
.stars-badge.pop { animation: pop 0.5s; }
.stage { flex: 1; display: flex; flex-direction: column; gap: 16px; align-items: stretch; }
.task-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 80px; }
.repeat-wrap { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.row-center { display: flex; gap: 16px; align-items: center; justify-content: center; flex-wrap: wrap; }
.single-pic { display: flex; flex-direction: column; align-items: center; }

/* --- карточки-варианты --- */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); }
.grid.n3 { grid-template-columns: repeat(3, 1fr); }
.grid.n5 { grid-template-columns: repeat(3, 1fr); }
.grid.word-row { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); direction: rtl; }
.grid.dagesh-pair { grid-template-columns: repeat(2, 1fr); direction: rtl; }
.card { background: var(--card); border: 4px solid var(--ink); border-radius: var(--radius); min-height: 140px; min-width: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; transition: transform 0.15s, background 0.2s; }
.card:active { transform: scale(0.96); }
.card-sm { min-height: 96px; padding: 6px; }
.card.is-correct, .piece.is-correct, .btn-mic.is-correct, .slots.is-correct, .basket .is-correct { background: #D8F3DC; border-color: var(--ok); }
.card.is-wrong, .piece.is-wrong, .faller.is-wrong { animation: shake 0.4s; border-color: var(--warn); }
.card.is-hint, .piece.is-hint { background: var(--hint); box-shadow: 0 0 0 6px var(--hint); }
.card.dim { opacity: 0.35; }
.card.selected { outline: 6px solid var(--accent2); }
.card-audio { flex-direction: row; font-size: 40px; min-height: 96px; }
.card-audio .num { font-size: 22px; color: var(--muted); }
.card-audio.armed { background: #E3F0FF; border-color: var(--accent2); }
.card-answer { min-height: 120px; }

/* --- презентация --- */
.present { display: flex; flex-direction: column; align-items: center; gap: 12px; flex: 1; justify-content: center; }
.forms { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.form-row { display: flex; align-items: center; gap: 12px; }
.form-tag { font-size: 32px; }

/* --- сборка (E5/E14) --- */
.dir-arrow { font-size: 40px; text-align: right; color: var(--accent2); font-weight: 800; display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.dir-label { font-size: 14px; color: var(--muted); font-family: var(--ru-font); }
.slots { display: flex; gap: 10px; justify-content: flex-start; flex-wrap: wrap; min-height: 96px; background: var(--card); border-radius: var(--radius); padding: 12px; }
.slot { min-width: 72px; min-height: 80px; border: 3px dashed var(--muted); border-radius: 14px; padding: 4px 12px; font-family: var(--he-font); letter-spacing: 0.07em; display: flex; align-items: center; justify-content: center; }
.slot.slot-next { border-color: var(--accent2); border-style: solid; background: #E3F0FF; }
.slot.filled { border-style: solid; border-color: var(--ink); background: var(--bg2); }
.tray { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.piece { font-family: var(--he-font); letter-spacing: 0.07em; font-size: inherit; min-width: 72px; min-height: 80px; padding: 4px 16px; border-radius: 16px; border: 4px solid var(--ink); background: var(--accent); }
.piece.used { opacity: 0.25; pointer-events: none; }
.he-md .piece, .he-md .slot { font-size: 30px; } .he-xl .piece, .he-xl .slot { font-size: 52px; }

/* --- маскот, диалог --- */
.mascot-scene { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.mascot { font-size: 120px; line-height: 1; }
.mascot-small { font-size: 44px; }
.bubble { background: var(--card); border: 3px solid var(--ink); border-radius: 24px; padding: 12px 20px; position: relative; text-align: center; }
.scene { display: flex; flex-direction: column; align-items: center; gap: 12px; flex: 1; }
.scene-classroom { background: linear-gradient(#EAF3E6, var(--bg)); border-radius: var(--radius); padding: 12px; }
.scene-yard { background: linear-gradient(#E6F0FA, var(--bg)); border-radius: var(--radius); padding: 12px; }
.speaker { display: flex; flex-direction: column; align-items: center; position: relative; }
.char { line-height: 1; } .char-name { font-size: 16px; color: var(--muted); }
.answers { width: 100%; margin-top: auto; }
/* Значок действия рядом с героем. right был -50px — значок торчал ЗА пределы экрана
   (на телефоне страница получала горизонтальную прокрутку). Держим внутри родителя. */
.action-fx { position: absolute; top: -12px; right: 0; }

/* --- команды, лабиринт, аркада, сортировка, мемори --- */
.room { display: flex; justify-content: center; position: relative; min-height: 120px; }
.hero { font-size: 96px; transition: transform 0.4s; position: relative; }
.hero.act-sit { transform: translateY(20px) scaleY(0.8); } .hero.act-stand { transform: translateY(-10px); } .hero.act-come { transform: translateX(60px); }
.maze { position: relative; height: 320px; background: var(--card); border-radius: var(--radius); border: 4px solid var(--ink); overflow: hidden; }
.maze-exits { position: absolute; top: 12px; left: 0; right: 0; display: flex; justify-content: space-around; }
.maze-paths .path { position: absolute; bottom: 90px; width: 14px; height: 140px; background: var(--bg2); border-radius: 8px; }
.path.p0 { left: 16%; transform: rotate(20deg); } .path.p1 { left: 50%; } .path.p2 { left: 82%; transform: rotate(-20deg); }
.maze-hero { position: absolute; bottom: 8px; left: 50%; font-size: 64px; transform: translateX(-50%); transition: all 0.7s ease-in-out; }
.maze-hero.go-0 { left: 17%; bottom: 120px; } .maze-hero.go-1 { left: 50%; bottom: 120px; } .maze-hero.go-2 { left: 83%; bottom: 120px; }
.catch-field { position: relative; height: 380px; background: linear-gradient(#DDEBFF, var(--card)); border-radius: var(--radius); border: 4px solid var(--ink); overflow: hidden; }
.faller { position: absolute; top: -90px; background: var(--card); border: 3px solid var(--ink); border-radius: 18px; padding: 4px; animation: fall linear infinite; }
@keyframes fall { from { transform: translateY(0) } to { transform: translateY(480px) } }
.catch-label { text-align: center; font-size: 22px; font-weight: 800; }
.baskets { display: flex; gap: 16px; justify-content: center; }
.basket { flex: 1; min-height: 160px; border: 4px dashed var(--ink); border-radius: var(--radius); background: var(--card); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; flex-wrap: wrap; }
.basket-icon { font-size: 40px; }
.basket .card { min-height: 56px; width: 64px; padding: 2px; border-width: 2px; }
.basket .card .pic { width: 48px; height: 48px; } .basket .card .pic.emoji { font-size: 34px; }
.sort-tray { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.memory { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
/* min-width: 0 обязателен: колонка grid по умолчанию не ужимается уже содержимого, и картинка
   со своей шириной 448px растягивала всю сетку за пределы экрана. */
.mem-card { position: relative; aspect-ratio: 1; min-width: 0; border-radius: 18px; border: 4px solid var(--ink); background: var(--accent); font-size: 40px; perspective: 600px; }
.mem-card .mem-front { display: none; align-items: center; justify-content: center; }
.mem-card.flipped { background: var(--card); } .mem-card.flipped .mem-back { display: none; } .mem-card.flipped .mem-front { display: flex; }
.mem-card.matched { background: #D8F3DC; border-color: var(--ok); }

/* --- главный экран --- */
.home-header { display: flex; align-items: center; gap: 12px; }
.home-header .stars-badge { margin-left: auto; }
.streak { font-size: 32px; }
.map { display: flex; flex-direction: column; gap: 16px; }
.island { background: var(--card); border: 4px solid var(--ink); border-radius: var(--radius); padding: 12px 16px; }
.island.done { background: #EAF7EC; }
.island-title { font-weight: 800; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.island-emoji { width: 40px; height: 40px; }
.dots { display: flex; gap: 12px; }
.dot { width: 64px; height: 64px; border-radius: 999px; border: 4px solid var(--ink); font-size: 22px; font-weight: 800; background: var(--bg2); }
.dot.done { background: var(--ok); color: #fff; } .dot.current { background: var(--accent); box-shadow: 0 0 0 6px var(--hint); animation: pulse 1.5s infinite; }
.dot.locked { opacity: 0.4; } .dot.boss { width: 72px; height: 72px; }
.foot { color: var(--muted); font-size: 14px; text-align: center; }
.foot .ver { font-size: 11px; opacity: 0.6; margin-top: 2px; }
.loading { align-items: center; justify-content: center; }

/* --- итоги, награда, двор --- */
.summary { display: flex; flex-direction: column; align-items: center; gap: 16px; flex: 1; justify-content: center; }
.big-stars { font-size: 48px; font-weight: 800; }
.levelup { font-size: 24px; font-weight: 800; background: var(--hint); padding: 12px 20px; border-radius: 16px; }
.chest { font-size: 140px; align-self: center; cursor: pointer; transition: transform 0.3s; }
.chest.open { transform: rotate(-10deg) scale(1.2); }
.reward-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mission-card { background: var(--card); border: 4px solid var(--ink); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.yard { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 16px; background: linear-gradient(#DDEBFF 0 40%, #CDE8C2 40%); border-radius: var(--radius); padding: 24px; min-height: 360px; align-content: end; }
.yard-item { background: none; border: none; display: flex; flex-direction: column; align-items: center; }
.yard-item .emoji { font-size: 72px; }

/* --- родительский раздел --- */
.lock-box { display: flex; flex-direction: column; align-items: center; gap: 16px; justify-content: center; flex: 1; }
.parent { display: flex; flex-direction: column; gap: 16px; }
.psec { background: var(--card); border-radius: var(--radius); padding: 16px; }
.psec h3 { margin: 0 0 8px; }
.ptable { width: 100%; border-collapse: collapse; font-size: 15px; }
.ptable td { padding: 6px 4px; border-bottom: 1px solid var(--bg2); vertical-align: top; } .ptable td:first-child { color: var(--muted); width: 55%; }
.wordlist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; }
.wordlist li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wordlist .btn-speaker { min-width: 44px; min-height: 44px; font-size: 20px; }
.wordlist .he-sm { font-size: 22px; } .wordlist .ru { color: var(--muted); } .wordlist .translit { color: var(--accent2); font-size: 14px; } .wordlist .box { margin-left: auto; font-size: 12px; color: var(--muted); }
.settings { display: flex; flex-direction: column; gap: 10px; }
.field { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.field input[type=text], .field input:not([type]), .field select { font-size: 16px; padding: 8px; border-radius: 10px; border: 2px solid var(--bg2); }
.field input[type=checkbox] { width: 28px; height: 28px; }
@media (max-width: 420px) { .he-xl { font-size: 52px; } .pic-xl { width: 200px; height: 200px; } .pic-xl.emoji { font-size: 140px; } .grid.n3 { grid-template-columns: repeat(2, 1fr); } }

/* --- родительский раздел: кастомные контролы (без библиотек) --- */
.field { background: var(--bg); border-radius: 16px; padding: 10px 14px; }
.field > span { font-weight: 700; color: var(--ink); }
.field select, .field input:not([type]), .field input[type=text] {
  appearance: none; -webkit-appearance: none; font-family: inherit; font-size: 16px; font-weight: 700; color: var(--ink);
  background: var(--card); border: 3px solid var(--ink); border-radius: 14px; padding: 10px 40px 10px 14px; min-height: 48px; min-width: 160px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10'%3E%3Cpath d='M1 1l7 7 7-7' fill='none' stroke='%232B2622' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.field input:not([type]), .field input[type=text] { background-image: none; padding-right: 14px; }
.field select:focus, .field input:focus { outline: none; box-shadow: 0 0 0 4px var(--hint); }
/* переключатель вместо чекбокса */
.field input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 60px; height: 34px; border-radius: 999px; background: var(--bg2); border: 3px solid var(--ink); position: relative; cursor: pointer; transition: background 0.2s; margin: 0; }
.field input[type=checkbox]::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 999px; background: var(--card); border: 2px solid var(--ink); transition: transform 0.2s; }
.field input[type=checkbox]:checked { background: var(--ok); }
.field input[type=checkbox]:checked::after { transform: translateX(26px); }
.field .note { font-size: 14px; color: var(--muted); max-width: 55%; text-align: right; }
.parent .btn-big { font-size: 18px; min-height: 56px; }
label.btn-big { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.psec h3 { font-size: 20px; }
.parent h2 { margin: 0; }

/* текст, который можно нажать, чтобы переслушать */
.tappable { cursor: pointer; border-radius: 12px; transition: background 0.15s; }
.tappable:active { background: var(--hint); }

/* Twemoji: одинаковый стиль на всех устройствах */
.emoji.tw { display: flex; align-items: center; justify-content: center; gap: 2%; }
.emoji.tw img { width: 100%; height: 100%; object-fit: contain; }
.emoji.tw.n2 img { width: 48%; } .emoji.tw.n3 img { width: 32%; } .emoji.tw.n4 img, .emoji.tw.n5 img, .emoji.tw.n6 img, .emoji.tw.n7 img { width: 24%; }
.pic-empty { }

/* прописное начертание (כתב) — без никуда */
.he-ktav { font-family: 'Ktav Yad CLM', cursive; letter-spacing: 0.02em; font-weight: 400; line-height: 1.3; }
.he-ktav.he-xl { font-size: 76px; } .he-ktav.he-lg { font-size: 56px; }
.ktav-pair { display: flex; gap: 16px; justify-content: center; align-items: stretch; background: var(--card); border-radius: var(--radius); padding: 16px; }
.pair-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pair-col .tag { font-size: 14px; color: var(--muted); }
.warn { background: #FFF1D6; border: 3px solid var(--accent); border-radius: 16px; padding: 12px 16px; font-size: 15px; }
.stars-badge { white-space: nowrap; }

.card-audio.with-text { justify-content: flex-start; gap: 14px; padding: 10px 16px; direction: rtl; }
.card-audio.with-text .spk { font-size: 30px; }
.banner { background: #FFF3C4; border: 3px solid #E0A800; border-radius: var(--radius); padding: 12px 16px; margin: 8px 0; font-size: 18px; display: flex; gap: 10px; align-items: center; cursor: pointer; }
.pl-modules { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 6px 0; } .pl-modules label { display: flex; gap: 4px; align-items: center; font-size: 16px; }
.placement-setup .field { flex-direction: column; align-items: stretch; gap: 6px; } .placement-setup .field select { width: 100%; font-size: 18px; }

.ask { display: flex; flex-direction: column; align-items: center; gap: 8px; background: var(--card); border-radius: var(--radius); padding: 12px; }
.ask .bubble { background: #fff; border: 3px solid var(--ink); border-radius: 18px; padding: 10px 16px; max-width: 100%; }
.pic-row { display: flex; justify-content: center; }
.audio-grid.with-text { grid-template-columns: 1fr; }
.card-audio.with-text .he { text-align: right; }
.scene-home { background: linear-gradient(#FBF0E6, var(--bg)); border-radius: var(--radius); padding: 12px; }
.scene-shop { background: linear-gradient(#FFF6DA, var(--bg)); border-radius: var(--radius); padding: 12px; }
.scene-park, .scene-street { background: linear-gradient(#E4F2E1, var(--bg)); border-radius: var(--radius); padding: 12px; }

/* Письменная подстраховка заданий на слух: показывается, только если озвучка не отработала. */
.sound-fallback { margin: 8px auto; padding: 10px 16px; max-width: 92%; border: 3px dashed var(--warn); border-radius: 16px; background: #FFF8E8; text-align: center; }
.sound-fallback .sf-hint { font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.sound-fallback .sf-body { font-size: 26px; font-weight: 800; }
.sound-fallback .sf-hint:empty { display: none; }
.sf-translit { font-size: 17px; font-weight: 600; color: var(--muted); font-family: var(--ru-font); letter-spacing: 0; margin-top: 2px; }
.card-audio .sf-translit { font-size: 14px; }

/* Мемори: при мёртвом звуке на аудиокарточке вместо 🔊 — написание с транскрипцией. */
.memory.sf-revealed .mem-front { font-size: 15px; padding: 2px; line-height: 1.15; }
.memory.sf-revealed .mem-front .sf-translit { font-size: 12px; margin-top: 0; }

/* Экран входа */
.login { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 24px 16px; }
.login h2 { margin: 0; }
.login-form { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 320px; }
.inp { font-family: inherit; font-size: 20px; padding: 14px 16px; border: 3px solid var(--ink); border-radius: 16px; background: var(--card); color: var(--ink); }
.login-err { color: var(--warn); font-weight: 700; min-height: 22px; text-align: center; }
/* Предупреждение о несохранении — поверх всего, его нельзя не заметить */
.sync-warn { position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 30; padding: 12px 16px; border-radius: 14px; background: var(--warn); color: #fff; font-weight: 700; text-align: center; }

/* Заказные иллюстрации слов (assets/img/words/*.webp).
   У картинок нет альфы: скругление нарисовано внутри, а за ним белые углы. Поэтому контейнер
   белый (var(--card)) и скруглён радиусом дизайн-системы с overflow: hidden — углы исходника
   сливаются с карточкой, а форма совпадает с остальными блоками интерфейса. */
.word-illu {
  width: 100%; max-width: 560px; aspect-ratio: 760 / 504; overflow: hidden;
  background: var(--card); border-radius: var(--radius); box-shadow: 0 2px 0 var(--bg2);
}
.word-illu .illu { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Произношение на карточке знакомства: тише написания, но читаемо взрослым рядом с ребёнком. */
.word-translit { font-size: 20px; font-weight: 600; color: var(--muted); font-family: var(--ru-font); }

/* В остальных заданиях иллюстрация встаёт в существующий квадратный слот .pic.
   object-fit: contain, а не cover: кадрировать нельзя — у картинок жест уходит к краю
   (машущая рука слева, подарок снизу), и обрезка убила бы смысл. */
/* Иллюстрации задаются по ШИРИНЕ, а не вписываются в квадрат: слоты .pic квадратные, а картинки
   3:2, поэтому при object-fit: contain изображение занимало лишь две трети высоты слота и
   выглядело мелким. Высота следует из собственных пропорций файла (width/height у <img>). */
.pic.pic-illu { object-fit: contain; border-radius: 14px; background: var(--card); width: auto; height: auto; max-width: 100%; }
.pic-sm.pic-illu { width: 190px; }
.pic.pic-illu:not([class*='pic-']) { width: 260px; }
.pic-md.pic-illu { width: 300px; }
.pic-lg.pic-illu { width: 380px; }
.pic-xl.pic-illu { width: 460px; }
/* В карточках выбора — во всю ширину карточки. */
.card .pic.pic-illu { width: 100%; height: auto; }
.mem-card .mem-front { width: 100%; height: 100%; }
.mem-front .pic-illu { width: 100%; height: auto; max-height: 100%; }

/* Планшет и десктоп: карточка знакомства не должна расползаться на всю ширину экрана. */
@media (min-width: 700px) { .word-illu { max-width: 680px; } }
/* Узкий телефон: картинка занимает почти всю ширину, жест остаётся читаемым. */
@media (max-width: 420px) { .word-illu { max-width: 100%; } .word-translit { font-size: 18px; } }

/* Маскот и награда — не словарные картинки: показываются целиком, со свободным полем вокруг,
   и никогда не кадрируются. Фон белый: у файлов нет альфы, за скруглением исходника белое поле. */
.pic.pic-whole { object-fit: contain; padding: 6px; background: transparent; border-radius: 14px; width: auto; height: auto; max-width: 100%; }
.mascot .pic-whole, .mascot-small .pic-whole { padding: 0; }
/* Маскот — лицо приложения, он должен быть заметным. */
.mascot .pic-whole { width: 300px; }
.mascot-small .pic-whole { width: 92px; }
.pic-sm.pic-whole { width: 120px; }
.pic-md.pic-whole { width: 240px; }
.pic-lg.pic-whole { width: 300px; }
.pic-xl.pic-whole { width: 380px; }
/* Награда на экране итогов и во «Дворе»: целиком, без обрезки лесенки и низа конструкции. */
.reward-item .pic-whole { width: 100%; max-width: 380px; }
.yard-item .pic-whole { width: 100%; }
