/* The quiz's variable-width, fixed-height top and bottom units. */
.page-ad-slot {
    width: 100%;
    max-width: 970px;
    height: 50px;
    min-height: 50px;
    flex: 0 0 auto;
    margin-inline: auto;
    overflow: visible;
}
.page-ad-slot > ins { display: block; width: 100%; height: 100%; }
.page-ad-preview {
    display: grid;
    place-content: center;
    height: 100%;
    box-sizing: border-box;
    background: #edf2f7;
    color: #344256;
    box-shadow: inset 0 0 0 2px #98a6b8;
    font: 12px/1.3 system-ui, sans-serif;
    text-align: center;
}
@media (max-width: 799px) and (min-height: 800px) and (orientation: portrait) {
    .page-ad-slot { height: 100px; min-height: 100px; }
}
@media (min-width: 800px) and (min-height: 600px) {
    .page-ad-slot { height: 90px; min-height: 90px; }
}
@media (min-width: 360px) and (max-width: 799px) and (min-height: 900px) and (orientation: portrait) {
    .page-ad-slot[data-page-ad="bottom"] { height: 250px; min-height: 250px; }
}
/* Public articles scroll normally, with banners bracketing the whole page. */
body.page-ad-document { height: auto; min-height: 100dvh; }
body.page-ad-document #root { height: auto; }
body.page-ad-document [data-device] { height: auto !important; }
/* Town's navigation/game owns its scrolling inside the remaining viewport. */
body.page-ad-game {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    min-height: 0;
    margin: 0;
    overflow: hidden;
}
body.page-ad-game #root {
    flex: 1 1 0;
    height: auto;
    min-height: 0;
    min-width: 0;
}

/* Separate publisher content and controls from the ad boundaries. */
.page-ad-slot[data-page-ad="top"] { margin-bottom: 24px; }
.page-ad-slot[data-page-ad="bottom"] { margin-top: 24px; }

/* Town requests variable-width banners at a fixed height before ads load. */
body.page-ad-game .page-ad-slot { height: 50px; min-height: 50px; }
/* The game header and tab bar provide their own padding next to the banners. */
body.page-ad-game .page-ad-slot[data-page-ad="top"] { margin-bottom: 0; }
body.page-ad-game .page-ad-slot[data-page-ad="bottom"] { margin-top: 0; }
@media (min-width: 800px) and (min-height: 800px) {
    body.page-ad-game .page-ad-slot { height: 90px; min-height: 90px; }
}

.infoArticleAd { grid-column: 1 / -1; min-width: 0; }
.infoArticleAd:empty { display: none; }
.page-ad-slot.page-ad-article { height: auto; min-height: 120px; max-width: none; margin-block: 24px; }
.page-ad-slot.page-ad-article > ins { height: auto; }
.page-ad-article .page-ad-preview { min-height: 120px; }
