/* Embedded presentation only; retain the upstream standalone page. */
html.embedded,
.embedded body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.embedded .site-header,
.embedded .page-heading,
.embedded .sidebar,
.embedded footer,
.embedded .board-caption {
  display: none;
}

.embedded .sr-only {
  bottom: 0;
  left: 0;
}

.embedded .app-shell {
  width: 100%;
  max-width: none;
  height: 100dvh;
  padding: 64px 8px 8px;
}

.embedded main,
.embedded .game-layout {
  display: block;
  height: 100%;
  min-height: 0;
}

.embedded .game-section {
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr) 44px;
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 14px;
}

.embedded .game-toolbar {
  height: auto;
  min-width: 0;
  padding: 0 8px;
  gap: 6px;
}

.embedded .chapter-label {
  gap: 6px;
}

.embedded .chapter-number {
  width: 24px;
  height: 30px;
  font-size: 11px;
}

.embedded .chapter-label b {
  font-size: 11px;
}

.embedded .chapter-label small {
  font-size: 9px;
}

.embedded .hud-stars {
  gap: 2px;
}

.embedded .hud-stars svg {
  width: 17px;
  height: 17px;
}

.embedded .game-controls {
  gap: 0;
}

.embedded .game-controls .icon-button {
  width: 40px;
  height: 40px;
  border-color: transparent;
}

.embedded .board {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  aspect-ratio: auto;
  border-radius: 0;
}

.embedded .board-footer {
  height: auto;
  padding: 0 10px;
  gap: 6px;
}

.embedded .board-footer > span {
  font-size: 9px;
}

.embedded .overlay-card {
  max-height: 100%;
  overflow: auto;
  padding: 14px;
  transform: none;
}

.embedded .overlay-card h2 {
  font-size: 20px;
  margin: 6px 0;
}

.embedded .overlay-card p {
  margin-bottom: 10px;
}

.embedded .overlay-card .tiny-label {
  display: none;
}

.embedded .overlay-card .text-button {
  margin-top: 0;
}

.embedded .result-stars {
  margin: 0 0 8px;
  font-size: 24px;
}

.embedded dialog {
  top: 64px;
  bottom: 8px;
  max-height: calc(100dvh - 72px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 18px;
}

.embedded .dialog-heading h2 {
  margin-bottom: 12px;
  font-size: 20px;
}

.embedded .dialog-tabs {
  margin-bottom: 12px;
}

@media (min-width: 650px) and (max-height: 520px) {
  .embedded .game-section {
    grid-template-columns: 112px minmax(0, 1fr) 112px;
    grid-template-rows: minmax(0, 1fr);
  }

  .embedded .game-toolbar {
    flex-direction: column;
    justify-content: center;
    padding: 8px;
    gap: 12px;
  }

  .embedded .game-controls {
    flex-direction: column;
  }

  .embedded .board-footer {
    flex-direction: column;
    justify-content: center;
    padding: 8px;
    gap: 12px;
    text-align: center;
  }

  .embedded .board-footer > span {
    flex-direction: column;
  }
}
