:root {
  color-scheme: dark;
  font-family: 'Courier New',monospace;
  background: #070a10;
  color: #a8bac6;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  color: #b5dce6;
  border: 1px solid #2e4655;
  background: #101b25;
  padding: 10px 13px;
  cursor: pointer;
  border-radius: 3px;
}
button: hover {
  border-color: #73e5ee;
  color: #fff;
}
button: focus-visible,a:focus-visible {
  outline: 2px solid #ffb14d;
  outline-offset: 4px;
}
.cabinet {
  max-width: 1260px;
  margin: auto;
  padding: 18px 28px 10px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}
.brand {
  text-decoration: none;
  color: #ffb54f;
  font-size: 25px;
  font-weight: bold;
  letter-spacing: 3px;
}
.brand small {
  display: block;
  color: #688b9d;
  font-size: 10px;
  letter-spacing: 2.6px;
  margin-top: 5px;
}
nav {
  display: flex;
  gap: 7px;
}
nav button {
  font-size: 11px;
}
.machine {
  border: 1px solid #293a46;
  background: #05080c;
  padding: 12px 20px 8px;
  box-shadow: 0 0 50px #0008;
  border-radius: 8px;
}
.hud {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 2px;
  padding: 3px 5px 12px;
  color: #75a5b6;
}
.hud b {
  display: block;
  color: #e5eef1;
  font-size: 23px;
  letter-spacing: 3px;
  margin-top: 3px;
}
.hud span:first-child b {
  color: #ffbc68;
}
.screen {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 10/7;
  max-height: calc(100dvh - 225px);
  margin: auto;
  overflow: hidden;
  background: #03060b;
  border: 1px solid #172a36;
}
canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}
.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(transparent 0px,transparent 3px,#0002 4px);
  opacity: .4;
}
#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 5% 4%;
  text-align: center;
  background: linear-gradient(transparent 20%,#03060be8 59%);
}
#overlay.hidden {
  display: none;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 3px;
  color: #61dce9;
  margin: 0;
}
h1 {
  font-size: clamp(24px,7cqw,54px);
  white-space: nowrap;
  letter-spacing: 5px;
  line-height: 1;
  color: #ffb146;
  text-shadow: 0 0 20px #ff911c50;
  margin: 8px 0;
}
#caption {
  font-size: clamp(10px,2.4cqw,16px);
  max-width: 560px;
  line-height: 1.6;
  color: #b9c9d3;
  margin: 8px 0 12px;
}
#launch {
  background: #ffb14d;
  color: #15100a;
  font-weight: bold;
  letter-spacing: 2px;
  border: 0;
  font-size: clamp(11px,2.5cqw,17px);
  padding: 10px 18px;
}
#launch span {
  margin-left: 24px;
}
.instructions {
  font-size: clamp(8px,1.7cqw,11px);
  line-height: 1.5;
  color: #7f98a8;
  margin-top: 10px;
}
.instructions p {
  margin: 6px 0;
}
kbd {
  border: 1px solid #38515f;
  padding: 2px 4px;
  color: #cbe0e8;
}
.status {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 2px 1px;
  font-size: 10px;
  letter-spacing: 1px;
  color: #64b8ca;
}
#phase {
  color: #ffb765;
}
.touch {
  display: none;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
}
.touch>div {
  display: flex;
  gap: 9px;
}
.touch button {
  min-width: 64px;
  height: 60px;
  touch-action: none;
  user-select: none;
  font-weight: bold;
}
.touch button[data-control=left],.touch button[data-control=right] {
  font-size: 28px;
}
.touch .fire {
  border-color: #b76739;
  color: #ffb46d;
}
.touch button.held {
  background: #2a4855;
  border-color: #a6fcff;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 9px;
  color: #4e6a7a;
  margin: 12px 0;
  line-height: 1.5;
}
@media(pointer:coarse) {
  .touch {
    display: flex;
  }
  .screen {
    max-height: calc(100dvh - 310px);
  }
  footer>span:first-child {
    display: none;
  }
}
@media(max-width:650px) {
  .screen {
    width: 100%;
    max-width: 100%;
  }
  .cabinet {
    padding: 10px 8px;
  }
  header {
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
  }
  .brand {
    font-size: 18px;
    letter-spacing: 2px;
  }
  .brand small {
    font-size: 8px;
    letter-spacing: 1px;
  }
  nav {
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 200px;
  }
  nav button {
    font-size: 9px;
    padding: 7px;
  }
  .machine {
    padding: 10px 8px;
  }
  .hud {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .hud b {
    font-size: 17px;
  }
  .screen {
    max-height: none;
  }
  .status {
    font-size: 8px;
    letter-spacing: 0;
  }
  #timer {
    max-width: 100px;
    text-align: right;
  }
  #overlay {
    padding: 3% 4%;
  }
  .eyebrow {
    font-size: 7px;
    letter-spacing: 2px;
  }
  h1 {
    font-size: 30px;
    margin: 5px 0;
    letter-spacing: 5px;
  }
  #caption {
    font-size: 10px;
    margin: 0 0 8px;
  }
  #launch {
    font-size: 11px;
    padding: 9px 15px;
  }
  .instructions {
    font-size: 8px;
    line-height: 1.6;
    margin-top: 3px;
  }
  .instructions p {
    margin: 5px 0;
  }
  footer {
    font-size: 8px;
  }
  .touch button {
    min-width: 58px;
  }
  .touch button[data-control=thrust] {
    font-size: 11px;
  }
}
@media(max-height:550px) and (orientation:landscape) {
  header {
    margin-bottom: 5px;
  }
  .cabinet {
    padding: 6px 12px;
  }
  .screen {
    max-height: calc(100dvh - 150px);
  }
  .touch {
    position: absolute;
    bottom: 35px;
    left: 25px;
    right: 25px;
    pointer-events: none;
  }
  .touch button {
    pointer-events: auto;
    opacity: .8;
  }
  .hud {
    padding-bottom: 5px;
  }
  .hud b {
    font-size: 16px;
  }
  footer {
    margin: 5px;
  }
  #overlay .instructions {
    display: none;
  }
  h1 {
    font-size: 30px;
  }
  #caption {
    font-size: 11px;
  }
}
@media(prefers-reduced-motion:reduce) {
  .scanlines {
    display: none;
  }
}
/* Keep captions and launch controls readable even on narrow, short screens. */
#speech-caption {
  margin: 5px 0;
  min-height: 1em;
  font-size: 11px;
  text-align: center;
  color: #b9c9d3;
}
#overlay {
  overflow-y: auto;
}
.instructions[style*="hidden"] {
  display: none;
}
.status {
  flex-wrap: wrap;
}
@media (max-width: 650px) {
  header {
    flex-wrap: wrap;
  }
  nav {
    max-width: none;
    width: 100%;
    justify-content: space-between;
  }
  nav button {
    min-height: 36px;
  }
  .screen {
    min-height: 245px;
  }
  #overlay {
    justify-content: center;
    background: #03060bc9;
  }
  #caption {
    font-size: 12px;
    line-height: 1.35;
  }
  .instructions {
    font-size: 10px;
  }
  h1 {
    font-size: 26px;
  }
  #speech-caption {
    font-size: 10px;
  }
}
@media (max-height: 550px) and (orientation: landscape) {
  header {
    flex-wrap: nowrap;
  }
  nav {
    width: auto;
  }
  .brand small, .eyebrow {
    display: none;
  }
  .screen {
    min-height: 190px;
    max-height: none;
    height: calc(100dvh - 165px);
  }
  #overlay {
    justify-content: center;
    padding: 8px;
    background: #03060bc9;
  }
  h1 {
    font-size: 24px;
    margin: 3px;
  }
  #caption {
    margin-bottom: 6px;
    line-height: 1.25;
  }
  .touch {
    position: fixed;
    bottom: 8px;
    left: 12px;
    right: 12px;
    z-index: 2;
  }
  .touch button {
    height: 44px;
    min-width: 48px;
  }
  .touch:has(button) {
    padding-top: 0;
  }
  .cabinet:has(#overlay:not(.hidden)) .touch {
    visibility: hidden;
  }
  footer {
    display: none;
  }
}
