* {
  box-sizing: border-box;
}
:root {
  color-scheme: dark;
  --pale: #ebeee6;
  --mute: #b6c2be;
  --amber: #f2b75d;
  --mint: #9be8c8;
  --line: rgba(220, 233, 223, 0.23);
  --ink: #13232a;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --sans: 'Avenir Next', 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
  --display: 'Avenir Next Condensed', 'Arial Narrow', Impact, 'Helvetica Neue', Arial, sans-serif;
}
html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #172934;
  color: var(--pale);
  font-family: var(--sans);
  user-select: none;
}
[hidden] {
  display: none !important;
}
button,
select,
input {
  font: inherit;
}
button {
  cursor: pointer;
}
button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 4px;
}
#world,
#shade,
#menu,
#hud,
#damage,
#modal,
#boot {
  position: fixed;
  inset: 0;
}
#world {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
#shade,
#damage,
#hud {
  pointer-events: none;
}
#shade {
  background:
    linear-gradient(
      90deg,
      rgba(7, 18, 24, 0.92),
      rgba(9, 21, 27, 0.73) 24%,
      rgba(13, 24, 28, 0.17) 56%,
      transparent 78%
    ),
    linear-gradient(0deg, rgba(8, 18, 23, 0.51), transparent 24%);
  transition: opacity 0.25s;
}
body[data-phase='playing'] #shade {
  opacity: 0;
}
body[data-phase='paused'] #shade,
body[data-phase='dead'] #shade,
body[data-phase='won'] #shade {
  opacity: 0.45;
}
#damage {
  box-shadow: inset 0 0 12vmin 4vmin rgba(185, 46, 32, 0.83);
  opacity: 0;
}
#menu {
  padding: clamp(26px, 5.1vw, 84px);
  display: flex;
  align-items: center;
}
.mast {
  position: absolute;
  top: clamp(22px, 4.8vh, 60px);
  left: clamp(26px, 5.1vw, 84px);
  right: clamp(26px, 5.1vw, 84px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: #e3e8df;
}
.brand span {
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.18em;
}
.brand small {
  display: block;
  font: 8px var(--mono);
  letter-spacing: 0.17em;
  margin-top: 3px;
}
.brandmark {
  width: 35px;
  height: 28px;
  display: block;
  background: repeating-linear-gradient(135deg, transparent 0 5px, #e7bb76 5px 10px);
  clip-path: polygon(0 65%, 44% 0, 71% 0, 37% 52%, 100% 52%, 100% 76%, 24% 76%, 10% 100%, 0 100%);
}
.weather {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 650;
  text-shadow: 0 1px 5px #182831;
}
.weather b {
  font: 13px var(--mono);
  border-left: 1px solid #b9c3bd;
  padding-left: 10px;
}
.rainicon {
  width: 15px;
  height: 11px;
  border-top: 2px solid currentColor;
  background: repeating-linear-gradient(
    112deg,
    transparent 0 3px,
    currentColor 4px 5px,
    transparent 6px
  );
}
.hero {
  position: relative;
  padding-top: 4.5vh;
  max-width: 560px;
}
.hero h1 {
  font: italic 900 clamp(72px, min(9.2vw, 12.8vh), 165px) / 0.77 var(--display);
  letter-spacing: -0.055em;
  margin: 0 0 18px;
  color: #e5e9e0;
  text-shadow: 0 2px 10px #14212840;
}
.hero h1 span {
  display: block;
  color: var(--amber);
}
.hero h2 {
  font-size: clamp(24px, 2.5vw, 44px);
  line-height: 1.2;
  letter-spacing: 0.18em;
  margin: 0;
  font-weight: 810;
}
.hero p {
  font-size: clamp(13px, 1.03vw, 17px);
  line-height: 1.85;
  letter-spacing: 0.04em;
  color: #c6d0cc;
  margin: 18px 0 24px;
}
.primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 35px;
  background: var(--amber);
  border: 0;
  color: #1e2b2d;
  font-weight: 800;
  letter-spacing: 0.09em;
  padding: 14px 21px;
  min-width: 205px;
  font-size: 15px;
  transition:
    background 0.15s,
    transform 0.15s;
}
.primary:hover {
  background: #ffd293;
  transform: translateY(-1px);
}
.primary span {
  font: 23px/1 var(--mono);
}
.secondary {
  display: flex;
  align-items: center;
  gap: 17px;
  margin-top: 15px;
}
.secondary button,
.ghost {
  background: transparent;
  color: #d2dcd6;
  border: 0;
  padding: 5px 0;
  font-size: 13px;
  letter-spacing: 0.06em;
}
.secondary button:hover,
.ghost:hover {
  color: var(--amber);
}
.secondary i {
  height: 12px;
  width: 1px;
  background: var(--line);
}
.chart {
  position: absolute;
  bottom: 5.7vh;
  right: 5.1vw;
  width: clamp(180px, 16.3vw, 280px);
  padding: 12px 14px 10px;
  background: #152a31d9;
  border: 1px solid #9eaea956;
  box-shadow: 0 8px 27px #10202b24;
}
.chart-title,
.chart-key {
  display: flex;
  align-items: center;
}
.chart-title {
  justify-content: space-between;
  border-bottom: 1px solid #a9b9aa55;
  padding-bottom: 7px;
}
.chart-title b {
  font: 700 11px var(--mono);
  letter-spacing: 0.12em;
}
.chart-title span,
.chart-key {
  color: #c4cec2;
  font-size: 10px;
}
.chart canvas {
  display: block;
  width: 100%;
  height: auto;
}
.chart-key {
  gap: 6px;
  border-top: 1px solid #a9b9aa36;
  padding-top: 6px;
}
.chart-key i,
.chart-key em {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--amber);
  transform: rotate(45deg);
}
.chart-key em {
  margin-left: 10px;
  background: var(--mint);
  border-radius: 50%;
}
#hud {
  color: #f0f1df;
  text-shadow:
    0 1px 5px #12212b,
    0 0 12px #132029bb;
}
.kicker {
  color: #d6dfd6;
  font: 700 11px var(--sans);
  letter-spacing: 0.13em;
  display: flex;
  align-items: center;
  gap: 7px;
}
.kicker i {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--amber);
  transform: rotate(45deg);
}
.kicker b {
  color: var(--mint);
}
#orders {
  position: absolute;
  top: 4.5%;
  left: 3.2%;
  border-left: 2px solid var(--amber);
  padding: 2px 16px 5px;
  background: linear-gradient(90deg, #12232b9c, transparent);
}
#order-title {
  font-size: clamp(16px, 1.4vw, 23px);
  display: block;
  margin: 5px 0 7px;
}
.kicker,
#weapon-state {
  line-height: 1.4;
}
#relay-row {
  display: flex;
  gap: 5px;
}
#relay-row span {
  font: 700 11px var(--mono);
  padding: 2px 7px;
  color: #ead6a9;
  border: 1px solid #d7c08b9e;
}
#relay-row .done {
  background: #9be8c8;
  color: #19312d;
  border-color: #9be8c8;
  text-shadow: none;
}
#radio {
  max-width: 260px;
  color: #d6eee2;
  font-size: 12px;
  line-height: 1.65;
  margin-top: 6px;
}
#radio:empty {
  display: none;
}
#compass {
  position: absolute;
  top: 3%;
  left: 50%;
  width: min(35vw, 430px);
  height: 46px;
  transform: translateX(-50%);
  filter: drop-shadow(0 1px 3px #112029);
}
#waypoint {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  color: #ffe1a5;
  font: 700 12px var(--mono);
  transform: translate(-50%, -50%);
  padding: 4px 8px;
  background: #182a2e96;
  border-radius: 2px;
}
#waypoint i {
  height: 9px;
  width: 9px;
  border: 2px solid var(--amber);
  transform: rotate(45deg);
}
#waypoint.edge i {
  width: 0;
  height: 0;
  border: 5px solid transparent;
  border-left: 8px solid var(--amber);
  transform: rotate(var(--angle, 0deg));
}
#reticle,
#hitmark,
#use,
#alarm {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
#reticle {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  top: 50%;
  background: #f2efdb;
  box-shadow: 0 0 3px #18262b;
  --spread: 7px;
}
#reticle i {
  position: absolute;
  background: #f4f3db;
  box-shadow: 0 0 3px #17242b;
}
.ads #reticle {
  opacity: 0.15;
}
#reticle i:nth-child(1),
#reticle i:nth-child(2) {
  width: 5px;
  height: 1.5px;
  top: 0.2px;
}
#reticle i:nth-child(1) {
  right: var(--spread);
}
#reticle i:nth-child(2) {
  left: var(--spread);
}
#reticle i:nth-child(3),
#reticle i:nth-child(4) {
  height: 5px;
  width: 1.5px;
  left: 0.2px;
}
#reticle i:nth-child(3) {
  bottom: var(--spread);
}
#reticle i:nth-child(4) {
  top: var(--spread);
}
#hitmark {
  top: 50%;
  transform: translate(-50%, -53%);
  font: 34px/1 var(--mono);
  color: #ffc480;
  opacity: 0;
}
#use {
  top: 62%;
  min-width: 160px;
  background: #14252ddd;
  padding: 10px 13px;
  border: 1px solid #cfdbc359;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}
kbd {
  font: 700 12px var(--mono);
  color: #f2efdb;
  border: 1px solid #c2ccc274;
  padding: 3px 6px;
  border-radius: 2px;
}
#use kbd {
  margin-right: 9px;
  color: var(--amber);
}
.track,
.health-track {
  height: 3px;
  background: #d5e2d23d;
  margin-top: 9px;
}
.track i,
.health-track i {
  display: block;
  height: 100%;
  background: var(--mint);
  transform-origin: left;
}
#vitals,
#ammo {
  position: absolute;
  bottom: 4.4%;
  padding: 10px 14px;
  background: linear-gradient(90deg, #10232bbf, #10232b35);
  border-bottom: 1px solid #b7caba66;
}
#vitals {
  left: 3.2%;
  min-width: 142px;
}
#ammo {
  right: 3.2%;
  text-align: right;
  background: linear-gradient(270deg, #10232bbf, #10232b35);
  min-width: 153px;
}
#ammo .kicker {
  justify-content: end;
}
#ammo .kicker b {
  color: var(--amber);
}
.readout {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 2px 0 -2px;
}
.readout strong {
  font: 750 clamp(32px, 3.25vw, 55px) / 1 var(--display);
  font-variant-numeric: tabular-nums;
}
.readout small {
  font: 12px var(--mono);
  color: #c6cec7;
}
#ammo .readout {
  justify-content: end;
}
#weapon-state {
  font: 10px var(--sans);
  color: #efcf93;
  margin-top: 5px;
}
#alarm {
  top: 17%;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: #ffe5b4;
  background: #4a2b23aa;
  padding: 5px 13px;
}
#alarm:empty {
  display: none;
}
#modal,
#boot {
  display: grid;
  place-items: center;
  background: #0c1c24a8;
  backdrop-filter: blur(4px);
}
.dialog {
  position: relative;
  background: #182a31f5;
  border: 1px solid #9db3ae64;
  width: min(435px, 91vw);
  max-height: 90vh;
  overflow: auto;
  padding: 29px 31px 25px;
  box-shadow: 0 18px 90px #09172070;
}
.dialog-stripe {
  position: absolute;
  left: 0;
  top: 0;
  width: 64px;
  height: 4px;
  background: var(--amber);
}
#dialog-code {
  font: 11px var(--mono);
  color: var(--amber);
  letter-spacing: 0.17em;
}
.dialog h2 {
  font-size: 30px;
  letter-spacing: 0.08em;
  margin: 9px 0 17px;
}
.dialog p {
  font-size: 14px;
  color: #c5d2ca;
  line-height: 1.7;
  margin: 6px 0 13px;
}
#dialog-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 22px;
}
#dialog-actions .primary {
  font-size: 14px;
  min-width: 134px;
  padding: 11px 16px;
}
.keys {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 12px;
}
.keys div,
.statrow,
.option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #819a9438;
  padding: 8px 0;
  font-size: 13px;
  color: #cbd7cc;
}
.keys kbd {
  font-size: 11px;
  white-space: nowrap;
}
.statrow strong {
  font: 700 15px var(--mono);
  color: #f1d39d;
}
.option {
  padding: 12px 0;
}
.option select {
  background: #20363e;
  border: 1px solid #92a79f83;
  color: var(--pale);
  padding: 4px 7px;
}
.option input {
  accent-color: var(--amber);
  width: 42%;
}
.option output {
  font: 12px var(--mono);
}
#boot {
  background: #15242d;
  color: var(--pale);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.bootword {
  font: italic 900 42px var(--display);
  letter-spacing: -0.03em;
  color: var(--amber);
}
#bootmsg {
  font-size: 14px;
}
@media (max-height: 600px) {
  .hero {
    padding-top: 34px;
  }
  .hero h1 {
    font-size: clamp(48px, 10vh, 80px);
    margin-bottom: 9px;
  }
  .hero p {
    margin: 7px 0 10px;
  }
  .secondary {
    margin-top: 6px;
  }
  .mast {
    top: 16px;
  }
  .hero h2 {
    font-size: 23px;
  }
}
@media (max-width: 720px) {
  .chart {
    width: 150px;
    right: 22px;
    bottom: 24px;
  }
  .hero h1 {
    font-size: clamp(69px, 15vw, 96px);
  }
  #compass {
    left: 69%;
    width: 49vw;
  }
  #orders {
    max-width: 43%;
    padding-left: 8px;
  }
  #radio {
    font-size: 10px;
  }
  #waypoint {
    font-size: 10px;
  }
  .weather {
    font-size: 11px;
  }
}
@media (max-width: 510px) {
  .chart {
    display: none;
  }
  .hero {
    padding-top: 15px;
  }
  .keys {
    gap: 3px 9px;
  }
  .dialog {
    padding: 22px;
  }
  .hero p {
    font-size: 13px;
  }
}

body[data-phase='departing'] #shade {
  opacity: 0;
}
#departure {
  position: fixed;
  bottom: 8%;
  left: 5%;
  border-left: 3px solid var(--mint);
  background: #12272cba;
  color: #e4ecdb;
  font-weight: 700;
  padding: 9px 14px;
  letter-spacing: 0.12em;
}
#departure span {
  color: var(--mint);
}
