/* The page is only a frame for the painting. Everything else lives in src/ui/. */

html,
body {
  margin: 0;
  height: 100%;
  background: #15141a;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* The whole screen is the wheel. */
#scene,
#first-frame {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
  touch-action: none;
}

/* The first frame matches the renderer's opening camera (cover fit, a 4% overscan). */
#first-frame {
  object-fit: cover;
  object-position: 50% 50%;
  transform: scale(1.04);
  transition: opacity 1.6s ease;
  pointer-events: none;
}
#first-frame.gone {
  opacity: 0;
}

#scene {
  opacity: 0;
  transition: opacity 1.2s ease;
  cursor: grab;
}
#scene.live {
  opacity: 1;
}
#scene:active {
  cursor: grabbing;
}

/* The UI layer never blocks the wheel: its own elements opt back into pointer events. */
#ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

/* The sound hint: an inked speaker, shown only when the browser would not let sound start from a
   wheel (a wheel is not a user gesture to the browser). One tap anywhere starts it. */
#sound-hint {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  width: 42px;
  height: 42px;
  padding: 6px;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 18, 24, 0.28);
  color: rgba(244, 232, 208, 0.82);
  cursor: pointer;
  animation: breathe 3.2s ease-in-out infinite;
  z-index: 5;
}
#sound-hint svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#sound-hint svg path:first-child {
  fill: currentColor;
  fill-opacity: 0.18;
}
#sound-hint:focus-visible {
  outline: 2px solid rgba(244, 232, 208, 0.9);
  outline-offset: 3px;
}
@keyframes breathe {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50% { opacity: 0.95; transform: scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  #sound-hint { animation: none; opacity: 0.8; }
  #first-frame, #scene { transition-duration: 0.3s; }
}

.noscript {
  position: fixed;
  bottom: 24px;
  left: 0;
  right: 0;
  text-align: center;
  color: #efe3c8;
  font: italic 18px Georgia, serif;
}

/* Portrait: the renderer frames the storm, the steps and the oak (focal x 1090). */
@media (max-aspect-ratio: 1/1) {
  #first-frame {
    object-position: 64% 50%;
  }
}
