:root{font-family:Inter,ui-rounded,"SF Pro Rounded",system-ui,-apple-system,sans-serif;color:#261736;background:#160d25;--ink:#261736;--purple:#7c3aed;--pink:#ec4899;--yellow:#fbbf24;--mint:#34d399;--danger:#f43f5e;--panel:rgba(255,255,255,.94)}
*{box-sizing:border-box}
html{overflow-y:scroll}
/* Смена экранов через View Transitions API (см. motion.js → transition()).
   Без этого блока браузер использует дефолтный мгновенный кроссфейд 0.25s —
   здесь он чуть удлинён и совмещён с лёгким наездом камеры, в духе
   остальных переходов на карте (path-turn, checkpoint). Один блок правит
   анимацию всех вызовов transition() сразу. */
::view-transition-old(root){animation:kuromiScreenOut .32s cubic-bezier(.4,0,1,1) both}
::view-transition-new(root){animation:kuromiScreenIn .32s cubic-bezier(0,0,.2,1) both}
@keyframes kuromiScreenOut{to{opacity:0;transform:scale(.98)}}
@keyframes kuromiScreenIn{from{opacity:0;transform:scale(1.02)}}

body{margin:0;min-width:320px;min-height:100vh;background:radial-gradient(circle at 12% 4%,rgba(126,211,246,.42) 0,transparent 34%),radial-gradient(circle at 88% 12%,rgba(110,78,170,.44) 0,transparent 32%),linear-gradient(180deg,#527f9f 0%,#493b78 48%,#21152f 100%);background-size:125% 125%;background-attachment:fixed;animation:ambientGradient 16s ease-in-out infinite alternate}
body[data-lesson-world]{background-color:#21152f;background-repeat:no-repeat;background-position:center;background-size:cover;background-attachment:fixed;animation:none}
body[data-lesson-world="1"]{background-image:linear-gradient(rgba(12,10,39,.2),rgba(12,10,39,.28)),url("assets/world-moon.webp")}
body[data-lesson-world="2"]{background-image:linear-gradient(rgba(20,48,27,.13),rgba(14,44,27,.22)),url("assets/world-forest.webp")}
body[data-lesson-world="3"]{background-image:linear-gradient(rgba(24,56,89,.12),rgba(28,46,70,.2)),url("assets/world-castle.webp")}
body[data-lesson-world="4"]{background-image:linear-gradient(rgba(4,39,72,.12),rgba(4,37,67,.22)),url("assets/world-tower.webp")}
body[data-lesson-world="5"]{background-image:linear-gradient(rgba(53,72,35,.08),rgba(68,54,25,.16)),url("assets/world-knight-road.webp")}
body[data-lesson-world="6"]{background-image:linear-gradient(rgba(50,68,91,.08),rgba(63,51,38,.16)),url("assets/world-dragon-cliffs.webp")}
body[data-lesson-world="7"]{background-image:linear-gradient(rgba(7,29,59,.14),rgba(11,27,54,.24)),url("assets/world-rune-cave.webp")}
body[data-lesson-world="8"]{background-image:linear-gradient(rgba(84,53,22,.08),rgba(75,47,20,.16)),url("assets/world-royal-mail.webp")}
body[data-lesson-world="9"]{background-image:linear-gradient(rgba(5,16,52,.12),rgba(9,15,46,.22)),url("assets/world-number-vault.webp")}
body[data-lesson-world="10"]{background-image:linear-gradient(rgba(35,84,142,.06),rgba(58,68,102,.14)),url("assets/world-olympus.webp")}
button,input{font:inherit}
.app{width:min(1120px,calc(100% - 28px));margin:0 auto;padding:34px 0 60px}
.hidden{display:none!important}
.hero{text-align:center;color:white;position:relative}
.hero-sky{font-size:28px;letter-spacing:16px;opacity:.75;animation:floatSky 4s ease-in-out infinite alternate}
.hero-character{position:absolute;z-index:0;object-fit:contain;pointer-events:none;filter:drop-shadow(0 18px 22px rgba(18,9,32,.18))}.hero-kuromi-left{left:-155px;top:-105px;width:650px;height:650px;opacity:.62}.hero-kitty-right{right:-350px;top:-180px;width:1000px;height:1000px;opacity:.42}.hero>h1,.hero>.subtitle,.hero>.brand-badge,.hero>.stats-row{position:relative;z-index:1}
.brand-badge,.eyebrow{display:inline-flex;padding:7px 12px;border-radius:999px;background:#261736;color:white;font-weight:900;font-size:12px;letter-spacing:.06em;text-transform:uppercase;border:1px solid rgba(255,255,255,.18)}
h1{font-size:clamp(44px,8vw,84px);line-height:.95;margin:14px 0 12px;letter-spacing:-.06em;text-shadow:0 8px 22px rgba(0,0,0,.25)}
.subtitle{margin:0 auto 22px;max-width:720px;font-size:19px;line-height:1.5;color:#efe6ff}
.stats-row{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;margin-bottom:22px}
.stat-pill{padding:10px 15px;border-radius:16px;background:rgba(255,255,255,.13);border:1px solid rgba(255,255,255,.18);font-weight:900;backdrop-filter:blur(10px)}
.adaptive-card{position:relative;z-index:2;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:16px;text-align:left;background:linear-gradient(135deg,#fff,#f5f3ff);color:var(--ink);border:2px solid #c4b5fd;border-radius:24px;padding:16px 18px;margin:0 auto 22px;box-shadow:0 15px 35px rgba(16,8,30,.18)}
.adaptive-card h2{margin:3px 0;font-size:21px}
.adaptive-card p{margin:0;color:#705d7b}
.adaptive-icon{font-size:38px}
.world-map{position:relative;z-index:2;display:grid;gap:24px;text-align:left}
.world-card{position:relative;overflow:hidden;background:#fff;color:var(--ink);border-radius:30px;padding:22px;box-shadow:0 20px 60px rgba(11,4,20,.22);border:2px solid #fff}
.world-card::before{content:"";position:absolute;inset:0;background:radial-gradient(circle at 90% 10%,var(--world-glow,#ede9fe),transparent 34%);pointer-events:none}
.world-1{--world-glow:#e9d5ff}
.world-2{--world-glow:#bbf7d0}
.world-3{--world-glow:#fde68a}
.world-4{--world-glow:#ddd6fe}
.world-5{--world-glow:#fecdd3}
.world-6{--world-glow:#fed7aa}
.world-7{--world-glow:#cffafe}
.world-8{--world-glow:#fef3c7}
.world-9{--world-glow:#dbeafe}
.world-10{--world-glow:#e0e7ff}
.world-complete{border-color:#fbbf24}
.world-header{position:relative;z-index:1;display:grid;grid-template-columns:auto 1fr auto;gap:14px;align-items:center}
.world-emblem{display:grid;place-items:center;width:66px;height:66px;border-radius:22px;background:#261736;font-size:36px;box-shadow:0 8px 0 #120a19}
.world-emblem img{display:block;width:62px;height:62px;object-fit:contain;transform:translateY(4px)}
.world-kicker{font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.08em;color:#7c3aed}
.world-header h2{margin:2px 0;font-size:clamp(24px,4vw,36px)}
.world-header p{margin:0;color:#75647d}
.world-stars{font-weight:900;background:white;border:1px solid #eaddeb;padding:9px 12px;border-radius:14px}
.world-story{position:relative;z-index:1;display:flex;gap:12px;align-items:center;margin:16px 0;padding:11px 14px;border-radius:16px;background:rgba(255,255,255,.7);color:#65516f;font-weight:700}
.world-story span{font-size:25px;white-space:nowrap}
.path-scroll{position:relative;z-index:1;overflow:visible;padding:8px 0 18px}
.adventure-path{position:relative;min-height:272px;width:100%;display:grid;grid-template-columns:repeat(7,minmax(0,1fr));grid-auto-rows:84px;align-items:center;padding:10px 22px}
.adventure-path{--path-pad:22px;--path-row-h:84px;--path-edge:calc(var(--path-pad) + (100% - 2 * var(--path-pad)) / 14)}
.path-line{position:absolute;left:var(--path-edge);right:var(--path-edge);height:7px;border-radius:999px;background:repeating-linear-gradient(90deg,#c4b5fd 0 18px,#ede9fe 18px 30px);box-shadow:inset 0 2px 3px rgba(0,0,0,.12);transform:translateY(-50%)}
.path-line-top{top:calc(10px + var(--path-row-h) * .5)}
.path-line-middle{top:calc(10px + var(--path-row-h) * 1.5)}
.path-line-bottom{top:calc(10px + var(--path-row-h) * 2.5)}
.path-turn{position:absolute;width:7px;height:var(--path-row-h);border-radius:999px;background:#c4b5fd;box-shadow:inset 2px 0 3px rgba(0,0,0,.12);transform:translateX(-50%)}
.path-turn-right{left:calc(100% - var(--path-edge));top:calc(10px + var(--path-row-h) * .5)}
.path-turn-left{left:var(--path-edge);top:calc(10px + var(--path-row-h) * 1.5)}
.path-node{position:relative;z-index:2;grid-row:var(--path-row);grid-column:var(--path-column);justify-self:center;width:56px;height:56px;border-radius:50%;border:3px solid white;background:#7c3aed;color:white;display:grid;place-items:center;grid-template-rows:1fr auto auto;padding:4px;box-shadow:0 3px 0 #4c1d95,0 5px 8px rgba(76,29,149,.2);cursor:pointer;transition:.2s ease}
.path-node:hover{transform:translateY(-3px) scale(1.06)}
.warmup-card{border-color:#fcd34d;background:linear-gradient(135deg,#fff,#fffbeb)}
.arena-card{border-color:#67e8f9;background:linear-gradient(135deg,#fff,#ecfeff)}
.result-note{max-width:520px;margin:6px auto 14px;color:#5b4b6b;font-weight:700}
.path-node.game{background:#ec4899;box-shadow:0 3px 0 #9d174d,0 5px 8px rgba(157,23,77,.22)}
.path-node.blind{background:#2563eb;box-shadow:0 3px 0 #1e3a8a,0 5px 8px rgba(30,58,138,.22)}
.path-node.boss{background:#261736;box-shadow:0 3px 0 #100815,0 5px 8px rgba(0,0,0,.24)}
.path-node.completed{border-color:#fde68a;outline:2px solid #fbbf24;outline-offset:1px}
.node-icon{font-size:20px;line-height:1}
.path-node.sprite-icon{grid-template-rows:28px 9px 9px;padding:2px 4px 3px}
.world-card .path-node.sprite-icon .node-icon{align-self:center;justify-self:center;width:28px;height:28px;background-image:var(--sprite-image);background-repeat:no-repeat;background-size:var(--sprite-size,700% 300%);background-position:var(--sprite-position,var(--sprite-x) var(--sprite-y));font-size:0}
.path-node.sprite-icon .node-label{align-self:end;line-height:9px}
.path-node.sprite-icon .node-stars{align-self:end;line-height:8px}
.world-card .path-node.boss.sprite-icon .node-icon{position:absolute;left:50%;top:50%;z-index:1;width:56px;height:56px;transform:translate(-50%,-50%);margin:0}
.path-node.boss.sprite-icon .node-label,.path-node.boss.sprite-icon .node-stars{position:relative;z-index:2}
.path-node.boss.sprite-icon .node-label{grid-row:2}
.path-node.boss.sprite-icon .node-stars{grid-row:3}
.path-node.boss.sprite-icon .node-label{-webkit-text-stroke:1px #120a19;paint-order:stroke fill;text-shadow:0 1px 1px #120a19}
.node-label{font-size:7px;font-weight:950;letter-spacing:.03em}
.node-stars{min-width:31px;padding:1px 2px;border-radius:999px;background:rgba(20,8,32,.58);font-size:7px;line-height:1.1;white-space:nowrap;color:#fef3c7}
.path-node:not(.completed) .node-stars{opacity:.55;color:#ddd6fe}
.world-1 .path-node:not(.boss){background:#7c3aed;box-shadow:0 3px 0 #4c1d95,0 5px 8px rgba(76,29,149,.2)}
.world-2 .path-node:not(.boss){background:#0f766e;box-shadow:0 3px 0 #115e59,0 5px 8px rgba(17,94,89,.22)}
.world-3 .path-node:not(.boss):not(.game):not(.blind){background:#f0cf36;color:#78350f;box-shadow:0 3px 0 #b45309,0 5px 8px rgba(180,83,9,.22)}
.world-4 .path-node:not(.boss):not(.game):not(.blind){background:#7dd3fc;color:#0c4a6e;box-shadow:0 3px 0 #0369a1,0 5px 8px rgba(3,105,161,.22)}
.world-5 .path-node:not(.boss){background:#be123c;box-shadow:0 3px 0 #881337,0 5px 8px rgba(136,19,55,.22)}
.world-6 .path-node:not(.boss){background:#c2410c;box-shadow:0 3px 0 #7c2d12,0 5px 8px rgba(124,45,18,.22)}
.world-7 .path-node:not(.boss){background:#0e7490;box-shadow:0 3px 0 #164e63,0 5px 8px rgba(22,78,99,.22)}
.world-8 .path-node:not(.boss){background:#a16207;box-shadow:0 3px 0 #713f12,0 5px 8px rgba(113,63,18,.22)}
.world-9 .path-node:not(.boss){background:#1d4ed8;box-shadow:0 3px 0 #1e3a8a,0 5px 8px rgba(30,58,138,.22)}
.world-10 .path-node:not(.boss){background:#4338ca;box-shadow:0 3px 0 #312e81,0 5px 8px rgba(49,46,129,.22)}
.path-node.game,.path-node.boss{width:56px;height:56px}
.world-card .path-node.game{background:#dc2626;box-shadow:0 3px 0 #991b1b,0 5px 8px rgba(153,27,27,.22)}
.path-node.boss{background:linear-gradient(145deg,#4c1d95,#18101f);box-shadow:0 3px 0 #100815,0 5px 8px rgba(0,0,0,.24)}
.path-node.game:hover,.path-node.boss:hover{transform:translateY(-3px) scale(1.06)}
.battle-node-badge{position:absolute;right:-8px;top:-10px;z-index:3;width:23px;height:23px;display:grid;place-items:center;border:2px solid white;border-radius:50%;background:#fbbf24;color:#4a2500;font-size:12px;font-weight:950;box-shadow:0 3px 0 #b45309}
.path-node.game .node-icon,.path-node.boss .node-icon{font-size:20px}
.path-node.game .node-label,.path-node.boss .node-label{font-size:8px;letter-spacing:.05em}
.world-banner{position:relative;z-index:1;text-align:center;background:#fff7d6;border:1px solid #fbbf24;border-radius:15px;padding:9px;font-weight:900;color:#6b4d00}
#gameScreen{color:var(--ink);margin-top:-22px}
.game-header{display:grid;grid-template-columns:120px 1fr auto;align-items:center;gap:12px;margin-bottom:8px}
.game-title-wrap{text-align:center}
.game-header-actions{display:flex;align-items:center;gap:8px}
.ghost-button,.primary-button{min-height:46px;border-radius:15px;padding:0 16px;font-weight:950;cursor:pointer}
.ghost-button{border:1px solid #ded3e4;background:white;color:#4b375b}
.primary-button{border:0;background:#261736;color:white;box-shadow:0 7px 0 #120a19}
.primary-button:active{transform:translateY(3px);box-shadow:0 4px 0 #120a19}
.hud{width:min(100%,560px);display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin:0 auto 9px}
.hud>div{display:grid;grid-template-columns:auto 1fr;align-items:center;column-gap:6px;background:white;border:1px solid #eaddeb;border-radius:14px;padding:7px 9px}
.hud span{grid-row:1/span 2;font-size:20px}
.hud b{font-size:17px}
.hud small{color:#836f8e;font-size:10px;font-weight:700}
.race-panel{width:100%;background:#261736;color:white;border-radius:16px;padding:6px 12px 8px;margin:0 0 9px;overflow:hidden;border:1px solid rgba(255,255,255,.12)}
.race-labels{display:flex;justify-content:space-between;font-size:11px;font-weight:950;letter-spacing:.08em;opacity:.85}
.track{height:44px;margin-top:4px;border-radius:999px;position:relative;background:linear-gradient(90deg,#4c1d95,#831843);overflow:hidden;border:2px solid rgba(255,255,255,.18)}
.track::before{content:"";position:absolute;left:18px;right:18px;top:60%;border-top:2px dashed rgba(255,255,255,.28)}
.track-fill{position:absolute;inset:0 auto 0 0;width:0;background:linear-gradient(90deg,rgba(52,211,153,.35),rgba(251,191,36,.28));transition:width .18s ease}
.kuromi{position:absolute;left:3%;top:54%;transform:translate(-50%,-50%);width:38px;height:38px;transition:left .23s cubic-bezier(.2,.8,.2,1);z-index:4;filter:drop-shadow(0 5px 6px rgba(0,0,0,.25))}
.kuromi.boost{animation:boost .45s ease}
.kuromi-svg{width:100%;height:100%;overflow:visible;animation:hoverFly 1.35s ease-in-out infinite alternate}
.hood,.pom{fill:#24202a;stroke:#100d12;stroke-width:2}
.face-shape{fill:#fff;stroke:#100d12;stroke-width:2}
.skull{fill:#f58bb4}
.eye{fill:#100d12}
.nose{fill:#f58bb4;stroke:#100d12;stroke-width:1}
.smile,.tail{fill:none;stroke:#100d12;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.trail{position:absolute;right:52px;top:24px;color:#fbbf24;white-space:nowrap;font-size:15px;animation:twinkle .8s infinite alternate}
.checkpoint{position:absolute;top:1px;transform:translateX(-50%);display:grid;justify-items:center;gap:0;opacity:.52;transition:.2s ease;z-index:2}
.checkpoint span{font-size:12px;line-height:1}
.checkpoint small{font-size:7px;font-weight:900}
.checkpoint.reached{opacity:1;transform:translateX(-50%) scale(1.15);filter:drop-shadow(0 0 7px rgba(251,191,36,.8))}
.c1{left:25%}
.c2{left:50%}
.c3{left:75%}
.c4{left:96%}
.exercise-card{background:white;border:1px solid #eaddeb;border-radius:20px;padding:11px 16px 13px;margin-bottom:0;box-shadow:0 9px 30px rgba(63,33,80,.12)}
.game[data-kind="boss"] .exercise-card{border:3px solid #f59e0b}
.game[data-kind="game"] .exercise-card{border:3px solid #f9a8d4}
.round-line{display:flex;justify-content:space-between;gap:12px;color:#806e89;font-size:13px;font-weight:900}
.target-line{display:flex;justify-content:center;gap:clamp(4px,1vw,10px);margin:24px 0 12px;padding:8px 3px;font-size:clamp(22px,4vw,40px);line-height:1.35;font-weight:950;white-space:nowrap}
.target-line.medium-text{flex-wrap:wrap;gap:4px 3px;margin:18px 0 10px;font-size:clamp(18px,2.4vw,30px);white-space:normal}
.target-line.medium-text .char{flex:0 0 clamp(26px,3vw,42px);height:clamp(48px,5vw,64px);aspect-ratio:auto;border-radius:10px}
.target-line.long-text{flex-wrap:wrap;gap:3px 2px;margin:15px 0 10px;font-size:clamp(16px,1.7vw,21px);white-space:normal}
.target-line.long-text .char{flex:0 0 clamp(19px,1.8vw,25px);height:clamp(42px,4vw,54px);aspect-ratio:auto;border-radius:8px}
.char{position:relative;display:grid;place-items:center;flex:0 1 64px;min-width:0;aspect-ratio:1;border:2px solid #d7d7d7;background:white;color:#777;border-radius:10px}
.char.done{color:#10bd78;border-color:#a8ddc2}
.char.done::before{content:'✓';position:absolute;bottom:100%;font-size:20px;line-height:1.1;color:#10bd78}
.char.current{color:#555;box-shadow:0 0 0 3px #d4e3ef;border-color:#b8cbdc}
.char.error{background:#fecdd3;color:#be123c;animation:shake .22s linear}
.feedback{min-height:24px;text-align:center;font-weight:900;color:#6d5b78}
.battle-stage{position:relative;height:330px;margin:0 0 14px;overflow:hidden;border:3px solid #bae6fd;border-radius:28px;background:linear-gradient(#38bdf8 0,#7dd3fc 58%,#dff8ff 100%);box-shadow:inset 0 -25px 55px rgba(255,255,255,.22),0 12px 32px rgba(14,116,144,.2)}
.battle-stage::before{content:"";position:absolute;inset:auto -4% 0 36%;height:73px;background:#e0f2fe;clip-path:polygon(0 28%,100% 0,92% 100%,7% 88%);filter:drop-shadow(0 10px 0 rgba(14,116,144,.16))}
.battle-cloud{position:absolute;width:130px;height:30px;border-radius:999px;background:rgba(255,255,255,.28);filter:blur(1px)}
.battle-cloud::before,.battle-cloud::after{content:"";position:absolute;border-radius:50%;background:inherit}
.battle-cloud::before{width:55px;height:55px;left:20px;bottom:0}.battle-cloud::after{width:70px;height:70px;right:10px;bottom:0}
.cloud-one{left:6%;top:70px}.cloud-two{right:4%;top:42px;transform:scale(.7)}
.battle-instruction{position:absolute;left:50%;top:18px;transform:translateX(-50%);z-index:3;padding:8px 15px;border-radius:999px;background:rgba(255,255,255,.88);color:#075985;font-size:13px;font-weight:950;white-space:nowrap}
.battle-target{position:absolute;left:50%;top:64px;transform:translateX(-50%);z-index:3;min-width:64px;padding:10px 14px;border-radius:16px;background:white;border:4px solid #dbeafe;color:#251a35;text-align:center;font-size:34px;font-weight:950;box-shadow:0 8px 0 rgba(3,105,161,.24)}
.battle-platform{position:absolute;left:8%;right:19%;bottom:44px;height:22px;border-radius:70% 45% 40% 65%;background:#e0f2fe;box-shadow:0 13px 0 rgba(14,116,144,.18)}
.battle-hero{position:absolute;left:14%;bottom:60px;width:100px;height:100px;z-index:3;filter:drop-shadow(0 8px 5px rgba(3,105,161,.28))}
.battle-kuromi-svg{width:100%;height:100%;animation:battleReady .7s ease-in-out infinite alternate}
.battle-monster{position:absolute;right:22%;bottom:65px;width:108px;height:125px;z-index:3;border:4px solid #164e63;border-radius:48% 48% 38% 38%;background:linear-gradient(145deg,#a7f3d0,#22c55e);box-shadow:inset -12px -13px 0 rgba(5,150,105,.22),0 9px 0 rgba(14,116,144,.2);transform-origin:50% 100%}
.monster-horn{position:absolute;top:-25px;width:27px;height:40px;border:4px solid #164e63;background:#fef3c7;clip-path:polygon(50% 0,100% 100%,0 100%)}
.monster-horn.left{left:12px;transform:rotate(-16deg)}.monster-horn.right{right:12px;transform:rotate(16deg)}
.monster-eye{position:absolute;top:42px;width:13px;height:18px;border-radius:50%;background:#0f172a}.monster-eye.left{left:27px}.monster-eye.right{right:27px}
.monster-mouth{position:absolute;left:50%;top:77px;width:36px;height:18px;transform:translateX(-50%);border-bottom:5px solid #0f172a;border-radius:50%}
.magic-fruit{position:absolute;left:21%;bottom:115px;z-index:5;font-size:34px;opacity:0;filter:drop-shadow(0 4px 3px rgba(0,0,0,.2))}
.victory-banner{position:absolute;inset:0;z-index:8;display:grid;place-content:center;justify-items:center;background:rgba(36,32,42,.82);color:white;opacity:0;pointer-events:none;transform:scale(.92);transition:.28s}
.victory-banner span{font-size:45px}.victory-banner b{font-size:clamp(38px,7vw,72px);letter-spacing:.08em}.victory-banner small{font-size:15px;font-weight:900;color:#fde68a}
.battle-stage.hit .magic-fruit{animation:fruitThrow .42s ease-in forwards}.battle-stage.hit .battle-monster{animation:monsterHit .42s ease}
.battle-stage.victory .battle-monster{animation:monsterFall .8s ease-in forwards}.battle-stage.victory .battle-hero{animation:ninjaVictory .9s .15s ease both}.battle-stage.victory .victory-banner{opacity:1;transform:scale(1);transition-delay:.55s}
.keyboard-toggle{width:min(100%,300px);display:grid;grid-template-columns:auto 1fr;align-items:center;gap:9px;background:white;border:1px solid #eaddeb;border-radius:16px;padding:9px 11px;cursor:pointer}
.keyboard-toggle input{position:absolute;opacity:0;pointer-events:none}
.keyboard-toggle>span:last-child{display:grid;gap:2px}
.keyboard-toggle b{font-size:14px}.keyboard-toggle small{color:#806e89;font-size:11px;font-weight:700;line-height:1.15}
.toggle-track{width:48px;height:28px;padding:3px;border-radius:999px;background:#d8cadf;transition:.18s}
.toggle-track span{display:block;width:22px;height:22px;border-radius:50%;background:white;box-shadow:0 2px 6px rgba(0,0,0,.2);transition:.18s}
.keyboard-toggle input:checked+.toggle-track{background:#7c3aed}
.keyboard-toggle input:checked+.toggle-track span{transform:translateX(20px)}
.header-keyboard-toggle{width:auto;min-height:46px;grid-template-columns:auto auto;padding:6px 10px;border-radius:15px}.header-keyboard-toggle b{font-size:11px}.header-keyboard-toggle .toggle-track{width:40px;height:24px;padding:3px}.header-keyboard-toggle .toggle-track span{width:18px;height:18px}.header-keyboard-toggle input:checked+.toggle-track span{transform:translateX(16px)}
#keyboardWrap{position:relative;padding-top:7px;transition:opacity .18s;overflow:visible}
#keyboardWrap.keyboard-hidden{display:none;opacity:0}
.keyboard{display:grid;gap:7px;background:#f3f3f3;border:10px solid #f7f7f7;border-radius:24px;padding:10px;box-shadow:0 0 0 1px #e5e5e5,0 9px 0 #e9e9e9}
.key-row{display:grid;gap:6px;grid-template-columns:repeat(30,minmax(0,1fr))}
.key{--finger-color:#cbbfd0;grid-column:span var(--span,2);display:grid;place-items:center;min-width:0;min-height:64px;border-radius:10px;background:white;border:2px solid #d2d2d2;color:#6f6676;font-size:18px;font-weight:950;line-height:1;transition:.12s;position:relative;box-shadow:0 2px 0 #d2d2d2}
.finger-pinky{--finger-color:#0d7df4}.finger-ring{--finger-color:#7dbb18}.finger-middle{--finger-color:#ffbd25}.finger-index{--finger-color:#ff4c4c}.finger-thumb{--finger-color:#8b5cf6}
.key.typing-key,.key.learned:not(.modifier-key){background:var(--finger-color);border-color:var(--finger-color);color:white;font-size:21px;text-shadow:0 1px 1px rgba(0,0,0,.16);box-shadow:0 3px 0 color-mix(in srgb,var(--finger-color) 78%,#333)}
.key.modifier-key{font-size:10px;letter-spacing:.035em;color:#716b73;background:#fafafa}.key.space-key{--finger-color:#60a5fa;font-size:13px;background:#e9e9e9;color:#aaa;border-color:#ddd;box-shadow:0 3px 0 #d3d3d3}
.key.active{z-index:3}.key.active::after{content:"";position:absolute;left:50%;top:50%;width:128px;height:128px;border-radius:50%;background:rgba(255,255,255,.38);transform:translate(-50%,-50%);pointer-events:none;box-shadow:inset 0 0 0 2px rgba(255,255,255,.18)}
.key.wrong{background:#fecdd3!important;border-color:#fb7185!important;color:#be123c!important}
.key .dot{width:5px;height:5px;border-radius:50%;background:white;position:absolute;bottom:7px;box-shadow:0 1px 1px rgba(0,0,0,.25)}
.key-guide-character{position:absolute;z-index:7;width:62px;height:68px;transform:translateX(-50%);transition:left .15s ease,top .15s ease;pointer-events:none;filter:drop-shadow(0 5px 4px rgba(38,23,54,.26))}
#guideKuromi{position:relative;z-index:2;width:54px;height:54px;margin:auto}.guide-kuromi-svg{width:100%;height:100%;animation:guideBounce .65s ease-in-out infinite alternate}.guide-arm{position:absolute;z-index:3;top:39px;width:11px;height:25px;border:2px solid #100d12;border-radius:8px;background:#24202a;transform-origin:50% 0}.guide-arm::after{content:"";position:absolute;left:50%;bottom:-5px;width:10px;height:10px;border:2px solid #100d12;border-radius:50%;background:#fff;transform:translateX(-50%)}.guide-arm-left{left:13px;transform:rotate(-20deg)}.guide-arm-right{right:13px;transform:rotate(20deg)}
.hand-guide{display:flex;justify-content:center;align-items:flex-start;gap:8px;margin-top:6px;padding:7px 10px 0;border-radius:18px;background:rgba(255,255,255,.9);border:1px solid rgba(234,221,235,.75);overflow:hidden}
.hand-card{display:grid;justify-items:center;width:min(18%,100px);color:#806e89;font-size:8px;letter-spacing:.1em}.hand-card>b{margin-top:-13px;position:relative;z-index:4}.hand-visual{position:relative;width:100%;aspect-ratio:270/300}
.hand-svg{display:block;width:100%;height:100%;overflow:visible}.right-hand{transform:scaleX(-1)}
.hand-outline{fill:#fff;stroke:#555158;stroke-width:6;stroke-linejoin:round;filter:drop-shadow(0 4px 0 rgba(85,81,88,.08))}
.hand-seams{fill:none;stroke:#555158;stroke-width:4;stroke-linecap:round}
.hand-zone{fill:transparent;stroke:transparent;stroke-width:4;transition:fill .16s,stroke .16s,filter .16s}.finger-dot{fill:var(--finger-color);stroke:#fff;stroke-width:3;transition:r .16s,filter .16s}
.hand-finger-zone.active .hand-zone{fill:var(--finger-color);fill-opacity:.2;stroke:var(--finger-color);filter:drop-shadow(0 0 8px var(--finger-color))}.hand-finger-zone.active .finger-dot{r:14;filter:drop-shadow(0 0 7px var(--finger-color))}
.hand-side-mark{position:absolute;left:50%;top:72%;transform:translate(-50%,-50%);width:30px;height:30px;display:grid;place-items:center;border-radius:50%;background:#f8f7f8;color:#d2ced4;font-size:16px;font-weight:950}
.finger-hint{width:max-content;max-width:100%;min-width:1px;min-height:28px;margin:6px auto 0;padding:5px 10px;border-radius:999px;background:rgba(255,255,255,.9);color:#443154;text-align:center;font-size:12px;font-weight:900}.finger-hint:empty{visibility:hidden}
.game.hands-disabled .hand-guide,.game.hands-disabled .finger-hint{display:none}.game.hands-disabled .key.typing-key,.game.hands-disabled .key.learned:not(.modifier-key):not(.space-key){background:#fff;border-color:#d2d2d2;color:#6f6676;text-shadow:none;box-shadow:0 2px 0 #d2d2d2}.game.hands-disabled .key .dot{background:#6f6676}
.game.keyboard-disabled #keyboardWrap{display:none!important}
.result{position:relative;text-align:center;padding:60px 12px;color:white;overflow:hidden}
.result-character{font-size:72px}
.result h2{font-size:clamp(32px,6vw,56px);margin:12px 0}
.stars{font-size:54px;letter-spacing:7px;margin:16px 0 22px}
.result-metrics{display:flex;justify-content:center;gap:12px;flex-wrap:wrap;margin:24px auto;max-width:850px}
.metric{background:white;color:var(--ink);border:1px solid #eaddeb;border-radius:18px;padding:14px 20px;min-width:140px}
.metric.weak{border-color:#fbbf24}
.metric b{display:block;font-size:26px}
.metric small{color:#7d6987;font-weight:700}
.result-actions{position:relative;z-index:2;display:flex;justify-content:center;gap:22px;flex-wrap:wrap;margin-top:30px}.result-icon{width:82px;height:82px;padding:0;border:8px solid white;border-radius:50%;color:white;display:grid;place-items:center;cursor:pointer;box-shadow:0 7px 20px rgba(12,7,24,.25)}.result-icon svg{display:block;width:46px;height:46px;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}.result-icon.home svg{fill:none}.result-icon.home{background:#f97316}.result-icon.retry{background:#0ea5e9}.result-icon.next{background:#84cc16}.result-icon:hover{transform:translateY(-3px)}
.celebration{position:absolute;z-index:1;inset:0;overflow:hidden;pointer-events:none}.celebration i{position:absolute;left:var(--x);bottom:-30px;color:var(--color);font-size:clamp(15px,2.5vw,30px);font-style:normal;opacity:0;animation:celebrate 2.6s var(--delay) ease-out both}.result>*:not(.celebration){position:relative;z-index:2}
@keyframes celebrate{0%{opacity:0;transform:translate(0,0) scale(.4) rotate(0)}15%{opacity:1}75%{opacity:1}100%{opacity:0;transform:translate(var(--drift),-85vh) scale(1.25) rotate(420deg)}}
@keyframes twinkle{to{opacity:.25;transform:scale(.7)}
}
@keyframes hoverFly{to{transform:translateY(-5px) rotate(-2deg)}
}
@keyframes boost{50%{transform:translate(-50%,-50%) scale(1.18) rotate(-6deg)}
}
@keyframes shake{25%{transform:translateX(-3px)}
75%{transform:translateX(3px)}
}
@keyframes floatSky{to{transform:translateY(8px);opacity:.45}
}
@keyframes ambientGradient{to{background-position:10% 4%,90% 12%,50% 100%}
}
@keyframes guideBounce{to{transform:translateY(-5px) rotate(-3deg)}
}
@keyframes battleReady{to{transform:translateY(-5px) rotate(-2deg)}
}
@keyframes fruitThrow{0%{left:21%;bottom:115px;opacity:1;transform:rotate(0)}55%{left:48%;bottom:205px;opacity:1;transform:rotate(380deg)}100%{left:72%;bottom:112px;opacity:1;transform:rotate(720deg)}
}
@keyframes monsterHit{20%{transform:translateX(10px) rotate(6deg);filter:brightness(1.4)}55%{transform:translateX(-7px) rotate(-5deg)}100%{transform:none}
}
@keyframes monsterFall{30%{transform:rotate(13deg) translateX(18px)}100%{transform:rotate(76deg) translate(120px,190px);opacity:0}
}
@keyframes ninjaVictory{35%{transform:translateY(-70px) rotate(-8deg) scale(1.15)}70%{transform:translateY(-30px) rotate(8deg) scale(1.1)}100%{transform:translateY(-45px) scale(1.18);filter:drop-shadow(0 0 20px #fde68a)}
}
@media(max-width:850px){.world-header{grid-template-columns:auto 1fr}
.world-stars{grid-column:1/-1;justify-self:start}
.adaptive-card{grid-template-columns:auto 1fr}
.adaptive-card button{grid-column:1/-1}
.game-header{grid-template-columns:1fr 1fr}
.game-title-wrap{grid-column:1/-1;grid-row:1}
.hud{grid-template-columns:1fr}
.keyboard{padding:8px;gap:5px}
.key-row{gap:4px}
.key{min-height:42px;font-size:11px}.key.typing-key,.key.learned:not(.modifier-key){font-size:15px}.key.modifier-key{font-size:8px}
.game-header button{width:100%}
}
@media(max-width:560px){.app{width:min(100% - 14px,1120px);padding-top:16px}
.world-card{padding:16px;border-radius:24px}
.world-header{grid-template-columns:1fr}
.world-emblem{width:54px;height:54px}
.world-story{align-items:flex-start}
.adventure-path{min-height:auto;grid-template-columns:repeat(5,minmax(0,1fr));grid-auto-rows:70px;padding:14px 2px}
.path-line,.path-turn{display:none}
.path-node{grid-row:auto;grid-column:auto;width:50px;height:50px;border-width:3px}
.path-node.game,.path-node.boss{width:50px;height:50px}
.node-icon{font-size:18px}
.node-label{font-size:8px}
.target-line{letter-spacing:0}
.battle-stage{height:280px}.battle-instruction{font-size:11px}.battle-target{top:58px;font-size:26px}.battle-hero{left:8%;width:80px;height:80px}.battle-monster{right:12%;width:88px;height:105px}.magic-fruit{left:18%}
.hand-guide{gap:4px;padding-inline:4px}.hand-card{width:min(28%,90px)}.hand-card>b{font-size:7px}.hand-side-mark{width:27px;height:27px;font-size:14px}
.race-panel{padding-inline:10px}
.keyboard{overflow-x:auto}.key-row{min-width:760px}
.round-line{flex-direction:column}
.hud>div{grid-template-columns:auto auto 1fr}
.hud small{justify-self:end}
.result{padding-top:30px}
.track{height:44px}
.kuromi{width:36px;height:36px}
.hero-character{display:none}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
}

/* Урок: сначала понятная задача, затем строка и спокойные подсказки. */
.lesson-title{margin:0 0 6px;font-size:clamp(19px,2.4vw,26px);color:#382947}
.lesson-description{max-width:760px;margin:0 auto 16px;color:#655672;line-height:1.5;font-size:15px}
.target-line,.target-line.medium-text,.target-line.long-text{flex-wrap:wrap;gap:12px 5px;align-items:center;white-space:normal}
.typing-word{display:inline-flex;gap:3px;flex:0 0 auto}
.target-line .char{flex:0 0 auto;width:clamp(24px,4vw,48px);height:clamp(38px,4.8vw,58px);aspect-ratio:auto}
.target-line.medium-text .char{flex:0 0 auto;width:clamp(21px,3vw,36px);height:48px}
.target-line.long-text .char{flex:0 0 auto;width:clamp(18px,2vw,25px);height:42px}
.target-line .space{width:20px;min-width:16px;color:#877792;font-size:18px;background:#f8f5fb;border-color:transparent}
.target-line .space.current{border-color:#9363cc;background:#eee5fb;color:#552d84}
.char.done::before{display:none}
.layout-dialog{position:fixed;width:min(460px,calc(100% - 32px));max-height:calc(100dvh - 32px);overflow:auto;box-sizing:border-box;margin:auto;padding:30px;border:1px solid #ded0ec;border-radius:26px;background:#fffafd;color:#382947;text-align:center;box-shadow:0 24px 90px #1e103d66}
.layout-dialog::backdrop{background:#1e143a99;backdrop-filter:blur(5px)}
.layout-dialog h2{font-size:27px;margin:12px 0}
.layout-dialog p{font-size:16px;line-height:1.6}
.layout-dialog .dialog-note{font-size:14px;color:#746181}
.dialog-icon{font-size:42px}
.dialog-close{position:absolute;right:10px;top:10px;width:40px;height:40px;border:0;border-radius:50%;background:#eee6f4;color:#573870;font-size:28px;cursor:pointer}
button:focus-visible,select:focus-visible{outline:3px solid #b584f4;outline-offset:4px}
@media(max-width:560px){.game-header-actions{flex-wrap:wrap;justify-content:flex-end}.game-header{grid-template-columns:auto 1fr}.game-header-actions{grid-column:1/-1}.lesson-description{font-size:14px}.target-line{font-size:23px}.target-line.medium-text{font-size:20px}.typing-word{gap:2px}}

.learning-start{position:relative;z-index:2;margin:18px auto 28px;padding:20px;max-width:640px;border:1px solid #ffffff38;border-radius:20px;background:#25103cbd}
.learning-start p{margin:12px 0 8px;line-height:1.5}.learning-start small{color:#e5d6ee}
.learning-start .primary-button{background:#f1e7ff;color:#442164;box-shadow:0 4px 0 #bea2d6;max-width:100%;height:auto;padding:12px 22px}
.layout-choice{font-size:11px;display:grid;gap:2px;color:#efe5ff}.layout-choice select{max-width:145px;min-height:32px;border:1px solid #d9c8e6;border-radius:9px;background:#fffafd;color:#493456}
.game-header{grid-template-columns:auto 1fr}.game-header-actions{flex-wrap:wrap;justify-content:flex-end}

@media(min-width:851px){.game-header{grid-template-columns:110px minmax(130px,1fr) auto}.game-header-actions{max-width:720px}}

@media(max-width:850px){#gameScreen{margin-top:0}.hud{grid-template-columns:repeat(3,minmax(0,1fr))}.hud>div{grid-template-columns:auto 1fr}.hud small{justify-self:start}.hud:has(#speedBox:not(.hidden)){grid-template-columns:repeat(2,minmax(0,1fr))}}
.lesson-title{text-align:center;text-shadow:none}

/* Единая композиция урока: задание → клавиши → руки. */
body:has(#gameScreen:not(.hidden)){background-blend-mode:screen;background-color:#e9e2f3}
#gameScreen{max-width:960px;margin:0 auto;color:#382947}
.game-header{grid-template-columns:110px minmax(0,1fr) 110px;gap:16px;margin-bottom:16px}
.game-header-actions{grid-column:auto;justify-content:flex-end}
.game-title-wrap{grid-column:auto;grid-row:auto;min-width:0}
.game-header .ghost-button{width:100%;font-size:13px}
.game-header .eyebrow{letter-spacing:.02em;font-size:11px;background:#49345f}
.hud{max-width:480px;gap:8px;margin-bottom:16px}
.hud>div{padding:8px 12px;grid-template-columns:auto 1fr;background:#fff;border-color:#e6deed}
.hud small{color:#655672;justify-self:start;font-size:11px}
.race-panel{margin-bottom:16px;background:#49345f;border-radius:18px;padding:10px 16px}
.race-labels{font-size:10px;letter-spacing:.04em;opacity:1}
.checkpoint small{display:none}.checkpoint{top:10px}.checkpoint span{font-size:16px}
.exercise-card{padding:24px;border-radius:24px;border:1px solid #ded5e8;box-shadow:0 8px 24px #3829470d}
.lesson-title{margin:0 0 8px;font-size:clamp(22px,3vw,30px);line-height:1.25;letter-spacing:-.02em;text-align:center;text-shadow:none}
.lesson-description{max-width:640px;margin:0 auto 20px;text-align:center;color:#655672;font-size:14px;line-height:1.5}
.round-line{flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;font-weight:600;color:#655672;font-size:14px}
#roundLabel{border-radius:99px;background:#eee7f7;color:#573879;padding:5px 12px;font-size:12px;font-weight:750}
.target-line,.target-line.medium-text,.target-line.long-text{min-height:96px;margin:20px 0 16px;padding:20px 8px;gap:12px 5px;border-radius:16px;background:#f8f5fb;align-content:center;font-family:ui-monospace,SFMono-Regular,Consolas,monospace}
.target-line .char{border-color:transparent;border-bottom-color:#d8cde4;border-radius:7px;background:transparent;color:#655672;box-shadow:none}
.target-line .char.current{background:#ede2fc;color:#4e237a;border-color:#8552b4;box-shadow:0 3px 0 #8552b4}
.target-line .char.done{color:#18764e;background:#e8f5ed;border-color:transparent;border-bottom-color:#79b895}
.target-line .char.error{color:#9f1239;background:#ffe4eb;border-color:#be345a}
.target-line .space{color:#655672;background:transparent}
.feedback{min-height:24px;font-size:13px;line-height:1.5;font-weight:600;color:#655672}
.lesson-settings{margin:16px 0;color:#574369;font-size:13px}
.lesson-settings summary{width:max-content;margin:0 auto;min-height:44px;padding:12px 18px;cursor:pointer;border-radius:12px;background:#fff;border:1px solid #ded5e8;font-weight:650}
.lesson-settings summary:focus-visible{outline:3px solid #8552b4;outline-offset:3px}
.lesson-settings-content{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:12px;margin-top:12px;padding:16px;background:white;border-radius:16px}
.layout-choice{color:#574369;font-size:12px;gap:5px}.layout-choice select{min-height:44px;padding:6px;max-width:180px}
#keyboardWrap{padding-top:0;margin-top:0}
.keyboard{border:8px solid #f7f4fa;padding:8px;background:#eee8f3;gap:6px;border-radius:20px;box-shadow:0 4px 0 #d8cfe2}
.key{min-height:48px;color:#655672;font-weight:700;border-width:1px;border-radius:8px}
.finger-pinky{--finger-color:#a9ccef}.finger-ring{--finger-color:#b6d9ba}.finger-middle{--finger-color:#f2d68c}.finger-index{--finger-color:#efb4c5}.finger-thumb{--finger-color:#c6b4e8}
.key.typing-key,.key.learned:not(.modifier-key){color:#382947;text-shadow:none;font-size:19px;box-shadow:0 2px 0 color-mix(in srgb,var(--finger-color) 75%,#776586)}
.key.active{outline:3px solid #71409a;outline-offset:1px}.key.active::after{display:none}
.key.space-key{color:#655672}.key .dot{background:#49345f;box-shadow:none}
.hand-guide{gap:48px;margin-top:28px;padding:16px 24px 12px;border-radius:20px;background:#fff;border:1px solid #ded5e8;overflow:hidden}
.hand-card{width:120px;max-width:36%;font-size:12px;letter-spacing:0}
.hand-outline{fill:#fcf8f4;stroke:#817185;stroke-width:4;filter:none}.hand-seams{stroke:#817185;stroke-width:3}
.hand-finger-zone .hand-zone{fill:var(--finger-color);fill-opacity:.22}
.hand-finger-zone.active .hand-zone{fill-opacity:.9;stroke:#71409a;stroke-width:5;filter:none}
.hand-finger-zone.active .finger-dot{filter:none;r:12}.finger-dot{stroke:#fff;stroke-width:2}
.hand-side-mark{width:auto;height:auto;background:transparent;color:#655672;font-size:12px;font-weight:650;top:78%}
.finger-hint{margin:12px auto 0;padding:8px 16px;font-size:14px;color:#49345f}
@media(max-width:850px){.game-header{grid-template-columns:90px minmax(0,1fr) 100px}.game-title-wrap{grid-row:auto;grid-column:auto}.hud{grid-template-columns:repeat(3,minmax(0,1fr))}.key{min-height:44px}}
@media(max-width:560px){.game-header{gap:8px;grid-template-columns:80px minmax(0,1fr) 90px}.game-header-actions{grid-column:auto}.game-header .ghost-button{padding:0 8px;font-size:12px}.game-header .eyebrow{font-size:9px;padding:7px;letter-spacing:0}.exercise-card{padding:20px 12px}.lesson-description{font-size:13px}.target-line,.target-line.medium-text,.target-line.long-text{padding:16px 2px}.target-line.long-text .char{width:17px}.hand-guide{gap:32px;margin-top:24px}.hand-card{width:110px}.hud>div{padding:8px}.hud b{font-size:15px}.hud span{font-size:17px}.race-panel{padding:8px 12px}}
