/* In-player sponsorship — presentation only, above <video>. */
.hvl-sponsor-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.hvl-sponsor-layer a,
.hvl-sponsor-layer button {
  pointer-events: none;
}
.hvl-sponsor-slate.is-visible a,
.hvl-sponsor-slate.is-visible button,
.hvl-sponsor-overlay.is-visible a,
.hvl-sponsor-overlay.is-visible button,
.hvl-sponsor-bug.is-visible a,
.hvl-sponsor-bug.is-visible button {
  pointer-events: auto;
}

.hvl-sponsor-kicker {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.hvl-sponsor-slate {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  background: linear-gradient(180deg, rgba(6, 8, 12, 0.55), rgba(6, 8, 12, 0.78));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.36s ease;
  overflow: hidden;
  box-sizing: border-box;
}
.hvl-sponsor-slate.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.player.has-sponsor-slate .connectingToast { opacity: 0; pointer-events: none; }

.hvl-sponsor-safe-area {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  padding-top: max(clamp(10px, 2vw, 18px), env(safe-area-inset-top, 0px));
  padding-bottom: max(clamp(10px, 2vw, 18px), env(safe-area-inset-bottom, 0px));
  padding-left: max(10px, env(safe-area-inset-left, 0px));
  padding-right: max(10px, env(safe-area-inset-right, 0px));
}

.hvl-sponsor-slate-inner {
  flex: 0 1 auto;
  min-height: 0;
  max-height: 100%;
  width: min(92%, 360px);
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: clamp(4px, 1.4cqi, 10px);
  text-align: center;
  padding: clamp(8px, 2.2cqi, 18px) clamp(10px, 2.4cqi, 20px);
  border-radius: 18px;
  background: rgba(10, 12, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  color: #fff;
  box-sizing: border-box;
  overflow: hidden;
}
.hvl-sponsor-slate-card { display: contents; }
.hvl-sponsor-slate-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
}
.hvl-sponsor-slate-logo {
  width: clamp(48px, 12cqi, 72px);
  height: clamp(48px, 12cqi, 72px);
  object-fit: contain;
  margin: clamp(2px, 0.8cqi, 12px) auto clamp(2px, 0.6cqi, 8px);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  padding: 6px;
  display: block;
  flex: 0 0 auto;
}
.hvl-sponsor-slate-name {
  margin: 0 0 clamp(2px, 0.6cqi, 6px);
  font-size: clamp(1.125rem, 3.4cqi, 1.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.hvl-sponsor-slate-tag {
  margin: 0 0 clamp(6px, 1.2cqi, 12px);
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(0.8125rem, 2.4cqi, 0.92rem);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  max-height: 2.7em;
}
.hvl-sponsor-slate-status {
  flex: 0 0 auto;
  margin: clamp(4px, 1cqi, 12px) 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(0.75rem, 2.2cqi, 0.875rem);
  font-weight: 650;
  line-height: 1.25;
}

.hvl-sponsor-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(36px, 8cqi, 42px);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 750;
  font-size: 0.88rem;
  flex: 0 0 auto;
}
.hvl-sponsor-cta:hover { background: rgba(255, 255, 255, 0.16); }
.hvl-sponsor-cta-sm { min-height: 32px; padding: 0.28rem 0.7rem; font-size: 0.78rem; margin-top: 6px; }

.hvl-sponsor-overlay {
  position: absolute;
  right: max(10px, env(safe-area-inset-right, 0px));
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  left: auto;
  max-width: min(92%, 360px);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.hvl-sponsor-overlay.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.hvl-sponsor-overlay-card {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 10px 36px 10px 12px;
  border-radius: 14px;
  background: rgba(8, 10, 16, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  color: #fff;
}
.hvl-sponsor-overlay-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hvl-sponsor-overlay-card img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
}
.hvl-sponsor-name-link {
  display: block;
  color: #fff;
  font-weight: 750;
  font-size: 0.95rem;
  line-height: 1.2;
}
.hvl-sponsor-overlay-card.is-compact {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 34px 8px 8px;
  max-width: min(94vw, 320px);
}
.hvl-sponsor-overlay-card.is-compact img { width: 32px; height: 32px; }

.hvl-sponsor-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}
.hvl-sponsor-close:hover { background: rgba(255, 255, 255, 0.16); }

.hvl-sponsor-bug {
  position: absolute;
  right: max(10px, env(safe-area-inset-right, 0px));
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.hvl-sponsor-bug.is-visible { opacity: 1; pointer-events: auto; }
.hvl-sponsor-bug[data-corner="bottom-left"] {
  right: auto;
  left: max(10px, env(safe-area-inset-left, 0px));
}
.hvl-sponsor-bug[data-corner="top-right"] {
  bottom: auto;
  top: max(10px, env(safe-area-inset-top, 0px));
}
.hvl-sponsor-bug-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 30px 6px 8px;
  border-radius: 999px;
  background: rgba(8, 10, 16, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  color: #fff;
}
.hvl-sponsor-bug-card img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 6px;
}
.hvl-sponsor-bug-card a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
}
.hvl-sponsor-bug-card .hvl-sponsor-close {
  width: 26px;
  height: 26px;
  font-size: 1rem;
}

.hvl-sponsor-slate[hidden],
.hvl-sponsor-overlay[hidden],
.hvl-sponsor-bug[hidden] {
  display: none !important;
}

.player.hvl-sponsor-native-fs .hvl-sponsor-slate,
.player.hvl-sponsor-native-fs .hvl-sponsor-overlay {
  display: none;
}

@media (max-width: 640px) {
  .hvl-sponsor-overlay {
    left: max(8px, env(safe-area-inset-left, 0px));
    right: max(8px, env(safe-area-inset-right, 0px));
    max-width: none;
  }
  .hvl-sponsor-kicker {
    font-size: clamp(10px, 2.8cqi, 12px);
    letter-spacing: 0.08em;
  }
  .hvl-sponsor-safe-area {
    padding-top: max(clamp(10px, 2vw, 18px), env(safe-area-inset-top, 0px));
    padding-bottom: max(clamp(10px, 2vw, 18px), env(safe-area-inset-bottom, 0px));
    padding-left: max(8px, env(safe-area-inset-left, 0px));
    padding-right: max(8px, env(safe-area-inset-right, 0px));
  }
  .hvl-sponsor-slate-inner {
    width: min(96%, 360px);
    padding: clamp(6px, 1.6cqi, 12px) clamp(8px, 2cqi, 12px);
    gap: 4px;
    border-radius: 14px;
  }
  .hvl-sponsor-slate-logo {
    width: clamp(48px, 16cqi, 64px);
    height: clamp(48px, 16cqi, 64px);
    margin: 2px auto 2px;
    padding: 4px;
    border-radius: 12px;
  }
  .hvl-sponsor-slate-name {
    font-size: clamp(18px, 5cqi, 22px);
    margin-bottom: 2px;
  }
  .hvl-sponsor-slate-tag {
    font-size: clamp(13px, 3.6cqi, 15px);
    margin-bottom: 4px;
  }
  .hvl-sponsor-cta {
    min-height: clamp(36px, 10cqi, 42px);
    padding: 0.28rem 0.75rem;
    font-size: 0.82rem;
  }
  .hvl-sponsor-slate-status {
    font-size: clamp(12px, 3.4cqi, 14px);
    margin-top: 4px;
  }
}

/* Very small phones / 16:9 player (~320–390). Hide tagline before any clip. */
@media (max-width: 430px) {
  .hvl-sponsor-slate-tag { -webkit-line-clamp: 1; line-clamp: 1; max-height: 1.35em; }
}
@media (max-width: 390px) {
  .hvl-sponsor-slate-logo {
    width: clamp(40px, 14cqi, 56px);
    height: clamp(40px, 14cqi, 56px);
  }
}
@media (max-width: 375px) {
  .hvl-sponsor-slate-tag { display: none; }
  .hvl-sponsor-slate-name { font-size: 18px; }
}
@media (max-width: 320px) {
  .hvl-sponsor-slate-tag { display: none; }
  .hvl-sponsor-slate-logo { width: 40px; height: 40px; margin: 0 auto; }
  .hvl-sponsor-slate-name { font-size: 16px; }
  .hvl-sponsor-cta { min-height: 36px; }
  .hvl-sponsor-kicker { font-size: 10px; }
  .hvl-sponsor-slate-status { font-size: 12px; }
}

@container hvl-player (max-height: 220px) {
  .hvl-sponsor-slate-tag { display: none; }
  .hvl-sponsor-slate-logo {
    width: clamp(36px, 18cqh, 52px);
    height: clamp(36px, 18cqh, 52px);
    margin: 0 auto 2px;
  }
  .hvl-sponsor-slate-inner { padding: 4px 8px; gap: 2px; }
  .hvl-sponsor-cta { min-height: 36px; }
}
@container hvl-player (max-height: 180px) {
  .hvl-sponsor-slate-tag { display: none; }
  .hvl-sponsor-slate-logo { width: 36px; height: 36px; }
  .hvl-sponsor-slate-name { font-size: 16px; }
  .hvl-sponsor-kicker { font-size: 10px; }
  .hvl-sponsor-cta { min-height: 32px; padding: 0.2rem 0.65rem; }
  .hvl-sponsor-slate-status { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .hvl-sponsor-slate,
  .hvl-sponsor-overlay,
  .hvl-sponsor-bug { transition: none; }
}

body.theme-goshen .hvl-sponsor-slate-card,
body.theme-goshen .hvl-sponsor-slate-inner,
body.theme-goshen .hvl-sponsor-overlay-card,
body.theme-goshen .hvl-sponsor-bug-card {
  border-color: rgba(196, 165, 116, 0.35);
  background: rgba(14, 10, 6, 0.7);
}
body.theme-goshen .hvl-sponsor-kicker { color: #e8c98a; }
