.misty-scene {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 48px;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  gap: 5px;
}

.misty-window {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid #6d8496;
  border-radius: clamp(14px, 3vw, 30px);
  background: #53798a;
  box-shadow: var(--tf-shadow);
  user-select: none;
}

.misty-artwork, .misty-artwork svg, .misty-window canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.misty-artwork { pointer-events: none; }
.misty-window canvas { touch-action: none; cursor: grab; -webkit-touch-callout: none; }
.misty-window canvas:active { cursor: grabbing; }
.misty-window canvas:focus-visible { outline: var(--tf-focus-ring); outline-offset: -5px; }

.misty-gesture {
  position: absolute;
  bottom: clamp(10px, 3vh, 30px);
  left: 0;
  right: 0;
  margin-inline: auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid #b8d1d8;
  border-radius: var(--tf-radius-round);
  background: #e6f4f3;
  color: #203d4b;
  box-shadow: 0 4px 18px #13334e26;
  pointer-events: none;
}

.misty-actions { display: flex; justify-content: center; align-items: center; gap: 12px; }
.misty-discovery { font-weight: 700; }
.misty-next { padding-block: .4rem; }
.misty-next:dir(rtl) [aria-hidden="true"] { transform: scaleX(-1); }
.misty-artwork :is(.eyes, .reaction) { transform-box: fill-box; transform-origin: center; }
.misty-artwork[data-state="peek"] .eyes { animation: misty-blink .34s ease-in-out; }
.misty-artwork[data-state="found"] .eyes { animation: misty-hello .8s ease-in-out; }
.misty-artwork[data-state="found"] .reaction { animation: misty-greet .85s ease-in-out; }
@keyframes misty-blink { 45% { transform: scaleY(.1); } }
@keyframes misty-hello { 30%, 64% { transform: scaleY(.14); } 45%, 83% { transform: scaleY(1); } }
@keyframes misty-greet { 25%, 65% { transform: rotate(7deg); } 45%, 85% { transform: rotate(-6deg); } }
.play-view:has(.misty-scene) .game-progress { display: none; }
.misty-still .misty-artwork :is(.eyes, .reaction) { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .misty-artwork :is(.eyes, .reaction) { animation: none !important; }
}

@media (orientation: landscape) and (max-height: 570px) {
  .misty-window {
    justify-self: center;
    width: auto;
    max-width: 100%;
    height: 100%;
    aspect-ratio: 2.7;
  }
}
