:root {
  --night: #06132f;
  --panel: rgba(8, 22, 53, .88);
  --panel-solid: #0c2048;
  --ink: #f7f4e8;
  --muted: #a9bedc;
  --gold: #ffd36a;
  --gold-deep: #b77a20;
  --cyan: #72e8ff;
  --coral: #ff806d;
  --mint: #74efc4;
  --line: rgba(178, 215, 255, .2);
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { color: var(--ink); background: var(--night); font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif; }
button { font: inherit; }

.observatory { position: relative; width: 100vw; height: 100vh; min-width: 1100px; min-height: 720px; overflow: hidden; isolation: isolate; }
.world { position: absolute; inset: 0; z-index: -3; background: linear-gradient(rgba(3, 10, 31, .18), rgba(3, 10, 31, .45)), url("art/observatory-world-01.webp") center / cover no-repeat; transform: scale(1.015); }
.sky-grain { position: absolute; inset: 0; z-index: -2; opacity: .22; pointer-events: none; background-image: radial-gradient(circle, rgba(255,255,255,.8) 0 1px, transparent 1.5px); background-size: 41px 41px; mask-image: linear-gradient(black, transparent 78%); }
.observatory::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(circle at 53% 40%, transparent 0 24%, rgba(2,7,22,.15) 58%, rgba(2,7,22,.65) 100%); }

.mission-rail { display: grid; grid-template-columns: 1fr 270px 1fr; align-items: center; gap: 24px; width: min(1320px, calc(100vw - 64px)); height: 92px; margin: 0 auto; padding: 18px 24px; border-bottom: 1px solid rgba(199,225,255,.16); }
.brand-lockup { display: flex; align-items: center; gap: 13px; }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid rgba(255,211,106,.55); border-radius: 15px; color: var(--gold); background: rgba(5,17,44,.7); box-shadow: inset 0 0 24px rgba(255,211,106,.12), 0 8px 28px rgba(0,0,0,.18); font-size: 24px; }
.brand-lockup span:not(.brand-mark), .scoreboard span, .adaptive-meter > span, .field-note > span, .log-card > span, .skill-chip span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.brand-lockup strong { display: block; margin-top: 3px; font-family: Georgia, serif; font-size: 19px; letter-spacing: .01em; }
.adaptive-meter { justify-self: center; width: 250px; }
.adaptive-meter > span { display: flex; justify-content: space-between; }
.adaptive-meter > span b { color: var(--ink); font-size: 15px; }
.adaptive-meter > i { display: block; height: 7px; margin: 7px 0 5px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.12); }
.adaptive-meter > i b { display: block; width: 18%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--gold)); box-shadow: 0 0 16px rgba(114,232,255,.6); transition: width 260ms ease-out; }
.adaptive-meter > strong { display: block; color: #d5e6fb; text-align: center; font-size: 12px; }
.scoreboard { justify-self: end; display: flex; gap: 8px; }
.scoreboard > div { min-width: 78px; padding: 8px 13px; border: 1px solid rgba(178,215,255,.15); border-radius: 14px; background: rgba(5,17,44,.62); }
.scoreboard span { display: block; }
.scoreboard strong { display: block; margin-top: 1px; font-size: 20px; }
.scoreboard strong i { color: var(--gold); font-style: normal; font-size: 15px; }

.game-deck { display: grid; grid-template-columns: 210px minmax(650px, 850px) 190px; justify-content: center; gap: 22px; width: min(1360px, calc(100vw - 48px)); height: calc(100vh - 118px); margin: 18px auto 0; }
.nova-panel, .equipment { position: relative; min-height: 0; }
.speech { position: relative; z-index: 4; width: 210px; min-height: 86px; padding: 15px 17px; border: 1px solid rgba(255,211,106,.45); border-radius: 19px 19px 19px 5px; color: #fff7d6; background: rgba(7,19,47,.92); box-shadow: 0 14px 35px rgba(0,0,0,.24); font-size: 13px; line-height: 1.45; }
.speech::after { content: ""; position: absolute; left: 25px; bottom: -10px; width: 18px; height: 18px; border-right: 1px solid rgba(255,211,106,.45); border-bottom: 1px solid rgba(255,211,106,.45); background: rgba(7,19,47,.92); transform: rotate(45deg); }
.mascot-wrap { position: relative; z-index: 3; width: 210px; height: 290px; margin-top: -3px; transform-origin: 50% 85%; transition: transform 180ms ease-out, filter 180ms ease-out; }
.mascot { position: absolute; inset: 8px -22px auto -16px; width: 245px; height: 245px; object-fit: contain; filter: drop-shadow(0 16px 16px rgba(0,0,0,.36)); }
.mascot-aura { position: absolute; left: 20px; top: 40px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(255,211,106,.2), transparent 68%); }
.reaction { position: absolute; top: 20px; right: 2px; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: #0c2048; background: var(--gold); box-shadow: 0 0 30px rgba(255,211,106,.72); opacity: 0; transform: scale(.4) rotate(-18deg); font-size: 22px; }
.mascot-wrap.is-happy { animation: owl-hop 620ms cubic-bezier(.18,.88,.3,1.35); }
.mascot-wrap.is-happy .reaction { animation: reaction-pop 720ms ease-out; }
.mascot-wrap.is-thinking { transform: rotate(-2deg) translateY(3px); filter: saturate(.8); }
.field-note { position: absolute; left: 0; bottom: 22px; width: 210px; min-height: 145px; padding: 17px; border: 1px solid rgba(178,215,255,.16); border-radius: 18px; background: rgba(7,19,47,.76); backdrop-filter: blur(10px); }
.field-note strong { display: block; margin: 6px 0; color: var(--gold); font-family: Georgia, serif; font-size: 17px; }
.field-note p { margin: 0; color: #c3d4ea; font-size: 12px; line-height: 1.45; }

.mission-card { display: grid; grid-template-rows: auto minmax(355px, 1fr) 24px minmax(70px, auto); min-height: 0; padding: 22px 26px 20px; border: 1px solid rgba(178,215,255,.24); border-radius: 30px; background: linear-gradient(160deg, rgba(11,30,70,.91), rgba(5,15,42,.94)); box-shadow: 0 30px 80px rgba(0,0,0,.38), inset 0 1px 0 rgba(255,255,255,.1); backdrop-filter: blur(14px); }
.mission-copy { text-align: center; }
.kicker { color: var(--cyan); font-size: 11px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 5px 0 4px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(27px, 2.5vw, 38px); font-weight: 600; line-height: 1.05; letter-spacing: -.025em; }
.mission-copy p { margin: 0; color: #bfd2ea; font-size: 14px; }
.sky-window { position: relative; min-height: 350px; margin-top: 15px; overflow: hidden; border: 1px solid rgba(143,206,255,.26); border-radius: 24px; background: radial-gradient(circle at 50% 42%, #102d67, #071638 65%, #040d24); box-shadow: inset 0 0 70px rgba(31,111,193,.14), 0 16px 36px rgba(0,0,0,.2); }
.sky-window::before { content: ""; position: absolute; inset: 0; opacity: .28; background-image: radial-gradient(circle, #fff 0 1px, transparent 1.2px); background-size: 33px 29px; transform: rotate(5deg); }
.scope-corners i { position: absolute; z-index: 3; width: 30px; height: 30px; border-color: rgba(114,232,255,.38); border-style: solid; pointer-events: none; }
.scope-corners i:nth-child(1) { left: 14px; top: 14px; border-width: 1px 0 0 1px; border-radius: 8px 0 0; }
.scope-corners i:nth-child(2) { right: 14px; top: 14px; border-width: 1px 1px 0 0; border-radius: 0 8px 0 0; }
.scope-corners i:nth-child(3) { right: 14px; bottom: 14px; border-width: 0 1px 1px 0; border-radius: 0 0 8px; }
.scope-corners i:nth-child(4) { left: 14px; bottom: 14px; border-width: 0 0 1px 1px; border-radius: 0 0 0 8px; }
#starMap { position: relative; z-index: 2; display: block; width: 100%; height: 100%; min-height: 350px; overflow: visible; }
.star-hit { cursor: pointer; }
.star-hit circle:first-child { fill: transparent; }
.star-core { fill: #fffbe8; filter: url(#starGlow); transition: transform 130ms ease-out, fill 130ms ease-out; transform-box: fill-box; transform-origin: center; }
.star-hit:hover .star-core, .star-hit:focus .star-core { fill: var(--gold); transform: scale(1.42); }
.star-hit:focus { outline: none; }
.star-hit:focus .star-ring { stroke: var(--cyan); stroke-width: 3; opacity: 1; }
.star-ring { fill: transparent; stroke: rgba(114,232,255,.4); stroke-width: 1; opacity: .45; }
.star-hit.is-connected .star-core { fill: var(--gold); transform: scale(1.25); }
.constellation-line { fill: none; stroke: var(--cyan); stroke-width: 3; stroke-linecap: round; filter: url(#lineGlow); stroke-dasharray: 900; stroke-dashoffset: 0; animation: draw-line 380ms ease-out both; }
.constellation-line.is-guide { stroke: rgba(114,232,255,.24); stroke-width: 2; stroke-dasharray: 6 8; animation: none; }
.candidate-region { cursor: pointer; }
.candidate-region .region-hit { fill: rgba(114,232,255,.025); stroke: rgba(114,232,255,.13); stroke-width: 1; stroke-dasharray: 5 8; transition: fill 150ms ease-out, stroke 150ms ease-out; }
.candidate-region:hover .region-hit, .candidate-region:focus .region-hit { fill: rgba(114,232,255,.1); stroke: rgba(114,232,255,.65); }
.candidate-region:focus { outline: none; }
.field-star { fill: rgba(234,244,255,.8); }
.sky-label { fill: #a9c5e5; font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.sky-status { position: absolute; z-index: 4; left: 50%; bottom: 12px; padding: 7px 12px; border: 1px solid rgba(178,215,255,.18); border-radius: 99px; color: #bed5ed; background: rgba(3,12,34,.72); opacity: 0; transform: translate(-50%, 8px); transition: 160ms ease-out; font-size: 11px; font-weight: 800; }
.sky-status.is-visible { opacity: 1; transform: translate(-50%, 0); }
.feedback { min-height: 24px; padding-top: 5px; color: var(--mint); text-align: center; font-size: 13px; font-weight: 800; }
.feedback.is-error { color: #ffab9e; }
.mission-card.is-wrong { animation: gentle-shake 300ms ease-out; }
.action-dock { display: flex; align-items: end; justify-content: center; gap: 11px; min-height: 62px; }
.choice, .primary { position: relative; min-width: 145px; min-height: 52px; padding: 11px 18px; border: 1px solid rgba(178,215,255,.28); border-radius: 16px; color: var(--ink); background: rgba(17,44,91,.9); box-shadow: 0 6px 0 #06142e, inset 0 1px 0 rgba(255,255,255,.09); cursor: pointer; font-weight: 800; transition: transform 130ms ease-out, border-color 130ms ease-out, background 130ms ease-out, box-shadow 130ms ease-out; }
.choice:hover, .primary:hover { transform: translateY(-3px); border-color: rgba(114,232,255,.7); background: #183e7b; box-shadow: 0 9px 0 #06142e; }
.choice:active, .primary:active { transform: translateY(4px); box-shadow: 0 2px 0 #06142e; }
.choice:focus-visible, .primary:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.choice small { display: block; margin-top: 3px; color: #9bb7d8; font-size: 10px; font-weight: 700; }
.primary { min-width: 220px; color: #092044; border-color: #ffe39b; background: linear-gradient(#ffe086, #ffc857); box-shadow: 0 6px 0 #9b6018, inset 0 1px 0 #fff6cb; }
.primary:hover { border-color: #fff; background: #ffe28e; box-shadow: 0 9px 0 #9b6018; }

.equipment { display: flex; flex-direction: column; align-items: center; padding-top: 40px; }
.equipment > img { width: 210px; height: 210px; object-fit: contain; filter: drop-shadow(0 18px 20px rgba(0,0,0,.38)); transform: translateX(-4px); }
.log-card { width: 180px; margin-top: -4px; padding: 16px; border: 1px solid rgba(255,211,106,.24); border-radius: 17px; background: rgba(7,19,47,.82); backdrop-filter: blur(10px); }
.mission-pips { display: flex; gap: 8px; margin: 11px 0 9px; }
.mission-pips i { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid rgba(178,215,255,.26); border-radius: 50%; color: rgba(178,215,255,.5); font-style: normal; font-size: 11px; }
.mission-pips i.is-done { color: #092044; border-color: var(--gold); background: var(--gold); box-shadow: 0 0 15px rgba(255,211,106,.35); }
.log-card p { margin: 0; color: #c1d3e8; font-size: 12px; }
.skill-chip { width: 180px; margin-top: 12px; padding: 12px 15px; border-radius: 15px; background: rgba(7,19,47,.72); }
.skill-chip strong { display: block; margin-top: 3px; color: var(--cyan); font-size: 13px; }
.celebration { position: absolute; inset: 0; z-index: 30; overflow: hidden; pointer-events: none; }
.celebration i { position: absolute; left: 50%; top: 45%; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 14px var(--gold); animation: burst 800ms ease-out forwards; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 40; padding: 11px 18px; border: 1px solid rgba(255,255,255,.15); border-radius: 99px; color: white; background: #081a3c; box-shadow: 0 12px 30px rgba(0,0,0,.35); opacity: 0; transform: translate(-50%, 12px); transition: 180ms ease-out; pointer-events: none; font-size: 13px; font-weight: 800; }
.toast.is-showing { opacity: 1; transform: translate(-50%, 0); }

@keyframes draw-line { from { stroke-dashoffset: 900; } }
@keyframes gentle-shake { 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
@keyframes owl-hop { 0%,100% { transform: none; } 35% { transform: translateY(-15px) rotate(3deg); } 62% { transform: translateY(2px) rotate(-2deg); } }
@keyframes reaction-pop { 0% { opacity: 0; transform: scale(.4) rotate(-18deg); } 30% { opacity: 1; transform: scale(1.2) rotate(8deg); } 75% { opacity: 1; transform: scale(1) rotate(0); } 100% { opacity: 0; transform: translateY(-20px) scale(.8); } }
@keyframes burst { to { opacity: 0; transform: translate(var(--x), var(--y)) rotate(180deg) scale(.2); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
