main.shell { padding-top: 14px; }

.site-head { position: relative; z-index: 5; }
.head-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.approach-pills {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 7px; border: 1px solid var(--border); border-radius: 3px; background: #10141d;
}
.approach-pills .pill {
  padding: 2px 6px; border-radius: 2px; font-size: 10px; color: var(--muted);
  border: 1px solid transparent; transition: color .2s, border-color .2s, background .2s;
}
.approach-pills .pill.current { color: var(--paper); border-color: var(--ice); background: #6ed4ff18; }
.approach-pills .pill.done { color: #9de4be; border-color: #75b69b75; background: #91f2bc16; }

.flight {
  height: clamp(470px, calc(100vh - 208px), 680px);
  min-height: 0; position: relative; isolation: isolate; overflow: hidden;
  background: #070a12; border: 1px solid #2b3546;
}
.flight:focus { outline: none; }
.flight:focus-visible { border-color: #56758a; }

#scene, .flight-shade { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.flight-shade {
  background:
    linear-gradient(0deg, #070b14e8 0%, #070b1499 10%, transparent 24%),
    linear-gradient(100deg, #060912a8 0%, #0609123a 28%, transparent 54%);
}

.title-block {
  position: absolute; top: 30px; left: 32px; z-index: 1;
  transition: opacity .35s ease, transform .35s ease;
}
.title-block.compact { opacity: .68; transform: translateY(-4px); pointer-events: none; }
.title-block.dimmed { opacity: .18; pointer-events: none; }
.location { display: flex; align-items: center; gap: 8px; color: var(--muted); }
h1 {
  margin: 10px 0 9px; font-size: clamp(48px, 6.4vw, 96px);
  font-weight: 390; line-height: .88; letter-spacing: -.065em;
}
.lede { font-size: 13.5px; color: #c7d0dc; margin-top: 12px; max-width: 36ch; line-height: 1.45; }

.sky-label {
  position: absolute; top: 10%; right: 6%; color: #c9d2e0cc;
  display: flex; align-items: center; gap: 7px; z-index: 1;
}
.sky-label span { width: 19px; border-bottom: 1px solid #8eb8d488; }

.mission-controls {
  display: flex; gap: 6px; position: absolute; right: 24px; top: 24px; z-index: 3;
}
.mission-controls button, .prompt .outline-button { background: #0e1522eb; }

/* Ready / Crash / Touchdown Prompt */
.prompt {
  position: absolute; z-index: 3; top: 44%; left: 32px;
  max-width: min(440px, calc(100% - 64px));
  border-left: 2px solid var(--ember); padding: 14px 18px 16px;
  background: linear-gradient(135deg, #0b111de6, #0d1524d8);
  border-top: 1px solid #2c384b; border-right: 1px solid #242f40; border-bottom: 1px solid #242f40;
  backdrop-filter: blur(8px);
  box-shadow: 0 18px 50px #02040a99;
}
.prompt.result {
  top: 50%; left: 50%; transform: translate(-50%, -56%);
  width: min(560px, calc(100% - 40px)); max-width: none;
  border-left: 2px solid #9de4be;
  background: linear-gradient(155deg, #0c1322f2, #090e19f0);
  padding: 20px 22px 20px;
}
.prompt.crashed {
  top: 50%; left: 50%; transform: translate(-50%, -56%);
  width: min(460px, calc(100% - 40px)); max-width: none;
  border-left: 2px solid var(--ember);
  background: linear-gradient(155deg, #161018f2, #0b0e17f0);
  padding: 18px 20px;
}
.approach { color: #ff9c7d; letter-spacing: .12em; }
.prompt.result .approach { color: #9de4be; }
.result-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 6px; }
.prompt h2 { font-size: 23px; font-weight: 520; letter-spacing: -.025em; }
.prompt-copy { color: #d6deea; font-size: 13px; line-height: 1.48; max-width: 52ch; }

.quick-keys {
  display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; padding-top: 10px;
  border-top: 1px solid #263144; font-size: 11.5px; color: #b6c2d2;
}
.quick-keys kbd {
  display: inline-block; padding: 1px 5px; border: 1px solid #3c4a60; border-radius: 3px;
  background: #141c2b; color: var(--ice); font: 11px/1.2 var(--mono);
}

.grade {
  padding: 4px 11px; border-radius: 3px; font-size: 12px; font-weight: 600; white-space: nowrap;
  border: 1px solid #75b69b80; background: #91f2bc1c; color: #9de4be;
}
.grade.grade-S { color: #ffd97d; border-color: #ffd97d88; background: #ffd97d1c; box-shadow: 0 0 18px #ffd97d28; }
.grade.grade-A { color: #9de4be; border-color: #75b69b88; background: #91f2bc1a; }
.grade.grade-B { color: var(--ice); border-color: #6ed4ff70; background: #6ed4ff18; }

.touchdown-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px;
  margin-top: 12px; padding: 10px 12px;
  background: #0a101b; border: 1px solid #253143; border-radius: 3px;
}
.touchdown-stats span { display: block; font-size: 9px; color: var(--muted); margin-bottom: 2px; }
.touchdown-stats strong { font-size: 13px; color: var(--paper); font-weight: 550; }

.science-card {
  margin-top: 12px; padding: 12px 14px;
  background: linear-gradient(135deg, #101b2b, #0c1421);
  border: 1px solid #2c3e55; border-left: 2px solid var(--ice); border-radius: 3px;
}
.science-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px;
}
.science-tag { display: inline-flex; align-items: center; gap: 6px; color: var(--ice); font-size: 10px; }
.ice-dot { background: var(--ice); }
.science-card-head a { color: var(--ice); font-size: 11px; text-underline-offset: 3px; }
.science-card h3 { margin: 0 0 5px; font-size: 15px; font-weight: 560; color: var(--paper); }
.science-card p { margin: 0; font-size: 12.5px; color: #c7d5e4; line-height: 1.5; }

.prompt-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.primary {
  display: inline-flex; justify-content: space-between; align-items: center; gap: 16px;
  min-height: 39px; padding: 0 15px; background: var(--ember); color: #150b07;
  border: 1px solid #ff8c69; border-radius: 3px; font-size: 13px; font-weight: 660;
  transition: background .15s, transform .12s;
}
.primary:hover { background: #ff7a52; }

/* Survey Complete Finale Overlay */
.finale {
  position: absolute; z-index: 4; top: 50%; left: 50%; transform: translate(-50%, -53%);
  width: min(680px, calc(100% - 36px)); max-height: calc(100% - 108px); overflow-y: auto;
  padding: 22px 24px;
  background: linear-gradient(160deg, #0d1525f6, #080d17f6);
  border: 1px solid #3c506a; border-top: 2px solid var(--ember);
  backdrop-filter: blur(10px);
  box-shadow: 0 24px 70px #02040acc;
}
.finale-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.finale-head h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 500; letter-spacing: -.03em; margin-top: 4px; }
.finale-badge {
  padding: 7px 14px; border: 1px solid #ffd97d70; background: #ffd97d14; border-radius: 3px;
  text-align: center; min-width: 112px;
}
.finale-badge span { display: block; font-size: 9px; color: #d8c89c; }
.finale-badge strong { display: block; font-size: 24px; color: #ffd97d; line-height: 1.1; margin-top: 2px; }

.finale-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 14px;
}
.finale-item {
  padding: 10px 12px; background: #0c121e; border: 1px solid #263347; border-radius: 3px;
}
.finale-item .fi-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 4px; }
.finale-item .fi-name { font-size: 12px; color: var(--paper); font-weight: 520; }
.finale-item .fi-meta { font-size: 10.5px; color: var(--muted); margin-top: 3px; }

.finale-efficiency {
  margin-top: 12px; padding: 10px 12px; background: #0b111c; border: 1px solid #253244; border-radius: 3px;
}
.finale-efficiency > div:first-child { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.finale-efficiency strong { color: var(--ice); font-size: 12px; }
.eff-track { height: 5px; background: #1e2838; border-radius: 2px; overflow: hidden; }
.eff-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--ice), #9de4be); transition: width .6s ease; }

/* Instruments */
.flight-instruments {
  position: absolute; bottom: 14px; left: 24px; right: 24px; margin: 0; z-index: 2;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(95px, 1fr);
  gap: 12px; padding: 10px 0 0; border-top: 1px solid #66758c66;
}
.flight-instruments dt { font-size: 11px; color: #a9b8c9; margin-bottom: 3px; }
.flight-instruments dd { margin: 0; font: clamp(14px, 2vw, 23px)/1.1 var(--mono); white-space: nowrap; }
.flight-instruments small { font: 10px/1 var(--mono); color: #a9b8c9; }
.flight-instruments [data-state="safe"] { color: #9de4be; }
.flight-instruments [data-state="caution"] { color: #ffd38b; }
.flight-instruments [data-state="danger"] { color: #ff8e86; }

meter { display: block; height: 3px; width: 100%; -webkit-appearance: none; appearance: none; background: #242e3b; }
meter::-webkit-meter-bar { background: #242e3b; border: 0; border-radius: 0; }
meter::-webkit-meter-optimum-value { background: var(--ice); }
meter::-moz-meter-bar { background: var(--ice); }
.fuel meter { max-width: 112px; margin-top: 5px; }
.fuel meter.low::-webkit-meter-optimum-value { background: var(--ember); }
.fuel meter.low::-moz-meter-bar { background: var(--ember); }

.plume-callout {
  position: absolute; z-index: 3; top: 20px; left: 50%; transform: translateX(-50%);
  max-width: min(520px, calc(100% - 260px)); width: max-content;
  padding: 7px 13px; font-size: 11.5px; line-height: 1.38;
  border: 1px solid #35546e; border-left: 2px solid var(--ice); border-radius: 3px;
  background: #091522eb; color: #dff2ff;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 26px #02050a99;
  pointer-events: none;
}
.plume-callout strong { color: var(--ice); margin-right: 6px; font-weight: 560; }

/* Control Strip */
.control-strip {
  min-height: 70px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  align-items: center; gap: 14px; border-bottom: 1px solid var(--border);
}
.controls { display: flex; gap: 7px; }
.controls button {
  border: 1px solid #303746; display: flex; align-items: center; gap: 5px;
  padding: 6px 9px; min-height: 38px; border-radius: 3px; background: #121620;
  color: #cdd3df; font-size: 12px; touch-action: none; user-select: none;
}
.controls button:hover, .controls button.active { color: var(--paper); border-color: #748a9e; }
.controls button.active { background: #223744; border-color: var(--ice); }
.controls kbd { font: 15px/1 var(--mono); color: var(--ice); }
.controls button small { font-size: 10px; color: var(--muted); }
.controls .sas { touch-action: manipulation; }
.sas strong { color: var(--muted); font: 10px var(--mono); margin-left: 3px; }
.sas[aria-pressed="true"] strong { color: #9de4be; }

.touchdown { color: var(--muted); font-size: 12px; line-height: 1.4; }
.touchdown strong { display: block; color: var(--paper); font-weight: 550; }
.touchdown b { color: #7e879a; font-weight: 400; }
.gravity { color: var(--muted); text-align: right; }
.gravity strong { display: block; margin-top: 2px; font-size: 19px; color: var(--ice); font-weight: 450; }
.gravity small { font-size: 11px; }

/* World Data dropdown */
.world-data { position: relative; }
.world-data summary { list-style: none; cursor: pointer; }
.world-data summary::-webkit-details-marker { display: none; }
.world-data summary::after { content: "+"; color: var(--ice); }
.world-data[open] summary::after { content: "−"; }
.world-data summary:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; }
.world-panel {
  position: absolute; top: calc(100% + 10px); right: 0; width: min(310px, 77vw); padding: 16px;
  background: #101621; border: 1px solid #3b4a5d; box-shadow: 0 12px 44px #03050ab0;
}
.world-panel h2 { font-size: 18px; font-weight: 520; margin-bottom: 10px; }
.world-panel h2 small { color: var(--muted); margin-left: 4px; font: 11px var(--mono); }
.world-panel dl { display: grid; gap: 7px; margin: 0 0 12px; }
.world-panel dl div { display: flex; justify-content: space-between; gap: 5px; font-size: 12px; }
.world-panel dd { margin: 0; white-space: nowrap; font-family: var(--mono); color: var(--ice); }
.world-panel a { color: var(--ice); font-size: 12px; text-underline-offset: 3px; }

@media (max-width: 940px) {
  .control-strip { grid-template-columns: auto 1fr auto; }
  .touchdown span { display: block; }
}
@media (max-width: 750px) {
  .sky-label { display: none; }
  .world-panel { right: -65px; }
  .finale-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  main.shell { padding-top: 12px; }
  .approach-pills { display: none; }
  .flight { height: clamp(510px, 72svh, 640px); }
  .title-block { top: 18px; left: 16px; }
  h1 { font-size: clamp(40px, 11vw, 56px); }
  .lede { font-size: 12px; margin-top: 8px; }
  .prompt { left: 14px; top: 48%; max-width: calc(100% - 28px); padding: 12px 14px; }
  .prompt.result, .prompt.crashed { width: calc(100% - 24px); padding: 14px; top: 47%; }
  .touchdown-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mission-controls { right: 12px; top: 12px; }
  .flight-instruments { left: 12px; right: 12px; bottom: 12px; gap: 4px; grid-template-columns: .95fr 1.22fr 1.26fr .69fr .67fr; }
  .flight-instruments dt, .flight-instruments small { font-size: 9px; }
  .flight-instruments dd { font-size: clamp(10px, 3.25vw, 14px); }
  .plume-callout { top: 12px; left: 12px; right: 12px; bottom: auto; transform: none; max-width: none; width: auto; font-size: 10px; }
  .control-strip { padding: 10px 0 12px; gap: 10px; grid-template-columns: 1fr auto; }
  .controls { grid-column: 1 / -1; gap: 4px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .controls button { min-height: 42px; justify-content: center; padding-inline: 3px; font-size: 11px; }
  .controls button small { display: none; }
  .touchdown { font-size: 11px; }
  .gravity { font-size: 9px; }
  .gravity strong { font-size: 16px; }
}
