:root {
  --ink: #294d46;
  --cream: #fff9ed;
  --peach: #ffbba0;
  --glass: rgba(255, 250, 238, 0.88);
  --line: rgba(59, 87, 67, 0.14);
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
body {
  font-family:
    ui-rounded,
    "Avenir Next",
    Avenir,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  color: var(--ink);
  background: #b7dccc;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #e68369;
  outline-offset: 5px;
}
button:active {
  transform: scale(0.95);
}
button {
  transition:
    background 0.2s,
    transform 0.2s,
    box-shadow 0.2s;
}
button:hover {
  background-color: #fffdf7;
}
svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
span[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#world {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
#vignette {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 50% 35%,
    transparent 45%,
    rgba(45, 68, 51, 0.12)
  );
  z-index: 1;
}
#fade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: #fff3d9;
  opacity: 0;
  transition: opacity 0.32s;
  z-index: 40;
}
#fade.on {
  opacity: 1;
}
.hidden {
  display: none !important;
}
.hud {
  z-index: 5;
  position: absolute;
}
.topbar {
  left: max(28px, env(safe-area-inset-left));
  right: max(28px, env(safe-area-inset-right));
  top: max(25px, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  pointer-events: none;
}
.topbar > * {
  pointer-events: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  text-align: left;
  font-family: Georgia, serif;
  font-size: 25px;
  letter-spacing: -0.8px;
  padding: 0;
  text-shadow: 0 1px 12px rgba(255, 255, 255, 0.4);
}
.brand:hover {
  background: transparent;
}
.brand-flower {
  font-size: 43px;
  font-family: Georgia;
  color: #dc8568;
  line-height: 1;
}
.brand-sub {
  display: block;
  font-family: ui-rounded, "Avenir Next", sans-serif;
  font-size: 8px;
  letter-spacing: 1.1px;
  margin: 6px 0 0 2px;
  font-weight: 700;
}
.topbar nav {
  display: flex;
  gap: 9px;
  align-items: center;
}
.pill,
.round {
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 4px 20px #405d4110;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  height: 45px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}
.round {
  width: 45px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pill {
  padding: 0 17px;
  border-radius: 25px;
  font-size: 12px;
  font-weight: 600;
}
#count {
  font-size: 10px;
  color: #718376;
  border-left: 1px solid var(--line);
  padding-left: 9px;
}
#loading {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #e2eedd;
  transition: opacity 0.6s;
}
.loading-flower {
  font: 70px Georgia;
  color: #e9947c;
  animation: sway 3s ease-in-out infinite;
}
#loading p {
  font-family: Georgia;
  font-size: 25px;
  margin: 20px 0 10px;
}
#loading small {
  font-size: 11px;
  color: #798975;
  letter-spacing: 1px;
}
@keyframes sway {
  50% {
    transform: rotate(45deg) scale(1.08);
  }
}
#welcome {
  z-index: 4;
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(247, 248, 223, 0.68),
    rgba(247, 248, 223, 0.14) 49%,
    transparent 70%
  );
}
.welcome-copy {
  position: absolute;
  left: 7%;
  top: 29%;
  pointer-events: auto;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 2.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow > span {
  display: block;
  width: 23px;
  height: 1px;
  background: #65816b;
}
h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(44px, 5.8vw, 86px);
  line-height: 1.05;
  letter-spacing: -3.5px;
  margin: 25px 0 20px;
}
h1 em {
  color: #a85747;
  font-weight: 400;
}
#welcome p {
  font-size: 14px;
  line-height: 1.9;
  font-weight: 500;
  letter-spacing: 0.1px;
}
.primary {
  border: 1px solid #fff6df55;
  background: #294f44;
  color: #fff9e9;
  border-radius: 40px;
  padding: 17px 25px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 42px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 7px 25px #31523b18;
}
.primary:hover {
  background: #3d6857;
}
.primary > span {
  font-size: 23px;
  line-height: 1;
}
#start {
  margin-top: 15px;
}
.welcome-foot {
  font-size: 10px;
  margin-top: 24px;
  color: #4e705e;
}
.welcome-badge {
  position: absolute;
  right: 6%;
  bottom: 11%;
  border: 1px solid #fff7e6bd;
  border-radius: 50%;
  width: 128px;
  height: 128px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: rotate(9deg);
  font-size: 10px;
  line-height: 1.5;
  background: #fffae7ba;
  backdrop-filter: blur(8px);
}
.welcome-badge em {
  font: 18px Georgia;
  margin-top: 4px;
}
.welcome-badge span {
  font-size: 27px;
  margin-top: 8px;
  color: #c98262;
}
#location {
  top: 91px;
  left: 35px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  letter-spacing: 0.6px;
  text-shadow: 0 1px 5px white;
}
.location-dot {
  width: 5px;
  height: 5px;
  background: #698361;
  border-radius: 50%;
}
#hint {
  bottom: 133px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #fff9edda;
  backdrop-filter: blur(8px);
  border-radius: 25px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 1;
  transition: opacity 1s;
}
#hint svg {
  width: 17px;
  height: 17px;
}
#reticle {
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  margin: -2.5px;
  background: #fff8;
  border: 1px solid #31534145;
  border-radius: 50%;
  pointer-events: none;
}
#animalLabel {
  position: absolute;
  z-index: 7;
  transform: translate(-50%, -100%);
  text-align: center;
  pointer-events: none;
  background: #fff8eade;
  backdrop-filter: blur(8px);
  padding: 8px 15px;
  border-radius: 14px;
  white-space: nowrap;
  box-shadow: 0 3px 15px #28443312;
}
#animalName {
  display: block;
  font-family: Georgia;
  font-size: 17px;
}
#animalAction {
  display: block;
  font-size: 9px;
  margin-top: 4px;
  color: #7b886f;
}
#toast {
  position: absolute;
  z-index: 30;
  left: 50%;
  top: 110px;
  transform: translate(-50%, -15px);
  opacity: 0;
  transition:
    opacity 0.4s,
    transform 0.4s;
  pointer-events: none;
  display: flex;
  gap: 13px;
  align-items: center;
  background: #fff9eef2;
  box-shadow: 0 8px 30px #274a3c18;
  padding: 14px 23px;
  border-radius: 18px;
  max-width: min(440px, 90vw);
  backdrop-filter: blur(15px);
  min-width: 220px;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
#toastIcon {
  font-size: 27px;
  color: #ce886b;
}
#toastText {
  font-size: 12px;
  line-height: 1.6;
}
#toastText b {
  font-family: Georgia;
  font-weight: 400;
  display: block;
  font-size: 20px;
  line-height: 1.3;
  margin-bottom: 3px;
}
#toolbar {
  bottom: max(28px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
}
.tools {
  display: flex;
  gap: 4px;
  padding: 7px;
  background: #fff9edeb;
  border-radius: 25px;
  border: 1px solid #fffaf4;
  box-shadow: 0 8px 40px #294c4220;
  backdrop-filter: blur(14px);
}
.tool {
  background: none;
  min-width: 80px;
  border-radius: 18px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 5px;
  font-size: 10px;
}
.tool.selected {
  background: #e7edda;
}
.tool.selected svg {
  color: #406c4e;
}
.tool svg {
  width: 25px;
  height: 25px;
}
.photo {
  width: 49px;
  height: 49px;
}
#keyboardHint {
  bottom: 9px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  letter-spacing: 0.3px;
  color: #335442cc;
  white-space: nowrap;
}
#keyboardHint span {
  padding: 0 9px;
}
#joystick {
  bottom: 58px;
  left: 55px;
  width: 106px;
  touch-action: none;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 10px;
}
.joy-ring {
  width: 106px;
  height: 106px;
  background: #fff9e735;
  border: 1px solid #fffbeaa3;
  border-radius: 50%;
  position: relative;
  box-shadow: 0 2px 22px #284f3310;
  backdrop-filter: blur(2px);
}
#joyKnob {
  position: absolute;
  width: 45px;
  height: 45px;
  border: 1px solid #fff9eece;
  background: #fffaeaa3;
  border-radius: 50%;
  left: 30px;
  top: 30px;
  box-shadow: 0 4px 12px #2c432415;
  pointer-events: none;
}
.joy-arrow {
  position: absolute;
  width: 100%;
  text-align: center;
  opacity: 0.5;
  font-size: 17px;
  pointer-events: none;
}
.north {
  top: 2px;
}
.south {
  bottom: 2px;
}
.joy-label {
  font-size: 8px;
  letter-spacing: 2px;
  color: #44644a;
}
#lookHint {
  right: 55px;
  bottom: 95px;
  display: flex;
  align-items: center;
  flex-direction: column;
  font-size: 10px;
  letter-spacing: 0.3px;
  color: #fff8e7;
  text-shadow: 0 1px 8px #24473b;
}
#lookHint span {
  font-size: 28px;
}
dialog {
  border: 1px solid #fffdf3;
  background: #fff9ed;
  color: var(--ink);
  border-radius: 28px;
  padding: 30px;
  width: min(670px, 92vw);
  max-height: 86dvh;
  box-shadow: 0 30px 100px #163e3959;
  overflow-y: auto;
  overscroll-behavior: contain;
}
dialog::backdrop {
  background: #204d4255;
  backdrop-filter: blur(8px);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
h2 {
  font-family: Georgia;
  font-size: 33px;
  letter-spacing: -1.1px;
  line-height: 1.1;
  font-weight: 400;
  margin: 10px 0;
}
.modal-header .eyebrow {
  font-size: 8px;
  letter-spacing: 1.8px;
}
.close {
  background: #ebeede;
  box-shadow: none;
  font-size: 25px;
}
.modal-intro {
  font-size: 12px;
  line-height: 1.8;
  color: #75806a;
  margin: 17px 0 24px;
}
.journal-tabs {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.journal-tabs button {
  padding: 0 0 13px;
  background: none;
  font-size: 12px;
  color: #87907b;
}
.journal-tabs button.active {
  border-bottom: 2px solid #4e725d;
  color: var(--ink);
}
.journal-tabs span {
  font-size: 10px;
  margin-left: 8px;
  opacity: 0.6;
}
#journalGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.friend-card {
  border: 1px solid #dfe5ce;
  border-radius: 17px;
  padding: 16px 12px;
  background: #f4f3e5;
  min-height: 142px;
  position: relative;
  text-align: center;
}
.friend-card.locked {
  opacity: 0.52;
  border-style: dashed;
  background: none;
}
.friend-art {
  font-size: 34px;
  display: block;
  height: 43px;
  margin: 0 auto 7px;
}
.friend-card h3 {
  font: 18px Georgia;
  margin: 4px 0 6px;
}
.friend-card p {
  font-size: 10px;
  line-height: 1.5;
  margin: 5px 0;
  color: #7b866f;
}
.friend-hearts {
  color: #d88d78;
  letter-spacing: 3px;
  font-size: 12px;
}
.saved-note {
  font-size: 10px;
  color: #8b9380;
  text-align: center;
  line-height: 1.7;
  margin: 23px 0 0;
}
.place-card {
  grid-column: span 3;
  display: flex;
  gap: 15px;
  text-align: left;
  align-items: center;
  min-height: 85px;
}
.place-card .friend-art {
  margin: 0;
  width: 50px;
  flex-shrink: 0;
}
.place-card h3 {
  margin-top: 0;
}
#mapCanvasWrap {
  margin-top: 20px;
  border-radius: 20px;
  background: #e7edd9;
  overflow: hidden;
}
#mapCanvas {
  display: block;
  width: 100%;
  height: auto;
}
.map-caption {
  text-align: center;
  font-size: 11px;
  color: #79856f;
  margin: 15px 0;
}
#mapPlaces {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
}
#mapPlaces button {
  border: 1px solid #dfe5ce;
  border-radius: 30px;
  padding: 10px 13px;
  background: #f0f0df;
  font-size: 11px;
}
#photoImage {
  width: 100%;
  display: block;
  border: 10px solid white;
  box-shadow: 0 3px 12px #234f3020;
  margin: 20px 0;
  border-radius: 3px;
}
#savePhoto {
  display: flex;
  width: max-content;
  margin: auto;
}
#error {
  position: absolute;
  z-index: 100;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 35px;
  border-radius: 24px;
  background: #fff9ed;
  width: min(430px, 90vw);
  box-shadow: 0 15px 60px #26473533;
}
#error p {
  font-size: 13px;
  line-height: 1.7;
}
.photo-mode .hud,
.photo-mode #animalLabel,
.photo-mode #toast {
  visibility: hidden;
}
body:not(.playing) .topbar nav {
  display: none;
}
@media (pointer: fine) {
  #joystick,
  #lookHint {
    display: none !important;
  }
}
@media (max-width: 700px) {
  .topbar {
    left: 18px;
    right: 18px;
    top: max(18px, env(safe-area-inset-top));
  }
  .brand {
    font-size: 19px;
    gap: 6px;
  }
  .brand-flower {
    font-size: 32px;
  }
  .brand-sub {
    font-size: 6px;
    letter-spacing: 0.6px;
    margin-top: 4px;
  }
  .topbar nav {
    gap: 5px;
  }
  .round {
    width: 36px;
    height: 36px;
  }
  .round svg {
    width: 18px;
    height: 18px;
  }
  .pill {
    height: 36px;
    padding: 0 10px;
    gap: 5px;
  }
  .pill svg {
    width: 17px;
  }
  .desktop-label {
    display: none;
  }
  #count {
    font-size: 8px;
    padding-left: 5px;
  }
  .welcome-copy {
    top: 25%;
    left: 8%;
  }
  h1 {
    font-size: 53px;
    letter-spacing: -2.6px;
    margin: 23px 0 19px;
  }
  #welcome p {
    font-size: 13px;
  }
  #welcome {
    background: linear-gradient(90deg, #f5f6df94, transparent 95%);
  }
  .welcome-badge {
    width: 98px;
    height: 98px;
    right: 7%;
    bottom: 10%;
    font-size: 8px;
  }
  .welcome-badge em {
    font-size: 15px;
  }
  .welcome-badge span {
    font-size: 23px;
    margin-top: 4px;
  }
  .welcome-foot {
    font-size: 9px;
  }
  #location {
    left: 23px;
    top: 75px;
    font-size: 9px;
  }
  #toolbar {
    bottom: max(22px, env(safe-area-inset-bottom));
    gap: 8px;
  }
  .tools {
    border-radius: 21px;
    padding: 5px;
    gap: 1px;
  }
  .tool {
    min-width: 59px;
    padding: 9px 8px;
    font-size: 9px;
    border-radius: 16px;
  }
  .tool svg {
    width: 24px;
    height: 24px;
  }
  .photo {
    width: 39px;
    height: 39px;
  }
  #keyboardHint {
    display: none !important;
  }
  #joystick {
    left: 26px;
    bottom: 132px;
    width: 94px;
  }
  .joy-ring {
    width: 94px;
    height: 94px;
  }
  #joyKnob {
    width: 41px;
    height: 41px;
    left: 26px;
    top: 26px;
  }
  .joy-label {
    font-size: 7px;
  }
  #lookHint {
    right: 34px;
    bottom: 169px;
    font-size: 9px;
  }
  #hint {
    bottom: 104px;
    font-size: 10px;
    padding: 9px 13px;
    max-width: 90vw;
    white-space: normal;
    text-align: center;
  }
  #toast {
    top: 98px;
    padding: 12px 18px;
    min-width: 240px;
  }
  #toastText {
    font-size: 11px;
  }
  #toastText b {
    font-size: 18px;
  }
  dialog {
    padding: 23px 20px;
    border-radius: 23px;
  }
  h2 {
    font-size: 28px;
  }
  .modal-header .eyebrow {
    font-size: 7px;
    letter-spacing: 1.2px;
  }
  #journalGrid {
    gap: 8px;
  }
  .friend-card {
    padding: 13px 6px;
    min-height: 133px;
  }
  .friend-card h3 {
    font-size: 16px;
  }
  .friend-card p {
    font-size: 9px;
  }
  .friend-art {
    font-size: 30px;
  }
  .journal-tabs {
    gap: 15px;
  }
  .journal-tabs button {
    font-size: 11px;
  }
}
@media (max-height: 520px) {
  .welcome-copy {
    top: 24%;
    left: 8%;
  }
  h1 {
    font-size: 44px;
    margin: 12px 0 10px;
  }
  #welcome p {
    font-size: 11px;
    line-height: 1.6;
  }
  .welcome-foot {
    display: none;
  }
  #start {
    margin-top: 5px;
    padding: 12px 22px;
  }
  #toolbar {
    bottom: 16px;
  }
  #hint {
    bottom: 105px;
  }
  #joystick {
    bottom: 25px;
    left: 30px;
  }
  #lookHint {
    bottom: 55px;
    right: 40px;
  }
  #keyboardHint {
    display: none !important;
  }
  .topbar {
    top: 14px;
  }
  .welcome-badge {
    bottom: 13%;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

#wishBtn {
  left: 50%;
  transform: translateX(-50%);
  top: 116px;
  z-index: 8;
  background: #fff1cfe6;
  color: #8b6649;
  font-family: Georgia;
  font-size: 15px;
  box-shadow: 0 0 30px #ffdc8750;
}
#wishBtn:disabled {
  opacity: 0.65;
  cursor: default;
}
#wishBtn:hover {
  background: #fff7df;
}
@media (max-width: 700px) {
  #wishBtn {
    top: 106px;
    font-size: 12px;
    height: 38px;
  }
}

.starlight .brand,
.starlight #location,
.starlight #keyboardHint,
.starlight .joy-label {
  color: #f5ebd1;
  text-shadow: 0 1px 10px #14273b80;
}
.starlight .brand-flower {
  color: #f5b397;
}
.starlight .location-dot {
  background: #f1d494;
}
.starlight #vignette {
  background: radial-gradient(ellipse at 50% 35%, transparent 45%, #101b3524);
}

.friend-art.has-portrait {
  width: 78px;
  height: 78px;
  margin-bottom: 10px;
}
.animal-portrait {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid #e0e2c8;
}
@media (max-width: 700px) {
  .friend-art.has-portrait {
    width: 65px;
    height: 65px;
  }
}

@media (max-width: 370px) {
  .topbar {
    left: 12px;
    right: 12px;
    gap: 8px;
  }
  .brand {
    font-size: 16px;
  }
  .brand-flower {
    font-size: 26px;
  }
  .brand-sub {
    font-size: 5px;
  }
  .topbar nav {
    gap: 4px;
  }
  .topbar .round {
    width: 31px;
    height: 31px;
  }
  .topbar .pill {
    height: 31px;
    padding: 0 7px;
  }
  #count {
    display: none;
  }
  h1 {
    font-size: 45px;
  }
  .welcome-copy {
    left: 7%;
  }
  .tool {
    min-width: 54px;
    padding: 9px 7px;
  }
  #toolbar {
    gap: 6px;
  }
}
