/* The app owns its interior; the host bounds its complete, proportional screen. */
.kh-game-screen.kh-game-app-stage { display: block; aspect-ratio: auto; min-height: 0; }
.kh-game-app-frame,
iframe.khcs-frame,
iframe.khom-frame {
  display: block;
  width: 100%;
  --kh-game-app-ratio: 16 / 9;
  --kh-game-app-ratio-value: 1.7777777778;
  --kh-game-app-display-limit: min(720px, max(1px, calc(100dvh - 32px)));
  height: auto;
  aspect-ratio: var(--kh-game-app-ratio);
  min-height: 0;
  max-height: var(--kh-game-app-display-limit);
  max-width: min(100%, calc(var(--kh-game-app-display-limit) * var(--kh-game-app-ratio-value)));
  margin-inline: auto;
  border: 0;
  background: var(--kh-game-app-background, #f7f7f1);
}
.kh-game-app-frame[data-aspect-ratio="9:16"] {
  --kh-game-app-ratio: 9 / 16;
  --kh-game-app-ratio-value: 0.5625;
}
.kh-game-app-frame.khom-frame { --kh-game-app-background: #f5f5ed; }
.kh-game-app-frame:fullscreen {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
  margin: 0;
}
