.tg-ad-anchor {
  position: fixed;
  z-index: 50;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: 0;
  right: 0;
  width: 100%;
  pointer-events: none;
}

.tg-ad-anchor.is-hidden {
  display: none;
}

#tg-ad-slot {
  pointer-events: auto;
}

.tg-ad-panel {
  display: grid;
  gap: 0;
}

.tg-ad-panel__top {
  display: flex;
  justify-content: center;
  padding: 0 12px;
}

.tg-ad-panel__sides {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.tg-ad-rail {
  position: fixed;
  top: clamp(210px, 36vh, 460px);
  pointer-events: auto;
  display: grid;
  gap: 10px;
}

.tg-ad-rail--left {
  left: max(10px, env(safe-area-inset-left, 0px) + 8px);
}

.tg-ad-rail--right {
  right: max(10px, env(safe-area-inset-right, 0px) + 8px);
}

.tg-ad-button,
.tg-ad-status,
.tg-ad-banner-shell {
  box-sizing: border-box;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.tg-ad-button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 54px;
  padding: 10px 12px;
  background: rgba(34, 24, 58, 0.88);
  color: #fff;
  font: 800 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
}

.tg-ad-button--prominent {
  width: min(70vw, 250px);
  min-height: 58px;
  background: linear-gradient(180deg, rgba(97, 63, 208, 0.96), rgba(45, 35, 128, 0.96));
}

.tg-ad-rail .tg-ad-button {
  width: 84px;
  min-height: 78px;
  padding: 10px 8px;
  border-radius: 18px;
  background: rgba(23, 28, 54, 0.84);
}

.tg-ad-button:disabled {
  opacity: 0.72;
  cursor: wait;
}

.tg-ad-button__title {
  font-size: 13px;
  font-weight: 900;
}

.tg-ad-button__reward {
  color: #fff1a5;
  font-size: 12px;
  font-weight: 800;
}

.tg-ad-rail .tg-ad-button__title {
  font-size: 11px;
}

.tg-ad-rail .tg-ad-button__reward {
  font-size: 10px;
  line-height: 1.15;
}

.tg-ad-banner-shell {
  width: 84px;
  min-height: 70px;
  padding: 6px;
  background: rgba(16, 18, 33, 0.5);
}

.tg-ad-banner-shell[data-empty="1"] {
  display: none;
}

.tg-ad-banner-shell [data-banner] {
  width: 100%;
  min-height: 58px;
}

.tg-ad-status {
  width: min(88vw, 320px);
  margin: 12px auto 0;
  padding: 9px 12px;
  background: rgba(18, 23, 31, 0.88);
  color: #d8e3ef;
  font: 700 12px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: center;
}

.tg-ad-status.is-hidden {
  display: none;
}

.tg-ad-status.is-success {
  background: rgba(19, 98, 57, 0.9);
  color: #dfffb2;
}

.tg-ad-status.is-warn {
  background: rgba(102, 79, 19, 0.92);
  color: #ffe8a1;
}

.tg-ad-status.is-error {
  background: rgba(116, 33, 33, 0.92);
  color: #ffd2d2;
}

@media (max-width: 420px) {
  .tg-ad-rail {
    top: clamp(180px, 33vh, 380px);
  }

  .tg-ad-rail .tg-ad-button,
  .tg-ad-banner-shell {
    width: 76px;
    min-height: 72px;
  }
}
