@font-face {
  font-family: Maplestory;
  src: url(maplestory-bold.otf) format('opentype');
  font-weight: 700;
  font-display: swap;
}
* {
  box-sizing: border-box;
}
:root {
  color-scheme: dark;
  --night: 0;
  --dusk: 0;
  --weather: 0;
  --size: clamp(64px, 13.6vmin, 132px);
  --board-width: clamp(246px, min(35vw, 55vh), 472px);
}
html,
body {
  margin: 0;
  height: 100%;
  background: #413766;
  overflow: hidden;
}
main {
  position: fixed;
  inset: 0;
  isolation: isolate;
  overflow: hidden;
}
.landscape,
.sky-tint {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.landscape {
  object-fit: cover;
  object-position: 50% 54%;
}
.night {
  background: linear-gradient(180deg, #151739, #373765 65%, #272045);
  opacity: calc(var(--night) * 0.66);
}
.dusk {
  background: linear-gradient(165deg, #5d4b92, #ffad8033 70%, #9464b0);
  mix-blend-mode: multiply;
  opacity: calc(var(--dusk) * 0.52);
}
.haze {
  background: linear-gradient(180deg, #858cae, #b0a1bc33 85%);
  opacity: calc(var(--weather) * 0.34);
}
.sky-tint {
  transition: opacity 3s ease;
}
.lantern {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  height: var(--size);
  translate: -50% -50%;
  border-radius: 14px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  z-index: 1;
  cursor: grab;
  will-change: transform;
}
.lantern img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 3px 4px #45275455)
    drop-shadow(0 0 9px rgb(255 178 88 / calc(var(--night) * 0.35)));
}
.lantern.active {
  cursor: grabbing;
  z-index: 2;
}
.lantern:focus-visible {
  outline: 2px solid #fff2ba;
  outline-offset: 4px;
}
.ai {
  --x: 19%;
  --y: 29%;
}
.chat {
  --x: 31%;
  --y: 43%;
}
.photos {
  --x: 41%;
  --y: 22%;
}
.watch {
  --x: 60%;
  --y: 25%;
}
.search {
  --x: 70%;
  --y: 43%;
}
.code {
  --x: 82%;
  --y: 29%;
}
.board {
  position: absolute;
  left: 50%;
  bottom: max(3.4%, calc(env(safe-area-inset-bottom) + 8px));
  width: var(--board-width);
  aspect-ratio: 1050/770;
  translate: -50% 0;
  z-index: 4;
  container-type: inline-size;
  pointer-events: none;
}
.board img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: drop-shadow(0 8px 11px #36214260)
    drop-shadow(0 0 14px rgb(255 179 96 / calc(var(--night) * 0.32)));
}
.slip {
  position: absolute;
  left: var(--sx);
  top: var(--sy);
  translate: -50% -50%;
  width: 18%;
  height: max(24px, 12.6%);
  display: grid;
  place-items: center;
  padding: 0 1px;
  border: 0;
  border-radius: 9%;
  color: #502714;
  background: transparent;
  text-shadow: 0 1px #fff9e8;
  font:
    700 clamp(8px, 3.25cqw, 15px)/1 Maplestory,
    'Trebuchet MS',
    Arial,
    sans-serif;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  pointer-events: auto;
}
#minecraft {
  font-size: clamp(7px, 2.75cqw, 13px);
}
.slip:hover,
.slip:focus-visible {
  background: #fffbe387;
  color: #35170e;
}
.slip:focus-visible {
  outline: 2px solid #6d3725;
  outline-offset: -2px;
}
.copy-note {
  position: absolute;
  left: 50%;
  bottom: -16px;
  translate: -50% 0;
  width: max-content;
  max-width: 98%;
  border: 1px solid #d9a76b;
  border-radius: 6px;
  padding: 5px 9px;
  color: #fff2dd;
  background: #432644;
  font:
    700 12px/1.2 Maplestory,
    system-ui,
    sans-serif;
}
.copy-note:empty {
  display: none;
}
@media (max-aspect-ratio: 1/1),
  (max-width: 740px) and (min-aspect-ratio: 1/1) and (min-height: 460px) {
  :root {
    --board-width: clamp(250px, 80vw, min(415px, 49vh));
    --size: clamp(56px, min(19vw, 12.5vh), 110px);
  }
  .ai {
    --x: 20%;
    --y: 24%;
  }
  .chat {
    --x: 50%;
    --y: 18%;
  }
  .watch {
    --x: 80%;
    --y: 24%;
  }
  .photos {
    --x: 20%;
    --y: 42%;
  }
  .search {
    --x: 50%;
    --y: 39%;
  }
  .code {
    --x: 80%;
    --y: 42%;
  }
}
@media (min-aspect-ratio: 1/1) and (max-height: 460px) {
  :root {
    --board-width: clamp(250px, min(41vw, 76vh), 324px);
    --size: clamp(48px, 17vh, 76px);
  }
  .ai {
    --x: 13%;
    --y: 25%;
  }
  .chat {
    --x: 28%;
    --y: 18%;
  }
  .photos {
    --x: 43%;
    --y: 23%;
  }
  .watch {
    --x: 57%;
    --y: 17%;
  }
  .search {
    --x: 72%;
    --y: 23%;
  }
  .code {
    --x: 87%;
    --y: 18%;
  }
}
.clouds {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
  opacity: calc(0.88 + var(--weather) * 0.12);
  filter: brightness(calc(1 - var(--night) * 0.42)) saturate(calc(1 - var(--night) * 0.25));
}
.cloud {
  position: absolute;
  left: 0;
  bottom: var(--b);
  width: calc(var(--s) * min(40vw, 95vh));
  height: auto;
  opacity: var(--a);
  animation: drift var(--dur) linear var(--delay) infinite;
  will-change: transform;
}
@keyframes drift {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100vw);
  }
}
.menu {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
  font:
    700 13px/1.35 Maplestory,
    system-ui,
    sans-serif;
  color: #fff2dd;
}
.menu-toggle {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #f3d7a144;
  border-radius: 50%;
  color: #ffe2a8;
  background: #2b2144a6;
  opacity: 0.62;
  cursor: pointer;
  transition: opacity 0.2s;
}
.menu-toggle:hover,
.menu-toggle:focus-visible,
.menu-toggle[aria-expanded='true'] {
  opacity: 1;
}
.menu-toggle:focus-visible,
.menu-panel :focus-visible {
  outline: 2px solid #fff2ba;
  outline-offset: 2px;
}
.weather-credit {
  margin: 10px 0 0;
  font-size: 11px;
  font-weight: 400;
  color: #eadff2;
}
.weather-credit span {
  display: none;
}
:root[data-weather='live'] .weather-credit span {
  display: inline;
}
.menu-panel {
  position: absolute;
  top: 42px;
  right: 0;
  width: min(250px, calc(100vw - 20px));
  max-height: calc(100vh - 70px);
  overflow: auto;
  padding: 12px;
  border: 1px solid #d9a76b55;
  border-radius: 12px;
  background: #2b2144f0;
  box-shadow: 0 10px 30px #1a102c88;
}
.menu-panel[hidden] {
  display: none;
}
.menu-panel h2 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #ffd99a;
}
.menu-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.menu-row input {
  flex: 1;
  accent-color: #e8b36b;
  min-width: 0;
}
.menu-panel button:not(.menu-toggle) {
  border: 1px solid #d9a76b77;
  border-radius: 7px;
  padding: 5px 10px;
  color: #fff2dd;
  background: #45305e;
  font: inherit;
  cursor: pointer;
}
.menu-panel button:hover {
  background: #56407a;
}
#music[aria-checked='true'] {
  background: #8a5a2e;
  border-color: #f0c58a;
}
.menu-panel details {
  margin-top: 10px;
  border-top: 1px solid #d9a76b33;
  padding-top: 8px;
}
.menu-panel summary {
  cursor: pointer;
  color: #ffd99a;
}
.menu-panel ul {
  margin: 8px 0 0;
  padding-left: 16px;
  color: #eadff2;
  font-size: 12px;
}
.menu-panel li {
  margin-bottom: 6px;
}
.menu-panel a {
  color: #ffd99a;
}
.board .wings {
  position: absolute;
  inset: 0;
  background: url(board-wings.webp) 0 0/800% 100% no-repeat;
  pointer-events: none;
  filter: drop-shadow(0 8px 11px #36214250);
  animation: flap 2.4s steps(8) infinite;
}
/* 8 frames, side by side: one smooth wing beat (glide, rising, up, falling, glide, pushing, down, recovering). */
@keyframes flap {
  to {
    background-position-x: 114.286%;
  }
}
/* The whole board rises on the down-stroke (highest as the wings finish pushing) and settles on the up-stroke. */
.board {
  animation: board-fly 2.4s infinite;
  will-change: transform;
}
@keyframes board-fly {
  0% {
    transform: translateY(-3.5px);
    animation-timing-function: steps(1);
  }
  12.5% {
    transform: translateY(-1px);
    animation-timing-function: steps(1);
  }
  25% {
    transform: translateY(0px);
    animation-timing-function: steps(1);
  }
  37.5% {
    transform: translateY(-1px);
    animation-timing-function: steps(1);
  }
  50% {
    transform: translateY(-3.5px);
    animation-timing-function: steps(1);
  }
  62.5% {
    transform: translateY(-6px);
    animation-timing-function: steps(1);
  }
  75% {
    transform: translateY(-7px);
    animation-timing-function: steps(1);
  }
  87.5% {
    transform: translateY(-6px);
    animation-timing-function: steps(1);
  }
  100% {
    transform: translateY(-3.5px);
  }
}
.now-playing {
  margin: -2px 0 10px;
  font-size: 11px;
  font-weight: 400;
  color: #eadff2;
  min-height: 1.35em;
}
@media (prefers-reduced-motion: reduce) {
  .sky-tint {
    transition: none;
  }
  .cloud {
    animation-play-state: paused;
  }
  .board,
  .board .wings {
    animation: none;
  }
}
