:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  color: #ffeef6;
  background: #210819;
}

* { box-sizing: border-box; }

body { margin: 0; }

.park {
  position: relative;
  isolation: isolate;
  height: 100dvh;
  overflow: hidden;
}

.intro {
  position: absolute;
  z-index: 1;
  top: max(1rem, env(safe-area-inset-top));
  inset-inline: 1rem;
  display: grid;
  justify-items: center;
  pointer-events: none;
}

h1 {
  margin: 0;
  padding: .5em .9em;
  border: 1px solid #ffc79760;
  border-radius: 999px;
  color: #ffe8d9;
  background: #290b20c9;
  font: normal clamp(.91rem, 2vw, 1.3rem)/1.2 Georgia, serif;
  text-align: center;
  text-shadow: 0 1px 3px #210819;
}

.map-window {
  height: 100%;
  overflow: auto hidden;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

.map-window::-webkit-scrollbar { display: none; }

.map {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.map-image {
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-drag: none;
}

.map-places, .effects { position: absolute; inset: 0; }
.effects { pointer-events: none; }

.glow {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 7%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, #ffdb96ba, #ff9a5e55 27%, transparent 68%);
  mix-blend-mode: screen;
  animation: glow 4s ease-in-out var(--delay) infinite alternate;
}

.snowflake {
  position: absolute;
  top: 0;
  left: var(--x);
  width: var(--size);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff6f4;
  box-shadow: 0 0 .5rem #ffbad9;
  opacity: var(--opacity);
  animation: snowfall var(--duration) linear var(--delay) infinite;
}

@keyframes glow {
  from { opacity: .2; scale: .8; }
  to { opacity: .85; scale: 1.25; }
}

@keyframes snowfall {
  from { transform: translate(-2rem, -2rem); }
  to { transform: translate(2rem, 104cqh); }
}

.effects { container-type: size; }

@media (orientation: portrait) {
  .map { min-width: 128dvh; }
}

@media (prefers-reduced-motion: reduce) {
  .effects > * { animation: none; }
  .snowflake { display: none; }
}

.map-places { z-index: 1; }

.park-in-game > :is(.park, .sound-toggle, .settings-toggle) { visibility: hidden; }

.park-game-frame {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: block;
  width: 100%;
  height: 100dvh;
  border: 0;
  background: #210819;
}

.map-landmark {
  position: absolute;
  translate: -50% 0;
  display: grid;
  justify-items: center;
  width: auto;
  color: #fff0e8;
  text-decoration: none;
  border-radius: 35% 35% 16% 16%;
  cursor: pointer;
}


.map-tree {
  left: 50%;
  bottom: 42%;
  height: 42%;
  aspect-ratio: 3 / 4;
}

.map-geography {
  left: 70%;
  bottom: 29%;
  height: 31%;
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  background: none;
}

.map-workshop {
  left: 69%;
  bottom: 59%;
  height: 27%;
  aspect-ratio: 1.24;
  border: 0;
  padding: 0;
  background: none;
}

.map-workshop .map-landmark-label { max-width: 13rem; }

.map-sleigh {
  left: 25.5%;
  bottom: 28%;
  height: 24%;
  aspect-ratio: 1.52;
}

.map-word {
  left: 25.5%;
  bottom: 59%;
  height: 28%;
  aspect-ratio: 1.27;
}

.map-secret-santa {
  left: 5.1%;
  bottom: 72.5%;
  height: clamp(2.75rem, 6.7%, 4rem);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: none;
}

.map-secret-santa .map-landmark-image {
  filter: brightness(.77) saturate(.9) drop-shadow(0 .2rem .3rem #340a29a0);
}

.map-secret-santa:hover .map-landmark-image,
.map-secret-santa:focus-visible .map-landmark-image {
  filter: drop-shadow(0 0 .45rem #ffd99786);
}

.map-final-gift {
  left: 49.2%;
  bottom: 8%;
  height: 15%;
  aspect-ratio: 1;
  z-index: 1;
  padding: 0;
  border: 0;
  background: none;
}

.map-final-gift:disabled { cursor: not-allowed; }
.map-final-gift:disabled .map-landmark-image { transform: none; filter: drop-shadow(0 .45rem .45rem #4d10336e); }
.map-final-gift[data-state="ready"] .map-landmark-image { filter: drop-shadow(0 0 .72rem #ffd184ce); }

.final-gift-label {
  position: absolute;
  bottom: 4%;
  left: 50%;
  translate: -50% 0;
  display: inline-flex;
  align-items: center;
  gap: .34rem;
  width: max-content;
  padding: .3rem .62rem;
  border: 1px solid #ffc797c2;
  border-radius: 999px;
  color: #ffe4c1;
  background: #44132ef5;
  box-shadow: 0 .16rem .6rem #4d10336e;
  font: 700 clamp(.73rem, 1.4vw, .95rem) system-ui, sans-serif;
}

.map-final-gift[data-state="ready"] .final-gift-label { color: #49232c; background: #ffdda9; }
.final-gift-lock[hidden] { display: none; }
.final-gift-claim { text-decoration: none; }
.final-gift-dialog img {
  display: block;
  width: min(45%, 10rem);
  height: auto;
  filter: drop-shadow(0 0 1.25rem #ffd18477);
}
.final-gift-dialog .final-gift-message { text-align: center; }
.final-gift-dialog[data-state="claimed"] img { animation: final-gift-pop .52s both; }

@keyframes final-gift-pop {
  from { transform: scale(.9); }
  55% { transform: scale(1.13) rotate(-4deg); }
}

@media (orientation: portrait) {
  .map-geography {
    left: 69%;
    height: 23%;
  }
  .map-workshop {
    left: 68%;
    height: 20%;
  }
  .map-sleigh { left: 31%; height: 19%; }
  .map-word { left: 31%; height: 23%; }
}

.map-landmark-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  transform-origin: center bottom;
  filter: drop-shadow(0 .45rem .45rem #4d10336e);
  transition: transform .24s ease, filter .24s ease;
}

.map-landmark:hover .map-landmark-image,
.map-landmark:focus-visible .map-landmark-image {
  transform: scale(1.035);
  filter: drop-shadow(0 0 .65rem #ffd997b0);
}

.map-landmark:focus-visible {
  outline: 2px solid #fff3ae;
  outline-offset: 3px;
}

.map-landmark-label {
  position: absolute;
  left: 50%;
  top: calc(100% + .26rem);
  translate: -50% 0;
  display: grid;
  gap: .16rem;
  width: max-content;
  max-width: 10rem;
  padding: .36rem .7rem;
  border: 1px solid #ffc7979c;
  border-radius: .75rem;
  background: #44132ee8;
  box-shadow: 0 .2rem .65rem #4d103340;
  font: normal .96rem/1.1 Georgia, serif;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.map-landmark:focus-visible .map-landmark-label {
  opacity: 1;
}

.tree-marker-done, .geography-marker-done, .sleigh-marker-done, .word-marker-done { color: #ffd3a0; font: 650 .7rem system-ui, sans-serif; }

@media (hover: hover) {
  .map-landmark:hover .map-landmark-label { opacity: 1; }
}

@media (hover: none) {
  .map-tree .map-landmark-label { opacity: 1; }
  .map-tree:not(:focus-visible) .tree-marker-done { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .map-landmark-image, .map-landmark-label { transition: none; }
  .map-landmark:hover .map-landmark-image, .map-landmark:focus-visible .map-landmark-image { transform: none; }
  .final-gift-dialog[data-state="claimed"] img { animation: none; }
}

.sound-toggle, .settings-toggle {
  position: fixed;
  z-index: 3;
  top: max(.75rem, env(safe-area-inset-top));
  right: max(.75rem, env(safe-area-inset-right));
  width: 2.75rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid #ffc7979c;
  border-radius: 50%;
  color: #ffe8d9;
  background: #44132ee8;
  box-shadow: 0 .2rem .65rem #330b2a60;
  cursor: pointer;
}

.settings-toggle { right: calc(max(.75rem, env(safe-area-inset-right)) + 3.15rem); }

.sound-toggle svg, .settings-toggle svg { width: 1.27rem; height: 1.27rem; }
.sound-toggle:hover, .settings-toggle:hover { background: #672342; }
.sound-toggle:focus-visible, .settings-toggle:focus-visible { outline: 2px solid #ffe6a3; outline-offset: 3px; }
.sound-toggle .speaker-slash,
.sound-toggle[aria-pressed="true"] .speaker-waves { display: none; }
.sound-toggle[aria-pressed="true"] .speaker-slash { display: initial; }

.sound-welcome, .game-settings {
  width: min(28rem, calc(100% - 2rem));
  padding: 0;
  border: 1px solid #ffc797ab;
  border-radius: 1.4rem;
  color: #fff0eb;
  background: radial-gradient(ellipse at top, #74284d, #3d102b);
  box-shadow: 0 .65rem 4rem #240413a0;
}

.sound-welcome::backdrop, .game-settings::backdrop {
  background: #1b07188c;
  backdrop-filter: blur(4px);
}

.sound-welcome form, .game-settings form {
  display: grid;
  justify-items: center;
  gap: .75rem;
  padding: 1.65rem 1rem;
  text-align: center;
}

.sound-welcome strong, .game-settings h2 {
  margin: 0;
  font: normal clamp(1.34rem, 5vw, 2rem) Georgia, serif;
}

.sound-welcome-icon { color: #ffd2ad; font-size: 1.65rem; }
.game-settings p { margin: 0; color: #ffdeef; }
.game-settings-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }

.park-dialog-button {
  padding: .55rem 1rem;
  border: 1px solid #ffc7979c;
  border-radius: 999px;
  color: #ffe8d9;
  background: #44132e;
  font: 600 .9rem system-ui, sans-serif;
  cursor: pointer;
}

.park-dialog-button:focus-visible { outline: 2px solid #fff3ae; outline-offset: 3px; }
.park-dialog-button:hover { background: #672342; }
.park-dialog-primary { color: #40152b; background: #ffd2ad; }
.park-dialog-primary:hover { background: #ffe3c9; }

@media (max-width: 34rem) {
  .intro {
    inset-inline: .75rem 6.85rem;
    justify-items: start;
  }
}
