/* Keep very wide games playable while an advert and its controls share the player. */
.p-game-screen:not(:is(:fullscreen, .is-window-fullscreen)):has(:is([data-game-ad], [data-game-page-ad]):not([hidden])) {
  min-block-size: min(12rem, 85svh);
}

.p-game-stage > .ad-break {
  grid-template: minmax(0, 1fr) auto / minmax(0, 1fr);
}
.ad-break [data-break-creative] {
  grid-area: 1 / 1 / -1 / -1;
  container-type: size;
}
/* House artwork fills the stage. Paid creatives use the space above the controls. */
.ad-break [data-break-creative]:has(> .ad-card) { grid-row-end: 2; }
.ad-break .ad-card {
  grid-template: auto minmax(0, 1fr) / minmax(0, 1fr);
  min-block-size: 0;
  padding: .25rem clamp(.45rem, 2cqw, 1rem);
}
.ad-break .ad-card > small {
  align-self: start;
  max-block-size: 2.7em;
  max-inline-size: 100%;
  margin: 0;
  overflow: auto;
  overflow-wrap: anywhere;
  line-height: 1.3;
}
.ad-break .ad-content {
  align-self: center;
  max-block-size: 100%;
  min-block-size: 0;
}
.ad-break .ad-content :is(img, iframe) {
  max-inline-size: 100%;
  max-block-size: max(1px, calc(100cqh - 2.65rem));
}
.ad-break .ad-demo-copy { max-inline-size: 100%; }
.ad-break [data-player-house] strong a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 44px;
}
.ad-break .ad-break-actions {
  position: relative;
  z-index: 1;
  inset: auto;
  grid-area: 2 / 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) fit-content(65%);
  min-block-size: 3.125rem;
  block-size: auto;
  padding: .18rem clamp(.45rem, 3cqw, 1.25rem);
  gap: .3rem .65rem;
}
.ad-break-actions .ad-clock, .ad-page-actions .ad-clock {
  min-inline-size: 0;
  overflow-wrap: anywhere;
}
.p-game-screen .ad-break .ad-break-actions button {
  block-size: auto;
  min-block-size: 44px;
  max-block-size: none;
  padding: .3rem clamp(.45rem, 2cqw, .9rem);
  font-size: .92rem;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
}

.p-game-screen .ad-game-page {
  grid-template-columns: minmax(44px, var(--side-width)) minmax(0, 1fr) minmax(44px, var(--side-width));
}
.ad-game-page [data-page-creative] { max-inline-size: 100%; }
.ad-game-page [data-page-creative] :is(img, iframe) {
  max-inline-size: 100%;
  max-block-size: clamp(2rem, 12cqh, 5rem);
}
.ad-game-page .ad-card { min-inline-size: 0; }
.p-game-screen .ad-game-page .ad-page-actions button {
  min-inline-size: 44px;
  min-block-size: 44px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

@container player (max-width: 28rem) and (min-height: 14rem) {
  .ad-game-page:has(.ad-card) { grid-template-columns: minmax(0, 1fr) auto; gap: .1rem .5rem; }
  .ad-game-page:has(.ad-card) [data-page-creative] { grid-area: 1 / 1 / 2 / -1; }
  .ad-game-page:has(.ad-card) .ad-clock { grid-area: 2 / 1; }
  .ad-game-page:has(.ad-card) .ad-page-actions button { grid-area: 2 / 2; }
}

@container (max-height: 14rem) {
  .ad-break .ad-demo-copy { gap: .1rem; }
  .ad-break .ad-demo-size { display: none; }
}
