/* Аеро-деца — стилове */
.kids { --ink: #1f2937; --sun: #ffd23f; --sky: #3CB4E5; --navy: #1a365d; --paper: #fffdf5; font-size: 17px; }
.kids section { padding: 3rem 0; }
.kids h2.k-title { font-size: clamp(1.6rem, 3.4vw, 2.3rem); color: var(--navy); margin: 0 0 .4rem; font-weight: 900; letter-spacing: -.01em; }
.kids .k-lead { color: #4b5563; max-width: 760px; margin: 0 0 1.6rem; font-size: 1.05rem; }
.kids .pill { display: inline-block; background: rgba(60,180,229,.14); color: #0369a1; font-weight: 800; font-size: .75rem; padding: .22rem .6rem; border-radius: 999px; }
.kids .muted { color: #6b7280; }
.kbtn { font: inherit; font-weight: 800; font-size: .95rem; border: 2.5px solid var(--ink); background: var(--sun); color: var(--ink); padding: .55rem 1rem; border-radius: 14px; cursor: pointer; box-shadow: 3px 3px 0 var(--ink); transition: transform .08s, box-shadow .08s; }
.kbtn:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--ink); }
.kbtn:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink); }
.kbtn.ghost { background: #fff; }
.kbtn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: 3px 3px 0 var(--ink); }

/* hero */
.k-hero { background: linear-gradient(180deg, #bfe8fb 0%, #e9f8ff 100%); padding: calc(110px + 2rem) 0 3rem !important; border-bottom: 3px solid var(--ink); }
.k-hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 2rem; align-items: center; }
.k-hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.05; margin: .4rem 0 .8rem; color: var(--navy); font-weight: 900; }
.k-hero h1 span { background: var(--sun); padding: 0 .3rem; border-radius: 8px; box-shadow: 3px 3px 0 var(--ink); display: inline-block; transform: rotate(-1.5deg); }
.k-hero p { font-size: 1.1rem; color: #334155; }
.k-hero-art { border: 3px solid var(--ink); border-radius: 20px; overflow: hidden; box-shadow: 6px 6px 0 var(--ink); background: #fff; aspect-ratio: 400/260; }
.k-hero-art svg, .cast-art svg, .cc-cover svg, .cpanel svg, .sl-art svg, .cert-art svg { width: 100%; height: 100%; display: block; }
.k-nav { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.2rem; }
.k-nav a { text-decoration: none; }
.k-badges { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.k-badges span { background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: .2rem .7rem; font-weight: 700; font-size: .85rem; }

/* герои */
.cast { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.cast-card { background: #fff; border: 3px solid var(--ink); border-radius: 18px; overflow: hidden; box-shadow: 4px 4px 0 var(--ink); }
.cast-art { aspect-ratio: 400/260; border-bottom: 3px solid var(--ink); }
.cast-card h4 { margin: .6rem .8rem .2rem; color: var(--navy); font-size: 1.05rem; }
.cast-card p { margin: 0 .8rem .8rem; font-size: .88rem; color: #4b5563; line-height: 1.4; }

/* комикси */
.k-comics { background: var(--paper); border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); background-image: radial-gradient(rgba(31,41,55,.07) 1.2px, transparent 1.2px); background-size: 14px 14px; }
.comic-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.2rem; }
.comic-card { font: inherit; text-align: left; padding: 0; background: #fff; border: 3px solid var(--ink); border-radius: 18px; overflow: hidden; cursor: pointer; box-shadow: 5px 5px 0 var(--c); transition: transform .12s; }
.comic-card:hover { transform: translateY(-3px) rotate(-.4deg); }
.cc-cover { position: relative; aspect-ratio: 400/260; border-bottom: 3px solid var(--ink); }
.cc-num { position: absolute; left: 8px; top: 8px; background: var(--c); color: #fff; font-weight: 900; font-size: .78rem; padding: .2rem .6rem; border-radius: 999px; border: 2px solid var(--ink); }
.cc-done { position: absolute; right: 8px; top: 8px; background: #16a34a; color: #fff; font-weight: 900; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--ink); }
.cc-body { padding: .7rem .9rem .9rem; }
.cc-body h3 { margin: 0 0 .2rem; font-size: 1.12rem; color: var(--navy); }
.cc-body p { margin: 0; font-size: .85rem; color: #6b7280; }

.comic-view { margin-top: 2rem; background: #fff; border: 3px solid var(--ink); border-radius: 22px; padding: 1.4rem; box-shadow: 6px 6px 0 var(--ink); scroll-margin-top: 100px; }
.cv-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.cv-head h3 { margin: .3rem 0 0; font-size: 1.6rem; color: var(--navy); }
.cv-head .pill { background: var(--c); color: #fff; }
.cv-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.comic-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }

.cpanel { position: relative; aspect-ratio: 400/260; border: 3px solid var(--ink); border-radius: 6px; overflow: hidden; background: #fff; container-type: inline-size; }
.cpanel > svg { position: absolute; inset: 0; }
.cp-cap { position: absolute; left: 0; top: 0; background: #fff4b8; border-right: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); padding: .25em .6em; font-size: clamp(11px, 3.4cqw, 15px); font-weight: 700; font-style: italic; max-width: 78%; z-index: 2; }
.cp-bubbles { position: absolute; left: 3%; right: 3%; top: 4%; display: flex; flex-direction: column; gap: 4px; z-index: 3; }
.cp-bubbles.has-cap { top: 15%; }
.cp-bubbles.row { flex-direction: row; justify-content: space-between; align-items: flex-start; }
.cp-bubbles.row .bubble { align-self: flex-start; max-width: 49%; }
.bubble { position: relative; max-width: 64%; background: #fff; border: 2.5px solid var(--ink); border-radius: 16px; padding: .35em .65em .4em; font-size: clamp(11px, 3.5cqw, 16px); line-height: 1.25; font-weight: 600; color: var(--ink); box-shadow: 2px 2px 0 rgba(0,0,0,.15); }
.bubble b { display: block; font-size: .72em; text-transform: uppercase; letter-spacing: .04em; color: #0369a1; }
.bubble.plane { background: #fff8d6; }
.bubble.plane b { color: #b45309; }
.bubble.radio { border-style: dashed; background: #eef9ff; font-style: italic; }
.bubble.start { align-self: flex-start; }
.bubble.end { align-self: flex-end; }
.bubble.center { align-self: center; }
.bubble .tail { position: absolute; bottom: -12px; width: 18px; height: 12px; }
.bubble .tail::before, .bubble .tail::after { content: ""; position: absolute; left: 0; top: 0; border-style: solid; }
.bubble .tail::before { border-width: 12px 9px 0 9px; border-color: var(--ink) transparent transparent transparent; top: 1px; }
.bubble .tail::after { border-width: 9px 6px 0 6px; border-color: #fff transparent transparent transparent; left: 3px; top: -1px; }
.bubble.plane .tail::after { border-top-color: #fff8d6; }

.tryit { margin-top: 1.2rem; background: #ecfdf5; border: 2.5px dashed #16a34a; border-radius: 16px; padding: 1rem 1.2rem; font-size: 1rem; }
.quiz { margin-top: 1.2rem; background: #f8fafc; border: 2.5px solid var(--ink); border-radius: 16px; padding: 1rem 1.2rem; }
.quiz h4 { margin: 0 0 .6rem; color: var(--navy); }
.q { margin-bottom: .8rem; }
.q p { margin: 0 0 .4rem; font-weight: 600; }
.opts { display: flex; gap: .5rem; flex-wrap: wrap; }
.opts button { font: inherit; font-size: .95rem; padding: .45rem .9rem; border-radius: 12px; border: 2px solid var(--ink); background: #fff; cursor: pointer; font-weight: 600; }
.opts button:hover { background: #fff8d6; }
.opts button.ok { background: #bbf7d0; border-color: #15803d; }
.opts button.bad { background: #fecaca; border-color: #b91c1c; text-decoration: line-through; }
.q-result { font-weight: 800; color: #15803d; font-size: 1.1rem; }

/* игри */
.k-games { background: linear-gradient(180deg, #e9f8ff, #fff); }
.game { background: #fff; border: 3px solid var(--ink); border-radius: 22px; box-shadow: 6px 6px 0 var(--ink); padding: 1.4rem; margin-bottom: 2rem; }
.game h3 { margin: 0 0 .3rem; color: var(--navy); font-size: 1.45rem; }
.game > p { margin: 0 0 1rem; color: #4b5563; }
.parts-wrap { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.4rem; align-items: center; }
#partsSvg { width: 100%; background: #e0f2fe; border-radius: 16px; border: 2.5px solid var(--ink); }
#partsSvg [data-part] { cursor: pointer; transition: filter .15s; }
#partsSvg [data-part]:hover { filter: brightness(1.12) drop-shadow(0 0 3px #3CB4E5); }
#partsSvg .hl { fill: #4ade80 !important; }
#partsSvg .wrong { fill: #f87171 !important; }
.parts-info { background: #fff8d6; border: 2.5px solid var(--ink); border-radius: 16px; padding: 1rem; min-height: 120px; font-size: 1.05rem; line-height: 1.5; }
.parts-info .big { font-size: 1.4rem; color: var(--navy); }
.btn-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }

.sim-grid { display: grid; grid-template-columns: 260px 1fr; gap: 1.4rem; }
.stick-pad { position: relative; aspect-ratio: 1; background: radial-gradient(circle, #f1f5f9 0 55%, #e2e8f0 56%); border: 3px solid var(--ink); border-radius: 22px; touch-action: none; cursor: grab; user-select: none; }
.stick-pad::before, .stick-pad::after { content: ""; position: absolute; background: #cbd5e1; }
.stick-pad::before { left: 50%; top: 8%; bottom: 8%; width: 2px; }
.stick-pad::after { top: 50%; left: 8%; right: 8%; height: 2px; }
.stick-pad span { position: absolute; font-size: .72rem; font-weight: 800; color: #475569; }
.stick-knob { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #4b5563, #111827); border: 3px solid var(--ink); z-index: 2; pointer-events: none; }
.pedal-box { margin-top: 1rem; }
.pedal-box label { font-weight: 800; font-size: .9rem; display: flex; justify-content: space-between; }
.pedal-box input { width: 100%; accent-color: #0ea5e9; }
.sim-views { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.sim-view { background: linear-gradient(#7cc8f0, #d9f1fc); border: 2.5px solid var(--ink); border-radius: 14px; overflow: hidden; position: relative; aspect-ratio: 4/3; }
.sim-view svg { width: 100%; height: 100%; display: block; }
.sim-view b { position: absolute; left: 8px; top: 6px; background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: .05rem .5rem; font-size: .75rem; }
#simTop { background: #e0f2fe; }
#pF, #pS { transition: transform .15s; }
#pT { transition: transform .2s; }
.sim-msg { margin-top: .8rem; background: #fff8d6; border: 2.5px solid var(--ink); border-radius: 14px; padding: .8rem 1rem; min-height: 64px; }
.missions { list-style: none; padding: 0; margin: .8rem 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: .3rem .8rem; font-weight: 600; font-size: .95rem; }
.missions li.ok { color: #15803d; }
.legend { font-size: .82rem; color: #475569; margin-top: .4rem; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1.5px solid var(--ink); vertical-align: -1px; margin: 0 .2rem 0 .6rem; }

.radio-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.radio-row input { font: inherit; font-size: 1.2rem; padding: .55rem .9rem; border: 2.5px solid var(--ink); border-radius: 14px; flex: 1 1 220px; min-width: 0; }
.nato { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .8rem; }
.nato-card { background: var(--sun); border: 2.5px solid var(--ink); border-radius: 14px; padding: .4rem .8rem; text-align: center; box-shadow: 3px 3px 0 var(--ink); animation: pop .35s both; }
.nato-card span { display: block; font-size: 1.6rem; font-weight: 900; line-height: 1; }
.nato-card b { font-size: .9rem; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.nato-table { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .3rem; margin-top: 1rem; font-size: .9rem; color: #374151; }
.nato-table b { display: inline-block; width: 1.2em; color: #0369a1; }

/* книжка */
.logbook-wrap { background: #1a365d; color: #fff; border-radius: 22px; padding: 1.5rem; border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); }
.logbook-wrap h3 { margin: 0; color: #fff; }
.logbook { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: .8rem; margin: 1rem 0; }
.stamp { text-align: center; }
.stamp span { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto .3rem; border-radius: 50%; border: 3px dashed rgba(255,255,255,.4); font-weight: 900; font-size: 1.3rem; color: rgba(255,255,255,.5); }
.stamp.on span { background: var(--c); border: 3px solid #fff; color: #fff; transform: rotate(-8deg); box-shadow: 0 0 0 3px var(--c); }
.stamp small { font-size: .72rem; line-height: 1.2; display: block; opacity: .85; }
.cert-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.cert-row input { font: inherit; padding: .5rem .8rem; border-radius: 12px; border: 2.5px solid var(--ink); min-width: 0; flex: 1 1 200px; }
.link-btn { background: none; border: 0; color: #93c5fd; text-decoration: underline; cursor: pointer; font: inherit; font-size: .85rem; }

/* лекции */
.lecture { background: #fff; border: 3px solid var(--ink); border-radius: 18px; padding: 1rem 1.2rem; margin-bottom: 1rem; box-shadow: 4px 4px 0 var(--ink); }
.lecture header { display: flex; gap: .9rem; align-items: center; }
.lecture h3 { margin: .25rem 0 0; color: var(--navy); font-size: 1.25rem; }
.lk-emoji { font-size: 2.2rem; width: 56px; height: 56px; display: grid; place-items: center; background: #e0f2fe; border-radius: 16px; border: 2.5px solid var(--ink); flex: none; }
.lk-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .9rem; }
.lk-actions .kbtn { font-size: .85rem; padding: .4rem .8rem; }
.lk-body { margin-top: 1rem; border-top: 2px dashed #cbd5e1; padding-top: 1rem; }
.lk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.lk-grid h4 { margin: .8rem 0 .4rem; color: var(--navy); }
.lk-grid h4:first-child { margin-top: 0; }
.lk-grid ul, .lk-grid ol { margin: 0; padding-left: 1.2rem; }
.lk-grid li { margin-bottom: .25rem; }
.lk-plan { border-collapse: collapse; width: 100%; font-size: .92rem; }
.lk-plan td { border-bottom: 1px solid #e5e7eb; padding: .35rem .4rem; vertical-align: top; }
.lk-plan td:first-child { white-space: nowrap; font-weight: 800; color: #0369a1; width: 80px; }
.k-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.6rem; }
.k-info div { background: #fff8d6; border: 2.5px solid var(--ink); border-radius: 16px; padding: .9rem 1rem; }
.k-info b { display: block; color: var(--navy); margin-bottom: .2rem; }
.k-cta { background: var(--sun); border: 3px solid var(--ink); border-radius: 22px; padding: 1.5rem; box-shadow: 6px 6px 0 var(--ink); display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.k-cta h3 { margin: 0 0 .3rem; color: var(--navy); }
.k-cta p { margin: 0; }

/* презентация */
.presenter { position: fixed; inset: 0; z-index: 10000; background: #0f172a; display: none; flex-direction: column; }
.presenter.open { display: flex; }
.p-top { display: flex; align-items: center; gap: .6rem; padding: .5rem .8rem; color: #e2e8f0; font-size: .9rem; }
.p-top #pTitle { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-top button { font: inherit; background: #1e293b; color: #fff; border: 1px solid #334155; border-radius: 10px; padding: .35rem .7rem; cursor: pointer; }
.p-top button:hover { background: #334155; }
.p-bar { height: 4px; background: #1e293b; }
.p-bar i { display: block; height: 100%; background: var(--sun, #ffd23f); width: 0; transition: width .2s; }
.p-stage-wrap { flex: 1; display: grid; place-items: center; padding: 1rem; min-height: 0; }
.p-stage { width: min(100%, calc((100vh - 140px) * 16 / 9)); aspect-ratio: 16/9; background: #fffdf5; border-radius: 14px; overflow: hidden; position: relative; container-type: inline-size; cursor: pointer; color: #1f2937; }
.p-nav { display: flex; justify-content: center; gap: 1rem; padding: .5rem; }
.p-nav button { font: inherit; font-weight: 800; background: #ffd23f; border: 0; border-radius: 12px; padding: .5rem 1.4rem; cursor: pointer; }
.p-notes { background: #1e293b; color: #e2e8f0; padding: .7rem 1rem; font-size: .95rem; max-height: 22vh; overflow: auto; }
.p-notes .muted { color: #94a3b8; }
.sl { position: absolute; inset: 0; }
.sl h2 { font-size: 5cqw; line-height: 1.1; margin: 0 0 2.5cqw; color: #1a365d; font-weight: 900; }
.sl-title .sl-art { position: absolute; inset: 0; }
.sl-title .sl-cap { position: absolute; left: 4cqw; bottom: 4cqw; right: 4cqw; background: rgba(255,255,255,.92); border: .4cqw solid #1f2937; border-radius: 2cqw; padding: 2cqw 3cqw; box-shadow: .6cqw .6cqw 0 #1f2937; }
.sl-title h2 { margin: 0; font-size: 5.6cqw; }
.sl-title p { margin: .6cqw 0 0; font-size: 2.2cqw; color: #475569; font-weight: 700; }
.sl-bul { display: grid; grid-template-columns: 1fr 1fr; gap: 3cqw; padding: 4cqw; align-items: center; }
.sl-bul ul { margin: 0; padding-left: 3cqw; font-size: 2.9cqw; line-height: 1.35; }
.sl-bul li { margin-bottom: 1.4cqw; }
.sl-bul .sl-art { aspect-ratio: 400/260; border: .4cqw solid #1f2937; border-radius: 1.6cqw; overflow: hidden; }
.sl-full { padding: 3cqw 4cqw; display: flex; flex-direction: column; }
.sl-full h2 { font-size: 4cqw; margin-bottom: 1.5cqw; }
.sl-full .sl-art { flex: 1; border: .4cqw solid #1f2937; border-radius: 1.6cqw; overflow: hidden; min-height: 0; }
.sl-panel { display: grid; place-items: center; background: #1f2937; }
.sl-panel .cpanel { height: 100%; width: auto; aspect-ratio: 400/260; border: 0; border-radius: 0; }
.sl-quiz { padding: 3.5cqw 5cqw; }
.sl-quiz h2 { font-size: 3.8cqw; }
.sl-quiz ol { margin: 0; padding-left: 3cqw; font-size: 2.4cqw; }
.sl-quiz li { margin-bottom: 1.8cqw; }
.sl-quiz p { margin: 0 0 .7cqw; font-weight: 700; }
.sq-opts { display: flex; gap: 1.4cqw; flex-wrap: wrap; }
.sq-opts span { background: #fff; border: .25cqw solid #1f2937; border-radius: 1cqw; padding: .4cqw 1.2cqw; }
.sq-opts span.ok { background: #bbf7d0; border-color: #15803d; font-weight: 800; }
.sl-quiz .kbtn { font-size: 1.8cqw; background: #ffd23f; border: .25cqw solid #1f2937; padding: .6cqw 1.6cqw; border-radius: 1cqw; box-shadow: .3cqw .3cqw 0 #1f2937; margin-top: .5cqw; }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 30px); background: #1a365d; color: #fff; padding: .7rem 1.2rem; border-radius: 14px; font-weight: 700; opacity: 0; pointer-events: none; transition: .25s; z-index: 10001; border: 2px solid #ffd23f; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* печат */
#printArea { display: none; }
@media print {
  body.print-mode > *:not(#printArea) { display: none !important; }
  body.print-mode #printArea { display: block !important; }
  .print-lecture { font-family: Inter, sans-serif; color: #000; font-size: 11pt; }
  .print-lecture h1 { font-size: 18pt; margin: 0 0 4pt; }
  .print-lecture .lk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14pt; }
  .cert { width: 100%; height: 95vh; display: grid; place-items: center; font-family: Inter, sans-serif; }
  .cert-in { border: 6px double #1a365d; padding: 28pt; text-align: center; width: 90%; }
  @page { margin: 12mm; }
}
.cert-top { font-weight: 700; color: #475569; letter-spacing: .05em; }
.cert h1 { font-size: 40pt; margin: 6pt 0 0; color: #1a365d; letter-spacing: .1em; }
.cert h2 { font-size: 22pt; margin: 0 0 14pt; color: #b45309; }
.cert-name { font-size: 30pt; font-weight: 900; border-bottom: 2px solid #1a365d; display: inline-block; padding: 0 30pt 4pt; margin: 6pt 0 12pt; }
.cert-list { font-size: 10pt; color: #374151; max-width: 80%; margin: 0 auto; }
.cert-art { width: 260px; margin: 14pt auto; aspect-ratio: 400/260; border-radius: 12px; overflow: hidden; }
.cert-sign { display: flex; justify-content: space-between; margin-top: 18pt; font-weight: 700; }

@media (max-width: 980px) {
  .k-hero-grid, .parts-wrap, .sim-grid, .lk-grid { grid-template-columns: 1fr; }
  .cast { grid-template-columns: repeat(2, 1fr); }
  .cast-card:last-child { grid-column: span 2; }
  .k-info { grid-template-columns: 1fr; }
  .sim-grid { max-width: 640px; }
  .stick-pad { max-width: 240px; margin: 0 auto; }
}
@media (max-width: 640px) {
  .kids section { padding: 2rem 0; }
  .comic-grid { grid-template-columns: 1fr; }
  .sim-views { grid-template-columns: 1fr 1fr; }
  .missions { grid-template-columns: 1fr; }
  .comic-view, .game { padding: 1rem; }
  .cast { grid-template-columns: 1fr 1fr; gap: .7rem; }
  .p-stage-wrap { padding: .3rem; }
}

/* презентация/четене на телефон в портрет */
@media (max-aspect-ratio: 1/1) {
  .p-stage-wrap { align-items: stretch; padding: .4rem; }
  .p-stage { width: 100%; height: 100%; aspect-ratio: auto; }
  .sl h2 { font-size: 24px; }
  .sl-title .sl-cap { left: 12px; right: 12px; bottom: 12px; padding: 12px 14px; border-width: 2.5px; border-radius: 14px; box-shadow: 3px 3px 0 #1f2937; }
  .sl-title h2 { font-size: 26px; }
  .sl-title p { font-size: 14px; margin-top: 4px; }
  .sl-bul { grid-template-columns: 1fr; padding: 16px; align-content: center; gap: 14px; }
  .sl-bul ul { font-size: 17px; padding-left: 20px; }
  .sl-bul li { margin-bottom: 6px; }
  .sl-bul .sl-art, .sl-full .sl-art { border-width: 2.5px; border-radius: 12px; }
  .sl-full { padding: 16px; justify-content: center; }
  .sl-full h2 { font-size: 22px; margin-bottom: 10px; }
  .sl-full .sl-art { flex: none; aspect-ratio: 400/260; }
  .sl-panel .cpanel { width: 100%; height: auto; }
  .sl-quiz { padding: 16px; overflow: auto; }
  .sl-quiz h2 { font-size: 20px; margin-bottom: 10px; }
  .sl-quiz ol { font-size: 15px; padding-left: 20px; }
  .sl-quiz li { margin-bottom: 12px; }
  .sl-quiz p { margin-bottom: 5px; }
  .sq-opts { gap: 6px; }
  .sq-opts span { padding: 3px 9px; border-width: 1.5px; border-radius: 8px; }
  .sl-quiz .kbtn { font-size: 14px; padding: 6px 12px; border-width: 2px; border-radius: 10px; box-shadow: 2px 2px 0 #1f2937; }
}

/* дисциплини и нови игри */
.disc-filter { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.2rem; }
.chip { font: inherit; font-size: .85rem; font-weight: 700; padding: .35rem .8rem; border-radius: 999px; border: 2px solid var(--ink); background: #fff; cursor: pointer; }
.chip.on { background: var(--navy); color: #fff; }
.cc-disc { display: block; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--c); margin-bottom: .2rem; }
.game > .pill { margin-bottom: .4rem; }
.nav-wrap, .dec-wrap, .bal-wrap, .ck-wrap { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.4rem; align-items: start; }
#navSvg { width: 100%; border: 2.5px solid var(--ink); border-radius: 14px; background: #f1f5d8; }
.nav-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin: .8rem 0; max-width: 300px; }
.nav-pad .kbtn { padding: .45rem .3rem; font-size: .85rem; }
.nav-c { display: grid; place-items: center; font-weight: 800; color: #64748b; font-size: .8rem; }
.nav-cmds { display: flex; flex-wrap: wrap; gap: .3rem; min-height: 32px; }
.nav-cmds span { background: #e0f2fe; border: 1.5px solid var(--ink); border-radius: 8px; padding: .1rem .45rem; font-weight: 700; font-size: .85rem; }
.nav-cmds em { color: #64748b; font-size: .9rem; }
.dec-art { aspect-ratio: 400/260; border: 2.5px solid var(--ink); border-radius: 14px; overflow: hidden; }
.dec-art svg { width: 100%; height: 100%; display: block; }
.dec-q { font-size: 1.05rem; line-height: 1.5; margin-bottom: .8rem; }
.dec-q .why { margin-top: .6rem; background: #fff8d6; border: 2px solid var(--ink); border-radius: 12px; padding: .6rem .8rem; font-size: .98rem; }
.dec-opts button { font-size: 1rem; }
.dec-opts .kbtn { background: var(--sun); }
.bal-row { display: block; font-weight: 700; margin-bottom: .8rem; }
.bal-row b { float: right; color: #0369a1; }
.bal-row select, .bal-row input[type=range] { display: block; width: 100%; margin-top: .3rem; font: inherit; }
.bal-row select { padding: .4rem; border: 2px solid var(--ink); border-radius: 10px; background: #fff; }
.bal-row input[type=range] { accent-color: #d97706; }
.bal-lbl { font-weight: 800; font-size: .85rem; margin: .6rem 0 .3rem; }
.mass-bar, .cg-bar { position: relative; height: 26px; background: #f1f5f9; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; }
.mfill { position: absolute; left: 0; top: 0; bottom: 0; background: #22c55e; transition: width .2s; }
.mfill.over { background: #ef4444; }
.mmax { position: absolute; top: 0; bottom: 0; width: 3px; background: var(--ink); }
.cg-bar .bz { position: absolute; top: 0; bottom: 0; background: #bbf7d0; }
.cg-bar .bp { position: absolute; top: 2px; bottom: 2px; width: 6px; margin-left: -3px; background: var(--navy); border-radius: 3px; transition: left .2s; }
.cg-bar .bl, .cg-bar .br { position: absolute; top: 3px; font-size: .7rem; font-weight: 700; color: #64748b; }
.cg-bar .bl { left: 6px; } .cg-bar .br { right: 6px; }
.bad-t { color: #b91c1c; } .ok-t { color: #15803d; }
.ck-dials svg { width: 100%; display: block; border: 2.5px solid var(--ink); border-radius: 14px; margin-bottom: 1rem; }
.ck-air { position: relative; height: 170px; border: 2.5px solid var(--ink); border-radius: 14px; background: linear-gradient(#bae6fd, #e0f2fe); overflow: hidden; }
.ck-air i { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #2563eb; opacity: .6; }
.ck-air::after { content: "въздух около самолета"; position: absolute; left: 8px; bottom: 6px; font-size: .75rem; font-weight: 800; color: #0369a1; }
.ck-read { margin-top: .6rem; font-size: 1.02rem; }
@media (max-width: 980px) { .nav-wrap, .dec-wrap, .bal-wrap, .ck-wrap { grid-template-columns: 1fr; } }


/* подредба: подменю, каталог, демо достъп */
.kids section[id] { scroll-margin-top: 170px; }
.k-subnav { position: sticky; top: 110px; z-index: 50; display: flex; justify-content: center; gap: .4rem; flex-wrap: wrap; background: var(--navy); padding: .55rem 1rem; }
.k-subnav a { color: #fff; text-decoration: none; font-weight: 800; font-size: .95rem; padding: .3rem .9rem; border-radius: 999px; }
.k-subnav a:hover { background: var(--sun); color: var(--navy); }
.disc-h { grid-column: 1 / -1; margin: .8rem 0 -.2rem; color: var(--navy); font-size: 1.15rem; font-weight: 900; border-bottom: 2.5px solid var(--ink); padding-bottom: .25rem; }
.disc-h:first-child { margin-top: 0; }
.game-catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.2rem; }
.game-card { --c: #3CB4E5; font: inherit; text-align: left; padding: 0; background: #fff; border: 3px solid var(--ink); border-radius: 18px; overflow: hidden; cursor: pointer; box-shadow: 5px 5px 0 var(--ink); transition: transform .12s; }
.game-card:hover { transform: translateY(-3px); }
.game-card.on { box-shadow: 5px 5px 0 var(--sun); outline: 3px solid var(--sun); }
.game-card .cc-body h3 { margin: 0 0 .2rem; font-size: 1.1rem; color: var(--navy); }
.game-card .cc-body p { margin: 0; font-size: .85rem; color: #6b7280; }
.game { display: none; margin-top: 2rem; scroll-margin-top: 170px; }
.game.open { display: block; }
.pill.demo { background: var(--sun); color: var(--navy); margin-left: .35rem; }
.lk-access { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; background: #fff8d6; border: 2.5px solid var(--ink); border-radius: 16px; padding: .9rem 1.1rem; margin-bottom: 1.4rem; }
.lk-access.on { background: #dcfce7; }
.lk-access form { display: flex; gap: .5rem; flex-wrap: wrap; flex: 0 1 430px; }
.lk-access input { font: inherit; flex: 1 1 200px; min-width: 0; padding: .5rem .8rem; border: 2.5px solid var(--ink); border-radius: 12px; }
.lk-err { flex-basis: 100%; margin: 0; color: #b91c1c; font-weight: 700; }
.lk-err:empty { display: none; }
.lk-lock { margin: .8rem 0 0; font-weight: 700; color: #475569; }
@media (max-width: 980px) { .k-subnav { top: 90px; } }
@media print { .k-subnav { display: none !important; } }
/* body с overflow:hidden пречи на sticky; clip пази страницата без хоризонтално скролиране */
body:has(main.kids) { overflow-x: clip; overflow-y: visible; }

/* печат на плана за лектора: колоните не бива да излизат извън листа */
@media print {
  #printArea, .print-lecture { width: 100%; max-width: 100%; box-sizing: border-box; overflow: visible; }
  .print-lecture .lk-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16pt; }
  .print-lecture .lk-grid > div { min-width: 0; overflow-wrap: break-word; }
  .print-lecture .lk-plan { table-layout: fixed; width: 100%; }
  .print-lecture .lk-plan td:first-child { width: 58pt; white-space: normal; }
  .print-lecture li, .print-lecture .lk-plan tr { break-inside: avoid; }
}
.lk-plan td + td { white-space: normal !important; overflow: visible; overflow-wrap: break-word; }
@media print { .print-lecture .lk-plan td:first-child { width: 68pt; white-space: nowrap; } }

/* споделяне като история */
.kbtn.story { background: #1877f2; color: #fff; }
.share-game { float: right; margin: -2.6rem 0 .4rem .6rem; font-size: .9rem; }
@media (max-width: 600px) { .share-game { float: none; margin: .2rem 0 .6rem; } }
.story-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 10050; background: rgba(15, 23, 42, .72); display: none; align-items: center; justify-content: center; padding: 16px; }
.story-modal.open { display: flex; }
.story-box { position: relative; background: #fff; border: 3px solid var(--ink, #1f2937); border-radius: 22px; padding: 1.2rem; width: 100%; max-width: 460px; max-height: 94vh; overflow: auto; }
.story-box h3 { margin: 0 2rem .8rem 0; color: #1a365d; font-size: 1.2rem; }
.story-x { position: absolute; top: 10px; right: 10px; border: 0; background: #f1f5f9; border-radius: 50%; width: 36px; height: 36px; font-size: 1rem; cursor: pointer; }
.story-prev { text-align: center; background: #f1f5f9; border-radius: 14px; padding: .6rem; min-height: 120px; }
.story-prev img { max-width: 100%; max-height: 52vh; border-radius: 10px; box-shadow: 0 4px 14px rgba(0, 0, 0, .2); }
.story-btns { display: flex; flex-wrap: wrap; margin: .8rem -.3rem 0; }
.story-btns .kbtn { margin: .3rem; text-decoration: none; }
.story-hint { font-size: .85rem; color: #475569; margin: .8rem 0 0; }
.story-url { word-break: break-all; color: #0369a1; }
/* полет с планер */
.glide-box { max-width: 760px; border: 3px solid var(--ink, #1f2937); border-radius: 16px; overflow: hidden; background: #e0f4fd; }
.glide-box svg { display: block; width: 100%; height: auto; }
.glide-info { min-height: 3em; margin: .8rem 0; font-size: 1.05rem; }
.glide-ctl .kbtn { margin: 0 .5rem .5rem 0; }
#glideCircle { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }

/* телефон: картинката цяла, репликите под нея с четим шрифт */
@media (max-width: 600px) {
  .comic-grid .cpanel { aspect-ratio: auto; height: auto !important; container-type: normal; }
  .comic-grid .cpanel > svg { position: relative; width: 100%; height: auto; }
  .comic-grid .cp-cap { font-size: 13px; }
  .comic-grid .cp-bubbles, .comic-grid .cp-bubbles.has-cap { position: static; flex-direction: column; padding: 8px; background: #fffdf5; border-top: 3px solid var(--ink); }
  .comic-grid .cp-bubbles > .bubble { max-width: 92% !important; font-size: 15px; margin-bottom: 6px; }
  .comic-grid .cp-bubbles.row > .bubble { max-width: 92%; }
  .comic-grid .cp-bubbles > .bubble:nth-child(even) { align-self: flex-end; }
  .comic-grid .cp-bubbles > .bubble:nth-child(odd) { align-self: flex-start; }
  .comic-grid .bubble .tail { display: none; }
  .comic-grid .cp-bubbles:empty { display: none; }
}
