@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Lora:wght@400;500&display=swap");

:root {
  color-scheme: light;
  font-family: "DM Mono", monospace;
  color: #f8f3d8;
  background: #dce8d4;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}
main,
.garden {
  width: 100%;
  height: 100%;
}
.garden {
  position: fixed;
  inset: 0;
  height: 100dvh;
  overflow: hidden;
  background: #dce8d4;
}
.garden.is-night {
  background: #283d4d;
}
a {
  color: inherit;
}
button,
summary {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}
:focus-visible {
  outline: 2px solid #f4d996;
  outline-offset: 4px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
#viewport {
  position: absolute;
  inset: 0;
  touch-action: none;
  cursor: grab;
}
#viewport:active {
  cursor: grabbing;
}
#viewport canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.is-walking #viewport {
  cursor: none;
}
#explorer-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font: 23px/1 monospace;
  color: #fff9e8d9;
  text-shadow: 0 1px 3px #293e25;
}
#crosshair.has-target {
  color: #fff0a5;
}
#target-card {
  position: absolute;
  top: calc(50% + 27px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: max-content;
  max-width: calc(100% - 28px);
  padding: 14px 20px;
  text-align: center;
  color: #f8f3d8;
  background: #293e32e6;
  border: 1px solid #e8edc936;
  border-radius: 6px;
  box-shadow: 0 6px 24px #1b302524;
}
.target-eyebrow {
  font-size: 8px;
  letter-spacing: 1.8px;
  color: #c3caa6;
}
#target-name {
  font:
    500 17px "Lora",
    Georgia,
    serif;
}
#target-detail {
  font-size: 10px;
  max-width: 340px;
  line-height: 1.6;
}
#companion-message {
  position: absolute;
  bottom: 200px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(400px, calc(100% - 40px));
  width: max-content;
  padding: 12px 16px;
  border: 1px solid #e6e1b966;
  border-radius: 6px;
  background: #293e32e6;
  font-size: 11px;
  line-height: 1.7;
  text-align: center;
}
#action-message {
  position: absolute;
  bottom: 220px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(380px, calc(100% - 40px));
  width: max-content;
  padding: 12px 16px;
  background: #293e32ef;
  border: 1px solid #e6e1b966;
  border-radius: 6px;
  font-size: 11px;
  text-align: center;
  line-height: 1.7;
}
.toolbelt {
  position: absolute;
  bottom: max(112px, calc(env(safe-area-inset-bottom) + 96px));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  z-index: 3;
}
.toolbelt-tools {
  display: flex;
  gap: 6px;
}
.toolbelt button {
  border: 1px solid #e1e5c85c;
  border-radius: 4px;
  background: #293e32df;
  color: #f8f3d8;
  padding: 10px 17px;
  font-size: 11px;
  cursor: pointer;
}
.toolbelt button[aria-pressed="true"] {
  border-color: #f5d68f;
  background: #71815c;
  box-shadow: 0 0 0 1px #f5d68f;
}
.toolbelt kbd {
  font: inherit;
  font-size: 8px;
  margin-right: 8px;
  opacity: 0.7;
}
#tool-instruction {
  font-size: 9px;
  text-shadow: 0 1px 4px #233b2b;
  text-align: center;
}
.is-walking .toolbelt {
  pointer-events: none;
}
.field-note {
  color: #30483c;
  background: #f4f0df;
  border: 4px double #83916b;
  border-radius: 8px;
  padding: 28px;
  width: min(470px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  box-shadow: 0 20px 100px #152d3555;
}
.field-note::backdrop {
  background: #16312766;
  backdrop-filter: blur(3px);
}
.note-eyebrow {
  font-size: 8px;
  letter-spacing: 1.4px;
  color: #7c8768;
  margin: 0 0 12px;
}
#note-date {
  font:
    500 18px/1.6 "Lora",
    Georgia,
    serif;
  margin: 0 0 12px;
}
.note-count {
  font:
    500 32px "Lora",
    Georgia,
    serif;
  margin: 0 0 10px;
}
.note-repository {
  font-size: 10px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.pocket-find {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 0;
  margin-top: 22px;
  border-block: 1px solid #d7dac3;
}
.pocket-find > span {
  font-size: 38px;
  color: #9da765;
}
.pocket-find .note-eyebrow {
  font-size: 7px;
  margin-bottom: 8px;
}
.pocket-find h3 {
  font:
    500 16px "Lora",
    Georgia,
    serif;
  margin: 0;
}
#note-story {
  font-size: 10px;
  line-height: 1.8;
  color: #738065;
  margin: 8px 0 0;
}
#field-note-progress {
  font-size: 9px;
  margin: 16px 0 22px;
  color: #738065;
}
.note-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.note-actions button {
  padding: 12px 14px;
  border: 0;
  border-radius: 4px;
  color: #f4f0df;
  background: #415b43;
  font-size: 10px;
  cursor: pointer;
}
.note-actions a {
  font-size: 9px;
  line-height: 1.7;
}
@media (max-width: 760px) {
  .toolbelt {
    left: auto;
    right: 16px;
    transform: none;
    bottom: max(114px, calc(env(safe-area-inset-bottom) + 98px));
    width: calc(100% - 132px);
  }
  .toolbelt-tools {
    width: 100%;
    gap: 4px;
  }
  .toolbelt button {
    flex: 1;
    padding: 9px 5px;
    font-size: 9px;
  }
  .toolbelt kbd {
    margin-right: 4px;
  }
  #tool-instruction {
    font-size: 8px;
  }
  .field-note {
    padding: 22px;
  }
}
.garden-destinations {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0 15px;
}
.garden-destinations a {
  display: block;
  padding: 12px;
  border: 1px solid #e6e1b94d;
  border-radius: 5px;
  text-decoration: none;
  font-size: 11px;
  line-height: 1.7;
}
.garden-destinations a[aria-current],
.repository-group a[aria-current] {
  background: #77957a55;
  border-color: #b7c58c;
}
.repository-group {
  margin-block: 16px;
}
.repository-group h2 {
  font-size: 11px;
  font-weight: 500;
  color: #d5d2a6;
}
.repository-group a {
  display: block;
  padding: 8px;
  font-size: 10px;
  overflow-wrap: anywhere;
  border: 1px solid transparent;
  border-radius: 3px;
  text-decoration: none;
}
.repository-group a:hover {
  background: #77957a33;
}
.repository-status {
  padding: 10px;
  background: #e6e1b911;
  border-radius: 4px;
}
.companion-notes {
  padding-top: 14px;
  margin-top: 16px;
  border-top: 1px solid #e6e1b933;
}
.minimap {
  position: absolute;
  top: max(24px, env(safe-area-inset-top));
  right: max(24px, env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
}
#garden-map {
  width: 144px;
  height: 104px;
  border: 1px solid #e5ecd455;
  border-radius: 5px;
  image-rendering: pixelated;
}
.minimap span {
  font-size: 8px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 3px #263e2c;
}
.scene-controls {
  position: absolute;
  bottom: max(56px, calc(env(safe-area-inset-bottom) + 40px));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  white-space: nowrap;
  z-index: 3;
}
.scene-controls button {
  padding: 11px 15px;
  border: 1px solid #ffffff70;
  border-radius: 6px;
  background: #293e32d9;
  color: #f8f3d8;
  font-size: 10px;
  cursor: pointer;
}
.scene-controls button:hover:not(:disabled) {
  background: #344d3e;
}
.scene-controls button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.scene-controls button span[aria-hidden] {
  margin-right: 5px;
  font-size: 15px;
}
.is-walking .scene-controls,
.is-walking .calendar-details {
  visibility: hidden;
}
.scene-bottom {
  position: absolute;
  bottom: max(20px, env(safe-area-inset-bottom));
  inset-inline: 24px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 9px;
  color: #fff9e6;
  text-shadow: 0 1px 4px #233b2b;
  pointer-events: none;
}
.coordinates {
  font-size: 8px;
  letter-spacing: 0.8px;
}
#loading {
  position: absolute;
  top: 46%;
  width: 100%;
  text-align: center;
  font-size: 12px;
  padding: 20px;
  color: #30483c;
  pointer-events: none;
}
#joystick {
  display: none;
  position: absolute;
  bottom: max(126px, calc(env(safe-area-inset-bottom) + 110px));
  left: max(25px, env(safe-area-inset-left));
  width: 100px;
  height: 100px;
  border: 1px solid #fff9dd80;
  border-radius: 50%;
  background: #f5f4eb24;
  pointer-events: auto;
  touch-action: none;
}
#joystick span {
  position: absolute;
  left: 30px;
  top: 30px;
  width: 38px;
  height: 38px;
  border: 1px solid #fff9ddbb;
  border-radius: 50%;
  background: #f5f4eb66;
}
.calendar-details {
  position: absolute;
  top: max(24px, env(safe-area-inset-top));
  left: max(24px, env(safe-area-inset-left));
  z-index: 4;
  font-size: 11px;
  border: 1px solid #ffffff50;
  border-radius: 6px;
  background: #293e32d9;
}
.calendar-details summary {
  cursor: pointer;
  padding: 11px 14px;
  font-size: 11px;
  list-style: none;
}
.calendar-details summary::-webkit-details-marker {
  display: none;
}
.calendar-details[open] {
  width: min(440px, calc(100% - 48px));
  max-height: calc(100dvh - 140px);
  overflow: auto;
  padding: 0 16px 16px;
  background: #293e32f5;
}
.calendar-details[open] summary {
  padding-inline: 0;
}
.calendar-details p {
  line-height: 1.8;
  color: #cdd5bc;
}
.fern-button {
  border: 0;
  padding: 8px 0;
  background: transparent;
  color: inherit;
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
}
.home-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 10px;
}
.day-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 5px;
  max-height: 300px;
  overflow: auto;
  padding: 5px;
}
.day-entry {
  border: 0;
  padding: 9px;
  border-radius: 3px;
  cursor: pointer;
  color: #203828;
  text-align: left;
  font-size: 11px;
}
.day-entry span {
  display: block;
  margin-top: 4px;
  font-size: 9px;
}
.level-0 {
  background: #d8dfb6;
}
.level-1 {
  background: #a6c785;
}
.level-2 {
  background: #83aa66;
}
.level-3 {
  background: #5d8a51;
}
.level-4 {
  background: #366345;
  color: #fff;
}
.no-script {
  position: fixed;
  inset: auto 20px 20px;
  text-align: center;
  padding: 15px;
  color: #30483c;
  font-size: 12px;
}
@media (pointer: coarse) {
  .scene-controls #walk {
    display: none;
  }
  #joystick {
    display: block;
  }
}
@media (max-width: 760px) {
  .minimap {
    top: max(16px, env(safe-area-inset-top));
    right: 16px;
  }
  #garden-map {
    width: 86px;
    height: 62px;
  }
  .minimap span {
    display: none;
  }
  .calendar-details {
    top: max(16px, env(safe-area-inset-top));
    left: 16px;
  }
  .calendar-details[open] {
    width: calc(100% - 32px);
  }
  .scene-controls {
    gap: 5px;
    flex-wrap: wrap;
    width: calc(100% - 24px);
    justify-content: center;
  }
  .scene-controls button {
    padding: 10px;
    font-size: 9px;
  }
  .reset-text,
  .coordinates {
    display: none;
  }
  .call-label {
    display: none;
  }
  .scene-bottom {
    justify-content: center;
    inset-inline: 8px;
    text-align: center;
    line-height: 1.7;
  }
  #target-card {
    top: 104px;
    padding: 11px 14px;
  }
  #target-name {
    font-size: 15px;
  }
  #target-detail {
    font-size: 9px;
  }
  #joystick {
    width: 86px;
    height: 86px;
    left: 16px;
    bottom: max(124px, calc(env(safe-area-inset-bottom) + 108px));
  }
  #joystick span {
    top: 23px;
    left: 23px;
  }
}
@media (max-height: 500px) and (pointer: coarse) {
  #joystick {
    bottom: 35px;
  }
  #target-card {
    top: 90px;
  }
  .scene-controls {
    left: auto;
    right: 12px;
    transform: none;
    bottom: 35px;
    width: auto;
  }
}
