:root {
  color-scheme: dark;
  --black: #050508;
  --screen: #0b0b10;
  --paper: #f3eedc;
  --green: #43d344;
  --cyan: #45bfe8;
  --blue: #2455bd;
  --yellow: #f4d84b;
  --orange: #d76635;
  --dim: #8b8b83;
  --font: "VT323", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #090a0e;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--paper);
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    #111219;
  background-size: 100% 4px;
  font-family: var(--font);
  font-size: 22px;
  letter-spacing: 0.02em;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 3px,
    rgba(0, 0, 0, 0.1) 4px
  );
  content: "";
  opacity: 0.34;
  pointer-events: none;
}

button,
a {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 3px;
}

.weather {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: radial-gradient(circle at 50% 0, #222633 0, #111219 54%, #08090d 100%);
  pointer-events: none;
}

.weather span {
  position: absolute;
  top: -8%;
  width: 3px;
  height: 16px;
  background: rgba(126, 194, 214, 0.2);
  box-shadow: 60px 130px rgba(126, 194, 214, 0.18), 180px 320px rgba(126, 194, 214, 0.15);
  transform: rotate(24deg);
  animation: snow 2.4s steps(8, end) infinite;
}

.weather span:nth-child(1) { left: 8%; animation-delay: -0.4s; }
.weather span:nth-child(2) { left: 29%; animation-delay: -1.2s; }
.weather span:nth-child(3) { left: 51%; animation-delay: -2s; }
.weather span:nth-child(4) { left: 71%; animation-delay: -0.9s; }
.weather span:nth-child(5) { left: 92%; animation-delay: -1.7s; }

@keyframes snow {
  to { transform: translate(130px, 110vh) rotate(24deg); }
}

.game-shell {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 26px;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.masthead {
  min-height: 54px;
  margin-bottom: 12px;
  border-bottom: 3px solid var(--dim);
  padding: 0 2px 10px;
}

.wordmark {
  color: var(--paper);
  text-decoration: none;
  text-transform: uppercase;
}

.wordmark strong {
  display: block;
}

.wordmark strong {
  font-size: 28px;
  font-weight: 400;
  line-height: 0.9;
}

.signal {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--paper);
  font-size: 19px;
}

.signal i {
  width: 10px;
  height: 10px;
  background: var(--green);
  animation: blink 1.1s steps(1, end) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.panel {
  border: 5px solid var(--paper);
  background: var(--black);
  box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.32);
}

.intro {
  position: relative;
  display: flex;
  min-height: 650px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 58px 32px 190px;
  text-align: center;
  overflow: hidden;
}

.intro::before {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 160px;
  border-top: 7px solid var(--cyan);
  background:
    linear-gradient(172deg, transparent 0 37%, var(--blue) 38% 52%, transparent 53%) 0 34px / 210px 78px repeat-x,
    repeating-linear-gradient(177deg, #0b3276 0 12px, #1768b1 13px 18px, #071e4f 19px 31px);
  content: "";
}

.intro::after {
  position: absolute;
  right: 13%;
  bottom: 94px;
  width: 260px;
  height: 31px;
  background: var(--paper);
  box-shadow:
    -28px 22px 0 -7px var(--orange),
    82px -25px 0 -5px var(--paper),
    104px -43px 0 -10px var(--orange),
    104px -58px 0 -11px var(--orange);
  clip-path: polygon(0 0, 100% 0, 92% 100%, 8% 100%);
  content: "";
  transform: rotate(-2deg);
}

.eyebrow,
.location {
  color: var(--green);
  font-size: 21px;
  text-transform: uppercase;
}

.intro h1 {
  position: relative;
  z-index: 1;
  margin: 18px 0 25px;
  color: var(--yellow);
  font-size: clamp(68px, 10vw, 110px);
  font-weight: 400;
  line-height: 0.74;
  text-shadow: 5px 5px 0 var(--orange);
  text-transform: uppercase;
}

.intro h1 em {
  color: var(--paper);
  font-style: normal;
  text-shadow: 5px 5px 0 var(--blue);
  white-space: nowrap;
}

.lede {
  position: relative;
  z-index: 1;
  max-width: 660px;
  margin: 14px auto 28px;
  border: 5px solid var(--green);
  padding: 17px 22px;
  color: var(--paper);
  background: var(--black);
  font-size: 25px;
  line-height: 1.18;
  text-align: left;
}

.primary-button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  min-width: 290px;
  align-items: center;
  justify-content: space-between;
  border: 0;
  padding: 10px 14px;
  color: var(--black);
  background: var(--paper);
  cursor: pointer;
  font-size: 25px;
  text-transform: uppercase;
}

.primary-button::before {
  margin-right: 12px;
  content: ">";
}

.primary-button:hover {
  color: var(--black);
  background: var(--yellow);
}

.primary-button b {
  font-weight: 400;
}

.game {
  display: block;
}

.status-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.8fr);
  padding: 0;
  overflow: hidden;
}

.ship-window {
  position: relative;
  min-height: 300px;
  border-right: 5px solid var(--paper);
  background:
    linear-gradient(0deg, transparent 0 52%, var(--green) 53% 55%, transparent 56%),
    linear-gradient(#02020a 0 58%, #071a48 59% 100%);
  image-rendering: pixelated;
  overflow: hidden;
}

.pixel-cloud {
  position: absolute;
  top: 42px;
  left: 10%;
  width: 58px;
  height: 10px;
  background: #969799;
  box-shadow: 17px -9px 0 #969799, 47px 3px 0 #969799;
}

.cloud-two {
  top: 82px;
  right: 13%;
  left: auto;
  transform: scale(0.72);
}

.lighthouse {
  position: absolute;
  right: 7%;
  bottom: 131px;
  width: 11px;
  height: 44px;
  background: var(--paper);
  box-shadow: 0 -9px 0 3px var(--orange), -6px 42px 0 9px #26752b;
}

.lighthouse::after {
  position: absolute;
  top: -18px;
  left: -42px;
  width: 40px;
  height: 7px;
  background: linear-gradient(90deg, transparent, var(--yellow));
  content: "";
}

.ship {
  position: absolute;
  right: 12%;
  bottom: 78px;
  left: 8%;
  height: 74px;
  transform-origin: 60% 100%;
  animation: pitch 2.3s steps(3, end) infinite;
}

.hull {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 32px;
  border-top: 7px solid var(--orange);
  background: var(--paper);
  clip-path: polygon(0 0, 100% 0, 91% 100%, 10% 100%);
}

.deckhouse {
  position: absolute;
  right: 9%;
  bottom: 31px;
  width: 22%;
  height: 31px;
  border-top: 7px solid var(--paper);
  background: var(--cyan);
  box-shadow: -126px 20px 0 -8px var(--paper);
}

.stack {
  position: absolute;
  right: 16%;
  bottom: 62px;
  width: 17px;
  height: 25px;
  background: var(--orange);
  box-shadow: 0 -5px 0 var(--black);
}

.wave {
  position: absolute;
  right: -10%;
  bottom: 34px;
  left: -10%;
  height: 52px;
  border-top: 8px solid var(--cyan);
  background: repeating-linear-gradient(171deg, var(--blue) 0 13px, #072b70 14px 29px);
  transform: rotate(-2deg);
}

.wave-two {
  bottom: -15px;
  border-color: #b9e9f0;
  transform: rotate(2deg);
}

@keyframes pitch {
  50% { transform: rotate(-2deg) translateY(4px); }
}

.status-grid {
  display: grid;
  align-content: center;
  grid-template-columns: 1fr 0.6fr;
  padding: 22px 20px;
  color: var(--black);
  background: var(--paper);
  gap: 18px 14px;
}

.stat span,
.route-labels,
.scene-meta span {
  display: block;
  color: inherit;
  font-size: 17px;
  line-height: 1;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
}

.stat-wide {
  grid-column: 1 / -1;
}

.meter {
  height: 11px;
  margin: 7px 0 3px;
  border: 3px solid var(--black);
  background: var(--paper);
}

.meter i {
  display: block;
  width: 50%;
  height: 100%;
  background: var(--green);
  transition: width 240ms steps(6, end);
}

.meter.danger i {
  background: var(--orange);
}

.route {
  grid-column: 1 / -1;
  padding: 14px 20px 17px;
  color: var(--black);
  background: var(--paper);
}

.route-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.route-line {
  position: relative;
  height: 8px;
  border: 2px solid var(--black);
  background: var(--paper);
}

.route-line i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--green);
  transition: width 250ms steps(7, end);
}

.route-line b {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 17px;
  border: 3px solid var(--black);
  background: var(--yellow);
  transform: translate(-50%, -50%);
  transition: left 250ms steps(7, end);
}

.story-panel {
  position: relative;
  display: flex;
  min-height: 425px;
  flex-direction: column;
  margin-top: 14px;
  border-color: var(--green);
  padding: 25px 30px 21px;
}

.scene-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  color: var(--paper);
}

.scene-meta strong {
  display: block;
  color: var(--yellow);
  font-size: 34px;
  font-weight: 400;
  line-height: 0.9;
}

.scene-copy {
  padding: 18px 0 20px;
}

.location {
  margin: 0 0 7px;
}

.scene-copy h2,
.ending h2 {
  margin: 0;
  color: var(--yellow);
  font-size: clamp(40px, 6vw, 62px);
  font-weight: 400;
  line-height: 0.9;
  text-transform: uppercase;
}

#scene-text {
  max-width: 850px;
  margin: 14px 0 0;
  font-size: 24px;
  line-height: 1.12;
}

.radio-message {
  max-width: 850px;
  margin: 15px 0 0;
  border: 3px dashed var(--cyan);
  padding: 8px 11px;
  color: var(--cyan);
  font-size: 20px;
  line-height: 1.05;
}

.radio-message::before {
  color: var(--paper);
  content: "RADIO: ";
}

.choices {
  display: grid;
  gap: 3px;
  margin-top: auto;
}

.choice {
  display: grid;
  grid-template-columns: minmax(160px, 0.42fr) 1fr;
  align-items: center;
  border: 0;
  padding: 7px 10px;
  color: var(--paper);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.choice:hover,
.choice:focus-visible {
  color: var(--black);
  background: var(--paper);
  outline: none;
}

.choice span {
  color: var(--green);
  font-size: 20px;
  text-transform: uppercase;
}

.choice:hover span,
.choice:focus-visible span {
  color: #16701c;
}

.choice strong {
  font-size: 23px;
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
}

.keyboard-hint {
  margin: 9px 0 0;
  color: var(--dim);
  font-size: 17px;
  text-align: right;
}

kbd {
  color: var(--yellow);
  font: inherit;
}

.ending {
  min-height: 650px;
  padding: 52px 58px;
}

.ending-mark {
  width: 48px;
  margin-bottom: 22px;
  border: 5px solid var(--green);
  color: var(--green);
  font-size: 32px;
  line-height: 38px;
  text-align: center;
}

.ending h2 {
  max-width: 800px;
  margin: 12px 0 20px;
}

.ending-text {
  max-width: 790px;
  font-size: 25px;
  line-height: 1.15;
}

.captain-log {
  display: grid;
  max-width: 790px;
  grid-template-columns: 1fr 1fr;
  margin: 23px 0;
  border: 3px solid var(--paper);
}

.captain-log span {
  border: 1px solid var(--dim);
  padding: 5px 9px;
  color: var(--paper);
  font-size: 18px;
  text-transform: uppercase;
}

.captain-log span::before {
  color: var(--green);
  content: "* ";
}

.history-note {
  max-width: 790px;
  margin: 28px 0;
  border: 5px solid var(--green);
  padding: 13px 16px;
}

.history-note strong {
  color: var(--yellow);
  font-size: 22px;
  font-weight: 400;
}

.history-note p {
  margin: 5px 0 0;
  color: var(--paper);
  font-size: 20px;
  line-height: 1.08;
}

.hidden {
  display: none !important;
}

@media (max-width: 720px) {
  body {
    font-size: 20px;
  }

  .game-shell {
    width: min(100% - 18px, 560px);
    padding-top: 10px;
  }

  .masthead {
    min-height: 44px;
  }

  .intro {
    min-height: 690px;
    padding: 40px 16px 190px;
  }

  .intro h1 {
    font-size: clamp(48px, 15vw, 76px);
    line-height: 0.82;
    text-shadow: 3px 3px 0 var(--orange);
  }

  .intro h1 em {
    text-shadow: 3px 3px 0 var(--blue);
  }

  .lede {
    padding: 14px;
    font-size: 22px;
  }

  .intro::after {
    right: 8%;
    width: 230px;
  }

  .status-panel {
    display: block;
  }

  .ship-window {
    min-height: 235px;
    border-right: 0;
    border-bottom: 5px solid var(--paper);
  }

  .status-grid {
    grid-template-columns: 1fr 0.5fr;
  }

  .story-panel {
    min-height: 515px;
    padding: 20px 15px 15px;
  }

  .scene-meta strong {
    font-size: 30px;
  }

  #scene-text {
    font-size: 22px;
  }

  .choice {
    display: block;
    padding: 8px;
  }

  .choice span,
  .choice strong {
    display: block;
  }

  .choice span {
    margin-bottom: 2px;
  }

  .ending {
    min-height: 0;
    padding: 32px 20px;
  }

  .captain-log {
    grid-template-columns: 1fr;
  }

}

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