:root {
  --ink: #eef8ff;
  --muted: #8ca9bd;
  --cyan: #4edbff;
  --cyan-soft: rgba(78, 219, 255, 0.14);
  --orange: #ffad64;
  --green: #6de7b0;
  --red: #ff7d8f;
  --line: rgba(117, 198, 227, 0.22);
  --panel: rgba(7, 22, 39, 0.88);
  --panel-2: rgba(11, 32, 53, 0.82);
  --bg: #030914;
  --radius: 22px;
  --route: #4edbff;
}

* { box-sizing: border-box; }
[hidden] { display:none !important; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 20%, rgba(28, 103, 143, 0.22), transparent 28rem),
    radial-gradient(circle at 88% 70%, rgba(24, 82, 117, 0.2), transparent 34rem),
    linear-gradient(145deg, #020711, #061323 58%, #020711);
  overflow-x: hidden;
}

button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

.stars { position: fixed; inset: 0; pointer-events: none; opacity: .65; }
.stars::before, .stars::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.9) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(93,211,255,.7) 0 1px, transparent 1.5px);
  background-size: 83px 83px, 137px 137px;
  background-position: 17px 31px, 61px 9px;
}
.stars-b { transform: scale(1.3) rotate(7deg); opacity: .24; }

.topbar {
  position: relative; z-index: 10; width: min(1440px, calc(100% - 48px)); margin: 0 auto;
  min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; letter-spacing: .08em; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--cyan); color: var(--cyan); transform: rotate(45deg); }
.brand-mark::first-letter { transform: rotate(-45deg); }
.brand b, .brand small { display: block; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
nav { display: flex; gap: 6px; }
.nav-button { border: 0; border-radius: 999px; background: transparent; padding: 10px 15px; color: var(--muted); cursor: pointer; }
.nav-button:hover, .nav-button.is-active { color: var(--ink); background: var(--cyan-soft); }
.streak { color: var(--muted); font-size: 13px; white-space: nowrap; }
.streak span { color: var(--orange); }

main { position: relative; z-index: 2; width: min(1440px, calc(100% - 48px)); margin: 0 auto; padding: 34px 0 60px; }
.view { display: none; animation: reveal .38s ease-out; }
.view.is-visible { display: block; }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } }

.mission-layout { min-height: calc(100vh - 174px); display: grid; grid-template-columns: minmax(340px, .78fr) minmax(560px, 1.22fr); border: 1px solid var(--line); border-radius: 30px; overflow: hidden; background: rgba(2, 11, 23, .58); box-shadow: 0 35px 100px rgba(0,0,0,.38); }
.ship-panel { position: relative; min-height: 680px; padding: clamp(32px, 5vw, 70px); overflow: hidden; background: radial-gradient(circle at 54% 40%, #123956 0, #061526 36%, #020812 72%); }
.ship-panel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(1,7,15,.9) 84%); }
.ship-copy { position: absolute; z-index: 4; left: clamp(28px, 5vw, 68px); right: 35px; bottom: 54px; }
.eyebrow { color: var(--cyan); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.ship-copy h1 { margin: 12px 0 17px; font-size: clamp(42px, 5vw, 76px); line-height: .94; letter-spacing: -.045em; text-transform: uppercase; }
.ship-copy h1 em { color: transparent; font-style: normal; -webkit-text-stroke: 1px var(--cyan); text-shadow: 0 0 28px rgba(78,219,255,.17); }
.ship-copy p { max-width: 430px; margin: 0; color: #afc6d6; line-height: 1.65; }
.orbit { position: absolute; border: 1px solid rgba(77, 218, 255, .13); border-radius: 50%; transform: rotate(-23deg); }
.orbit-one { width: 580px; height: 260px; left: -80px; top: 110px; }
.orbit-two { width: 720px; height: 350px; left: -150px; top: 75px; }
.planet { position: absolute; border-radius: 50%; box-shadow: inset -12px -10px 20px rgba(0,0,0,.55), 0 0 35px rgba(53,159,214,.15); }
.planet-one { width: 62px; height: 62px; right: 10%; top: 9%; background: linear-gradient(135deg, #6f91a6, #172735 58%, #050a0e); }
.planet-two { width: 14px; height: 14px; left: 12%; top: 28%; background: var(--orange); box-shadow: 0 0 24px var(--orange); }
.ship { position: absolute; z-index: 2; top: 29%; left: 50%; width: 275px; height: 64px; transform: translate(-50%,-50%) rotate(-8deg); filter: drop-shadow(0 22px 20px rgba(0,0,0,.6)); }
.ship-core { position: absolute; inset: 10px 15px 10px 35px; background: linear-gradient(180deg, #647384, #17222e 52%, #080d13); clip-path: polygon(0 18%, 74% 0, 100% 45%, 82% 80%, 14% 100%, 0 66%); border-radius: 10px; }
.ship-core::after { content: ""; position: absolute; inset: 12px 56px; border-top: 2px solid var(--cyan); border-bottom: 1px solid rgba(255,255,255,.25); }
.ship-wing { position: absolute; left: 80px; width: 120px; height: 54px; background: linear-gradient(135deg,#536170,#101923); clip-path: polygon(0 50%,100% 0,72% 100%); }
.ship-wing-top { top: -30px; }
.ship-wing-bottom { bottom: -30px; transform: scaleY(-1); }
.ship-engine { position: absolute; left: 19px; top: 20px; width: 30px; height: 26px; border-radius: 50%; background: #dffbff; box-shadow: -18px 0 32px 9px #2bc5ff, -65px 0 50px 2px rgba(43,197,255,.45); }

.console { min-height: 680px; background: linear-gradient(145deg, rgba(9,29,48,.98), rgba(3,13,25,.98)); }
.screen { display: none; min-height: 100%; padding: clamp(28px, 5vw, 64px); }
.screen.is-visible { display: block; animation: reveal .35s ease-out; }
.console-head, .task-topline { display: flex; justify-content: space-between; gap: 25px; align-items: flex-start; }
.console h2, .page-head h2 { margin: 8px 0 0; font-size: clamp(30px, 3.4vw, 50px); line-height: 1.08; letter-spacing: -.035em; }
.time-chip, .timer { border: 1px solid var(--line); padding: 10px 13px; color: #bcd4e3; font-size: 12px; white-space: nowrap; }
.message { display: flex; gap: 16px; margin: 36px 0; padding: 20px; border-left: 2px solid var(--cyan); background: linear-gradient(90deg, var(--cyan-soft), transparent); }
.message .avatar { flex: 0 0 36px; display: grid; place-items: center; height: 36px; border: 1px solid var(--cyan); border-radius: 50%; color: var(--cyan); font-weight: 800; }
.message b { color: var(--cyan); font-size: 11px; letter-spacing: .1em; }
.message p { margin: 7px 0 0; color: #b8cbd8; line-height: 1.55; }
.brief-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 40px 0; }
.brief-grid article { min-height: 125px; padding: 18px; border: 1px solid var(--line); background: rgba(4,18,32,.55); }
.brief-grid span { display: block; color: var(--cyan); font: 700 12px ui-monospace, monospace; }
.brief-grid b, .brief-grid small { display: block; }
.brief-grid b { margin: 21px 0 7px; font-size: 14px; }
.brief-grid small { color: var(--muted); line-height: 1.35; }
.primary-button, .ghost-button { min-height: 46px; border-radius: 4px; padding: 0 18px; font-weight: 750; cursor: pointer; transition: .2s ease; }
.primary-button { border: 1px solid var(--cyan); color: #02111c; background: var(--cyan); box-shadow: 0 0 26px rgba(78,219,255,.13); }
.primary-button:hover { background: #a1edff; border-color: #a1edff; transform: translateY(-1px); }
.primary-button span { margin-left: 13px; }
.ghost-button { border: 1px solid var(--line); color: #c7deea; background: transparent; }
.ghost-button:hover { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-soft); }
.save-note { color: #6f8da2; font-size: 11px; }

.route-picker { margin: 28px 0 30px; padding: 20px; border: 1px solid var(--line); background: rgba(4,18,32,.55); }
.route-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.route-picker h3 { margin: 6px 0 0; font-size: 18px; }
.voice-toggle { border: 1px solid var(--line); border-radius: 999px; padding: 9px 13px; background: transparent; color: #c7deea; cursor: pointer; font-size: 12px; }
.voice-toggle[aria-pressed="true"] { border-color: var(--route); color: var(--route); background: rgba(78,219,255,.08); }
.route-options { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 16px; }
.route-card { min-height: 108px; padding: 13px; border: 1px solid var(--line); background: rgba(2,10,20,.72); text-align: left; cursor: pointer; transition: .2s ease; }
.route-card:hover, .route-card.is-selected { border-color: var(--route); background: rgba(78,219,255,.11); transform: translateY(-1px); }
.route-card span, .route-card b, .route-card small { display: block; }
.route-card span { font-size: 22px; }
.route-card b { margin: 8px 0 4px; }
.route-card small { color: var(--muted); line-height: 1.3; }
.route-mission { margin: 14px 0 0; color: #b8cbd8; font-size: 13px; }

.task-topline > div:first-child { flex: 1; }
.progress-track { width: 100%; height: 3px; margin-top: 13px; overflow: hidden; background: rgba(255,255,255,.08); }
.progress-track span { display: block; width: 25%; height: 100%; background: var(--cyan); box-shadow: 0 0 14px var(--cyan); transition: width .3s ease; }
.analysis-note { margin: 22px 0 -2px; padding: 12px 15px; border: 1px solid rgba(255,173,100,.28); color: #ffd2ad; background: rgba(255,173,100,.08); font-size: 13px; line-height: 1.45; }
.task-card { margin-top: 25px; padding: clamp(24px, 4vw, 44px); border: 1px solid var(--line); background: rgba(4,17,31,.74); }
.quest-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -12px 0 22px; padding-bottom: 14px; border-bottom: 1px solid var(--line); color: var(--route); font-size: 11px; letter-spacing: .04em; }
.quest-line b { color: #b8cbd8; text-align: right; }
.case-tag { display: inline-flex; gap: 10px; align-items: center; color: var(--cyan); font: 700 11px ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; }
.case-tag > span:first-child { font-size: 20px; }
.task-card h2 { max-width: 760px; margin: 24px 0 34px; font-size: clamp(25px,3vw,39px); line-height: 1.25; }
.listen-button { margin: -20px 0 28px; padding: 8px 12px; border: 0; border-bottom: 1px dashed var(--route); color: var(--route); background: transparent; cursor: pointer; font-size: 13px; }
#answer-form label { display: block; margin-bottom: 9px; color: var(--muted); font-size: 12px; }
.answer-row { display: flex; align-items: stretch; gap: 10px; }
.answer-row input { min-width: 0; flex: 1; border: 1px solid var(--line); border-radius: 4px; padding: 13px 16px; color: var(--ink); background: #020a14; font-size: 20px; }
.answer-row input::placeholder { color: #496477; }
#answer-unit { display: grid; place-items: center; min-width: 45px; color: var(--muted); }
.task-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.voice-action { border-color: rgba(255,173,100,.5); color: #ffd2ad; }
.voice-status { min-height: 20px; margin: 11px 0 0; color: #9fc1d3; font-size: 12px; line-height: 1.45; }
.help-panel { margin-top: 18px; padding: 18px; border: 1px solid rgba(78,219,255,.28); background: var(--cyan-soft); }
.help-panel b { color: var(--cyan); }
.help-panel p { margin: 8px 0 0; color: #c8dce7; line-height: 1.55; }
.help-panel .listen-button { margin: 12px 0 0; }
.ask-argo-form { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.ask-argo-form label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.ask-argo-form > div { display: flex; gap: 8px; }
.ask-argo-form input { min-width: 0; flex: 1; border: 1px solid var(--line); border-radius: 4px; padding: 11px 13px; color: var(--ink); background: #020a14; }
.ask-argo-form input::placeholder { color: #496477; }
.privacy-note { display: block; margin-top: 10px; color: #6f8da2; line-height: 1.4; }
.feedback-panel { display: flex; gap: 18px; margin-top: 22px; padding: 20px; border: 1px solid var(--line); background: rgba(3,13,24,.92); }
.feedback-panel.is-correct { border-color: rgba(109,231,176,.5); }
.feedback-panel.is-wrong { border-color: rgba(255,125,143,.45); }
.feedback-icon { flex: 0 0 42px; display: grid; place-items: center; height: 42px; border: 1px solid currentColor; border-radius: 50%; font-weight: 900; }
.is-correct .feedback-icon { color: var(--green); }
.is-wrong .feedback-icon { color: var(--red); }
.feedback-panel h3 { margin: 0; }
.feedback-panel p { margin: 7px 0 16px; color: #b8cbd8; line-height: 1.5; }
.sync-button { position: fixed; z-index: 35; right: 14px; bottom: 14px; min-height: 38px; padding: 0 13px; border: 1px solid var(--cyan); border-radius: 999px; color: var(--cyan); background: rgba(3,15,27,.96); box-shadow: 0 8px 28px rgba(0,0,0,.35); font-size: 11px; font-weight: 800; cursor: pointer; }
.sync-button.is-connected { border-color: var(--green); color: var(--green); }
.sync-dialog { width: min(500px,calc(100% - 24px)); padding: 0; border: 1px solid var(--cyan); border-radius: 14px; color: var(--ink); background: #061523; box-shadow: 0 25px 100px rgba(0,0,0,.65); }
.sync-dialog::backdrop { background: rgba(0,6,14,.78); backdrop-filter: blur(4px); }
.sync-dialog form { position: relative; display: grid; gap: 12px; padding: 26px; }
.sync-dialog h2 { margin: 0; font-size: 24px; }
.sync-dialog p,.sync-dialog small { margin: 0; color: var(--muted); line-height: 1.5; }
.sync-dialog label { margin-top: 4px; color: #bcd3df; font-size: 12px; }
.sync-dialog input { width: 100%; padding: 13px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: #020a14; font: 700 17px ui-monospace,monospace; letter-spacing: .05em; text-transform: uppercase; }
.dialog-close { position: absolute; top: 9px; right: 10px; width: 34px; height: 34px; border: 0; color: var(--muted); background: transparent; font-size: 25px; cursor: pointer; }
.feedback-panel.success-popup { position: fixed; z-index: 50; left: 50%; top: 50%; width: min(560px, calc(100vw - 28px)); max-height: calc(100vh - 28px); margin: 0; overflow: auto; transform: translate(-50%,-50%); border-color: rgba(109,231,176,.75); border-radius: 14px; background: linear-gradient(145deg,rgba(5,30,39,.99),rgba(2,11,22,.99)); box-shadow: 0 0 0 100vmax rgba(0,5,12,.72),0 24px 80px rgba(0,0,0,.55),0 0 45px rgba(109,231,176,.18); animation: success-pop .28s ease-out; }
.feedback-panel.success-popup .feedback-icon { box-shadow: 0 0 24px rgba(109,231,176,.35); }
.feedback-panel.error-popup { position: fixed; z-index: 50; left: 50%; top: 50%; width: min(540px,calc(100vw - 28px)); max-height: calc(100vh - 28px); margin: 0; overflow: auto; transform: translate(-50%,-50%); border-color: rgba(255,173,100,.72); border-radius: 14px; background: linear-gradient(145deg,rgba(39,22,12,.99),rgba(6,13,23,.99)); box-shadow: 0 0 0 100vmax rgba(0,5,12,.68),0 24px 80px rgba(0,0,0,.55),0 0 38px rgba(255,173,100,.14); animation: error-pop .26s ease-out; }
.feedback-panel.error-popup .feedback-icon { color: var(--orange); box-shadow: 0 0 18px rgba(255,173,100,.24); }
.retry-button { margin-right: 8px; border-color: rgba(255,173,100,.55); color: #ffd3ae; }
@keyframes success-pop { from { opacity:0; transform:translate(-50%,-47%) scale(.94); } to { opacity:1; transform:translate(-50%,-50%) scale(1); } }
@keyframes error-pop { 0% { opacity:0; transform:translate(-50%,-50%) scale(.96); } 55% { transform:translate(calc(-50% - 3px),-50%) scale(1); } 75% { transform:translate(calc(-50% + 2px),-50%) scale(1); } 100% { opacity:1; transform:translate(-50%,-50%) scale(1); } }
@media (prefers-reduced-motion:reduce) { .feedback-panel.success-popup,.feedback-panel.error-popup { animation:none; } }

#complete-screen { position: relative; text-align: center; overflow: hidden; }
.complete-orbit { display: grid; place-items: center; width: 100px; height: 100px; margin: 5px auto 28px; border: 1px solid var(--cyan); border-radius: 50%; color: var(--cyan); font-size: 32px; box-shadow: 0 0 80px rgba(78,219,255,.24), inset 0 0 30px rgba(78,219,255,.1); }
#complete-screen > p { max-width: 630px; margin: 18px auto; color: #b8cbd8; line-height: 1.55; }
.result-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 34px 0; }
.result-grid article { padding: 20px 10px; border: 1px solid var(--line); }
.result-grid strong, .result-grid span { display: block; }
.result-grid strong { color: var(--cyan); font: 700 28px ui-monospace, monospace; }
.result-grid span { margin-top: 6px; color: var(--muted); font-size: 11px; }
#mission-insight { text-align: left; }
.complete-actions { display: flex; justify-content: center; gap: 10px; }

.page-head { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin: 20px 0 40px; }
.page-head p { max-width: 470px; margin: 0; color: var(--muted); line-height: 1.55; }
.skill-map { position: relative; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; max-width: 1050px; margin: auto; }
.skill-node { display: grid; grid-template-columns: 80px 1fr; gap: 20px; align-items: center; min-height: 155px; padding: 24px; border: 1px solid var(--line); background: var(--panel); }
.skill-star { display: grid; place-items: center; width: 70px; height: 70px; border: 1px solid var(--cyan); border-radius: 50%; color: var(--cyan); font-size: 25px; box-shadow: 0 0 calc(var(--glow, 10) * 1px) rgba(78,219,255,.3); }
.skill-status { color: var(--cyan); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.skill-node h3 { margin: 6px 0; }
.skill-node p { margin: 0 0 13px; color: var(--muted); font-size: 13px; }
.mastery-track { height: 4px; background: rgba(255,255,255,.08); }
.mastery-track span { display: block; height: 100%; background: var(--cyan); }

.report-layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; }
.report-card { padding: clamp(24px,4vw,42px); border: 1px solid var(--line); background: var(--panel); }
.report-card h3 { margin: 10px 0 28px; font-size: 24px; }
.diagnosis-card { grid-column: 1 / -1; }
.diagnosis-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.diagnosis-columns b { display: block; margin-bottom: 12px; }
.diagnosis-columns .good { color: var(--green); }
.diagnosis-columns .focus { color: var(--orange); }
.diagnosis-columns ul, .next-plan ol { margin: 0; padding-left: 20px; color: #b7ccd8; line-height: 1.8; }
.report-skill { margin-bottom: 20px; }
.report-skill header { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; }
.report-skill header span { color: var(--muted); }
.next-plan li { margin-bottom: 10px; padding-left: 7px; }

@media (max-width: 980px) {
  .mission-layout { grid-template-columns: 1fr; }
  .ship-panel { min-height: 410px; }
  .ship { top: 35%; }
  .ship-copy { bottom: 30px; }
  .ship-copy p { display: none; }
  .console { min-height: auto; }
  .report-layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topbar { width: min(100% - 28px); flex-wrap: wrap; padding: 14px 0; }
  .topbar nav { order: 3; width: 100%; overflow-x: auto; }
  .nav-button { flex: 1; white-space: nowrap; padding-inline: 10px; }
  main { width: min(100% - 24px); padding-top: 18px; }
  .mission-layout { border-radius: 18px; }
  .ship-panel { min-height: 350px; }
  .ship { transform: translate(-50%,-50%) rotate(-8deg) scale(.75); }
  .ship-copy h1 { font-size: 43px; }
  .screen { padding: 25px 20px; }
  .brief-grid, .result-grid, .skill-map, .diagnosis-columns { grid-template-columns: 1fr; }
  .route-options { grid-template-columns: 1fr; }
  .route-picker-head, .quest-line { align-items: flex-start; flex-direction: column; }
  .route-card { min-height: auto; }
  .brief-grid article { min-height: auto; }
  .brief-grid b { margin-top: 10px; }
  .answer-row { flex-wrap: wrap; }
  .answer-row input { flex-basis: calc(100% - 60px); }
  .answer-row .primary-button { width: 100%; }
  .task-actions, .complete-actions { flex-direction: column; }
  .ask-argo-form > div { flex-direction: column; }
  .page-head { display: block; }
  .page-head p { margin-top: 18px; }
  .skill-node { grid-template-columns: 58px 1fr; padding: 18px; }
  .skill-star { width: 54px; height: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

/* Компактный экран миссии и фотореалистичные миры */
.mission-layout { grid-template-columns: minmax(400px,.82fr) minmax(0,1.18fr); min-height: 620px; }
.ship-panel { min-height: 620px; background: #061526 top center / 100% auto no-repeat; }
body[data-route="space"] .ship-panel { background-image: url("assets/space-hero.webp"); }
body[data-route="ocean"] .ship-panel { background-image: url("assets/ocean-hero.webp"); }
body[data-route="catopolis"] .ship-panel { background-image: url("assets/catopolis-hero.webp"); }
.ship-panel::before { content:""; position:absolute; inset:0; z-index:1; background: linear-gradient(180deg,rgba(1,8,16,.05) 28%,rgba(1,8,16,.9) 92%),linear-gradient(90deg,rgba(1,8,16,.34),transparent 72%); }
.ship-panel::after { z-index:1; }
.orbit,.planet,.ship { display:none; }
.ship-copy { z-index:3; top:clamp(340px,32vw,455px); bottom:auto; }
.ship-copy h1 { max-width:100%; font-size:clamp(38px,4vw,60px); overflow-wrap:anywhere; }
.ship-copy h1 em { color:var(--route); -webkit-text-stroke:0; text-shadow:0 0 28px rgba(78,219,255,.22); }
.console,.screen,.task-card,.task-topline>div { min-width:0; max-width:100%; }
.screen { padding:28px 32px; }
#task-screen { padding:18px 26px; }
.analysis-note { margin:10px 0 0; padding:9px 12px; }
.task-card { margin-top:12px; padding:20px 24px; }
.quest-line { margin:-4px 0 14px; padding-bottom:10px; }
.task-card h2 { margin:14px 0 14px; font-size:clamp(20px,2vw,29px); line-height:1.24; overflow-wrap:anywhere; white-space:pre-line; }
.listen-button { margin:-2px 0 12px; padding:6px 9px; }
#answer-form label { margin-bottom:5px; }
.answer-row input { width:0; padding:10px 13px; font-size:18px; }
.primary-button,.ghost-button { min-height:42px; }
.task-actions { margin-top:10px; }
.voice-status { min-height:14px; margin:5px 0 0; }
.help-panel { margin-top:10px; padding:13px 15px; }
.help-panel p { margin-top:5px; }
.ask-argo-form { margin-top:11px; padding-top:10px; }
.privacy-note { margin-top:6px; }
.feedback-panel { margin-top:12px; padding:14px; }
.feedback-panel p { margin:5px 0 10px; }
.discovery-fact { padding:9px 11px; border-left:2px solid var(--orange); color:#ffe0bd !important; background:rgba(255,173,100,.08); font-size:12px; }
.story-arc { margin:18px 0; padding:14px 16px; border:1px solid var(--line); background:linear-gradient(90deg,var(--cyan-soft),transparent); }
.story-arc h3 { margin:5px 0; font-size:17px; }
.story-arc p { margin:0 0 9px; color:#b8cbd8; font-size:12px; }
.story-track { height:4px; overflow:hidden; background:rgba(255,255,255,.08); }
.story-track span { display:block; height:100%; width:8%; background:var(--route); transition:width .3s ease; }

.celebration-layer { position:fixed; inset:0; z-index:90; overflow:hidden; pointer-events:none; opacity:0; transition:opacity .15s ease; }
.celebration-layer.is-active { opacity:1; }
.celebration-layer.is-finale { background:radial-gradient(circle at 50% 42%,rgba(78,219,255,.13),transparent 54%); }
.celebration-piece { position:absolute; display:block; line-height:1; filter:drop-shadow(0 0 8px currentColor); will-change:transform,opacity; }
.falling-star { left:var(--x); top:-8vh; color:#fff1a8; font-size:var(--size); animation:star-fall var(--duration) var(--delay) ease-in forwards; }
.flying-comet { left:-18vw; top:var(--y); color:#dffbff; font-size:clamp(54px,8vw,96px); text-shadow:-24px 7px 18px #4edbff; animation:comet-fly 1.7s var(--delay) cubic-bezier(.22,.72,.45,1) forwards; }
.burst-piece { left:var(--ox); top:var(--oy); color:#fff0a8; font-size:var(--size); animation:celebration-burst 1.35s var(--delay) cubic-bezier(.15,.7,.25,1) both; }
.paw-step { left:var(--x); top:var(--y); color:#ffbd79; font-size:clamp(25px,4vw,43px); transform:rotate(var(--turn)); opacity:0; animation:paw-appear 1.1s var(--delay) ease-out forwards; }
.dog-paw { color:#ffd09e; }
.bubble-rise { left:var(--x); bottom:-9vh; color:#adfbff; font-size:var(--size); animation:bubble-float var(--duration) var(--delay) ease-out forwards; }
.dolphin-jump { left:-18vw; bottom:5vh; font-size:clamp(72px,12vw,142px); animation:dolphin-jump 2.25s cubic-bezier(.22,.7,.3,1) forwards; }
.whale-sweep { right:-20vw; bottom:8vh; font-size:clamp(86px,15vw,170px); transform:scaleX(-1); animation:whale-sweep 2.35s ease-in-out forwards; }
.whale-spray { right:42vw; bottom:37vh; color:#c5fbff; font-size:58px; opacity:0; animation:whale-spray 1.1s var(--delay) ease-out forwards; }
.calm-celebration { left:50%; top:45%; color:#fff2a6; font-size:74px; transform:translate(-50%,-50%); animation:calm-pop .65s ease-out forwards; }

@keyframes star-fall { 0% { transform:translate3d(0,-5vh,0) rotate(0); opacity:0; } 12% { opacity:1; } 100% { transform:translate3d(var(--drift),112vh,0) rotate(260deg); opacity:0; } }
@keyframes comet-fly { 0% { transform:translate3d(0,0,0) rotate(-18deg); opacity:0; } 12% { opacity:1; } 100% { transform:translate3d(138vw,55vh,0) rotate(-18deg); opacity:0; } }
@keyframes celebration-burst { 0% { transform:translate(-50%,-50%) scale(.1); opacity:0; } 16% { opacity:1; } 100% { transform:translate(calc(-50% + var(--tx)),calc(-50% + var(--ty))) rotate(200deg) scale(1.15); opacity:0; } }
@keyframes paw-appear { 0% { transform:rotate(var(--turn)) scale(.3); opacity:0; } 30%,70% { transform:rotate(var(--turn)) scale(1); opacity:1; } 100% { transform:rotate(var(--turn)) scale(.85); opacity:0; } }
@keyframes bubble-float { 0% { transform:translate3d(0,0,0) scale(.45); opacity:0; } 15% { opacity:.95; } 100% { transform:translate3d(var(--sway),-112vh,0) scale(1.1); opacity:0; } }
@keyframes dolphin-jump { 0% { transform:translate3d(0,8vh,0) rotate(-18deg); opacity:0; } 12% { opacity:1; } 48% { transform:translate3d(62vw,-48vh,0) rotate(-10deg); } 100% { transform:translate3d(132vw,10vh,0) rotate(20deg); opacity:0; } }
@keyframes whale-sweep { 0% { transform:translate3d(0,18vh,0) scaleX(-1) rotate(-8deg); opacity:0; } 18% { opacity:1; } 55% { transform:translate3d(-62vw,-18vh,0) scaleX(-1) rotate(8deg); } 100% { transform:translate3d(-132vw,15vh,0) scaleX(-1) rotate(-8deg); opacity:0; } }
@keyframes whale-spray { 0% { transform:translate(0,0) scale(.3); opacity:0; } 25% { opacity:1; } 100% { transform:translate(var(--tx),-100px) scale(1); opacity:0; } }
@keyframes calm-pop { 0% { transform:translate(-50%,-50%) scale(.65); opacity:0; } 35% { opacity:1; } 100% { transform:translate(-50%,-50%) scale(1.1); opacity:0; } }

@media (max-width:980px) {
  .mission-layout { grid-template-columns:minmax(0,1fr); }
  .ship-panel { min-height:145px; background-position:center 43%; background-size:cover; }
  .ship-panel::before { background:linear-gradient(90deg,rgba(1,8,16,.78),rgba(1,8,16,.1)),linear-gradient(180deg,transparent 25%,rgba(1,8,16,.58)); }
  .ship-copy { left:20px; right:16px; top:auto; bottom:16px; }
  .ship-copy h1 { margin:5px 0 0; font-size:26px; line-height:1; }
  .ship-copy p { display:none; }
}
@media (max-width:720px) {
  .topbar { width:calc(100% - 12px); min-height:44px; padding:0; justify-content:center; border-bottom:0; }
  .topbar .brand,.topbar .streak { display:none; }
  .topbar nav { width:100%; justify-content:center; }
  .nav-button { flex:1; max-width:180px; padding:8px 10px; }
  main { width:min(100% - 12px); padding:2px 0 12px; }
  .mission-layout { grid-template-rows:96px auto; border-radius:12px; overflow:hidden; }
  .ship-panel { min-height:96px; max-height:96px; }
  .ship-copy { left:14px; bottom:9px; }
  .ship-copy h1 { margin:3px 0 0; font-size:20px; line-height:.92; }
  .ship-copy h1 br { display:none; }
  .ship-copy .eyebrow { font-size:8px; }
  #briefing-screen { padding:8px 10px 10px; }
  #briefing-screen > .console-head,#briefing-screen > .argo-message,#briefing-screen > .brief-grid,#briefing-screen > .save-note { display:none; }
  .story-arc { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:0 0 7px; padding:8px 10px; }
  .story-arc h3 { margin:2px 0 0; font-size:12px; }
  .story-arc p { display:none; }
  .story-track { flex:0 0 58px; }
  .route-picker { margin:0 0 7px; padding:8px; }
  .route-picker-head { display:block; }
  .route-picker-head h3,.voice-toggle,.route-mission { display:none; }
  .route-options { grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; margin-top:7px; }
  .route-card { min-height:58px; padding:7px 5px; text-align:center; }
  .route-card span { font-size:18px; }
  .route-card b { margin:3px 0 0; font-size:11px; overflow-wrap:anywhere; }
  .route-card small { display:none; }
  #start-mission { width:100%; min-height:40px; }
  #task-screen { padding:11px 9px; }
  .task-topline { align-items:center; }
  .timer { padding:7px 9px; }
  .task-card { padding:13px; margin-top:8px; }
  .quest-line { gap:5px; margin:0 0 10px; font-size:9px; }
  .task-card h2 { margin:11px 0; font-size:19px; }
  .answer-row { flex-wrap:nowrap; gap:6px; }
  .answer-row input { flex:1 1 0; min-width:0; }
  .answer-row .primary-button { width:auto; flex:0 0 auto; padding-inline:12px; }
  #answer-unit { min-width:30px; }
  .task-actions { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
  .task-actions .ghost-button { padding:7px 8px; font-size:12px; }
  #voice-question { grid-column:1 / -1; }
  .help-panel,.feedback-panel { padding:11px; }
  .feedback-icon { flex-basis:34px; width:34px; height:34px; }
}

@media (min-width:981px) {
  .topbar { min-height:64px; }
  main { padding:14px 0; }
  .mission-layout { height:calc(100vh - 92px); min-height:560px; }
  .ship-panel,.console { min-height:0; height:100%; }
  #briefing-screen { height:100%; min-height:0; padding:18px 22px; }
  #briefing-screen .console-head h2 { font-size:clamp(25px,2.5vw,35px); }
  #briefing-screen .time-chip { padding:8px 10px; }
  #briefing-screen > .argo-message { margin:10px 0; padding:10px 12px; }
  #briefing-screen > .argo-message .avatar { flex-basis:32px; width:32px; height:32px; }
  #briefing-screen > .argo-message p { margin-top:4px; font-size:12px; line-height:1.35; }
  #briefing-screen .story-arc { margin:8px 0; padding:9px 12px; }
  #briefing-screen .story-arc h3 { font-size:15px; }
  #briefing-screen .story-arc p { margin-bottom:6px; line-height:1.3; }
  #briefing-screen .route-picker { margin:8px 0; padding:11px 12px; }
  #briefing-screen .route-picker h3 { font-size:16px; }
  #briefing-screen .route-options { gap:8px; margin-top:9px; }
  #briefing-screen .route-card { min-height:72px; padding:8px 10px; }
  #briefing-screen .route-card span { font-size:18px; }
  #briefing-screen .route-card b { margin:4px 0 2px; font-size:13px; }
  #briefing-screen .route-card small { font-size:11px; }
  #briefing-screen .route-mission { margin-top:7px; font-size:12px; }
  #briefing-screen #start-mission { min-height:40px; }
  #briefing-screen .save-note { margin:6px 0 0; }
}
