:root {
  color-scheme: dark;
  --cream: #f1e7cd;
  --muted: #b5b79c;
  --gold: #cfac70;
  --panel: rgba(22, 29, 23, 0.89);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow: hidden;
  background: #2b382c;
  color: var(--cream);
  font:
    14px Georgia,
    serif;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
#game {
  display: block;
  width: 100vw;
  height: 100vh;
  outline: none;
  image-rendering: pixelated;
}
.topbar {
  position: fixed;
  top: 32px;
  left: 38px;
  right: 38px;
  display: flex;
  align-items: flex-start;
  gap: 28px;
  pointer-events: none;
  text-shadow: 0 2px 10px #121a16;
}
.brand {
  width: 230px;
}
.eyebrow {
  font:
    10px 'Segoe UI',
    sans-serif;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--gold);
}
h1 {
  font-size: 34px;
  font-weight: normal;
  letter-spacing: 8px;
  margin: 5px 0 8px;
}
h1 span {
  font-size: 19px;
  vertical-align: middle;
  letter-spacing: 0;
  margin-left: 6px;
}
.brand-line {
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
  width: 200px;
}
.location {
  margin: auto;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 11px 20px;
  border: 1px solid #c6b78729;
  background: var(--panel);
  border-radius: 4px;
  box-shadow: 0 6px 30px #0e161329;
}
.location > div > span {
  font-size: 16px;
}
.location small {
  display: block;
  font:
    10px 'Segoe UI',
    sans-serif;
  color: var(--muted);
  margin-top: 5px;
  letter-spacing: 1px;
}
.sun {
  color: var(--gold);
  font-size: 26px;
}
.seed,
.clock {
  border-left: 1px solid #c6b78730;
  margin-left: 15px;
  padding-left: 18px;
  font:
    8px 'Segoe UI',
    sans-serif;
  letter-spacing: 2px;
  color: var(--muted);
  line-height: 1.8;
}
.seed b,
.clock b {
  color: var(--cream);
  font-size: 12px;
  font-weight: 400;
}
.clock {
  margin-left: 0;
}
.topbar > button {
  pointer-events: auto;
  width: 38px;
  height: 38px;
  background: var(--panel);
  border: 1px solid #d3be8a55;
  border-radius: 50%;
  font-size: 18px;
  margin-left: 190px;
}
.topbar > #sound-button {
  margin-left: 0;
  font-size: 16px;
}
.topbar > #help-button {
  margin-left: 124px;
}
#sound-panel {
  position: fixed;
  top: 80px;
  right: 38px;
  z-index: 30;
  display: grid;
  gap: 10px;
  min-width: 220px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid #d3be8a55;
  border-radius: 4px;
  font:
    12px 'Segoe UI',
    sans-serif;
  color: var(--cream);
}
#sound-panel[hidden] {
  display: none;
}
#sound-panel label {
  display: grid;
  gap: 4px;
}
#sound-panel label.mute {
  display: flex;
  gap: 8px;
  align-items: center;
}
#sound-panel input[type='range'] {
  width: 100%;
  accent-color: var(--gold);
}
.chapter {
  position: fixed;
  top: 158px;
  left: 38px;
  pointer-events: none;
  text-shadow: 0 2px 5px #151d19;
}
.chapter h2 {
  font-size: 24px;
  font-weight: normal;
  margin: 10px 0;
}
.chapter p {
  color: #d4d7be;
  font-size: 13px;
  line-height: 1.7;
}
.objective {
  margin-top: 23px;
  font:
    11px 'Segoe UI',
    sans-serif;
  color: #e1d6b6;
}
.objective span {
  font-size: 23px;
  vertical-align: middle;
  color: var(--gold);
  margin-right: 8px;
}
#compass {
  position: fixed;
  right: 44px;
  top: 116px;
  text-align: center;
  color: var(--cream);
  font:
    10px 'Segoe UI',
    sans-serif;
  width: 42px;
  text-shadow: 0 2px 8px #000;
}
#compass-arrow {
  font-size: 42px;
  color: var(--gold);
  line-height: 1.3;
}
#compass small {
  font-size: 9px;
  color: #e3ddc2;
}
#hint {
  position: fixed;
  left: 50%;
  bottom: 133px;
  transform: translateX(-50%);
  font:
    11px 'Segoe UI',
    sans-serif;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px #000;
  color: #f2ecd9;
  background: #1822198c;
  padding: 9px 18px;
  border-radius: 3px;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 1s;
}
footer {
  position: fixed;
  left: 32px;
  right: 32px;
  bottom: 27px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}
.player-card {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--panel);
  border: 1px solid #c6b78730;
  padding: 10px 18px 10px 10px;
  border-radius: 5px;
  min-width: 220px;
}
.portrait {
  position: relative;
  width: 48px;
  height: 57px;
  background: #72745235;
  overflow: hidden;
  border: 1px solid #bfa06a77;
  border-radius: 3px;
}
.portrait img {
  position: absolute;
  width: 400px;
  height: 90px;
  max-width: none;
  left: 0;
  top: 0;
  image-rendering: pixelated;
}
.player-card .eyebrow {
  font-size: 8px;
  letter-spacing: 2px;
}
.player-card strong {
  display: block;
  font-weight: 400;
  margin: 5px 0;
  font-size: 14px;
}
.state {
  font:
    10px 'Segoe UI',
    sans-serif;
  color: var(--muted);
}
.state i,
.live-dot {
  display: inline-block;
  border-radius: 50%;
  width: 5px;
  height: 5px;
  background: #9cab76;
  margin-right: 6px;
}
.actions {
  display: flex;
  align-items: center;
  gap: 3px;
  background: var(--panel);
  border: 1px solid #c6b78735;
  padding: 9px 13px;
  border-radius: 5px;
}
.actions button {
  background: transparent;
  border: 0;
  padding: 5px 10px;
  border-radius: 3px;
  min-width: 53px;
}
.actions button:hover {
  background: #e2cb9620;
}
.actions kbd {
  display: block;
  font:
    10px 'Segoe UI',
    sans-serif;
  color: var(--cream);
  border: 1px solid #c6b78755;
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 5px 8px;
  margin-bottom: 6px;
  min-height: 25px;
}
.actions span {
  font:
    9px 'Segoe UI',
    sans-serif;
  color: var(--muted);
}
.separator {
  height: 30px;
  border-left: 1px solid #c6b78730;
  margin: 0 4px;
}
.status {
  font:
    8px 'Segoe UI',
    sans-serif;
  letter-spacing: 2px;
  line-height: 1.7;
  text-align: right;
  min-width: 140px;
  text-shadow: 0 1px 5px #000;
}
.status small {
  display: block;
  font-size: 9px;
  letter-spacing: 1px;
  color: #d5d9c5;
}
.status small:last-child {
  color: #c0c6ad;
  font-size: 8px;
}
#loading {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  background: radial-gradient(ellipse at center, #394333, #172019);
  transition: opacity 0.6s;
}
#loading.done {
  opacity: 0;
  pointer-events: none;
}
.loading-mark {
  font-size: 74px;
  color: var(--gold);
  border: 1px solid #cfac7055;
  padding: 0 23px;
  margin-bottom: 25px;
}
.loading-line {
  width: 180px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin-top: 22px;
  animation: pulse 1.4s infinite;
}
#loading h2 {
  font-weight: normal;
  font-size: 27px;
  margin-top: 20px;
}
#loading p {
  font:
    12px 'Segoe UI',
    sans-serif;
  color: var(--muted);
  max-width: 540px;
  text-align: center;
}
dialog {
  background: #222b22;
  color: var(--cream);
  padding: 38px;
  border: 1px solid #9b886452;
  border-radius: 8px;
  max-width: 480px;
  box-shadow: 0 30px 100px #0009;
}
dialog::backdrop {
  background: #0c140f99;
  backdrop-filter: blur(5px);
}
dialog h2 {
  font-size: 29px;
  font-weight: normal;
  margin: 13px 0 28px;
}
dialog dl {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 15px;
  font:
    12px 'Segoe UI',
    sans-serif;
}
dialog dt {
  color: var(--gold);
}
dialog dd {
  margin: 0;
  color: #d3d5c5;
}
dialog p {
  font:
    12px/1.8 'Segoe UI',
    sans-serif;
  color: var(--muted);
  margin: 25px 0;
}
.close {
  position: absolute;
  right: 14px;
  top: 10px;
  font-size: 25px;
  border: 0;
  background: none;
}
.primary {
  width: 100%;
  text-align: left;
  padding: 13px 17px;
  background: #bb9c63;
  color: #1d251c;
  border: 0;
  border-radius: 3px;
}
.primary span {
  float: right;
}
@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}
@media (max-width: 1050px) {
  .topbar > button,
  .topbar > #help-button {
    margin-left: 0;
  }
  .brand {
    width: 200px;
  }
  .player-card {
    min-width: 0;
    padding-right: 12px;
  }
  .player-card strong {
    font-size: 12px;
  }
  .actions button {
    padding: 5px 6px;
  }
  .status {
    min-width: 80px;
  }
  .chapter {
    top: 140px;
  }
}
@media (max-width: 760px) {
  .topbar {
    top: 20px;
    left: 20px;
    right: 20px;
  }
  .brand {
    width: auto;
  }
  h1 {
    font-size: 25px;
    letter-spacing: 5px;
  }
  .brand .eyebrow {
    font-size: 7px;
  }
  .brand-line {
    width: 145px;
  }
  .location {
    margin: 0 0 0 auto;
    padding: 9px 12px;
  }
  .location .seed,
  .location .clock,
  .location small,
  .sun {
    display: none;
  }
  #sound-panel {
    top: 70px;
    right: 20px;
  }
  .location > div > span {
    font-size: 12px;
  }
  .chapter {
    left: 20px;
    top: 120px;
  }
  .chapter h2 {
    font-size: 19px;
  }
  .chapter p {
    display: none;
  }
  .chapter .objective {
    font-size: 9px;
  }
  .chapter .eyebrow {
    font-size: 8px;
  }
  footer {
    left: 15px;
    right: 15px;
    bottom: 15px;
    flex-wrap: wrap;
  }
  .player-card {
    display: none;
  }
  .status {
    display: none;
  }
  .actions {
    margin: auto;
  }
  .actions button {
    padding: 4px;
  }
  .actions kbd {
    font-size: 8px;
  }
  #hint {
    bottom: 105px;
    font-size: 9px;
  }
  #compass {
    right: 22px;
    top: 90px;
  }
}

.chapter {
  transition: opacity 1.8s;
}
.exploring .chapter {
  opacity: 0;
}
.location {
  background: rgba(20, 35, 29, 0.76);
}
.actions,
.player-card {
  background: rgba(20, 32, 25, 0.84);
}
