/*! Solar System Repair Co. | Source: https://orbitalforest.com */
:root {
  color-scheme: dark;
  --black: #071012;
  --ink: #0b1719;
  --steel: #173035;
  --steel-2: #25474b;
  --cream: #f4e5c5;
  --muted: #b9b49f;
  --amber: #ffb34b;
  --amber-pale: #ffd793;
  --rust: #c86435;
  --teal: #53d9c3;
  --green: #9fe082;
  --red: #f06c4e;
  --panel: rgba(8, 22, 24, .88);
  --panel-soft: rgba(12, 29, 31, .72);
  --line: rgba(244, 229, 197, .22);
  --shadow: 0 18px 55px rgba(0, 0, 0, .5);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--black);
  color: var(--cream);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 16px;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
}

.noscript {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 2rem;
  background: var(--ink);
  color: var(--cream);
  text-align: center;
}

#game-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--ink);
}

.top-hud,
.bottom-hud {
  position: relative;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-color: var(--line);
  background: rgba(7, 16, 18, .96);
  padding-left: max(1rem, var(--safe-left));
  padding-right: max(1rem, var(--safe-right));
}

.top-hud {
  min-height: calc(58px + var(--safe-top));
  padding-top: var(--safe-top);
  border-bottom: 1px solid var(--line);
}

.bottom-hud {
  min-height: calc(36px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .78rem;
  letter-spacing: .04em;
}

.brand-lockup,
.hud-actions {
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand-lockup {
  gap: .7rem;
}

.hud-actions {
  gap: .45rem;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border: 2px solid var(--amber);
  border-radius: 50%;
  color: var(--teal);
  box-shadow: inset 0 0 0 4px var(--ink), 0 0 16px rgba(83, 217, 195, .18);
  font-size: 1.2rem;
}

.brand-name {
  display: grid;
  flex: 0 0 auto;
  color: var(--amber-pale);
  font-size: .9rem;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.scene-label {
  overflow: hidden;
  max-width: 220px;
  padding-left: .75rem;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: .76rem;
  letter-spacing: .08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-status {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-right: .6rem;
  color: var(--muted);
  font-size: .72rem;
}

.connection-status span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.credit-balance {
  margin-right: .4rem;
  padding: .35rem .55rem;
  border: 1px solid rgba(255, 179, 75, .32);
  border-radius: 4px;
  background: rgba(255, 179, 75, .07);
  color: var(--amber-pale);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .05em;
  white-space: nowrap;
}

.icon-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--steel);
  color: var(--cream);
  padding: .5rem .7rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
}

.icon-button:hover {
  border-color: var(--amber);
  background: var(--steel-2);
}

#game-stage {
  position: relative;
  min-height: 0;
  isolation: isolate;
  overflow: hidden;
  background: #111;
}

.scene-art,
.art,
.art img,
.image-shade,
.scanlines,
.scene,
#flight-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.art {
  display: none;
  overflow: hidden;
}

.art img {
  object-fit: cover;
  object-position: center;
  transform: scale(1.015);
  transition: transform 1.3s ease;
}

#game-shell[data-scene="workshop"] .art-hangar,
#game-shell[data-scene="debrief"] .art-hangar,
#game-shell[data-scene="mission"] .art-mission {
  display: block;
}

#game-shell[data-scene="workshop"] .art-hangar img {
  object-position: 50% 62%;
}

#game-shell[data-scene="workshop"][data-workshop-view="explore"] .art-hangar img {
  filter: saturate(1.04) brightness(1.03);
  object-position: center;
  transform: scale(1);
}

#game-shell[data-scene="workshop"][data-workshop-view="explore"] .image-shade {
  opacity: .24;
}

#game-shell[data-scene="debrief"] .art-hangar img {
  transform: scale(1.05);
  object-position: 50% 58%;
}

#game-shell[data-scene="flight"] #game-stage,
#game-shell[data-scene="return"] #game-stage {
  background: #03080e;
}

.image-shade {
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(3, 9, 10, .6), transparent 34%, transparent 66%, rgba(3, 9, 10, .55)),
    linear-gradient(0deg, rgba(3, 9, 10, .62), transparent 40%);
}

.scanlines {
  z-index: 40;
  pointer-events: none;
  opacity: .16;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 0, 0, .25) 3px 4px);
  mix-blend-mode: multiply;
}

/* Standard preserves the original .16 overlay and its four-pixel spacing. */
#game-shell[data-scanlines="off"] .scanlines { opacity: 0; }
#game-shell[data-scanlines="subtle"] .scanlines { opacity: .08; }
#game-shell[data-scanlines="strong"] .scanlines { opacity: .32; }
#game-shell[data-scanlines="intense"] .scanlines { opacity: .64; }

.scene {
  z-index: 10;
  display: none;
  padding: clamp(.8rem, 2vw, 1.5rem);
}

.scene.is-active {
  display: block;
  animation: scene-in .42s ease both;
}

@keyframes scene-in {
  from { opacity: 0; transform: scale(1.008); }
  to { opacity: 1; transform: scale(1); }
}

.metal-panel {
  position: absolute;
  overflow: hidden;
  border: 1px solid rgba(244, 229, 197, .3);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .045), transparent 24%),
    var(--panel);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(0, 0, 0, .48);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.metal-panel::after {
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255, 255, 255, .045);
  border-radius: 3px;
  content: "";
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 .35rem;
  color: var(--amber);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .13em;
}

h1,
h2,
p {
  text-wrap: pretty;
}

h1,
h2 {
  margin: 0;
  font-family: ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
}

h1 {
  font-size: clamp(1.55rem, 3.1vw, 3.2rem);
  line-height: 1.03;
}

h2 {
  font-size: clamp(1.15rem, 2.2vw, 1.8rem);
  line-height: 1.18;
}

.mission-interface,
.workshop-explore {
  position: absolute;
  inset: 0;
}

.mission-interface {
  z-index: 3;
}

.mission-interface-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(2, 7, 8, .08);
  cursor: zoom-out;
}

.mission-interface > .crew-panel,
.mission-interface > .mission-board,
.mission-interface > .mission-terminal,
.mission-interface > .workshop-note {
  z-index: 2;
}

.workshop-explore {
  z-index: 5;
}

.workshop-guide {
  top: .75rem;
  left: 50%;
  z-index: 150;
  width: min(430px, calc(100% - 2rem));
  padding: .72rem 1rem;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.workshop-guide h1 {
  font-size: clamp(1.28rem, 2.3vw, 2rem);
}

.workshop-guide p:last-child {
  position: relative;
  z-index: 1;
  margin: .42rem 0 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.45;
}

.workshop-zone-layer {
  z-index: auto;
}

.workshop-rivet,
.workshop-socket {
  pointer-events: none;
}

.socket-activity-bubble {
  position: absolute;
  bottom: calc(100% - 5px);
  left: 50%;
  z-index: 8;
  width: max-content;
  max-width: 175px;
  padding: .3rem .42rem;
  border: 1px solid rgba(83, 217, 195, .62);
  border-radius: 5px 5px 5px 1px;
  background: rgba(4, 14, 16, .9);
  color: var(--teal);
  box-shadow: 0 5px 16px rgba(0, 0, 0, .38);
  font-size: clamp(.46rem, .58vw, .58rem);
  font-weight: 900;
  letter-spacing: .055em;
  line-height: 1.25;
  text-align: center;
  transform: translateX(-50%);
}

.socket-activity-bubble[hidden] {
  display: none;
}

.workshop-explore.is-inspecting .workshop-move-pad,
.workshop-explore.is-inspecting .workshop-interact-button,
.workshop-explore.is-inspecting .workshop-interact-prompt {
  opacity: .15;
  pointer-events: none;
}

.workshop-inspector {
  right: 1rem;
  top: 1rem;
  bottom: auto;
  z-index: 190;
  width: min(390px, 38vw);
  padding: 1rem;
}

.workshop-aside-button {
  position: absolute;
  z-index: 95;
  left: 50%;
  bottom: 7.1rem;
  transform: translateX(-50%);
  padding: .4rem .7rem;
  border: 1px solid var(--teal);
  border-radius: 4px;
  background: rgba(9, 30, 39, .94);
  color: var(--cream);
  cursor: pointer;
  font-size: .72rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: .09em;
  white-space: nowrap;
}
.workshop-aside {
  position: absolute;
  z-index: 195;
  left: 50%;
  top: 50%;
  width: min(430px, calc(100% - 30px));
  transform: translate(-50%, -50%);
  padding: 1rem 1.2rem;
  text-align: left;
}
.workshop-aside > span { color: var(--teal); font-size: .73rem; font-weight: 900; letter-spacing: .14em; }
.workshop-aside p { color: var(--cream); line-height: 1.5; }
.workshop-aside .button { display: block; margin-left: auto; }
.workshop-aside[hidden], .workshop-aside-button[hidden] { display: none; }

.workshop-inspector-bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -.25rem -.2rem .8rem;
  padding-bottom: .55rem;
  border-bottom: 1px solid var(--line);
  color: var(--teal);
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .12em;
}

.workshop-inspector-bar button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--steel);
  color: var(--cream);
  cursor: pointer;
  font-size: 1rem;
}

.workshop-inspector h2,
.workshop-inspector > p,
.workshop-inspector-footer {
  position: relative;
  z-index: 1;
}

.workshop-inspector h2 {
  color: var(--amber-pale);
}

.workshop-inspector > p:not(.eyebrow) {
  margin: .55rem 0 .9rem;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.5;
}

.workshop-inspector-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding-top: .75rem;
  border-top: 1px solid var(--line);
}

.workshop-inspector-footer > span {
  color: var(--green);
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .07em;
}

.workshop-inspector-footer .button {
  min-height: 38px;
  padding: .5rem .65rem;
  font-size: .75rem;
}

.workshop-inspector-footer .button:disabled {
  border-color: rgba(159, 224, 130, .35);
  background: rgba(159, 224, 130, .08);
  color: var(--green);
  cursor: default;
  opacity: .8;
}

.workshop-shop,
.shop-backdrop {
  position: absolute;
  inset: 0;
}

.workshop-shop {
  z-index: 14;
}

.workshop-shop[hidden] {
  display: none;
}

.shop-backdrop {
  background: rgba(2, 8, 10, .57);
  backdrop-filter: blur(3px);
}

.shop-panel {
  top: 50%;
  left: 50%;
  z-index: 2;
  width: min(940px, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  overflow: auto;
  padding: 0;
  transform: translate(-50%, -50%);
}

.shop-titlebar,
.shop-heading,
.shop-grid,
.shop-footer {
  position: relative;
  z-index: 1;
}

.shop-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .68rem .8rem;
  border-bottom: 1px solid var(--line);
  background: rgba(23, 48, 53, .9);
  color: var(--teal);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .09em;
}

.shop-titlebar button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--steel-2);
  color: var(--cream);
  padding: .4rem .58rem;
  font-size: .64rem;
  font-weight: 900;
  letter-spacing: .05em;
}

.shop-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 1.1rem .85rem;
}

.shop-heading h1 {
  margin-top: .1rem;
  color: var(--amber-pale);
  font-size: clamp(1.45rem, 3.4vw, 2.2rem);
}

.shop-heading p:last-child {
  margin: .35rem 0 0;
  color: var(--muted);
  font-size: .84rem;
}

.shop-wallet {
  display: grid;
  min-width: 150px;
  gap: .22rem;
  padding: .58rem .7rem;
  border: 1px solid rgba(255, 179, 75, .42);
  border-radius: 5px;
  background: rgba(255, 179, 75, .08);
  text-align: right;
}

.shop-wallet span {
  color: var(--muted);
  font-size: .58rem;
  letter-spacing: .08em;
}

.shop-wallet strong {
  color: var(--amber-pale);
  font-size: 1.05rem;
}

.shop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .7rem;
  padding: .2rem 1.1rem 1rem;
}

.shop-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  grid-template-areas:
    "badge heading price"
    "badge copy copy"
    "badge effect action";
  gap: .38rem .72rem;
  min-width: 0;
  padding: .85rem;
  border: 1px solid rgba(244, 229, 197, .19);
  border-radius: 6px;
  background: rgba(10, 28, 31, .78);
}

.shop-card.is-owned {
  border-color: rgba(159, 224, 130, .44);
  background: rgba(38, 66, 49, .4);
}

.shop-item-badge {
  grid-area: badge;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(83, 217, 195, .55);
  border-radius: 50%;
  background: rgba(83, 217, 195, .08);
  color: var(--teal);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .04em;
}

.shop-card.is-owned .shop-item-badge {
  border-color: var(--green);
  color: var(--green);
}

.shop-item-heading {
  grid-area: heading;
  min-width: 0;
}

.shop-item-heading span,
.shop-item-heading strong {
  display: block;
}

.shop-item-heading span {
  color: var(--muted);
  font-size: .58rem;
  letter-spacing: .08em;
}

.shop-item-heading strong {
  overflow: hidden;
  margin-top: .15rem;
  color: var(--cream);
  font-family: ui-rounded, system-ui, sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-item-price {
  grid-area: price;
  color: var(--amber-pale);
  font-size: .78rem;
  white-space: nowrap;
}

.shop-item-copy {
  grid-area: copy;
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.4;
}

.shop-item-effect {
  grid-area: effect;
  align-self: center;
  color: var(--teal);
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .06em;
}

.shop-buy-button {
  grid-area: action;
  min-height: 36px;
  border: 1px solid rgba(255, 179, 75, .56);
  border-radius: 4px;
  background: rgba(255, 179, 75, .1);
  color: var(--amber-pale);
  padding: .42rem .62rem;
  font-size: .65rem;
  font-weight: 900;
  letter-spacing: .04em;
}

.shop-buy-button:hover:not(:disabled) {
  border-color: var(--teal);
  background: rgba(83, 217, 195, .13);
  color: var(--teal);
}

.shop-buy-button:disabled {
  cursor: default;
  opacity: .56;
}

.shop-card.is-owned .shop-buy-button {
  border-color: rgba(159, 224, 130, .42);
  color: var(--green);
}

.shop-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem 1.1rem;
  border-top: 1px solid var(--line);
  color: var(--green);
  font-size: .67rem;
  font-weight: 900;
  letter-spacing: .07em;
}

.shop-footer small {
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0;
}

.crew-panel {
  top: 1rem;
  left: 1rem;
  width: min(310px, 30vw);
  padding: 1rem;
}

.crew-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: .65rem;
  padding: .55rem 0;
  border-top: 1px solid var(--line);
}

.crew-callout {
  display: grid;
  width: 42px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(83, 217, 195, .55);
  border-radius: 4px;
  background: rgba(83, 217, 195, .09);
  color: var(--teal);
  font-size: .68rem;
  font-weight: 800;
}

.crew-row strong,
.crew-row span {
  display: block;
}

.crew-row strong {
  color: var(--cream);
  font-family: ui-rounded, system-ui, sans-serif;
}

.crew-row div span {
  margin-top: .15rem;
  color: var(--muted);
  font-size: .68rem;
}

.crew-row b {
  color: var(--green);
  font-size: .68rem;
  letter-spacing: .08em;
}

.mission-board {
  top: 10.65rem;
  left: 1rem;
  z-index: 3;
  width: min(330px, 27vw);
  padding: .8rem;
}

.mission-board-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .65rem;
}

.mission-board-heading .eyebrow {
  margin-bottom: .18rem;
}

.mission-board-heading strong {
  font-family: ui-rounded, system-ui, sans-serif;
  font-size: .94rem;
}

.mission-board-heading > span {
  flex: 0 0 auto;
  color: var(--teal);
  font-size: .58rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.mission-picker {
  position: relative;
  z-index: 1;
  display: grid;
  gap: .5rem;
}

.mission-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .14rem .6rem;
  min-height: 78px;
  border: 1px solid rgba(244, 229, 197, .2);
  border-radius: 5px;
  background: rgba(23, 48, 53, .82);
  color: var(--cream);
  padding: .62rem .68rem;
  text-align: left;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.mission-card:hover {
  border-color: rgba(255, 179, 75, .7);
  background: rgba(37, 71, 75, .94);
  transform: translateX(2px);
}

.mission-card > span,
.mission-card > strong,
.mission-card > small {
  grid-column: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mission-card > span {
  color: var(--amber);
  font-size: .57rem;
  font-weight: 900;
  letter-spacing: .1em;
}

.mission-card > strong {
  font-family: ui-rounded, system-ui, sans-serif;
  font-size: .88rem;
}

.mission-card > small {
  color: var(--muted);
  font-size: .62rem;
}

.mission-card > b {
  grid-column: 2;
  grid-row: 1 / 4;
  align-self: center;
  color: var(--muted);
  font-size: .55rem;
  letter-spacing: .06em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.mission-card.is-selected {
  border-color: var(--amber);
  background: linear-gradient(90deg, rgba(255, 179, 75, .17), rgba(23, 48, 53, .94));
  box-shadow: inset 3px 0 0 var(--amber), 0 0 18px rgba(255, 179, 75, .08);
}

.mission-card-ice > span {
  color: #9beeff;
}

.mission-card-ice.is-selected {
  border-color: #82dff2;
  background: linear-gradient(90deg, rgba(96, 205, 231, .17), rgba(23, 48, 53, .94));
  box-shadow: inset 3px 0 0 #82dff2, 0 0 18px rgba(96, 205, 231, .1);
}

.mission-card-titan > span {
  color: #ffc066;
}

.mission-card-titan.is-selected {
  border-color: #f2a43f;
  background: linear-gradient(90deg, rgba(242, 145, 47, .2), rgba(23, 48, 53, .94));
  box-shadow: inset 3px 0 0 #f2a43f, 0 0 18px rgba(242, 145, 47, .12);
}

.mission-picker-empty {
  padding: .8rem .7rem;
  border: 1px dashed rgba(83, 217, 195, .35);
  border-radius: 5px;
  color: var(--muted);
  font-size: .68rem;
  line-height: 1.5;
}

.mission-card.has-progress::after {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  content: "";
}

.mission-terminal {
  right: clamp(.8rem, 3vw, 2.5rem);
  bottom: clamp(.8rem, 4vh, 2.2rem);
  width: min(860px, 69vw);
}

.terminal-bar {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: .75rem;
  padding: .65rem .9rem;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 20, 21, .9);
  color: var(--muted);
  font-size: .68rem;
  letter-spacing: .08em;
}

.terminal-bar i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: .45rem;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
  animation: pulse 1.8s ease-in-out infinite;
}

.terminal-bar b {
  color: var(--amber-pale);
  font: inherit;
}

.terminal-bar > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-exit {
  min-height: 29px;
  border: 1px solid rgba(244, 229, 197, .2);
  border-radius: 3px;
  background: rgba(37, 71, 75, .72);
  color: var(--cream);
  padding: .28rem .46rem;
  cursor: pointer;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .06em;
}

.terminal-exit:hover {
  border-color: var(--teal);
  background: var(--steel-2);
}

.terminal-exit span {
  margin-left: .25rem;
  color: var(--teal);
  font-size: .78rem;
}

@keyframes pulse {
  50% { opacity: .45; }
}

.terminal-screen {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(250px, .92fr) minmax(270px, 1.08fr);
  gap: .85rem;
  padding: .85rem;
  background:
    linear-gradient(rgba(12, 45, 42, .45), rgba(7, 26, 26, .72)),
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(83, 217, 195, .06) 4px 5px);
}

.video-terminal {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 2px solid rgba(83, 217, 195, .55);
  border-radius: 12px 9px 13px 8px;
  background: #061719;
  box-shadow:
    0 0 0 5px rgba(4, 13, 14, .8),
    0 0 0 6px rgba(244, 229, 197, .16),
    inset 0 0 35px rgba(83, 217, 195, .14);
  aspect-ratio: 16 / 9;
  isolation: isolate;
}

.caller-feed,
.caller-feed img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.caller-feed img {
  object-fit: cover;
  filter: saturate(.86) contrast(1.06) brightness(.9);
  transform: scale(1.035);
}

.signal-noise,
.video-scan {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.signal-noise {
  opacity: .18;
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(50, 255, 221, .16) 3px 4px),
    linear-gradient(90deg, transparent 0 48%, rgba(255,255,255,.08) 49%, transparent 51%);
  mix-blend-mode: screen;
  animation: signal-jitter .24s steps(2, end) infinite;
}

.video-scan {
  inset: -35% 0 auto;
  height: 32%;
  opacity: .4;
  background: linear-gradient(180deg, transparent, rgba(117, 255, 232, .18), transparent);
  animation: video-scan 3.8s linear infinite;
}

.corner {
  position: absolute;
  z-index: 3;
  width: 17px;
  height: 17px;
  border-color: rgba(255, 215, 147, .82);
  pointer-events: none;
}

.corner-a { top: 8px; left: 8px; border-top: 2px solid; border-left: 2px solid; }
.corner-b { top: 8px; right: 8px; border-top: 2px solid; border-right: 2px solid; }
.corner-c { right: 8px; bottom: 8px; border-right: 2px solid; border-bottom: 2px solid; }
.corner-d { bottom: 8px; left: 8px; border-bottom: 2px solid; border-left: 2px solid; }

.video-labels {
  position: absolute;
  right: .65rem;
  bottom: .55rem;
  left: .65rem;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  color: #d9fff8;
  font-size: .57rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-shadow: 0 1px 4px #000, 0 1px 4px #000;
}

.video-labels span:first-child {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.video-labels i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
  animation: pulse .9s ease-in-out infinite;
}

.dialogue-counter {
  align-self: start;
  color: var(--teal);
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .08em;
  white-space: nowrap;
}

.call-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 20px;
  margin: .1rem 0 .6rem;
}

.call-wave span {
  width: 3px;
  height: 30%;
  border-radius: 2px;
  background: var(--teal);
  box-shadow: 0 0 5px rgba(83, 217, 195, .5);
  animation: call-wave .86s ease-in-out infinite alternate;
}

.call-wave span:nth-child(2n) { animation-delay: -.26s; }
.call-wave span:nth-child(3n) { animation-delay: -.51s; }
.call-wave span:nth-child(4n) { animation-delay: -.68s; }

.call-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: auto;
}

.button-quiet {
  min-height: 36px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  padding: .4rem .55rem;
  font-size: .65rem;
}

.button-quiet:hover {
  border-color: var(--line);
  color: var(--cream);
}

.line-change {
  animation: dialogue-in .26s ease both;
}

.mission-terminal.is-ringing .caller-feed img {
  filter: saturate(.45) contrast(1.2) brightness(.62) blur(1px);
  animation: waiting-signal 1.4s steps(2, end) infinite;
}

.mission-terminal.is-ringing .signal-noise {
  opacity: .46;
}

.mission-terminal.is-connected .caller-feed img {
  animation: caller-drift 5.6s ease-in-out infinite alternate;
}

.mission-terminal.is-local-speaker .video-terminal {
  border-color: rgba(255, 179, 75, .72);
}

.mission-terminal.is-local-speaker .caller-feed img {
  filter: saturate(.66) contrast(1.08) brightness(.7);
}

.mission-terminal.is-local-speaker .call-wave span {
  background: var(--amber);
  box-shadow: 0 0 5px rgba(255, 179, 75, .5);
}

.mission-terminal.is-summary .caller-feed img {
  filter: saturate(.55) contrast(1.05) brightness(.62);
}

.mission-terminal.is-summary .signal-noise {
  opacity: .3;
}

.contract-summary {
  position: relative;
  z-index: 1;
  padding: .68rem .9rem;
  border-top: 1px solid var(--line);
  background: rgba(255, 179, 75, .055);
}

.contract-copy {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: .25rem .8rem;
}

.contract-copy .eyebrow {
  grid-column: 1 / -1;
  margin: 0;
}

.contract-copy strong {
  color: var(--amber-pale);
  font-family: ui-rounded, system-ui, sans-serif;
}

.contract-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: .73rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes signal-jitter {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-1px, 1px); }
  66% { transform: translate(1px, 0); }
}

@keyframes video-scan {
  from { transform: translateY(0); }
  to { transform: translateY(420%); }
}

@keyframes waiting-signal {
  0%, 84% { transform: scale(1.04) translate(0, 0); }
  86% { transform: scale(1.04) translate(-2px, 1px); }
  89% { transform: scale(1.04) translate(2px, -1px); }
  92%, 100% { transform: scale(1.04) translate(0, 0); }
}

@keyframes caller-drift {
  from { transform: scale(1.035) translate3d(-.2%, 0, 0); }
  to { transform: scale(1.055) translate3d(.2%, -.35%, 0); }
}

@keyframes call-wave {
  from { height: 24%; opacity: .62; }
  to { height: 92%; opacity: 1; }
}

@keyframes dialogue-in {
  from { opacity: .35; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.mission-facts {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.mission-facts div {
  min-width: 0;
  padding: .75rem .9rem;
  border-right: 1px solid var(--line);
}

.mission-facts div:last-child {
  border-right: 0;
}

.mission-facts dt {
  margin-bottom: .25rem;
  color: var(--muted);
  font-size: .62rem;
  letter-spacing: .08em;
}

.mission-facts dd {
  overflow: hidden;
  margin: 0;
  color: var(--cream);
  font-size: .8rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-actions,
.debrief-actions {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  gap: .65rem;
  padding: .85rem;
}

.button {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: .7rem 1rem;
  font-weight: 900;
  letter-spacing: .035em;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(1px);
}

.button-primary {
  border-color: var(--amber-pale);
  background: var(--amber);
  color: #261607;
  box-shadow: 0 5px 18px rgba(255, 179, 75, .18);
}

.button-primary:hover {
  background: var(--amber-pale);
}

.button-secondary {
  border-color: var(--line);
  background: var(--steel);
  color: var(--cream);
}

.button-secondary:hover {
  border-color: var(--teal);
  background: var(--steel-2);
}

[hidden] {
  display: none !important;
}

.workshop-note {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding-left: .75rem;
  border-left: 3px solid var(--amber);
  text-shadow: 0 2px 5px #000;
  pointer-events: none;
}

.workshop-note span {
  color: var(--muted);
  font-size: .7rem;
}

.workshop-note strong {
  font-family: ui-rounded, system-ui, sans-serif;
  font-size: 1.05rem;
  letter-spacing: .06em;
}

#flight-canvas {
  z-index: 4;
  touch-action: none;
}

.flight-readout {
  top: 1rem;
  left: 1rem;
  z-index: 7;
  width: min(390px, 42vw);
  padding: 1rem 1.1rem;
}

#flight-instructions {
  position: relative;
  z-index: 1;
  margin: .55rem 0 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.45;
}

.atlas-button {
  position: relative;
  z-index: 1;
  min-height: 34px;
  margin-top: .7rem;
  border: 1px solid rgba(83, 217, 195, .5);
  border-radius: 4px;
  background: rgba(83, 217, 195, .08);
  color: var(--teal);
  padding: .45rem .65rem;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .06em;
}

.atlas-button:hover {
  background: rgba(83, 217, 195, .17);
}

.flight-meters {
  top: 1rem;
  right: 1rem;
  z-index: 7;
  width: min(310px, 31vw);
  padding: .9rem 1rem;
}

.flight-data-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .62rem .85rem;
  margin-bottom: .65rem;
}

.flight-data-grid div {
  min-width: 0;
}

.flight-data-grid span,
.flight-data-grid strong {
  display: block;
}

.flight-data-grid span {
  margin-bottom: .18rem;
  color: var(--muted);
  font-size: .59rem;
  letter-spacing: .08em;
}

.flight-data-grid strong {
  overflow: hidden;
  color: var(--cream);
  font-size: .77rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meter-label {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  margin-bottom: .32rem;
  color: var(--muted);
  font-size: .67rem;
}

.flight-meters > .meter-label {
  margin-top: .72rem;
}

.meter-label strong {
  color: var(--cream);
}

.meter {
  position: relative;
  z-index: 1;
  height: 9px;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(255, 255, 255, .11);
}

.meter i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--amber);
  box-shadow: 0 0 10px rgba(255, 179, 75, .5);
  transition: width .15s linear;
}

.meter-fuel i {
  width: 100%;
  background: var(--amber);
  box-shadow: 0 0 10px rgba(255, 179, 75, .5);
}

.meter-cyan i {
  width: 100%;
  background: var(--teal);
  box-shadow: 0 0 10px rgba(83, 217, 195, .45);
}

.meter.is-critical i {
  background: #ef6f61;
  box-shadow: 0 0 12px rgba(239, 111, 97, .7);
}

.nav-status {
  position: relative;
  z-index: 1;
  margin: .62rem 0 0;
  color: var(--teal);
  font-size: .65rem;
  line-height: 1.35;
}

.system-map {
  bottom: 1rem;
  left: 1rem;
  z-index: 7;
  width: 257px;
  padding: .65rem;
}

.map-heading {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: .6rem;
  letter-spacing: .08em;
}

#system-map-canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 190px;
  margin-top: .45rem;
  border: 1px solid rgba(83, 217, 195, .2);
  border-radius: 4px;
  background: rgba(1, 6, 11, .84);
}

.system-map p {
  position: relative;
  z-index: 1;
  margin: .35rem 0 0;
  color: var(--muted);
  font-size: .55rem;
  text-align: center;
}

.flight-controls {
  position: absolute;
  right: max(1.25rem, var(--safe-right));
  bottom: max(1.25rem, var(--safe-bottom));
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(3, 58px);
  grid-template-areas:
    "left thrust right"
    ". brake .";
  gap: .55rem;
}

.flight-control {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(244, 229, 197, .48);
  border-radius: 12px;
  background: rgba(7, 16, 18, .82);
  color: var(--cream);
  box-shadow: var(--shadow);
  font-size: 1.2rem;
  line-height: 1;
  backdrop-filter: blur(6px);
  touch-action: none;
  user-select: none;
}

.flight-control span {
  margin-top: -7px;
  font-size: .5rem;
  font-weight: 800;
  letter-spacing: .04em;
}

.flight-control.turn-left { grid-area: left; }
.flight-control.thrust { grid-area: thrust; border-color: rgba(255, 179, 75, .65); color: var(--amber-pale); }
.flight-control.turn-right { grid-area: right; }
.flight-control.brake { grid-area: brake; }

.flight-control:hover,
.flight-control:active,
.flight-control.is-active {
  border-color: var(--teal);
  background: rgba(23, 48, 53, .94);
  color: var(--teal);
  box-shadow: 0 0 18px rgba(83, 217, 195, .24);
}

#game-shell.is-towing .flight-controls {
  opacity: .18;
  pointer-events: none;
}

.flight-tip {
  position: absolute;
  left: 50%;
  bottom: 1.1rem;
  z-index: 7;
  margin: 0;
  padding: .5rem .75rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(7, 16, 18, .78);
  color: var(--muted);
  font-size: .72rem;
  transform: translateX(-50%);
  white-space: nowrap;
}

.flight-emergency {
  top: 50%;
  left: 50%;
  z-index: 18;
  display: grid;
  width: min(430px, calc(100% - 2rem));
  gap: .38rem;
  padding: 1.25rem 1.4rem;
  border-color: rgba(239, 111, 97, .74);
  background: rgba(24, 8, 9, .94);
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .46), 0 22px 70px rgba(0, 0, 0, .72);
  text-align: center;
  transform: translate(-50%, -50%);
  animation: emergency-arrival .32s ease-out both;
}

.flight-emergency[hidden] {
  display: none;
}

.flight-emergency h2 {
  margin: 0;
  color: #ffd4ca;
  font-size: clamp(1.7rem, 6vw, 2.8rem);
  letter-spacing: .04em;
}

.flight-emergency > strong {
  color: var(--amber-pale);
  letter-spacing: .12em;
}

.flight-emergency > span {
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.45;
}

@keyframes emergency-arrival {
  from { opacity: 0; transform: translate(-50%, -46%) scale(.96); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.atlas-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
  margin: 1rem 0;
}

.atlas-grid section {
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(83, 217, 195, .045);
}

.atlas-grid h3 {
  margin: 0 0 .35rem;
  color: var(--amber-pale);
  font-family: ui-rounded, system-ui, sans-serif;
  font-size: .82rem;
}

.atlas-grid p {
  margin: 0;
  font-size: .72rem;
}

kbd {
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 3px;
  background: var(--steel);
  color: var(--cream);
  padding: .1rem .3rem;
}

#game-shell.bump #game-stage {
  animation: bump .25s ease;
}

@keyframes bump {
  25% { transform: translateX(-5px); }
  55% { transform: translateX(5px); }
  100% { transform: translateX(0); }
}

.location-plate {
  top: 1rem;
  left: 1rem;
  width: min(330px, 34vw);
  padding: .85rem 1rem;
}

.location-plate h1 {
  font-size: clamp(1.4rem, 2.6vw, 2.45rem);
}

.location-plate p:last-child {
  position: relative;
  z-index: 1;
  margin: .35rem 0 0;
  color: var(--muted);
  font-size: .75rem;
}

.repair-progress {
  top: 1rem;
  right: 1rem;
  width: min(305px, 32vw);
  padding: .9rem 1rem;
}

.repair-progress ol {
  position: relative;
  z-index: 1;
  display: grid;
  gap: .55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.repair-progress li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: .5rem;
  align-items: center;
  color: var(--muted);
  font-size: .72rem;
}

.repair-progress li b {
  overflow: hidden;
  font: inherit;
  color: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.repair-progress li span {
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.repair-progress li.is-current {
  color: var(--cream);
}

.repair-progress li.is-current span {
  border-color: var(--amber);
  box-shadow: 0 0 8px rgba(255, 179, 75, .4);
}

.repair-progress li.is-complete {
  color: var(--green);
}

.repair-progress li.is-complete span {
  border-color: var(--green);
  background: var(--green);
}

.repair-progress li.is-complete span::after {
  color: var(--ink);
  content: "✓";
  font-size: .68rem;
  font-weight: 900;
}

.relay-markers {
  position: absolute;
  z-index: 6;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}

.relay-markers li {
  position: absolute;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid rgba(255, 179, 75, .75);
  border-radius: 50%;
  background: rgba(7, 16, 18, .82);
  color: var(--amber-pale);
  box-shadow: 0 0 0 5px rgba(255, 179, 75, .08), 0 4px 14px #000;
  font-weight: 900;
}

.relay-markers li:nth-child(1) { left: 52%; top: 44%; }
.relay-markers li:nth-child(2) { left: 63%; top: 43%; }
.relay-markers li:nth-child(3) { left: 73%; top: 47%; }

.relay-markers li.is-complete {
  border-color: var(--teal);
  background: var(--teal);
  color: var(--ink);
  box-shadow: 0 0 0 6px rgba(83, 217, 195, .13), 0 0 24px rgba(83, 217, 195, .75);
}

.attempts {
  color: var(--muted);
  font-size: .7rem;
}

#question-prompt {
  max-width: 900px;
}

.answer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: .8rem;
}

.answer-button {
  min-width: 88px;
  min-height: 48px;
  border: 1px solid rgba(244, 229, 197, .36);
  border-radius: 4px;
  background: var(--steel);
  color: var(--cream);
  font-size: 1rem;
  font-weight: 900;
}

.answer-button:hover {
  border-color: var(--amber);
  background: var(--steel-2);
}

.answer-button.is-wrong {
  border-color: var(--red);
  color: #ffd3c9;
}

.answer-button.is-correct {
  border-color: var(--green);
  background: rgba(83, 113, 61, .8);
  color: #eeffe7;
}

.answer-button:disabled {
  opacity: .55;
}

.answer-button.is-correct:disabled {
  opacity: 1;
}

.feedback {
  margin-top: .75rem;
  padding: .62rem .75rem;
  border-left: 3px solid var(--teal);
  background: rgba(83, 217, 195, .09);
  color: #d8efe9;
  font-size: .82rem;
  line-height: 1.4;
}

.feedback.is-hint {
  border-left-color: var(--amber);
  background: rgba(255, 179, 75, .09);
  color: var(--amber-pale);
}

.next-button {
  float: right;
  margin-top: .75rem;
}

.debrief-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(780px, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  overflow: auto;
  padding: clamp(1.1rem, 3vw, 2rem);
  transform: translate(-50%, -50%);
}

.debrief-panel > * {
  position: relative;
  z-index: 1;
}

.debrief-panel > p:not(.eyebrow) {
  max-width: 58ch;
  color: var(--muted);
  line-height: 1.5;
}

.debrief-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 1.2rem 0;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.debrief-stats div {
  padding: .8rem;
  border-right: 1px solid var(--line);
}

.debrief-stats div:last-child {
  border-right: 0;
}

.debrief-stats span,
.debrief-stats strong {
  display: block;
}

.debrief-stats span {
  margin-bottom: .3rem;
  color: var(--muted);
  font-size: .66rem;
}

.debrief-stats strong {
  color: var(--amber-pale);
  font-family: ui-rounded, system-ui, sans-serif;
  font-size: 1.25rem;
}

.mission-settlement {
  position: relative;
  z-index: 1;
  overflow: hidden;
  margin: 1rem 0;
  border: 1px solid rgba(255, 179, 75, .3);
  border-radius: 6px;
  background: rgba(3, 12, 14, .64);
}

.settlement-heading,
.settlement-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem .85rem;
  background: rgba(255, 179, 75, .08);
}

.settlement-heading div {
  display: grid;
  gap: .15rem;
}

.settlement-heading span,
.mission-settlement dt,
.settlement-total span,
.mission-settlement > p {
  color: var(--muted);
  font-size: .64rem;
  letter-spacing: .07em;
}

.settlement-heading strong,
.settlement-total strong {
  color: var(--cream);
}

.settlement-heading b {
  padding: .25rem .45rem;
  border: 1px solid rgba(83, 217, 195, .45);
  border-radius: 3px;
  color: var(--teal);
  font-size: .62rem;
  letter-spacing: .08em;
}

.settlement-heading b.is-aborted {
  border-color: rgba(239, 111, 97, .5);
  color: #ff9d8f;
}

.mission-settlement dl {
  margin: 0;
}

.mission-settlement dl > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .48rem .85rem;
  border-top: 1px solid rgba(244, 229, 197, .08);
}

.mission-settlement dt {
  display: flex;
  align-items: baseline;
  gap: .55rem;
  letter-spacing: .02em;
}

.mission-settlement dt small {
  color: rgba(157, 183, 181, .72);
  font-size: .6rem;
}

.mission-settlement dd {
  margin: 0;
  color: var(--cream);
  font-weight: 800;
  white-space: nowrap;
}

.mission-settlement .settlement-bonus-row {
  background: rgba(255, 179, 75, .025);
}

.mission-settlement .settlement-bonus-row.is-earned {
  background: linear-gradient(90deg, rgba(255, 179, 75, .12), rgba(83, 217, 195, .07));
}

.mission-settlement .settlement-bonus-row.is-earned dt,
.mission-settlement .settlement-bonus-row.is-earned dd {
  color: var(--amber-pale);
}

.settlement-total {
  border-top: 1px solid rgba(255, 179, 75, .3);
}

.settlement-total strong {
  color: var(--teal);
  font-size: 1.15rem;
}

.settlement-total strong.is-negative {
  color: #ff9d8f;
}

.mission-settlement > p {
  display: flex;
  justify-content: space-between;
  max-width: none;
  margin: 0;
  padding: .5rem .85rem;
}

.mission-settlement > p strong {
  color: var(--amber-pale);
}

blockquote {
  margin: 1rem 0;
  padding: .9rem 1rem;
  border-left: 3px solid var(--teal);
  background: rgba(83, 217, 195, .07);
  color: #d8efe9;
  line-height: 1.45;
}

cite {
  display: block;
  margin-top: .35rem;
  color: var(--muted);
  font-size: .75rem;
  font-style: normal;
}

.debrief-actions {
  padding-right: 0;
  padding-bottom: 0;
}

.game-dialog {
  width: min(560px, calc(100% - 1.25rem));
  max-height: min(720px, calc(100dvh - 1.25rem));
  overflow: hidden;
  border: 1px solid rgba(244, 229, 197, .35);
  border-radius: 8px;
  background: var(--ink);
  color: var(--cream);
  box-shadow: 0 30px 100px #000;
  padding: 0;
}

.game-dialog::backdrop {
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(5px);
}

.dialog-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .7rem .85rem;
  border-bottom: 1px solid var(--line);
  background: var(--steel);
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .08em;
}

.dialog-titlebar button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--cream);
  font-size: 1.2rem;
}

.dialog-body {
  overflow: auto;
  max-height: calc(100dvh - 7rem);
  padding: 1.2rem;
}

.dialog-body p,
.dialog-body li {
  color: var(--muted);
  line-height: 1.5;
}

.dialog-body ul {
  padding-left: 1.25rem;
}

.dialog-note {
  padding: .75rem;
  border-left: 3px solid var(--teal);
  background: rgba(83, 217, 195, .07);
}

.dialog-close {
  width: 100%;
  margin-top: .75rem;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 0;
  border-bottom: 1px solid var(--line);
}

.setting-row strong,
.setting-row small {
  display: block;
}

.setting-row small {
  margin-top: .25rem;
  color: var(--muted);
}

.setting-row input {
  width: 24px;
  height: 24px;
  accent-color: var(--teal);
}

.control-help {
  display: grid;
  gap: .3rem;
  margin: 1rem 0;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: .82rem;
}

.control-help strong {
  color: var(--cream);
}

.reset-button {
  width: 100%;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(52px + var(--safe-bottom));
  z-index: 200;
  max-width: min(440px, calc(100% - 2rem));
  padding: .65rem .85rem;
  border: 1px solid var(--teal);
  border-radius: 5px;
  background: rgba(7, 16, 18, .94);
  color: var(--cream);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.flight-impact-alert {
  position: absolute;
  left: 50%;
  top: calc(50% + 64px);
  z-index: 35;
  width: min(440px, calc(100% - 48px));
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #ff6b68;
  font: 700 clamp(.7rem, 1.15vw, .85rem)/1.4 ui-monospace, monospace;
  text-align: center;
  text-wrap: balance;
  text-shadow: 0 2px 3px #000, 0 0 9px #000, 0 0 18px #000;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity .18s ease;
}
.flight-impact-alert.is-visible { opacity: 1; animation: flight-impact-flash 1s ease-in-out infinite; }
@keyframes flight-impact-flash { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
body.is-page-hidden .flight-impact-alert { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .flight-impact-alert.is-visible { animation: none; } }

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
  transition-duration: .001ms !important;
}

@media (max-width: 820px) {
  .connection-status,
  .scene-label,
  .desktop-only,
  .crew-panel,
  .workshop-note,
  .flight-tip {
    display: none;
  }

  .workshop-guide {
    top: .65rem;
    right: .65rem;
    left: .65rem;
    width: auto;
    padding: .72rem .8rem;
    transform: none;
  }

  .workshop-guide h1 {
    font-size: 1.2rem;
  }

  .workshop-guide p:last-child {
    margin-top: .22rem;
    font-size: .75rem;
  }

  .workshop-interact-prompt {
    display: none;
  }

  .workshop-inspector {
    right: .65rem;
    bottom: 4.7rem;
    left: .65rem;
    width: auto;
    max-height: calc(100% - 10.3rem);
    overflow: auto;
  }

  .shop-panel {
    width: calc(100% - 1.3rem);
    max-height: calc(100% - 1.3rem);
  }

  .shop-grid {
    gap: .55rem;
    padding-right: .75rem;
    padding-left: .75rem;
  }

  .shop-card {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    padding: .68rem;
  }

  .shop-item-badge {
    width: 48px;
    height: 48px;
  }

  .mission-board {
    top: .65rem;
    right: .65rem;
    left: .65rem;
    width: auto;
    padding: .55rem;
  }

  .mission-board-heading {
    margin-bottom: .42rem;
  }

  .mission-picker {
    grid-template-columns: 1fr 1fr;
  }

  .mission-card {
    min-height: 66px;
    padding: .48rem .55rem;
  }

  .mission-terminal {
    right: .65rem;
    bottom: .65rem;
    left: .65rem;
    width: auto;
    max-height: calc(100% - 8.9rem);
    overflow: auto;
  }

  .terminal-screen {
    grid-template-columns: minmax(220px, .84fr) minmax(260px, 1.16fr);
    gap: .7rem;
    padding: .8rem;
  }

  .call-wave {
    margin-bottom: .4rem;
  }

  .mission-facts div {
    padding: .55rem .65rem;
  }

  .terminal-actions {
    padding: .65rem;
  }

  .button {
    min-height: 44px;
    padding: .62rem .8rem;
    font-size: .78rem;
  }

  .flight-readout {
    top: .65rem;
    left: .65rem;
    width: min(310px, 44vw);
    padding: .75rem .85rem;
  }

  #flight-instructions {
    display: none;
  }

  .flight-meters {
    top: .65rem;
    right: .65rem;
    bottom: auto;
    left: auto;
    width: min(270px, 48vw);
    padding: .7rem .8rem;
  }

  .system-map {
    bottom: .65rem;
    left: .65rem;
    width: 221px;
  }

  #system-map-canvas {
    height: 158px;
  }

  .flight-controls {
    right: max(.65rem, var(--safe-right));
    bottom: max(.65rem, var(--safe-bottom));
  }

  .location-plate {
    top: .65rem;
    left: .65rem;
    width: min(270px, calc(100% - 1.3rem));
  }

  .repair-progress {
    display: none;
  }

  .answer-grid {
    gap: .4rem;
    margin-top: .55rem;
  }

  .answer-button {
    min-width: 72px;
    min-height: 44px;
  }

  .relay-markers li:nth-child(1) { left: 50%; top: 39%; }
  .relay-markers li:nth-child(2) { left: 63%; top: 38%; }
  .relay-markers li:nth-child(3) { left: 75%; top: 42%; }
}

@media (max-width: 580px) {
  .top-hud {
    min-height: calc(52px + var(--safe-top));
  }

  .brand-mark {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  .brand-name {
    font-size: .72rem;
    letter-spacing: .04em;
  }

  .credit-balance {
    padding: .28rem .38rem;
    font-size: .58rem;
  }

  .shop-heading {
    align-items: stretch;
    padding: .78rem;
  }

  .shop-heading > div:first-child p:last-child,
  .shop-footer small {
    display: none;
  }

  .shop-wallet {
    min-width: 112px;
    padding: .48rem .55rem;
  }

  .shop-grid {
    grid-template-columns: 1fr;
  }

  .shop-card {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: .28rem .55rem;
  }

  .shop-item-badge {
    width: 44px;
    height: 44px;
    font-size: .62rem;
  }

  .icon-button {
    min-height: 34px;
    padding: .4rem .5rem;
    font-size: .63rem;
  }

  #audio-button {
    display: none;
  }

  .bottom-hud {
    min-height: calc(31px + var(--safe-bottom));
    font-size: .65rem;
  }

  .mission-board {
    padding: .42rem;
  }

  .mission-board-heading {
    margin-bottom: .3rem;
  }

  .mission-board-heading .eyebrow,
  .mission-board-heading > span {
    display: none;
  }

  .mission-board-heading strong {
    font-size: .74rem;
  }

  .mission-picker {
    gap: .35rem;
  }

  .mission-card {
    min-height: 55px;
    padding: .38rem .45rem;
  }

  .mission-card > small {
    display: none;
  }

  .mission-card > strong {
    font-size: .72rem;
  }

  .mission-card > span,
  .mission-card > b {
    font-size: .48rem;
  }

  .mission-terminal {
    max-height: calc(100% - 7rem);
  }

  .terminal-bar {
    padding: .5rem .65rem;
  }

  #call-channel-label {
    display: none;
  }

  .terminal-bar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .45rem;
  }

  .terminal-exit {
    min-height: 27px;
    padding: .22rem .36rem;
    font-size: .66rem;
  }

  .workshop-guide .eyebrow {
    margin-bottom: .2rem;
    font-size: .7rem;
  }

  .workshop-guide h1 {
    font-size: 1.02rem;
  }

  .workshop-guide p:last-child {
    max-width: 34rem;
    line-height: 1.3;
  }

  .workshop-inspector {
    bottom: 4.55rem;
    padding: .75rem;
  }

  .workshop-inspector > p:not(.eyebrow) {
    max-height: 5.8em;
    overflow: auto;
    margin: .4rem 0 .65rem;
    font-size: .8rem;
    line-height: 1.42;
  }

  .workshop-inspector-footer {
    align-items: stretch;
    flex-direction: column;
    gap: .5rem;
  }

  .workshop-inspector-footer .button {
    width: 100%;
  }

  .terminal-screen {
    grid-template-columns: 1fr;
    gap: .58rem;
    padding: .58rem;
  }

  .video-terminal {
    max-height: 150px;
    aspect-ratio: 16 / 7;
  }

  .caller-feed img {
    object-position: 50% 39%;
  }

  .call-wave {
    display: none;
  }

  .call-controls {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .call-controls .button-primary {
    width: 100%;
  }

  .contract-summary {
    padding: .5rem .65rem;
  }

  .contract-copy {
    display: block;
  }

  .contract-copy span {
    display: none;
  }

  .mission-facts {
    grid-template-columns: 1fr 1fr;
  }

  .mission-facts div:nth-child(even) {
    border-right: 0;
  }

  .terminal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .art img {
    object-position: 56% center;
  }

  .flight-readout {
    top: .42rem;
    left: .42rem;
    width: 42vw;
    padding: .55rem .62rem;
  }

  .flight-readout h1 {
    font-size: clamp(1.02rem, 5vw, 1.35rem);
  }

  .flight-readout .eyebrow {
    margin-bottom: .18rem;
    font-size: .56rem;
  }

  .atlas-button {
    min-height: 28px;
    margin-top: .38rem;
    padding: .3rem .4rem;
    font-size: .52rem;
  }

  .flight-meters {
    top: .42rem;
    right: .42rem;
    width: 52vw;
    padding: .5rem .58rem;
  }

  .flight-data-grid {
    gap: .34rem .5rem;
    margin-bottom: .42rem;
  }

  .flight-data-grid span {
    font-size: .49rem;
  }

  .flight-data-grid strong {
    font-size: .64rem;
  }

  .flight-meters > .meter-label {
    margin-top: .42rem;
    margin-bottom: .2rem;
    font-size: .54rem;
  }

  .nav-status {
    display: none;
  }

  .system-map {
    bottom: .42rem;
    left: .42rem;
    width: min(158px, calc(100% - 171px));
    padding: .42rem;
  }

  #system-map-canvas {
    height: 118px;
    margin-top: .3rem;
  }

  .system-map p {
    display: none;
  }

  .flight-controls {
    right: max(.42rem, var(--safe-right));
    bottom: max(.42rem, var(--safe-bottom));
    grid-template-columns: repeat(3, 46px);
    gap: .35rem;
  }

  .flight-control {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    font-size: 1rem;
  }

  .flight-control span {
    margin-top: -5px;
    font-size: .42rem;
  }

  .atlas-grid {
    grid-template-columns: 1fr;
  }

  #game-shell[data-scene="mission"] .art-mission img {
    object-position: 46% center;
  }

  .location-plate h1 {
    font-size: 1.35rem;
  }

  .location-plate p:last-child {
    display: none;
  }

  #question-prompt {
    font-size: 1.05rem;
  }

  .feedback {
    max-height: 64px;
    overflow: auto;
  }

  .next-button {
    width: 100%;
  }

  .relay-markers {
    display: none;
  }

  .debrief-panel {
    max-height: calc(100% - 1.2rem);
    overflow: auto;
  }

  .debrief-stats {
    grid-template-columns: 1fr;
  }

  .debrief-stats div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: .55rem .7rem;
  }

  .debrief-stats div:last-child {
    border-bottom: 0;
  }

  .debrief-stats span {
    margin: 0;
  }

  blockquote {
    font-size: .82rem;
  }

  .debrief-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .mission-settlement dt {
    display: grid;
    gap: .15rem;
  }
}

@media (max-height: 650px) and (orientation: landscape) {
  .top-hud {
    min-height: calc(48px + var(--safe-top));
  }

  .bottom-hud {
    min-height: calc(28px + var(--safe-bottom));
  }

  .crew-panel,
  .workshop-note {
    display: none;
  }

  .workshop-guide {
    top: .5rem;
    left: .5rem;
    width: min(310px, 38vw);
    padding: .62rem .72rem;
    text-align: left;
    transform: none;
  }

  .workshop-guide h1 {
    font-size: 1.08rem;
  }

  .workshop-guide p:last-child {
    display: none;
  }

  .workshop-inspector {
    right: .5rem;
    bottom: .5rem;
    width: min(355px, 42vw);
    max-height: calc(100% - 1rem);
    overflow: auto;
    padding: .72rem;
  }

  .workshop-inspector > p:not(.eyebrow) {
    margin: .38rem 0 .55rem;
    font-size: .76rem;
    line-height: 1.38;
  }

  .mission-board {
    top: .5rem;
    right: auto;
    left: .5rem;
    width: 240px;
    max-height: calc(100% - 1rem);
    overflow: auto;
    padding: .45rem;
  }

  .mission-board-heading {
    margin-bottom: .35rem;
  }

  .mission-board-heading .eyebrow,
  .mission-board-heading > span,
  .mission-card > small {
    display: none;
  }

  .mission-board-heading strong {
    font-size: .74rem;
  }

  .mission-picker {
    grid-template-columns: 1fr;
    gap: .35rem;
  }

  .mission-card {
    min-height: 55px;
    padding: .38rem .45rem;
  }

  .mission-terminal {
    right: .5rem;
    left: 250px;
    width: auto;
    max-height: calc(100% - 1rem);
    bottom: .5rem;
    overflow: auto;
  }

  .terminal-screen {
    grid-template-columns: minmax(220px, .82fr) minmax(280px, 1.18fr);
    padding: .72rem;
  }

  .video-terminal {
    min-height: 160px;
    aspect-ratio: auto;
  }

  .call-wave {
    height: 13px;
    margin: 0 0 .3rem;
  }

  .call-controls .button {
    min-height: 38px;
    padding: .45rem .62rem;
  }

  .contract-summary {
    display: none;
  }

  .mission-facts div {
    padding: .45rem .7rem;
  }

  .terminal-actions {
    padding: .5rem;
  }

  #flight-instructions,
  .flight-tip,
  .repair-progress,
  .location-plate p:last-child {
    display: none;
  }

  .flight-readout {
    top: .45rem;
    left: .45rem;
    padding: .55rem .65rem;
  }

  .flight-readout h1 {
    font-size: 1.22rem;
  }

  .atlas-button {
    min-height: 28px;
    margin-top: .35rem;
  }

  .flight-meters {
    top: .45rem;
    right: .45rem;
    padding: .5rem .65rem;
  }

  .nav-status {
    display: none;
  }

  .system-map {
    bottom: .45rem;
    left: .45rem;
    width: 180px;
    padding: .42rem;
  }

  #system-map-canvas {
    height: 110px;
  }

  .system-map p {
    display: none;
  }

  .flight-controls {
    right: max(.45rem, var(--safe-right));
    bottom: max(.45rem, var(--safe-bottom));
    grid-template-columns: repeat(3, 46px);
    gap: .35rem;
  }

  .flight-control {
    width: 46px;
    height: 46px;
  }

  .answer-grid {
    margin-top: .48rem;
  }

  .answer-button {
    min-height: 40px;
  }
}

@media (max-width: 700px) and (max-height: 650px) and (orientation: landscape) {
  .workshop-inspector {
    right: .45rem;
    bottom: 4.45rem;
    left: .45rem;
    width: auto;
    max-height: calc(100% - 5.2rem);
  }

  .mission-board {
    width: 170px;
  }

  .mission-terminal {
    right: .45rem;
    left: 180px;
    width: auto;
  }

  .terminal-screen {
    grid-template-columns: minmax(0, 1fr);
    gap: .5rem;
    padding: .48rem;
  }

  .video-terminal {
    display: none;
  }

  .call-controls {
    display: flex;
  }
}

/* Playable mission rooms */
#game-shell[data-scene="mission"] .art-mission {
  display: none;
}

#mission-scene {
  padding: 0;
}

.mission-world,
.mission-world-art,
.mission-world-art img,
.mission-world-glow,
.mission-zone-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.mission-world {
  z-index: 0;
  overflow: hidden;
  background: #071012;
  isolation: isolate;
}

.mission-world-art {
  z-index: 0;
  overflow: hidden;
}

.mission-world-art img {
  object-fit: fill;
  filter: saturate(.96) contrast(1.03) brightness(.92);
  transform: scale(1.004);
}

#game-shell[data-mission="europa-greenhouse-01"] .mission-world-art img {
  filter: saturate(.94) contrast(1.02) brightness(.94) hue-rotate(-3deg);
}

.mission-world-glow {
  z-index: 1;
  pointer-events: none;
  opacity: .7;
  background:
    linear-gradient(90deg, rgba(2, 8, 9, .42), transparent 16%, transparent 84%, rgba(2, 8, 9, .45)),
    linear-gradient(180deg, rgba(2, 8, 9, .2), transparent 42%, rgba(2, 8, 9, .36)),
    linear-gradient(108deg, transparent 25%, rgba(83, 217, 195, .08) 47%, transparent 61%);
  background-size: 100% 100%, 100% 100%, 210% 100%;
  animation: mission-light-sweep 9s ease-in-out infinite alternate;
}

@keyframes mission-light-sweep {
  from { background-position: 0 0, 0 0, 0 0; }
  to { background-position: 0 0, 0 0, 100% 0; }
}

.mission-zone-layer {
  z-index: auto;
  pointer-events: none;
}

.mission-extra-npc-layer {
  display: contents;
}

.mission-zone-marker {
  position: absolute;
  left: var(--zone-x);
  top: var(--zone-y);
  display: grid;
  place-items: center;
  color: var(--muted);
  opacity: .62;
  transform: translate(-50%, -50%);
  transition: opacity .2s ease, filter .2s ease;
}

.mission-zone-ring {
  position: relative;
  display: grid;
  width: clamp(34px, 3.8vw, 54px);
  height: clamp(15px, 1.8vw, 24px);
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: rgba(4, 13, 15, .28);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .035), 0 0 14px currentColor;
  transform: perspective(70px) rotateX(55deg);
}

.mission-zone-marker strong {
  position: absolute;
  bottom: calc(100% + 7px);
  width: max-content;
  max-width: 145px;
  padding: .25rem .42rem;
  border: 1px solid currentColor;
  border-radius: 3px;
  background: rgba(5, 15, 17, .7);
  color: inherit;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .44);
  backdrop-filter: blur(3px) saturate(.9);
  -webkit-backdrop-filter: blur(3px) saturate(.9);
  font-size: clamp(.48rem, .63vw, .62rem);
  letter-spacing: .07em;
  line-height: 1.15;
  text-align: center;
}

.mission-zone-marker.is-current {
  color: var(--amber-pale);
  opacity: 1;
}

.mission-zone-marker.is-current .mission-zone-ring {
  animation: mission-zone-pulse 1.45s ease-in-out infinite;
}

.mission-zone-marker.is-npc.is-current {
  color: var(--teal);
}

.mission-zone-marker.is-nearby {
  opacity: 1;
  filter: brightness(1.32);
}

.mission-zone-marker.is-nearby .mission-zone-ring {
  background: rgba(255, 179, 75, .18);
  box-shadow: 0 0 0 7px rgba(255, 179, 75, .11), 0 0 25px currentColor;
}

.mission-zone-marker.is-complete {
  color: var(--green);
  opacity: .82;
}

.mission-zone-marker.is-complete .mission-zone-ring::after {
  position: absolute;
  color: var(--green);
  content: "✓";
  font-size: .9rem;
  font-weight: 900;
  transform: rotateX(-55deg) translateY(-2px);
}

.mission-zone-marker.is-locked {
  opacity: .24;
  filter: grayscale(1);
}

.workshop-zone-marker {
  width: clamp(78px, 7vw, 104px);
  height: clamp(46px, 4vw, 58px);
  padding: 0;
  border: 0;
  border-radius: 50%;
  appearance: none;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  font: inherit;
  opacity: .88;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.workshop-zone-marker .mission-zone-ring {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border-width: 3px;
  background: rgba(4, 18, 19, .42);
  box-shadow: 0 0 0 5px rgba(83, 217, 195, .07), 0 0 18px currentColor;
  transition: background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.workshop-zone-marker strong {
  top: auto;
  bottom: calc(100% + 8px);
  left: 50%;
  width: max-content;
  max-width: 180px;
  padding: .4rem .58rem;
  border: 2px solid currentColor;
  border-radius: 4px;
  background: rgba(5, 15, 17, .74);
  color: inherit;
  box-shadow: 0 5px 16px rgba(0, 0, 0, .48);
  font-size: clamp(.875rem, 1.05vw, 1rem);
  font-weight: 900;
  letter-spacing: .055em;
  line-height: 1.1;
  text-shadow: none;
  transform: translateX(-50%);
}

.workshop-zone-marker.is-current {
  color: var(--amber-pale);
}

.workshop-zone-marker:hover,
.workshop-zone-marker:focus-visible,
.workshop-zone-marker.is-active {
  opacity: 1;
  outline: none;
}

.workshop-zone-marker:hover .mission-zone-ring,
.workshop-zone-marker:focus-visible .mission-zone-ring,
.workshop-zone-marker.is-active .mission-zone-ring {
  background: rgba(83, 217, 195, .18);
  box-shadow: 0 0 0 8px rgba(83, 217, 195, .11), 0 0 28px currentColor;
  transform: perspective(70px) rotateX(55deg) scale(1.1);
}

.workshop-zone-marker.is-nearby .mission-zone-ring {
  background: rgba(255, 179, 75, .2);
}

.workshop-zone-marker.is-complete {
  color: var(--green);
}

.workshop-zone-marker.is-complete .mission-zone-ring::after {
  display: none;
}

@keyframes mission-zone-pulse {
  50% { box-shadow: 0 0 0 9px rgba(255, 179, 75, .08), 0 0 28px currentColor; transform: perspective(70px) rotateX(55deg) scale(1.12); }
}

.mission-actor {
  --depth-scale: .9;
  min-width: 0;
  min-height: 0;
  position: absolute;
  display: grid;
  transform: translate(-50%, -100%) scale(var(--depth-scale));
  transform-origin: 50% 100%;
  pointer-events: none;
  will-change: left, top, transform;
}

.mission-rivet {
  width: clamp(112px, 10.5vw, 154px);
}

.mission-socket {
  width: clamp(90px, 8.4vw, 124px);
}

.workshop-rivet {
  width: clamp(112px, 10vw, 150px);
}

.workshop-socket {
  width: clamp(88px, 8vw, 118px);
}

.mission-client {
  --npc-step-lift: 0px;
  width: clamp(112px, 10.8vw, 168px);
}

#game-shell[data-mission="phobos-relay-01"] .mission-client {
  width: clamp(122px, 11.4vw, 182px);
}

#game-shell[data-mission="europa-greenhouse-01"] .mission-client {
  width: clamp(112px, 10.8vw, 168px);
}

#game-shell[data-mission="titan-archive-01"] .mission-client {
  width: clamp(112px, 10.8vw, 168px);
}

#game-shell[data-mission="titan-archive-01"] .mission-extra-npc {
  width: clamp(108px, 10.2vw, 158px);
}

.mission-sprite {
  position: relative;
  z-index: 2;
  display: block;
  grid-area: 1 / 1;
  width: 100%;
  overflow: hidden;
  aspect-ratio: var(--frame-aspect, 3 / 2);
  line-height: 0;
  transform-origin: 50% 100%;
  transition: transform .12s ease;
}

/* Crew and NPCs both render one cell, without CSS atlas translation. */
.crew-sprite-atlas { display: block; aspect-ratio: 8 / 9; transform: none; scale: 1; transition: none; }
.crew-sprite-atlas picture { display: none; }
.crew-sprite-atlas canvas { display: block; width: 100%; height: 100%; }
.socket-activity-bubble { bottom: calc(56% + 10px); }

.mission-client .mission-client-sprite {
  display: block;
  min-width: 0;
  min-height: 0;
  overflow: visible;
  aspect-ratio: 8 / 9;
  transform: none;
  transition: none;
}

.npc-atlas-source {
  display: none;
}

.mission-client-sprite canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Keep intrinsic atlas/canvas dimensions out of actor layout during tab
   suspension and backing-store restoration. The viewport owns the size. */
.crew-sprite-atlas, .mission-client .mission-client-sprite {
  contain: size layout;
  min-width: 0;
  aspect-ratio: 8 / 9;
}
.crew-sprite-atlas canvas, .mission-client-sprite canvas {
  position: absolute;
  inset: 0;
  min-width: 0;
  max-width: 100%;
}

.mission-client.is-moving .mission-client-sprite {
  transform: translateY(var(--npc-step-lift));
}

.mission-client .mission-actor-shadow {
  width: 62%;
}

.mission-actor-shadow {
  position: absolute;
  bottom: -3px;
  left: 50%;
  z-index: 1;
  width: 54%;
  height: 13px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .42);
  filter: blur(3px);
  transform: translateX(-50%);
}

.mission-socket .mission-actor-shadow {
  width: 72%;
  height: 10px;
}

.mission-actor.is-moving .mission-actor-shadow {
  animation: mission-shadow-step .27s ease-in-out infinite alternate;
}

@keyframes mission-shadow-step {
  to { opacity: .72; transform: translateX(-50%) scaleX(.88); }
}

#mission-scene .location-plate,
#mission-scene .repair-progress {
  z-index: 125;
}

.repair-progress:has(li:nth-child(6)) { width: min(340px, 34vw); }
.repair-progress:has(li:nth-child(6)) ol { gap: .34rem; }
.repair-progress:has(li:nth-child(6)) li { font-size: .67rem; }

.concept-board { display: grid; gap: .7rem; width: 100%; color: #f1e7cc; }
.concept-board-heading { color: #ffcf87; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.concept-board-instruction { margin: 0; line-height: 1.45; }
.concept-facts { display: flex; flex-wrap: wrap; gap: .45rem; }
.concept-fact { padding: .46rem .63rem; border: 1px solid #769488; border-radius: 7px; background: #19383b; color: #f2e6c9; font-size: .87rem; }
.concept-answers { display: grid; gap: .38rem; }
.concept-answer-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .45rem; border: 1px solid #527574; border-radius: 7px; background: #102c31; }
.concept-answer-row label { flex: 1 1 135px; font-size: .83rem; font-weight: 700; }
.concept-answer-value { display: inline-grid; min-width: 4rem; min-height: 2.2rem; place-items: center; color: #ffda9b; font-weight: 900; }
.concept-button { min-height: 2.25rem; padding: .35rem .6rem; border: 1px solid #83acaa; border-radius: 5px; background: #24464b; color: #f5ebd6; font: inherit; font-size: .82rem; cursor: pointer; }
.concept-button:hover:not(:disabled), .concept-button:focus-visible { background: #36676b; border-color: #ffcc7d; }
.concept-button:disabled { opacity: .58; cursor: default; }
.concept-button[aria-pressed="true"], .concept-button.is-selected { background: #876049; border-color: #ffcf87; color: white; }
.concept-options, .concept-actions, .concept-piece-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.concept-actions { justify-content: flex-end; padding-top: .4rem; border-top: 1px solid #537371; }
.concept-test { background: #a96837; border-color: #ffd08a; font-weight: 900; }
.concept-coordinate-area, .concept-cargo, .concept-tiling, .concept-score { display: grid; gap: .5rem; padding: .55rem; border: 1px solid #729894; border-radius: 7px; background: #0e282e; }
.concept-coordinate-grid, .concept-tile-grid { display: grid; grid-template-columns: repeat(var(--concept-cols), minmax(0, 1fr)); gap: 3px; max-width: 420px; }
.concept-coordinate-grid .concept-button { min-height: 2rem; padding: 0; font-size: .69rem; }
.concept-tile-grid .concept-button { min-height: 2.2rem; padding: 0; }
.concept-tile-grid [data-panel="0"] { background: #be8560; }.concept-tile-grid [data-panel="1"] { background: #689c91; }.concept-tile-grid [data-panel="2"] { background: #946b9a; }.concept-tile-grid [data-panel="3"] { background: #ad985a; }.concept-tile-grid [data-panel="overlap"] { background: #aa423b; }
.concept-cargo-row { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.concept-cargo-row span { min-width: 7rem; }
.concept-score-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; }
.concept-score-slots .concept-button { min-height: 3rem; padding: .3rem; }
.concept-score-slots [data-instrument="CHIME"] { background: #a37744; }.concept-score-slots [data-instrument="DRUM"] { background: #704e72; }.concept-score-slots [data-instrument="MELODY"] { background: #2f6c68; }
@media (max-width: 700px) { .repair-progress:has(li:nth-child(6)) { width: min(300px, 42vw); } .concept-cargo-row span { width: 100%; } .concept-score-slots .concept-button { font-size: .7rem; } }

.mission-objective-ribbon {
  position: absolute;
  top: 1rem;
  left: 50%;
  z-index: 126;
  display: grid;
  min-width: min(340px, 34vw);
  padding: .55rem .8rem;
  border: 1px solid rgba(83, 217, 195, .42);
  border-radius: 5px;
  background: rgba(5, 15, 17, .82);
  box-shadow: 0 9px 28px rgba(0, 0, 0, .28);
  text-align: center;
  transform: translateX(-50%);
  backdrop-filter: blur(7px);
}

.mission-objective-ribbon span {
  color: var(--teal);
  font-size: .55rem;
  font-weight: 900;
  letter-spacing: .13em;
}

.mission-objective-ribbon strong {
  overflow: hidden;
  margin-top: .17rem;
  color: var(--cream);
  font-size: .72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mission-inventory {
  position: absolute;
  bottom: max(.65rem, var(--safe-bottom));
  left: 50%;
  z-index: 131;
  width: min(360px, 38vw);
  padding: .46rem .55rem .5rem;
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
}

.mission-inventory header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  margin-bottom: .35rem;
  color: var(--teal);
  font-size: .56rem;
  font-weight: 900;
  letter-spacing: .1em;
}

.mission-inventory header strong {
  color: var(--amber-pale);
}

.mission-inventory-slots {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .35rem;
}

.inventory-slot {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 48px;
  place-items: center;
  border: 1px solid rgba(244, 229, 197, .24);
  border-radius: 5px;
  background: rgba(5, 15, 17, .82);
  color: rgba(185, 180, 159, .6);
  padding: .25rem;
  cursor: default;
}

.inventory-slot.has-item {
  border-color: rgba(83, 217, 195, .5);
  color: var(--cream);
  cursor: pointer;
}

.inventory-slot.has-item:hover,
.inventory-slot.has-item:focus-visible,
.inventory-slot.is-selected {
  border-color: var(--amber);
  background: rgba(255, 179, 75, .14);
  box-shadow: inset 0 0 14px rgba(255, 179, 75, .09), 0 0 13px rgba(255, 179, 75, .15);
}

.inventory-slot.is-selected::after {
  position: absolute;
  top: 3px;
  right: 4px;
  color: var(--amber-pale);
  content: "✓";
  font-size: .62rem;
  font-weight: 900;
}

.inventory-slot-glyph {
  color: var(--teal);
  font-family: ui-rounded, system-ui, sans-serif;
  font-size: 1.15rem;
  line-height: 1;
  text-shadow: 0 0 9px rgba(83, 217, 195, .45);
}

.inventory-slot-label {
  overflow: hidden;
  width: 100%;
  color: inherit;
  font-size: .5rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mission-inventory > small {
  position: relative;
  z-index: 1;
  display: block;
  overflow: hidden;
  margin-top: .28rem;
  color: var(--muted);
  font-size: .52rem;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mission-interact-prompt {
  position: absolute;
  bottom: max(6.25rem, calc(var(--safe-bottom) + 5.6rem));
  left: 50%;
  z-index: 130;
  display: flex;
  align-items: center;
  gap: .5rem;
  max-width: min(470px, 44vw);
  padding: .48rem .68rem;
  border: 1px solid rgba(244, 229, 197, .24);
  border-radius: 5px;
  background: rgba(5, 15, 17, .82);
  color: var(--muted);
  box-shadow: 0 7px 25px rgba(0, 0, 0, .35);
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .05em;
  transform: translateX(-50%);
  backdrop-filter: blur(7px);
}

.mission-interact-prompt span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mission-interact-prompt kbd {
  min-width: 25px;
  color: var(--amber-pale);
  text-align: center;
}

.mission-interact-prompt.is-ready {
  border-color: rgba(255, 179, 75, .74);
  color: var(--cream);
  animation: mission-prompt-ready 1.3s ease-in-out infinite alternate;
}

.mission-interact-prompt.is-locked {
  color: var(--muted);
  opacity: .7;
}

@keyframes mission-prompt-ready {
  to { box-shadow: 0 0 22px rgba(255, 179, 75, .2); }
}

.mission-move-pad {
  position: absolute;
  bottom: max(.72rem, var(--safe-bottom));
  left: max(.8rem, var(--safe-left));
  z-index: 132;
  display: grid;
  grid-template-columns: repeat(3, 45px);
  grid-template-areas:
    ". up ."
    "left down right";
  gap: .28rem;
}

.mission-control,
.mission-interact-button {
  border: 1px solid rgba(244, 229, 197, .4);
  background: rgba(6, 17, 19, .82);
  color: var(--cream);
  box-shadow: 0 8px 25px rgba(0, 0, 0, .35);
  backdrop-filter: blur(6px);
  touch-action: none;
  user-select: none;
}

.mission-control {
  display: grid;
  width: 45px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  font-size: .86rem;
}

.mission-control.mission-up { grid-area: up; }
.mission-control.mission-left { grid-area: left; }
.mission-control.mission-down { grid-area: down; }
.mission-control.mission-right { grid-area: right; }

.mission-control:hover,
.mission-control.is-active,
.mission-interact-button:hover,
.mission-interact-button.is-active {
  border-color: var(--teal);
  background: rgba(23, 48, 53, .96);
  color: var(--teal);
  box-shadow: 0 0 18px rgba(83, 217, 195, .23);
}

.mission-interact-button {
  position: absolute;
  right: max(1rem, var(--safe-right));
  bottom: max(1rem, var(--safe-bottom));
  z-index: 132;
  display: grid;
  width: 82px;
  height: 64px;
  place-items: center;
  border-color: rgba(255, 179, 75, .67);
  border-radius: 18px;
  color: var(--amber-pale);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .06em;
}

.mission-interact-button span {
  display: block;
  margin-top: -14px;
  color: var(--muted);
  font-size: .56rem;
}

.mission-dialogue-backdrop {
  position: absolute;
  inset: 0;
  z-index: 198;
  background: rgba(2, 7, 8, .52);
  backdrop-filter: blur(2px);
}

.dialogue-choice-button {
  min-height: 42px;
  border: 1px solid rgba(83, 217, 195, .52);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(32, 66, 68, .96), rgba(13, 34, 36, .98));
  color: #ddf7ef;
  padding: .62rem .8rem;
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .055em;
  line-height: 1.25;
  text-align: left;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.dialogue-choice-button:hover,
.dialogue-choice-button:focus-visible {
  border-color: var(--amber);
  background: linear-gradient(180deg, rgba(67, 80, 61, .98), rgba(30, 52, 48, .98));
  transform: translateY(-1px);
}

.dialogue-accessible-text {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.dialogue-word {
  display: inline;
  opacity: 0;
  animation: dialogue-word-in .3s ease-out var(--word-delay, 0ms) forwards;
}

.dialogue-word.is-revealed {
  opacity: 1;
  animation: none;
}

@keyframes dialogue-word-in {
  from { opacity: 0; filter: blur(2px); }
  to { opacity: 1; filter: blur(0); }
}

.mission-dialogue-close {
  position: absolute;
  top: -.58rem;
  right: -.58rem;
  z-index: 6;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(244, 229, 197, .44);
  border-radius: 50%;
  background: var(--steel);
  color: var(--cream);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .45);
  cursor: pointer;
  font-size: 1.1rem;
}

.mission-dialogue-close:hover {
  border-color: var(--teal);
  color: var(--teal);
}

#mission-scene.is-dialogue-open .mission-move-pad,
#mission-scene.is-dialogue-open .mission-interact-button,
#mission-scene.is-dialogue-open .mission-interact-prompt,
#mission-scene.is-dialogue-open .mission-objective-ribbon,
#mission-scene.is-dialogue-open .mission-inventory {
  opacity: .15;
  pointer-events: none;
}

/* Workshop backyard */
#backyard-scene {
  padding: 0;
}

.backyard-world-art img {
  object-fit: fill;
  filter: saturate(.98) contrast(1.02) brightness(.96);
  transform: scale(1.002);
}

.beach-world-art img {
  object-fit: fill;
  transform: none;
}

.beach-world-glow {
  opacity: .25;
  background: linear-gradient(180deg, rgba(255, 224, 149, .1), transparent 65%, rgba(74, 46, 21, .1));
}
.beach-shore-waves { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.shore-swash { animation: gentle-shore-wash 10s ease-in-out infinite; animation-play-state: paused; }
#beach-scene[aria-hidden="false"] .shore-swash { animation-play-state: running; }
@keyframes gentle-shore-wash {
  0%, 100% { transform: translateY(-6px); opacity: .18; }
  30% { transform: translateY(10px); opacity: .6; }
  58% { transform: translateY(28px); opacity: .9; }
  80% { transform: translateY(5px); opacity: .4; }
}
.reduce-motion .shore-swash { animation: none; opacity: .18; }
@media (prefers-reduced-motion: reduce) { .shore-swash { animation: none !important; opacity: .18; } }

.beach-location {
  z-index: 125;
  max-width: min(320px, 48vw);
}

.beach-zone-marker {
  color: #f5d48d;
}

.backyard-world-glow {
  opacity: .58;
  background:
    linear-gradient(90deg, rgba(6, 18, 17, .24), transparent 19%, transparent 84%, rgba(6, 18, 17, .25)),
    linear-gradient(180deg, rgba(255, 234, 166, .035), transparent 54%, rgba(16, 36, 28, .22)),
    linear-gradient(108deg, transparent 22%, rgba(255, 235, 174, .09) 45%, transparent 62%);
  background-size: 100% 100%, 100% 100%, 210% 100%;
}

#backyard-scene .location-plate,
.backyard-progress {
  z-index: 125;
}

.backyard-location {
  max-width: min(420px, 44vw);
}

.backyard-progress {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: grid;
  min-width: 150px;
  gap: .12rem;
  padding: .68rem .8rem;
  text-align: right;
}

.backyard-progress span,
.backyard-progress small {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .09em;
}

.backyard-progress strong {
  position: relative;
  z-index: 1;
  color: var(--green);
  font-size: 1rem;
}

#game-shell #backyard-julia,
.backyard-julia {
  width: clamp(109px, 10.2vw, 150px);
}

.signal-puzzle {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 440px;
  margin-inline: auto;
}
.signal-route-status { margin: 0 0 .7rem; font-size: 1rem; line-height: 1.45; }
.signal-route-labels {
  display: flex;
  justify-content: space-between;
  gap: .6rem;
  margin-bottom: .5rem;
  color: #efb76c;
  font-size: .875rem;
  font-weight: 800;
}
.signal-route-labels span:last-child { color: #64decd; text-align: right; }
.signal-board {
  display: grid;
  grid-template-columns: repeat(var(--signal-columns), minmax(0, 1fr));
  gap: 5px;
  padding: 7px;
  border: 2px solid #6d8b83;
  border-radius: 6px;
  background: #102422;
}
.signal-tile {
  position: relative;
  padding: 0;
  min-width: 0;
  min-height: 44px;
  aspect-ratio: 1;
  border: 2px solid #43665e;
  border-radius: 4px;
  background: #263f38;
  color: #6e8c7f;
  cursor: pointer;
}
.signal-tile svg { display: block; width: 100%; height: 100%; overflow: hidden; }
.signal-conduit-bed { fill: none; stroke: #10221f; stroke-width: 28; }
.signal-conduit { fill: none; stroke: currentColor; stroke-width: 14; stroke-linejoin: round; }
.signal-tile circle { fill: #c3a36f; stroke: #263f38; stroke-width: 3; }
.signal-tile.is-lit { color: #f5c16e; background: #3a4631; }
.signal-tile.is-source { border-left: 4px solid #efb76c; }
.signal-tile.is-receiver { border-right: 4px solid #64decd; }
.signal-tile.is-blocked { box-shadow: inset 0 0 0 2px #c7856b; }
.signal-tile:focus-visible { outline: 3px solid #fcecc1; outline-offset: 1px; z-index: 1; }
.signal-tile:disabled { cursor: default; opacity: 1; }
.signal-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .8rem; }
.signal-actions .button { flex: 1; min-width: 115px; min-height: 44px; font-size: .875rem; }
.mission-card[data-accent="titania"] > span { color: #9fd0c8; }
.mission-card[data-accent="titania"].is-selected { border-color: #9fd0c8; background: #193530; }

.backyard-zone-layer {
  pointer-events: none;
}

.backyard-zone-marker {
  width: clamp(66px, 6vw, 90px);
  height: clamp(38px, 3.4vw, 50px);
  padding: 0;
  border: 0;
  appearance: none;
  background: transparent;
  color: #f5d48d;
  cursor: pointer;
  font: inherit;
  opacity: .86;
  pointer-events: auto;
  touch-action: manipulation;
}

.backyard-zone-marker .mission-zone-ring {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border-width: 2px;
  background: rgba(9, 35, 28, .4);
  box-shadow: 0 0 0 5px rgba(255, 220, 139, .065), 0 0 16px currentColor;
}

.backyard-zone-marker strong {
  top: auto;
  bottom: calc(100% + 7px);
  left: 50%;
  width: max-content;
  max-width: 160px;
  padding: .36rem .5rem;
  border: 2px solid currentColor;
  border-radius: 4px;
  background: rgba(5, 24, 21, .74);
  color: inherit;
  box-shadow: 0 5px 16px rgba(0, 0, 0, .42);
  font-size: clamp(.74rem, .9vw, .9rem);
  font-weight: 900;
  letter-spacing: .05em;
  transform: translateX(-50%);
}

.backyard-zone-marker:hover,
.backyard-zone-marker:focus-visible,
.backyard-zone-marker.is-nearby {
  opacity: 1;
  outline: none;
  filter: brightness(1.2);
}

.backyard-zone-marker:hover .mission-zone-ring,
.backyard-zone-marker:focus-visible .mission-zone-ring,
.backyard-zone-marker.is-nearby .mission-zone-ring {
  background: rgba(255, 179, 75, .18);
  box-shadow: 0 0 0 8px rgba(255, 179, 75, .1), 0 0 25px currentColor;
  transform: perspective(70px) rotateX(55deg) scale(1.08);
}

.backyard-zone-marker.is-complete {
  color: var(--green);
  opacity: .88;
}

.backyard-zone-marker.is-complete .mission-zone-ring::after {
  display: none;
}

.mission-zone-marker.is-exit,
.workshop-zone-marker.is-exit {
  color: var(--amber-pale);
}

.zone-arrow {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  color: currentColor;
  font-size: clamp(1rem, 1.5vw, 1.5rem);
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 0 10px currentColor;
  transform: rotateX(-55deg);
}

.julia-activity-bubble {
  position: absolute;
  bottom: calc(100% - 4px);
  left: 50%;
  z-index: 8;
  width: max-content;
  max-width: 180px;
  padding: .3rem .45rem;
  border: 1px solid rgba(255, 212, 126, .7);
  border-radius: 5px 5px 5px 1px;
  background: rgba(5, 24, 21, .9);
  color: #ffe0a2;
  box-shadow: 0 5px 16px rgba(0, 0, 0, .34);
  font-size: clamp(.48rem, .6vw, .6rem);
  font-weight: 900;
  letter-spacing: .055em;
  line-height: 1.25;
  text-align: center;
  transform: translateX(-50%);
}

.julia-activity-bubble::after { content: "CHECKING THE BEDS"; }
#backyard-julia[data-activity="checking-lines"] .julia-activity-bubble::after { content: "TUNING DRIP LINES"; }
#backyard-julia[data-activity="checking-tomatoes"] .julia-activity-bubble::after { content: "CHECKING TOMATOES"; }
#backyard-julia[data-activity="sorting-seeds"] .julia-activity-bubble::after { content: "SORTING SEEDS"; }
#backyard-julia[data-activity="tending-flowers"] .julia-activity-bubble::after { content: "TENDING FLOWERS"; }
#backyard-julia[data-activity="reading-weather"] .julia-activity-bubble::after { content: "READING THE WEATHER"; }
#backyard-julia[data-activity="surveying"] .julia-activity-bubble::after { content: "SURVEYING NEW GROWTH"; }
#backyard-julia[data-activity="carrying-compost"] .julia-activity-bubble::after { content: "TURNING COMPOST"; }
#backyard-julia[data-activity="moving"] .julia-activity-bubble { display: none; }

.backyard-panel-backdrop {
  position: absolute;
  inset: 0;
  z-index: 198;
  background: rgba(3, 16, 14, .38);
  backdrop-filter: blur(1.5px);
}

.backyard-activity-panel > * {
  position: relative;
  z-index: 1;
}

.backyard-activity-copy {
  margin: .65rem 0 .85rem;
  color: #d8eee4;
  font-size: 1rem;
  line-height: 1.55;
}

.backyard-activity-target {
  min-height: 58px;
  margin: .7rem 0;
  padding: .75rem .85rem;
  border: 1px solid rgba(83, 217, 195, .36);
  border-radius: 8px;
  background: rgba(2, 12, 12, .5);
  color: var(--cream);
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  font-weight: 800;
  line-height: 1.4;
}

.backyard-sequence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}

.backyard-sequence span {
  display: inline-grid;
  min-width: 72px;
  min-height: 42px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 6px;
  color: var(--amber-pale);
  font-size: .78rem;
  letter-spacing: .06em;
  animation: backyard-sequence-pulse 1.8s ease-in-out var(--pulse-delay, 0ms) infinite;
}

@keyframes backyard-sequence-pulse {
  0%, 38%, 100% { background: transparent; box-shadow: none; transform: translateY(0); }
  12%, 26% { background: rgba(255, 179, 75, .17); box-shadow: 0 0 16px rgba(255, 179, 75, .24); transform: translateY(-2px); }
}

.backyard-activity-controls,
.backyard-dialogue-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .62rem;
}

.backyard-activity-button {
  min-height: 54px;
  border: 2px solid rgba(83, 217, 195, .48);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(40, 82, 67, .96), rgba(16, 45, 39, .98));
  color: #e1f5e9;
  padding: .58rem .7rem;
  font-size: .88rem;
  font-weight: 900;
  letter-spacing: .04em;
}

.backyard-activity-button:hover,
.backyard-activity-button:focus-visible {
  border-color: var(--amber);
  color: var(--amber-pale);
}

.backyard-activity-feedback {
  margin-top: .8rem;
}

#backyard-scene.is-overlay-open .mission-move-pad,
#backyard-scene.is-overlay-open .mission-interact-button,
#backyard-scene.is-overlay-open .mission-interact-prompt,
#backyard-scene.is-overlay-open .mission-objective-ribbon,
#backyard-scene.is-overlay-open .backyard-progress {
  opacity: .15;
  pointer-events: none;
}

#backyard-scene .next-button {
  float: right;
  min-height: 42px;
  margin-top: .45rem;
}

@media (max-width: 820px) {
  .mission-objective-ribbon {
    top: 5.1rem;
    min-width: min(330px, calc(100% - 1.3rem));
  }

  .mission-move-pad {
    grid-template-columns: repeat(3, 40px);
  }

  .mission-inventory {
    width: min(300px, calc(100% - 14rem));
  }

  .mission-control {
    width: 40px;
    height: 36px;
  }

  .mission-interact-prompt {
    bottom: 6rem;
    max-width: calc(100% - 1.2rem);
  }

}

@media (max-width: 580px) {
  .mission-rivet {
    width: clamp(104px, 25vw, 138px);
  }

  .mission-socket {
    width: clamp(78px, 18vw, 102px);
  }

  .mission-zone-marker strong {
    max-width: 100px;
  }

  .mission-objective-ribbon {
    top: 4.55rem;
  }

  .mission-interact-prompt {
    display: none;
  }

  .mission-inventory {
    bottom: max(4.15rem, calc(var(--safe-bottom) + 3.75rem));
    width: min(260px, calc(100% - 1rem));
    padding: .35rem .4rem .38rem;
  }

  .mission-inventory header {
    margin-bottom: .25rem;
  }

  .inventory-slot {
    min-height: 41px;
  }

  .mission-inventory > small {
    display: none;
  }

  .mission-move-pad {
    bottom: max(.45rem, var(--safe-bottom));
    left: max(.45rem, var(--safe-left));
    grid-template-columns: repeat(3, 38px);
    gap: .2rem;
  }

  .mission-control {
    width: 38px;
    height: 35px;
  }

  .mission-interact-button {
    right: max(.55rem, var(--safe-right));
    bottom: max(.55rem, var(--safe-bottom));
    width: 74px;
    height: 57px;
  }

}

@media (max-height: 650px) and (orientation: landscape) {
  .mission-objective-ribbon {
    top: .55rem;
    min-width: min(280px, 32vw);
    padding: .4rem .6rem;
  }

  .mission-interact-prompt {
    bottom: 5.4rem;
  }

  .mission-inventory {
    bottom: .35rem;
    width: min(310px, 40vw);
  }

  .mission-inventory > small {
    display: none;
  }

  .mission-move-pad {
    bottom: .4rem;
    transform: scale(.86);
    transform-origin: bottom left;
  }

  .mission-interact-button {
    right: .55rem;
    bottom: .55rem;
    width: 72px;
    height: 54px;
  }

}

@media (max-width: 820px) {
  .backyard-progress {
    top: 4.8rem;
    right: .65rem;
    min-width: 126px;
  }

}

@media (max-width: 580px) {
  .backyard-location {
    max-width: calc(100% - 1rem);
  }

  .backyard-progress {
    display: none;
  }

  .backyard-activity-controls,
  .backyard-dialogue-choices {
    grid-template-columns: 1fr;
  }

}

@media (max-height: 650px) and (orientation: landscape) {
  .backyard-progress {
    top: .55rem;
  }

}

/* One portrait and panel format for calls, conversations, repairs and departure. */
#game-shell .dialogue-panel {
  --portrait-size: 192px;
  --dialogue-padding: 1.25rem;
  position: relative;
  display: grid;
  grid-template-columns: var(--portrait-size) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: start;
  gap: 1.25rem;
  min-width: 0;
  min-height: 0;
  padding: var(--dialogue-padding);
  border: 2px solid rgba(244, 229, 197, .54);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .07), transparent 28%),
    linear-gradient(180deg, rgba(19, 43, 45, .98), rgba(7, 20, 22, .985));
  color: var(--cream);
  box-shadow: 0 18px 46px rgba(0, 0, 0, .54), inset 0 0 0 1px rgba(0, 0, 0, .42);
}

#game-shell :is(.dialogue-console, .backyard-activity-panel).dialogue-panel {
  position: absolute;
  z-index: 210;
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  width: min(820px, calc(100% - 1.5rem));
  max-height: min(640px, calc(100% - 1.5rem));
  overflow: hidden;
  transform: translate(-50%, -50%);
}

#game-shell .dialogue-panel::before,
#game-shell .dialogue-panel::after {
  content: none;
}

#game-shell .dialogue-portrait {
  position: relative;
  display: block;
  width: var(--portrait-size);
  height: var(--portrait-size);
  aspect-ratio: 1;
  overflow: hidden;
  padding: 0;
  border: 2px solid rgba(83, 217, 195, .7);
  border-radius: 10px;
  background: radial-gradient(circle at 50% 34%, rgba(83, 217, 195, .2), rgba(4, 14, 15, .92));
  box-shadow: inset 0 0 24px rgba(83, 217, 195, .13), 0 7px 20px rgba(0, 0, 0, .3);
}

#game-shell .dialogue-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transform: none;
}

#game-shell .dialogue-panel .dialogue-content {
  position: relative;
  z-index: 1;
  align-self: stretch;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  padding-right: .2rem;
  scrollbar-gutter: stable;
}

#game-shell .dialogue-panel :is(.dialogue-heading, .caller-meta) {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .45rem 1rem;
  margin: 0 1.3rem .6rem 0;
  padding: 0;
}

#game-shell .dialogue-panel :is(.eyebrow, .dialogue-heading strong, .caller-meta strong, .attempts, .dialogue-counter) {
  font-size: .875rem;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}

#game-shell .dialogue-panel :is(.dialogue-heading strong, .caller-meta strong) {
  display: block;
  color: var(--cream);
  letter-spacing: .04em;
}

#game-shell .dialogue-panel :is(.dialogue-line, .call-line, .backyard-activity-copy) {
  margin: .65rem 0 .8rem;
  color: #d9efe7;
  font-size: clamp(1rem, 1.35vw, 1.16rem);
  line-height: 1.55;
  white-space: normal;
  overflow-wrap: anywhere;
}

#game-shell .dialogue-panel :is(h1, h2) {
  margin: .45rem 0 .7rem;
  color: var(--cream);
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  line-height: 1.3;
}

#game-shell .dialogue-panel :is(.answer-grid, .backyard-activity-controls) {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .7rem;
  margin-top: 1rem;
}

#game-shell .dialogue-panel :is(.dialogue-choice-button, .backyard-activity-button) {
  font-size: 1rem;
  letter-spacing: .02em;
}

#game-shell .dialogue-panel .answer-button {
  min-width: 0;
  min-height: 56px;
  border-width: 2px;
  border-radius: 8px;
  font-size: 1.2rem;
}

#game-shell .dialogue-panel :is(.answer-button, .dialogue-choice-button, .backyard-activity-button):not(.is-correct, .is-wrong) {
  border: 2px solid rgba(83, 217, 195, .52);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(32, 66, 68, .96), rgba(13, 34, 36, .98));
  color: #ddf7ef;
}

#game-shell .dialogue-panel :is(.answer-button, .dialogue-choice-button, .backyard-activity-button):not(.is-correct, .is-wrong):is(:hover, :focus-visible) {
  border-color: var(--amber);
  background: linear-gradient(180deg, rgba(67, 80, 61, .98), rgba(30, 52, 48, .98));
}

#game-shell .dialogue-panel .feedback {
  font-size: 1rem;
}

#game-shell .dialogue-panel .next-button {
  float: none;
  min-height: 44px;
  margin-top: .8rem;
}

#game-shell .dialogue-panel .button {
  min-height: 44px;
  font-size: .875rem;
}

#game-shell .dialogue-panel .mission-dialogue-close {
  position: absolute;
  z-index: 3;
  top: .65rem;
  right: .65rem;
}

#game-shell .call-copy.dialogue-panel {
  align-self: stretch;
}

#game-shell :is(.mission-dialogue-backdrop, .backyard-panel-backdrop) {
  background: rgba(2, 7, 8, .36);
  backdrop-filter: blur(1.2px);
}

@media (max-width: 820px) {
  #game-shell .dialogue-panel {
    --portrait-size: 144px;
    --dialogue-padding: 1rem;
    gap: 1rem;
  }
}

@media (max-width: 580px) {
  #game-shell .dialogue-panel {
    --portrait-size: 120px;
    --dialogue-padding: .85rem;
    gap: .7rem;
  }

  #game-shell :is(.dialogue-console, .backyard-activity-panel).dialogue-panel {
    width: calc(100% - 1rem);
    max-height: calc(100% - 1rem);
    overflow: auto;
  }

  #game-shell .dialogue-panel .dialogue-content {
    display: contents;
  }

  #game-shell .dialogue-panel .dialogue-portrait {
    grid-column: 1;
    grid-row: 1;
  }

  #game-shell .dialogue-panel :is(.dialogue-heading, .caller-meta, #backyard-activity-eyebrow) {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    margin-right: 1.4rem;
  }

  #game-shell .dialogue-panel .dialogue-content > :not(.dialogue-heading, .caller-meta, #backyard-activity-eyebrow) {
    grid-column: 1 / -1;
    min-width: 0;
  }

  #game-shell .dialogue-panel :is(.answer-grid, .backyard-activity-controls) {
    gap: .5rem;
  }

  #game-shell .dialogue-panel .answer-grid:has(.dialogue-choice-button),
  #game-shell .dialogue-panel .backyard-activity-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 650px) and (orientation: landscape) {
  #game-shell .dialogue-panel {
    --portrait-size: 120px;
    --dialogue-padding: .85rem;
    gap: .8rem;
  }
}

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

  .dialogue-word {
    opacity: 1 !important;
    animation: none !important;
    filter: none !important;
  }
}

/* Compact bubbles use the real game-stage bounds; content never scrolls. */
#game-shell .mission-interface > :is(.crew-panel, .workshop-note) { display: none; }
#game-shell .mission-computer-card {
  position: absolute; z-index: 3; top: 50%; left: 50%;
  width: min(1120px, calc(100% - 24px)); height: auto;
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px;
  transform: translate(-50%, -50%) scale(var(--panel-fit, 1)); transform-origin: center;
}
#game-shell .mission-computer-card .mission-board {
  position: relative; inset: auto; width: auto; max-height: none; padding: 14px; overflow: visible;
}
#game-shell .mission-board-heading { gap: 8px; margin-bottom: 12px; }
#game-shell .mission-board-heading strong { font-size: 1rem; }
#game-shell .mission-picker { display: grid; grid-template-columns: 1fr; gap: 8px; max-height: none; overflow: visible; }
#game-shell .mission-card { min-height: 64px; padding: 10px; }
#game-shell .mission-computer-card .mission-terminal { position: relative; inset: auto; width: auto; max-width: none; padding: 0; align-self: start; }
#game-shell .terminal-bar { padding: 12px 16px; }
#game-shell .terminal-bar > span:nth-child(2) { font-size: .7rem; }
#game-shell .terminal-screen { display: block; padding: 0; gap: 0; min-height: 0; }
#game-shell :is(.video-terminal, .call-wave, .contract-summary) { display: none; }
#game-shell .call-copy.dialogue-panel { --portrait-size: 120px; margin: 0; border-radius: 0 0 16px 16px; border-width: 0; padding: 18px; }
#game-shell .call-copy h1 { font-size: clamp(1.2rem, 2.1vw, 1.65rem); }
#game-shell .call-copy .call-line { margin: 0; font-size: 1rem; line-height: 1.45; }
#game-shell .call-copy .mission-facts { width: 100%; padding: 0; margin: 4px 0; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px 16px; }
#game-shell .call-copy .mission-facts[hidden], #game-shell .terminal-actions[hidden] { display: none; }
#game-shell .mission-facts div { min-width: 0; border: 0; padding: 0; }
#game-shell .mission-facts dt { margin-bottom: 3px; font-size: .65rem; }
#game-shell .mission-facts dd { margin: 0; font-size: .88rem; line-height: 1.35; }
#game-shell .call-copy .terminal-actions { padding: 0; margin: 4px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
#game-shell .call-controls { margin: 0; }
#game-shell .dialogue-panel { --portrait-size: 120px; --dialogue-padding: 18px; gap: 10px 16px; grid-template-rows: auto; }
#game-shell .dialogue-panel .dialogue-content { display: contents; overflow: visible; scrollbar-gutter: auto; max-height: none; padding: 0; }
#game-shell .dialogue-panel .dialogue-portrait { grid-column: 1; grid-row: 1; }
#game-shell .dialogue-panel :is(.dialogue-heading, .caller-meta, #backyard-activity-eyebrow) { grid-column: 2; grid-row: 1; align-self: center; margin: 0 24px 0 0; }
#game-shell .dialogue-panel .dialogue-content > :not(.dialogue-heading, .caller-meta, #backyard-activity-eyebrow) { grid-column: 1 / -1; min-width: 0; }
#game-shell :is(.dialogue-console, .backyard-activity-panel).dialogue-panel {
  width: min(820px, calc(100% - 24px)); max-height: none; height: auto; overflow: visible;
  transform: translate(-50%, -50%) scale(var(--panel-fit, 1)); transform-origin: center;
}
#game-shell .dialogue-panel :is(.dialogue-line, .backyard-activity-copy) { margin: 0; font-size: 1rem; line-height: 1.45; }
#game-shell .dialogue-panel :is(h1, h2) { margin: 0; }
#game-shell .dialogue-panel :is(.answer-grid, .backyard-activity-controls) { margin: 0; }
#game-shell .dialogue-panel .feedback { font-size: .95rem; line-height: 1.4; margin: 0; min-height: 0; }
#game-shell .dialogue-panel .next-button { margin: 0; justify-self: end; }
#game-shell .dialogue-panel.is-signal-mode { --portrait-size: 96px; }
#game-shell .is-signal-mode :is(#dialogue-line, #question-prompt) { display: none; }
#game-shell .is-signal-mode .answer-grid { display: block; }
#game-shell .signal-puzzle { display: grid; grid-template-columns: minmax(140px,1fr) auto; grid-template-areas: "status board" "labels board" "actions board"; gap: 12px 20px; max-width: none; align-items: start; }
#game-shell .signal-route-status { grid-area: status; font-size: .95rem; line-height: 1.45; margin: 0; align-self: end; }
#game-shell .signal-route-labels { grid-area: labels; flex-direction: column; align-items: flex-start; gap: 8px; margin: 0; font-size: .78rem; }
#game-shell .signal-route-labels span:last-child { text-align: left; }
#game-shell .signal-board { grid-area: board; gap: 5px; padding: 0; grid-template-columns: repeat(var(--signal-columns), var(--signal-tile-size, 58px)); }
#game-shell .signal-tile { width: var(--signal-tile-size, 58px); height: var(--signal-tile-size, 58px); min-height: 0; padding: 0; }
#game-shell .signal-actions { grid-area: actions; display: grid; grid-template-columns: 1fr; margin: 0; gap: 8px; align-self: start; }
#game-shell .signal-actions .button { min-height: 40px; padding: 8px; font-size: .75rem; }
#game-shell #backyard-julia { width: clamp(109px, 10.2vw, 150px); }
#game-shell .flight-readout { width: auto; max-width: min(430px, calc(100% - 24px)); padding: 12px 16px; }
#game-shell .flight-readout h1 { font-size: clamp(1.1rem, 2vw, 1.6rem); margin: 2px 0 0; }
#game-shell #flight-direction { text-transform: none; margin: 0; font-size: .85rem; }
#game-shell .system-map { cursor: pointer; color: var(--cream); font: inherit; text-align: left; }
#game-shell .system-map canvas { pointer-events: none; }
#game-shell .system-map:hover, #game-shell .system-map:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.mission-launch-card { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; z-index: 1000; isolation: isolate; overflow: hidden; background: radial-gradient(ellipse at 20% 80%, #8e613d, #183b50 45%, #0c1d30); }
.mission-launch-card[hidden], .mission-launch-card:not([open]) { display: none; }
.mission-launch-card[open] { display: block; }
.mission-launch-card::backdrop { background: transparent; }
.mission-launch-card picture, .mission-launch-card img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mission-launch-card picture, .mission-launch-card > .launch-fallback-art { position: absolute; inset: 0; }
.mission-launch-card > .launch-fallback-art { z-index: 0; background: radial-gradient(ellipse at 28% 24%, #20445199, transparent 60%), radial-gradient(ellipse at 78% 65%, #3d345866, transparent 65%), #081823; }
.mission-launch-card picture { z-index: 1; }
.mission-launch-card[data-loading="waiting"] picture,
.mission-launch-card:not([data-art-ready="true"]) picture { visibility: hidden; }
.mission-launch-card.is-departure img { object-fit: cover; }
.mission-launch-card::after { content: ""; position: absolute; inset: 0; z-index: 2; background: linear-gradient(0deg, rgba(2,8,16,.88), transparent 65%); pointer-events: none; }
@media (max-aspect-ratio: 4/5) {
  .mission-launch-card img { object-fit: cover; object-position: center; }
}
.launch-caption { position: absolute; z-index: 3; bottom: max(16%, 88px); left: 7%; right: 7%; color: #fff1d4; text-shadow: 0 3px 16px #000; }
.launch-caption .eyebrow { color: #71e7cf; }
.launch-caption h1 { font-size: clamp(1.7rem, 5vw, 4rem); max-width: 900px; margin: 12px 0; }
.launch-caption > p:last-child { font-size: clamp(1rem, 2vw, 1.5rem); margin: 0; }
.launch-loading { position: absolute; z-index: 3; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(360px, calc(100% - 48px)); color: #fff1d4; text-align: center; font-size: .65rem; font-weight: 700; letter-spacing: .2em; }
.launch-loading-track { height: 12px; margin-top: 8px; padding: 2px; border: 1px solid #b4d6cc; border-radius: 3px; background: rgba(2, 8, 16, .8); }
.launch-loading-fill { width: 0; height: 100%; background: #71e7cf; }
.credit-balance { font-variant-numeric: tabular-nums; }
.launch-loading-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; letter-spacing: .08em; }
.loading-bar-retry { min-height: 44px; margin-top: 10px; padding: 8px 16px; color: #142c30; background: #f2c46f; border: 2px solid #fff0be; font: 700 12px/1.25 ui-monospace, monospace; letter-spacing: .04em; cursor: pointer; }
.loading-bar-retry[hidden] { display: none; }
.mission-launch-card:has(#launch-loading-retry:not([hidden])) .launch-caption { bottom: max(23%, 156px); }
.expanded-map-dialog { width: min(1120px, calc(100vw - 24px)); height: min(820px, calc(100dvh - 24px)); max-width: none; max-height: none; padding: 16px; border: 2px solid #6eb9aa; border-radius: 18px; color: #f4e5c5; background: #081b22; overflow: hidden; }
.expanded-map-dialog[open] { display: grid; grid-template-rows: auto auto minmax(0,1fr) auto; gap: 12px; }
.expanded-map-dialog::backdrop { background: rgba(0,5,12,.78); backdrop-filter: blur(4px); }
.expanded-map-heading { display: flex; justify-content: space-between; align-items: center; }
.expanded-map-heading h2 { margin: 0; font-size: 1.35rem; }
.expanded-map-heading .eyebrow { margin: 0 0 3px; font-size: .65rem; }
#close-system-map { width: 38px; height: 38px; border: 1px solid #71aa9f; border-radius: 8px; color: #f4e5c5; background: #163438; font-size: 1.5rem; cursor: pointer; }
.map-system-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.map-system-tabs button { padding: 8px 12px; border: 1px solid #446b70; border-radius: 7px; background: #102b33; color: #d3e6dc; cursor: pointer; }
.map-system-tabs button[aria-pressed="true"] { background: #346c66; border-color: #64dfc6; color: #fff3d7; }
#expanded-map-canvas { width: 100%; height: 100%; min-height: 0; display: block; }
.expanded-map-key { display: flex; justify-content: space-between; gap: 8px; margin: 0; font-size: .75rem; color: #8eb4b2; }
.map-course-key { color: #64dfc6; }
@media (max-width: 600px) {
  #game-shell .mission-computer-card { grid-template-columns: 1fr; gap: 8px; }
  #game-shell .mission-computer-card .mission-board { padding: 10px; }
  #game-shell .mission-board-heading { margin-bottom: 8px; }
  #game-shell .mission-picker { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
  #game-shell .mission-card { min-height: 52px; padding: 8px; }
  #game-shell .mission-card :is(small, b) { display: none; }
  #game-shell .terminal-bar { padding: 8px 12px; }
  #game-shell .terminal-bar > span:nth-child(2) { display: none; }
  #game-shell .call-copy.dialogue-panel, #game-shell .dialogue-panel { --portrait-size: 96px; --dialogue-padding: 12px; padding: 12px; gap: 8px 12px; }
  #game-shell .dialogue-panel .answer-grid:has(.dialogue-choice-button), #game-shell .backyard-activity-controls { grid-template-columns: 1fr; }
  #game-shell .signal-puzzle { grid-template-columns: 1fr; grid-template-areas: "status" "labels" "board" "actions"; gap: 8px; }
  #game-shell .signal-route-labels { flex-direction: row; justify-content: space-between; font-size: .65rem; }
  #game-shell .signal-route-status { font-size: .85rem; }
  #game-shell .signal-board { justify-content: center; }
  #game-shell .signal-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .expanded-map-dialog { padding: 12px; gap: 8px; }
  .map-system-tabs button { padding: 7px 9px; font-size: .8rem; }
  .expanded-map-key { font-size: .6rem; }
}
@media (max-height: 480px) {
  #game-shell { grid-template-rows: minmax(0,1fr); }
  #game-shell > :is(.top-hud, .bottom-hud) { display: none; }
}
.game-dialog { position: fixed; inset: auto; top: 50%; left: 50%; margin: 0; height: auto; max-height: none; overflow: visible; transform: translate(-50%, -50%) scale(var(--panel-fit,1)); }
.game-dialog .dialog-body { max-height: none; overflow: visible; }

#game-shell .call-controls:has(#answer-call-button[hidden]) { display: none; }
@media (max-width: 580px) { #game-shell #backyard-julia { width: clamp(101px, 24.2vw, 134px); } }

#game-shell .mission-card-destination { display: none; }
@media (max-width: 600px) {
  #game-shell .mission-picker { grid-template-columns: repeat(3,minmax(0,1fr)); }
  #game-shell .mission-card { min-height: 42px; padding: 6px; text-align: center; }
  #game-shell .mission-card > :not(.mission-card-destination) { display: none; }
  #game-shell .mission-card .mission-card-destination { display: block; color: var(--cream); font-size: .875rem; letter-spacing: 0; overflow-wrap: anywhere; }
  #game-shell .mission-board-heading strong { display: none; }
  #game-shell .mission-board-heading .eyebrow { margin: 0; }
}
@media (max-height: 480px) {
  #game-shell .call-copy.dialogue-panel, #game-shell .dialogue-panel { --portrait-size: 84px; --dialogue-padding: 12px; padding: 12px; gap: 8px 12px; }
  #game-shell .call-copy .call-line { font-size: .95rem; }
}

#game-shell .workshop-inspector { position: absolute; inset: auto; top: 50%; left: 50%; width: min(560px, calc(100% - 24px)); height: auto; max-height: none; overflow: visible; transform: translate(-50%, -50%) scale(var(--panel-fit,1)); }
#game-shell .mission-card .mission-card-destination { grid-column: 1 / -1; }
#game-shell .mission-computer-card .mission-terminal { overflow: visible; }
#game-shell .dialogue-panel :is(.dialogue-line, .call-line, .backyard-activity-copy, .feedback, .answer-grid, #question-prompt) { min-height: 0; height: auto; max-height: none; overflow: visible; }
#game-shell .call-copy .mission-facts dd { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }

.outer-cruise-indicator { width: fit-content; margin: 9px 0 0; padding: 5px 9px; border: 1px solid #6de4d1; border-radius: 6px; color: #adffea; background: #133f40; font-size: .75rem; line-height: 1.3; letter-spacing: .04em; box-shadow: 0 0 16px rgba(89,230,210,.2); }
#game-shell.is-outer-cruise #speed-value { color: #80f2d5; text-shadow: 0 0 12px rgba(83,217,195,.45); }
#game-shell.is-outer-cruise .flight-readout { border-color: #6de4d1; }
@media (max-width: 900px) { #game-shell .flight-readout { max-width: 42vw; } }
@media (max-width: 580px) {
  #game-shell .flight-readout { padding: 9px 10px; }
  .outer-cruise-indicator { padding: 4px 5px; font-size: .58rem; letter-spacing: .02em; }
}

/* Stillwater's approved atlases share Rivet's frame width and ground anchor. */
#game-shell[data-mission="enceladus-quiet-tide-01"] .mission-client { width: clamp(112px, 10.5vw, 154px); }
#game-shell[data-mission="enceladus-quiet-tide-01"] .mission-inventory { display: none; }
@media (max-width: 580px) {
  #game-shell[data-mission="enceladus-quiet-tide-01"] .mission-client { width: clamp(104px, 25vw, 138px); }
}
#mission-cooling-lights { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.cooling-instrument-light { position: absolute; width: 8px; height: 8px; transform: translate(-50%,-50%); border-radius: 50%; background: #efae50; box-shadow: 0 0 10px #e9a142; }
.cooling-instrument-light.is-restored { background: #7fd8ff; box-shadow: 0 0 12px 4px #58bcef88; }
#game-shell .dialogue-panel.is-pressure-mode { --portrait-size: 96px; }
#game-shell .is-pressure-mode :is(#dialogue-line, #question-prompt) { display: none; }
#game-shell .is-pressure-mode .answer-grid { display: block; }
/* A visual sequence: starting levels, per-step preview, and goals on their steps. */
.pressure-puzzle { display: grid; gap: 10px; color: var(--cream); }
.pressure-goal { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 20px; flex-wrap: wrap; }
.pressure-goal > strong { font-size: 1rem; line-height: 1.35; }
.pressure-rules { color: #d4e7dd; font-size: .875rem; line-height: 1.35; }
.pressure-gauges { display: flex; gap: 10px; }
.pressure-gauge { flex: 1; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; padding: 6px 10px; border: 1px solid #64807a; border-radius: 8px; background: #152f32; }
.pressure-gauge-name { font-size: .875rem; color: #a6f0df; }
.pressure-endpoints { font-size: .875rem; text-align: right; }
.pressure-gauge .pressure-level { grid-column: 1 / -1; grid-template-columns: 1fr; }
.pressure-gauge .pressure-level-label { display: none; }
.pressure-howto { margin: 0; font-size: 1rem; line-height: 1.35; color: #f2e5c8; }
.pressure-timeline { display: grid; gap: 6px; }
.pressure-timeline-heading { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 3px 8px; font-size: .875rem; }
.pressure-range { color: #c4d2bc; font-size: .875rem; }
.pressure-slots { display: grid; grid-template-columns: repeat(var(--pressure-beats), minmax(0, 1fr)); gap: 6px; }
.pressure-slot { display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-width: 0; padding: 7px 6px; border: 1px solid #647c73; border-radius: 7px; color: var(--cream); background: #153033; text-align: left; cursor: pointer; }
.pressure-slot[aria-pressed="true"] { border-color: #ffd587; background: #374a40; box-shadow: inset 0 0 0 1px #ffd587; }
.pressure-slot[aria-pressed="true"] .pressure-beat { color: #ffd587; }
.pressure-beat { font-size: .75rem; letter-spacing: .02em; color: #c4d2bc; }
.pressure-instruction { font-size: .875rem; line-height: 1.25; }
.pressure-step-levels { display: grid; gap: 3px; margin-top: 2px; }
.pressure-level { display: grid; grid-template-columns: auto minmax(14px, 1fr); align-items: center; gap: 5px; min-width: 0; }
.pressure-level-label { font-size: .875rem; white-space: nowrap; color: #b9e8e2; }
.pressure-level-track { position: relative; display: block; height: 8px; border: 1px solid #658b8b; border-radius: 3px; background: #071c23; }
.pressure-level-fill { display: block; width: var(--pressure-fill); height: 100%; border-radius: 2px; background: #70d3e8; }
.pressure-goal-mark { position: absolute; left: var(--pressure-goal); top: -3px; bottom: -3px; border-left: 2px dashed #fff0b0; transform: translateX(-1px); }
.pressure-level.is-unknown .pressure-level-track { border-style: dashed; }
.pressure-level.is-unsafe .pressure-level-fill { background: #efab73; }
.pressure-level.is-unsafe .pressure-level-label { color: #ffd0a3; }
.pressure-step-goal { margin-top: auto; padding-top: 3px; font-size: .875rem; line-height: 1.2; color: #ffe6aa; }
.pressure-slot.has-goal { border-bottom: 3px solid #e4c98c; }
.pressure-slot.is-goal-met { border-bottom-color: #7fe3c4; }
.pressure-slot.is-goal-met .pressure-step-goal { color: #9cf3d5; }
.pressure-slot.is-failed, .pressure-slot.is-unsafe { border-color: #eea36b; }
.pressure-chooser { display: grid; gap: 6px; }
.pressure-chooser-label { color: #ffe4a4; font-size: .875rem; }
.pressure-instructions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pressure-instructions:has(> :last-child:nth-child(3)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pressure-action { min-width: 0; display: grid; gap: 3px; padding: 8px 5px; border: 1px solid #899377; border-radius: 7px; background: #344237; color: var(--cream); cursor: pointer; }
.pressure-action strong { font-size: .875rem; }
.pressure-action-effect { font-size: .875rem; line-height: 1.25; color: #d8eee2; }
.pressure-slot:hover, .pressure-action:hover { background: #3a534b; border-color: #ffd587; }
.pressure-slot:focus-visible, .pressure-action:focus-visible { outline: 2px solid #ffd587; outline-offset: 2px; }
.pressure-preview-guide { margin: 0; font-size: .875rem; line-height: 1.35; color: #c4d2bc; }
.pressure-controls { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
#game-shell .pressure-controls .button { min-height: 36px; padding: 8px 12px; font-size: .875rem; }
.pressure-puzzle button:disabled { cursor: default; opacity: .75; }
/* Hearthlight: compact, readable parcel cards and bags in the shared bubble. */
#game-shell[data-mission="pluto-long-way-post-01"] .mission-client { width: clamp(122px, 11.4vw, 168px); }
#game-shell[data-mission="pluto-long-way-post-01"] .mission-extra-npc { width: clamp(130px, 12.2vw, 180px); }
#game-shell .dialogue-panel.is-packing-mode { --portrait-size: 96px; gap: 8px 12px; }
#game-shell .is-packing-mode :is(#dialogue-line, #question-prompt) { display: none; }
#game-shell .is-packing-mode .answer-grid { display: block; }
.packing-puzzle { display: grid; gap: 8px; color: var(--cream); }
.packing-howto { margin: 0; font-size: 1rem; line-height: 1.3; }
.packing-selection, .packing-rule { margin: 0; font-size: .875rem; line-height: 1.35; color: #d4e7dd; }
.packing-selection { color: #ffe3a0; }
.packing-rack { padding: 8px; border: 1px solid #7d8670; border-radius: 8px; background: #223632; }
.packing-rack-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; font-size: .8rem; }
.packing-return { border: 1px solid #7d8670; border-radius: 5px; padding: 5px 8px; color: var(--cream); background: #344237; font: inherit; font-size: .75rem; cursor: pointer; }
.packing-parcels, .packing-bag-contents { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.packing-parcel { position: relative; display: grid; grid-template-columns: auto auto; align-items: center; gap: 2px 10px; min-width: 54px; min-height:  40px; padding: 5px 8px; border: 2px solid #bd9560; border-radius: 6px; color: #fff2cb; background: linear-gradient(90deg, #775135 0 43%, #937147 43% 57%, #775135 57%); cursor: pointer; }
.packing-parcel-id { font-size: .8rem; }
.packing-weight { font-size: 1.2rem; }
.packing-tag { grid-column: 1 / -1; font-size: .65rem; line-height: 1.1; letter-spacing: .02em; }
.packing-parcel[data-tag="warm"] { border-color: #ffbc63; }
.packing-parcel[data-tag="chilled"] { border-color: #7be8fb; background: #245566; }
.packing-parcel.is-selected { outline: 2px solid #ffe6a6; outline-offset: 2px; }
.packing-bags { display: grid; grid-template-columns: repeat(var(--packing-bags), minmax(0, 1fr)); gap: 8px; }
.packing-bag { min-width: 0; padding: 7px; border: 2px solid #738a7c; border-radius: 12px 12px 8px 8px; background: #193539; }
.packing-bag.is-matched { border-color: #82e4bd; }
.packing-bag.is-failed { border-color: #efa36a; }
.packing-bag-select { display: grid; width: 100%; gap: 3px; padding: 3px 4px 8px; text-align: left; border: 0; background: transparent; color: var(--cream); cursor: pointer; }
.packing-bag-select strong { font-size: 1rem; }
.packing-target { font-size: .75rem; color: #ffe6a6; }
.packing-total { font-size: 1rem; font-weight: 700; color: #a4e9e1; }
.packing-count { font-size: .875rem; }
.packing-meter { display: block; height: 7px; border: 1px solid #738a7c; border-radius: 3px; background: #071c23; }
.packing-meter > span { display: block; height: 100%; width: var(--packing-fill); background: #71d4d8; }
.packing-bag-contents { min-height:  40px; padding-top: 6px; border-top: 1px dashed #738a7c; }
.packing-empty { font-size: .8rem; color: #bdcdc4; line-height: 1.3; }
.packing-tag-warning { width: 100%; font-size: .8rem; color: #ffd0a3; line-height: 1.3; }
.packing-controls { display: flex; justify-content: flex-end; gap: 6px; }
#game-shell .packing-controls .button { min-height: 36px; padding: 8px 12px; font-size: .875rem; }
.packing-puzzle button:disabled { cursor: default; }
.packing-controls button:disabled, .packing-return:disabled { opacity: .65; }
.packing-puzzle button:focus-visible { outline: 2px solid #ffe6a6; outline-offset: 2px; }
@media (max-width: 600px) {
  .packing-puzzle { gap: 6px; }
  .packing-bags { grid-template-columns: 1fr; gap: 6px; }
  .packing-bag { display: grid; grid-template-columns: minmax(105px, 1fr) minmax(0, 1.5fr); gap: 8px; padding: 5px 7px; }
  .packing-bag-select { padding: 2px; gap: 2px; }
  .packing-bag-contents { border-top: 0; border-left: 1px dashed #738a7c; padding: 0 0 0 8px; gap: 4px; }
  .packing-parcel { padding: 4px 6px; gap: 2px 6px; min-width: 46px; }
  .packing-target { font-size: .7rem; }
  .packing-rack { padding: 6px; }
  .packing-rack .packing-parcels { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
  .packing-rack .packing-parcel { min-width: 0; padding: 4px 2px; gap: 2px; justify-content: center; }
  .packing-rack .packing-tag { font-size: .65rem; overflow-wrap: anywhere; }
  .packing-rack .packing-empty { grid-column: 1 / -1; }
  .packing-controls { justify-content: stretch; }
  #game-shell .packing-controls .button { flex: 1; padding: 8px 4px; }
}
@media (max-width: 580px) {
  #game-shell[data-mission="pluto-long-way-post-01"] .mission-client { width: clamp(113px, 27.2vw, 150px); }
  #game-shell[data-mission="pluto-long-way-post-01"] .mission-extra-npc { width: clamp(121px, 29vw, 162px); }
}
#game-shell .dialogue-panel.is-pressure-mode { gap: 8px 12px; }
@media (max-width: 600px) {
  .pressure-puzzle { gap: 7px; }
  .pressure-goal { gap: 3px; }
  .pressure-gauges { gap: 6px; }
  .pressure-gauge { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 5px 7px; }
  .pressure-endpoints { flex: 1; text-align: left; white-space: nowrap; }
  .pressure-gauge .pressure-level { width: 100%; }
  .pressure-slots { grid-template-columns: repeat(min(var(--pressure-beats), 3), minmax(0, 1fr)); gap: 5px; }
  .pressure-slot { padding: 5px; gap: 3px; }
  .pressure-instructions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pressure-action { padding: 6px 4px; }
  .pressure-controls { justify-content: stretch; }
  #game-shell .pressure-controls .button { flex: 1; padding: 8px 4px; }
  #game-shell .is-completion-mode :is(#return-button, #mission-stay-button) { grid-column: 1 / -1; grid-row: auto; width: 100%; }
}
#game-shell #beach-chester {
  appearance: none;
  -webkit-appearance: none;
  width: 14.44%;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: none;
  box-shadow: none;
  background: transparent;
  pointer-events: auto;
  cursor: pointer;
}
#game-shell #beach-chester:focus-visible canvas { filter: drop-shadow(0 0 3px var(--amber-pale)); }
.beach-gull-layer { position: absolute; inset: 0; pointer-events: none; }
.beach-seagull {
  position: absolute;
  width: 4.6%;
  aspect-ratio: 1;
  background-image: url("assets/beach-seagulls-v1.webp");
  background-size: 400% 100%;
  background-repeat: no-repeat;
  transform-origin: center;
}
.beach-fishing-visual {
  position: relative;
  height: 172px;
  overflow: hidden;
  border: 1px solid rgba(83, 217, 195, .5);
  border-radius: 9px;
  background: #226d76 url("assets/beach-world-v4.webp") center 35% / 150% auto;
}
.fishing-bobber {
  position: absolute;
  top: 45%;
  left: 50%;
  width: 20px;
  height: 28px;
  border: 2px solid #233539;
  border-radius: 50%;
  background: linear-gradient(#fff4d8 50%, #e06b49 50%);
  box-shadow: 0 3px 0 5px rgba(232, 252, 246, .25);
  transition: left .25s ease;
}
.beach-fishing-visual[data-phase="waiting"] .fishing-bobber { animation: fishing-float 2s ease-in-out infinite; }
.beach-fishing-visual[data-phase="bite"] .fishing-bobber { top: 60%; animation: fishing-float .4s ease-in-out infinite; box-shadow: 0 0 0 9px rgba(255, 214, 124, .65); }
@keyframes fishing-float { 50% { transform: translateY(5px); } }
.fishing-cue { position: absolute; top: 12px; left: 0; width: 100%; text-align: center; font-size: 1.3rem; color: #fff0b1; text-shadow: 0 2px 4px #102c35; }
.fishing-bite-meter { position: absolute; left: 8%; bottom: 15px; width: 84%; height: 16px; accent-color: var(--amber); }
.fishing-track { position: absolute; left: 6%; right: 6%; top: 26px; height: 90px; border: 2px solid #9be1d6; border-radius: 8px; background: rgba(6, 35, 46, .87); }
.fishing-catch-zone { position: absolute; top: 4px; bottom: 4px; width: 30%; transform: translateX(-50%); border: 3px solid #b9e794; border-radius: 6px; background: rgba(105, 180, 92, .36); }
.fishing-fish-sprite { position: absolute; top: 50%; width: 80px; aspect-ratio: 1; background: url("assets/fishing-fish-v1.webp") no-repeat; background-size: 400% 100%; }
.beach-fishing-visual[data-aligned="true"] .fishing-catch-zone { border-color: #e0ff9b; background: rgba(152, 223, 100, .6); }
.beach-fishing-visual[data-phase="caught"] .fishing-catch-zone { display: none; }
.beach-fishing-visual[data-phase="caught"] .fishing-track { top: 50px; }
.fishing-progress { position: absolute; left: 6%; right: 6%; bottom: 15px; display: flex; align-items: center; gap: 10px; padding: 6px 9px; border-radius: 6px; background: #092e39; }
#fishing-progress-label { font-size: .875rem; white-space: nowrap; color: #e0f8dd; }
#fishing-reel-meter { width: 100%; height: 15px; accent-color: #9fe082; }
.beach-fishing-visual[data-phase="reeling"] :is(.fishing-bobber, .fishing-cue),
.beach-fishing-visual[data-phase="escaped"] .fishing-bobber,
.beach-fishing-visual[data-phase="caught"] .fishing-bobber { display: none; }
#fishing-reel-control { touch-action: none; user-select: none; }
#fishing-reel-control[aria-pressed="true"] { background: #42644a; border-color: #d4ef9c; }
#beach-dialogue-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#beach-dialogue-choices button:disabled { opacity: .4; cursor: default; }
#beach-scene.is-overlay-open :is(.mission-move-pad, .mission-interact-button, .mission-interact-prompt, .mission-objective-ribbon) { opacity: .15; pointer-events: none; }
@media (max-width: 600px) { #beach-dialogue-choices { grid-template-columns: 1fr; } }
#beach-scene { container-type: size; background: #153b43; }
#beach-world { inset: auto; left: 0; top: 0; width: var(--world-camera-width, 100%); height: var(--world-camera-height, 100%); transform: translate(var(--world-camera-x, 0px), var(--world-camera-y, 0px)); }
#beach-world #beach-player { width: 10.5%; }
#beach-world #beach-follower { width: 8.4%; }
.reduce-motion .fishing-bobber { animation: none !important; transition: none; }
@media (prefers-reduced-motion: reduce) { .fishing-bobber { animation: none !important; transition: none; } }

/* All missions crop one proportional world in every layout. Widths are
   fractions of that world, so screen size cannot change the prop/crew scale. */
#game-shell[data-multi-room="true"] #mission-scene { container-type: size; background: #152329; }
#game-shell #mission-world {
  inset: auto; left: 0; top: 0; width: var(--world-camera-width, 100%); height: var(--world-camera-height, 100%);
  transform: translate(var(--world-camera-x, 0px), var(--world-camera-y, 0px));
  --mission-rivet-width: 10.5%;
  --mission-sprocket-width: 8.4%;
  --mission-client-width: 10.8%;
}
#game-shell #mission-world .mission-world-art img { object-fit: fill; transform: none; }
#game-shell #mission-world .mission-rivet { width: var(--mission-rivet-width); }
#game-shell #mission-world .mission-socket { width: var(--mission-sprocket-width); }
#game-shell #mission-world .mission-client { width: var(--mission-client-width); }
#game-shell #mission-world .mission-extra-npc { width: var(--mission-extra-width, var(--mission-client-width)); }

/* Keep the audited desktop atlas cell ratios. Visible heights still differ
   with the individual character's shape and their depth in the room. */
#game-shell[data-multi-room="true"] #mission-world { --mission-client-width: 14.44%; }
#game-shell:is([data-easy-mission="true"], [data-mission="enceladus-quiet-tide-01"]) #mission-world { --mission-client-width: 10.5%; }
#game-shell:is([data-mission="mars-red-dust-picnic-01"], [data-mission="venus-cloudtop-gallery-01"]) #mission-world { --mission-client-width: 10.8%; }
#game-shell[data-mission="moon-moonlight-market-01"] #mission-world { --mission-client-width: 10.2%; }
#game-shell:is([data-mission="phobos-relay-01"], [data-mission="pluto-long-way-post-01"]) #mission-world { --mission-client-width: 11.4%; }
#game-shell[data-mission="pluto-long-way-post-01"] #mission-world { --mission-extra-width: 12.2%; }
#game-shell[data-mission="titan-archive-01"] #mission-world { --mission-extra-width: 10.2%; }
#game-shell[data-mission="mercury-long-shadow-01"] #mission-world {
  --mission-rivet-width: 8.4%;
  --mission-sprocket-width: 6.72%;
  --mission-client-width: 10.8%;
}
#mission-client[hidden] { display: none; }
.community-progress-sign {
  position: absolute; padding: 4px 7px; border: 1px solid #9ee0cb; border-radius: 4px; background: #18352b; color: #e1efd3;
  font-size: clamp(8px, .9cqw, 16px); font-weight: bold; transform: translate(-50%, -50%); white-space: nowrap;
}
.community-task-result {
  position: absolute; transform: translate(-50%, -50%); padding: 4px 7px; border-radius: 5px;
  background: #19392fe8; border: 1px solid #98c6a5; color: #fff0c9; white-space: nowrap;
  font-size: clamp(9px, .95cqw, 16px); font-weight: bold;
}
#game-shell .dialogue-panel.is-math-mode { --portrait-size: 96px; gap: 7px 12px; }
#game-shell .is-math-mode :is(#dialogue-line, #question-prompt) { display: none; }
#game-shell .is-math-mode .answer-grid { display: block; }
.supply-math-puzzle { display: grid; gap: 7px; color: var(--cream); font-size: 1rem; line-height: 1.3; }
.math-guide, .math-rule, .math-supply, .math-receipt, .math-warning { margin: 0; }
.math-guide { font-weight: bold; color: #ffe0a0; }
.math-rule, .math-warning { font-size: .875rem; }
.math-warning { color: #ffb783; }
.math-object-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.math-object-group { padding: 7px; border: 1px solid #799684; border-radius: 7px; background: #223932; font-size: .875rem; }
.math-items { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin-top: 3px; }
.math-item { display: inline-grid; place-items: center; width: 22px; height: 22px; font-size: 18px; }
.math-quantity { display: grid; grid-template-columns: minmax(0, 1fr) 38px 44px 38px; align-items: center; gap: 6px; }
.math-quantity-label { font-size: .875rem; }
.math-value { font-size: 1.15rem; text-align: center; font-weight: bold; }
.math-action { min-height: 36px; padding: 7px; border: 1px solid #9ba88a; border-radius: 6px; background: #2a463b; color: #fff0c9; font: inherit; font-size: .875rem; cursor: pointer; }
.math-action:hover { background: #375e50; }
.math-action:focus-visible { outline: 2px solid #ffdc93; outline-offset: 2px; }
.math-action[aria-pressed="true"] { background: #49644a; border-color: #ffe29d; }
.math-action:disabled { cursor: default; opacity: .65; }
.math-tabs, .math-group-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.math-tabs .math-action { flex: 1; }
.math-selectable-groups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.math-selectable-groups .math-items { justify-content: center; min-height: 24px; }
.math-coins, .math-boxes { display: flex; flex-wrap: wrap; gap: 5px; min-height: 28px; }
.math-coin { display: grid; place-items: center; width: 29px; height: 29px; border: 2px solid #e5bd68; border-radius: 50%; background: #6c5628; font-size: .9rem; font-weight: bold; }
.math-box { font-size: 26px; opacity: .3; }
.math-box.is-filled { opacity: 1; }
.math-controls { display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 6px; }
.math-test { background: #886033; border-color: #ffd68b; }
@media (max-width: 600px) {
  #game-shell .dialogue-panel.is-math-mode { --portrait-size: 70px; gap: 6px 9px; }
  .supply-math-puzzle { gap: 6px; }
  .math-selectable-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .math-action { min-height: 38px; padding: 6px; }
  .math-items { gap: 2px; }
}

.community-prepared-items {
  position: absolute; transform: translate(-50%, -50%); padding: 3px 5px; white-space: nowrap;
  background: #19392fe8; border: 1px solid #98c6a5; border-radius: 4px;
  color: #fff0c9; font-size: clamp(9px, 1.2cqw, 20px); line-height: 1.2;
}

/* Measurement diagrams remain ordinary labelled controls, with no drag or timer. */
.supply-math-puzzle:has(.math-clock, .math-panel-plan, .math-number-rail, .math-balance, .math-mosaic, .math-schedule-track) .math-action { min-height: 44px; }
.math-panel-plan { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; max-width: 330px; }
.math-panel-slot { display: grid; place-items: center; height: 29px; border: 1px dashed #a2b8a1; border-radius: 4px; color: #dfd8b8; }
.math-panel-slot.is-installed { background: #638171; color: #fff3cf; border-style: solid; }
.math-number-rail { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; max-width: 392px; }
.math-rail-mark { min-height: 44px; padding: 4px; font: inherit; color: #fff3cf; background: #293f38; border: 1px solid #71877a; border-radius: 4px; cursor: pointer; }
.math-rail-mark.is-fixed { border-bottom: 5px solid #f6be79; }
.math-rail-mark[aria-pressed="true"] { background: #607c61; outline: 2px solid #ffdc93; outline-offset: -3px; }
.math-rail-mark:focus-visible, .math-pane:focus-visible { outline: 3px solid #fff3c6; outline-offset: 2px; }
.math-rail-mark:disabled, .math-pane:disabled { cursor: default; }
.math-rail-intervals { margin: 0; font-size: .875rem; color: #ffd897; }
.math-balance { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0 4px; border-top: 5px solid #b1aa8b; }
.math-balance-tray { flex: 1; background: #243a32; border: 1px solid #9da98c; border-bottom: 4px solid #cda76b; padding: 8px; text-align: center; font-size: .875rem; }
.math-balance[data-balance="left"] .math-balance-tray:first-child, .math-balance[data-balance="right"] .math-balance-tray:last-child { transform: translateY(4px); }
.math-mosaic { display: grid; grid-template-columns: repeat(var(--mosaic-columns), 1fr); grid-template-rows: repeat(var(--mosaic-rows), 1fr); width: min(100%, 288px); height: 144px; gap: 3px; padding: 4px; background: #2a2f28; border: 2px solid #d4b881; box-sizing: border-box; }
.math-pane { min-width: 0; min-height: 0; padding: 2px; border: 1px solid #ddcfaa; font: inherit; font-size: .75rem; font-weight: bold; line-height: 1.1; cursor: pointer; }
:is(.math-pane, .mission-mosaic-thumbnail > span)[data-color="cream"] { background: #eee0b9; color: #343a30; }
:is(.math-pane, .mission-mosaic-thumbnail > span)[data-color="blue"] { background: repeating-linear-gradient(135deg, #35657d 0 6px, #447994 6px 10px); color: #fff4d3; }
:is(.math-pane, .mission-mosaic-thumbnail > span)[data-color="gold"] { background: radial-gradient(#71522e 1px, transparent 2px) 0 0 / 8px 8px, #d9b970; color: #2c342c; }
.math-half-comparison { display: flex; gap: 7px; }
.math-half-area { flex: 1; min-height: 44px; display: grid; place-items: center; background: linear-gradient(90deg, #35657d 50%, #eee0b9 50%); border: 2px solid #d4b881; color: #fff4d3; font-size: .75rem; font-weight: bold; text-shadow: 1px 1px 2px #172c28, -1px -1px 2px #172c28; }
.math-clock-row { display: flex; gap: 16px; align-items: center; }
.math-clock-row .math-rule { flex: 1; }
.math-clock { position: relative; flex: 0 0 140px; width: 140px; height: 140px; border: 5px solid #bdb297; border-radius: 50%; background: #f0e2bc; color: #273b35; box-shadow: inset 0 0 0 2px #5c7466; }
.math-clock-number { position: absolute; transform: translate(-50%, -50%); font-size: .875rem; font-weight: bold; }
.math-clock-hour, .math-clock-minute { position: absolute; display: block; bottom: 50%; left: 50%; transform-origin: 50% 100%; border-radius: 3px 3px 0 0; }
.math-clock-hour { width: 6px; margin-left: -3px; height: 27%; background: #283c35; }
.math-clock-minute { width: 4px; margin-left: -2px; height: 36%; background: #8b5034; }
.math-clock-pin { position: absolute; top: 50%; left: 50%; width: 10px; height: 10px; transform: translate(-50%, -50%); background: #283c35; border-radius: 50%; }
.math-schedule-track { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.math-job-plan { display: grid; gap: 4px; }
.math-job-line { margin: 0; font-size: .875rem; }
.math-job-timeline { position: relative; display: block; width: 100%; height: 12px; margin-top: 3px; background: repeating-linear-gradient(90deg, #263c32 0 calc(100% / var(--job-slots) - 1px), #7e9783 calc(100% / var(--job-slots) - 1px) calc(100% / var(--job-slots))); }
.math-job-bar { position: absolute; display: block; left: calc(var(--job-start) * 100% / var(--job-slots)); width: calc(var(--job-length) * 100% / var(--job-slots)); height: 12px; box-sizing: border-box; border: 1px solid #e9ce95; background: #577665; }
.math-job-bar[data-job="1"] { background: #ba995c; }
.math-job-bar[data-job="2"] { background: repeating-linear-gradient(135deg, #35657d 0 6px, #447994 6px 10px); }
.mission-completed-exhibit { position: absolute; transform: translate(-50%, -50%); display: flex; gap: .35cqw; padding: .4cqw; background: #313a30; border: .2cqw solid #ceb17d; border-radius: 3px; width: 17%; height: 12%; box-sizing: border-box; }
.mission-mosaic-thumbnail { display: grid; flex: 1; grid-template-columns: repeat(var(--mosaic-columns), 1fr); gap: .12cqw; background: #283a32; }
.mission-mosaic-thumbnail > span { border: 1px solid #dbd1b0; }
.mission-recording { width: 20%; height: 14%; display: grid; place-items: center; color: #e2f0bf; font-size: clamp(8px, .9cqw, 15px); }
.mission-recording-trace { font-size: 2cqw; color: #a9d2c2; animation: recorded-observation 3s ease-out both; }
.mission-recording strong { font-size: inherit; }
#mission-world-image.is-shade-deployed { animation: shade-deployment 1.2s ease-out both; }
@keyframes recorded-observation { from { opacity: .2; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0); } }
@keyframes shade-deployment { from { filter: brightness(1.15); } to { filter: brightness(1); } }
@media (max-width: 600px) {
  .math-clock { flex-basis: 112px; width: 112px; height: 112px; }
  .math-clock-row { gap: 10px; }
  .math-balance { gap: 7px; }
  .math-quantity { grid-template-columns: minmax(0, 1fr) 44px 38px 44px; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) { .mission-recording-trace, #mission-world-image.is-shade-deployed { animation: none; } }

.debrief-panel.printer-paper { padding: 28px 32px; width: min(760px, calc(100% - 24px)); background: #f0ecdf; color: #171713; border: 0; border-radius: 0; box-shadow: 0 10px 35px #0008; font-family: "Courier New", Courier, monospace; }
.printer-paper::before, .printer-paper::after { content: ""; position: absolute; top: 0; bottom: 0; width: 18px; background: radial-gradient(circle, #292a25 0 3px, transparent 3.5px) center 8px / 18px 22px repeat-y; pointer-events: none; }
.printer-paper::before { left: 0; border-right: 1px dashed #b6b2a7; }
.printer-paper::after { right: 0; border-left: 1px dashed #b6b2a7; }
.mission-report-source[hidden] { display: none; }
.mission-report-output { font: 600 16px/1.5 "Courier New", Courier, monospace; letter-spacing: 0; color: #171713; overflow-wrap: normal; }
.report-print-line { display: block; min-height: 1.5em; white-space: pre; }
.printer-paper.is-printing .report-print-line { animation: report-line-print 110ms steps(var(--print-steps), end) var(--print-delay) both; }
@keyframes report-line-print { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
.printer-paper .debrief-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding-top: 14px; border-top: 1px dashed #77766e; }
.printer-paper .button { font: bold 14px/1.4 "Courier New", Courier, monospace; letter-spacing: .02em; color: #171713; background: #f0ecdf; border: 1px solid #171713; border-radius: 0; box-shadow: none; text-shadow: none; min-height: 40px; }
.printer-paper .button-primary { background: #171713; color: #f0ecdf; }
.printer-paper .button:hover, .printer-paper .button:focus-visible { outline: 2px solid #171713; outline-offset: 2px; }
@media (max-width: 600px) { .debrief-panel.printer-paper { padding: 20px 24px; } }
@media (prefers-reduced-motion: reduce) { .printer-paper.is-printing .report-print-line { animation: none; } }
.reduce-motion .printer-paper.is-printing .report-print-line { animation: none; }

/* The report scrolls as one sheet, so the tractor-feed holes reach its actual bottom. */
#debrief-scene.is-active { display: flex; overflow-y: auto; align-items: flex-start; }
#game-shell .debrief-panel.printer-paper { position: relative; top: auto; left: auto; flex: none; height: max-content; max-height: none; overflow: visible; margin: auto; transform: none; }

/* A green completion burst sits above the controls without stealing input. */
#game-shell .puzzle-sparkles { position: absolute; inset: 0; z-index: 8; overflow: visible; pointer-events: none; }
#game-shell .puzzle-sparkles::before { content: ""; position: absolute; inset: -18px; opacity: 0; border-radius: inherit; background: radial-gradient(ellipse at center, rgba(120,255,151,.28), transparent 62%); }
#game-shell .puzzle-sparkles.is-sparkling::before { animation: puzzle-green-halo 1.15s ease-out both; }
#game-shell .puzzle-sparkles span { position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; border-radius: 50%; opacity: 0; background: #c5ff80; box-shadow: 0 0 10px 4px #72f783, 0 0 25px #22ce83; }
#game-shell .puzzle-sparkles span:nth-child(3n) { width: 7px; height: 7px; background: #e7ffb0; }
#game-shell .puzzle-sparkles span:nth-child(4n)::before, #game-shell .puzzle-sparkles span:nth-child(4n)::after { content: ""; position: absolute; left: 50%; top: 50%; background: #d8ff9d; transform: translate(-50%, -50%); }
#game-shell .puzzle-sparkles span:nth-child(4n)::before { width: 3px; height: 28px; }
#game-shell .puzzle-sparkles span:nth-child(4n)::after { width: 28px; height: 3px; }
#game-shell .puzzle-sparkles.is-sparkling span { animation: puzzle-green-spark 1.18s cubic-bezier(.15,.6,.25,1) var(--spark-delay) both; }
#game-shell .dialogue-panel.is-puzzle-success { animation: puzzle-frame-green 1.28s ease-out both; }
@keyframes puzzle-green-spark { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); } 12%, 38% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--spark-x)), calc(-50% + var(--spark-y))) scale(.7); } }
@keyframes puzzle-green-halo { 0% { opacity: 0; transform: scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: scale(1.25); } }
@keyframes puzzle-frame-green { 0%, 100% { border-color: var(--line); box-shadow: var(--shadow); } 16%, 43% { border-color: #baff9d; box-shadow: 0 0 0 4px rgba(133,255,151,.43), 0 0 44px 10px rgba(93,250,142,.55), inset 0 0 32px rgba(82,251,130,.32); } }

/* The optional Phobos echo is a little field radio: read the lit strip, then transmit. */
#game-shell .relay-echo-board { display: grid; justify-items: stretch; gap: 8px; width: min(100%, 650px); margin-inline: auto; padding: 10px; border: 2px solid #8d7759; border-radius: 12px; background: linear-gradient(145deg, #254046, #0a2029 48%, #152a2c); box-shadow: inset 0 0 0 3px #162d32, 0 12px 28px #0007; }
#game-shell .relay-echo-board > strong { color: #e6efcf; font: 900 .92rem ui-rounded, system-ui, sans-serif; letter-spacing: .12em; text-align: center; }
#game-shell .relay-echo-monitor { position: relative; width: 100%; aspect-ratio: 640 / 154; max-height: 142px; overflow: hidden; border: 2px solid #887e66; border-radius: 7px; background: #0a2027; box-shadow: inset 0 0 0 3px #172e34, 0 0 18px #6bdac733; }
#game-shell .relay-echo-monitor img { display: block; width: 100%; height: 100%; object-fit: fill; }
#game-shell .relay-echo-monitor-badge { position: absolute; right: 9px; bottom: 8px; padding: 3px 6px; border: 1px solid #73c9b6; border-radius: 3px; color: #dbf5d4; background: #0a2329e8; font: 800 .58rem system-ui, sans-serif; letter-spacing: .1em; }
#game-shell .relay-echo-caption { color: #a6cec3; font: 800 .65rem system-ui, sans-serif; letter-spacing: .12em; text-align: center; }
#game-shell .relay-echo-pattern, #game-shell .relay-echo-keys { display: flex; justify-content: center; gap: 8px; width: 100%; }
#game-shell .relay-echo-light, #game-shell .relay-echo-key { display: flex; flex: 1 1 0; min-width: 0; min-height: 63px; align-items: center; justify-content: flex-end; flex-direction: column; gap: 4px; padding: 6px 4px; border: 2px solid currentColor; border-radius: 8px; font: 900 .69rem ui-rounded, system-ui, sans-serif; letter-spacing: .055em; white-space: nowrap; }
#game-shell .relay-echo-light { background: linear-gradient(180deg, #213c43, #0c232a); box-shadow: inset 0 0 14px #050f17, 0 0 7px currentColor; }
#game-shell .relay-echo-light::before, #game-shell .relay-echo-key::before { content: ""; display: block; width: 26px; height: 26px; flex: none; border: 3px solid currentColor; border-radius: 50%; background: radial-gradient(circle at 39% 32%, #fff9, currentColor 35%, #132329 84%); box-shadow: 0 0 12px currentColor, inset 0 0 9px #fff7; }
#game-shell .relay-echo-light.is-entered { opacity: .44; box-shadow: inset 0 0 16px #020c13; }
#game-shell .relay-echo-progress { display: flex; gap: 5px; width: 100%; height: 7px; padding: 0 3px; }
#game-shell .relay-echo-progress-step { flex: 1; border: 1px solid #5b8079; border-radius: 4px; background: #122e31; }
#game-shell .relay-echo-progress-step.is-entered { border-color: #b9ffb4; background: #7bf1a8; box-shadow: 0 0 10px #7bf1a8; }
#game-shell .relay-echo-key { min-height: 69px; background: linear-gradient(180deg, #2b5051, #112b33); color: #e1f4e5; box-shadow: inset 0 2px 0 #ffffff30, 0 5px 0 #071b21; cursor: pointer; touch-action: manipulation; }
#game-shell .relay-echo-key:hover, #game-shell .relay-echo-key:focus-visible { transform: translateY(-2px); outline: 2px solid #e2ffd1; outline-offset: 2px; filter: brightness(1.25); }
#game-shell .relay-echo-key:active { transform: translateY(3px); box-shadow: inset 0 2px 6px #071b21; }
#game-shell .relay-echo-board [data-tone="amber"] { color: #ffc36d; }
#game-shell .relay-echo-board [data-tone="cyan"] { color: #72e5ec; }
#game-shell .relay-echo-board [data-tone="mint"] { color: #a4f9a5; }
#game-shell .relay-echo-key[data-tone] { color: #e8f4e8; }
#game-shell .relay-echo-key[data-tone="amber"]::before { color: #ffc36d; }
#game-shell .relay-echo-key[data-tone="cyan"]::before { color: #72e5ec; }
#game-shell .relay-echo-key[data-tone="mint"]::before { color: #a4f9a5; }
#game-shell .relay-echo-board.is-complete { border-color: #a5f5a9; box-shadow: inset 0 0 24px #6deb9666, 0 0 32px #6deb9666; }
#game-shell .relay-echo-board.is-error { border-color: #da956a; }
@media (max-width: 580px) { #game-shell .relay-echo-board { gap: 6px; padding: 7px; } #game-shell .relay-echo-light, #game-shell .relay-echo-key { min-height: 53px; font-size: .55rem; letter-spacing: 0; } #game-shell .relay-echo-light::before, #game-shell .relay-echo-key::before { width: 21px; height: 21px; } #game-shell .relay-echo-monitor-badge { font-size: .48rem; } }
.tea-brew-board { display: grid; gap: .7rem; padding: .8rem; border: 1px solid #9ac5ad; border-radius: 9px; background: linear-gradient(145deg, #132e34, #0b1d28); color: #f8e9c9; }
.tea-brew-board > strong { color: #f7c777; letter-spacing: .1em; }
.tea-brew-board p { margin: 0; color: #cbe4ce; font-size: .78rem; line-height: 1.45; }
.tea-brew-readout { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .5rem; align-items: center; font: 800 .74rem system-ui, sans-serif; }
.tea-brew-gauge { height: 18px; overflow: hidden; border: 1px solid #a5c9b2; border-radius: 99px; background: #081a22; }
.tea-brew-gauge i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #5cbdba, #f5ae5b); transition: width .18s ease; }
.tea-brew-controls { display: flex; flex-wrap: wrap; gap: .45rem; }
.tea-brew-button { min-height: 40px; border: 1px solid #a7bdb0; border-radius: 6px; padding: .4rem .65rem; background: #254449; color: #f8e9c9; font: 800 .7rem system-ui, sans-serif; cursor: pointer; }
.tea-brew-button:hover, .tea-brew-button:focus-visible { border-color: #ffc77a; background: #3c5b53; outline-offset: 2px; }
.tea-brew-button:disabled { cursor: default; opacity: .43; }
@media (max-width: 580px) { .tea-brew-readout { grid-template-columns: 1fr auto; } .tea-brew-gauge { grid-column: 1 / -1; } .tea-brew-button { min-height: 42px; } }

/* Cockpit character windows react to actual pilot controls and honor Reduced Motion. */
#game-shell .flight-cockpit-crew { position: absolute; left: 50%; bottom: 12px; z-index: 7; display: flex; gap: 8px; transform: translateX(-50%); pointer-events: none; }
#game-shell .flight-tip { left: 59%; bottom: max(.55rem, var(--safe-bottom)); padding: .33rem .58rem; font-size: .61rem; line-height: 1.25; opacity: .88; }
#game-shell .cockpit-portrait { width: clamp(84px, 8vw, 112px); margin: 0; padding: 5px; border: 1px solid rgba(105, 221, 180, .5); border-radius: 11px; background: linear-gradient(155deg, rgba(15, 49, 52, .94), rgba(8, 20, 27, .94)); box-shadow: inset 0 0 0 2px #214448, 0 8px 25px #0009; }
#game-shell .cockpit-portrait-window { position: relative; isolation: isolate; aspect-ratio: 1; overflow: hidden; border-radius: 7px; background: radial-gradient(circle at 50% 25%, #365962, #101f2c 80%); }
#game-shell .cockpit-portrait-window::before { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: .28; background: repeating-linear-gradient(180deg, transparent 0 3px, #b9fff126 3px 4px), linear-gradient(90deg, #69f6e51a, transparent 16% 84%, #69f6e51a); }
#game-shell .cockpit-portrait-window::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 19%; z-index: 3; pointer-events: none; opacity: 0; background: linear-gradient(180deg, transparent, #a9fff155 22%, #fff4cc1f 36%, transparent 62%); box-shadow: 0 2px 0 #afffdf44; animation: cockpit-interference 4.6s steps(1, end) infinite; }
#game-shell .cockpit-sprocket .cockpit-portrait-window::after { animation-delay: -2.1s; }
#game-shell .cockpit-frame { width: 100%; height: 100%; background-size: 800% 300%; background-position: 0 0; background-repeat: no-repeat; animation: cockpit-idle 2.1s ease-in-out infinite alternate; }
#game-shell .cockpit-rivet .cockpit-frame { background-image: url("assets/rivet-cockpit-frames-v163.webp"); }
#game-shell .cockpit-sprocket .cockpit-frame { background-image: url("assets/sprocket-cockpit-frames-v163.webp"); animation-delay: -1.4s; }
#game-shell .cockpit-portrait figcaption { margin-top: 3px; color: #b9f0cf; text-align: center; white-space: nowrap; font: 800 .55rem system-ui, sans-serif; letter-spacing: .07em; }
@keyframes cockpit-idle { from { transform: translateY(1px); } to { transform: translateY(-2px); } }
@keyframes cockpit-thrust { from { transform: translateY(3px); } to { transform: translateY(-3px); } }
@keyframes cockpit-retro { from { transform: translateY(-2px); } to { transform: translateY(2px); } }
@keyframes cockpit-interference { 0%, 69%, 76%, 100% { opacity: 0; transform: translateY(-25%); } 70%, 71% { opacity: .85; transform: translateY(96%); } 72%, 74% { opacity: .45; transform: translateY(330%); } 75% { opacity: .8; transform: translateY(460%); } }
@media (max-width: 820px) { #game-shell .flight-cockpit-crew { top: 132px; bottom: auto; gap: 5px; } #game-shell .cockpit-portrait { width: 65px; padding: 3px; } #game-shell .cockpit-portrait figcaption { font-size: .43rem; } }
@media (max-width: 600px), (max-height: 500px) { #game-shell .flight-cockpit-crew { top: 104px; gap: 4px; } #game-shell .cockpit-portrait { width: 53px; padding: 2px; } #game-shell .cockpit-portrait figcaption { font-size: .38rem; letter-spacing: 0; } }
#game-shell .flight-cockpit-crew { left: 287px; right: auto; bottom: 1rem; transform: none; }
#game-shell.is-engine-firing .cockpit-frame { animation: cockpit-thrust .14s linear infinite alternate; }
#game-shell.is-retro-firing .cockpit-frame { animation: cockpit-retro .19s linear infinite alternate; }
@media (max-width: 820px) { #game-shell .flight-cockpit-crew { left: 243px; top: auto; bottom: .65rem; } }
@media (max-width: 600px) and (min-height: 501px) { #game-shell .flight-cockpit-crew { left: calc(.42rem + min(158px, 100% - 171px) + 6px); top: auto; bottom: 165px; } }
@media (max-height: 500px) { #game-shell .flight-cockpit-crew { left: 194px; top: auto; bottom: .45rem; } #game-shell .cockpit-portrait { width: 48px; } }
#game-shell[data-mission="enceladus-quiet-tide-01"] .mission-world-art img { object-fit: cover; }
@keyframes inventory-attention { 0%, 100% { border-color: var(--line); box-shadow: 0 0 0 transparent; } 20%, 58% { border-color: #c9ffaf; box-shadow: 0 0 18px #70f2ad, inset 0 0 14px #70f2ad44; } }
#game-shell .mission-inventory.is-attention { animation: inventory-attention .6s ease-in-out 2; }
#game-shell .mission-inventory.is-attention .inventory-slot.is-attention { animation: inventory-attention .6s ease-in-out 2; }
@media (prefers-reduced-motion: reduce) { #game-shell .cockpit-frame, #game-shell.is-engine-firing .cockpit-frame, #game-shell.is-retro-firing .cockpit-frame, #game-shell .cockpit-portrait-window::after { animation: none; } #game-shell .mission-inventory.is-attention { animation-duration: .01ms; } }
body.reduce-motion #game-shell .cockpit-frame, body.reduce-motion #game-shell.is-engine-firing .cockpit-frame, body.reduce-motion #game-shell.is-retro-firing .cockpit-frame, body.reduce-motion #game-shell .cockpit-portrait-window::after { animation: none; }
body.reduce-motion #game-shell .mission-inventory.is-attention { animation-duration: .01ms; }
#game-shell .mission-inventory { top: .7rem; bottom: auto; left: .7rem; width: min(320px, 32vw); transform: none; }
#game-shell[data-mission="enceladus-quiet-tide-01"] .mission-inventory { display: block; }

.mission-zone-marker.mission-collectible-marker {
  width: clamp(21px, 2.2vw, 28px);
  height: clamp(21px, 2.2vw, 28px);
  opacity: .68;
  pointer-events: none;
  filter: drop-shadow(0 0 2px rgba(252, 208, 113, .46));
  animation: collectible-glimmer 3.8s ease-in-out infinite;
}
.mission-zone-marker.mission-collectible-marker img { display: block; width: 100%; height: 100%; object-fit: contain; }
.mission-zone-marker.mission-collectible-marker.is-nearby {
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(252, 208, 113, .8));
}
.mission-zone-marker.mission-collectible-marker[hidden] { display: none; }
@keyframes collectible-glimmer {
  50% { filter: drop-shadow(0 0 5px rgba(252, 208, 113, .55)); }
}
.mission-souvenir-pocket {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-top: .35rem;
  padding: .18rem .3rem;
  border: 1px solid rgba(247, 195, 101, .38);
  border-radius: 4px;
  background: rgba(247, 195, 101, .08);
  color: var(--amber-pale);
  font-size: .55rem;
  line-height: 1.2;
}
.mission-souvenir-pocket[hidden] { display: none; }
.mission-souvenir-pocket img { width: 25px; height: 25px; flex: none; object-fit: contain; }
.mission-souvenir-pocket span { overflow: hidden; text-overflow: ellipsis; }
.collection-gallery .shop-panel { width: min(970px, calc(100% - 1.2rem)); }
.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .6rem;
  padding: .2rem 1.1rem 1.1rem;
}
.collection-card {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 100px;
  padding: .55rem;
  border: 1px solid rgba(230, 217, 188, .2);
  border-radius: 6px;
  background: rgba(5, 17, 20, .65);
  text-align: left;
}
.collection-card.is-owned { border-color: rgba(246, 192, 105, .42); background: rgba(246, 192, 105, .065); }
.collection-card-art {
  display: grid;
  width: 74px;
  height: 74px;
  flex: none;
  place-items: center;
  border: 1px solid rgba(83, 217, 195, .24);
  border-radius: 5px;
  background: radial-gradient(circle, rgba(83, 217, 195, .13), rgba(5, 17, 20, .86));
  color: rgba(230, 217, 188, .35);
  font: 900 2rem ui-rounded, system-ui, sans-serif;
}
.collection-card-art img { width: 100%; height: 100%; object-fit: contain; }
.collection-card-location { display: block; color: var(--teal); font-size: .58rem; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.collection-card strong { display: block; margin-top: .2rem; color: var(--amber-pale); font-size: .82rem; }
.collection-card p { margin: .2rem 0 0; color: var(--muted); font-size: .68rem; line-height: 1.32; }
.collection-card.is-missing strong { color: var(--muted); }
@media (max-width: 580px) {
  .collection-gallery .shop-heading { align-items: flex-start; }
  .collection-gallery .shop-wallet { min-width: 78px; padding: .4rem; }
  .collection-grid { grid-template-columns: 1fr; padding: .2rem .7rem .7rem; }
  .collection-card { min-height: 78px; }
  .collection-card-art { width: 58px; height: 58px; }
}
@media (prefers-reduced-motion: reduce) { .mission-zone-marker.mission-collectible-marker { animation: none; } }
body.reduce-motion .mission-zone-marker.mission-collectible-marker { animation: none; }
@media (max-width: 960px) { #game-shell .mission-objective-ribbon { top: 7.2rem; } }
@media (max-width: 580px) { #game-shell .mission-inventory { top: .4rem; left: .4rem; bottom: auto; width: min(230px, calc(100% - .8rem)); } #game-shell .mission-objective-ribbon { top: 6.1rem; } }
@media (max-height: 650px) and (orientation: landscape) { #game-shell .mission-inventory { top: .35rem; bottom: auto; left: .35rem; width: min(255px, 31vw); transform: none; } #game-shell .mission-objective-ribbon { top: .55rem; } }
@media (prefers-reduced-motion: reduce) { #game-shell .puzzle-sparkles.is-sparkling span, #game-shell .puzzle-sparkles.is-sparkling::before { animation: none; opacity: 0; } #game-shell .dialogue-panel.is-puzzle-success { animation: none; border-color: #baff9d; box-shadow: 0 0 24px #5efa8e88; } #game-shell .cockpit-frame { animation: none !important; } }
body.reduce-motion #game-shell .puzzle-sparkles.is-sparkling span, body.reduce-motion #game-shell .puzzle-sparkles.is-sparkling::before { animation: none; opacity: 0; }
body.reduce-motion #game-shell .dialogue-panel.is-puzzle-success { animation: none; border-color: #baff9d; box-shadow: 0 0 24px #5efa8e88; }

/* Repair instruments fill the panel; portraits and step counters belong to dialogue. */
#game-shell #mission-dialogue-console.is-puzzle-mode { grid-template-columns: minmax(0, 1fr); }
#game-shell #mission-dialogue-console.is-puzzle-mode .dialogue-portrait,
#game-shell #mission-dialogue-console.is-puzzle-mode #question-label { display: none; }
#game-shell #mission-dialogue-console.is-puzzle-mode .dialogue-heading { grid-column: 1; grid-row: 1; }
body.reduce-motion #game-shell .cockpit-frame { animation: none !important; }

/* Four reserved mission slots keep every page, including the last, the same size. */
#game-shell .mission-picker {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: repeat(4, 78px);
  height: 336px;
  align-content: start;
}
#game-shell .mission-card { min-height: 0; height: 100%; }
#game-shell .mission-picker-empty { grid-column: 1 / -1; grid-row: 1 / -1; margin: 0; }
#game-shell .mission-pagination {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 6px; margin-top: 12px; height: 36px;
}
#game-shell .mission-pagination button {
  height: 36px; padding: 4px 6px; border: 1px solid #638b83; border-radius: 5px;
  background: #173035; color: var(--cream); font: 700 .7rem system-ui, sans-serif; cursor: pointer;
}
#game-shell .mission-pagination button:disabled { opacity: .4; cursor: default; }
#game-shell .mission-pagination button:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
#game-shell #mission-page-status { color: var(--muted); font-size: .65rem; white-space: nowrap; }
@media (max-width: 600px) {
  #game-shell .mission-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, 52px);
    height: 110px;
  }
  #game-shell .mission-pagination { margin-top: 8px; }
}

.easy-repair-puzzle { gap: 8px; }
.easy-count-items { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; }
.easy-count-item { display:grid; place-items:center; position:relative; width:42px; height:42px; background:#d9cbae; color:#273b41; border:2px solid #59686a; border-radius:5px; font-size:24px; }
.easy-count-item.is-empty { background:#24373b; color:#9daaaa; border-style:dashed; }
.easy-count-item.is-broken { opacity:.7; }
.easy-cross { position:absolute; inset:0; display:grid; place-items:center; color:#942e22; font-size:38px; text-shadow:1px 1px #f5e6cb; }
.easy-answer-choices { display:flex; flex-wrap:wrap; justify-content:center; gap:6px; }
.easy-answer-choices button { min-width:40px; min-height:42px; font-size:18px; display:flex; flex-direction:column; align-items:center; gap:2px; }
.easy-answer-choices button[aria-pressed="true"],.easy-match-parts button[aria-pressed="true"] { background:#c2ecd6; color:#173637; outline:2px solid #83d9c6; }
.easy-symbol { display:inline-flex; align-items:center; justify-content:center; width:42px; height:42px; font-size:30px; color:inherit; line-height:1; }
.easy-symbol-short { width:26px; }.easy-symbol-long { width:62px; font-size:22px; white-space:nowrap; }
.easy-symbol-small { font-size:20px; }.easy-symbol-medium { font-size:32px; }.easy-symbol-large { font-size:45px; }
.easy-symbol.is-outline { opacity:.7; }
.easy-answer-status { margin:0; font-size:13px; text-align:center; }
.easy-match-parts,.easy-match-mounts { display:flex; justify-content:center; gap:8px; }
.easy-match-parts button,.easy-match-mounts button { display:flex; flex:1; flex-direction:column; align-items:center; font-size:13px; min-width:0; padding:6px; }
.easy-match-parts small,.easy-match-mounts small { font-size:11px; }
.easy-match-down { display:block; text-align:center; margin:-5px 0; }
.easy-loop-reference { display:flex; flex-direction:column; align-items:center; gap:4px; }
.easy-unit-bracket { display:flex; gap:8px; padding:2px 10px 6px; border:2px solid #8ed6c4; border-top:0; border-radius:0 0 8px 8px; }
.easy-loop-item { display:flex; flex-direction:column; align-items:center; }
.easy-loop-item small { font-size:11px; }
.easy-pattern-sequence { display:flex; justify-content:center; align-items:center; gap:5px; padding:5px; border-radius:7px; background:#142e35; }
.easy-missing-symbol,.easy-number { display:grid; place-items:center; width:36px; height:38px; border:1px solid #8caca9; font-size:24px; }
.easy-missing-symbol { border-style:dashed; color:#ffe3a2; }
.easy-airflow { display:flex; justify-content:space-around; align-items:center; background:#d9cbae; color:#233b42; padding:18px; border-radius:8px; }
.easy-machine-effect { position:absolute; pointer-events:none; }
.effect-io { left:43.5%; top:32%; width:13%; }.effect-io svg { width:100%; }.easy-fan-blades { transform-origin:50px 50px; animation:easy-fan-spin 2s linear infinite; }
.effect-ceres { left:61%;top:42%;width:22%;height:16%;display:flex;justify-content:space-around; }.effect-ceres i { width:3%;height:14%;background:#a4e3ea;border-radius:50%;animation:easy-water 3s ease-in infinite; }.effect-ceres i:nth-child(2){animation-delay:.75s}.effect-ceres i:nth-child(3){animation-delay:1.5s}.effect-ceres i:nth-child(4){animation-delay:2.25s}
.effect-vesta {left:64%;top:43%;width:14%;height:10%;color:#e8dbc1;}.effect-vesta b { display:block;animation:easy-tray 4s ease-in-out infinite; }.effect-vesta i {display:block;width:20%;aspect-ratio:1;border:4px dashed #81c7b8;border-radius:50%;animation:easy-fan-spin 4s linear infinite;}
.effect-ganymede {left:66%;top:26%;width:20%;height:20%;}.effect-ganymede i {display:block;width:100%;height:100%;background:linear-gradient(90deg,#93e5df99,transparent);clip-path:polygon(0 45%,100% 0,100% 100%,0 55%);transform-origin:left;animation:easy-beacon 6s ease-in-out infinite;}.effect-ganymede b {position:absolute;top:100%;font-size:clamp(8px,1cqw,16px);color:#b5ebd4;}
.effect-deimos {left:20%;top:38%;width:14%;display:flex;gap:6%;align-items:center;}.effect-deimos i{width:10%;aspect-ratio:1;background:#a9dfcd;border-radius:50%;animation:easy-signal 6s ease-in-out infinite;}.effect-deimos i:nth-child(2){animation-delay:2s}.effect-deimos i:nth-child(3){animation-delay:4s}.effect-deimos b{font-size:clamp(7px,.9cqw,14px);color:#b5ebd4;}
@keyframes easy-fan-spin {to{transform:rotate(360deg)}}
@keyframes easy-water {0%{transform:translateY(0);opacity:0}15%{opacity:.8}90%{transform:translateY(450%);opacity:.8}100%{transform:translateY(470%);opacity:0}}
@keyframes easy-tray {50%{transform:translateX(20%)}}
@keyframes easy-beacon {0%,32%{transform:scaleY(1);opacity:.6}33%,64%{transform:scaleY(.25);opacity:.4}65%,100%{transform:scaleY(.25);opacity:.55}}
@keyframes easy-signal {0%,25%{opacity:1}35%,100%{opacity:.4}}
.reduce-motion .easy-machine-effect * {animation:none!important}
@media(prefers-reduced-motion:reduce){.easy-machine-effect *{animation:none!important}}
.crate-overlay { position:absolute; inset:0; z-index:120; display:grid; place-items:center; padding:20px; }
.crate-overlay[hidden] {display:none;}
.crate-backdrop {position:absolute;inset:0;border:0;background:#081c28d9;cursor:default;}
.crate-panel {position:relative;width:min(850px,100%);max-height:100%;overflow:auto;background:#16333a;color:#e9e1ce;border:3px solid #8dbab0;border-radius:14px;padding:16px;box-shadow:0 20px 70px #0009;}
.crate-header {display:flex;align-items:center;justify-content:space-between;gap:12px;}.crate-header h2{margin:0;font-size:24px;}.crate-guide{font-size:14px;line-height:1.5;margin:10px 0;}
.crate-layout{display:grid;grid-template-columns:240px 1fr;gap:12px;align-items:center;}
.crate-rack{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-content:center;min-height:300px;border:2px dashed #638a87;border-radius:9px;padding:8px;}
.crate-tray-slot{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-height:92px;}.crate-tray-slot small{font-size:11px;text-align:center;}
.crate-frame {position:relative;aspect-ratio:1.07;min-width:0;}.crate-frame-art{position:absolute;inset:0;}.crate-frame-art img{width:100%;height:100%;object-fit:fill;}
.crate-grid{position:absolute;left:16%;top:24.8%;width:68.4%;height:48.8%;display:grid;grid-template-columns:repeat(6,1fr);grid-template-rows:repeat(4,1fr);touch-action:none;}
.crate-grid-cell{min-width:0;padding:0;border:1px solid #8a9f9560;background:#10262a91;border-radius:0;outline-offset:-3px;}.crate-grid-cell.is-preview{background:#78d7b6a0;}.crate-grid-cell.is-invalid{background:#e2836ca0;}
.crate-piece{position:relative;flex:none;padding:0;border:0;background:transparent;pointer-events:none;touch-action:none;cursor:grab;outline-offset:2px;}
.crate-part-cell{position:absolute;pointer-events:auto;display:block;}.crate-part-cell picture,.crate-part-cell img{width:100%;height:100%;display:block;user-select:none;}.crate-piece.is-selected .crate-part-cell {filter:drop-shadow(0 0 3px #defddd);}.crate-piece:disabled{cursor:default;}
.crate-placed-parts{position:absolute;inset:0;pointer-events:none;}.crate-placed-parts .crate-piece{position:absolute;}.crate-drag-ghost{position:fixed;z-index:10000;opacity:.87;pointer-events:none;filter:drop-shadow(0 8px 8px #0009);}.crate-drag-ghost *{pointer-events:none;}
.crate-controls{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;}.crate-action{min-height:38px;padding:6px 12px;background:#335458;border:1px solid #91b8ac;color:#eee8d7;border-radius:5px;font:inherit;font-size:14px;cursor:pointer;}.crate-action:disabled{opacity:.5;cursor:default;}.crate-status{min-height:40px;margin:12px 0 0;font-size:14px;line-height:1.5;}.crate-status.is-complete{color:#a9ecc7;font-weight:bold;}.crate-hint{font-size:13px;color:#edce92;}
@media(max-width:700px){.crate-overlay{padding:8px;}.crate-panel{padding:10px;}.crate-header h2{font-size:20px;}.crate-layout{grid-template-columns:1fr;gap:0;}.crate-rack{grid-template-columns:repeat(3,1fr);min-height:0;gap:5px;padding:5px;}.crate-tray-slot{min-height:75px;gap:4px;}.crate-frame{width:min(440px,100%);justify-self:center;}.crate-guide{font-size:12px;}.crate-controls{gap:5px;}.crate-action{font-size:12px;padding:5px 8px;}.easy-symbol{width:32px;height:34px;font-size:25px;}.easy-symbol-short{width:22px}.easy-symbol-long{width:54px;font-size:19px}.easy-symbol-small{font-size:16px}.easy-symbol-medium{font-size:26px}.easy-symbol-large{font-size:34px}.easy-pattern-sequence{gap:3px}.easy-count-item{width:34px;height:34px;font-size:20px}.easy-match-parts button,.easy-match-mounts button{padding:4px;font-size:11px}}

@media(max-width:420px){.easy-pattern-sequence .easy-symbol{width:28px;font-size:23px;flex-shrink:0}.easy-pattern-sequence .easy-symbol-short{width:20px}.easy-pattern-sequence .easy-symbol-long{width:48px;font-size:17px}.easy-pattern-sequence .easy-missing-symbol{width:28px;flex-shrink:0}}

.easy-count-items.is-mount-rack{display:grid;width:fit-content;margin:8px auto;gap:8px}

/* The area lives beside the game title; scene headings remain available to assistive tech. */
.scene-heading-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.top-hud .scene-label { max-width: min(40vw, 400px); }
@media (max-width: 820px) {
  .top-hud .scene-label { display: block; max-width: min(24vw, 170px); font-size: .68rem; }
}
@media (max-width: 580px) {
  .top-hud { gap: .35rem; padding-left: max(.5rem, var(--safe-left)); padding-right: max(.5rem, var(--safe-right)); }
  .brand-lockup { gap: .35rem; }
  .brand-mark { display: none; }
  .top-hud .scene-label { max-width: 29vw; padding-left: .4rem; font-size: .6rem; letter-spacing: .02em; }
}
@media (max-height: 480px) {
  #game-shell:is([data-scene="workshop"], [data-scene="backyard"], [data-scene="beach"], [data-scene="mission"]) { grid-template-rows: auto minmax(0, 1fr); }
  #game-shell:is([data-scene="workshop"], [data-scene="backyard"], [data-scene="beach"], [data-scene="mission"]) > .top-hud { display: flex; min-height: 34px; padding-top: 0; }
}

/* A live channel breaks up the caller portrait before answering, then settles. */
#game-shell .mission-terminal .caller-portrait { isolation: isolate; }
#game-shell .mission-terminal .caller-portrait::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(3, 22, 24, .7) 0 2px, rgba(133, 243, 226, .32) 2px 3px, transparent 3px 7px),
    linear-gradient(105deg, transparent 0 40%, rgba(235, 255, 251, .48) 47% 49%, transparent 55%);
  mix-blend-mode: screen; opacity: .12; animation: portrait-interference 1.7s steps(3, end) infinite;
}
#game-shell .mission-terminal.is-ringing .caller-portrait::after { opacity: .78; animation-duration: .22s; }
#game-shell .mission-terminal.is-summary .caller-portrait::after { opacity: .17; animation-duration: 2.4s; }
#game-shell .mission-terminal.is-ringing .caller-portrait img {
  filter: saturate(.55) contrast(1.22) brightness(.76);
  animation: portrait-dropouts 1.25s steps(2, end) infinite;
}
#game-shell .mission-terminal.is-summary .caller-portrait img {
  animation: portrait-connected 6s steps(2, end) infinite;
}
@keyframes portrait-interference {
  0%, 100% { transform: translateY(-2%); }
  33% { transform: translateY(4%); }
  67% { transform: translateY(-5%); }
}
@keyframes portrait-dropouts {
  0%, 66%, 100% { transform: translateX(0); }
  68% { transform: translateX(-5px); }
  72% { transform: translateX(4px); }
  77% { transform: translateX(0); }
}
@keyframes portrait-connected {
  0%, 95%, 100% { transform: translateX(0); }
  96% { transform: translateX(2px); }
}

/* Workshop wash bay uses the approved top-down ship painting. */
.ship-wash-overlay { position: absolute; inset: 0; z-index: 220; display: grid; place-items: center; padding: 12px; }
.ship-wash-overlay[hidden] { display: none; }
.ship-wash-backdrop { position: absolute; inset: 0; border: 0; background: rgba(3, 13, 17, .88); cursor: default; }
.ship-wash-panel { position: relative; display: grid; justify-items: center; gap: 8px; width: min(780px, 100%); max-height: 100%; overflow: auto; padding: 16px; border: 2px solid #75c9c4; border-radius: 14px; background: #102a30; color: var(--cream); box-shadow: 0 20px 60px #000b; }
.ship-wash-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; }
.ship-wash-header h2 { margin: 0; font-size: clamp(1.1rem, 2.5vw, 1.6rem); }
.ship-wash-guide { margin: 0; width: 100%; color: var(--muted); font-size: .9rem; line-height: 1.4; }
.ship-wash-canvas { display: block; width: min(100%, 680px, 68dvh); height: auto; aspect-ratio: 680 / 600; border: 2px solid rgba(139, 225, 217, .52); border-radius: 8px; background: #102932; touch-action: none; cursor: crosshair; }
.ship-wash-canvas:focus-visible { outline: 3px solid #ffd383; outline-offset: 2px; }
.ship-wash-gauges { display: grid; grid-template-columns: auto minmax(80px, 1fr) auto minmax(80px, 1fr); align-items: center; gap: 8px 12px; width: 100%; font-size: .8rem; }
.ship-wash-gauges progress { width: 100%; height: 13px; accent-color: #73e5d9; }
.ship-wash-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 38px; }
.ship-wash-footer p { margin: 0; font-size: .85rem; line-height: 1.35; }
.ship-wash-button { min-height: 38px; padding: 6px 12px; border: 1px solid #98ccc4; border-radius: 5px; background: #34545b; color: var(--cream); font: inherit; font-size: .83rem; cursor: pointer; white-space: nowrap; }
.ship-wash-button:hover { background: #42666c; }
.ship-wash-button[hidden] { display: none; }
@media (max-width: 580px) {
  .ship-wash-overlay { padding: 6px; }
  .ship-wash-panel { padding: 9px; gap: 5px; }
  .ship-wash-guide { font-size: .76rem; }
  .ship-wash-canvas { width: min(100%, 59dvh); }
  .ship-wash-gauges { grid-template-columns: auto 1fr; gap: 3px 8px; font-size: .72rem; }
  .ship-wash-footer p { font-size: .76rem; }
  .ship-wash-button { min-height: 34px; padding: 4px 8px; font-size: .75rem; }
}

/* Puzzle instruments: the parts and readouts carry the instructions. */
#game-shell :is(.concept-board, .supply-math-puzzle, .pressure-puzzle, .packing-puzzle) {
  width: 100%; box-sizing: border-box; padding: clamp(9px, 1.4vw, 16px); gap: 9px;
  border: 2px solid #709a93; border-radius: 12px;
  background: radial-gradient(circle at 50% 0, #255053 0, #123239 47%, #0b242e 100%);
  box-shadow: inset 0 0 0 3px #0b2229, inset 0 0 22px #060f1b, 0 8px 20px #0008;
}
#game-shell :is(.concept-board, .supply-math-puzzle, .pressure-puzzle, .packing-puzzle) button { touch-action: manipulation; }
#game-shell :is(.concept-board, .supply-math-puzzle, .pressure-puzzle, .packing-puzzle) :is(button, output):focus-visible { outline: 3px solid #ffe6a4; outline-offset: 2px; }
.concept-machine-header, .math-machine-header {
  display: flex; align-items: center; gap: 10px; min-height: 32px; padding: 5px 10px;
  border: 1px solid #608a83; border-radius: 6px; background: linear-gradient(#26494b, #102d34);
}
.concept-power-light, .math-status-lamp { flex: none; width: 11px; height: 11px; border-radius: 50%; border: 2px solid #143b38; background: #a9f3ae; box-shadow: 0 0 10px #75e5b2; }
.concept-board-heading, .math-guide { flex: 1; min-width: 0; font-size: .9rem; letter-spacing: .04em; line-height: 1.25; }
.concept-machine-index { color: #a4cec6; font: 800 .78rem ui-monospace, monospace; }
.concept-board-instruction { padding-inline: 4px; color: #c5ded5; font-size: .85rem; line-height: 1.35; }
.concept-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(155px, 100%), 1fr)); gap: 6px; }
.concept-fact { display: grid; grid-template-columns: 7px minmax(0,1fr); gap: 2px 7px; align-items: center; min-width: 0; padding: 7px 9px; border-color: #4d7879; background: #0b252d; box-shadow: inset 0 2px 5px #071820; }
.concept-fact-led { grid-row: 1 / 3; width: 6px; height: 15px; border-radius: 4px; background: #8acdb9; box-shadow: 0 0 7px #68c8b8; }
.concept-fact-label { color: #95beb6; font: 800 .65rem system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.concept-fact-value { overflow-wrap: anywhere; color: #ffe4ab; font: 800 .95rem ui-monospace, monospace; line-height: 1.25; }
.concept-coordinate-area, .concept-cargo, .concept-tiling, .concept-score { padding: 10px; border-color: #729e95; background: linear-gradient(155deg,#153a40,#0a252e); }
.concept-coordinate-area > strong, .concept-cargo > strong, .concept-tiling > strong, .concept-score > strong { color: #ffe2a4; font-size: .78rem; letter-spacing: .06em; }
.concept-plot { display: grid; grid-template-columns: 24px minmax(0, 1fr); grid-template-rows: minmax(0, auto) 18px; gap: 3px 6px; width: min(100%, 480px); margin-inline: auto; position: relative; padding: 0 0 15px; }
.concept-coordinate-grid { grid-column: 2; grid-row: 1; max-width: none; gap: 2px; border: 3px solid #739a8b; background: #63877d; }
.concept-coordinate-grid .concept-grid-point { position: relative; min-height: clamp(30px, 5vw, 48px); border: 0; border-radius: 0; background: #15383d; }
.concept-coordinate-grid .concept-grid-point::after { content: ""; position: absolute; width: 7px; height: 7px; top: 50%; left: 50%; transform: translate(-50%,-50%); border-radius: 50%; background: #80c7bd; box-shadow: 0 0 4px #65d4c6; }
.concept-coordinate-grid .concept-grid-point.is-selected { background: #b66e40; box-shadow: inset 0 0 0 3px #ffdc8c; }
.concept-coordinate-grid .concept-grid-point.is-selected::after { width: 15px; height: 15px; background: #fff5b8; box-shadow: 0 0 14px #ffecac; }
.concept-x-ticks { grid-column: 2; grid-row: 2; display: grid; grid-template-columns: repeat(var(--concept-cols),1fr); text-align: center; color: #dbdfc4; font: 700 .72rem ui-monospace, monospace; }
.concept-y-ticks { grid-column: 1; grid-row: 1; display: grid; grid-template-rows: repeat(var(--concept-rows),1fr); place-items: center; color: #dbdfc4; font: 700 .72rem ui-monospace, monospace; }
.concept-axis-x, .concept-axis-y { position: absolute; color: #a5dacf; font: 800 .65rem ui-monospace, monospace; }
.concept-axis-x { bottom: 0; right: 0; }.concept-axis-y { top: -10px; left: -20px; }
.concept-cargo-row { display: grid; grid-template-columns: 80px minmax(0,1fr); gap: 6px; padding: 4px; border-radius: 6px; background: #0b252d; }
.concept-cargo-row span { min-width: 0; }
.concept-cargo-block { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 5px; padding: 5px; border: 2px solid #c99d66; border-radius: 5px; color: #fff0ca; background: repeating-linear-gradient(90deg,#765539 0 14px,#906643 14px 18px); }
.concept-cargo-block b { font-size: .7rem; }.concept-cargo-block strong { font-size: 1.25rem; text-align: center; }
.concept-pod-choices { display: grid; grid-template-columns: repeat(var(--concept-pods, 3), minmax(0,1fr)); gap: 5px; }
.concept-pod-choices .concept-button { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px; padding: 5px; min-width: 0; text-align: left; }
.concept-pod-choices .concept-button > span:nth-child(2) { overflow-wrap: anywhere; font-size: .72rem; }
.concept-pod-symbol { font-size: 1.1rem; color: #8ce1d5; }.concept-pod-choices strong { color: #ffe3a4; }
.concept-piece-list .concept-button { display: flex; align-items: center; gap: 6px; min-height: 42px; }
.concept-piece-swatch { width: calc(var(--piece-width) * 8px); height: calc(var(--piece-height) * 8px); border: 2px solid #ffdeaa; border-radius: 2px; background: repeating-linear-gradient(90deg,#658d82 0 7px,#375b58 7px 9px); }
.concept-tile-grid { max-width: none; width: min(100%, 440px); margin-inline: auto; gap: 3px; padding: 4px; border: 3px solid #678f86; background: #0b2028; }
.concept-tile-grid .concept-button { aspect-ratio: 1.15; min-height: 34px; border-radius: 2px; font-size: 1rem; font-weight: 900; }
.concept-tile-grid [data-panel="empty"] { background: #21434a; border-style: dashed; }
.concept-score-slots { grid-template-columns: repeat(8,minmax(0,1fr)); }
.concept-score-slots .concept-button { display: grid; place-items: center; gap: 1px; min-height: 64px; padding: 3px; border-bottom-width: 5px; }
.concept-score-slots small { font: 800 .64rem ui-monospace,monospace; opacity: .8; }.concept-score-slots .concept-instrument-icon { font-size: 1.5rem; line-height: 1; }.concept-score-slots span { font-size: .55rem; letter-spacing: .02em; }
.concept-answers { grid-template-columns: repeat(auto-fit, minmax(min(265px,100%),1fr)); gap: 6px; }
.concept-answer-row { display: grid; grid-template-columns: minmax(0,1fr) 40px minmax(45px,auto) 40px; gap: 4px; padding: 7px; border-color: #527f79; background: #0d2931; }
.concept-answer-row label { min-width: 0; flex: auto; font-size: .78rem; }.concept-answer-row .concept-button { min-height: 38px; padding: 3px; font-size: 1.15rem; }
.concept-answer-value { min-height: 38px; border: 1px solid #788e7d; border-radius: 4px; background: #091e28; font: 800 1.1rem ui-monospace,monospace; }
.concept-options { grid-column: 2 / -1; display: grid; grid-template-columns: repeat(auto-fit,minmax(58px,1fr)); width: 100%; }
.concept-options .concept-button { font-size: .8rem; }
.concept-actions { padding-top: 7px; }.concept-actions .concept-button { min-width: 72px; min-height: 40px; }

.supply-math-puzzle .math-object-groups, .easy-repair-puzzle .math-object-groups { grid-template-columns: repeat(auto-fit,minmax(min(175px,100%),1fr)); }
.math-object-group { min-height: 54px; border-color: #719a89; background: #102c32; box-shadow: inset 0 2px 8px #061a22; }
.math-object-group > strong { color: #ffe2a4; font-size: .76rem; letter-spacing: .03em; }
.math-items { min-height: 27px; gap: 4px; }
.math-item { width: 24px; height: 24px; border: 1px solid #70a79d; border-radius: 3px; background: #335b59; color: #d7f2de; font-size: 17px; }
.math-item[data-object="battery"] { background: linear-gradient(90deg,#9ac1bd 0 15%,#e8b963 15% 82%,#76694a 82%); color: #33423f; }
.math-item[data-object="seed"] { border-radius: 50% 50% 5px 5px; background: #598c62; color: #e4f5cb; }
.math-item[data-object="cup"] { border-radius: 3px 3px 10px 10px; background: #e0cba8; color: #7a4b2f; }
.math-quantity { min-height: 44px; padding: 5px 7px; border: 1px solid #527c76; border-radius: 7px; background: #102b32; }
.math-quantity-label { color: #d3e8d6; font-weight: 700; }.math-value { display: grid; place-items: center; min-height: 36px; border: 1px solid #638a80; border-radius: 4px; background: #071c27; color: #ffe0a0; font: 800 1.2rem ui-monospace,monospace; }
.math-action { background: linear-gradient(#315953,#1b393e); border-color: #77a299; box-shadow: inset 0 1px #ffffff25, 0 2px #071e26; }
.math-action:active { transform: translateY(2px); box-shadow: inset 0 1px 4px #071e26; }
.math-selectable-groups .math-action { display: grid; justify-items: center; gap: 5px; min-width: 0; }
.math-group-actions .math-action { flex: 1 1 90px; }.math-tabs .math-action { min-width: 0; }
.math-panel-plan, .math-number-rail { max-width: none; width: 100%; padding: 6px; border: 2px solid #759c8f; border-radius: 6px; background: #0e252b; }
.math-panel-slot { height: 35px; font-size: 1.2rem; background: #173c40; }
.math-number-rail { position: relative; }
.math-number-rail::before { content: ""; position: absolute; left: 4%; right: 4%; top: 50%; height: 5px; background: #9da990; pointer-events: none; }
.math-rail-mark { position: relative; z-index: 1; background: #1c3d40; font-weight: 800; }
.math-balance { position: relative; align-items: start; gap: 12px; padding: 16px 6px 0; border-top: 0; }
.math-balance::before { content: ""; position: absolute; top: 11px; left: 6%; right: 6%; height: 6px; border-radius: 4px; background: #c1ad7e; transform: rotate(var(--beam-angle,0deg)); }
.math-balance[data-balance="left"] { --beam-angle:-3deg; }.math-balance[data-balance="right"] { --beam-angle:3deg; }
.math-balance-tray { z-index: 1; display: grid; place-items: center; gap: 2px; min-height: 64px; border-radius: 0 0 12px 12px; background: #1b3c40; }
.math-balance-tray strong { font: 900 1.4rem ui-monospace,monospace; color: #ffdf9c; }.math-balance-tray small { font-size: .65rem; }.math-balance-blocks { color: #bfcfae; font-size: .7rem; }
.math-balance-pivot { position: absolute; top: 5px; left: 50%; z-index: 2; transform: translateX(-50%); color: #e1c58d; }
.math-paint-chip { flex: 1 1 54px; min-height: 36px; }
.math-paint-chip::before { content: ""; display: block; width: min(100%,70px); height: 22px; margin: auto; border: 2px solid #e5d8b5; border-radius: 3px; background: #eee0b9; }
.math-paint-chip[data-color="blue"]::before { background: repeating-linear-gradient(135deg,#35657d 0 6px,#447994 6px 10px); }
.math-paint-chip[data-color="gold"]::before { background: radial-gradient(#71522e 1px,transparent 2px) 0 0 / 8px 8px,#d9b970; }
.math-mosaic { width: min(100%,420px); height: clamp(130px,22vw,195px); margin-inline: auto; }
.math-color-readout { text-align: center; white-space: pre-wrap; font: 800 .85rem ui-monospace,monospace; }
.math-box { display: grid; place-items: center; width: 34px; height: 34px; border: 2px dashed #8aa79e; border-radius: 5px; background: #193b3b; color: #e2c388; font-size: 22px; }
.math-box.is-filled { border-style: solid; background: #5e846e; }

.easy-repair-puzzle .math-guide { line-height: 1.25; }.easy-count-items { padding: 7px; border: 2px solid #638d84; border-radius: 7px; background: #0b252d; }
.easy-count-item { box-shadow: inset 0 0 0 3px #c4b493, 0 3px #071c22; }.easy-count-item.is-empty { box-shadow: inset 0 0 0 2px #284a48; }
.easy-answer-choices { padding: 8px; border: 1px solid #527c76; border-radius: 7px; background: #0b252d; }
.easy-answer-choices button { flex: 1 1 42px; max-width: 110px; }.easy-answer-status { color: #a9d5c6; }
.easy-match-parts, .easy-match-mounts { padding: 7px; border: 1px solid #5b877e; border-radius: 7px; background: #0b252d; }
.easy-match-down { margin: -3px 0; color: #91e4c7; font-size: 1.3rem; }
.easy-pattern-sequence { min-height: 48px; border: 2px solid #719b8c; background: #0b252d; }
.easy-airflow { min-height: 82px; border: 4px solid #719b8c; background: linear-gradient(90deg,#243e42,#c7d4ba,#26474c); color: #fff0c5; }

.pressure-gauges { gap: 6px; }.pressure-gauge { background: #0b252d; border-color: #69918a; }.pressure-endpoints { color: #ffe0a4; font: 800 .78rem ui-monospace,monospace; }
.pressure-howto { padding: 5px 8px; border-radius: 5px; background: #1d4244; color: #a5e4ce; font: 800 .72rem system-ui,sans-serif; letter-spacing: .06em; }
.pressure-objective { margin: 0; color: #ffe0a4; font: 800 .875rem/1.5 system-ui,sans-serif; }
.pressure-howto { font: 500 .875rem/1.5 system-ui,sans-serif; letter-spacing: normal; }
.pressure-help { color: #d4e7dd; font: 500 .875rem/1.5 system-ui,sans-serif; }
.pressure-help summary { min-height: 44px; padding: 10px 0; cursor: pointer; color: #a5e4ce; }
.pressure-help p { margin: 0 0 6px; }
.pressure-slots { gap: 5px; }.pressure-slot { align-items: center; gap: 4px; padding: 7px 5px; border-width: 2px; background: #0e2930; text-align: center; }
.pressure-beat { align-self: start; font: 800 .67rem ui-monospace,monospace; }.pressure-valve-symbol { display: grid; place-items: center; width: 38px; height: 38px; border: 2px solid #84aca3; border-radius: 50%; background: #254448; color: #ffe2a7; font-size: 1.4rem; }
.pressure-slot[aria-pressed="true"] .pressure-valve-symbol { box-shadow: 0 0 13px #f2cc8d; border-color: #ffe0a1; }
.pressure-step-levels { width: 100%; }.pressure-level-track { height: 11px; }.pressure-instruction { font-size: .72rem; }
.pressure-step-goal { min-height: 1.7em; font-size: .72rem; }.pressure-action { grid-template-columns: 36px 1fr; align-items: center; text-align: left; background: #1a3c40; }
.pressure-action-icon { grid-row: 1 / 3; display: grid; place-items: center; width: 32px; height: 32px; border: 2px solid #9bcabb; border-radius: 50%; color: #ffdf9d; font-size: 1.25rem; }
.pressure-action-effect { font: 800 .7rem ui-monospace,monospace; }.pressure-preview-guide { font-size: .7rem; letter-spacing: .02em; }
.pressure-controls .button { min-height: 40px; }

.packing-howto { padding: 6px 9px; border: 1px solid #668e80; border-radius: 5px; background: #1b4041; color: #fbe3ad; font-weight: 800; font-size: .8rem; letter-spacing: .06em; }
.packing-selection { font: 800 .76rem ui-monospace,monospace; }
.packing-rack { background: #0e2930; border-width: 2px; }.packing-bags { align-items: stretch; }.packing-bag { background: #17363a; border-color: #6f9185; }
.packing-bag-select { width: 100%; }.packing-bag-select > strong { font-size: 1rem; color: #ffe0a4; }
.packing-target { color: #b5d8c9; }.packing-total, .packing-count { font: 800 .78rem ui-monospace,monospace; }
.packing-sockets { display: flex; justify-content: center; gap: 5px; margin: 4px 0; }
.packing-sockets i { width: 18px; height: 13px; border: 2px solid #8bc4ae; border-radius: 3px; background: #0c242b; }
.packing-sockets i.is-filled { background: #96e3b4; box-shadow: 0 0 8px #7beab2; }
.packing-parcel { box-shadow: inset 0 0 0 2px #bd9864, 0 3px #071d23; }
.packing-parcel.is-selected { transform: translateY(-3px); box-shadow: 0 5px 12px #0009, inset 0 0 0 2px #ffe3a4; }
.packing-rule { font-size: .76rem; color: #a8ccc1; }

#game-shell .signal-puzzle { grid-template-areas: "status board" "gesture board" "labels board" "actions board"; padding: 10px; border: 2px solid #648f85; border-radius: 10px; background: linear-gradient(145deg,#1c4042,#0b262e); }
#game-shell .signal-route-status { padding: 8px; border: 1px solid #789887; border-radius: 5px; background: #0c252c; color: #ffce85; font: 800 .8rem ui-monospace,monospace; }
#game-shell .signal-route-status[data-connected="true"] { color: #aaf1bb; box-shadow: inset 0 0 13px #4acc8a55; }
.signal-gesture { grid-area: gesture; color: #9dd7c6; font: 800 .72rem system-ui,sans-serif; letter-spacing: .03em; }
#game-shell .signal-board { border-width: 5px; border-color: #71988b; background: #0c262c; box-shadow: inset 0 0 12px #020e15, 0 4px #061820; }
#game-shell .signal-tile { border-color: #507f73; background: radial-gradient(circle,#345f58,#1b3739); }
#game-shell .signal-tile.is-lit { color: #ffe3a3; box-shadow: inset 0 0 13px #dfa667, 0 0 8px #ffa95288; }
#game-shell .signal-tile.is-receiver.is-lit { box-shadow: inset 0 0 14px #74e5dc, 0 0 13px #72e5dc; }

.tea-brew-board { gap: 8px; padding: 12px; border-width: 2px; box-shadow: inset 0 0 0 3px #0a2028; }
.tea-machine { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 94px; padding: 10px; border: 2px solid #719a8b; border-radius: 8px; background: radial-gradient(circle at 50% 20%,#2c5551,#0d292e); }
.tea-kettle { position: relative; width: 115px; height: 75px; flex: none; }.tea-kettle-body { position: absolute; left: 23px; bottom: 4px; width: 66px; height: 54px; border: 3px solid #d5b77e; border-radius: 25px 25px 15px 15px; background: linear-gradient(120deg,#6b9b93,#2c5b63); box-shadow: inset -9px -7px #14373e; }
.tea-kettle-body i { position: absolute; left: 16px; top: -10px; width: 30px; height: 6px; border-radius: 5px; background: #d9bc85; }.tea-kettle-handle { position: absolute; left: 32px; top: -3px; width: 48px; height: 28px; border: 6px solid #d5b77e; border-radius: 25px 25px 0 0; }.tea-kettle-spout { position: absolute; right: 0; top: 29px; width: 26px; height: 12px; border: 3px solid #d5b77e; border-left: 0; transform: skewY(-20deg); }
.tea-pour-tube { color: #9ee8cf; font-size: 1.8rem; }.tea-cup { display: grid; place-items: center; width: 68px; height: 53px; border: 4px solid #ecd5ac; border-radius: 4px 4px 25px 25px; background: #254347; color: #ffe1a5; font-size: 1.5rem; box-shadow: 12px 0 0 -3px #254347, 15px 0 0 -3px #ecd5ac; }
.tea-cup[data-leaves="orange"] { background: #a56434; }.tea-cup[data-leaves="mint"] { background: #377a62; }.tea-cup[data-leaves="berry"] { background: #7d4d6b; }.tea-cup.is-ready { box-shadow: 0 0 18px #ffe4a3, 12px 0 0 -3px #254347, 15px 0 0 -3px #ecd5ac; }
.tea-timer { display: flex; gap: 4px; margin-left: auto; }.tea-timer span { width: 12px; height: 24px; border: 2px solid #7eaa9c; border-radius: 3px; background: #10272d; }.tea-timer span.is-lit { background: #ffcd82; box-shadow: 0 0 9px #ffc16b; }
.tea-brew-readout { grid-template-columns: minmax(0,1fr) auto auto; padding: 7px; border: 1px solid #587f7b; border-radius: 5px; background: #0b252b; }.tea-brew-gauge { height: 19px; }
.tea-process { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; }.tea-process-step { display: flex; align-items: center; justify-content: center; gap: 3px; min-width: 0; padding: 6px 3px; border: 1px solid #638d83; border-radius: 5px; color: #c7dbce; background: #17363a; font-size: 1.1rem; }.tea-process-step small { font: 800 .6rem system-ui,sans-serif; }.tea-process-step.is-done { border-color: #a5e6b2; background: #386349; color: #fff0c3; }
.tea-brew-controls { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }.tea-brew-button { min-height: 44px; padding: 5px; font-size: .72rem; box-shadow: inset 0 1px #ffffff33, 0 3px #071b20; }.tea-brew-button:active { transform: translateY(2px); box-shadow: inset 0 2px 5px #071b20; }
.crate-guide, .ship-wash-guide { padding: 7px 10px; border: 1px solid #67978b; border-radius: 6px; background: #11333a; color: #ffdea4; font-weight: 800; letter-spacing: .04em; }
.crate-rack { background: #0c2831; box-shadow: inset 0 0 12px #061820; }.crate-tray-slot { border: 1px solid #507a78; border-radius: 5px; background: #1b3d42; }
.ship-wash-gauges { padding: 6px; border: 1px solid #608e86; border-radius: 6px; background: #0a252d; }
#game-shell .relay-echo-board { width: 100%; max-width: none; box-sizing: border-box; }
#game-shell .relay-echo-key { border-bottom-width: 5px; }
.backyard-sequence { border: 2px solid #6da78e; border-radius: 8px; background: #102d32; }
.backyard-sequence > span { display: grid; justify-items: center; gap: 2px; min-width: 0; padding: 6px; border: 2px solid #688d7e; border-radius: 5px; background: #224447; }
.backyard-sequence b { font-size: 1.6rem; }.backyard-sequence small { font-size: .7rem; }.backyard-sequence > span.is-entered { border-color: #b6edab; background: #477457; box-shadow: 0 0 10px #87e9b9; }
#fishing-reel-control { border: 2px solid #8ac8b0; box-shadow: inset 0 2px #ffffff33, 0 4px #092c31; }

@media (max-width: 700px) {
  .concept-facts { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .concept-fact-value { font-size: .8rem; }
  .concept-score-slots { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .concept-score-slots .concept-button { min-height: 46px; }
  .concept-answer-row { grid-template-columns: minmax(0,1fr) 35px minmax(42px,auto) 35px; }
  .concept-cargo-row { grid-template-columns: 58px minmax(0,1fr); }
  .concept-cargo-row span { width: auto; }
  .concept-cargo-block { grid-template-columns: 1fr; gap: 0; }
  .concept-pod-choices .concept-button { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 1px; }
  .concept-pod-symbol { display: none; }
  .math-selectable-groups { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #game-shell .signal-puzzle { grid-template-columns: 1fr; grid-template-areas: "status" "gesture" "labels" "board" "actions"; }
  .tea-machine { gap: 5px; }.tea-timer { margin-left: 2px; }
}
@media (max-width: 480px) {
  #game-shell :is(.concept-board,.supply-math-puzzle,.pressure-puzzle,.packing-puzzle) { padding: 7px; gap: 6px; }
  .concept-facts { gap: 4px; }.concept-fact { padding: 5px; }.concept-board-instruction { font-size: .75rem; }
  .concept-coordinate-grid .concept-grid-point { min-height: 27px; }
  .concept-cargo-row { grid-template-columns: 48px minmax(0,1fr); padding: 3px; }
  .concept-pod-choices .concept-button { min-height: 35px; padding: 2px; font-size: .7rem; }
  .concept-score-slots span { display: none; }
  .pressure-slot { padding: 4px 2px; }.pressure-valve-symbol { width: 28px; height: 28px; font-size: 1rem; }.pressure-beat,.pressure-step-goal { font-size: .61rem; }
  .pressure-gauges { flex-wrap: wrap; }.pressure-gauge { min-width: 42%; }
  .tea-kettle { transform: scale(.8); margin: -6px -12px; }.tea-cup { width: 48px; height: 42px; }.tea-process-step small { font-size: .52rem; }
  .tea-brew-controls { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ship-wash-guide, .crate-guide { font-size: .7rem; }
}

/* v167: visible, cancellable waits only when a selected location is not ready. */
.asset-loading-dialog { max-width: min(440px, calc(100% - 32px)); padding: 26px; border: 3px solid #427767; border-radius: 12px; color: #e8f3dd; background: #153b38; box-shadow: 0 12px 36px #0009; }
.asset-loading-dialog::backdrop { background: #061614b8; }
.asset-loading-dialog h2 { font-size: 1.3rem; margin: 0 0 14px; }
.asset-loading-dialog p { min-height: 2.8em; line-height: 1.5; }
.asset-loading-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.asset-loading-actions button { min-width: 115px; min-height: 48px; }

/* Inline vector fallback; loading-dial.css adds the generated instrument skin. */
.asset-loading-dialog, .graphics-loading-dialog { text-align: center; background: #153b38; }
.asset-loading-dialog { margin: auto; }
.asset-loading-dialog h2, .graphics-loading-dialog h2 { margin: 14px 0 8px; font-size: 1.2rem; }
.asset-loading-actions { justify-content: center; }
.loading-timer { display: block; width: 48px; height: 48px; margin: 0 auto; color: #c2e2be; }
.loading-timer svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.loading-timer-hand { transform-origin: 24px 25px; animation: loading-clock-turn 1.6s linear infinite; }
@keyframes loading-clock-turn { to { transform: rotate(360deg); } }
.graphics-loading-dialog { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; box-sizing: border-box; margin: 0; border: 0; border-radius: 0; padding: 24px; color: #e8f3dd; background: #102a29f5; }
.graphics-loading-dialog[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.graphics-loading-dialog p { max-width: 32ch; margin: 10px 0; line-height: 1.5; }
.graphics-loading-dialog p:empty { display: none; }
.graphics-loading-dialog button { margin-top: 12px; min-height: 48px; }
.graphics-loading-dialog::backdrop { background: #102a29; }
.title-graphics-loading { position: absolute; z-index: 8; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; color: #f4f0df; font: 600 1.1rem/1.5 sans-serif; }
.title-graphics-loading > span:last-child { display: block; margin-top: 14px; }
@media (prefers-reduced-motion: reduce) { .loading-timer-hand { animation: none; } }
.is-reduced-motion .loading-timer-hand, .reduce-motion .loading-timer-hand { animation: none; }
