/* Большая игра «Агенты будущего» — мобайл-ферст.
   Токены — из брендбука (стайлгайд/брендбук/brand-tokens.css): палитра сайта, Manrope. */
:root {
  --night:#0D1B2A; --deep:#06111C; --surface:#142638; --raised:#1B2F46; --line:#22344E;
  --text:#E8EDF2; --text-2:#A9BDD0; --muted:#7F95AB;
  --light:#F4F7FA; --ink:#16202E; --ink-2:#52627A;
  --sky:#5DADE2; --sky-300:#85C1E9; --orange:#E67E22; --orange-h:#F08C34;
  --ok:#27AE60; --ok-bg:rgba(39,174,96,.16); --no:#E0654A; --no-bg:rgba(224,101,74,.14);
  --self:#3498DB; --self-300:#8FC6EB; --self-bg:rgba(23,68,99,.55);
  --act:#E67E22;  --act-300:#F1B885;  --act-bg:rgba(103,57,15,.55);
  --inter:#9B59B6; --inter-300:#C8A4D7; --inter-bg:rgba(70,40,82,.6);
  --think:#27AE60; --think-300:#88D2A8; --think-bg:rgba(18,78,43,.55);
  --font:'Manrope', system-ui, sans-serif; --mono:ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing:border-box; margin:0; padding:0; -webkit-tap-highlight-color:transparent }
html, body { background:var(--night); color:var(--text) }
body { font-family:var(--font); font-size:16px; line-height:1.5; min-height:100dvh }
button { font:inherit; color:inherit; cursor:pointer; border:0; background:none }
input { font:inherit; color:inherit }
img { display:block; max-width:100% }
#app { max-width:480px; margin:0 auto; min-height:100dvh; display:flex; flex-direction:column; position:relative }
.screen { flex:1; display:flex; flex-direction:column; padding:16px 16px calc(20px + var(--safe-b)); gap:16px; animation:in .3s ease }
@keyframes in { from { opacity:0; transform:translateY(8px) } to { opacity:1; transform:none } }
.grow { flex:1 }
.center { text-align:center }
:focus-visible { outline:2px solid var(--sky); outline-offset:2px }

/* типографика */
.label { font-size:12px; font-weight:800; letter-spacing:.14em; text-transform:uppercase; color:var(--sky) }
.dossier { font-family:var(--mono); font-size:11px; font-weight:600; letter-spacing:.1em; text-transform:uppercase; color:var(--text-2) }
h1 { font-size:30px; line-height:1.1; font-weight:800; letter-spacing:-.01em }
h2 { font-size:23px; line-height:1.2; font-weight:800 }
.lead { font-size:17px; color:var(--text-2) }
.small { font-size:14px; color:var(--text-2) }
.accent { color:var(--sky) }
.orange { color:var(--orange) }

/* кнопки */
.btn { display:flex; align-items:center; justify-content:center; gap:10px; width:100%; min-height:56px; padding:0 22px; border-radius:999px; font-weight:800; font-size:17px; transition:transform .1s, opacity .2s, background .2s }
.btn:active { transform:scale(.98) }
.btn-primary { background:var(--orange); color:#fff; box-shadow:0 10px 24px rgba(230,126,34,.35) }
.btn-primary:hover { background:var(--orange-h) }
.btn-primary:disabled { opacity:.4; box-shadow:none }
.btn-ghost { border:1.5px solid var(--line); background:var(--surface) }
.btn-vk { background:#0077FF; color:#fff } .btn-vk:disabled { opacity:.45 }
.link { color:var(--sky); font-weight:700; padding:8px }
.back { align-self:flex-start; display:inline-flex; align-items:center; gap:6px; color:var(--text-2); font-weight:700; padding:6px 0 }

/* шапка: знак, номер агента, очки, звук */
.hud { display:flex; align-items:center; gap:10px; min-height:40px }
.hud .znak { width:30px; height:30px; flex:none }
.hud .who { display:flex; flex-direction:column; line-height:1.1 }
.hud .who b { font-size:14px } .hud .who span { font-size:11px; color:var(--muted) }
.hud .pts { margin-left:auto; display:flex; align-items:center; gap:6px; background:var(--surface); border:1px solid var(--line); border-radius:999px; padding:6px 12px 6px 8px; font-weight:800; font-variant-numeric:tabular-nums }
.hud .pts i { width:18px; height:18px; background:url(/assets/logo/znak.svg) center/contain no-repeat }
.hud .pts.bump { animation:bump .5s ease }
@keyframes bump { 30% { transform:scale(1.18); border-color:var(--orange) } }
.icon-btn { width:40px; height:40px; border-radius:50%; display:grid; place-items:center; background:var(--surface); border:1px solid var(--line); flex:none }
.icon-btn svg { width:20px; height:20px; fill:var(--text-2) }

/* поля */
.field { display:flex; flex-direction:column; gap:6px }
.field label { font-weight:700; font-size:14px }
.field .hint { font-size:13px; color:var(--muted) }
.input { width:100%; min-height:56px; padding:0 16px; border-radius:16px; border:1.5px solid var(--line); background:var(--surface); font-size:18px; font-weight:700; outline:none }
.input:focus { border-color:var(--sky); box-shadow:0 0 0 4px rgba(93,173,226,.18) }
.input.code { text-transform:uppercase; letter-spacing:.2em; text-align:center; font-size:22px }
.input.pin { letter-spacing:.6em; text-align:center; font-size:26px; font-weight:800 }
.nick-row { display:flex; gap:8px } .nick-row .input { flex:1 }
.dice { width:56px; flex:none; border-radius:16px; background:var(--raised); border:1.5px solid var(--line); display:grid; place-items:center; font-size:24px }
.dice svg { width:26px; height:26px; fill:var(--sky) }
.dice.roll svg { animation:roll .5s ease }
@keyframes roll { to { transform:rotate(360deg) } }
.error { color:var(--no); font-weight:700; font-size:14px; min-height:20px }
.chip-school { display:flex; gap:10px; align-items:center; padding:12px 14px; border-radius:14px; background:var(--ok-bg); color:var(--think-300); font-weight:700 }

/* старт */
.hero { border-radius:20px; overflow:hidden; aspect-ratio:4/3; background:var(--surface); position:relative }
.hero img { width:100%; height:100%; object-fit:cover }
.hero .corner { position:absolute; width:22px; height:22px; border:0 solid rgba(255,255,255,.85) }
.hero .c1 { left:10px; top:10px; border-left-width:2px; border-top-width:2px } .hero .c2 { right:10px; top:10px; border-right-width:2px; border-top-width:2px }
.hero .c3 { left:10px; bottom:10px; border-left-width:2px; border-bottom-width:2px } .hero .c4 { right:10px; bottom:10px; border-right-width:2px; border-bottom-width:2px }
.brand-logo { width:200px; height:auto }
.roles { display:flex; flex-direction:column; gap:10px }
.role { display:flex; align-items:center; gap:14px; text-align:left; padding:14px 16px; border-radius:20px; background:var(--surface); border:1px solid var(--line) }
.role b { display:block; font-size:17px } .role span { font-size:14px; color:var(--text-2) }

/* иконки навыков */
.sk { --c:var(--self); --c3:var(--self-300); --cb:var(--self-bg) }
.sk[data-c="act"] { --c:var(--act); --c3:var(--act-300); --cb:var(--act-bg) }
.sk[data-c="inter"] { --c:var(--inter); --c3:var(--inter-300); --cb:var(--inter-bg) }
.sk[data-c="think"] { --c:var(--think); --c3:var(--think-300); --cb:var(--think-bg) }
.sk-icon { width:44px; height:44px; border-radius:12px; background:var(--cb); border:1px solid color-mix(in srgb, var(--c) 45%, transparent); display:grid; place-items:center; flex:none }
.sk-icon i { width:24px; height:24px; background:var(--c3); -webkit-mask:var(--m) center/contain no-repeat; mask:var(--m) center/contain no-repeat }

/* удостоверение */
.issue { flex:1; display:flex; flex-direction:column; justify-content:center; gap:22px }
.idcard { position:relative; aspect-ratio:85.6/54; border-radius:20px; background:var(--deep); border:1px solid var(--line); overflow:hidden; padding:6%; display:grid; grid-template-columns:30% 1fr; gap:6%; box-shadow:0 24px 50px rgba(0,0,0,.45); container-type:inline-size }
.idcard::before { content:""; position:absolute; inset:0; background:radial-gradient(circle at 100% 0%, rgba(93,173,226,.32), transparent 52%), radial-gradient(circle at 0% 100%, rgba(230,126,34,.2), transparent 48%) }
.idcard > * { position:relative }
.idcard .ph { border-radius:12px; background:var(--surface); outline:2px solid var(--sky); outline-offset:3px; display:grid; place-items:center }
.idcard .ph img { width:70% }
.idcard .info { display:flex; flex-direction:column; justify-content:space-between; min-width:0 }
.idcard .top { display:flex; justify-content:space-between; align-items:center; gap:6px }
.idcard .lbl { font-family:var(--mono); font-size:2.7cqw; letter-spacing:.1em; color:var(--muted); text-transform:uppercase }
.idcard .no { font-weight:800; font-size:9cqw; line-height:1; letter-spacing:.01em }
.idcard .row { display:flex; gap:6cqw } .idcard .row b { display:block; font-size:4cqw; font-weight:800; white-space:nowrap }
.idcard .bars { display:flex; gap:1.4cqw } .idcard .bars i { flex:1; height:1.5cqw; border-radius:2px; background:var(--c); opacity:.22; transition:opacity .4s }
.idcard .bars i.on { opacity:1 }
.idcard .scan { position:absolute; left:0; right:0; height:3px; top:0; background:linear-gradient(90deg, transparent, var(--sky), transparent); box-shadow:0 0 18px var(--sky); animation:scan 1.6s ease-in-out 2 }
@keyframes scan { 50% { top:100% } 100% { top:0 } }
.idcard.printing .info > *, .idcard.printing .ph { opacity:0; animation:appear .4s ease forwards }
.idcard.printing .ph { animation-delay:.5s } .idcard.printing .top { animation-delay:.9s } .idcard.printing .noblk { animation-delay:1.3s }
.idcard.printing .row { animation-delay:1.8s } .idcard.printing .bars { animation-delay:2.2s }
@keyframes appear { from { opacity:0; transform:translateY(4px) } to { opacity:1; transform:none } }
.stamp-ok { align-self:center; transform:rotate(-8deg); border:3px solid var(--ok); color:var(--think-300); font-weight:800; padding:6px 14px; border-radius:6px; letter-spacing:.06em; text-transform:uppercase; font-size:15px; opacity:0; animation:stamp .35s 2.6s cubic-bezier(.2,1.6,.4,1) forwards }
@keyframes stamp { from { opacity:0; transform:rotate(-8deg) scale(1.8) } to { opacity:1; transform:rotate(-8deg) scale(1) } }

/* чат Искры */
.chat { flex:1; display:flex; flex-direction:column; gap:12px; overflow:auto; padding-bottom:8px }
.msg { display:flex; gap:10px; align-items:flex-end; animation:in .3s ease }
.msg .ava { width:34px; height:34px; border-radius:50%; background:var(--surface); border:1px solid var(--line); display:grid; place-items:center; flex:none }
.msg .ava img { width:20px }
.bubble { background:var(--surface); border:1px solid var(--line); border-radius:18px 18px 18px 6px; padding:12px 14px; max-width:84%; font-size:16px }
.bubble img { border-radius:12px; margin-top:10px; aspect-ratio:4/3; object-fit:cover; width:100% }
.msg.me { justify-content:flex-end } .msg.me .bubble { background:var(--raised); border-color:transparent; border-radius:18px 18px 6px 18px; color:var(--sky-300); font-weight:700 }
.typing { display:inline-flex; gap:4px; padding:4px 2px } .typing i { width:7px; height:7px; border-radius:50%; background:var(--text-2); animation:blink 1s infinite } .typing i:nth-child(2) { animation-delay:.15s } .typing i:nth-child(3) { animation-delay:.3s }
@keyframes blink { 50% { opacity:.25 } }
.skills-grid { display:grid; grid-template-columns:repeat(6,1fr); gap:6px; margin-top:10px }
.skills-grid .sk-icon { width:100%; height:auto; aspect-ratio:1; border-radius:10px } .skills-grid .sk-icon i { width:58%; height:58% }

/* задание */
.task-top { display:flex; align-items:center; gap:12px }
.progress { flex:1; height:8px; border-radius:4px; background:var(--surface); overflow:hidden }
.progress i { display:block; height:100%; background:var(--sky); border-radius:4px; transition:width .35s }
.task-n { font-weight:800; font-size:14px; color:var(--text-2); min-width:44px; text-align:right; font-variant-numeric:tabular-nums }
.streak { display:inline-flex; align-items:center; gap:6px; font-weight:800; font-size:13px; color:var(--orange); background:rgba(230,126,34,.14); border-radius:999px; padding:4px 10px; align-self:flex-start }
.situation { background:var(--surface); border:1px solid var(--line); border-radius:20px; overflow:hidden }
.situation .pic { position:relative }
.situation img { aspect-ratio:4/3; object-fit:cover; width:100%; background:var(--raised) }
.situation .tag { position:absolute; left:10px; top:10px; background:rgba(13,27,42,.82); color:#fff; padding:4px 8px; border-radius:4px }
.situation p { padding:14px 16px 16px; font-size:16px; font-weight:500 }
.q { font-weight:800; font-size:18px }
.options { display:grid; grid-template-columns:1fr 1fr; gap:10px }
.opt { display:flex; flex-direction:column; align-items:flex-start; gap:10px; padding:12px; min-height:110px; text-align:left; border-radius:18px; background:var(--surface); border:1.5px solid var(--line); font-weight:800; font-size:14px; line-height:1.2; transition:transform .1s, border-color .2s }
.opt:active { transform:scale(.97) }
.opt.wrong { opacity:.45; border-color:var(--no); background:var(--no-bg); text-decoration:line-through }
.opt.right { border-color:var(--ok); background:var(--ok-bg) }
.fly { position:fixed; z-index:30; font-weight:800; font-size:22px; color:var(--orange); pointer-events:none; animation:fly .9s ease-out forwards; text-shadow:0 2px 10px rgba(0,0,0,.5) }
@keyframes fly { to { transform:translateY(-70px); opacity:0 } }

/* лист с объяснением */
.sheet-back { position:fixed; inset:0; background:rgba(6,17,28,.6); animation:fade .2s ease; z-index:10 }
@keyframes fade { from { opacity:0 } }
.sheet { position:fixed; left:0; right:0; bottom:0; max-width:480px; margin:0 auto; background:var(--raised); z-index:11; border-radius:24px 24px 0 0; padding:20px 16px calc(20px + var(--safe-b)); display:flex; flex-direction:column; gap:14px; animation:up .28s cubic-bezier(.2,.8,.2,1); box-shadow:0 -10px 40px rgba(0,0,0,.4); border-top:1px solid var(--line) }
@keyframes up { from { transform:translateY(100%) } }
.sheet .verdict { display:flex; align-items:center; gap:12px }
.sheet .verdict b { font-size:20px; font-weight:800 }
.sheet.ok .verdict b { color:var(--think-300) } .sheet.no .verdict b { color:var(--no) }
.sheet .gain { margin-left:auto; font-weight:800; color:var(--orange); font-size:18px }
.sheet .why { font-size:16px; color:var(--text) }

/* итог */
.ring-wrap { position:relative; width:min(250px,70vw); aspect-ratio:1; margin:0 auto }
.ring-wrap svg { width:100%; height:100% }
.ring-wrap .seg { opacity:.15; transition:opacity .3s }
.ring-wrap .seg.on { opacity:1 }
.ring-wrap .mid { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center }
.ring-wrap .mid b { font-size:44px; font-weight:800; line-height:1; color:var(--orange); font-variant-numeric:tabular-nums }
.ring-wrap .mid span { font-size:13px; color:var(--text-2) }
.score { display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px }
.score div { background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:10px; text-align:center }
.score b { display:block; font-size:22px; font-weight:800; font-variant-numeric:tabular-nums } .score span { font-size:12px; color:var(--text-2) }
#confetti { position:fixed; inset:0; pointer-events:none; z-index:40 }

/* карта пути */
.path { position:relative; display:flex; flex-direction:column; gap:14px; padding-left:22px }
.path::before { content:""; position:absolute; left:21px; top:20px; bottom:20px; width:2px; background:repeating-linear-gradient(var(--line) 0 8px, transparent 8px 14px) }
.node { position:relative; display:flex; align-items:center; gap:14px; text-align:left; width:100%; padding:14px; border-radius:20px; background:var(--surface); border:1px solid var(--line) }
.node .dot { position:absolute; left:-22px; width:20px; height:20px; margin-left:-9px; border-radius:50%; background:var(--night); border:2px solid var(--line) }
.node.done .dot { background:var(--ok); border-color:var(--ok) }
.node.now { border-color:var(--orange); box-shadow:0 0 0 4px rgba(230,126,34,.15) } .node.now .dot { background:var(--orange); border-color:var(--orange); box-shadow:0 0 0 6px rgba(230,126,34,.25) }
.node.locked { opacity:.55 }
.node .ico { width:44px; height:44px; border-radius:12px; background:var(--raised); display:grid; place-items:center; flex:none }
.node .ico svg { width:24px; height:24px; fill:var(--sky) }
.node.now .ico svg { fill:var(--orange) } .node.done .ico svg { fill:var(--think-300) }
.node b { display:block; font-size:16px } .node span { font-size:13px; color:var(--text-2) }
.node .st { margin-left:auto; font-size:12px; font-weight:800; white-space:nowrap; color:var(--muted) }
.node.done .st { color:var(--think-300) } .node.now .st { color:var(--orange) }
.node.final { background:linear-gradient(160deg, var(--raised), var(--surface)) }
.foot-links { display:flex; justify-content:center; gap:16px }
@media (prefers-reduced-motion: reduce) { *, *::before { animation:none !important; transition:none !important } .idcard.printing .info > *, .idcard.printing .ph, .stamp-ok { opacity:1 } }

/* карта-тропа */
.map-head { display:flex; align-items:flex-end; justify-content:space-between; gap:12px }
.map-prog { text-align:right; line-height:1 } .map-prog b { font-size:30px; font-weight:800; color:var(--sky) } .map-prog span { display:block; font-size:12px; color:var(--text-2); margin-top:4px }
.trail { position:relative; display:flex; flex-direction:column; gap:6px; padding:8px 0 24px;
  background-image:radial-gradient(rgba(93,173,226,.10) 1px, transparent 1.4px); background-size:18px 18px; border-radius:24px }
.trail-line { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; overflow:visible }
.trail-line .tl-all { fill:none; stroke:var(--line); stroke-width:5; stroke-dasharray:2 12; stroke-linecap:round }
.trail-line .tl-done { fill:none; stroke:var(--sky); stroke-width:5; stroke-linecap:round; opacity:.85 }
.trail-line .tl-branch { fill:none; stroke:var(--sky); stroke-width:3; stroke-dasharray:2 9; stroke-linecap:round; opacity:.7 }
.trail-line .tl-branch.done { stroke-dasharray:none; opacity:.85 }
.sec { position:relative; z-index:1; display:flex; justify-content:center; margin:12px 0 4px }
.sec span { font-size:11px; font-weight:800; letter-spacing:.14em; text-transform:uppercase; color:var(--text-2); background:var(--night); border:1px solid var(--line); border-radius:999px; padding:5px 12px }
.stop { position:relative; z-index:1; height:118px }
.stop .station, .stop .cap, .stop .here { position:absolute; left:var(--x); transform:translateX(-50%) }
.station { width:74px; height:74px; top:4px; border-radius:50%; display:grid; place-items:center; background:var(--surface); border:3px solid var(--line); box-shadow:0 6px 0 var(--deep); transition:transform .12s }
.station:active { transform:translateX(-50%) translateY(3px) !important; box-shadow:0 3px 0 var(--deep) }
.station svg { width:32px; height:32px; fill:var(--muted) }
.station .sk-icon { background:none; border:0; width:40px; height:40px } .station .sk-icon i { width:34px; height:34px }
.stop.done .station { background:var(--raised); border-color:var(--sky) } .stop.done .station svg { fill:var(--sky-300) }
.stop.now .station { background:var(--orange); border-color:#FFB46B; box-shadow:0 6px 0 #9A4E10, 0 0 0 0 rgba(230,126,34,.6); animation:pulse 1.8s infinite }
.stop.now .station svg { fill:#fff } .stop.now .station .sk-icon i { background:#fff }
@keyframes pulse { 0% { box-shadow:0 6px 0 #9A4E10, 0 0 0 0 rgba(230,126,34,.55) } 70% { box-shadow:0 6px 0 #9A4E10, 0 0 0 18px rgba(230,126,34,0) } 100% { box-shadow:0 6px 0 #9A4E10, 0 0 0 0 rgba(230,126,34,0) } }
.stop.locked .station > svg, .stop.locked .station > .sk-icon { opacity:.5 } /* сам круг непрозрачный: линия пути не просвечивает */
.stop.locked .station { border-color:color-mix(in srgb, var(--line) 70%, var(--night)) } .stop.locked .station .sk-icon { filter:grayscale(.6) }
.stop.final .station { width:90px; height:90px; border-radius:24px; top:0 } .stop.final { height:132px }
.badge { position:absolute; right:-4px; top:-4px; width:26px; height:26px; border-radius:50%; display:grid; place-items:center; border:2px solid var(--night) }
.badge svg { width:14px !important; height:14px !important } .badge.ok { background:var(--ok) } .badge.ok svg { fill:#fff !important }
.badge.lock { background:var(--raised) } .badge.lock svg { fill:var(--text-2) !important }
/* ветка вбок от станции: строка нулевой высоты, станция поднята на уровень родителя */
.stop.branch { height:0; margin-top:-6px }
.stop.branch .station { width:58px; height:58px; top:-107px; border-style:dashed; box-shadow:0 4px 0 var(--deep) }
.stop.branch .station svg { width:26px; height:26px }
.stop.branch .cap { top:-41px; width:120px }
.stop.branch.open .station { border-color:var(--sky); border-style:solid } .stop.branch.open .station svg { fill:var(--sky-300) }
.stop.branch.open .cap b { color:var(--sky-300) }
.stop.branch.done .station { border-style:solid }
.badge.plus { background:var(--sky); color:var(--night); font-size:16px; font-weight:800; line-height:1 }
.cap { top:86px; text-align:center; width:150px; line-height:1.15 } .stop.final .cap { top:100px }
.cap b { display:block; font-size:13px; font-weight:800 } .cap span { font-size:11px; color:var(--text-2) }
.stop.now .cap b { color:var(--orange) }
.here { top:-26px; background:var(--orange); color:#fff; font-size:11px; font-weight:800; padding:3px 9px; border-radius:999px; animation:bob 1.6s ease-in-out infinite }
.here::after { content:""; position:absolute; left:50%; bottom:-5px; margin-left:-5px; border:5px solid transparent; border-top-color:var(--orange); border-bottom:0 }
@keyframes bob { 50% { transform:translateX(-50%) translateY(-4px) } }
.sheet.step .verdict b { font-size:19px }
.station.mini { position:static; transform:none; width:48px; height:48px; border-width:2px; box-shadow:none; animation:none; flex:none }
.station.mini svg { width:22px; height:22px } .station.mini .sk-icon { width:28px; height:28px } .station.mini .sk-icon i { width:24px; height:24px }

/* сканер */
.scan-hero { position:relative; height:200px; display:grid; place-items:center; border-radius:20px; overflow:hidden; background:radial-gradient(circle at 50% 50%, rgba(93,173,226,.18), transparent 60%), var(--deep); border:1px solid var(--line) }
.ringbox { position:relative; width:160px; height:160px } .ringbox svg { width:100%; height:100% } .ringbox .seg { opacity:.15; transition:opacity .3s } .ringbox .seg.on { opacity:1 }
.ringbox img { position:absolute; inset:34%; width:32% }
.scanline { position:absolute; left:0; right:0; height:2px; background:linear-gradient(90deg, transparent, var(--sky), transparent); box-shadow:0 0 14px var(--sky); animation:sweep 2.4s ease-in-out infinite alternate }
@keyframes sweep { from { top:8% } to { top:92% } }
.q-kind { font-size:13px; font-weight:800; letter-spacing:.1em; text-transform:uppercase; color:var(--sky) }
.qcard { background:var(--surface); border:1px solid var(--line); border-radius:20px; padding:18px; position:relative; overflow:hidden }
.qcard::before { content:""; position:absolute; left:0; right:0; top:0; height:2px; background:linear-gradient(90deg, transparent, var(--sky), transparent); animation:sweep2 1.2s ease-out 1 }
@keyframes sweep2 { from { transform:translateX(-100%) } to { transform:translateX(100%) } }
.qcard p { font-size:18px; font-weight:700; line-height:1.4 }
.answers { display:flex; flex-direction:column; gap:10px }
.ans { text-align:left; padding:14px 16px; border-radius:16px; background:var(--surface); border:1.5px solid var(--line); font-weight:700; font-size:15px; line-height:1.3; transition:border-color .15s, background .15s }
.ans.picked { border-color:var(--sky); background:rgba(93,173,226,.16) }
.answers.scale .ans { display:flex; align-items:center; gap:12px }
.answers.scale .ans i { width:46px; height:8px; border-radius:4px; background:linear-gradient(90deg, var(--sky) calc(var(--l) * 33.3% + 8%), var(--raised) 0); flex:none }
.focus-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px }
.fopt { display:flex; align-items:center; gap:10px; padding:10px; border-radius:16px; background:var(--surface); border:1.5px solid var(--line); text-align:left; font-weight:700; font-size:13px; line-height:1.2 }
.fopt .sk-icon { width:36px; height:36px } .fopt .sk-icon i { width:20px; height:20px }
.fopt.on { border-color:var(--orange); background:rgba(230,126,34,.14) }
.radar { position:relative; width:min(300px,80vw); aspect-ratio:1; margin:6px auto 0 }
.radar svg { width:100%; height:100%; overflow:visible }
.radar .rr { fill:none; stroke:var(--line); stroke-width:.4 } .radar .ra { stroke:var(--line); stroke-width:.3 }
.radar .rp { fill:rgba(93,173,226,.28); stroke:var(--sky); stroke-width:1.2; stroke-linejoin:round; animation:grow .9s cubic-bezier(.2,.8,.2,1); transform-origin:50% 50% }
@keyframes grow { from { transform:scale(.1); opacity:0 } }
.radar .ri { position:absolute; transform:translate(-50%,-50%) } .radar .ri .sk-icon { width:30px; height:30px; border-radius:9px } .radar .ri .sk-icon i { width:17px; height:17px }
.card-list { display:flex; flex-direction:column; gap:10px; margin-top:18px }
.pcard { background:var(--surface); border:1px solid var(--line); border-radius:18px; padding:14px; display:flex; flex-direction:column; gap:10px }
.pcard.focus { border-color:rgba(230,126,34,.5) }
.tops { display:flex; flex-direction:column; gap:8px } .tops div { display:flex; align-items:center; gap:10px; font-weight:800 }

/* сканер: шкала из 6 кругов */
.angle { display:flex; flex-direction:column; gap:8px; margin-top:12px } .angle h2 { font-size:26px }
.qcard .qsk { margin-bottom:10px } .qcard .qsk .sk-icon { width:38px; height:38px } .qcard .qsk .sk-icon i { width:20px; height:20px }
.likert { display:flex; align-items:center; justify-content:space-between; gap:6px; margin-top:10px; padding:0 2px }
.dotbtn { display:grid; place-items:center; width:52px; height:52px; flex:none }
.dotbtn i { display:block; border-radius:50%; border:3px solid var(--c); transition:transform .12s, background .12s; width:var(--d); height:var(--d) }
.dotbtn.s0 { --d:50px; --c:#E0654A } .dotbtn.s1 { --d:40px; --c:#E89A6B } .dotbtn.s2 { --d:30px; --c:#A9BDD0 }
.dotbtn.s3 { --d:30px; --c:#A9BDD0 } .dotbtn.s4 { --d:40px; --c:#85C1E9 } .dotbtn.s5 { --d:50px; --c:#5DADE2 }
.dotbtn:active i { transform:scale(.9) } .dotbtn.picked i { background:var(--c); transform:scale(1.08) }
.likert-ends { display:flex; justify-content:space-between; font-size:12px; font-weight:800; color:var(--text-2); margin-top:2px }
.likert.rev .s0 { --c:#5DADE2 } .likert.rev .s1 { --c:#85C1E9 } .likert.rev .s2, .likert.rev .s3 { --c:#A9BDD0 } .likert.rev .s4 { --c:#E89A6B } .likert.rev .s5 { --c:#E0654A }

/* ---------- операции и тренировки ---------- */
.op-task { display:flex; align-items:center; gap:12px; width:100%; padding:14px; text-align:left; background:var(--surface); border:1.5px solid var(--line); border-radius:18px; transition:transform .1s }
.op-task:active { transform:scale(.98) }
.op-task .sk-icon { flex:none; width:40px; height:40px }
.op-task > svg { flex:none; width:32px; height:32px; fill:var(--muted); margin:0 4px }
.op-t { flex:1; display:flex; flex-direction:column; gap:3px; line-height:1.2 }
.op-t b { font-size:16px; font-weight:800 } .op-t span { font-size:12px; color:var(--text-2) }
.op-s { flex:none; display:inline-flex; align-items:center; gap:4px; font-weight:800; font-size:14px; color:var(--orange) }
.op-s svg { width:16px; height:16px; fill:var(--ok) }
.op-task.done { border-color:var(--sky) } .op-task.done .op-s { color:var(--sky-300) }
.op-task.soon { opacity:.55; border-style:dashed }
.tcard { background:var(--surface); border:1px solid var(--line); border-radius:20px; padding:16px }
.tcard .ctx { font-size:13px; color:var(--text-2); margin-bottom:8px }
.tcard p { font-size:18px; font-weight:700; line-height:1.35 }
.bins { display:flex; flex-direction:column; gap:10px }
.bin { display:flex; flex-direction:column; gap:3px; padding:12px 14px; text-align:left; background:var(--surface); border:1.5px solid var(--line); border-radius:16px; transition:transform .1s, border-color .2s }
.bin:active { transform:scale(.98) }
.bin b { font-size:16px; font-weight:800 } .bin span { font-size:13px; color:var(--text-2); line-height:1.25 }
.bin.right { border-color:var(--ok); background:var(--ok-bg) }
.bin.wrong { opacity:.45; border-color:var(--no); background:var(--no-bg) }
.msg .ava.npc { font-weight:800; color:var(--sky-300) }
.msg.narr { justify-content:center } .msg.narr .note { font-size:13px; color:var(--text-2); background:var(--night); border:1px dashed var(--line); border-radius:12px; padding:8px 12px; text-align:center }
.replies { display:flex; flex-direction:column; gap:8px }
.opt-line { padding:12px 14px; text-align:left; font-size:15px; font-weight:600; line-height:1.3; background:var(--surface); border:1.5px solid var(--line); border-radius:16px; transition:transform .1s }
.opt-line:active { transform:scale(.98) }
.opt-line.wrong { opacity:.45; border-color:var(--no); background:var(--no-bg); text-decoration:line-through }
.memo { background:var(--surface); border:1px solid var(--line); border-radius:18px; padding:14px 16px }
.memo ul { margin:8px 0 0; padding-left:18px; display:flex; flex-direction:column; gap:6px } .memo li { font-size:15px; line-height:1.35 }

/* ---------- рейтинг ---------- */
.hud .pts .rk { display:inline-flex; align-items:center; gap:3px; font-style:normal; color:var(--sky-300); padding-left:8px; margin-left:2px; border-left:1px solid var(--line) }
.hud .pts .rk svg, .rank-strip svg, .rank-note svg { width:15px; height:15px; fill:currentColor; flex:none }
.hud .pts.tap { cursor:pointer }
.rank-strip { display:flex; align-items:center; gap:12px; width:100%; text-align:left; padding:12px 14px; border-radius:16px; background:var(--surface); border:1px solid var(--line); color:var(--sky-300) }
.rank-strip svg { width:26px; height:26px }
.rank-strip span { flex:1; display:flex; flex-direction:column; line-height:1.25; color:var(--text) }
.rank-strip small { font-size:13px; color:var(--text-2) }
.rank-strip i { font-style:normal; font-size:24px; color:var(--muted) }
.rank-note { align-self:center; display:inline-flex; align-items:center; gap:8px; padding:8px 14px; border-radius:999px; background:var(--surface); border:1px solid var(--line); color:var(--sky-300); font-size:14px }
.rank-note span { color:var(--text-2) } .rank-note b { color:var(--text) }
.rank-note em { font-style:normal; font-weight:800; color:var(--think-300) }
.tabs { display:flex; gap:6px; background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:4px }
.tab { flex:1; padding:9px 4px; border-radius:10px; font-size:14px; font-weight:700; color:var(--text-2) }
.tab.on { background:var(--raised); color:var(--text) }
.rating { display:flex; flex-direction:column; gap:6px }
.rrow { display:flex; align-items:center; gap:12px; padding:10px 12px; border-radius:14px; background:var(--surface); border:1px solid var(--line) }
.rrow .pl { width:30px; height:30px; border-radius:50%; display:grid; place-items:center; flex:none; font-weight:800; font-variant-numeric:tabular-nums; background:var(--raised); font-size:14px }
.rrow.p1 .pl { background:#E8B931; color:#2A1E00 } .rrow.p2 .pl { background:#C5CED8; color:#16202E } .rrow.p3 .pl { background:#C98A55; color:#2A1405 }
.rrow .nm { flex:1; min-width:0; display:flex; flex-direction:column; line-height:1.25 }
.rrow .nm b { font-size:15px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.rrow .nm small { font-size:12px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.rrow .pp { font-weight:800; font-variant-numeric:tabular-nums }
.rrow.me { border-color:var(--sky); background:color-mix(in srgb, var(--sky) 12%, var(--surface)) }
.rgap { text-align:center; color:var(--muted); line-height:1 }

/* ---------- развилка на карте ---------- */
.stop.fk { height:142px }
.stop.twin { margin-top:-148px; pointer-events:none } /* вторая станция развилки лежит поверх первой — пропускаем нажатия сквозь пустое место */
.stop.twin .station { pointer-events:auto }
.stop.open .station { border-color:var(--sky) } .stop.open .station svg { fill:var(--sky-300) } .stop.open .cap b { color:var(--sky-300) }

/* ---------- мини-игры ---------- */
.lvl-n { flex:none; width:40px; height:40px; border-radius:12px; display:grid; place-items:center; background:var(--raised); font-weight:800; font-size:18px }
.op-task.done .lvl-n { color:var(--sky-300) }
.op-task:disabled .op-s svg { fill:var(--muted) }
.lvl-title { flex:1; font-weight:800; font-size:15px; text-align:center; padding-right:28px }
.g-status { display:flex; flex-direction:column; align-items:center; gap:2px; text-align:center; min-height:46px }
.g-status b { font-size:18px; font-weight:800 } .g-status span { font-size:14px; color:var(--text-2) }

/* Сад камней */
.garden { position:relative; width:100%; aspect-ratio:4/5; max-height:58vh; border-radius:20px; overflow:hidden; background:#E8DFCB url(/assets/garden/scene.webp) center/cover no-repeat; border:1px solid var(--line); flex:none }
.g-master { position:absolute; left:50%; top:1%; height:38%; transform:translateX(-50%); transition:opacity .2s; filter:drop-shadow(0 8px 10px rgba(60,40,10,.25)) }
.g-say { position:absolute; left:62%; top:6%; background:#fff; color:var(--ink); font-weight:800; font-size:14px; padding:6px 10px; border-radius:12px 12px 12px 4px; box-shadow:0 4px 12px rgba(0,0,0,.2) }
.g-stone { position:absolute; width:12%; transform:translate(-50%,-50%) rotate(var(--r,0deg)); transition:transform .45s cubic-bezier(.5,0,.75,0), opacity .45s; filter:drop-shadow(0 3px 2px rgba(60,40,10,.35)) }
.g-black { width:15%; --r:0deg; z-index:1 }
.g-stone.gone-up { transform:translate(-50%,-340%) scale(.5); opacity:0 }
.g-stone.gone-down { transform:translate(-50%,260%) scale(.6); opacity:0 }
.g-takes { display:grid; grid-template-columns:repeat(3,1fr); gap:8px }
.g-takes .btn { padding-left:4px; padding-right:4px; font-size:16px }
.g-takes .btn:disabled { opacity:.4 }
.sheet .verdict .ava { width:34px; height:34px; border-radius:50%; background:var(--surface); display:grid; place-items:center; flex:none }
.sheet .verdict .ava img { width:22px }
.qopt { width:100%; text-align:left; padding:14px 16px; border-radius:16px; background:var(--surface); border:1.5px solid var(--line); font-weight:700; font-size:16px }
.qopt.right { border-color:var(--ok); background:var(--ok-bg) } .qopt.wrong { border-color:var(--no); background:var(--no-bg); text-decoration:line-through; opacity:.7 }

/* Мастерская */
.ws-board { width:100%; max-width:440px; align-self:center; aspect-ratio:1; border-radius:20px; background:var(--surface); border:1px solid var(--line); touch-action:manipulation; flex:none }
.ws-board svg { width:100%; height:100%; display:block; cursor:crosshair }
.ws-board.small { max-width:200px; pointer-events:none }
.ws-dot { fill:var(--text); transition:fill .2s } .ws-dot.on { fill:var(--sky) }
.ws-line { fill:none; stroke:var(--orange); stroke-width:9; stroke-linejoin:round; stroke-linecap:round }
.ws-v { fill:var(--orange) } .ws-v.start { fill:none; stroke:var(--orange); stroke-width:6 }
svg.win .ws-line { stroke:var(--sky) } svg.win .ws-v { fill:var(--sky) } svg.win .ws-v.start { stroke:var(--sky); fill:none }
.ws-hole { fill:var(--line) }
.ws-row { stroke:var(--sky); stroke-width:7; stroke-linecap:round; opacity:.75 }
.ws-tree circle { fill:#5FA36E; stroke:#2F6B40; stroke-width:4 } .ws-tree rect { fill:#8A6A45 }
.ws-tools { display:grid; grid-template-columns:1fr 1fr; gap:8px }
.ws-tools .btn:disabled { opacity:.4 }
.ws-hint-line { display:block; margin-top:8px; padding-top:8px; border-top:1px solid var(--line); color:var(--sky-300); font-size:15px }
.here.fork-here { top:30px }
/* подписи станций — на плашке цвета фона, чтобы линии пути не перечёркивали текст */
.cap b, .cap span { display:table; margin:0 auto; background:var(--night); padding:1px 6px; border-radius:6px }
.cap span { margin-top:1px }
/* мини-игры: о Силе в начале и в конце */
.sk-about { display:flex; gap:12px; align-items:flex-start; padding:14px; border-radius:18px; background:var(--cb); border:1px solid color-mix(in srgb, var(--c) 40%, transparent) }
.sk-about .label { color:var(--c3) } .sk-about p { font-size:15px; line-height:1.4; margin-top:4px }
.memo p { font-size:15px; line-height:1.4; margin-top:6px }
.memo .memo-out { padding-top:10px; margin-top:10px; border-top:1px solid var(--line); color:var(--text-2) }
.ws-ghost { fill:none; stroke:var(--sky-300); stroke-width:6; stroke-dasharray:4 16; stroke-linecap:round; opacity:.85 }
.ws-mark { fill:none; stroke:var(--sky-300); stroke-width:4; stroke-dasharray:6 8; opacity:.9 }
/* вход: школа и класс */
.grades { display:flex; gap:6px; align-items:stretch }
.grade { flex:1; min-height:56px; border-radius:14px; border:1.5px solid var(--line); background:var(--surface); font-size:20px; font-weight:800; color:var(--text-2) }
.grade.on { border-color:var(--sky); background:var(--raised); color:var(--text); box-shadow:0 0 0 3px rgba(93,173,226,.18) }
.input.letter { width:64px; flex:none; text-align:center; text-transform:uppercase; padding:0 }
