/* Written with the help of Claude, an AI assistant made by Anthropic, as directed and reviewed by the team. See "Use of AI" in README.md. Licensed under Apache-2.0 (see LICENSE). */

/* Base layout. The full sticker look, fonts and effects arrive in build step 7. */
:root {
  --bg: #0b1030; --bg2: #141a4a; --card: #1d2563; --card2: #28327c; --line: #3d48a0; --ink: #070a22;
  --text: #f2f3ff; --muted: #aab2e6; --accent: #ffd166; --accent2: #5ee6c8; --pink: #ff6b9d; --blue: #7cc4ff; --violet: #a78bfa;
  --good: #06d6a0; --warn: #ffb547; --bad: #ef476f;
  --radius: 18px; --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Lilita One", "Baloo 2", system-ui, sans-serif; --round: "Baloo 2", "Nunito", system-ui, sans-serif;
  --title: "Bungee", "Lilita One", system-ui, sans-serif; --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --sticker: 0 5px 0 var(--ink); --sticker-sm: 0 3px 0 var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 var(--font); }
body { min-height: 100vh; overflow-x: hidden; }
h1, h2, h3, h4 { margin: .3em 0 .4em; line-height: 1.15; }
h2 { font-size: 1.6rem; } h3 { font-size: 1.1rem; } h4 { font-size: .95rem; }
p { margin: .4em 0; }
a { color: var(--accent2); }
button { font: inherit; color: inherit; }
.small { font-size: .85rem; } .muted { color: var(--muted); } .mono { font-family: var(--mono); }
.good { color: var(--good); } .warnc { color: var(--warn); } .badc { color: var(--bad); }
.eyebrow { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent2); font-weight: 700; }
.row { display: flex; align-items: center; gap: .5rem; }
.row.gap { gap: .6rem; } .row.wrap { flex-wrap: wrap; } .row.end { justify-content: flex-end; } .row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: .7rem; align-items: center; }
.grow { flex: 1; }
.pill { display: inline-block; padding: .1em .55em; border-radius: 99px; background: var(--card2); border: 1px solid var(--line); font-size: .75rem; font-weight: 600; white-space: nowrap; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .5rem; padding: .5rem 16px; background: rgba(11, 16, 48, .92); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.brand { background: none; border: 0; font-weight: 800; cursor: pointer; padding: .2rem; white-space: nowrap; }
.brand:disabled { cursor: default; }
.tb-mission { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iconbtn { background: var(--card); border: 1px solid var(--line); border-radius: 10px; width: 2.3rem; height: 2.3rem; cursor: pointer; flex: none; }

/* main */
.app { max-width: 1100px; margin: 0 auto; padding: 16px 16px 64px; }
.narrow { max-width: 720px; margin: 0 auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; }

/* buttons */
.btn { background: var(--card2); border: 2px solid var(--line); border-radius: 12px; padding: .55em 1em; font-weight: 700; cursor: pointer; transition: transform .08s; }
.btn:active:not(:disabled) { transform: scale(.96); }
.btn.primary { background: var(--accent); color: #1b1f3b; border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.small { padding: .3em .7em; font-size: .85rem; }
.btn.big { padding: .75em 1.4em; font-size: 1.1rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--accent2); outline-offset: 2px; }

/* choice cards */
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem; }
.choice { display: flex; flex-direction: column; gap: .25rem; text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: .7rem .8rem; cursor: pointer; }
.choice.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.field { display: flex; flex-direction: column; gap: .3rem; margin: 1rem 0; }
.field span:first-child { font-weight: 700; }
input[type=text], textarea { background: var(--bg2); color: var(--text); border: 2px solid var(--line); border-radius: 10px; padding: .6em .8em; font: inherit; width: 100%; }
input[type=range] { flex: 1; min-width: 120px; accent-color: var(--accent); }
textarea.code { font-family: var(--mono); font-size: .8rem; word-break: break-all; }

/* title */
.title-screen { text-align: center; padding: 8vh 0 2rem; }
.game-title { font-size: clamp(2.2rem, 8vw, 4rem); margin: .2em 0; }
.game-title small { display: block; font-size: .45em; color: var(--accent2); }
.lede { max-width: 560px; margin: 0 auto 1.5rem; color: var(--muted); font-size: 1.05rem; }

/* mission control */
.missions { display: grid; gap: .7rem; margin: 1rem 0; }
.mission { display: flex; align-items: center; gap: .9rem; text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; cursor: pointer; width: 100%; }
.mission.locked { opacity: .55; cursor: not-allowed; }
.mission .planet { font-size: 2.4rem; flex: none; }
.mission .mtext { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.mission .mscore { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.stars { color: var(--accent); letter-spacing: .1em; }
table { width: 100%; border-collapse: collapse; }
td { padding: .35rem .3rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.score td:last-child { text-align: right; } tr.tot td { font-weight: 800; border-bottom: 0; }

/* dialog */
.dialog { display: flex; flex-direction: column; gap: .6rem; margin: 1rem 0; }
.line { display: flex; gap: .6rem; align-items: flex-start; }
.face { flex: none; width: 2.8rem; height: 2.8rem; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; background: var(--card2); border: 2px solid var(--crew); }
.bubble { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .5rem .8rem; flex: 1; min-width: 0; }
.bubble p { margin: .2rem 0 0; }
.objs, .how ol { padding-left: 1.3rem; }
.card.goal.sel { border-color: var(--accent); }

/* hangar */
.goalchip { border-radius: 12px; padding: .5rem .8rem; margin: .6rem 0; font-size: .9rem; border: 1px solid var(--line); }
.goalchip.ok { background: rgba(6, 214, 160, .12); border-color: var(--good); } .goalchip.warn { background: rgba(255, 181, 71, .12); border-color: var(--warn); }
.meters { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .5rem .9rem; }
.meter .row { justify-content: space-between; gap: .4rem; }
.meter .row span { flex: 1; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter .bar { height: 8px; border-radius: 99px; background: var(--bg2); overflow: hidden; margin-top: .25rem; }
.meter .bar i { display: block; height: 100%; background: var(--good); }
.meter.warn .bar i { background: var(--warn); } .meter.bad .bar i { background: var(--bad); }
.meter .fix { color: var(--warn); margin-top: .15rem; } .meter.bad .fix { color: var(--bad); }
.qbtn { flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 1px solid var(--line); background: var(--card2); cursor: pointer; font-size: .8rem; font-weight: 800; }
.tabs { display: flex; gap: .4rem; margin: .8rem 0 0; }
.tab { background: transparent; border: 2px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; padding: .45rem 1rem; cursor: pointer; font-weight: 700; }
.tab.sel { background: var(--card); border-color: var(--accent); }
.hangar-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.hangar-grid .card { margin: 0; }
.shelf { max-height: 70vh; overflow-y: auto; }
.shelf-cat { margin-bottom: .6rem; }
.part { display: flex; flex-direction: column; gap: .1rem; width: 100%; text-align: left; background: var(--bg2); border: 2px solid var(--line); border-left: 6px solid var(--cat); border-radius: 10px; padding: .45rem .6rem; margin: .3rem 0; cursor: pointer; }
.part.on { box-shadow: 0 0 0 2px var(--cat) inset; }
.part.locked { opacity: .5; }
.goalstar { color: var(--accent); font-size: .8rem; }
.chip { display: inline-block; border: 2px solid var(--cat); border-radius: 99px; padding: .05rem .5rem; font-size: .8rem; }
.plan h3 { margin-top: 1rem; }
.plan.locked .choice { opacity: .6; }
details.adv { margin-top: 1rem; border: 1px solid var(--line); border-radius: 12px; padding: .5rem .8rem; }
details summary { cursor: pointer; font-weight: 700; }

/* review */
.summary.ok { border-color: var(--good); } .summary.warn { border-color: var(--warn); } .summary.bad { border-color: var(--bad); }
.ritem { display: flex; gap: .6rem; padding: .4rem 0; border-top: 1px solid var(--line); }
.ricon { flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: #1b1f3b; }
.ritem.ok .ricon { background: var(--good); } .ritem.warn .ricon { background: var(--warn); } .ritem.block .ricon { background: var(--bad); }

/* flight */
.game-card { max-width: 640px; margin: 1rem auto; text-align: center; }
.verdict { border-radius: 12px; padding: .6rem; margin: .8rem 0; }
.verdict.good { background: rgba(6, 214, 160, .12); } .verdict.ok { background: rgba(255, 209, 102, .12); } .verdict.bad { background: rgba(239, 71, 111, .14); }
.game-card .row { justify-content: center; }
.log { list-style: none; padding: 0; margin: .3rem 0; }
.log li { padding: .25rem 0 .25rem .9rem; border-left: 3px solid var(--line); margin: .2rem 0; font-size: .9rem; }
.log li.good { border-color: var(--good); } .log li.warn { border-color: var(--warn); } .log li.bad { border-color: var(--bad); }
.explore-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.explore-grid .card { margin: 0; }
.planetmap { position: relative; width: 100%; max-width: 360px; aspect-ratio: 1; margin: 0 auto; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--pc) 70%, white), var(--pc) 55%, color-mix(in srgb, var(--pc) 50%, black)); }
.nocov { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(45deg, rgba(0, 0, 0, .45) 0 6px, rgba(0, 0, 0, .25) 6px 12px); }
.nocov.top { top: 0; } .nocov.bot { bottom: 0; }
.sitedot { position: absolute; transform: translate(-50%, -50%); width: 1.8rem; height: 1.8rem; border-radius: 50%; border: 3px solid #fff; background: rgba(27, 31, 59, .8); cursor: pointer; font-size: .75rem; font-weight: 800; padding: 0; }
.sitedot.found { background: var(--good); color: #1b1f3b; }
.sitedot.sel { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 209, 102, .5); }
.findlist { list-style: none; padding: 0; }
.findlist li { display: grid; grid-template-columns: 7.5rem 1fr 1fr; gap: .4rem; padding: .3rem 0; border-top: 1px solid var(--line); }
.finds { display: grid; gap: .6rem; }
.find { background: var(--bg2); border: 2px solid var(--accent2); border-radius: 12px; padding: .6rem .8rem; }
.find .pill { margin-left: .4rem; }
.event { text-align: center; }
.ev-icon { font-size: 2.6rem; }
.outcome { padding: .5rem; border-radius: 10px; } .outcome.good { background: rgba(6, 214, 160, .12); } .outcome.bad { background: rgba(239, 71, 111, .14); }

/* report */
.report-top { display: flex; align-items: center; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.bigstars { font-size: 2.4rem; } .total { font-size: 1.8rem; font-weight: 800; }
.objlist { list-style: none; padding: 0; } .objlist li { padding: .3rem 0; }
.objlist li.good { color: var(--text); } .objlist li.bad { color: var(--muted); }
.links li { margin: .4rem 0; }

/* overlays */
.modal-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(5, 8, 25, .7); display: grid; place-items: center; padding: 16px; }
.modal-wrap[hidden] { display: none; }
.modal-box { background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 18px; width: 100%; max-width: 460px; max-height: 88vh; overflow-y: auto; }
.modal-box.wide { max-width: 640px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; width: min(420px, 100%); background: var(--bg2); border-left: 2px solid var(--line); padding: 16px; overflow-y: auto; }
.drawer[hidden] { display: none; }
.drawer details { margin: .6rem 0; border-bottom: 1px solid var(--line); padding-bottom: .5rem; }
.toasts { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: .4rem; width: min(420px, calc(100% - 32px)); pointer-events: none; }
.toast { background: var(--card2); border: 2px solid var(--accent); border-radius: 12px; padding: .55rem .8rem; text-align: center; transition: opacity .4s; }
.toast.out { opacity: 0; }

/* ---------- hangar: the spacecraft ---------- */
.center { text-align: center; }
.ship-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .4rem; }
.ship { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 0; user-select: none; -webkit-user-select: none; }
.ship-row { display: flex; gap: 10px; justify-content: center; align-items: flex-end; }
.ship-row.mid { align-items: center; width: 100%; gap: 6px; }
.ship-row.bot { align-items: flex-start; }
.wings { display: flex; flex-direction: column; gap: 6px; flex: none; }
.body { flex: 0 1 250px; min-width: 0; padding: 8px; border-radius: 18px; border: 3px solid #0d1238; color: #1b1f3b;
  background: linear-gradient(160deg, color-mix(in srgb, var(--paint) 92%, white), color-mix(in srgb, var(--paint) 70%, black)); box-shadow: 0 6px 0 rgba(0, 0, 0, .3); }
.body-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; min-width: 0; }
.nameplate { font-weight: 800; font-size: .8rem; background: rgba(13, 18, 56, .85); color: #fff; padding: .1rem .5rem; border-radius: 99px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zone { margin-top: 4px; }
.zl { display: block; font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; opacity: .75; margin-bottom: 2px; }
.mgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.mount { width: 64px; height: 56px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font-size: .66rem; line-height: 1.05; text-align: center; padding: 2px; touch-action: pan-y; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; transition: transform .1s; }
.mgrid .mount { width: auto; min-width: 0; }
.mount .mi { font-size: 1.25rem; line-height: 1; }
.mount .ml { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mount.empty { border: 2px dashed rgba(169, 176, 224, .55); background: rgba(11, 16, 48, .35); color: var(--muted); }
.mount.empty .mi { opacity: .45; filter: grayscale(1); }
.body .mount.empty { border-color: rgba(13, 18, 56, .45); background: rgba(255, 255, 255, .28); color: rgba(13, 18, 56, .75); }
.mount.locked { opacity: .45; }
.mount.full { background: var(--card2); border: 2px solid var(--cat); color: var(--text); cursor: grab; box-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.mount.wing { width: 58px; height: 62px; }
.mount.full.solar { background: repeating-linear-gradient(90deg, #24409a 0 9px, #3a62d6 9px 11px); border-color: #9ec0ff; }
.mount.full.rtg { background: repeating-linear-gradient(0deg, #4a4f6e 0 6px, #2f3350 6px 9px); }
.mount.ant { border-radius: 50% 50% 12px 12px; }
.mount.cap { border-radius: 40px 40px 10px 10px; }
.mount.eng { border-radius: 8px 8px 26px 26px; }
.mount.lnd { border-radius: 10px 10px 4px 4px; }
.patch-img { width: 42px; height: 42px; border-radius: 50%; flex: none; display: inline-grid; place-items: center; background: rgba(13, 18, 56, .25); }
.patch-img.big { width: 72px; height: 72px; }
.patch-img.empty { font-size: 1.2rem; }
/* drag and drop */
.part, .mount.full { -webkit-touch-callout: none; }
.part { touch-action: pan-y; user-select: none; -webkit-user-select: none; }
body.dragging, body.dragging * { cursor: grabbing !important; }
body.dragging .mount.can { outline: 3px dashed var(--good); outline-offset: 2px; }
body.dragging .mount.nope { opacity: .3; }
.mount.over { transform: scale(1.1); background: rgba(6, 214, 160, .45) !important; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; padding: .45rem .75rem; border-radius: 12px; background: var(--card2);
  border: 2px solid var(--cat); font-weight: 800; box-shadow: 0 10px 24px rgba(0, 0, 0, .5); white-space: nowrap; }
.shelf-tip { margin-top: 0; }
/* paint tab */
.paint-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px; }
.paint-grid > .card { margin: 0; }
.swatches { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0; }
.swatch { width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 3px solid var(--line); background: var(--sw); cursor: pointer; padding: 0; }
.swatch.sel { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 209, 102, .4); }
.small-sw .swatch { width: 1.8rem; height: 1.8rem; }
.patch-editor { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.patchwrap { position: relative; width: min(280px, 100%); aspect-ratio: 1; flex: none; }
.patchwrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#patchArt { touch-action: none; cursor: crosshair; }
#patchRing { pointer-events: none; }
.tools { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: .5rem; }
.stamps { display: flex; flex-wrap: wrap; gap: .3rem; }
.stampbtn { width: 2.2rem; height: 2.2rem; border-radius: 10px; border: 2px solid var(--line); background: var(--bg2); cursor: pointer; font-size: 1.1rem; padding: 0; }
.stampbtn.sel { border-color: var(--accent); }
/* compare tab */
.tablewrap { overflow-x: auto; }
table.compare { min-width: 420px; }
table.compare th { text-align: left; padding: .35rem .3rem; border-bottom: 1px solid var(--line); font-size: .85rem; vertical-align: top; }
table.compare td { font-size: .9rem; }
table.compare td.best { color: var(--good); font-weight: 800; }

/* ---------- minigames ---------- */
.game-wrap { max-width: 900px; margin: 0 auto; }
.ghud { min-height: 1.6em; font-size: .9rem; color: var(--muted); margin: .2rem 0 .4rem; }
.ghud b { color: var(--text); font-family: var(--mono); }
.gcanvas { width: 100%; border-radius: var(--radius); overflow: hidden; border: 2px solid var(--line); background: #060a24; }
.gcanvas canvas { display: block; width: 100%; touch-action: none; }
.touch { display: flex; gap: .5rem; margin-top: .6rem; justify-content: center; user-select: none; -webkit-user-select: none; }
.tbtn { flex: 1; max-width: 140px; min-height: 3.4rem; border-radius: 14px; border: 2px solid var(--line); background: var(--card2); font-weight: 800; font-size: 1rem;
  touch-action: none; -webkit-touch-callout: none; cursor: pointer; }
.tbtn.wide { max-width: 260px; }
.tbtn.on { background: var(--accent); color: #1b1f3b; border-color: var(--accent); transform: scale(.96); }
.keys { margin: .6rem 0; }
.effects { text-align: left; background: var(--bg2); border-radius: 12px; padding: .5rem .8rem; margin: .7rem 0; font-size: .9rem; }
.effects ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.lesson { background: rgba(255, 209, 102, .1); border-radius: 10px; padding: .4rem .6rem; }
.scanbox canvas { width: 100%; height: auto; border-radius: 10px; display: block; margin: .4rem 0; }
/* power emergency */
.crisis-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .5rem; margin: .6rem 0; }
.crisis-stats div { background: var(--bg2); border-radius: 10px; padding: .4rem .6rem; display: flex; flex-direction: column; }
.battery .bar { height: 14px; border-radius: 99px; background: var(--bg2); overflow: hidden; margin: .3rem 0 .6rem; }
.battery .bar i { display: block; height: 100%; background: var(--good); transition: width .3s; }
.battery .bar i.low { background: var(--bad); }
.loads { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .5rem; margin: .5rem 0; }
.load { display: flex; flex-direction: column; gap: .15rem; text-align: left; padding: .55rem .7rem; border-radius: 12px; border: 2px solid var(--line); background: var(--bg2); cursor: pointer; opacity: .75; }
.load.on { border-color: var(--good); background: rgba(6, 214, 160, .1); opacity: 1; }

/* ---------- beginner mode: coach and tour ---------- */
.coach { display: flex; gap: .7rem; align-items: flex-start; background: var(--card); border: 2px solid var(--accent); border-radius: var(--radius); padding: .7rem .9rem; margin: .6rem 0; }
.coach-body { flex: 1; min-width: 0; }
.coach-body p { margin: .15rem 0 .45rem; }
.checks { display: inline-flex; flex-wrap: wrap; gap: .3rem; }
.check { font-size: .75rem; font-weight: 700; padding: .1rem .5rem; border-radius: 99px; background: var(--bg2); color: var(--muted); border: 1px solid var(--line); }
.check.ok { color: var(--good); border-color: var(--good); }
.tour { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.tour-spot { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(5, 8, 25, .72); outline: 3px solid var(--accent); transition: all .25s ease; }
.tour-tip { position: fixed; left: 50%; transform: translateX(-50%); width: min(460px, calc(100% - 32px)); background: var(--card2); border: 2px solid var(--accent);
  border-radius: 16px; padding: .8rem 1rem; pointer-events: auto; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.tour-tip.at-top { top: 70px; } .tour-tip.at-bottom { bottom: 16px; }
.tour-tip p { margin: 0 0 .5rem; }
@media (prefers-reduced-motion: reduce) { .tour-spot { transition: none; } }

/* ---------- look and feel: cosmic sticker style ---------- */
html { background: radial-gradient(1200px 700px at 85% -10%, rgba(167, 139, 250, .22), transparent 60%),
  radial-gradient(900px 600px at -10% 110%, rgba(94, 230, 200, .14), transparent 60%), var(--bg); background-attachment: fixed; }
body { background: transparent; }
#bgSpace, #fxLayer { position: fixed; inset: 0; pointer-events: none; }
#bgSpace { z-index: 0; } #fxLayer { z-index: 90; }
.topbar, .app { position: relative; z-index: 1; }
.topbar { position: sticky; z-index: 20; background: rgba(11, 16, 48, .85); border-bottom: 3px solid var(--ink); }
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: .01em; }
h3, h4 { font-family: var(--round); font-weight: 800; }
.eyebrow { font-family: var(--font); font-weight: 800; }
.brand { font-family: var(--title); font-size: 1rem; letter-spacing: .02em; color: var(--accent); }
.mono, .meter .mono, .total, .ghud b { font-family: var(--mono); }

/* sticker cards */
.card, .choice, .mission, .modal-box, .coach, .bubble, .meters, .gcanvas, .tour-tip {
  border: 3px solid var(--ink); box-shadow: var(--sticker); border-radius: var(--radius); }
.card { background: linear-gradient(180deg, var(--card), color-mix(in srgb, var(--card) 85%, black)); }
.choice { background: var(--card); transition: transform .12s, border-color .12s; }
.choice:hover { transform: translateY(-2px); }
.choice.sel { border-color: var(--accent); box-shadow: 0 5px 0 #b8892b; }
.mission { background: var(--card); transition: transform .12s; }
.mission:not(.locked):hover { transform: translateY(-3px) rotate(-.4deg); }
.part { border: 3px solid var(--ink); border-left: 8px solid var(--cat); box-shadow: var(--sticker-sm); transition: transform .1s; }
.part:hover { transform: translateX(3px); }
.mount.full { border-width: 3px; box-shadow: var(--sticker-sm); }
.pill { border: 2px solid var(--ink); }
.tab { border: 3px solid var(--ink); border-bottom: 0; }
.tab.sel { background: var(--accent); color: #1b1f3b; border-color: var(--ink); }
.qbtn, .iconbtn { border: 2px solid var(--ink); box-shadow: 0 2px 0 var(--ink); }

/* squishy buttons */
.btn { font-family: var(--round); font-weight: 800; border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 var(--ink);
  transition: transform .08s, box-shadow .08s, filter .12s; }
.btn:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 5px 0 var(--ink); }
.btn:active:not(:disabled) { transform: translateY(3px) scale(.97); box-shadow: 0 1px 0 var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--ink); color: #1b1f3b; }
.btn.ghost { background: var(--card2); }
.btn.big { font-size: 1.15rem; padding: .7em 1.5em; }
.tbtn { border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); font-family: var(--round); }
.tbtn.on { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.iconbtn:active, .qbtn:active { transform: translateY(2px); box-shadow: none; }

/* title hero */
.game-title { font-family: var(--title); font-weight: 400; color: var(--accent); text-shadow: 0 5px 0 var(--ink), 0 0 30px rgba(255, 209, 102, .35); line-height: 1.05; }
.game-title small { font-family: var(--display); color: var(--accent2); text-shadow: 0 3px 0 var(--ink); letter-spacing: .04em; margin-top: .2em; }
.hero { position: relative; width: 190px; height: 190px; margin: 0 auto 1rem; }
.hero-planet { position: absolute; inset: 25px; width: 140px; height: 140px; animation: bob 4s ease-in-out infinite; }
.hero .ring { position: absolute; inset: 50%; border: 2px solid rgba(94, 230, 200, .6); border-radius: 50%; animation: ping 3s ease-out infinite; }
.hero .r2 { animation-delay: 1s; } .hero .r3 { animation-delay: 2s; }
.hero .orbit { position: absolute; inset: 0; animation: spin 9s linear infinite; }
.hero .sat { position: absolute; top: -4px; left: 50%; font-size: 1.6rem; transform: translateX(-50%) rotate(90deg); }
@keyframes bob { 50% { transform: translateY(-6px) rotate(2deg); } }
@keyframes ping { 0% { inset: 45%; opacity: 1; } 100% { inset: -20%; opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* planets with faces */
.planet-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.mission .planet { width: 64px; height: 64px; font-size: 2rem; display: grid; place-items: center; }
.mission:not(.locked):hover .planet-svg { animation: wiggle .5s ease; }
@keyframes wiggle { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
.brief-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brief-planet { width: 96px; height: 96px; flex: none; animation: bob 4s ease-in-out infinite; }
.report-planet { width: 84px; height: 84px; }
.face { overflow: hidden; background: color-mix(in srgb, var(--crew) 30%, #1b2257); border: 3px solid var(--ink); box-shadow: 0 2px 0 var(--ink); }
.face svg { display: block; }
.coach .face, .tour-tip .face, .line .face { width: 3.1rem; height: 3.1rem; flex: none; }
.bubble { background: var(--card); position: relative; }
.bubble::before { content: ""; position: absolute; left: -10px; top: 14px; border: 8px solid transparent; border-right-color: var(--ink); }

/* googly-eyed spacecraft */
.body { position: relative; border-width: 3px; border-color: var(--ink); box-shadow: 0 6px 0 var(--ink); }
.googly { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; pointer-events: none; z-index: 2; }
.googly i { width: 22px; height: 22px; background: #fff; border: 3px solid var(--ink); border-radius: 50%; position: relative; display: block; }
.googly b { position: absolute; width: 9px; height: 9px; background: var(--ink); border-radius: 50%; left: 4px; top: 5px; animation: googly 3.5s ease-in-out infinite; }
.googly i:last-child b { animation-delay: .15s; }
@keyframes googly { 0%, 100% { transform: translate(0, 0); } 30% { transform: translate(4px, 3px); } 60% { transform: translate(1px, 5px); } 80% { transform: translate(3px, 0); } }
.ship-row.top { margin-bottom: 10px; }

/* small touches */
.meter .bar, .battery .bar { border: 2px solid var(--ink); }
.meter .bar i { border-radius: 99px; }
.verdict { border: 3px solid var(--ink); box-shadow: var(--sticker-sm); }
.toast { border: 3px solid var(--ink); background: var(--accent); color: #1b1f3b; font-weight: 800; box-shadow: var(--sticker-sm); }
.find { border: 3px solid var(--ink); border-left: 8px solid var(--accent2); box-shadow: var(--sticker-sm); }
.goalchip { border: 3px solid var(--ink); }
.sitedot { border-color: var(--ink); box-shadow: 0 0 0 2px #fff; }
.planetmap { border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--ink), inset -20px -20px 40px rgba(0, 0, 0, .35); }
.drawer { border-left: 3px solid var(--ink); }
.stars { text-shadow: 0 2px 0 var(--ink); }
.bigstars .stars { font-size: 2.6rem; }
@keyframes popIn { 0% { transform: scale(.85); opacity: 0; } 70% { transform: scale(1.03); } 100% { transform: scale(1); opacity: 1; } }
.modal-box, .verdict, .find, .toast { animation: popIn .25s ease-out; }
.app.enter > * { animation: fadeUp .25s ease-out; }
@keyframes fadeUp { from { transform: translateY(6px); opacity: 0; } }

/* ---------- fun layer ---------- */
.iconbtn.off { opacity: .45; text-decoration: line-through; }
/* rank stamps */
.stamp { width: 84px; height: 84px; margin: -6px auto 4px; border-radius: 50%; border: 4px solid currentColor; display: flex; flex-direction: column; align-items: center; justify-content: center;
  transform: rotate(-12deg); animation: stampIn .45s cubic-bezier(.2, 1.6, .4, 1); font-family: var(--title); line-height: 1; }
.stamp b { font-size: 2.2rem; font-weight: 400; } .stamp span { font-family: var(--round); font-weight: 800; font-size: .7rem; text-transform: uppercase; }
.rank-S { color: #ffd166; } .rank-A { color: #5ee6c8; } .rank-B { color: #7cc4ff; } .rank-C { color: #ffb547; } .rank-D { color: #ff6b8a; }
@keyframes stampIn { 0% { transform: rotate(-12deg) scale(2.4); opacity: 0; } 100% { transform: rotate(-12deg) scale(1); opacity: 1; } }
/* badge pop-up */
.badgePop { position: fixed; left: 50%; top: 76px; transform: translateX(-50%); z-index: 95; width: min(400px, calc(100% - 32px)); display: flex; gap: .8rem; align-items: center;
  background: var(--card2); border: 3px solid var(--ink); border-radius: 18px; padding: .7rem .9rem; box-shadow: 0 6px 0 var(--ink), 0 0 30px rgba(255, 209, 102, .4); cursor: pointer;
  animation: badgeIn .5s cubic-bezier(.2, 1.5, .4, 1); transition: opacity .3s, transform .3s; }
.badgePop.out { opacity: 0; transform: translate(-50%, -20px); }
.badgePop p { margin: .1rem 0 0; } .hatnote { color: var(--accent); font-weight: 700; }
.bp-icon { font-size: 2.4rem; animation: spinIn .6s ease-out; }
@keyframes badgeIn { 0% { transform: translate(-50%, -40px) scale(.7); opacity: 0; } 100% { transform: translate(-50%, 0) scale(1); opacity: 1; } }
@keyframes spinIn { from { transform: rotate(-200deg) scale(.3); } }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.badge { display: grid; grid-template-columns: 2rem 1fr; column-gap: .4rem; align-items: center; padding: .4rem .5rem; border-radius: 12px; background: var(--bg2); border: 2px solid var(--line); opacity: .55; }
.badge.got { opacity: 1; border-color: var(--accent); }
.badge span { grid-row: span 2; font-size: 1.5rem; text-align: center; } .badge b { font-size: .8rem; } .badge small { font-size: .68rem; color: var(--muted); line-height: 1.2; }
/* discovery flip cards */
.fcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .7rem; perspective: 900px; }
.fcard { min-height: 170px; }
.fc-in { position: relative; width: 100%; height: 100%; min-height: 170px; transform-style: preserve-3d; animation: flip .6s ease-out var(--d) both; }
.fc-back, .fc-front { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 14px; border: 3px solid var(--ink); box-shadow: var(--sticker-sm); padding: .6rem .7rem; }
.fc-back { display: grid; place-items: center; background: repeating-linear-gradient(45deg, var(--card2) 0 10px, var(--card) 10px 20px); font-family: var(--title); font-size: 2.6rem; color: var(--accent); }
.fc-front { transform: rotateY(180deg); background: var(--card); display: flex; flex-direction: column; gap: .2rem; }
.fc-front p { flex: 1; margin: .1rem 0; }
@keyframes flip { from { transform: rotateY(0); } to { transform: rotateY(180deg); } }
.fcard.rare .fc-front { border-color: #7cc4ff; box-shadow: 0 3px 0 var(--ink), 0 0 14px rgba(124, 196, 255, .45); }
.fcard.epic .fc-front { border-color: #ffd166; box-shadow: 0 3px 0 var(--ink), 0 0 22px rgba(255, 209, 102, .6); background: linear-gradient(160deg, #3a2f6e, var(--card)); }
.rar { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.fcard.rare .rar { color: #7cc4ff; } .fcard.epic .rar { color: #ffd166; }
.new { font-size: .65rem; font-weight: 900; background: var(--pink); color: #fff; border-radius: 99px; padding: .05rem .45rem; border: 2px solid var(--ink); }
/* hats, moods and quips on the spacecraft */
.hat { position: absolute; top: -46px; left: 50%; transform: translateX(-50%) rotate(-8deg); font-size: 1.9rem; z-index: 3; pointer-events: none; filter: drop-shadow(0 2px 0 var(--ink)); }
.moodface { position: absolute; top: -14px; right: -8px; font-size: 1.3rem; z-index: 3; animation: bob 1.2s ease-in-out infinite; }
.ship { position: relative; }
.ship.mood-worried .googly b { animation-duration: 1.4s; }
.ship.mood-panic .googly b { animation: panicEyes .25s linear infinite; }
.ship.mood-panic .body { animation: shake .4s linear infinite; }
.ship.mood-happy .googly b { animation: googly 3.5s ease-in-out infinite; }
@keyframes panicEyes { 0% { transform: translate(0, 0); } 50% { transform: translate(5px, 4px); } 100% { transform: translate(0, 5px); } }
@keyframes shake { 25% { transform: translateX(-1.5px) rotate(-.4deg); } 75% { transform: translateX(1.5px) rotate(.4deg); } }
.shipsay { position: absolute; top: 46px; left: calc(50% + 44px); z-index: 4; background: #fff; color: #1b1f3b; font-weight: 800; font-size: .78rem; line-height: 1.2;
  padding: .35rem .6rem; border-radius: 12px 12px 12px 2px; border: 3px solid var(--ink); box-shadow: var(--sticker-sm); width: max-content; max-width: min(170px, calc(50% - 50px));
  animation: popIn .25s ease-out; transition: opacity .35s; pointer-events: none; }
.shipsay::after { content: ""; position: absolute; left: -11px; bottom: 4px; border: 7px solid transparent; border-right-color: var(--ink); }
.shipsay.out { opacity: 0; }
.hats { display: flex; flex-wrap: wrap; gap: .4rem; }
.hatbtn { width: 2.6rem; height: 2.6rem; font-size: 1.4rem; border-radius: 12px; border: 3px solid var(--ink); background: var(--bg2); cursor: pointer; box-shadow: 0 2px 0 var(--ink); }
.hatbtn.sel { background: var(--accent); }
/* versus */
.vs-banner { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; background: linear-gradient(90deg, #3b2a7a, var(--card)); border: 3px solid var(--ink); box-shadow: var(--sticker);
  border-radius: var(--radius); padding: .7rem .9rem; margin: .6rem auto 1rem; max-width: 720px; text-align: left; }
.vs-banner > div:nth-child(2) { flex: 1; min-width: 180px; } .vs-banner p { margin: .1rem 0 0; }
.vs-icon { font-size: 2rem; }
.vs-wrap.won { border-color: var(--good); } .vs-wrap.lost { border-color: var(--pink); }
.vs-wrap td.best { color: var(--good); font-weight: 800; }

/* ---------- co-op ---------- */
.online-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: .5rem 0 1rem; }
.codein { font-family: var(--mono); font-size: 1.3rem; letter-spacing: .25em; text-transform: uppercase; width: 9rem; text-align: center; }
.neterr { background: rgba(239, 71, 111, .15); border: 2px solid var(--bad); border-radius: 12px; padding: .5rem .7rem; }
.roomcode { font-size: clamp(2.4rem, 12vw, 3.6rem); font-weight: 600; letter-spacing: .25em; color: var(--accent); text-shadow: 0 4px 0 var(--ink); }
.lobby { text-align: center; } .lobby .crew, .lobby .rolehelp { text-align: left; }
.crew { list-style: none; padding: 0; } .crew li { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .5rem 0; border-top: 2px solid var(--line); }
.crew .roles { display: flex; flex-wrap: wrap; gap: .3rem; margin-left: auto; }
.role-tag { display: inline-block; font-size: .72rem; font-weight: 800; padding: .1rem .5rem; border-radius: 99px; border: 2px solid var(--ink); color: #1b1f3b; white-space: nowrap; }
.r-lead { background: var(--accent); } .r-prop { background: #ff9f5a; } .r-sci { background: var(--accent2); } .r-pwr { background: var(--blue); }
.rolehelp p { margin: .3rem 0; }
.topbar .ico { display: none; }
.roomchip { font-size: .8rem; background: var(--card2); border: 2px solid var(--ink); border-radius: 99px; padding: .15rem .55rem; white-space: nowrap; }
.votes { list-style: none; padding: 0; } .votes li { padding: .3rem 0; } .votes li.go { color: var(--good); font-weight: 800; }

/* phones */
@media (max-width: 720px) {
  .hangar-grid, .explore-grid, .paint-grid { grid-template-columns: minmax(0, 1fr); }
  .mount { width: 56px; } .mount.wing { width: 50px; }
  .shelf { max-height: none; }
  .tb-mission { display: none; }
  .roomchip b, .roomchip .rl { display: none; }
  .topbar { gap: .35rem; padding: .5rem 10px; }
  .topbar .lbl { display: none; } .topbar .ico { display: inline; }
  .topbar .btn.small { padding: .25em .5em; }
  .iconbtn { width: 2.1rem; height: 2.1rem; }
  .brand span { display: none; }
  .findlist li { grid-template-columns: 6rem 1fr; }
  .findlist li span:last-child { grid-column: 2; }
  h2 { font-size: 1.45rem; }
  .brief-planet { width: 72px; height: 72px; }
  .hero { width: 150px; height: 150px; } .hero-planet { inset: 20px; width: 110px; height: 110px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- challenge resources: phase bar, ConOps timeline, trajectory ---------- */
.mphases { max-width: 860px; margin: 0 auto 10px; }
.mphases ol { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.mphases li { flex: 1 1 0; min-width: 0; padding: 6px 8px; background: var(--bg2); border: 1px solid var(--line); text-align: center; line-height: 1.2; }
.mphases li:first-child { border-radius: 12px 0 0 12px; } .mphases li:last-child { border-radius: 0 12px 12px 0; }
.mphases b { display: block; font-family: var(--round); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mphases span { display: block; font-size: .68rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mphases li.done { background: var(--card); } .mphases li.done b { color: var(--good); }
.mphases li.cur { background: var(--accent); border-color: var(--ink); box-shadow: var(--sticker-sm); }
.mphases li.cur b, .mphases li.cur span { color: var(--ink); }
.conops-card h3.mt { margin-top: 18px; }
.cbar { display: flex; gap: 2px; height: 30px; border-radius: 10px; overflow: hidden; border: 2px solid var(--ink); background: var(--bg2); }
.cseg { flex: 0 0 26px; display: grid; place-items: center; min-width: 26px; background: var(--card2); }
.cseg i { font-style: normal; font-size: .9rem; }
.cseg.build { background: var(--violet); } .cseg.cruise { background: var(--blue); } .cseg.sci { background: var(--good); }
.cscale { display: flex; justify-content: space-between; margin: 3px 2px 8px; }
.clist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; }
.clist li { display: flex; gap: 8px; align-items: flex-start; }
.clist .cicon { flex: none; width: 1.6rem; text-align: center; font-size: 1.1rem; }
.clist .pill { margin-left: 4px; }
.traj { margin: 6px 0 0; }
.traj svg { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto; background: radial-gradient(ellipse at center, #18205a, var(--bg) 75%); border-radius: 14px; border: 1px solid var(--line); }
.traj figcaption { margin-top: 6px; }
.traj .torbit { fill: none; stroke: var(--line); stroke-width: 1.2; stroke-dasharray: 3 4; }
.traj .tpath { fill: none; stroke: var(--accent2); stroke-width: 2.5; stroke-linecap: round; }
.traj .tpath.thin { stroke-width: 1.4; }
.traj .tret { fill: none; stroke: var(--pink); stroke-width: 2; stroke-dasharray: 6 4; }
.traj .tship { fill: var(--accent); stroke: var(--ink); stroke-width: 1.5; }
.traj .tlabel { fill: var(--muted); font: 600 10px var(--font); }
.traj .tlabel.strong { fill: var(--ink); font-weight: 800; }
.links li { margin-bottom: 10px; }
@media (max-width: 720px) {
  .mphases li { padding: 5px 3px; }
  .mphases b { font-size: .72rem; }
  .mphases li:not(.cur) span { display: none; }
  .mphases li.cur { flex-grow: 2.2; }
}

/* ---------- Team Hubble Huddle touches ---------- */
.title-screen .episode { font-family: var(--display); color: var(--pink); letter-spacing: .04em; margin: -.1em 0 .4em; text-shadow: 0 2px 0 var(--ink); }
.title-screen .credit { margin-top: 18px; }
.credit-roll { font-family: var(--round); font-size: 1.05rem; background: rgba(255, 107, 157, .12); border: 1px dashed var(--pink); border-radius: 12px; padding: 10px 12px; }

/* ---------- clarity pass: say what to do next on every screen ---------- */
.mission { position: relative; }
.mission.next { border-color: var(--accent); box-shadow: 0 5px 0 var(--ink), 0 0 0 4px rgba(255, 209, 102, .35); animation: nudge 1.6s ease-in-out infinite; }
.nextflag { position: absolute; top: -12px; left: 14px; background: var(--accent); color: var(--ink); font: 800 .78rem var(--round); padding: 2px 10px; border-radius: 99px; border: 2px solid var(--ink); }
@keyframes nudge { 0%, 100% { transform: none; } 50% { transform: translateY(-3px); } }
details.fold > summary { font-family: var(--display); font-size: 1.1rem; list-style: none; cursor: pointer; }
details.fold > summary::after { content: ' ▸ show'; font: 600 .8rem var(--font); color: var(--accent2); }
details.fold[open] > summary::after { content: ' ▾ hide'; }
details.fold[open] > summary { margin-bottom: .6rem; }
.pill.pick { background: var(--good); color: var(--ink); border-color: var(--ink); vertical-align: middle; }
.meter.idle .bar i { background: var(--line); }
.meter.idle .mono { color: var(--muted); }
.coach.pulse { animation: coachpulse 1s ease 3; }
@keyframes coachpulse { 50% { box-shadow: 0 0 0 6px rgba(255, 209, 102, .6); } }
.welcome { text-align: center; }
.welcome .face.big { width: 72px; height: 72px; margin: 0 auto 6px; }
.welcome .stack { display: flex; flex-direction: column; gap: 10px; align-items: stretch; margin: 14px 0 8px; }
.card.summary .row { margin-top: 10px; }
.todo { display: flex; gap: 10px; align-items: center; background: rgba(255, 209, 102, .14); border: 3px solid var(--accent); border-radius: 14px; padding: 8px 14px; margin: 10px 0; box-shadow: var(--sticker-sm); }
.todo.ok { border-color: var(--good); background: rgba(6, 214, 160, .12); }
.todo p { margin: 0; } .todo > span { font-size: 1.4rem; }
.sitedot em { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 3px; font: 700 .62rem var(--font); color: #fff; white-space: nowrap; text-shadow: 0 1px 3px #000, 0 0 6px #000; pointer-events: none; max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
.sitedot.todo { box-shadow: 0 0 0 2px #fff, 0 0 0 7px rgba(255, 209, 102, .55); animation: sitepulse 1.4s ease-in-out infinite; }
.sitedot.sel.todo, .sitedot.sel { animation: none; }
@keyframes sitepulse { 50% { box-shadow: 0 0 0 2px #fff, 0 0 0 12px rgba(255, 209, 102, .15); } }
.sitedot em.up { top: auto; bottom: 100%; margin: 0 0 3px; }
.objlist.live li { color: var(--muted); } .objlist.live li.good { color: var(--good); font-weight: 700; }
h3.mt { margin-top: 16px; }
.report-next { justify-content: center; margin-top: 10px; width: 100%; }
.howto { background: rgba(255, 209, 102, .12); border-left: 4px solid var(--accent); border-radius: 8px; padding: 8px 12px; }
.game-card .job { background: rgba(6, 214, 160, .14); border: 3px solid var(--good); border-radius: 14px; padding: 10px 14px; margin: 10px 0; text-align: left; }
.game-card .job .eyebrow { display: block; } .game-card .job b { font-family: var(--round); font-size: 1.2rem; }
.gsteps { text-align: left; margin: 8px 0; padding-left: 1.4rem; } .gsteps li { margin: 4px 0; }

/* ---------- AstroNova title ---------- */
.game-title .nova { color: var(--accent2); }

/* =====================================================================
   NEON MISSION CONTROL: glass panels, glowing edges, a living nebula.
   This layer restyles everything above; layout and behaviour are unchanged.
   ===================================================================== */
:root {
  --bg: #070a1f; --bg2: #0f1438; --card: #161c4e; --card2: #222a6a; --line: #343f94;
  --glass: linear-gradient(160deg, rgba(36, 44, 112, .72), rgba(16, 20, 58, .78));
  --glass-solid: linear-gradient(160deg, #222a6e, #12173f);
  --edge: rgba(150, 170, 255, .22); --edge-hi: rgba(190, 205, 255, .45);
  --gold: linear-gradient(135deg, #ffe08a, #ffb84d 55%, #ff8f5a);
  --teal: linear-gradient(135deg, #7af5dc, #4cc9f0);
  --holo: linear-gradient(100deg, #ffe08a 0%, #ffb84d 18%, #7af5dc 42%, #4cc9f0 60%, #b69cff 80%, #ffe08a 100%);
  --lift: 0 10px 30px rgba(2, 4, 20, .55), 0 2px 0 rgba(255, 255, 255, .04) inset;
  --glow-gold: 0 0 0 1px rgba(255, 209, 102, .55), 0 0 24px rgba(255, 184, 77, .35);
  --glow-teal: 0 0 0 1px rgba(94, 230, 200, .5), 0 0 22px rgba(76, 201, 240, .3);
  --radius: 20px;
}

/* --- the sky: deep space, two drifting nebula clouds, then the star canvas on top --- */
html { background: radial-gradient(1400px 900px at 50% -20%, #1b1f5e 0%, #0b0f2e 45%, #05071a 100%) fixed; }
body::before, body::after { content: ""; position: fixed; z-index: 0; pointer-events: none; border-radius: 50%; filter: blur(70px); opacity: .55; }
body::before { width: 70vmax; height: 55vmax; left: -20vmax; top: -15vmax;
  background: radial-gradient(closest-side, rgba(182, 156, 255, .55), rgba(120, 90, 255, .18) 55%, transparent); animation: drift1 38s ease-in-out infinite alternate; }
body::after { width: 65vmax; height: 50vmax; right: -22vmax; bottom: -18vmax;
  background: radial-gradient(closest-side, rgba(76, 201, 240, .45), rgba(94, 230, 200, .14) 55%, transparent); animation: drift2 44s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(14vmax, 8vmax) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-12vmax, -10vmax) scale(1.1); } }

/* --- type --- */
h1, h2 { letter-spacing: .015em; }
h2 { font-size: 1.75rem; text-shadow: 0 0 22px rgba(124, 160, 255, .35); }
.eyebrow { color: #7af5dc; letter-spacing: .14em; text-shadow: 0 0 12px rgba(94, 230, 200, .45); }
.muted { color: #a9b3ea; }

/* --- top bar: frosted glass with a neon underline --- */
.topbar { background: rgba(8, 11, 36, .62); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 0; box-shadow: 0 1px 0 rgba(150, 170, 255, .15), 0 8px 24px rgba(0, 0, 0, .35); }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--holo); background-size: 200% 100%; opacity: .7; animation: holo 8s linear infinite; }
.brand { background: var(--gold); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 10px rgba(255, 184, 77, .35)); }
.iconbtn { background: rgba(255, 255, 255, .06); border: 1px solid var(--edge); box-shadow: none; border-radius: 12px; transition: background .15s, box-shadow .15s; }
.iconbtn:hover { background: rgba(255, 255, 255, .12); box-shadow: var(--glow-teal); }

/* --- glass panels replace the flat stickers --- */
.card, .choice, .mission, .coach, .bubble, .meters, .tour-tip, .vs-banner, .badgePop {
  background: var(--glass); border: 1px solid var(--edge); box-shadow: var(--lift); position: relative; }
.card::before, .mission::before, .coach::before, .meters::before {   /* a thin highlight along the top edge */
  content: ""; position: absolute; left: 14px; right: 14px; top: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent); }
.modal-box { background: var(--glass-solid); border: 1px solid var(--edge-hi); box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .04) inset; }
.modal-wrap { background: rgba(3, 5, 20, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.drawer { background: linear-gradient(180deg, #141a4c, #0b0f2e); border-left: 1px solid var(--edge-hi); box-shadow: -20px 0 60px rgba(0, 0, 0, .5); }
.gcanvas { border: 1px solid var(--edge-hi); box-shadow: 0 0 0 1px rgba(255, 255, 255, .03) inset, 0 16px 40px rgba(0, 0, 0, .55), 0 0 40px rgba(76, 201, 240, .12); }
.part { background: rgba(10, 14, 44, .65); border: 1px solid var(--edge); border-left: 5px solid var(--cat); box-shadow: none; transition: transform .12s, box-shadow .15s, border-color .15s; }
.part:hover { transform: translateX(3px); box-shadow: 0 0 0 1px var(--cat), 0 0 18px color-mix(in srgb, var(--cat) 35%, transparent); }
.pill { background: rgba(255, 255, 255, .07); border: 1px solid var(--edge); }
.check { background: rgba(255, 255, 255, .05); border-color: var(--edge); }
.check.ok { background: rgba(6, 214, 160, .12); box-shadow: 0 0 10px rgba(6, 214, 160, .2); }
.face { border: 2px solid color-mix(in srgb, var(--crew) 70%, white); box-shadow: 0 0 14px color-mix(in srgb, var(--crew) 45%, transparent); }
.bubble::before { border-right-color: rgba(150, 170, 255, .35); }
input[type=text], textarea { background: rgba(5, 8, 30, .6); border: 1px solid var(--edge-hi); border-radius: 12px; transition: box-shadow .15s, border-color .15s; }
input[type=text]:focus, textarea:focus { outline: none; border-color: #7af5dc; box-shadow: var(--glow-teal); }

/* --- buttons: glowing gradient primaries, glass ghosts --- */
.btn { border: 1px solid var(--edge-hi); border-radius: 14px; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); letter-spacing: .01em;
  transition: transform .1s, box-shadow .2s, filter .15s, background .2s; }
.btn.ghost { background: rgba(255, 255, 255, .06); color: var(--text); }
.btn.ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .11); box-shadow: var(--glow-teal); transform: translateY(-1px); }
.btn.primary { background: var(--gold); color: #2a1a05; border: 0; box-shadow: 0 6px 20px rgba(255, 150, 60, .35), 0 1px 0 rgba(255, 255, 255, .6) inset; position: relative; overflow: hidden; }
.btn.primary::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; transform: skewX(-20deg); pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: sheen 3.8s ease-in-out infinite; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.06) saturate(1.1); transform: translateY(-2px); box-shadow: 0 10px 28px rgba(255, 150, 60, .5), 0 1px 0 rgba(255, 255, 255, .6) inset; }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.97); box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
.btn:disabled { filter: grayscale(.6); }
@keyframes sheen { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.tbtn { background: rgba(255, 255, 255, .07); border: 1px solid var(--edge-hi); box-shadow: 0 6px 16px rgba(0, 0, 0, .35); backdrop-filter: blur(6px); }
.tbtn.on { background: var(--gold); color: #2a1a05; border-color: transparent; box-shadow: 0 0 24px rgba(255, 184, 77, .55); transform: scale(.96); }
.qbtn { background: rgba(255, 255, 255, .08); border: 1px solid var(--edge-hi); box-shadow: none; }
.tab { background: rgba(255, 255, 255, .04); border: 1px solid var(--edge); border-bottom: 0; }
.tab.sel { background: var(--gold); color: #2a1a05; border-color: transparent; box-shadow: 0 -4px 18px rgba(255, 184, 77, .3); }

/* --- choices and missions --- */
.choice { transition: transform .15s, box-shadow .2s, border-color .2s; }
.choice:hover { transform: translateY(-2px); border-color: var(--edge-hi); }
.choice.sel, .card.goal.sel { border-color: rgba(255, 209, 102, .8); box-shadow: var(--lift), var(--glow-gold); }
.mission { overflow: visible; transition: transform .18s, box-shadow .2s, border-color .2s; }
.mission:not(.locked):hover { transform: translateY(-3px); border-color: var(--edge-hi); box-shadow: var(--lift), 0 0 30px rgba(124, 160, 255, .2); }
.mission .planet { filter: drop-shadow(0 0 14px rgba(124, 196, 255, .45)); }
.mission.locked { opacity: .45; filter: saturate(.4); }
.mission.next { border-color: rgba(255, 209, 102, .85); box-shadow: var(--lift), var(--glow-gold); }
.nextflag { background: var(--gold); border: 0; color: #2a1a05; box-shadow: 0 4px 14px rgba(255, 150, 60, .45); }

/* --- title screen: a glowing planet in orbit and a holographic logo --- */
.title-screen { padding-top: 6vh; }
.hero { width: 230px; height: 230px; }
.hero::before { content: ""; position: absolute; inset: -30px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(122, 245, 220, .35), rgba(76, 201, 240, .12) 55%, transparent); animation: breathe 5s ease-in-out infinite; }
.hero::after { content: ""; position: absolute; left: -16%; right: -16%; top: 44%; height: 20%; border-radius: 50%; pointer-events: none;   /* planetary ring */
  border: 2px solid rgba(182, 156, 255, .6); border-top-color: transparent; box-shadow: 0 0 18px rgba(182, 156, 255, .35); transform: rotate(-14deg); }
.hero-planet { inset: 35px; width: 160px; height: 160px; filter: drop-shadow(0 0 26px rgba(122, 245, 220, .5)); }
.hero .ring { border-color: rgba(122, 245, 220, .45); }
.hero .orbit { border: 1px dashed rgba(150, 170, 255, .25); border-radius: 50%; }
.hero .sat { filter: drop-shadow(0 0 8px rgba(255, 255, 255, .6)); }
@keyframes breathe { 50% { transform: scale(1.08); opacity: .8; } }
.game-title { font-size: clamp(3rem, 12vw, 5.6rem); letter-spacing: .02em; color: transparent; text-shadow: none;
  background: var(--holo); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 4px 0 rgba(5, 7, 26, .9)) drop-shadow(0 0 26px rgba(122, 200, 255, .35)); animation: holo 7s linear infinite; }
.game-title .nova { color: inherit; }
@keyframes holo { to { background-position: 220% 0; } }
.title-screen .eyebrow { font-size: .8rem; }
.title-screen .episode { color: #ff8fb8; text-shadow: 0 0 14px rgba(255, 107, 157, .5); }
.lede { color: #c3cbf5; }
.title-screen .stack .btn { min-width: 230px; }
.title-feats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 22px auto 0; max-width: 560px; }
.title-feats span { font: 700 .78rem var(--font); color: #cfd6ff; padding: 5px 12px; border-radius: 99px; background: rgba(255, 255, 255, .06); border: 1px solid var(--edge); }

/* --- phase bar: a neon progress track --- */
.mphases ol { gap: 6px; }
.mphases li { background: rgba(255, 255, 255, .04); border: 1px solid var(--edge); border-radius: 12px !important; position: relative; overflow: hidden; }
.mphases li.done { background: rgba(6, 214, 160, .1); border-color: rgba(6, 214, 160, .35); }
.mphases li.done::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--teal); }
.mphases li.cur { background: var(--gold); border-color: transparent; box-shadow: 0 0 22px rgba(255, 184, 77, .45); }
.mphases li.cur b, .mphases li.cur span { color: #2a1a05; }

/* --- meters: glowing bars --- */
.meter .bar, .battery .bar { height: 10px; border: 0; background: rgba(5, 8, 30, .7); box-shadow: 0 0 0 1px var(--edge) inset; }
.meter .bar i, .battery .bar i { background: var(--teal); box-shadow: 0 0 12px rgba(76, 201, 240, .6); }
.meter.warn .bar i { background: linear-gradient(90deg, #ffd166, #ffb547); box-shadow: 0 0 12px rgba(255, 181, 71, .6); }
.meter.bad .bar i, .battery .bar i.low { background: linear-gradient(90deg, #ff6b8a, #ef476f); box-shadow: 0 0 12px rgba(239, 71, 111, .6); }
.meter.idle .bar i { background: rgba(150, 170, 255, .25); box-shadow: none; }

/* --- hangar extras --- */
.coach { border-color: rgba(255, 209, 102, .55); box-shadow: var(--lift), 0 0 26px rgba(255, 184, 77, .15); }
.goalchip { border: 1px solid; box-shadow: none; }
.goalchip.ok { background: rgba(6, 214, 160, .1); border-color: rgba(6, 214, 160, .5); }
.goalchip.warn { background: rgba(255, 181, 71, .1); border-color: rgba(255, 181, 71, .5); }
#ship { background: radial-gradient(ellipse at 50% 40%, rgba(76, 201, 240, .14), transparent 65%), var(--glass); }
.body { box-shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 0 30px color-mix(in srgb, var(--paint) 30%, transparent); }
.mount.full { box-shadow: 0 4px 12px rgba(0, 0, 0, .4), 0 0 12px color-mix(in srgb, var(--cat) 30%, transparent); }

/* --- review, science, report --- */
.card.summary.ok { border-color: rgba(6, 214, 160, .6); box-shadow: var(--lift), 0 0 26px rgba(6, 214, 160, .18); }
.card.summary.warn { border-color: rgba(255, 181, 71, .6); box-shadow: var(--lift), 0 0 26px rgba(255, 181, 71, .16); }
.card.summary.bad { border-color: rgba(239, 71, 111, .6); box-shadow: var(--lift), 0 0 26px rgba(239, 71, 111, .18); }
.ritem .ricon { color: #1b1f3b; text-shadow: none; }
.ritem.ok .ricon { box-shadow: 0 0 12px rgba(6, 214, 160, .55); } .ritem.warn .ricon { box-shadow: 0 0 12px rgba(255, 181, 71, .55); } .ritem.block .ricon { box-shadow: 0 0 12px rgba(239, 71, 111, .55); }
.traj svg { border: 1px solid var(--edge); background: radial-gradient(ellipse at center, #1a2066, #070a1f 75%); box-shadow: 0 0 30px rgba(76, 201, 240, .1) inset; }
.traj .tpath { filter: drop-shadow(0 0 4px rgba(122, 245, 220, .8)); }
.cbar { border: 1px solid var(--edge-hi); background: rgba(5, 8, 30, .7); }
.cseg.build { background: linear-gradient(180deg, #c3a8ff, #8b6cf0); } .cseg.cruise { background: linear-gradient(180deg, #9ed6ff, #4cc9f0); } .cseg.sci { background: linear-gradient(180deg, #7af5dc, #06d6a0); }
.todo { background: linear-gradient(90deg, rgba(255, 209, 102, .16), rgba(255, 209, 102, .05)); border: 1px solid rgba(255, 209, 102, .6); box-shadow: 0 0 22px rgba(255, 184, 77, .15); }
.todo.ok { background: linear-gradient(90deg, rgba(6, 214, 160, .16), rgba(6, 214, 160, .05)); border-color: rgba(6, 214, 160, .6); }
.planetmap { border: 0; box-shadow: 0 0 0 1px rgba(255, 255, 255, .15), 0 0 50px color-mix(in srgb, var(--pc) 45%, transparent), inset -30px -30px 60px rgba(0, 0, 0, .45); }
.sitedot { background: rgba(7, 10, 31, .8); border: 2px solid #fff; box-shadow: 0 0 10px rgba(0, 0, 0, .6); }
.sitedot.found { background: var(--teal); box-shadow: 0 0 14px rgba(122, 245, 220, .8); }
.sitedot.sel { border-color: #ffe08a; box-shadow: 0 0 0 4px rgba(255, 209, 102, .4), 0 0 18px rgba(255, 209, 102, .6); }
.verdict { border: 1px solid var(--edge-hi); box-shadow: none; }
.verdict.good { background: linear-gradient(160deg, rgba(6, 214, 160, .18), rgba(6, 214, 160, .04)); border-color: rgba(6, 214, 160, .5); }
.verdict.ok { background: linear-gradient(160deg, rgba(255, 209, 102, .18), rgba(255, 209, 102, .04)); border-color: rgba(255, 209, 102, .5); }
.verdict.bad { background: linear-gradient(160deg, rgba(239, 71, 111, .2), rgba(239, 71, 111, .04)); border-color: rgba(239, 71, 111, .5); }
.game-card .job { background: linear-gradient(160deg, rgba(6, 214, 160, .16), rgba(76, 201, 240, .06)); border: 1px solid rgba(94, 230, 200, .55); box-shadow: 0 0 22px rgba(94, 230, 200, .12); }
.effects, .crisis-stats div, .load { background: rgba(5, 8, 30, .5); border: 1px solid var(--edge); }
.load.on { border-color: rgba(6, 214, 160, .6); box-shadow: 0 0 16px rgba(6, 214, 160, .2); }
.report-top { background: radial-gradient(ellipse at 50% 30%, rgba(255, 209, 102, .14), transparent 65%), var(--glass); }
.bigstars .stars, .stars { text-shadow: 0 0 14px rgba(255, 209, 102, .7); }
.total { background: var(--gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.find, .fc-front { background: var(--glass-solid); border: 1px solid var(--edge-hi); box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }
.fc-back { border: 1px solid var(--edge-hi); background: repeating-linear-gradient(45deg, #1d2466 0 10px, #141a4c 10px 20px); box-shadow: 0 0 22px rgba(255, 209, 102, .2) inset; }
.badge { background: rgba(255, 255, 255, .04); border: 1px solid var(--edge); }
.badge.got { border-color: rgba(255, 209, 102, .6); box-shadow: 0 0 14px rgba(255, 209, 102, .18); }
.toast { background: var(--gold); border: 0; color: #2a1a05; box-shadow: 0 10px 30px rgba(255, 150, 60, .4); border-radius: 14px; }
.badgePop { box-shadow: 0 20px 50px rgba(0, 0, 0, .55), var(--glow-gold); }
.roomcode { background: var(--gold); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 0 16px rgba(255, 184, 77, .4)); }
.credit-roll { border-style: solid; border-color: rgba(255, 107, 157, .45); background: linear-gradient(90deg, rgba(255, 107, 157, .14), rgba(182, 156, 255, .08)); }
.tour-spot { outline: 2px solid #ffe08a; box-shadow: 0 0 0 9999px rgba(3, 5, 20, .72), 0 0 30px rgba(255, 209, 102, .6); }

/* screen change: a slightly richer entrance */
.app.enter > * { animation: riseIn .35s cubic-bezier(.2, .8, .2, 1) both; }
.app.enter > *:nth-child(2) { animation-delay: .04s; } .app.enter > *:nth-child(3) { animation-delay: .08s; } .app.enter > *:nth-child(4) { animation-delay: .12s; }
@keyframes riseIn { from { transform: translateY(10px); opacity: 0; filter: blur(2px); } }

@media (max-width: 720px) {
  body::before, body::after { filter: blur(50px); opacity: .45; }
  .hero { width: 180px; height: 180px; } .hero-planet { inset: 28px; width: 124px; height: 124px; }
  .title-screen .stack .btn { min-width: 0; width: min(280px, 100%); }
}
@media (prefers-reduced-motion: reduce) { body::before, body::after { animation: none; } .btn.primary::after { display: none; } }

.credit-roll p { margin: 0 0 8px; }
.team-names { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 14px; font-weight: 700; }
.team-names li::before { content: '✦ '; color: #ffe08a; }
