  /* In-frame ad UX (banner peek + in-frame back arrow) */
  .ad-back {
    position: absolute;
    top: 10px; left: 10px;
    width: 36px; height: 36px;
    border-radius: 11px;
    z-index: 6;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  .ad-back.show { opacity: 0.92; pointer-events: auto; }
  .ad-back:hover { opacity: 1; }
  .ad-back svg { width: 18px; height: 18px; }
  /* During an active ad (catcher mounted), the megaphone stays visible, and
     the back arrow becomes a faded, unclickable placeholder — the ad-close X
     to the right of the countdown is the only way to dismiss the ad. Toggled
     via `.ad-active` on the parent frame in adAttachToIframe's peek start/end. */
  .ad-active .ad-back {
    opacity: 0.35 !important;
    pointer-events: none !important;
    cursor: default !important;
  }
  .ad-active .ad-mark { opacity: 1; }
  .ad-hot {
    position: absolute;
    top: 0; left: 0;
    width: 88px; height: 88px;
    z-index: 5;
    pointer-events: auto;
  }
  /* Countdown pip — sits next to .ad-mark during the 5s ad window.
     .ad-back at left:10/width:36, .ad-mark at left:56/width:32 → countdown
     at left:96 (56+32+8 padding). Matte-green to match the .ad-back family;
     megaphone keeps its amber identity in between. */
  .ad-countdown {
    position: absolute;
    top: 10px; left: 96px;
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: rgba(20, 50, 38, 0.78);
    color: var(--accent-soft);
    border: 1px solid rgba(60,130,110,0.55);
    font-weight: 700; font-size: 18px;
    z-index: 7;
    pointer-events: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 0 0 1px var(--accent-glow), 0 2px 6px rgba(0,0,0,0.45);
  }
  /* Ad close-X — sits next to .ad-countdown (left:136 = 96+32+8) during the
     5s ad window. Red-ish destructive tint matching .confirm-pop .danger.
     Click closes the ad immediately (same path as the legacy ad-back peek
     exit: endPeekIfActive('back') + 60s cooldown). */
  .ad-close {
    position: absolute;
    top: 10px; left: 136px;
    width: 32px; height: 32px;
    border-radius: 50%;
    display: grid; place-items: center;
    border: 1px solid rgba(180,80,60,0.55);
    background: rgba(70, 25, 18, 0.78);
    color: #ffd4c4;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, background 0.12s ease;
    z-index: 11;
  }
  .ad-active .ad-close { opacity: 1; pointer-events: auto; }
  .ad-close:hover { background: rgba(120,40,30,0.95); }
  .ad-close svg { width: 16px; height: 16px; display: block; }
  .ad-catcher {
    position: absolute;
    inset: 0;
    z-index: 4;
    background: transparent;
    cursor: pointer;
    /* Explicit opt-in — родитель .fs-ad-host имеет pointer-events:none, без
       этого clicks по catcher'у не доходили в FS-режиме. */
    pointer-events: auto;
  }
  /* Ad-overlay iframe (показывает рекламу поверх игрового iframe'а). PE:auto
     чтобы игра-реклама принимала interactions ВНУТРИ overlay'а — но catcher
     стоит выше (z:4) и перехватывает клики для travel-mechanic'а. */
  .ad-overlay-frame {
    pointer-events: auto;
  }
  /* Static "this is an ad" indicator — sits next to .ad-back during the 5s ad window.
     .ad-back is at top:10/left:10/width:36 → place at top:10/left:56 (10+36+10). */
  .ad-mark {
    position: absolute;
    top: 10px; left: 56px;
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border-radius: 50%;
    border: 1px solid rgba(140,140,80,0.45);
    background: rgba(40,40,8,0.72);
    color: #ffd47a;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    z-index: 6;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
  }
  .ad-mark.show { opacity: 1; }
  .ad-mark svg { width: 16px; height: 16px; }

  /* Narrow frames: ad controls are repositioned by JS (adAttachToIframe →
     refreshAdLayout / ResizeObserver) based on the ACTUAL frame width, not
     the viewport width. Inline styles applied there override these defaults.
     The old @media(max-width:380px) viewport-based rule is intentionally
     removed — it compared the wrong dimension (viewport vs. frame). */
