/* ==========================================================================
   THE HERCARE ON-CARD PARTNER CONVERSATION & DIRECT PHOTO SPEECH BUBBLES
   Dialogues appear directly on the photo card over Sarah (Vancouver) & Liam (London)
   ========================================================================== */

/* 1. Hotspots & Conversation Container on Romantic Partner Card */
.partner-hotspot-container {
  position: relative;
  width: 100%;
  display: block;
  overflow: visible;
  border-radius: 24px;
  user-select: none;
  background: #06060A;
}

.partner-hotspot-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 24px;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.5s ease;
}

/* 2. Character Interactive Tap Zones */
.character-tap-zone {
  position: absolute;
  top: 0;
  bottom: 70px;
  width: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding-top: clamp(14px, 3.2vw, 32px);
  transition: all 0.4s ease;
  outline: none;
  background: transparent;
  border: none;
}

.character-tap-zone.sarah-zone {
  left: 0;
}

.character-tap-zone.liam-zone {
  right: 0;
}

/* Ambient Hover & Active Auras directly on the characters */
.character-active-glow {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 4;
}

.character-active-glow.sarah-glow {
  left: 0;
  background: radial-gradient(circle at 40% 50%, rgba(244, 63, 94, 0.38) 0%, rgba(244, 63, 94, 0.1) 50%, transparent 80%);
}

.character-active-glow.liam-glow {
  right: 0;
  background: radial-gradient(circle at 60% 50%, rgba(56, 189, 248, 0.38) 0%, rgba(56, 189, 248, 0.1) 50%, transparent 80%);
}

.character-active-glow.active {
  opacity: 1;
}

/* Interactive Tap Badge (Shown when conversation is idle) */
.character-tap-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 9999px;
  background: rgba(6, 8, 18, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.75);
  color: #FFFFFF;
  font-size: clamp(0.72rem, 1vw, 0.84rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}

.character-tap-zone.sarah-zone .character-tap-badge {
  border: 1.5px solid rgba(244, 63, 94, 0.7);
  box-shadow: 0 8px 25px rgba(244, 63, 94, 0.35);
}

.character-tap-zone.liam-zone .character-tap-badge {
  border: 1.5px solid rgba(56, 189, 248, 0.7);
  box-shadow: 0 8px 25px rgba(56, 189, 248, 0.35);
}

.character-tap-zone:hover .character-tap-badge {
  transform: translateY(-3px) scale(1.05);
}

.tap-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulseBeacon 1.8s infinite;
}

.sarah-zone .tap-pulse-dot {
  background: #F43F5E;
  box-shadow: 0 0 10px #F43F5E;
}

.liam-zone .tap-pulse-dot {
  background: #38BDF8;
  box-shadow: 0 0 10px #38BDF8;
}

@keyframes pulseBeacon {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.4); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

/* Prompt Pill (Idle state - Positioned at bottom of couple image) */
.partner-talk-prompt-bar {
  position: absolute;
  bottom: 68px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 9999px;
  background: rgba(10, 14, 26, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 16;
  font-size: clamp(0.72rem, 0.95vw, 0.82rem);
  font-weight: 700;
  color: #FFFFFF;
  box-shadow: 0 10px 30px rgba(0,0,0,0.7);
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  transition: all 0.3s ease;
}

.partner-talk-prompt-bar:hover {
  border-color: rgba(244, 63, 94, 0.6);
  background: rgba(16, 22, 38, 0.98);
  transform: translateX(-50%) translateY(-2px);
}

.partner-talk-prompt-bar.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ==========================================================================
   3. DIRECT PHOTO SPEECH BUBBLES (ON THE CARD OVER SARAH & LIAM)
   ========================================================================== */
/* ==========================================================================
   3. COMIC SPEECH BALLOONS DIRECTLY ABOVE THE HEADS (SARAH & LIAM)
   Matches user's hand-drawn comic speech balloon reference
   ========================================================================== */
.oncard-speech-bubble {
  position: absolute;
  top: clamp(-110px, -9.5vw, -80px);
  width: min(390px, 46%);
  background: #FFFFFF;
  border: 3.5px solid #111827;
  border-radius: 36px 32px 34px 30px / 30px 34px 32px 36px;
  box-shadow: 4px 6px 0px #111827, 0 20px 50px rgba(0, 0, 0, 0.85);
  padding: clamp(9px, 1.2vw, 13px) clamp(12px, 1.5vw, 16px);
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.95);
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              visibility 0.3s ease;
  pointer-events: none;
  cursor: pointer;
}

.oncard-speech-bubble.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Sarah Speech Bubble - Directly Above Sarah's Head (Left) */
.oncard-speech-bubble.sarah-bubble {
  left: clamp(8px, 1.8vw, 20px);
}

/* Liam Speech Bubble - Directly Above Liam's Head (Right) */
.oncard-speech-bubble.liam-bubble {
  right: clamp(8px, 1.8vw, 20px);
}

/* Comic Speech Pointer Tails Pointing Down Directly To Their Heads */
.comic-speech-tail {
  position: absolute;
  bottom: -40px;
  width: 50px;
  height: 42px;
  pointer-events: none;
  z-index: 62;
  filter: drop-shadow(2px 3px 0px rgba(17, 24, 39, 0.6));
}

.sarah-tail {
  left: 36%;
}

.liam-tail {
  right: 26%;
  transform: scaleX(-1);
}

/* Header inside Comic Bubble */
.oncard-bubble-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 5px;
  border-bottom: 1.5px solid #E2E8F0;
}

.oncard-avatar-pill {
  display: flex;
  align-items: center;
  gap: 7px;
}

.oncard-emoji {
  font-size: 1.15rem;
  line-height: 1;
}

.oncard-name {
  display: block;
  font-size: 0.85rem;
  font-weight: 850;
  color: #111827;
  letter-spacing: -0.02em;
}

.oncard-loc {
  display: block;
  font-size: 0.66rem;
  font-weight: 700;
  color: #4B5563;
}

.sarah-bubble .oncard-name {
  color: #E11D48;
}

.liam-bubble .oncard-name {
  color: #0284C7;
}

/* Audio Wave Equalizer inside Bubble */
.oncard-audio-wave {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 14px;
}

.card-wave-bar {
  width: 3px;
  border-radius: 2px;
  background: #E11D48;
  animation: cardWave 0.8s ease-in-out infinite alternate;
}

.liam-wave .card-wave-bar {
  background: #0284C7;
}

.card-wave-bar:nth-child(1) { height: 6px; }
.card-wave-bar:nth-child(2) { height: 13px; animation-delay: 0.2s; }
.card-wave-bar:nth-child(3) { height: 8px; animation-delay: 0.4s; }

@keyframes cardWave {
  0% { transform: scaleY(0.4); }
  100% { transform: scaleY(1.2); }
}

/* Clear, High-Contrast Dialogue Comic Text */
.oncard-speech-text {
  font-size: clamp(0.82rem, 1vw, 0.92rem);
  font-weight: 650;
  line-height: 1.44;
  color: #0F172A;
  letter-spacing: -0.01em;
  margin: 7px 0 8px;
  min-height: auto;
}

/* 4-Second Transition Countdown Timer Row */
.oncard-timer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 7px;
  border-top: 1.5px solid #E2E8F0;
}

.oncard-timer-label {
  font-size: 0.68rem;
  font-weight: 750;
  color: #64748B;
  white-space: nowrap;
}

.oncard-timer-track {
  flex: 1;
  height: 5px;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-radius: 9999px;
  overflow: hidden;
}

.oncard-timer-bar {
  height: 100%;
  width: 0%;
  border-radius: 9999px;
  transition: width 0.1s linear;
}

.sarah-bubble .oncard-timer-bar {
  background: linear-gradient(90deg, #F43F5E, #FB7185);
}

.liam-bubble .oncard-timer-bar {
  background: linear-gradient(90deg, #0284C7, #38BDF8);
}

.oncard-skip-btn {
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 800;
  background: #111827;
  border: none;
  color: #FFFFFF;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 1px 2px 0px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
}

.oncard-skip-btn:hover {
  background: #F43F5E;
  transform: translateY(-1px);
}

.liam-bubble .oncard-skip-btn:hover {
  background: #0284C7;
}

/* Bubble Header Close Button */
.bubble-close-btn {
  background: #F1F5F9;
  border: 1.5px solid #CBD5E1;
  color: #64748B;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
}

.bubble-close-btn:hover {
  background: #111827;
  color: #FFFFFF;
  border-color: #111827;
  transform: scale(1.08);
}

/* When Conversation is Active, hide tap badges and prompt bar so heads are clear */
.partner-hotspot-container.conversation-active .character-tap-badge {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateY(-8px) scale(0.9) !important;
}

.partner-hotspot-container.conversation-active .partner-talk-prompt-bar {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@media (max-width: 680px) {
  .oncard-speech-bubble {
    width: calc(100% - 20px);
    left: 10px !important;
    right: 10px !important;
    top: 10px;
  }
  .comic-speech-tail {
    bottom: -22px;
    width: 36px;
    height: 24px;
  }
  .sarah-tail {
    left: 28%;
  }
  .liam-tail {
    right: 28%;
  }
  .partner-talk-prompt-bar {
    bottom: 58px;
    padding: 6px 12px;
    font-size: 0.7rem;
    max-width: 90%;
    white-space: normal;
    text-align: center;
  }
}
