/* The host keeps its player toolbar in the top 64px of the iframe. */
html.embedded, .embedded body { width: 100%; height: 100%; overflow: hidden; }
.embedded body { background: #203a32; }
.embedded .topbar, .embedded .page-heading, .embedded footer { display: none; }
.embedded main {
  height: calc(100dvh - 64px);
  margin: 64px 0 0;
  max-width: none;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.embedded-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 36px;
  flex: none;
}
.embedded-toolbar .campaign-button { min-height: 36px; padding: 4px 8px; gap: 4px; font-size: 11px; margin: 0; }
.embedded-toolbar .campaign-button small, .embedded-toolbar .campaign-button > svg,
.embedded-toolbar .campaign-button > span:last-child { display: none; }
.embedded-toolbar .icon-button { width: 36px; height: 36px; color: #f2ecd9; }
.embedded .game-layout { display: flex; flex: 1; min-height: 0; gap: 0; }
.embedded .battle-column { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.embedded .battle-shell, .embedded .battle-bottom { width: min(100%, calc((100dvh - 242px) * 4 / 3 + 2px)); flex: none; }
.embedded .battle-shell { border-radius: 7px; }
.embedded .canvas-wrap { aspect-ratio: 4 / 3; }
.embedded canvas { width: 100%; height: 100%; }
.embedded .battle-hud { height: 40px; padding: 0 7px; gap: 6px; }
.embedded .mission-title { min-width: 0; }
.embedded .mission-title > span, .embedded .mission-title small { display: none; }
.embedded .mission-title strong { font-size: 10px; white-space: nowrap; }
.embedded .resources { gap: 7px; }
.embedded .resource { gap: 3px; }
.embedded .resource strong { font-size: 13px; min-width: 0; }
.embedded .resource small { font-size: 9px; }
.embedded .resource svg { width: 13px; height: 13px; }
.embedded .control-dock { min-height: 50px; height: 50px; padding: 3px 6px; gap: 8px; }
.embedded .hero-control, .embedded .skill-control { min-height: 40px; }
.embedded .hero-control > span:nth-child(2), .embedded .skill-control > span:nth-child(2),
.embedded .dock-divider, .embedded .hero-control kbd, .embedded .skill-control kbd { display: none; }
.embedded .hero-avatar, .embedded .skill-icon { width: 33px; height: 36px; }
.embedded .skill-icon svg { width: 22px; height: 22px; }
.embedded .playback { gap: 4px; }
.embedded .playback button { width: 32px; min-height: 38px; }
.embedded .battle-bottom { margin: 0; height: 38px; justify-content: center; }
.embedded .battle-bottom > span { display: none; }
.embedded .wave-button { min-height: 36px; padding: 5px 12px; font-size: 11px; }
.embedded .intro-cover { padding: 6px; }
.embedded .intro-card { max-width: 300px; padding: 10px; }
.embedded .intro-emblem, .embedded .intro-card .eyebrow, .embedded .intro-card p,
.embedded .intro-card > small { display: none; }
.embedded .intro-card h2 { font-size: 14px; margin: 0 0 8px; }
.embedded .intro-card .primary-button { min-height: 40px; padding: 7px; }
.embedded .map-caption { left: 6px; right: 6px; bottom: 5px; }
.embedded .map-caption span:last-child { display: none; }
.embedded .target-hint { max-width: calc(100% - 8px); font-size: 10px; white-space: normal; gap: 5px; top: 4px; padding: 3px 5px; }
.embedded .target-hint button { min-height: 32px; white-space: nowrap; }
.embedded .command-panel {
  position: fixed;
  z-index: 10;
  top: 108px;
  right: 4px;
  bottom: 4px;
  width: min(310px, calc(100vw - 8px));
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
  box-shadow: 0 8px 35px #10271dcc;
}
.embedded-panel-close { display: block; margin: 0 0 8px auto; min-height: 36px; padding: 6px 12px; border: 1px solid #c2cbb4; border-radius: 5px; background: #e7eadf; color: #3b5540; }
.embedded .panel-heading, .embedded .field-notes, .embedded .chapter-progress { display: none; }
.embedded .command-panel h2 { margin: 6px 0; font-size: 17px; }
.embedded .panel-description { min-height: 0; margin: 6px 0 10px; font-size: 11px; }
.embedded .tower-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
.embedded .tower-card { min-height: 112px; }
.embedded .tower-card .tower-art { width: 80px; height: 60px; }
.embedded .range-toggle { min-height: 40px; }
.embedded .modal { max-height: calc(100dvh - 80px); margin: 72px auto 8px; padding: 24px 18px; }
.embedded .modal h2 { font-size: 18px; }
.embedded .campaign-grid { grid-template-columns: repeat(3, 1fr); }
.embedded .toast { bottom: 8px; padding: 8px 12px; font-size: 11px; }

/* Short landscape players use the free space beside the battlefield. */
@media (min-width: 650px) and (max-height: 520px) {
  .embedded main { flex-direction: row; }
  .embedded-toolbar { width: 96px; height: 100%; flex-direction: column; gap: 8px; }
  .embedded-toolbar .campaign-button { width: 96px; justify-content: center; }
  .embedded .battle-column { flex: 0 1 auto; width: min(100%, calc((100dvh - 114px) * 4 / 3 + 90px)); margin: auto; position: relative; }
  .embedded .battle-shell { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 88px; grid-template-rows: 40px auto; }
  .embedded .battle-hud { grid-column: 1; grid-row: 1; }
  .embedded .canvas-wrap { grid-column: 1; grid-row: 2; }
  .embedded .control-dock { grid-column: 2; grid-row: 1 / 3; height: 100%; flex-direction: column; gap: 8px; padding-bottom: 44px; }
  .embedded .hero-control, .embedded .skill-control { flex: none; }
  .embedded .playback { margin: auto 0 0; }
  .embedded .battle-bottom { position: absolute; right: 4px; bottom: 4px; width: 80px; }
  .embedded .wave-button { width: 80px; padding: 4px; font-size: 10px; white-space: normal; gap: 2px; }
  .embedded .wave-button svg { width: 14px; }
  .embedded .command-panel { top: 68px; }
}
