:root {
  color-scheme: dark;
  --ink: #f6ead1;
  --gold: #d4b88b;
  --pearl: #ffc572;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background: #092525;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
canvas#world,
.shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}
#world {
  cursor: crosshair;
}
.shade {
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      #031514bc,
      transparent 23%,
      transparent 57%,
      #021515ee
    ),
    radial-gradient(ellipse at 50% 42%, transparent 50%, #03161688);
}
#shell {
  position: absolute;
  pointer-events: none;
  bottom: 0;
  right: 1.5%;
  width: min(42vw, 560px);
  height: auto;
}
header,
nav,
aside,
#panel,
footer,
#target,
#message,
#controls,
#walk,
#reticle {
  position: absolute;
}
header {
  left: 3.25%;
  top: 4.8%;
  display: flex;
  align-items: center;
  gap: 13px;
  pointer-events: none;
}
header svg {
  width: 43px;
  color: var(--gold);
}
small,
.depth,
#target,
footer,
aside,
kbd,
.chapter,
#message,
#next,
dt,
dd,
#close {
  font-family: Arial, sans-serif;
}
small,
.depth,
#target,
.chapter,
#message,
#next,
#close {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}
header small {
  font-size: 8px;
  color: #decbac;
}
h1 {
  font-size: clamp(19px, 2vw, 31px);
  line-height: 1.12;
  margin: 3px 0 0;
  font-weight: normal;
  letter-spacing: -0.03em;
}
nav {
  right: 3.25%;
  top: 5%;
  display: flex;
  gap: 8px;
}
button {
  color: inherit;
  font: inherit;
  cursor: pointer;
}
nav button {
  width: 33px;
  height: 33px;
  border-radius: 50%;
  border: 1px solid #bba98080;
  background: #0b2323aa;
  font: italic 20px Georgia;
}
nav svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  vertical-align: middle;
}
button:hover,
button:focus-visible {
  border-color: #fff0c0;
  color: white;
  background-color: #284844;
}
#panel {
  left: 3.6%;
  bottom: 100px;
  pointer-events: none;
  max-width: 42vw;
  text-shadow: 0 2px 12px #051716;
}
.chapter {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--gold);
}
.chapter b {
  width: 26px;
  height: 1px;
  background: var(--gold);
}
.chapter b:last-child {
  width: 9px;
}
.chapter small {
  font-size: 9px;
}
h2 {
  font-weight: 400;
  font-size: clamp(33px, 4.4vw, 72px);
  letter-spacing: -0.05em;
  line-height: 1;
  margin: 10px 0;
}
#goal {
  font-size: clamp(13px, 1.23vw, 18px);
  line-height: 1.45;
  color: #d6d9c7;
  margin: 0;
}
footer {
  bottom: 30px;
  left: 3.6%;
  display: flex;
  gap: 21px;
  align-items: center;
  font-size: 11px;
  color: #d9d9c7;
  border-top: 1px solid #c8bea148;
  padding-top: 13px;
}
footer span,
aside button {
  display: flex;
  align-items: center;
  gap: 7px;
}
kbd {
  font-size: 8px;
  letter-spacing: 0.06em;
  border: 1px solid #bfb79766;
  border-radius: 3px;
  padding: 3px 5px;
  font-weight: 600;
  color: #f0e2c6;
}
.depth {
  color: #bba980;
  letter-spacing: 0.24em;
  font-size: 10px;
}
aside {
  left: 3.6%;
  bottom: 65px;
  display: flex;
  gap: 10px;
}
aside button,
#next,
#close {
  border: 1px solid #ae987569;
  background: #062326c9;
  border-radius: 3px;
  padding: 5px 8px;
  font-size: 11px;
}
.pearl {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--pearl);
  box-shadow: 0 0 8px var(--pearl);
}
#target {
  pointer-events: none;
  transform: translate(-50%, -100%);
  text-align: center;
  white-space: nowrap;
  font-size: 8px;
  color: #fff3cf;
  text-shadow: 0 1px 3px #000;
}
#target i {
  display: block;
  border: 1px solid currentColor;
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  margin: 0 auto 5px;
}
#reticle {
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border: 1px solid #fcf6d6;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 0 4px #122;
}
#message {
  top: 17%;
  left: 50%;
  transform: translateX(-50%);
  color: #fff1c8;
  text-shadow: 0 1px 6px #000;
  pointer-events: none;
  text-align: center;
}
#next,
#close {
  pointer-events: auto;
  padding: 9px 14px;
  margin-top: 12px;
  color: #f9e3b9;
}
#controls {
  top: 13%;
  right: 3.25%;
  max-width: min(330px, 88vw);
  padding: 22px;
  background: #0b2729f5;
  border: 1px solid #bca170;
}
h3 {
  font-size: 25px;
  font-weight: normal;
  margin: 0;
}
#controls p {
  font-size: 15px;
  line-height: 1.5;
}
dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-size: 12px;
}
dd {
  margin: 0;
  text-align: right;
  color: var(--gold);
}
#walk {
  display: none;
}
button[hidden],
[hidden] {
  display: none !important;
}
@media (pointer: coarse) {
  #walk {
    display: grid;
    grid-template-columns: repeat(3, 30px);
    bottom: 18%;
    right: 12px;
    gap: 2px;
  }
  #walk button {
    background: #0a262acc;
    border: 1px solid #bca17077;
    height: 28px;
    touch-action: none;
  }
  #walk button:first-child {
    grid-column: 2;
  }
  #walk button:nth-child(2) {
    grid-column: 1;
  }
  footer {
    display: none;
  }
}
@media (max-width: 600px) {
  #shell {
    width: 61vw;
    right: -6%;
    bottom: 3%;
  }
  header {
    gap: 7px;
  }
  header svg {
    width: 32px;
  }
  header small {
    font-size: 7px;
  }
  #panel {
    bottom: 110px;
    max-width: 72vw;
  }
  aside {
    bottom: 64px;
  }
  .depth {
    display: none;
  }
  #goal {
    max-width: 235px;
  }
  footer {
    bottom: 20px;
    gap: 10px;
  }
  #message {
    width: 90%;
  }
}
@media (max-height: 450px) {
  #panel {
    bottom: 72px;
  }
  aside {
    bottom: 37px;
  }
  footer {
    bottom: 6px;
    padding-top: 4px;
  }
  h2 {
    font-size: 29px;
    margin: 4px 0;
  }
  #shell {
    width: 35vw;
  }
}
