/* Banner is a normal-flow sibling, not a modal, fullscreen ad, or overlay. */
body.round-banner-layout {
  --round-banner-height: 110px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: var(--round-viewport-height, 100dvh);
}
body.round-banner-layout > .container {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}
body.round-banner-layout #main {
  height: 100%;
  max-height: 100%;
  min-height: 0;
}
/* Preserve mounted keyboard nodes; prevent taps against the advertisement. */
body.round-banner-layout #game-keyboard,
body.round-banner-layout .textarea-wrapper {
  visibility: hidden;
  pointer-events: none;
}
body.round-banner-layout .modal_bg {
  bottom: calc(var(--round-banner-height) + env(safe-area-inset-bottom, 0px)) !important;
  height: calc(100% - var(--round-banner-height) - env(safe-area-inset-bottom, 0px)) !important;
  max-height: calc(100% - var(--round-banner-height) - env(safe-area-inset-bottom, 0px)) !important;
}
#round-banner {
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 100%;
  height: calc(var(--round-banner-height) + env(safe-area-inset-bottom, 0px));
  padding: 28px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  color: #555;
  background: #fff;
  font: 10px/16px "Courier New", Courier, monospace;
}
#round-banner[hidden] { display: none !important; }
.round-banner-label { margin-bottom: 4px; }
.round-banner-preview {
  display: inline-flex;
  box-sizing: border-box;
  width: 320px;
  height: 50px;
  align-items: center;
  justify-content: center;
  border: 1px dashed #87956c;
  background: #f0f3e8;
  font-size: 12px;
}

/* Preserve the existing card, typography and spacing. Only the long results
   list scrolls; its heading and action buttons remain inside the dialog. */
#scoreboard > .modal_box,
#emptyround_total > .modal_box {
  display: flex;
  flex-direction: column;
  margin-top: 16px;
  margin-bottom: 16px;
  box-sizing: border-box;
  min-height: 0;
  max-height: calc(100% - 32px);
}
#scoreboard .modal_content,
#emptyround_total .modal_content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
#scoreboard .modal_content > :not(.modal_detail_text),
#emptyround_total .modal_content > :not(.modal_detail_text) {
  flex-shrink: 0;
}
#scoreboard .modal_detail_text,
#emptyround_total .modal_detail_text {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
