* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #ded9c8;
  color: #202923;
  font:
    16px Arial,
    Helvetica,
    sans-serif;
}
button {
  font: inherit;
  cursor: pointer;
}
button:focus-visible {
  outline: 3px solid #ff6437;
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
#world,
#brief,
#hud {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#brief {
  background: #e1dfd0;
  isolation: isolate;
  overflow: hidden;
}
.paper {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23584b38' filter='url(%23n)' opacity='.8' d='M0 0h160v160H0z'/%3E%3C/svg%3E");
}
.plate {
  position: absolute;
  right: -1%;
  top: 0;
  height: 100%;
  width: 62%;
  object-fit: cover;
  z-index: -1;
  object-position: 50% 45%;
}
header,
footer {
  position: absolute;
  left: 4.8%;
  right: 4.8%;
  display: flex;
  align-items: center;
  line-height: 1;
  font: 700 11px/1.25 monospace;
  letter-spacing: 0.13em;
}
header {
  top: 4.5%;
  border-bottom: 1px solid #38443977;
  padding-bottom: 14px;
  gap: 12px;
}
header svg {
  width: 35px;
  height: 29px;
}
header span {
  margin-left: auto;
  font-size: 10px;
}
footer {
  bottom: 4.5%;
  border-top: 1px solid #38443977;
  padding-top: 12px;
  font-size: 10px;
}
footer span {
  font-size: 18px;
}
footer b {
  margin-left: 26px;
}
.brieftext {
  position: absolute;
  left: 5.2%;
  top: 50%;
  transform: translateY(-45%);
  width: 45%;
  max-width: 650px;
}
.serial,
.place,
small,
#weapon span {
  font: bold 11px/1.5 monospace;
  letter-spacing: 0.13em;
}
.serial {
  display: flex;
  gap: 13px;
  align-items: center;
}
.serial i {
  background: #d2522b;
  width: 28px;
  height: 5px;
}
.serial b {
  color: #8c3c23;
}
h1 {
  font:
    1000 clamp(54px, min(9.8vw, 15vh), 170px)/0.77 Arial,
    Helvetica,
    sans-serif;
  letter-spacing: -0.08em;
  margin: 25px 0 22px;
  transform: scaleX(0.87);
  transform-origin: left;
  color: #222c25;
}
p {
  font-size: clamp(14px, 1.35vw, 20px);
  line-height: 1.48;
  max-width: 375px;
  margin: 14px 0 25px;
}
.place {
  font-size: 11px;
}
#start,
#again {
  border: 0;
  background: #26322a;
  color: #f3eddc;
  font-weight: 700;
  padding: 14px 18px;
  min-width: 180px;
  text-align: left;
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
#start:hover,
#again:hover {
  background: #904322;
}
#start strong {
  color: #f19a66;
  font-size: 21px;
}
#keybtn,
#close {
  border: none;
  background: none;
  color: inherit;
  margin-left: 16px;
  text-decoration: underline;
  text-underline-offset: 4px;
  font-size: 13px;
}
#keybtn b {
  margin-left: 5px;
}
#controls,
dialog {
  background: #e8e4d4;
  color: #233027;
  border: 1px solid #2c3b30;
  padding: 32px;
  box-shadow: 6px 6px 0 #28392d55;
}
#controls {
  position: absolute;
  left: 5%;
  top: 50%;
  transform: translateY(-45%);
  z-index: 4;
  width: min(370px, 90%);
}
h2 {
  font-size: 32px;
  letter-spacing: -0.05em;
  margin: 5px 0 14px;
}
dl {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
  font-size: 14px;
}
dd {
  margin: 0;
}
dt {
  font: 700 13px monospace;
}
#close {
  margin: 15px 0 0;
}
dialog {
  max-width: 90%;
  width: 400px;
}
dialog::backdrop {
  background: #182620b8;
}
#hud {
  color: white;
  pointer-events: none;
  text-shadow: 0 1px 4px #171f1a;
}
#orders,
#vitals,
#weapon {
  position: absolute;
  background: #1e2924d9;
  border-left: 3px solid #f7aa60;
  padding: 10px 15px;
}
#orders {
  top: 4%;
  left: 3%;
}
#orders strong,
#weapon b,
#weapon span {
  display: block;
}
#orders small,
#vitals small,
#weapon small {
  color: #e2c19c;
}
#compass {
  position: absolute;
  left: 50%;
  top: 4%;
  transform: translateX(-50%);
  font: 700 13px monospace;
  letter-spacing: 0.14em;
}
#vitals {
  bottom: 6%;
  left: 3%;
}
meter {
  display: block;
  width: 110px;
  height: 12px;
}
#weapon {
  bottom: 86px;
  right: 3%;
}
#weapon b {
  font: 800 30px Arial;
}
#weaponName, #slots {text-transform: uppercase;}
#slots {display:flex;gap:7px;margin:0 0 8px;font:700 10px monospace;color:#d2d4c8;}
#slots i {font-style:normal;padding:2px 0;border-bottom:2px solid transparent;}
#slots .selected {color:#ffc18b;border-bottom-color:currentColor;}
#weapon #role {font:12px Arial;letter-spacing:0;margin-top:1px;}
.place,
#weapon span {
  letter-spacing: 0.1em;
}
#reticle,
#marker,
#notice {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font: 18px monospace;
}
#marker {
  font: 700 28px monospace;
  color: #ffce76;
  text-align: center;
}
#marker span {
  display: block;
  font: 700 11px monospace;
}
#notice {
  top: auto;
  bottom: 13%;
  font: 700 14px monospace;
  background: #26392deb;
  padding: 9px;
  text-align: center;
}
#notice:empty {
  display: none;
}
#damage {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 10vw #ac3825;
  opacity: 0;
}
@media (max-width: 700px) {
  .plate {
    right: 0;
    width: 100%;
    height: 40%;
    top: 8%;
    object-fit: contain;
  }
  .brieftext {
    width: 90%;
    top: auto;
    bottom: 13%;
    transform: none;
  }
  .brieftext p {
    max-width: 100%;
  }
  .serial {
    font-size: 10px;
  }
  h1 {
    font-size: clamp(58px, 13vw, 92px);
  }
  header span {
    display: none;
  }
  #compass {
    right: 3%;
    left: auto;
    transform: none;
  }
  #weapon {
    bottom: 60px;
  }
  .brieftext button {
    font-size: 14px;
  }
  footer {
    font-size: 9px;
  }
}
@media (max-height: 490px) {
  header {
    top: 2%;
    padding-bottom: 3px;
  }
  footer {
    bottom: 2%;
    padding-top: 4px;
  }
  .brieftext {
    top: 50%;
  }
  h1 {
    font-size: 52px;
    margin: 12px 0;
  }
  .brieftext p {
    margin: 6px 0 12px;
  }
  .plate {
    height: 100%;
    top: 0;
  }
}
