/**
 * DDG — playground shell layout (same card + square stage as Slider Puzzle).
 */

.ddg-page {
  overflow-x: hidden;
  overflow-y: auto;
}

.ddg__card {
  /* layout + min-height: .labs-game-card */
}

.ddg-page .labs-game-card__stage-grow > .labs-game-slot {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

.ddg-page .labs-game-card__stage-grow .labs-game-stage {
  flex: 1 1 auto;
  min-height: clamp(280px, 52vw, 420px);
  aspect-ratio: 4 / 5;
  max-height: 100%;
  height: auto;
  width: 100%;
}

.ddg-page .labs-game-stage .page,
.ddg-page .labs-game-stage .page-fullscreen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.ddg-page .labs-game-stage .page-fullscreen {
  display: flex;
  flex-direction: column;
}

.ddg-page .labs-game-stage .frappy-bg,
.ddg-page .labs-game-stage .frappy-bg-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.ddg-page .labs-game-stage .intro-splash {
  position: absolute;
  inset: 0;
  z-index: 86;
  padding: 8px;
}

.ddg-page .labs-game-stage .intro-splash-world {
  border-radius: calc(var(--labs-stage-radius, 22px) - 4px);
  overflow: hidden;
}

.ddg-page .labs-game-stage .intro-splash-inner {
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  padding: 0.85rem 0.8rem;
  gap: clamp(6px, 1.5vh, 12px);
}

.ddg-page .labs-game-stage .intro-splash-brand-row .intro-splash-lo {
  width: min(38%, 120px);
  max-height: 72px;
}

.ddg-page .labs-game-stage .intro-splash-brand-row .ddg-skull-wrap--intro {
  width: min(32%, 88px);
  height: min(32%, 88px);
}

.ddg-page .labs-game-stage .game-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  padding: 4px calc(6px + 34px) 6px calc(6px + 34px);
}

.ddg-page .labs-game-stage .co-brand-lo {
  height: 28px;
}

.ddg-page .labs-game-stage .game-viewport {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ddg-page .labs-game-stage .canvas-wrap {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  aspect-ratio: unset;
}

.ddg-page .labs-game-stage .btn-back--corner,
.ddg-page .labs-game-stage .btn-help--corner {
  position: absolute;
  z-index: 70;
}

.ddg-page .labs-game-stage .btn-back--corner {
  top: max(6px, env(safe-area-inset-top, 0px));
  left: max(6px, env(safe-area-inset-left, 0px));
  min-height: 34px;
  min-width: 34px;
  padding: 0.3rem 0.5rem;
}

.ddg-page .labs-game-stage .btn-help--corner {
  top: max(6px, env(safe-area-inset-top, 0px));
  right: max(6px, env(safe-area-inset-right, 0px));
  min-height: 34px;
  min-width: 34px;
  padding: 0.3rem 0.5rem;
}

.ddg-page .labs-game-stage .modal-overlay {
  position: absolute;
  inset: 0;
  z-index: 120;
}

.ddg-page.game-over-active .labs-game-stage #overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 6px;
}

.ddg-page .labs-game-stage .overlay-card {
  max-width: none;
  width: 100%;
  max-height: calc(100% - 6px);
  overflow-y: auto;
  padding: 14px 12px 16px;
}

.ddg__actions {
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.ddg__actions .labs-back-to-hub {
  width: 100%;
  text-align: center;
  justify-content: center;
}

.ddg-page .labs-game-stage .hud-pill {
  font-size: 11px;
  padding: 3px 8px;
}
