/* PHP renders only actual ads; missing positions have no markup or empty box. */
.mame-ad[hidden] { display: none !important; }
.mame-ad {
  position: relative;
  width: var(--mame-ad-width);
  max-width: 100%;
  margin: 24px auto;
  line-height: 0;
}
.mame-ad a, .mame-ad img { display: block; }
.mame-ad img { width: 100%; height: auto; }
.mame-ad-embed-view { position: absolute; inset: 0; overflow: hidden; }
.mame-ad iframe { display: block; border: 0; max-width: none; transform-origin: 0 0; }
.mame-ad-header {
  display: flow-root;
  width: 100%;
  background: transparent;
  grid-column: 1 / -1;
}
section.hc-section.hero.mame-has-leaderboard { padding-top: 24px; }
.mame-has-leaderboard .mame-ad-header .mame-ad { margin-top: 0; }
.sp-top__grid > .mame-ad-header .mame-ad,
.sp-body__grid > .mame-ad-header .mame-ad { margin-top: 0; margin-bottom: 0; }
.mame-ad-mobile-p1-section {
  display: flow-root;
  width: 100%;
  margin: 0;
  background: #fff;
}
.mame-ad-mobile-p1-section .mame-ad { max-width: calc(100% - 40px); }
.mame-ad-desktop-leaderboard, .mame-ad-mobile-leaderboard { max-width: calc(100% - 18px); }
.mame-ad-desktop-p1 { margin-top: 0; }
.mame-ad-desktop-sticky, .mame-ad-mobile-sticky {
  position: fixed;
  bottom: max(8px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000000;
  max-width: calc(100vw - 24px);
  margin: 0;
}
.mame-ad-desktop-sticky img, .mame-ad-mobile-sticky img { max-height: 40vh; object-fit: contain; }
.mame-ad-close {
  position: absolute;
  right: 0;
  top: -24px;
  width: 28px;
  height: 24px;
  padding: 0;
  border: 1px solid #d7dce3;
  background: #fff;
  color: #11151d;
  font: 22px/22px Arial, sans-serif;
  cursor: pointer;
}
body.mame-has-ad-sticky { padding-bottom: var(--mame-ad-sticky-space); }
.mame-ad-tiles {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 24px;
  width: calc(100% - 40px);
  max-width: 1200px;
  margin: 0 auto;
}
.mame-ad-tiles .mame-ad { flex: 0 1 var(--mame-ad-width); margin: 24px 0; }
.mame-ad-desktop-branding-left, .mame-ad-desktop-branding-right {
  display: none;
  position: fixed;
  top: 0;
  width: min(var(--mame-ad-width), calc((100vw - 1240px) / 2 - 16px));
  margin: 0;
  z-index: 10;
}
.mame-ad-desktop-branding-left { right: calc(50% + 628px); }
.mame-ad-desktop-branding-right { left: calc(50% + 628px); }
.admin-bar .mame-ad-desktop-branding-left, .admin-bar .mame-ad-desktop-branding-right { top: 32px; }
@media (min-width: 1400px) {
  .mame-ad-desktop-branding-left, .mame-ad-desktop-branding-right { display: block; }
}
@media (max-width: 980px) {
  .mame-ad[class*="mame-ad-desktop-"] { display: none; }
  .mame-ad-tiles { display: none; }
}
@media (min-width: 981px) {
  .mame-ad[class*="mame-ad-mobile-"] { display: none; }
  .mame-ad-mobile-p1-section { display: none; }
}
@media print {
  .mame-ad, .mame-ad-tiles, .mame-ad-mobile-p1-section { display: none !important; }
  body.mame-has-ad-sticky { padding-bottom: 0; }
}
