/* Сюжет текущего жителя внутри обычного школьного занятия. */
.city-lesson-visual{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 92px;align-items:end;width:100%;min-height:190px;padding:12px 14px 34px;overflow:hidden;border-radius:24px;background:linear-gradient(145deg,#eef4d9,#f8e9b9)}
.city-lesson-building{display:block;width:100%;height:170px;object-fit:contain;filter:drop-shadow(0 12px 10px #51432628)}
.city-lesson-visual>span{position:relative;align-self:end;height:132px}
.city-lesson-resident{position:absolute;right:0;bottom:0;width:100%;height:100%;object-fit:contain;object-position:center bottom;filter:drop-shadow(0 9px 8px #40352135)}
.city-lesson-visual>b{position:absolute;left:14px;right:14px;bottom:10px;padding:6px 10px;overflow:hidden;border-radius:11px;background:#fffdf2e8;color:#3d3548;font-size:13px;line-height:1.2;text-align:center;text-overflow:ellipsis;white-space:nowrap;box-shadow:0 4px 12px #4b3b2214}
.city-station-intro .bubble{color:#332c40}
.city-lesson-goal{width:fit-content;max-width:100%;margin:10px auto 0;padding:8px 13px;border:1px solid #e6d59d;border-radius:999px;background:#fff6cf;color:#624b13;font-size:14px;font-weight:900;line-height:1.35;text-align:center}
.city-run-context{display:grid;grid-template-columns:64px minmax(0,1fr) 58px;align-items:center;gap:12px;max-width:760px;margin:10px auto 16px;padding:9px 12px;border:1px solid #ded4ec;border-radius:19px;background:linear-gradient(110deg,#f6f1ff,#fff8dc);box-shadow:0 7px 20px #4b3a6310}
.city-run-building,.city-run-resident{display:block;width:100%;height:58px;object-fit:contain}
.city-run-building{filter:drop-shadow(0 5px 5px #51432622)}
.city-run-resident{height:54px;object-position:center bottom;filter:drop-shadow(0 5px 5px #40352125)}
.city-run-context>span{min-width:0;text-align:center}
.city-run-context small,.city-run-context b{display:block;overflow-wrap:anywhere}
.city-run-context small{color:#675b78;font-size:12px;font-weight:800;line-height:1.3}
.city-run-context b{margin-top:3px;color:#332c40;font-size:15px;line-height:1.25}
.city-run-hero{display:grid;flex:0 0 64px;width:64px;height:64px;place-items:center;overflow:hidden;border-radius:20px;background:linear-gradient(145deg,#eef4d9,#fff0bd)}
.city-run-hero>img{display:block;width:100%;height:100%;object-fit:contain;object-position:center bottom}
.city-task-context{display:flex;align-items:center;gap:10px;width:fit-content;max-width:100%;margin:0 auto 14px;padding:7px 12px 7px 7px;border:1px solid #ddd2ee;border-radius:17px;background:#f6f1ff;color:#423753;font-size:14px;font-weight:800;line-height:1.35;text-align:left}
.city-task-context>img{flex:0 0 42px;width:42px;height:42px;object-fit:contain;object-position:center bottom}
.city-task-context>span{min-width:0;overflow-wrap:anywhere}
.city-math-story{max-width:620px;margin:0 auto 12px;padding:13px 16px;border:1px solid #e5d6a8;border-radius:19px;background:linear-gradient(120deg,#fff9e5,#f2f6e6);color:#383344;line-height:1.45;text-align:left}
.city-math-story>span{display:block;margin-bottom:4px;color:#725322;font-size:12px;font-weight:1000;letter-spacing:.035em;text-transform:uppercase}
.city-math-story>div{font-size:17px;font-weight:800;overflow-wrap:anywhere}
.city-math-expression{margin:4px auto 12px;color:#352d46;font-size:clamp(25px,4vw,38px);font-weight:1000;line-height:1.2;text-align:center}
.reading .city-run-context{margin-top:12px}
@media(max-width:600px){
 .city-lesson-visual{grid-template-columns:minmax(0,1fr) 74px;min-height:156px;padding:9px 10px 32px;border-radius:20px}
 .city-lesson-building{height:140px}
 .city-lesson-visual>span{height:108px}
 .city-lesson-visual>b{left:10px;right:10px;bottom:8px;font-size:12px}
 .city-lesson-goal{border-radius:15px;font-size:13px}
 .city-run-context{grid-template-columns:48px minmax(0,1fr) 44px;gap:8px;margin:8px auto 12px;padding:8px;border-radius:16px}
 .city-run-building{height:46px}
 .city-run-resident{height:44px}
 .city-run-context small{font-size:11px}
 .city-run-context b{font-size:13px}
 .city-run-hero{flex-basis:52px;width:52px;height:52px;border-radius:16px}
 .city-task-context{align-items:flex-start;margin-bottom:11px;font-size:13px}
 .city-task-context>img{flex-basis:36px;width:36px;height:36px}
 .city-math-story{padding:11px 13px;font-size:15px}
 .city-math-story>div{font-size:16px}
 .city-math-expression{font-size:28px}
}
@media(prefers-reduced-motion:reduce){.city-lesson-active *{scroll-behavior:auto}}

/* В сцене остаётся её механика; меняются только фон, здание и главный персонаж. */
.city-game-scene .city-scene-building{filter:drop-shadow(0 5px 4px #32434c28)}
.city-game-scene .city-scene-resident{filter:drop-shadow(0 4px 3px #263c4530)}
.city-scene-bat .sc-svg{filter:saturate(.88)}

/* Дополнительные курсы: отдельные уроки с настоящими игровыми механиками. */
.course-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:14px}
.course-card{display:grid;grid-template-columns:64px minmax(0,1fr);gap:12px;align-items:center;min-width:0;text-decoration:none;color:#342e43;transition:transform .18s ease,box-shadow .18s ease}
.course-card:hover{transform:translateY(-3px);box-shadow:0 14px 30px #29422b20}
.course-card:focus-visible,.course-lesson:focus-visible{outline:4px solid #e28a24;outline-offset:3px}
.course-card>strong{grid-column:1/-1;color:#226344;font-size:15px;text-align:right}
.course-icon{display:grid;width:64px;height:64px;place-items:center;border-radius:20px;background:#ffffffc9;font-size:35px;box-shadow:inset 0 0 0 1px #ffffff90}
.course-copy{display:block;min-width:0}.course-copy>b,.course-copy>small{display:block}.course-copy>b{font-size:20px;line-height:1.2}.course-copy>small{min-height:38px;margin:5px 0 9px;color:#4a4255;font-size:14px;line-height:1.35}.course-copy .bar{height:8px}.course-progress{display:block;margin-top:5px;color:#50475a;font-size:12px;font-weight:800}
.course-sunny{background:linear-gradient(145deg,#fff4c4,#ffe29a)}.course-green{background:linear-gradient(145deg,#e7f4c6,#c9e9b4)}.course-blue{background:linear-gradient(145deg,#e1f3f7,#c5e5f3)}
.course-hero{display:flex;align-items:center;gap:20px;margin:14px 0;padding:22px 25px;border-radius:25px}.course-hero>span{font-size:55px}.course-hero small{font-weight:800}.course-hero h1{margin:2px 0 5px}.course-hero p{margin:0;color:#3f3849}.course-lessons{display:grid;gap:12px;max-width:850px;margin:18px auto}.course-lesson{display:grid;grid-template-columns:48px minmax(0,1fr) auto;align-items:center;gap:14px;width:100%;min-height:86px;padding:15px 18px;text-align:left;cursor:pointer}.course-lesson>span b,.course-lesson>span small{display:block}.course-lesson>span b{color:#342e43;font-size:18px}.course-lesson>span small{margin-top:4px;color:#655b6c}.course-number{display:grid;width:44px;height:44px;place-items:center;border-radius:50%;background:#e4f0df;color:#2e6840;font-weight:1000}.course-lesson.done .course-number{background:#d6efcb}.course-lesson>strong{color:#2e6840;white-space:nowrap}.course-intro{max-width:760px;margin:20px auto;padding:30px;text-align:center}.course-intro .course-icon{margin:0 auto 12px}.course-intro h1{margin:7px 0 12px}.course-intro>p{max-width:58ch;margin:0 auto 18px;font-size:18px;line-height:1.6}.course-rule{margin:18px auto 22px;padding:13px 16px;border-radius:16px;background:#eff5e8;color:#34462f;font-weight:800}.course-intro .btn{min-height:50px}
@media(max-width:800px){.course-cards{grid-template-columns:1fr}.course-copy>small{min-height:0}.course-card{grid-template-columns:56px minmax(0,1fr)}.course-icon{width:56px;height:56px}.course-card>strong{grid-column:auto;text-align:left}.course-card{grid-template-columns:56px minmax(0,1fr) auto}}
@media(max-width:520px){.course-hero{gap:12px;padding:18px}.course-hero>span{font-size:42px}.course-hero h1{font-size:27px}.course-lesson{grid-template-columns:42px minmax(0,1fr);padding:13px}.course-lesson>strong{grid-column:2}.course-intro{padding:22px 16px}.course-intro>p{font-size:16px}}



/* Одна предыстория и один наставник на приключение; внутри вопросов это не повторяется. */
.city-lesson-topic{width:fit-content;max-width:100%;margin:10px auto 0;color:#eee7f7;font-size:14px;font-weight:800;line-height:1.4;text-align:center}
.city-lesson-visual .city-lesson-mentor{position:absolute;left:12px;top:12px;z-index:3;display:flex;align-items:center;gap:5px;max-width:150px;padding:5px 9px 5px 5px;border:1px solid #fff;border-radius:16px;background:#fffdf2ed;box-shadow:0 5px 15px #4b3b2218}
.city-lesson-mentor .hero.xs{flex:0 0 40px;width:40px;height:40px}
.city-lesson-mentor span{min-width:0;text-align:left}
.city-lesson-mentor b,.city-lesson-mentor small{display:block;white-space:nowrap}
.city-lesson-mentor b{color:#3f354c;font-size:13px}
.city-lesson-mentor small{color:#655b70;font-size:10px;font-weight:800}
.city-lesson-mentor.compact{display:flex;align-items:center;gap:6px;width:fit-content;max-width:760px;margin:-7px auto 14px;padding:5px 12px 5px 6px;border:1px solid #ded4ec;border-radius:16px;background:#fffdf5}
.city-lesson-mentor.compact .hero.xs{width:36px;height:36px;flex-basis:36px}
.city-lesson-mentor.compact span{display:flex;align-items:center;gap:7px}
.city-lesson-mentor.compact small{font-size:12px}
@media(max-width:600px){
 .city-lesson-visual .city-lesson-mentor{left:8px;top:8px;max-width:126px;padding:4px 7px 4px 4px}
 .city-lesson-mentor .hero.xs{width:32px;height:32px;flex-basis:32px}
 .city-lesson-mentor b{font-size:12px}.city-lesson-mentor small{font-size:9px}
 .city-lesson-mentor.compact{margin:-4px auto 12px}.city-lesson-mentor.compact small{font-size:11px}
}


/* Сюжетный предмет приключения: книга, карта, меню или заказ жителя. */
.city-lesson-active .q-hero{display:none}
.city-story-scene{contain:none}
.city-story-scene .city-story-art{position:relative;z-index:1;display:block;width:100%;height:auto;border-radius:inherit}
.city-story-scene .sc-hud{z-index:6}
.city-story-scene .sc-bubble{z-index:7}
.city-art-title{fill:#40354b;font-family:Nunito,Arial,sans-serif;font-size:14px;font-weight:1000;paint-order:stroke;stroke:#fff8df;stroke-width:3.5px;stroke-linejoin:round;transform:translateY(18px)}
.city-story-bat .city-art-title{fill:#fff3bd;stroke:#343454}
.city-story-label,.city-story-entry{font-family:Nunito,Arial,sans-serif;font-weight:1000;opacity:0;pointer-events:none}
.city-story-label{fill:#443326;font-size:11px;paint-order:stroke;stroke:#fff7dc;stroke-width:2.4px;stroke-linejoin:round}
.city-story-entry{fill:#4b3525;font-size:14px}
.city-story-bat .city-story-label{fill:#fff4bd;stroke:#202b50;stroke-width:2.5px}
.city-story-step.on .city-story-label,.city-story-step.on .city-story-entry{opacity:1}
.city-story-symbol-layer{position:absolute;inset:0;z-index:2;display:block;width:100%;height:100%;pointer-events:none}
.city-story-done{transition:opacity .35s ease}
.city-story-oops .city-story-symbol-layer{animation:cityStoryOops .36s ease}
@media(max-width:859px){
 .city-lesson-active .scene-box{max-width:none}
 .city-lesson-active .qscene{width:100%}
}
@media(max-width:600px){
 .city-lesson-active>.city-run-context,.city-lesson-active>.city-lesson-mentor.compact,.reading .city-run-context,.reading .city-lesson-mentor.compact{display:none}
 .city-lesson-active>.run-head{gap:6px;min-height:44px;margin:0 auto 6px;flex-wrap:nowrap}
 .city-lesson-active>.run-head>div{min-width:0;overflow:hidden}
 .city-lesson-active>.run-head .city-run-hero{flex-basis:44px;width:44px;height:44px;border-radius:13px}
 .city-lesson-active>.run-head .si-kind,.city-lesson-active>.run-head b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .city-lesson-active>.run-head .si-kind{font-size:11px}.city-lesson-active>.run-head b{font-size:14px}
 .city-lesson-active>.run-head .btn.sm{min-height:44px;padding:6px 10px;font-size:14px}
 .city-lesson-active .quiz>.task{min-height:50px;margin:0 0 6px;padding:6px 10px;border-radius:16px}
 .city-lesson-active .quiz>.task .task-l{display:none}
 .city-lesson-active .quiz>.task .task-t{grid-row:1/3;font-size:16px;line-height:1.2}
 .city-lesson-active .quiz>.task .task-say{width:44px;height:44px;min-height:44px}
 .city-lesson-active .quiz.has-scene .scene-box{width:min(100%,calc(24vh*400/330));margin:0 auto 4px}
 .city-lesson-active .reading.has-scene .scene-box{width:min(100%,calc(22vh*400/330))}
 .city-lesson-active .qscene{margin:0 0 4px}
 .city-lesson-active .qbody{min-height:62px;padding-top:5px;padding-bottom:5px}
 .city-lesson-active .qcard{padding-top:10px!important;padding-bottom:12px!important}
 .city-lesson-active .choices{margin-top:6px}
 .city-lesson-active .choices .ch{min-height:52px}
 .city-lesson-active .quiz.finale .scene-box,.city-lesson-active .v-scene .scene-box{width:min(100%,520px)}
}
@media(max-width:360px){
 .city-lesson-active>.run-head .city-run-hero{flex-basis:40px;width:40px;height:40px}
 .city-lesson-active>.run-head .btn.sm{padding-left:8px;padding-right:8px}
}
@media(max-width:360px) and (max-height:650px){
 .city-lesson-active .quiz.has-scene:not(.finale) .scene-box{width:min(100%,calc(18vh*400/330))}
 .city-lesson-active .qcard .hw-btns{flex-wrap:nowrap;gap:4px;margin-right:46px}
 .city-lesson-active .qcard .hw-b{min-height:44px;padding:4px 7px;font-size:12px;white-space:nowrap}
 .city-lesson-active .quiz>.task{min-height:44px}
 .city-lesson-active .quiz[data-kind="choice"]>.task{display:none}
}
@keyframes cityStoryOops{0%,100%{opacity:1}50%{opacity:.65}}
@media(prefers-reduced-motion:reduce){.city-story-oops .city-story-symbol-layer{animation:none}}
