
:root{
  --bg:#f3f6fb;--card:#ffffff;--ink:#1b2742;--ink2:#51607d;--line:#dfe6f1;
  --pri:#2563eb;--pri2:#1d4ed8;--ok:#16a34a;--okbg:#e8f8ee;--bad:#e11d48;--badbg:#fdecef;
  --hl:#f97316;--sea:#cfe5f6;--sea2:#b9d9f1;--land:#f5ecd9;--land2:#efe2c6;--border:#b3a27f;
  --r:16px;--shadow:0 6px 24px rgba(27,39,66,.08);
  --fh:"Fredoka",ui-rounded,"Segoe UI",system-ui,sans-serif;--fb:"Nunito",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%;background:var(--bg);color:var(--ink);font-family:var(--fb);-webkit-font-smoothing:antialiased}
button{font:inherit;color:inherit;cursor:pointer}
#app{height:100vh;height:100dvh;display:flex;flex-direction:column}
.bar{flex:0 0 auto;display:flex;align-items:center;gap:12px;min-height:58px;padding:8px 16px;background:#fff;border-bottom:1px solid var(--line);position:relative;z-index:5}
.lnxback{flex:0 0 auto;box-sizing:border-box;display:flex;align-items:center;gap:8px;height:38px;padding:0 14px 0 11px;border-radius:999px;background:rgba(18,17,16,.88);color:#f4efe6 !important;text-decoration:none !important;font:600 14px/1 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;letter-spacing:.02em;border:1px solid rgba(255,255,255,.16);box-shadow:0 3px 12px rgba(0,0,0,.18);overflow:hidden;white-space:nowrap;max-width:160px;transition:max-width .3s ease,padding .3s ease,background .2s ease}
.lnxback svg{flex:0 0 auto}
.lnxback span{transition:opacity .2s ease}
.lnxback.is-small:not(:hover):not(:focus-visible){max-width:40px;padding:0 10px}
.lnxback.is-small:not(:hover):not(:focus-visible) span{opacity:0}
.lnxback:hover,.lnxback:focus-visible{background:#c8402c}
.bar .home{display:inline-flex;align-items:center;gap:6px;height:38px;padding:0 14px;border-radius:999px;border:1px solid var(--line);background:#fff;font-weight:700;font-size:14px;white-space:nowrap}
.bar .home:hover{background:#eef3ff;border-color:#c7d6fb}
.bar h1{font:600 20px/1.15 var(--fh);margin:0;flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bar h1 .em{margin-right:6px}
.stats{display:flex;gap:8px;flex:0 0 auto}
.chip{display:inline-flex;align-items:center;gap:5px;height:32px;padding:0 11px;border-radius:999px;background:#f1f5fb;border:1px solid var(--line);font-weight:800;font-size:14px;white-space:nowrap}
.chip.pop{animation:pop .35s ease}
@keyframes pop{50%{transform:scale(1.18)}}
.prog{position:absolute;left:0;bottom:-1px;height:3px;background:var(--pri);transition:width .4s ease}
main#view{flex:1 1 auto;min-height:0;position:relative;overflow:auto}

/* ---------- menu ---------- */
.menu{max-width:1180px;margin:0 auto;padding:26px 18px 60px}
.hero{display:flex;align-items:center;gap:18px;margin:4px 0 22px;flex-wrap:wrap}
.hero .globe{width:74px;height:74px;border-radius:50%;flex:0 0 auto;background:radial-gradient(circle at 32% 30%,#9fd4ff,#2563eb 55%,#123a8f);box-shadow:inset -10px -8px 18px rgba(0,0,0,.25),0 8px 22px rgba(37,99,235,.3);position:relative;overflow:hidden}
.hero .globe svg{position:absolute;inset:0;width:100%;height:100%}
.hero h2{font:700 clamp(28px,4vw,42px)/1.05 var(--fh);margin:0}
.hero p{margin:6px 0 0;color:var(--ink2);font-size:16px;max-width:640px}
.hero .tot{margin-left:auto;background:#fff;border:1px solid var(--line);border-radius:14px;padding:10px 16px;font-weight:800;box-shadow:var(--shadow)}
.sec{margin:26px 0 10px;font:600 19px var(--fh);display:flex;align-items:center;gap:10px}
.sec::after{content:"";flex:1;height:1px;background:var(--line)}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,240px),1fr));gap:14px}
.gcard{all:unset;box-sizing:border-box;cursor:pointer;display:flex;gap:14px;align-items:flex-start;padding:16px;border-radius:var(--r);background:#fff;border:1px solid var(--line);box-shadow:var(--shadow);transition:transform .15s ease,box-shadow .15s ease,border-color .15s;min-width:0;position:relative;overflow:hidden}
.gcard:hover,.gcard:focus-visible{transform:translateY(-3px);box-shadow:0 12px 30px rgba(27,39,66,.13);border-color:var(--c,#2563eb)}
.gcard:focus-visible{outline:3px solid #93b4fb;outline-offset:2px}
.gcard .ic{flex:0 0 auto;width:52px;height:52px;border-radius:14px;display:grid;place-items:center;font-size:28px;background:var(--cb,#eef3ff)}
.gcard .tx{min-width:0;flex:1}
.gcard b{display:block;font:600 17px/1.2 var(--fh);margin:2px 0 4px;white-space:normal}
.gcard span{display:block;font-size:13.5px;line-height:1.35;color:var(--ink2);white-space:normal}
.gcard .best{position:absolute;right:10px;top:8px;font-size:12px;letter-spacing:1px;color:#f59e0b}
.foot{margin-top:34px;text-align:center;color:var(--ink2);font-size:13px}

/* ---------- intro ---------- */
.intro{max-width:620px;margin:0 auto;padding:30px 18px 50px;text-align:center}
.intro .big{font-size:64px;line-height:1;margin:6px 0 8px}
.intro h2{font:700 30px var(--fh);margin:0 0 8px}
.intro p{color:var(--ink2);font-size:16px;line-height:1.5;margin:0 auto 14px}
.howto{background:#fff;border:1px solid var(--line);border-radius:var(--r);padding:14px 18px;text-align:left;box-shadow:var(--shadow);margin:16px 0}
.howto li{margin:4px 0;line-height:1.45}
.howto ul{margin:6px 0 0;padding-left:20px}
.seg{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin:12px 0 18px}
.seg button{border:1px solid var(--line);background:#fff;border-radius:999px;padding:8px 14px;font-weight:700;font-size:14px}
.seg button[aria-pressed="true"]{background:var(--pri);border-color:var(--pri);color:#fff}
.btns{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:46px;padding:0 22px;border-radius:999px;border:0;background:var(--pri);color:#fff;font-weight:800;font-size:16px;box-shadow:0 6px 16px rgba(37,99,235,.28);transition:transform .12s ease,background .15s}
.btn:hover{background:var(--pri2);transform:translateY(-1px)}
.btn.alt{background:#fff;color:var(--ink);border:1px solid var(--line);box-shadow:none}
.btn.alt:hover{background:#eef3ff}
.btn.sm{min-height:38px;padding:0 16px;font-size:14px}

/* ---------- play ---------- */
.play{display:grid;grid-template-columns:minmax(0,1fr) 370px;height:100%}
.stage{position:relative;min-height:0;min-width:0;overflow:hidden;background:var(--sea)}
.stage.plain{background:linear-gradient(#f7f9fd,#eaf0f8)}
.panel{min-height:0;overflow:auto;background:#fff;border-left:1px solid var(--line);padding:18px 18px 24px;display:flex;flex-direction:column;gap:12px}
.qn{font-size:13px;font-weight:800;color:var(--ink2);text-transform:uppercase;letter-spacing:.06em}
.qt{font:500 21px/1.3 var(--fh);margin:0}
.qt b{color:var(--pri2);font-weight:600}
.qsub{color:var(--ink2);font-size:14.5px;line-height:1.45;margin:-4px 0 0}
.opts{display:grid;grid-template-columns:1fr;gap:9px}
.opt{all:unset;box-sizing:border-box;cursor:pointer;display:flex;align-items:center;gap:10px;min-height:48px;padding:10px 14px;border-radius:12px;border:2px solid var(--line);background:#fff;font-weight:700;font-size:15.5px;line-height:1.25;white-space:normal;text-align:left;transition:border-color .12s,background .12s,transform .1s}
.opt:hover:not([disabled]){border-color:#9db8f8;background:#f5f8ff}
.opt:focus-visible{outline:3px solid #93b4fb;outline-offset:1px}
.opt .k{flex:0 0 auto;width:24px;height:24px;border-radius:7px;background:#eef2f8;display:grid;place-items:center;font-size:12px;color:var(--ink2)}
.opt.ok{border-color:var(--ok);background:var(--okbg)}
.opt.bad{border-color:var(--bad);background:var(--badbg)}
.opt[disabled]{cursor:default}
.opt[disabled]:not(.ok):not(.bad){opacity:.6}
.fb{border-radius:14px;padding:12px 14px;font-size:15px;line-height:1.5;display:none}
.fb.show{display:block;animation:fadeup .25s ease}
.fb.ok{background:var(--okbg);border:1px solid #bfe8cd}
.fb.bad{background:var(--badbg);border:1px solid #f6c2cc}
.fb.info{background:#fff7ec;border:1px solid #fbd9ad}
.fb b.h{display:block;font:600 17px var(--fh);margin-bottom:2px}
@keyframes fadeup{from{opacity:0;transform:translateY(6px)}}
.acts{display:flex;gap:8px;flex-wrap:wrap;margin-top:auto;padding-top:4px}
.acts .btn{flex:1 1 auto}
.tip{font-size:13px;color:var(--ink2)}
.zbtns{position:absolute;right:12px;bottom:12px;display:flex;flex-direction:column;gap:6px;z-index:3}
.zbtns button{width:38px;height:38px;border-radius:10px;border:1px solid var(--line);background:#fff;font-size:20px;font-weight:800;line-height:1;box-shadow:0 2px 8px rgba(0,0,0,.08)}
.toast{position:absolute;left:50%;top:14px;transform:translateX(-50%);background:rgba(27,39,66,.92);color:#fff;padding:8px 14px;border-radius:999px;font-weight:700;font-size:14px;z-index:4;pointer-events:none;opacity:0;transition:opacity .2s;white-space:nowrap;max-width:92%;overflow:hidden;text-overflow:ellipsis}
.toast.show{opacity:1}
.loading{position:absolute;inset:0;display:grid;place-items:center;color:var(--ink2);font-weight:700}
.err{max-width:520px;margin:40px auto;padding:20px;background:#fff;border:1px solid var(--line);border-radius:var(--r);text-align:center}

/* ---------- map ---------- */
.gm{display:block;position:absolute;inset:0;width:100%;height:100%;touch-action:none;user-select:none;-webkit-user-select:none}
.gm path{vector-effect:non-scaling-stroke}
.gm .sphere{fill:var(--sea);stroke:#a9cbe6;stroke-width:1}
.gm .grat{fill:none;stroke:#fff;stroke-opacity:.55;stroke-width:.6}
.gm .land{fill:var(--land);stroke:var(--border);stroke-width:.6;stroke-linejoin:round}
.gm .land.pick{cursor:pointer}
.gm .land.pick:hover{fill:#ffe2b8}
.gm .land.ghost{fill:#efe6d2}
.gm .land.dim{fill:#ece5d6;stroke:#cfc2a6}
.gm .land.hl,.gm .land.ok{fill:#86e0a8;stroke:#15803d;stroke-width:1.4}
.gm .land.bad{fill:#fca5b4;stroke:#be123c;stroke-width:1.2}
.gm .land.tgt{fill:#ffb36b;stroke:#c2410c;stroke-width:1.6}
.gm .land.cont-hover{fill:#ffd9a3}
.gm .land.done{fill:var(--cc,#9ad0f5);stroke:#6b7c93}
.gm .ocean{fill:var(--sea);stroke:#a9cbe6;stroke-width:.8}
.gm .ocean.pick{cursor:pointer}
.gm .ocean.pick:hover{fill:#a8d2f2}
.gm .ocean.ok{fill:#86e0a8}
.gm .ocean.bad{fill:#fca5b4}
.gm .ocean.tgt{fill:#ffb36b}
.gm .ocean.done{fill:var(--cc)}
.gm .feat{fill:var(--hl);fill-opacity:.55;stroke:#c2410c;stroke-width:2;stroke-dasharray:6 4;animation:dash 1s linear infinite}
.gm .feat.seam{stroke:none}
.gm .feat.water{fill:#2b8be6;fill-opacity:.55;stroke:#0b4f9c}
.gm .feat.ok{fill:var(--ok);stroke:#14532d}
.gm .feat.ctx{fill:#94a3b8;fill-opacity:.25;stroke:#64748b;stroke-width:.6;stroke-dasharray:none;animation:none}
.gm .feat.study{cursor:pointer;fill-opacity:.35;stroke-width:1.2;stroke-dasharray:none;animation:none}
.gm .feat.study:hover,.gm .feat.study.on{fill-opacity:.75}
.gm .lakes path{fill:var(--sea);stroke:#7fb2db;stroke-width:.6}
.gm .riv{fill:none;stroke:#5aa3e0;stroke-width:1;stroke-linecap:round;stroke-linejoin:round}
.gm .riv.tgt{stroke:var(--hl);stroke-width:4.5;filter:drop-shadow(0 0 3px rgba(249,115,22,.8))}
.gm .riv.ok{stroke:var(--ok);stroke-width:4.5}
.gm .riv.study{cursor:pointer;stroke-width:2.2}
.gm .riv.study:hover,.gm .riv.study.on{stroke:var(--hl);stroke-width:4}
.gm .riv.hit{stroke:transparent;stroke-width:14}
@keyframes dash{to{stroke-dashoffset:-20}}
.gm .lab text{font-family:var(--fb);font-weight:800;fill:#1b2742;paint-order:stroke;stroke:#fff;stroke-width:3.5px;stroke-linejoin:round;text-anchor:middle;dominant-baseline:middle;pointer-events:none}
.gm .lab.ok text{fill:#14532d}
.gm .lab.bad text{fill:#9f1239}
.gm .lab.small text{font-weight:700}
.gm .mk{pointer-events:none}
.gm .mk .pulse{fill:none;stroke:var(--hl);stroke-width:3;transform-box:fill-box;transform-origin:center;animation:pulse 1.6s ease-out infinite}
@keyframes pulse{from{transform:scale(.5);opacity:1}to{transform:scale(2.4);opacity:0}}
.gm .mk.ok .pulse{stroke:var(--ok)}
.gm .mk.study{pointer-events:all;cursor:pointer}
.gm .ring{fill:var(--hl);fill-opacity:.08;stroke:var(--hl);stroke-width:2.5;stroke-dasharray:7 5;animation:dash 1s linear infinite}
.gm .ring.ok{fill:var(--ok);stroke:var(--ok)}
.gm .ll{fill:none;stroke:#94a3b8;stroke-width:.7}
.gm .ll.major{stroke:#64748b;stroke-width:1}
.gm .sp{fill:none;stroke:#e11d48;stroke-width:1.6;stroke-dasharray:7 5}
.gm .sp.hit{stroke:transparent;stroke-width:16;stroke-dasharray:none;cursor:pointer}
.gm .sp.on{stroke:var(--ok);stroke-width:3;stroke-dasharray:none}
.gm .axl{font:700 11px var(--fb);fill:#475569}
.gm .click-dot{fill:#1b2742;stroke:#fff;stroke-width:2}
.gm .tgt-dot{fill:var(--ok);stroke:#fff;stroke-width:2}
.gm .ans-dot{fill:var(--hl);stroke:#fff;stroke-width:2.5}
.gm.eq{cursor:crosshair}

/* ---------- flags & shapes ---------- */
.center{position:absolute;inset:0;display:grid;place-items:center;padding:20px}
.flagbox{background:#fff;border-radius:18px;padding:16px;box-shadow:0 12px 34px rgba(27,39,66,.15);max-width:min(92%,520px)}
.flagbox img{display:block;width:min(420px,78vw);aspect-ratio:4/3;max-width:100%;background:#f8fafc;max-height:52vh;object-fit:contain;border-radius:6px;border:1px solid #e5e7eb}
.flagbox .cap{text-align:center;margin-top:10px;font-weight:800;min-height:1.3em}
.shape svg{width:100%;height:100%;display:block}
.shape .sil{fill:#334e7a;stroke:#1b2742;stroke-width:1.2;stroke-linejoin:round}
.shape .sil.ok{fill:var(--ok)}

/* ---------- diagrams ---------- */
.dg{display:block;position:absolute;inset:0;width:100%;height:100%}
.dg .part{cursor:pointer;transition:filter .15s}
.dg .part:hover{filter:brightness(1.12) saturate(1.1)}
.dg path.part.ok,.dg rect.part.ok{stroke:#15803d;stroke-width:5}
.dg path.part.bad,.dg rect.part.bad{stroke:#be123c;stroke-width:5}
.dg .dl{font:800 15px var(--fb);fill:#fff;paint-order:stroke;stroke:rgba(0,0,0,.65);stroke-width:4px;stroke-linejoin:round;pointer-events:none}
.dg .dl.dark{fill:#1b2742;stroke:#fff}
.dg .dl.sm{font-size:12.5px;font-weight:700}
.hs{cursor:pointer}
.hs circle.b{fill:#1b2742;stroke:#fff;stroke-width:3;transition:fill .15s}
.hs:hover circle.b{fill:var(--pri)}
.hs text{font:800 20px var(--fb);fill:#fff;text-anchor:middle;dominant-baseline:central;pointer-events:none}
.hs.ok circle.b{fill:var(--ok)}
.hs.bad circle.b{fill:var(--bad)}
.planet{cursor:pointer}
.planet:hover .body{filter:brightness(1.25)}
.planet.ok .sel{stroke:var(--ok);stroke-width:4;fill:none}
.planet.bad .sel{stroke:var(--bad);stroke-width:4;fill:none}

/* ---------- end + study ---------- */
.end{max-width:640px;margin:0 auto;padding:28px 18px 50px;text-align:center}
.end .stars{font-size:46px;letter-spacing:6px;margin:6px 0}
.end .stars .off{filter:grayscale(1);opacity:.3}
.end h2{font:700 30px var(--fh);margin:0}
.end .sc{font-size:18px;color:var(--ink2);margin:6px 0 18px}
.review{text-align:left;background:#fff;border:1px solid var(--line);border-radius:var(--r);padding:6px 0;margin:18px 0;box-shadow:var(--shadow)}
.review div{display:flex;gap:10px;padding:8px 16px;border-top:1px solid #eef2f7;font-size:14.5px;line-height:1.4}
.review div:first-child{border-top:0}
.review i{font-style:normal;flex:0 0 auto}
.slist{display:flex;flex-direction:column;gap:6px}
.slist input{width:100%;height:42px;border-radius:10px;border:1px solid var(--line);padding:0 12px;font:inherit;font-size:15px}
.slist .it{all:unset;box-sizing:border-box;cursor:pointer;padding:9px 12px;border-radius:10px;border:1px solid var(--line);font-weight:700;font-size:14.5px;white-space:normal}
.slist .it:hover,.slist .it.on{border-color:var(--pri);background:#f2f6ff}
.sfact{background:#f7f9fd;border:1px solid var(--line);border-radius:12px;padding:12px 14px;line-height:1.5;font-size:15px}
.sfact > b:first-child{font:600 17px var(--fh);display:block;margin-bottom:2px}

@media (max-width:860px){
  .play{display:flex;flex-direction:column}
  .stage{flex:1 1 auto;min-height:190px}
  .panel{flex:0 1 auto;border-left:0;border-top:1px solid var(--line);max-height:58%;padding:12px 14px 14px;gap:9px}
  .qt{font-size:18px}
  .opts{grid-template-columns:1fr 1fr;gap:7px}
  .opt{min-height:44px;padding:8px 10px;font-size:14.5px}
  .opt .k{display:none}
  .fb{padding:9px 12px;font-size:14px}
  .acts .btn{min-height:42px}
  .panel.study{max-height:45%}
  .zbtns{right:8px;bottom:8px}
  .zbtns button{width:34px;height:34px}
}
@media (max-width:560px){
  .bar{gap:8px;padding:6px 10px}
  .lnxback{height:34px}
  .bar h1{font-size:17px}
  .bar .home{padding:0 11px;height:34px;font-size:13px}
  .bar .home .t{display:none}
  .chip{height:28px;padding:0 8px;font-size:13px}
  .chip.hide-sm{display:none}
  .hero .tot{margin-left:0}
}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

