:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #354c59;
  --ink: #354c59;
  --gold: #a48752;
  --paper: #f0f3f1;
  --line: #647e8c40;
  font-synthesis: none;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #dce6ec;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #94763f;
  outline-offset: 6px;
}
button:disabled {
  opacity: 0.5;
}
button {
  border: 0;
}
button[hidden],
[hidden] {
  display: none !important;
}
#world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
#vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 53% 44%, transparent 40%, #233f5220 100%);
  mix-blend-mode: multiply;
}
#flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: #eef4f6;
  opacity: 0;
  z-index: 8;
  transition: opacity 0.7s;
}
#masthead {
  position: fixed;
  top: max(35px, env(safe-area-inset-top));
  left: max(45px, env(safe-area-inset-left));
  right: max(45px, env(safe-area-inset-right));
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 15;
}
.masthead-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}
.masthead-actions button {
  min-height: 44px;
  min-width: 44px;
}
#fullscreen svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}
#fullscreen span {
  opacity: 1;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  color: inherit;
  font-size: 9px;
  letter-spacing: 3px;
}
.wordmark svg {
  width: 29px;
  height: 29px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
}
.icon-button {
  padding: 8px 0;
  background: none;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 9px;
  letter-spacing: 2px;
}
.icon-button span {
  opacity: 0.6;
}
.sound-bars {
  font-size: 15px;
  font-style: normal;
  letter-spacing: 2px;
}
.overlay {
  position: fixed;
  inset: 0;
  z-index: 5;
}
#menu {
  background: linear-gradient(90deg, #f0f6f757 0%, #f0f6f726 38%, #f0f6f700 66%);
}
.menu-copy {
  position: absolute;
  top: 26%;
  left: 9.3%;
  width: 82.7%;
  max-width: 600px;
}
.eyebrow {
  font-size: 8px;
  letter-spacing: 3px;
  line-height: 1.8;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 13px;
}
.eyebrow > span {
  height: 1px;
  width: 28px;
  background: var(--gold);
}
h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(60px, 7.4vw, 112px);
  font-weight: 400;
  letter-spacing: 0.13em;
  margin: 29px 0 24px;
  line-height: 1;
}
h1 > span {
  font-family: Arial, Helvetica, sans-serif;
  display: block;
  font-size: 11px;
  letter-spacing: 0.58em;
  margin: 23px 0 0 7px;
}
.intro {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink);
  margin: 35px 0 31px;
}
.primary {
  background: #3c5664;
  color: #f3f5f2;
  min-height: 52px;
  padding: 0 23px;
  font-size: 11px;
  letter-spacing: 1.1px;
  min-width: 209px;
  display: flex;
  justify-content: space-between;
  gap: 40px;
  align-items: center;
  transition:
    background 0.2s,
    transform 0.2s;
}
.primary:hover {
  background: #243f4e;
  transform: translateY(-2px);
}
.primary > span {
  font-size: 21px;
  font-weight: 300;
}
.text-button {
  display: block;
  background: none;
  padding: 13px 0;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-align: left;
}
.text-button:hover {
  color: #9b7d48;
}
.menu-secondary {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 24px;
  font-size: 10px;
  color: #5c7180;
}
.menu-secondary button {
  background: none;
  padding: 0;
  font-size: 10px;
  letter-spacing: 0.5px;
}
.menu-secondary button:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}
.menu-note {
  position: absolute;
  right: 7%;
  bottom: 20%;
  display: flex;
  gap: 17px;
  align-items: flex-start;
}
.note-rule {
  width: 27px;
  height: 1px;
  background: var(--gold);
  margin-top: 10px;
}
.menu-note p {
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 13px;
  line-height: 1.7;
  margin: 0;
  color: #546f7c;
}
.menu-footer {
  position: absolute;
  bottom: 31px;
  left: 45px;
  right: 45px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 8px;
  letter-spacing: 2px;
  color: #526d7a;
}
.edition b {
  color: var(--gold);
  font-size: 19px;
  margin-left: 14px;
  font-weight: 400;
}
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}
#chapter {
  position: absolute;
  left: 45px;
  top: 113px;
  display: flex;
  gap: 15px;
  align-items: center;
}
#chapter-number {
  font-family: Georgia, serif;
  font-size: 32px;
  opacity: 0.45;
  border-right: 1px solid var(--line);
  padding-right: 15px;
}
#chapter-name {
  font-family: Georgia, serif;
  font-size: 16px;
  margin: 0 0 7px;
}
#objective {
  font-size: 9px;
  letter-spacing: 1px;
  color: #637783;
}
#compass {
  position: absolute;
  top: 46px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 40px;
  font-size: 8px;
  opacity: 0.65;
}
#compass > div {
  position: relative;
  width: 1px;
  height: 16px;
}
#compass b {
  position: absolute;
  left: -3px;
  top: -12px;
  font-weight: 400;
}
#needle {
  position: absolute;
  top: 8px;
  left: -3px;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-bottom: 7px solid #997e4f;
  transform-origin: 3px 0;
}
#beacons {
  position: absolute;
  top: 119px;
  right: 46px;
  display: flex;
  gap: 13px;
}
#beacons i {
  width: 8px;
  height: 8px;
  border: 1px solid #8a979e;
  transform: rotate(45deg);
  transition: all 1s;
}
#beacons i.lit {
  background: #b7995f;
  border-color: #c1a168;
  box-shadow: 0 0 17px #e9c77c;
}
#awareness {
  position: absolute;
  left: 50%;
  bottom: 110px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  letter-spacing: 1.5px;
  transition: color 1s;
  white-space: nowrap;
}
#awareness-icon {
  font-size: 24px;
}
#awareness.quiet {
  opacity: 0;
}
#awareness.hidden {
  color: #3d6575;
}
#awareness.danger {
  color: #9e553b;
}
#prompt {
  position: absolute;
  left: 50%;
  top: 59%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.7px;
  background: #eef3f0d9;
  padding: 10px 17px;
  border: 1px solid #fff8;
}
kbd {
  font-family: inherit;
  font-size: 9px;
  letter-spacing: 1px;
  border: 1px solid #73889466;
  padding: 6px;
  white-space: nowrap;
}
#energy {
  position: absolute;
  bottom: 77px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
#energy span {
  width: 20px;
  height: 2px;
  background: #a28b60;
  transition: opacity 0.2s;
}
#energy span.empty {
  opacity: 0.2;
}
#hint {
  position: absolute;
  bottom: 29px;
  left: 45px;
  display: flex;
  gap: 25px;
  font-size: 8px;
  letter-spacing: 1px;
}
#hint b {
  font-weight: 400;
  opacity: 0.55;
  margin-left: 6px;
}
#map-button {
  position: absolute;
  bottom: 23px;
  right: 45px;
  pointer-events: auto;
}
#toast {
  position: fixed;
  top: 24%;
  left: 50%;
  transform: translate(-50%, -8px);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  z-index: 12;
  transition:
    opacity 0.8s,
    transform 0.8s;
  width: min(86%, 550px);
}
#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
#toast > span {
  font-size: 8px;
  letter-spacing: 3px;
  color: #927549;
}
#toast p {
  font-family: Georgia, serif;
  font-size: 17px;
  line-height: 1.6;
  color: #344e5d;
  text-shadow: 0 1px 8px #f2f7f6;
}
#area-title {
  position: fixed;
  left: 0;
  right: 0;
  top: 28%;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.5s;
  z-index: 7;
  text-shadow: 0 2px 18px #fff;
}
#area-title.visible {
  opacity: 1;
}
#area-title small {
  font-size: 9px;
  letter-spacing: 5px;
}
#area-title h2 {
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: 42px;
  margin: 20px 0 12px;
  letter-spacing: 2px;
}
#area-title p {
  font-size: 10px;
  letter-spacing: 1px;
}
.panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: #dce6e9b8;
  backdrop-filter: blur(13px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  overflow: auto;
}
.panel {
  max-width: 460px;
  width: 100%;
  padding: 28px 36px;
  border-top: 1px solid #7189954a;
}
.panel h2 {
  font-family: Georgia, serif;
  font-size: 38px;
  line-height: 1.2;
  font-weight: 400;
  margin: 23px 0;
}
.panel > p:not(.eyebrow) {
  font-size: 13px;
  line-height: 1.9;
  color: #5c717e;
}
.panel > .primary {
  margin-top: 28px;
  width: 100%;
}
.panel > .text-button {
  margin-top: 6px;
}
.wide {
  max-width: 680px;
}
.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 30px;
  margin: 30px 0;
}
.control-grid p {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 11px;
  line-height: 1.5;
}
.control-grid kbd {
  flex-shrink: 0;
  min-width: 59px;
  text-align: center;
  font-size: 8px;
}
.panel .quiet-copy {
  font-size: 11px;
  line-height: 1.8;
  opacity: 0.8;
}
.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 11px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.setting select {
  font: inherit;
  color: inherit;
  max-width: 170px;
  padding: 8px;
  border: 1px solid var(--line);
  background: #eaf0f0;
}
.setting input {
  width: 140px;
  accent-color: #677c85;
}
.setting.check input {
  width: auto;
}
.map-panel {
  max-width: 400px;
  padding-top: 15px;
}
.map-panel h2 {
  margin-bottom: 0;
}
.map-panel svg {
  width: 100%;
  max-height: 44vh;
}
.map-route {
  stroke: url(#map-path);
  stroke-width: 1;
  stroke-dasharray: 3 5;
  fill: none;
}
.map-mountains {
  fill: none;
  stroke: #8ba0ac;
  stroke-width: 1;
}
.map-panel text {
  font-size: 7px;
  letter-spacing: 1px;
  fill: #758995;
}
.map-panel circle {
  fill: #ba995b;
  stroke: #fff;
  stroke-width: 1.5;
}
.ending-panel {
  text-align: center;
  max-width: 560px;
}
.ending-panel .eyebrow {
  justify-content: center;
}
.ending-panel h2 {
  font-size: 50px;
}
.ending-symbol {
  font-size: 60px;
  color: #ae8c50;
}
.ending-panel .text-button {
  margin: 15px auto 25px;
}
.ending-panel small {
  font-size: 9px;
  line-height: 1.8;
  opacity: 0.65;
}
.ending-panel .primary {
  text-align: left;
}
#loading {
  position: fixed;
  inset: 0;
  background: #e3ebee;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 0.8s;
}
.loading-mark {
  font-size: 60px;
  font-family: Georgia, serif;
  font-weight: 300;
  animation: breathe 2s infinite;
}
#loading p {
  font-size: 9px;
  letter-spacing: 4px;
  margin-top: 30px;
}
#loading > span {
  width: 100px;
  height: 1px;
  background: #7f959e40;
  margin-top: 13px;
  position: relative;
}
#loading > span:after {
  content: '';
  position: absolute;
  height: 1px;
  background: #a38a59;
  width: 40px;
  animation: load 1.5s ease-in-out infinite;
}
#touch {
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
}
#joystick {
  position: absolute;
  bottom: 62px;
  left: max(35px, env(safe-area-inset-left));
  width: 105px;
  height: 105px;
  border-radius: 50%;
  border: 1px solid #6a859950;
  background: #eef3f210;
  pointer-events: auto;
  touch-action: none;
}
#joystick i {
  position: absolute;
  width: 39px;
  height: 39px;
  left: 32px;
  top: 32px;
  border-radius: 50%;
  border: 1px solid #69829160;
  background: #e7eff066;
}
.touch-actions {
  position: absolute;
  right: max(25px, env(safe-area-inset-right));
  bottom: max(45px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.touch-actions button {
  pointer-events: auto;
  touch-action: none;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  font-size: 8px;
  letter-spacing: 1px;
  background: #e8eff177;
  border: 1px solid #758b9b55;
}
#touch-pause {
  position: absolute;
  top: 90px;
  right: 26px;
  pointer-events: auto;
  background: none;
  font-size: 20px;
}
.noscript {
  position: fixed;
  inset: 0;
  background: #e3ebee;
  display: grid;
  place-items: center;
  z-index: 99;
}
@keyframes breathe {
  50% {
    opacity: 0.35;
    transform: translateY(-4px);
  }
}
@keyframes load {
  50% {
    transform: translateX(60px);
  }
}
@media (max-width: 850px) {
  #masthead {
    left: max(25px, env(safe-area-inset-left));
    right: max(25px, env(safe-area-inset-right));
    top: max(23px, env(safe-area-inset-top));
  }
  .menu-copy {
    left: 8%;
    top: 24%;
  }
  .menu-note {
    right: 7%;
    bottom: 15%;
  }
  .menu-footer {
    left: 25px;
    right: 25px;
    font-size: 7px;
  }
  .menu-footer > span:nth-child(2) {
    display: none;
  }
  .menu-copy h1 {
    font-size: 70px;
  }
  #hint {
    gap: 15px;
    left: 25px;
  }
  #chapter {
    left: 25px;
    top: 92px;
  }
  #compass {
    top: 35px;
  }
  #beacons {
    right: 26px;
    top: 100px;
  }
  .wordmark {
    font-size: 8px;
    letter-spacing: 2px;
  }
}
@media (max-width: 550px) {
  .masthead-actions {
    gap: 12px;
  }
  #fullscreen {
    letter-spacing: 1px;
  }
  .menu-copy {
    left: 8%;
    top: 23%;
  }
  .menu-copy h1 {
    font-size: 53px;
    letter-spacing: 0.1em;
    margin-top: 24px;
  }
  h1 > span {
    font-size: 9px;
    letter-spacing: 0.38em;
    margin-top: 18px;
  }
  .eyebrow {
    font-size: 7px;
    letter-spacing: 2px;
  }
  .intro {
    font-size: 16px;
    margin: 30px 0;
  }
  .menu-note {
    display: none;
  }
  .menu-footer .edition {
    font-size: 0;
  }
  .menu-footer .edition b {
    font-size: 18px;
  }
  .control-grid {
    grid-template-columns: 1fr;
    gap: 0;
    margin: 15px 0;
  }
  .control-grid p {
    margin: 7px 0;
  }
  .panel {
    padding: 20px 5px;
  }
  .panel-overlay {
    padding: 25px;
  }
  .panel h2 {
    font-size: 32px;
  }
  .panel .primary {
    min-height: 48px;
  }
  .wordmark > span {
    font-size: 7px;
    letter-spacing: 1.4px;
  }
  .icon-button {
    font-size: 8px;
    gap: 6px;
  }
  .sound-bars {
    display: none;
  }
  #hint {
    display: none;
  }
  #chapter-name {
    font-size: 13px;
  }
  #objective {
    font-size: 8px;
  }
  #compass {
    display: none;
  }
  #awareness {
    bottom: 213px;
    letter-spacing: 1px;
    font-size: 9px;
  }
  #energy {
    bottom: 190px;
  }
  #map-button {
    bottom: 20px;
    right: 25px;
  }
  #area-title h2 {
    font-size: 29px;
  }
  #area-title p {
    max-width: 80%;
    margin: auto;
    line-height: 1.8;
  }
  .ending-panel h2 {
    font-size: 40px;
  }
  .menu-secondary {
    margin-top: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
#photo {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  text-align: center;
}
#photo > p {
  font-size: 8px;
  letter-spacing: 4px;
  margin-top: 35px;
}
#photo > small {
  display: block;
  font-size: 9px;
  letter-spacing: 1px;
  opacity: 0.65;
}
#photo > div {
  position: absolute;
  bottom: 30px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 16px;
}
#photo button {
  pointer-events: auto;
  background: #edf3f0cf;
  padding: 15px 22px;
  font-size: 10px;
  letter-spacing: 1px;
  border: 1px solid #70899544;
}
#photo button:hover {
  background: #fff;
}
#qa-panel {
  position: fixed;
  right: 14px;
  bottom: 64px;
  z-index: 70;
  max-width: 540px;
  padding: 10px;
  background: #162c3ddd;
  color: #fff;
  font-size: 10px;
  border-radius: 5px;
}
#qa-panel summary {
  cursor: pointer;
  font-size: 10px;
  letter-spacing: 1px;
}
#qa-panel output {
  display: block;
  white-space: pre-wrap;
  font-family: monospace;
  font-size: 10px;
  line-height: 1.8;
  margin: 9px 0;
}
#qa-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
#qa-actions button {
  font-size: 9px;
  padding: 7px;
  color: #243b4b;
  background: #dce9ee;
  border-radius: 2px;
}
#ending {
  background: #e5eceeb0;
  backdrop-filter: blur(5px);
}
.panel-overlay {
  align-items: flex-start;
}
.panel {
  margin: auto;
}

/* Expedition identity and per-world saves live on the opening screen. */
.expedition-picker {
  max-width: 390px;
  margin: 1.35rem 0 1.5rem;
}
.expedition-picker label {
  display: block;
  font-size: 9px;
  letter-spacing: 0.2em;
  margin-bottom: 0.6rem;
  opacity: 0.7;
}
.expedition-picker select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  color: inherit;
  border: 1px solid rgba(62, 91, 106, 0.28);
  border-radius: 3px;
  background: rgba(246, 250, 250, 0.4);
  font: inherit;
  font-size: 13px;
}
.expedition-picker p {
  margin: 0.65rem 0 0;
  max-width: 370px;
  font-size: 11px;
  line-height: 1.65;
  opacity: 0.72;
}
@media (max-height: 760px) {
  .menu-copy {
    top: 15%;
    max-height: calc(85dvh - 80px);
    overflow-y: auto;
    padding-bottom: 6px;
  }
  .menu-copy h1 {
    margin: 20px 0;
  }
  .intro {
    margin: 24px 0 20px;
  }
  .menu-secondary {
    margin-top: 14px;
  }
  .expedition-picker {
    margin: 0.8rem 0 1rem;
  }
  .expedition-picker p {
    display: none;
  }
}
@media (max-height: 520px) {
  .menu-copy {
    top: 70px;
    max-height: calc(100dvh - 130px);
  }
  .menu-copy h1 {
    font-size: clamp(42px, 8vw, 68px);
    margin: 12px 0;
  }
  .menu-copy h1 > span {
    margin-top: 12px;
    font-size: 9px;
  }
  .intro {
    font-size: 15px;
    margin: 15px 0;
  }
  .menu-footer {
    bottom: 16px;
  }
}
@media (max-height: 520px) and (min-width: 550px) {
  .menu-copy {
    top: max(82px, calc(env(safe-area-inset-top) + 58px));
    left: max(25px, env(safe-area-inset-left));
    right: max(25px, env(safe-area-inset-right));
    width: auto;
    max-width: 760px;
    max-height: calc(100dvh - 112px);
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    column-gap: 30px;
  }
  .menu-copy > .eyebrow {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
  }
  .menu-copy h1 {
    grid-column: 1;
    grid-row: 2;
    font-size: clamp(42px, 6vw, 56px);
    margin: 8px 0;
  }
  .menu-copy h1 > span {
    margin: 10px 0 0 4px;
  }
  .menu-copy .intro {
    grid-column: 1;
    grid-row: 3;
    font-size: 14px;
    margin: 8px 0 0;
  }
  .expedition-picker {
    grid-column: 2;
    grid-row: 1 / 3;
    width: 100%;
    margin: 0 0 10px;
  }
  #start {
    grid-column: 2;
    grid-row: 3;
    align-self: start;
    min-width: 0;
  }
  #continue {
    grid-column: 2;
    grid-row: 4;
    padding: 10px 0;
  }
  .menu-secondary {
    grid-column: 2;
    grid-row: 5;
    margin-top: 5px;
  }
  .menu-note {
    display: none;
  }
}

#map-landmarks path {
  fill: rgba(139, 171, 183, 0.12);
  stroke: #7597a8;
  stroke-width: 0.85;
}
.map-places {
  margin: -0.3rem 0 0.8rem;
  color: #7893a0;
  font-size: 10px;
  letter-spacing: 0.06em;
}
