/*! Solar System Repair Co. | Source: https://orbitalforest.com */
/* Distinct painted hardware families. Live information remains HTML.
   Padding-box fills and alpha-shaped shadows keep the art's clear edges clear;
   backdrop blur would otherwise paint a rectangular patch through those edges. */
:root {
  --mission-terminal-frame: url("assets/mission-terminal-frame-v1.webp");
  --dialogue-plastic-frame: url("assets/dialogue-plastic-frame-v1.webp");
  --repair-instrument-frame: url("assets/repair-instrument-frame-v1.webp");
  --flight-avionics-frame: url("assets/flight-avionics-frame-v1.webp");
  --field-kit-frame: url("assets/field-kit-frame-v1.webp");
  --dialogue-soft-key: url("assets/dialogue-soft-key-v1.webp");
  --repair-amber-key: url("assets/repair-amber-key-v1.webp");
}

/* The computer is a single thick console, with two regions on its glass. */
#game-shell[data-scene="workshop"] .mission-computer-card {
  width: min(1240px, calc(100% - 20px));
  height: min(660px, calc(100% - 20px));
  border: 40px solid transparent;
  border-image: var(--mission-terminal-frame) 125 125 / 40px stretch;
  padding: 2px;
  gap: 0;
  background: #061b23;
  background-clip: padding-box;
  box-shadow: none;
  filter: drop-shadow(0 12px 30px #000c);
}
#game-shell[data-scene="workshop"] .mission-computer-card .mission-board {
  border-right: 1px solid #467075;
  background: linear-gradient(150deg, #12373d, #071e28 56%, #071923);
}
#game-shell[data-scene="workshop"] .mission-computer-card .mission-terminal {
  overflow: hidden;
  background: linear-gradient(150deg, #12363d, #061d29 56%, #071923);
}
#game-shell[data-scene="workshop"] .mission-computer-card .call-copy.dialogue-panel {
  display: grid;
  grid-template-columns: 106px minmax(0, 1fr);
  align-items: start;
  gap: 9px 16px;
  padding: 12px 17px;
}
#game-shell[data-scene="workshop"] .mission-computer-card .call-copy .dialogue-portrait {
  grid-column: 1;
  grid-row: 1;
  width: 106px;
  height: 106px;
  margin: 0;
}
#game-shell[data-scene="workshop"] .mission-computer-card .call-copy .dialogue-content {
  display: flex;
  flex-direction: column;
  grid-column: 2;
  grid-row: 1;
  align-items: stretch;
  gap: 7px;
  min-width: 0;
  padding: 0;
  margin: 0;
}
#game-shell[data-scene="workshop"] .mission-computer-card .call-copy .dialogue-content > * {
  min-width: 0;
  margin: 0;
}
#game-shell[data-scene="workshop"] .mission-computer-card .call-copy h1 {
  font-size: clamp(1.2rem, 1.8vw, 1.55rem);
  line-height: 1.12;
}
#game-shell[data-scene="workshop"] .mission-computer-card .call-copy .call-line {
  padding: 8px 10px;
  font-size: .9rem;
  line-height: 1.35;
}
#game-shell[data-scene="workshop"] .mission-computer-card .call-copy .mission-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  width: 100%;
  padding: 0;
}
#game-shell[data-scene="workshop"] .mission-computer-card .call-copy .mission-facts[hidden],
#game-shell[data-scene="workshop"] .mission-computer-card .call-copy .terminal-actions[hidden] { display: none; }
#game-shell[data-scene="workshop"] .mission-computer-card .mission-facts div {
  border: 1px solid #3c6669;
  background: #102d34;
  padding: 6px 8px;
}
#game-shell[data-scene="workshop"] .mission-computer-card .mission-facts dd {
  font-size: .76rem;
  line-height: 1.25;
}
#game-shell[data-scene="workshop"] .mission-computer-card .terminal-actions {
  justify-content: flex-end;
  padding-top: 3px;
}

/* Plastic transmission windows for people, brass machines for repairs. */
#game-shell :is(.dialogue-console, .backyard-dialogue-panel),
body:has(#game-shell) .game-dialog,
#game-shell[data-scene="workshop"] .workshop-aside {
  border: 23px solid transparent;
  border-image: var(--dialogue-plastic-frame) 108 125 / 23px stretch;
  border-radius: 0;
  background: #071d27;
  background-clip: padding-box;
  box-shadow: none;
  filter: drop-shadow(0 9px 24px #000b);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#game-shell .dialogue-console.is-puzzle-mode {
  border: 28px solid transparent;
  border-image: var(--repair-instrument-frame) 125 118 / 28px stretch;
  background: #111d20;
  background-clip: padding-box;
}
#game-shell .dialogue-console.metal-panel::before,
#game-shell .dialogue-console.metal-panel::after,
#game-shell .backyard-activity-panel.metal-panel::before,
#game-shell .backyard-activity-panel.metal-panel::after { content: none; }
#game-shell .dialogue-console :is(.dialogue-choice-button, .next-button),
#game-shell :is(.backyard-dialogue-choices, #beach-dialogue-choices) button,
body:has(#game-shell) .game-dialog .dialog-close {
  border: 9px solid transparent;
  border-image: var(--dialogue-soft-key) 82 104 fill / 9px stretch;
  border-radius: 0;
  background: transparent;
  color: #f2ead6;
  text-shadow: 0 1px 2px #051318;
  min-height: 44px;
}
#game-shell .dialogue-console.is-puzzle-mode :is(.answer-button, .next-button, .button-primary),
#game-shell :is(.crate-action, .ship-wash-button),
#game-shell .backyard-activity-panel.dialogue-panel .backyard-activity-controls .backyard-activity-button:not(.is-correct, .is-wrong) {
  border: 9px solid transparent;
  border-image: var(--repair-amber-key) 73 100 fill / 9px stretch;
  border-radius: 0;
  background: transparent;
  color: #241b11;
  text-shadow: 0 1px #ffe1a2;
  min-height: 44px;
}
#game-shell :is(.dialogue-console, .backyard-activity-panel) :is(button:hover, button:focus-visible) { filter: brightness(1.14); }
#game-shell :is(.dialogue-console, .backyard-activity-panel) button:active { filter: brightness(.88); }

/* A portable field kit carries Earth activities and the two Workshop games. */
#game-shell :is(.backyard-activity-panel, .crate-panel, .ship-wash-panel, .workshop-inspector, .shop-panel),
#game-shell[data-scene="workshop"] :is(.crate-panel, .ship-wash-panel, .workshop-inspector, .shop-panel),
#game-shell .mission-inventory {
  border: 24px solid transparent;
  border-image: var(--field-kit-frame) 113 117 / 24px stretch;
  border-radius: 0;
  background: #0a2528;
  background-clip: padding-box;
  box-shadow: none;
  filter: drop-shadow(0 6px 16px #000b);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#game-shell .mission-inventory {
  border-width: 12px;
  border-image-width: 12px;
  padding: 6px;
}
#game-shell :is(.backyard-dialogue-panel, .backyard-activity-panel, .crate-panel,
  .ship-wash-panel, .workshop-inspector, .shop-panel, .mission-inventory).metal-panel::before,
#game-shell :is(.backyard-dialogue-panel, .backyard-activity-panel, .crate-panel,
  .ship-wash-panel, .workshop-inspector, .shop-panel, .mission-inventory).metal-panel::after { content: none; }

/* Flight instruments attach to the cockpit with a separate avionics finish. */
#game-shell :is(.flight-readout, .flight-meters, .system-map, .flight-emergency),
.expanded-map-dialog {
  border: 17px solid transparent;
  border-image: var(--flight-avionics-frame) 100 103 / 17px stretch;
  border-radius: 0;
  background: #071824;
  background-clip: padding-box;
  box-shadow: none;
  filter: drop-shadow(0 4px 13px #000b);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#game-shell :is(.flight-readout, .flight-meters, .system-map, .flight-emergency).metal-panel::before,
#game-shell :is(.flight-readout, .flight-meters, .system-map, .flight-emergency).metal-panel::after { content: none; }
#game-shell .flight-control {
  border: 7px solid transparent;
  border-image: var(--flight-avionics-frame) 100 103 fill / 7px stretch;
  border-radius: 0;
  background: #102d40;
  box-shadow: 0 3px 0 #041018;
}
#game-shell .flight-control.thrust { color: #ffe3a7; }

/* Sprocket's optional line is a small footer action, never a floating prop. */
#game-shell[data-scene="workshop"] > .bottom-hud .workshop-aside-button {
  position: static;
  transform: none;
  flex: none;
  min-height: 30px;
  padding: 0 7px;
  border: 5px solid transparent;
  border-image: var(--dialogue-soft-key) 82 104 fill / 5px stretch;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #d8f0db;
  font-size: .62rem;
  letter-spacing: .04em;
}
#game-shell:not([data-scene="workshop"]) > .bottom-hud .workshop-aside-button { display: none; }
#game-shell[data-scene="workshop"]:not([data-workshop-view="explore"]) > .bottom-hud .workshop-aside-button { display: none; }
#game-shell:not([data-scene="workshop"]) > .bottom-hud .workshop-interact-prompt { display: none; }

@media (max-width: 820px) {
  #game-shell[data-scene="workshop"] .mission-computer-card {
    height: min(690px, calc(100% - 16px));
    border-width: 22px;
    border-image-width: 22px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  #game-shell[data-scene="workshop"] .mission-computer-card .mission-board { border-right: 0; border-bottom: 1px solid #467075; }
  #game-shell[data-scene="workshop"] .mission-computer-card .call-copy.dialogue-panel { grid-template-columns: 76px minmax(0, 1fr); padding: 7px 9px; gap: 5px 9px; }
  #game-shell[data-scene="workshop"] .mission-computer-card .call-copy .dialogue-portrait { width: 76px; height: 76px; }
  #game-shell[data-scene="workshop"] .mission-computer-card .call-copy .mission-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 721px) and (max-width: 820px) {
  #game-shell[data-scene="workshop"] .mission-computer-card { grid-template-columns: 210px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  #game-shell[data-scene="workshop"] .mission-computer-card .mission-board { border-right: 1px solid #467075; border-bottom: 0; }
}
@media (max-width: 600px), (max-height: 550px) {
  #game-shell[data-scene="workshop"] .mission-computer-card { border-width: 14px; border-image-width: 14px; }
  #game-shell[data-scene="workshop"] .mission-computer-card .mission-terminal { overflow-y: auto; }
  #game-shell[data-scene="workshop"] .mission-computer-card .call-copy .call-line { font-size: .8rem; }
  #game-shell :is(.dialogue-console, .backyard-activity-panel, .crate-panel, .ship-wash-panel, .shop-panel) { border-width: 12px; border-image-width: 12px; }
  #game-shell :is(.flight-readout, .flight-meters, .system-map, .flight-emergency) { border-width: 9px; border-image-width: 9px; }
}
