/* Modal pub avant lecture — thème bleu / blanc doux (secours) */
.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(8, 18, 32, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.watch-gate-backdrop::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 55% at 50% 0%, rgba(126, 184, 255, 0.22), transparent 62%);
  pointer-events: none;
}
.watch-gate-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  border-radius: 22px;
  border: 1px solid rgba(126, 184, 255, 0.45);
  background: linear-gradient(165deg, #ffffff 0%, #f0f6ff 48%, #e8f2fc 100%);
  box-shadow: 0 32px 80px rgba(15, 40, 80, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  padding: 0 0 1.5rem;
  animation: watchGateIn 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
  color: #1a2f4a;
}
@keyframes watchGateIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.watch-gate-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem 0.85rem;
  border-bottom: 1px solid rgba(126, 184, 255, 0.25);
  background: linear-gradient(180deg, rgba(126, 184, 255, 0.12), transparent);
}
.watch-gate-logo {
  height: 38px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  display: block;
}
.watch-gate-close {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(126, 184, 255, 0.35);
  background: rgba(255, 255, 255, 0.7);
  color: #4a6a8a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  flex-shrink: 0;
}
.watch-gate-close:hover {
  background: rgba(126, 184, 255, 0.2);
  border-color: rgba(126, 184, 255, 0.55);
  color: #1e3a5f;
}
.watch-gate-top {
  text-align: center;
  padding: 1.25rem 1.5rem 0.5rem;
}
.watch-gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #2d6cb5;
  background: rgba(126, 184, 255, 0.18);
  border: 1px solid rgba(126, 184, 255, 0.4);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.watch-gate-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5b9fd9;
  box-shadow: 0 0 8px rgba(91, 159, 217, 0.8);
}
.watch-gate-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(1.35rem, 4vw, 1.65rem);
  font-weight: 400;
  color: #1e3a5f;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.watch-gate-sub {
  color: rgba(30, 58, 95, 0.65);
  font-size: 13px;
  line-height: 1.65;
  margin: 0 0 16px;
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
}
.watch-gate-progress-global {
  height: 4px;
  background: rgba(126, 184, 255, 0.2);
  border-radius: 999px;
  overflow: hidden;
}
.watch-gate-progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #5b9fd9, #7eb8ff);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px rgba(91, 159, 217, 0.45);
}
.watch-gate-panel {
  padding: 0 1.5rem;
  text-align: left;
}
.watch-gate-ad-list {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}
.watch-gate-ad-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 14px;
  border: 1px solid rgba(126, 184, 255, 0.25);
  background: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(30, 58, 95, 0.45);
  transition: 0.25s;
  text-align: center;
  line-height: 1.3;
}
.watch-gate-ad-item span:last-child { display: none; }
.watch-gate-ad-item.active {
  border-color: rgba(91, 159, 217, 0.55);
  background: rgba(126, 184, 255, 0.15);
  color: #1e3a5f;
  box-shadow: 0 0 20px rgba(126, 184, 255, 0.2);
}
.watch-gate-ad-item.done {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
  color: #15803d;
}
.watch-gate-ad-item-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  background: rgba(126, 184, 255, 0.2);
  flex-shrink: 0;
}
.watch-gate-ad-item.done .watch-gate-ad-item-num {
  background: rgba(34, 197, 94, 0.15);
  color: #15803d;
}
.watch-gate-ad-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.watch-gate-ad-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(30, 58, 95, 0.55);
  white-space: nowrap;
}
.watch-gate-progress-track {
  flex: 1;
  height: 4px;
  background: rgba(126, 184, 255, 0.2);
  border-radius: 999px;
  overflow: hidden;
  min-width: 80px;
}
.watch-gate-ad-notice {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
  color: #1e3a5f;
  background: rgba(126, 184, 255, 0.12);
  border: 1px solid rgba(126, 184, 255, 0.3);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
  text-align: center;
}
.watch-gate-ad-card {
  position: relative;
  text-align: center;
  padding: 1.65rem 1.25rem 1.5rem;
  border-radius: 18px;
  border: 1px solid rgba(126, 184, 255, 0.35);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(232, 242, 252, 0.95));
  margin-bottom: 6px;
  overflow: hidden;
}
.watch-gate-ad-card-glow {
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  height: 80%;
  background: radial-gradient(ellipse, rgba(126, 184, 255, 0.2), transparent 70%);
  pointer-events: none;
}
.watch-gate-ad-card-icon {
  position: relative;
  margin-bottom: 14px;
  line-height: 1;
  display: flex;
  justify-content: center;
  color: #5b9fd9;
}
.watch-gate-ad-card-icon svg {
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 4px 12px rgba(91, 159, 217, 0.35));
}
.watch-gate-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
a.watch-gate-btn {
  color: #fff;
  text-decoration: none;
  box-sizing: border-box;
}
a.watch-gate-btn.is-used {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
.watch-gate-btn-icon svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}
.watch-gate-ad-confirm-hidden { display: none !important; }
.watch-gate-ad-card-desc {
  position: relative;
  color: rgba(30, 58, 95, 0.75);
  font-size: 14px;
  line-height: 1.65;
  margin: 0 0 18px;
  font-weight: 500;
}
.watch-gate-ad-status {
  font-size: 12px;
  color: rgba(30, 58, 95, 0.5);
  margin: 14px 0 0;
  min-height: 18px;
  line-height: 1.5;
}
.watch-gate-ad-status.ok { color: #15803d; }
.watch-gate-ad-status.err { color: #b91c1c; }
.watch-gate-hint {
  font-size: 11px;
  color: rgba(30, 58, 95, 0.45);
  margin: 12px 0 0;
  line-height: 1.55;
  text-align: center;
}
.watch-gate-btn {
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
  border: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: 0.22s;
}
.watch-gate-btn-primary {
  background: linear-gradient(135deg, #5b9fd9, #7eb8ff);
  color: #fff;
  box-shadow: 0 10px 28px rgba(91, 159, 217, 0.35);
}
.watch-gate-btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(91, 159, 217, 0.45);
}
.watch-gate-btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.watch-gate-btn-ghost {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(126, 184, 255, 0.35);
  color: rgba(30, 58, 95, 0.7);
  margin-top: 8px;
}
.watch-gate-btn-ghost:hover {
  border-color: rgba(126, 184, 255, 0.55);
  color: #1e3a5f;
}
.watch-gate-cf-card {
  text-align: center;
  padding: 1.5rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(126, 184, 255, 0.3);
  background: rgba(255, 255, 255, 0.65);
  margin-top: 8px;
}
.watch-gate-cf-icon {
  margin: 0 0 12px;
  color: #5b9fd9;
  display: flex;
  justify-content: center;
}
.watch-gate-cf-icon svg { width: 42px; height: 42px; }
.watch-gate-cf-text {
  text-align: center;
  color: rgba(30, 58, 95, 0.65);
  font-size: 14px;
  line-height: 1.65;
  margin: 0 0 16px;
}
.watch-gate-cf-widget {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 70px;
}
.watch-gate-cf-loading {
  font-size: 12px;
  color: rgba(30, 58, 95, 0.4);
}
.watch-gate-loading-panel,
.watch-gate-error-panel {
  text-align: center;
  padding: 2.5rem 1rem 1rem;
}
.watch-gate-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(126, 184, 255, 0.2);
  border-top-color: #5b9fd9;
  border-radius: 50%;
  animation: watchGateSpin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes watchGateSpin { to { transform: rotate(360deg); } }
.watch-gate-loading-panel p,
.watch-gate-error-msg {
  color: rgba(30, 58, 95, 0.7);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}
.watch-gate-error-icon {
  margin-bottom: 14px;
  color: #b91c1c;
  display: flex;
  justify-content: center;
}
.watch-gate-error-icon svg { width: 40px; height: 40px; }
.watch-gate-ad-item-num svg { width: 14px; height: 14px; }
.watch-gate-error-msg { margin-bottom: 18px; }
.watch-gate-error-actions {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 280px;
  margin: 0 auto;
}
@media (max-width: 480px) {
  .watch-gate-box { border-radius: 18px; }
  .watch-gate-top,
  .watch-gate-panel { padding-left: 1.1rem; padding-right: 1.1rem; }
  .watch-gate-brand { padding: 0.95rem 1.1rem; }
  .watch-gate-logo { height: 32px; }
}

/* Priorité sur tout style legacy / thème sombre */
#watchGateModal.watch-gate-modal .watch-gate-box {
  background: linear-gradient(165deg, #ffffff 0%, #f0f6ff 48%, #e8f2fc 100%) !important;
  border: 1px solid rgba(126, 184, 255, 0.45) !important;
  color: #1a2f4a !important;
  box-shadow: 0 32px 80px rgba(15, 40, 80, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.8) inset !important;
}
#watchGateModal .watch-gate-title { color: #0f2847 !important; }
#watchGateModal .watch-gate-sub { color: rgba(30, 58, 95, 0.75) !important; }
#watchGateModal .watch-gate-badge {
  background: rgba(126, 184, 255, 0.2) !important;
  color: #1e4a7a !important;
  border-color: rgba(126, 184, 255, 0.45) !important;
}
