/* An embedded game keeps its complete play surface and controls, without page chrome. */
html.game-embedded, html.game-embedded body.wg-game-body {
  width: 100%; height: 100%; min-width: 0; min-height: 0; margin: 0; padding: 0;
  overflow: hidden; background: transparent;
}
html.game-embedded body.wg-game-body { display: block; touch-action: auto; }
html.game-embedded .site-header, html.game-embedded .wg-site-header,
html.game-embedded .wg-page-heading, html.game-embedded .wg-discovery,
html.game-embedded .ant-intro, html.game-embedded .ant-howto,
html.game-embedded .ant-next-up, html.game-embedded .ant-category-navigation,
html.game-embedded .ant-stage-heading, html.game-embedded .ant-player-toolbar,
html.game-embedded .ant-flow-line, html.game-embedded .footer,
html.game-embedded .site-footer, html.game-embedded .wg-help,
html.game-embedded .wg-home-btn, html.game-embedded .wg-mute-lbl { display: none !important; }
html.game-embedded body.wg-game-body .wg-game-page,
html.game-embedded body.wg-game-body .wg-play-layout,
html.game-embedded body.wg-game-body .ant-stage {
  display: block; width: 100%; height: 100%; max-width: none; min-width: 0; min-height: 0;
  margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent;
  box-shadow: none; transform: none;
}
html.game-embedded .ant-stage::before, html.game-embedded .ant-stage::after { display: none; }
html.game-embedded body.wg-game-body .wg-player {
  position: relative; display: block; width: 100%; height: 100%; min-width: 0; min-height: 0;
  padding: 0; margin: 0; border: 0; border-radius: 0; overflow: hidden;
  background: var(--wg-player-background, transparent); box-shadow: none;
}
html.game-embedded .embed-content {
  position: absolute; left: 50%; top: 50%; width: 100%; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transform: translate(-50%, -50%) translate(var(--embed-offset-x, 0px), var(--embed-offset-y, 0px)) scale(var(--embed-scale, 1)); transform-origin: center;
}
html.game-embedded .embed-content > .wrap,
html.game-embedded .embed-content > .panel,
html.game-embedded .embed-content > .board-col {
  max-width: 100%; min-width: 0; flex-shrink: 0; margin: 0; box-sizing: border-box;
}
html.game-embedded[data-game-kind=canvas] .embed-content > .wrap,
html.game-embedded[data-game-kind=canvas] .embed-content > .board-col .wrap {
  width: min(100%, var(--game-world-width), calc((100svh - var(--game-controls-height)) * var(--game-world-ratio)));
  height: auto; max-width: none; min-width: 0; aspect-ratio: var(--game-world-ratio);
  flex-shrink: 0; margin: 0; border-radius: 0; box-shadow: none;
}
html.game-embedded[data-game-kind=canvas] .embed-content > .panel .wrap {
  max-width: 100%; margin-inline: auto;
}
html.game-embedded .wg-player canvas { display: block; max-width: 100%; height: auto; }
html.game-embedded[data-game-kind=canvas] .wg-player canvas#game {
  width: 100%; height: auto; aspect-ratio: var(--game-world-ratio);
}
html.game-embedded .overlay { max-width: 100%; box-sizing: border-box; overflow-y: auto; justify-content: safe center; }
html.game-embedded:not(.game-preview-mode)[data-game-kind=board] .embed-content > .panel:has(.overlay:not(.hidden)),
html.game-embedded:not(.game-preview-mode)[data-game-kind=board] .embed-content > .wrap:has(.overlay:not(.hidden)) {
  min-height: min(460px, 100svh);
}
/* The host fits the whole board, including its negative-side overflow. */
html.game-embedded[data-game=mancala] .board-area { overflow: visible !important; }
html.game-embedded:not(.game-preview-mode) #mute-btn { pointer-events: auto; }
html.game-embedded .btn-row { flex-wrap: wrap; justify-content: center; }
html.game-preview-mode, html.game-preview-mode * { pointer-events: none !important; }
html.game-preview-mode .overlay, html.game-preview-mode #mute-btn,
html.game-preview-mode .wg-tools, html.game-preview-mode .tools { display: none !important; }
@media (max-width: 340px), (max-height: 460px) {
  html.game-embedded .wg-player .overlay { gap: 8px; padding: 16px; }
  html.game-embedded .wg-player .title { font-size: 30px; }
  html.game-embedded .wg-player .title .en, html.game-embedded .wg-player .title .sub { font-size: 10px; letter-spacing: 2px; }
  html.game-embedded .wg-player .ant-big, html.game-embedded .wg-player .icon-big { font-size: 42px; }
  html.game-embedded .wg-player .tip { font-size: 12px; line-height: 1.5; }
  html.game-embedded .wg-player .best { font-size: 11px; }
  html.game-embedded .wg-player .btn-row button { padding: 10px 14px; font-size: 12px; }
}
