.game-bottom-ad {
  min-height: 50px;
  max-height: 100px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.game-bottom-ad[hidden],
.game-bottom-ad:has(.adsbygoogle[data-ad-status="unfilled"]) {
  display: none !important;
}

.game-bottom-ad .sudoku-ad-slot,
.game-bottom-ad .adsbygoogle {
  display: block;
  flex: 0 0 auto;
  width: min(970px, 100%);
  min-height: 50px;
  max-height: 100px;
  height: 90px;
  max-width: 100%;
}

.game-display-ad .sudoku-ad-slot {
  display: block;
  width: 100%;
}

@media (width >= 901px) {
  body.game-bottom-ad-active .board {
    width: min(100%, calc(100dvh - 310px));
  }
}

@media (height <= 1050px) and (width >= 901px) {
  body.game-bottom-ad-active .board {
    width: min(100%, calc(100dvh - 271px));
  }
}

@media (width <= 700px) {
  .shell {
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  body.game-bottom-ad-active .board {
    width: min(100%, calc(100dvh - 379px));
  }
}

@media (min-width: 1200px) and (max-width: 1499px) {
  .game-display-ad:not([hidden]) { display: block !important; }
}

@media (min-width: 1200px) {
  .game-display-ad {
    order: 1;
    min-height: 600px;
    margin-top: 8px;
  }
  .game-display-ad .sudoku-ad-slot { min-height: 600px; }
  .game-display-ad .adsbygoogle { min-height: 600px; }
  .challenge {
    order: 2;
    margin-top: 8px;
  }
}
