:root {
  font-family: "DM Sans", sans-serif;
  color: #f5f0e2;
  font-synthesis: none;
  --ink: #263f38;
  --cream: #f6f1e4;
  --gold: #e4bd79;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow: hidden;
  background: #9aaea0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button {
  transition:
    background 0.2s,
    transform 0.2s;
}
button:hover {
  filter: brightness(1.08);
}
button:active {
  transform: translateY(1px);
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
canvas:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
#world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
}
.vignette {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(20, 42, 36, 0.73),
      rgba(20, 42, 36, 0.18) 52%,
      transparent 75%
    ),
    linear-gradient(0deg, rgba(25, 43, 35, 0.5), transparent 35%);
  transition: opacity 1s;
}
body.playing .vignette {
  background:
    linear-gradient(0deg, rgba(20, 35, 30, 0.48), transparent 22%),
    linear-gradient(180deg, rgba(20, 35, 30, 0.3), transparent 22%);
}
header {
  position: fixed;
  left: 38px;
  right: 38px;
  top: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  z-index: 4;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--cream);
  font:
    500 16px "Manrope",
    sans-serif;
  letter-spacing: 1.8px;
}
.brand b {
  font-weight: 800;
}
.brand small {
  display: block;
  font-size: 7px;
  letter-spacing: 2.1px;
  margin-top: 5px;
  opacity: 0.75;
}
.brand-icon {
  font-size: 43px;
  font-family: Georgia;
  line-height: 1;
  color: var(--gold);
  border-right: 1px solid #ffffff33;
  padding-right: 15px;
}
nav {
  display: flex;
  gap: 9px;
}
.icon-btn {
  border: 1px solid #fff3;
  border-radius: 50%;
  width: 39px;
  height: 39px;
  color: var(--cream);
  background: #233e3540;
  font-size: 19px;
}
.icon-btn span {
  display: none;
}
#welcome {
  position: absolute;
  left: 7%;
  top: 28%;
  max-width: 560px;
  max-height: calc(72dvh - 24px);
  overflow-y: auto;
  padding-bottom: 4px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gold);
}
.eyebrow > span {
  width: 25px;
  height: 1px;
  background: var(--gold);
}
h1 {
  font:
    400 clamp(40px, 4.8vw, 72px) / 1.08 Georgia,
    serif;
  letter-spacing: -2px;
  margin: 22px 0;
}
h1 em {
  font-weight: 400;
  color: #e8c78e;
}
#welcome > p {
  font-size: 14px;
  line-height: 1.85;
  color: #e2e5d7;
  margin-bottom: 30px;
}
#join label {
  display: block;
  font-size: 8px;
  letter-spacing: 1.7px;
  color: #deded0;
  margin-bottom: 10px;
}
.name-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.name-row input {
  width: 180px;
  padding: 14px 16px;
  background: #f5f0e714;
  border: 1px solid #ffffff40;
  color: #fff;
  border-radius: 6px;
  font-size: 12px;
  backdrop-filter: blur(8px);
}
.name-row input::placeholder {
  color: #ddd;
}
.name-row button,
.primary {
  background: var(--gold);
  border: 0;
  border-radius: 5px;
  color: #334338;
  padding: 15px 20px;
  font-size: 12px;
  font-weight: 700;
}
.name-row button span {
  margin-left: 24px;
}
.preview-note {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 10px;
  margin-top: 16px;
  color: #dddcc8;
}
.preview-note span {
  color: var(--gold);
  font-size: 18px;
}
.welcome-foot {
  display: flex;
  gap: 25px;
  margin-top: 45px;
  font-size: 7px;
  letter-spacing: 1.6px;
  opacity: 0.6;
}
#hero-caption {
  position: absolute;
  right: 5%;
  bottom: 55px;
  text-align: right;
  text-shadow: 0 2px 18px #233b37;
}
#hero-caption > span {
  font-size: 9px;
  letter-spacing: 2px;
  color: #f0d2a4;
}
#hero-caption h2 {
  font: italic 30px/1.2 Georgia;
  margin: 14px 0;
}
#hero-caption > div {
  font-size: 7px;
  letter-spacing: 1.6px;
}
kbd {
  font:
    9px "DM Sans",
    sans-serif;
  padding: 4px 5px;
  border: 1px solid #ffffff40;
  border-radius: 3px;
  color: #fff9;
  margin-left: 10px;
}
dialog {
  border: 1px solid #e2dac5;
  border-radius: 14px;
  background: var(--cream);
  color: var(--ink);
  padding: 34px;
  width: min(480px, calc(100% - 28px));
  max-height: 90dvh;
  box-shadow: 0 25px 100px #152b3770;
}
dialog::backdrop {
  background: #172f3765;
  backdrop-filter: blur(7px);
}
dialog h2 {
  font: 34px/1.15 Georgia;
  letter-spacing: -0.7px;
  margin: 18px 0 12px;
}
dialog p {
  font-size: 12px;
  line-height: 1.75;
}
dialog .eyebrow {
  color: #a1783d;
  font-size: 8px;
}
.close {
  position: absolute;
  right: 14px;
  top: 12px;
  background: none;
  border: 0;
  color: #718172;
  font-size: 26px;
  width: 36px;
  height: 36px;
}
.muted {
  color: #7a8273;
}
.map-art {
  position: relative;
  background: #e8ead8;
  border: 1px solid #dbdfcb;
  border-radius: 7px;
  margin: 22px 0 12px;
  overflow: hidden;
}
.map-art svg {
  display: block;
  width: 100%;
}
.map-art > span {
  position: absolute;
  left: 16px;
  top: 14px;
  letter-spacing: 1.8px;
  font-size: 7px;
  color: #85917e;
}
.destination {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #dedcca;
}
.dest-icon {
  display: grid;
  place-items: center;
  background: #e1e7d8;
  width: 37px;
  height: 40px;
  border-radius: 7px;
  font-size: 22px;
  color: #5b7d68;
}
.dest-icon.volcano {
  background: #eedec6;
  color: #ae8854;
}
.destination h3 {
  font-size: 12px;
  margin: 0 0 4px;
}
.destination p {
  font-size: 9px;
  margin: 0;
  color: #848878;
}
.destination button {
  margin-left: auto;
  background: transparent;
  border: 0;
  color: #577d70;
  font-size: 10px;
  font-weight: 700;
  padding: 10px;
}
.full {
  width: 100%;
  margin-top: 20px;
}
.full > span {
  float: right;
}
.fine {
  font-size: 9px !important;
  color: #858978;
  line-height: 1.7 !important;
}
.setting {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid #dedcca;
  font-size: 12px;
  gap: 15px;
}
.setting select {
  max-width: 220px;
  font-size: 11px;
  background: #e6e9db;
  border: 1px solid #d2d9c6;
  border-radius: 4px;
  padding: 9px;
  color: var(--ink);
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0;
  font-size: 12px;
}
.check input {
  accent-color: #527968;
}
.secondary {
  background: transparent;
  border: 1px solid #b9c4af;
  color: #516e5e;
  padding: 12px;
  border-radius: 5px;
  font-size: 11px;
}
.answer-samples {
  display: flex;
  gap: 10px;
  margin: 25px 0;
}
.answer-samples span {
  flex: 1;
  text-align: center;
  padding: 20px 0;
  color: var(--cream);
  font: 26px Georgia;
  border-radius: 5px;
  background: #448e9b;
}
.answer-samples span:nth-child(2) {
  background: #c18c4d;
}
.answer-samples span:nth-child(3) {
  background: #9c688c;
}
.answer-samples span:nth-child(4) {
  background: #7c9e67;
}
#toast {
  position: absolute;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%);
  background: #f5efdf;
  color: #344b3d;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  max-width: 80%;
  text-align: center;
}
#toast.show {
  opacity: 1;
}
#metrics {
  position: absolute;
  right: 20px;
  top: 175px;
  font: 10px/1.8 monospace;
  background: #143025cc;
  padding: 12px;
  color: #e7e5bb;
  white-space: pre-line;
  pointer-events: none;
}
#loading {
  position: fixed;
  inset: 0;
  background: #243f39;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 20;
  transition: opacity 0.8s;
}
#loading h2 {
  font: 28px Georgia;
}
#loading p {
  font-size: 12px;
  color: #c3ccba;
}
.load-track {
  width: min(280px, 70vw);
  height: 6px;
  margin-top: 18px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}
#load-bar {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gold);
  transition: width 0.3s;
}
.loading-mark {
  font-size: 70px;
  color: var(--gold);
}
#route-banner {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 18px;
  align-items: center;
  background: #f3eddfeb;
  border-radius: 6px;
  padding: 10px 16px;
  color: var(--ink);
  font-size: 11px;
}
#route-banner button {
  border: 0;
  background: #d9dfce;
  border-radius: 4px;
  color: var(--ink);
  padding: 7px;
  font-size: 10px;
  white-space: nowrap;
}
#context-action {
  position: absolute;
  bottom: 155px;
  left: 50%;
  transform: translateX(-50%);
}
#context-action button {
  background: #e4bd79;
  border: 0;
  border-radius: 6px;
  padding: 12px 20px;
  font-size: 12px;
  color: var(--ink);
}
#touch-controls {
  display: none;
}
@media (pointer: coarse) {
  #touch-controls {
    display: block;
  }
  #joystick {
    position: absolute;
    left: calc(26px + env(safe-area-inset-left));
    bottom: calc(108px + env(safe-area-inset-bottom));
    width: 105px;
    height: 105px;
    border: 1px solid #fff7;
    background: #304c4444;
    border-radius: 50%;
    touch-action: none;
  }
  #joystick > div {
    position: absolute;
    left: 33px;
    top: 33px;
    width: 38px;
    height: 38px;
    background: #f0e4c8bb;
    border: 1px solid #fff9;
    border-radius: 50%;
    pointer-events: none;
  }
  #jump-button {
    position: absolute;
    right: calc(28px + env(safe-area-inset-right));
    bottom: calc(118px + env(safe-area-inset-bottom));
    width: 59px;
    height: 59px;
    border: 1px solid #fff7;
    background: #304c4477;
    color: #fff;
    border-radius: 50%;
    font-size: 26px;
    touch-action: none;
  }
}
@media (max-width: 760px) {
  header {
    left: max(20px, env(safe-area-inset-left));
    right: max(20px, env(safe-area-inset-right));
    top: max(20px, env(safe-area-inset-top));
  }
  .brand {
    font-size: 12px;
    gap: 8px;
  }
  .brand-icon {
    font-size: 35px;
    padding-right: 8px;
  }
  .brand small {
    font-size: 5px;
    letter-spacing: 1.4px;
  }
  nav {
    gap: 6px;
  }
  .icon-btn {
    width: 34px;
    height: 34px;
  }
  #welcome {
    left: 7%;
    top: 29%;
    right: 7%;
    max-height: calc(71dvh - 20px - env(safe-area-inset-bottom));
  }
  h1 {
    font-size: 49px;
  }
  #welcome > p {
    font-size: 12px;
  }
  #hero-caption {
    display: none;
  }
  .welcome-foot {
    margin-top: 30px;
  }
  dialog {
    padding: 28px;
  }
  dialog h2 {
    font-size: 30px;
  }
  .map-art {
    margin: 15px 0 5px;
  }
  .destination {
    padding: 11px 0;
  }
  .destination p {
    font-size: 8px;
  }
  #route-banner {
    bottom: 82px;
    max-width: 90%;
    width: max-content;
  }
  #metrics {
    top: 158px;
    right: 16px;
    font-size: 8px;
  }
  #loading h2 {
    font-size: 20px;
  }
  #loading p {
    font-size: 10px;
  }
}
@media (max-height: 650px) {
  #welcome {
    top: max(95px, calc(env(safe-area-inset-top) + 70px));
    max-height: calc(100dvh - 115px - env(safe-area-inset-bottom));
  }
  h1 {
    font-size: 42px;
    margin: 15px 0;
  }
  #welcome > p {
    margin-bottom: 15px;
  }
  .welcome-foot {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
@media (pointer: coarse) {
  #route-banner,
  #context-action,
  #prompt,
  #controls-line {
    bottom: calc(230px + env(safe-area-inset-bottom));
  }
  #toast {
    bottom: calc(285px + env(safe-area-inset-bottom));
  }
}

/* One line of keys. Contextual actions replace this text; they do not stack under it. */
#controls-line {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  max-width: min(920px, calc(100vw - 32px));
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(20, 32, 30, 0.82);
  color: #f6ecd6;
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
  z-index: 5;
}

/* "Press F" interaction prompt */
#prompt {
  position: absolute;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%);
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(20, 32, 30, 0.82);
  color: #f6ecd6;
  font-size: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
#prompt kbd {
  background: var(--gold);
  color: #1d2b28;
  border-radius: 5px;
  padding: 1px 7px;
  font-weight: 700;
}
#interact-button {
  position: absolute;
  right: calc(100px + env(safe-area-inset-right));
  bottom: calc(118px + env(safe-area-inset-bottom));
  width: 59px;
  height: 59px;
  touch-action: none;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(20, 32, 30, 0.6);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
}

/* Chat: a few recent lines that fade away, and a one-line input. */
#chat-log {
  position: absolute;
  left: max(18px, env(safe-area-inset-left));
  bottom: calc(86px + env(safe-area-inset-bottom));
  max-width: min(420px, 70vw);
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
  font-size: 14px;
  z-index: 6;
}
#chat-log div {
  background: rgba(20, 32, 30, 0.7);
  color: #f6ecd6;
  padding: 5px 10px;
  border-radius: 10px;
  transition: opacity 1.4s;
  width: fit-content;
}
#chat-log div.note {
  color: #d9cfa9;
  font-style: italic;
}
#chat-log div.fade {
  opacity: 0;
}
#chat-input {
  position: absolute;
  left: max(18px, env(safe-area-inset-left));
  bottom: calc(40px + env(safe-area-inset-bottom));
  width: min(420px, 80vw);
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(20, 32, 30, 0.88);
  color: #fff;
  font-size: 15px;
  z-index: 7;
}
