/* Explicit iframe mode only. Keep the standalone presentation and game palette intact. */
html.embed-mode {
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.embed-mode body.milk-demo {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  overflow-x: hidden;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.embed-mode header,
.embed-mode .side,
.embed-mode footer,
.embed-mode .mobile-title {
  display: none !important;
}
.embed-mode main {
  display: block;
  max-width: none;
  margin: 0;
  padding: 12px;
}
.embed-mode main > div {
  /* Fit the portrait canvas to available height, never scale text or controls.
     Below the useful minimum width, the document scrolls vertically instead. */
  width: min(100%, clamp(280px, calc((100vh - 280px) * .64179), 430px));
  width: min(100%, clamp(280px, calc((100dvh - 280px) * .64179), 430px));
  margin-inline: auto;
  min-width: 0;
}
.embed-mode .phone {
  border-radius: 16px;
  box-shadow: none;
}
.embed-mode .hud {
  padding: 10px 12px;
  flex-wrap: wrap;
}
.embed-mode .stage {
  min-height: 420px;
}
.embed-mode canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 430 / 670;
  touch-action: none;
}
.embed-mode .overlay {
  padding: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.embed-mode .modal {
  max-width: 100%;
}
.embed-mode .modal h2 {
  font-size: 24px;
}
.embed-mode .instruct {
  padding: 10px 12px 12px;
}
.embed-mode .tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.embed-mode button {
  min-height: 44px;
  min-width: 44px;
  font-size: 14px;
  white-space: normal;
  touch-action: manipulation;
}
.embed-mode .tools button {
  flex: 1 1 auto;
}
.embed-mode #jump {
  width: 100%;
  touch-action: none;
}
