/* Modal pubs avant lecture — dark InterFilm (2 étapes + Sans pub / VIP) */

.watch-gate-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.watch-gate-modal.open {
  opacity: 1;
  pointer-events: all;
}

.watch-gate-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.watch-gate-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #141414;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.65);
  padding: 1.35rem 1.25rem 1.15rem;
  animation: watchGateIn 0.4s cubic-bezier(0.34, 1.25, 0.64, 1);
  color: #fff;
  font-family: 'Outfit', system-ui, sans-serif;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
@keyframes watchGateIn {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.watch-gate-brand {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: relative;
  margin-bottom: 1rem;
  padding: 0;
  border: none;
  background: none;
}
.watch-gate-logo {
  height: 42px;
  width: auto;
  max-width: 170px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
.watch-gate-close {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}
.watch-gate-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.watch-gate-top {
  text-align: center;
  padding: 0 0 0.35rem;
}
.watch-gate-badge,
.watch-gate-progress-global,
.watch-gate-ad-head,
.watch-gate-ad-notice,
.watch-gate-ad-card-glow,
.watch-gate-ad-card-icon,
.watch-gate-ad-card-desc,
.watch-gate-ad-confirm-hidden {
  display: none !important;
}

.watch-gate-title {
  margin: 0 0 0.4rem;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: clamp(1.35rem, 4vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.2;
}
.watch-gate-sub {
  margin: 0 auto 0.55rem;
  max-width: 34ch;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 400;
}
.watch-gate-media {
  margin: 0 0 1.1rem;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.35);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.watch-gate-panel {
  padding: 0;
  text-align: left;
}

/* Liste des étapes */
.watch-gate-ad-list {
  list-style: none;
  margin: 0 0 1.1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.watch-gate-ad-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.035);
  color: rgba(255, 255, 255, 0.38);
  transition: border-color 0.2s, background 0.2s, color 0.2s, opacity 0.2s;
}
.watch-gate-ad-item.active {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}
.watch-gate-ad-item.done {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.55);
}
.watch-gate-ad-item-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.4);
}
.watch-gate-ad-item.active .watch-gate-ad-item-num {
  background: #fff;
  color: #111;
}
.watch-gate-ad-item.done .watch-gate-ad-item-num {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.watch-gate-ad-item.done .watch-gate-ad-item-num svg {
  width: 14px;
  height: 14px;
}
.watch-gate-ad-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.watch-gate-ad-item-text strong {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: inherit;
}
.watch-gate-ad-item-text span {
  font-size: 12px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.38);
  line-height: 1.35;
}
.watch-gate-ad-item.active .watch-gate-ad-item-text span {
  color: rgba(255, 255, 255, 0.55);
}

.watch-gate-ad-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: none;
  background: none;
  position: relative;
}

.watch-gate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: transform 0.15s, opacity 0.15s, background 0.15s;
}
.watch-gate-btn:disabled,
.watch-gate-btn.is-used,
.watch-gate-btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: default;
}
.watch-gate-btn-primary {
  padding: 14px 20px;
  border-radius: 999px;
  background: #fff;
  color: #111;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
#watchGateAdOpen.watch-gate-btn-primary {
  width: auto;
  max-width: 100%;
  min-width: 0;
  padding: 12px 22px;
  font-size: 13.5px;
  align-self: center;
}
.watch-gate-btn-primary:hover {
  transform: translateY(-1px);
  background: #f4f4f4;
}
.watch-gate-btn-ghost {
  padding: 11px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}
.watch-gate-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.watch-gate-btn-icon svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.watch-gate-ad-status {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  min-height: 1.2em;
}
.watch-gate-ad-status.ok {
  color: rgba(180, 255, 200, 0.85);
}
.watch-gate-ad-status.err {
  color: #ff5c6c;
  font-weight: 700;
  text-shadow: 0 0 12px rgba(255, 60, 80, 0.35);
}

.watch-gate-hint {
  margin: 2px 0 0;
  text-align: center;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.35);
  line-height: 1.4;
}

.watch-gate-warn {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(232, 48, 74, 0.55);
  background: linear-gradient(135deg, rgba(232, 48, 74, 0.2), rgba(232, 48, 74, 0.1));
  color: #ffc4cb;
  font-size: 12.5px;
  line-height: 1.5;
  text-align: left;
}
.watch-gate-warn strong {
  display: block;
  margin-bottom: 4px;
  color: #ff8a98;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Pied : Sans pub + VIP */
.watch-gate-alts {
  margin-top: 1.55rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.watch-gate-alt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.watch-gate-alt:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}
.watch-gate-alt-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.watch-gate-alt-icon svg {
  width: 17px;
  height: 17px;
}
.watch-gate-alt--sans .watch-gate-alt-icon {
  background: rgba(52, 168, 110, 0.2);
  color: #6ee7a8;
}
.watch-gate-alt--vip .watch-gate-alt-icon {
  background: rgba(212, 168, 67, 0.22);
  color: #f0c14b;
}
.watch-gate-alt-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.watch-gate-alt-body strong {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.watch-gate-alt-body span {
  font-size: 11.5px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.42);
}
.watch-gate-alt-chevron {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.28);
}

/* Cloudflare / loading / error */
.watch-gate-cf-card,
.watch-gate-loading-panel,
.watch-gate-error-panel {
  text-align: center;
  padding: 0.5rem 0 0.25rem;
}
.watch-gate-cf-icon,
.watch-gate-error-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(155, 140, 248, 0.12);
  color: #b8aaf9;
}
.watch-gate-cf-icon svg,
.watch-gate-error-icon svg {
  width: 22px;
  height: 22px;
}
.watch-gate-cf-text,
.watch-gate-error-msg,
#watchGateLoadingText {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.65);
}
.watch-gate-cf-widget {
  display: flex;
  justify-content: center;
  min-height: 65px;
  margin-bottom: 10px;
}
.watch-gate-cf-loading {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}
.watch-gate-spinner {
  width: 36px;
  height: 36px;
  margin: 12px auto;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: #fff;
  animation: watchGateSpin 0.75s linear infinite;
}
@keyframes watchGateSpin {
  to { transform: rotate(360deg); }
}
.watch-gate-error-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.watch-gate-error-icon {
  background: rgba(232, 48, 74, 0.15);
  color: #ff7a8a;
}

#watchGateCfSkip {
  display: none !important;
}

@media (max-width: 420px) {
  .watch-gate-modal { padding: 0.75rem; }
  .watch-gate-box {
    padding: 1.15rem 1rem 1rem;
    border-radius: 16px;
  }
  .watch-gate-title { font-size: 1.28rem; }
}
