/*! Solar System Repair Co. | Source: https://orbitalforest.com */
/* Approved review v2: live text keeps the Objective bar's platform font.
   No extra artwork or font download; none of these credits accept input. */
.orbitalforest-watermark {
  display: block;
  flex: 0 0 auto;
  color: #f4f0df;
  font: 400 12px/1.25 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  letter-spacing: .04em;
  text-transform: none;
  white-space: nowrap;
  opacity: .7;
  pointer-events: none;
  user-select: none;
}

/* A single overlay covers all five intro frames and every shared launch card. */
.watermark-title, .watermark-launch {
  position: absolute;
  right: max(20px, env(safe-area-inset-right, 0px));
  bottom: max(20px, calc(env(safe-area-inset-bottom, 0px) + 12px));
  z-index: 4;
  font-size: 14px;
  opacity: .55;
  text-shadow: 0 1px 3px #000;
}
html:not([data-puzzle-lab="true"]) .title-loader {
  bottom: max(52px, calc(env(safe-area-inset-bottom, 0px) + 44px));
}
html:not([data-puzzle-lab="true"]) .launch-loading {
  bottom: max(48px, calc(env(safe-area-inset-bottom, 0px) + 40px));
}

/* Menu credits have their own short line, clear of every action and total. */
.watermark-terminal { grid-column: 1 / -1; justify-self: center; }
.watermark-report { margin-top: 12px; color: #18382f; text-align: center; }
.watermark-settings, .watermark-congratulations { margin-top: 12px; text-align: center; }
html:not([data-puzzle-lab="true"]) #game-shell .mission-computer-card { row-gap: 8px; }
html:not([data-puzzle-lab="true"]) #game-shell[data-scene="workshop"][data-ui-layout="portrait"] .mission-computer-card {
  grid-template-rows: auto minmax(0, 1fr) auto;
}
html:not([data-puzzle-lab="true"]) #game-shell[data-scene="workshop"][data-ui-layout="landscape"] .mission-computer-card {
  grid-template-rows: minmax(0, 1fr) auto;
}

/* The first footer item stays leftmost in every scene, including both flights.
   Objectives can shrink; the short domain never wraps or crowds a control. */
html:not([data-puzzle-lab="true"]) #game-shell[data-scene] > .bottom-hud {
  padding-inline-start: max(12px, var(--safe-left));
  column-gap: 12px;
}
.watermark-hud { order: -1; margin-inline-start: 8px; }
/* Restore the flight rail's painted end-cap clearance after the shared inset.
   Workshop and compact layouts keep their approved spacing. */
html:not([data-puzzle-lab="true"]) #game-shell:is([data-scene="flight"], [data-scene="return"])[data-ui-layout="desktop"] > .bottom-hud {
  padding-inline-start: max(calc(var(--flight-bottom-cap) + 8px), var(--safe-left));
}
html:not([data-puzzle-lab="true"]) #game-shell > .bottom-hud #objective-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 1100px) {
  html:not([data-puzzle-lab="true"]) #game-shell > .bottom-hud .desktop-only { display: none; }
}
html:not([data-puzzle-lab="true"]) #game-shell[data-scene][data-ui-layout]:not([data-ui-layout="desktop"]) > .bottom-hud {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  align-items: center;
  column-gap: 8px;
  row-gap: 2px;
  padding-inline-start: max(8px, var(--safe-left));
}
html:not([data-puzzle-lab="true"]) #game-shell[data-ui-layout]:not([data-ui-layout="desktop"]) > .bottom-hud > .watermark-hud {
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: center;
  font-size: 10px;
}
html:not([data-puzzle-lab="true"]) #game-shell[data-ui-layout]:not([data-ui-layout="desktop"]) > .bottom-hud > :not(.watermark-hud) {
  grid-column: 2;
}

/* Full-screen landscape puzzles keep a thin branded rail below their frame.
   Their existing container-based geometry fits the remaining height. */
html:not([data-puzzle-lab="true"]) #game-shell[data-ui-layout="landscape"]:has(#mission-dialogue-console.is-puzzle-mode:not([hidden])) {
  --watermark-rail-height: calc(22px + var(--safe-bottom));
}
html:not([data-puzzle-lab="true"]) #game-shell[data-ui-layout="landscape"]:has(#mission-dialogue-console.is-puzzle-mode:not([hidden])) > .bottom-hud {
  position: fixed;
  inset: auto 0 0;
  display: flex;
  height: var(--watermark-rail-height);
  min-height: 0;
  padding: 0 max(12px, var(--safe-right)) var(--safe-bottom) max(12px, var(--safe-left));
  border: 0;
  border-image: none;
  background: #081b20;
  box-shadow: inset 0 1px #f4e5c52e;
}
html:not([data-puzzle-lab="true"]) #game-shell[data-ui-layout="landscape"]:has(#mission-dialogue-console.is-puzzle-mode:not([hidden])) > .bottom-hud > :not(.watermark-hud) {
  display: none;
}
html:not([data-puzzle-lab="true"]) #game-shell[data-ui-layout="landscape"] #mission-dialogue-console.is-puzzle-mode {
  height: calc(100dvh - 8px - var(--safe-top) - var(--watermark-rail-height, 22px));
  top: calc((100dvh - var(--watermark-rail-height, 22px) + var(--safe-top)) / 2);
}
@media (max-width: 480px), (max-height: 480px) {
  .watermark-title, .watermark-launch { font-size: 12px; right: max(12px, env(safe-area-inset-right, 0px)); bottom: max(12px, calc(env(safe-area-inset-bottom, 0px) + 8px)); }
  html:not([data-puzzle-lab="true"]) .title-loader { bottom: max(40px, calc(env(safe-area-inset-bottom, 0px) + 32px)); }
  html:not([data-puzzle-lab="true"]) .launch-loading { bottom: max(40px, calc(env(safe-area-inset-bottom, 0px) + 32px)); }
}

/* Set synchronously in the head, before the iframe can paint its intro. */
html[data-puzzle-lab="true"] .orbitalforest-watermark { display: none !important; }
