/* Conversion nudges — analytics-driven, frequency-capped prompts that recover
   high-intent sessions (Recommended Plays, 2026-07-20). Three surfaces share
   this styling:
     • Anonymous Buying Intent  — sign-in prompt for anon shoppers
     • High-Intent Purchase Rescue — exit-intent reassurance on /purchase, /shop
     • Subscriber Upsell Loop   — membership nudge for engaged non-subscribers
   All are dismissible, keyboard-accessible, and honor prefers-reduced-motion. */

.cn-card {
  position: fixed;
  right: 1rem;
  /* MUST clear the fixed bottom nav, at EVERY width — measured on the live
     site, .site-bottom-nav is present and 111-123px tall from 360px all the way
     to 1920px. The nav is z-index 1080 and this card is 1400, so a bare
     `bottom: 1rem` does not slide UNDER the nav, it paints ON TOP of it; at
     `min(360px, 100vw - 2rem)` that is nearly the full width of a phone, so the
     entire primary navigation would be unusable for as long as the card is up.
     --site-shell-bottom is the shared shell token app.js measures at runtime
     (mobile-bottom-nav.css seeds 110px/96px); this is the same idiom map.css
     and gacha.css already use for their bottom-anchored surfaces. */
  bottom: calc(var(--site-shell-bottom, 110px) + var(--site-safe-area-bottom, 0px) + 12px);
  z-index: 1400;
  width: min(360px, calc(100vw - 2rem));
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(30, 6, 6, 0.98), rgba(18, 0, 0, 0.98));
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(2, 6, 23, 0.55);
  color: #e2e8f0;
  padding: 1.05rem 1.15rem 1.1rem;
  transform: translateY(12px);
  opacity: 0;
  transition: transform 0.28s ease, opacity 0.28s ease;
}
.cn-card.cn-in { transform: translateY(0); opacity: 1; }

/* Purchase-rescue uses a stronger centered modal (exit intent = strong signal). */
.cn-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1399;
  background: rgba(2, 6, 23, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  transition: opacity 0.28s ease;
}
.cn-backdrop.cn-in { opacity: 1; }
.cn-backdrop .cn-card {
  position: static;
  right: auto;
  bottom: auto;
  width: min(440px, calc(100vw - 2.5rem));
  transform: scale(0.96);
}
.cn-backdrop.cn-in .cn-card { transform: scale(1); }

.cn-head { display: flex; align-items: flex-start; gap: 0.6rem; min-width: 0; }
.cn-icon {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 11px;
  background: rgba(255, 69, 0, 0.16);
  color: #ffd76b;
  font-size: 1.05rem;
}
.cn-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
  color: #f8fafc;
  min-width: 0;
  text-wrap: balance;
}
.cn-close {
  flex: 0 0 auto;
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(148, 163, 184, 0.85);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.3rem;
  border-radius: 8px;
}
.cn-close:hover { color: #e2e8f0; background: rgba(148, 163, 184, 0.14); }
.cn-body {
  margin: 0.6rem 0 0.9rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: rgba(226, 232, 240, 0.9);
}
.cn-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.cn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex: 1 1 auto;
  padding: 0.55rem 0.95rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  text-align: center;
}
.cn-btn-primary {
  background: linear-gradient(180deg, var(--fire-orange, #ff4500), var(--fire-red, #ff0000));
  color: #fff;
  border-color: rgba(255, 215, 0, 0.5);
}
.cn-btn-primary:hover { filter: brightness(1.08); }
.cn-btn-ghost {
  background: rgba(15, 23, 42, 0.7);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.24);
  flex: 0 0 auto;
}
.cn-btn-ghost:hover { background: rgba(30, 41, 59, 0.8); }
.cn-btn:focus-visible,
.cn-close:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .cn-card, .cn-backdrop { transition: none; }
  .cn-card { transform: none; }
  .cn-backdrop .cn-card { transform: none; }
}
