/* ==========================================================================
   OPENWHEN.CSS — "Open When..." Letters Capsule & Comfort Vault
   Dedicated 24/7 Emotional Sanctuary for Madam Ji (Mayu) from Aayu 💛
   ========================================================================== */

/* --------------------------------------------------------------------------
   01. SECTION LAYOUT & ATMOSPHERE
   -------------------------------------------------------------------------- */
#openwhen {
  position: relative;
  padding: 6rem 1.5rem;
  background: radial-gradient(circle at 50% 10%, rgba(244, 167, 185, 0.08) 0%, transparent 60%),
              radial-gradient(circle at 85% 80%, rgba(247, 231, 166, 0.06) 0%, transparent 50%),
              linear-gradient(180deg, #1A0F18 0%, #241422 50%, #1A0F18 100%);
  color: #FFF8F5;
  overflow: hidden;
  content-visibility: auto;
  contain-intrinsic-size: auto none auto 900px;
}

#openwhen::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244, 167, 185, 0.4), rgba(247, 231, 166, 0.5), transparent);
}

.openwhen-container {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

/* Header & Subtitles */
.openwhen-header {
  text-align: center;
  margin-bottom: 4rem;
  position: relative;
}

.openwhen-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1.2rem;
  background: rgba(244, 167, 185, 0.12);
  border: 1px solid rgba(244, 167, 185, 0.35);
  border-radius: 9999px;
  font-family: var(--font-body, 'Lato', sans-serif);
  font-size: 0.82rem;
  font-weight: 700;
  color: #F7E7A6;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 20px rgba(244, 167, 185, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.openwhen-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #FFF8F5 20%, #F4A7B9 60%, #FFD6BA 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 25px rgba(244, 167, 185, 0.25);
}

.openwhen-subtitle {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  font-style: italic;
  color: #FFD6BA;
  max-width: 720px;
  margin: 0 auto 0.75rem auto;
  line-height: 1.6;
}

.openwhen-dedication {
  font-family: 'Dancing Script', cursive;
  font-size: 1.25rem;
  color: #F4A7B9;
  letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   02. 3D ENVELOPE CARD GRID
   -------------------------------------------------------------------------- */
.openwhen-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.25rem;
  perspective: 1200px;
}

@media (max-width: 1024px) {
  .openwhen-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
  }
}

@media (max-width: 640px) {
  .openwhen-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
}

/* Individual Envelope Card */
.openwhen-card {
  position: relative;
  background: linear-gradient(145deg, #2D1B2E 0%, #201122 100%);
  border-radius: 18px;
  border: 1px solid rgba(244, 167, 185, 0.2);
  box-shadow: 0 15px 35px rgba(10, 5, 12, 0.6),
              0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  padding: 1.75rem 1.5rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 380px;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
              box-shadow 0.4s cubic-bezier(0.23, 1, 0.32, 1),
              border-color 0.3s ease;
  transform-style: preserve-3d;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.openwhen-card:hover,
.openwhen-card:focus-visible {
  transform: translateY(-10px) rotateX(4deg) scale(1.02);
  box-shadow: 0 25px 50px rgba(10, 5, 12, 0.75),
              0 0 35px rgba(244, 167, 185, 0.3),
              0 0 0 1px rgba(247, 231, 166, 0.4) inset;
  border-color: rgba(247, 231, 166, 0.6);
  outline: none;
}

/* Subtle parchment texture overlay */
.openwhen-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 16px 16px;
  opacity: 0.6;
  pointer-events: none;
}

/* Satin Ribbon Across the Card */
.envelope-ribbon-h {
  position: absolute;
  top: 48%;
  left: 0;
  right: 0;
  height: 14px;
  background: linear-gradient(180deg, #E28498 0%, #D86380 50%, #B74462 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 3;
}

.envelope-ribbon-h::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.envelope-ribbon-v {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  background: linear-gradient(90deg, #E28498 0%, #D86380 50%, #B74462 100%);
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 3;
}

.envelope-ribbon-v::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

/* Satin Ribbon Bow at intersection */
.envelope-bow {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  z-index: 4;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

/* Custom Vintage Postage Stamp */
.envelope-stamp {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 52px;
  height: 62px;
  background: #FFF8F5;
  border-radius: 4px;
  padding: 3px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  border: 2px dashed #E28498;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: transform 0.3s ease;
}

.openwhen-card:hover .envelope-stamp {
  transform: rotate(4deg) scale(1.05);
}

.stamp-emoji {
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 2px;
}

.stamp-text {
  font-family: var(--font-body, 'Lato', sans-serif);
  font-size: 0.62rem;
  color: #7A3C52;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
}

/* Card Header: Category Badge */
.card-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.75rem;
  border-radius: 9999px;
  background: rgba(247, 231, 166, 0.14);
  border: 1px solid rgba(247, 231, 166, 0.35);
  font-family: var(--font-body, 'Lato', sans-serif);
  font-size: 0.74rem;
  font-weight: 700;
  color: #FFD6BA;
  width: fit-content;
  margin-bottom: 1.25rem;
  z-index: 5;
  letter-spacing: 0.02em;
}

/* Card Body Content */
.card-letter-prompt {
  z-index: 5;
  margin-top: 0.5rem;
  margin-bottom: auto;
}

.card-open-prefix {
  font-family: 'Dancing Script', cursive;
  font-size: 1.4rem;
  color: #F4A7B9;
  display: block;
  margin-bottom: 0.25rem;
}

.card-prompt-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #FFF8F5;
  line-height: 1.35;
  margin-bottom: 0.75rem;
}

.card-teaser {
  font-family: 'Lato', sans-serif;
  font-size: 0.88rem;
  color: rgba(255, 248, 245, 0.7);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

/* 3D Wax Seal on Front */
.envelope-wax-seal {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FF7597, #C92A52 60%, #83102E 100%);
  border: 2px solid rgba(255, 214, 186, 0.5);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5),
              0 0 0 3px rgba(201, 42, 82, 0.3),
              inset 0 3px 6px rgba(255, 255, 255, 0.4),
              inset 0 -3px 6px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  bottom: 24px;
  right: 24px;
  z-index: 6;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.openwhen-card:hover .envelope-wax-seal {
  transform: scale(1.15) rotate(-6deg);
  box-shadow: 0 10px 24px rgba(201, 42, 82, 0.6),
              0 0 18px rgba(247, 231, 166, 0.5),
              inset 0 3px 6px rgba(255, 255, 255, 0.5);
}

.wax-seal-icon {
  font-size: 1.6rem;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
  user-select: none;
}

/* Unseal Action Prompt */
.card-action-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-body, 'Lato', sans-serif);
  font-size: 0.82rem;
  font-weight: 600;
  color: #F7E7A6;
  z-index: 5;
  margin-top: 1rem;
  letter-spacing: 0.02em;
}

.card-action-arrow {
  transition: transform 0.25s ease;
}

.openwhen-card:hover .card-action-arrow {
  transform: translateX(4px);
}

/* Individual card accents */
.openwhen-card[data-mood="bad-day"] {
  border-top: 3px solid #7E8CE0;
}
.openwhen-card[data-mood="miss-me"] {
  border-top: 3px solid #F4A7B9;
}
.openwhen-card[data-mood="cant-sleep"] {
  border-top: 3px solid #9B87F5;
}
.openwhen-card[data-mood="decision"] {
  border-top: 3px solid #F7E7A6;
}
.openwhen-card[data-mood="insecure"] {
  border-top: 3px solid #FF8FA3;
}
.openwhen-card[data-mood="laugh"] {
  border-top: 3px solid #FFB703;
}

/* --------------------------------------------------------------------------
   03. FULLSCREEN READING MODAL & PARCHMENT
   -------------------------------------------------------------------------- */
.openwhen-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 8, 16, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top, 1rem)) max(0.75rem, env(safe-area-inset-right, 0.75rem)) max(1rem, env(safe-area-inset-bottom, 1rem)) max(0.75rem, env(safe-area-inset-left, 0.75rem));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.openwhen-modal-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* Candlelight Ambience Glow behind modal */
.openwhen-candlelight-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 214, 186, 0.25) 0%, rgba(244, 167, 185, 0.1) 40%, transparent 70%);
  filter: blur(50px);
  pointer-events: none;
  animation: candleFlickerAmbient 4s infinite alternate ease-in-out;
  z-index: 0;
}

@keyframes candleFlickerAmbient {
  0%   { opacity: 0.7; transform: scale(0.96) translate(-2%, -2%); }
  50%  { opacity: 1;   transform: scale(1.04) translate(1%, 2%); }
  100% { opacity: 0.8; transform: scale(0.98) translate(2%, -1%); }
}

/* Reading Modal Card (Parchment Paper) */
.openwhen-modal-paper {
  position: relative;
  z-index: 1;
  background: #FFFDF9;
  color: #361F2B;
  width: 100%;
  max-width: 740px;
  max-height: calc(100dvh - 3rem);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: #E28498 #FFF8F5;
  border-radius: 20px;
  padding: 3rem 3.5rem 2.5rem 3.5rem;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6),
              0 0 0 1px rgba(244, 167, 185, 0.3),
              0 0 60px rgba(255, 214, 186, 0.3);
  transform: perspective(1200px) translateY(45px) scale(0.92) rotateX(6deg);
  opacity: 0;
  transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s ease;
  transform-origin: top center;
}

.openwhen-modal-overlay.is-active .openwhen-modal-paper {
  transform: perspective(1200px) translateY(0) scale(1) rotateX(0deg);
  opacity: 1;
}

.openwhen-modal-overlay.is-closing .openwhen-modal-paper {
  transform: perspective(1200px) translateY(35px) scale(0.92) rotateX(6deg);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;
}

/* Staggered modal contents reveal */
.openwhen-modal-overlay.is-active .modal-letter-header {
  animation: modalElementReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.openwhen-modal-overlay.is-active .modal-p {
  animation: modalElementReveal 0.65s cubic-bezier(0.16, 1, 0.3, 1) calc(var(--p-idx, 0) * 0.08s + 0.22s) both;
}

.openwhen-modal-overlay.is-active .modal-widget-container {
  animation: modalElementReveal 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.45s both;
}

.openwhen-modal-overlay.is-active .modal-signature {
  animation: modalElementReveal 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.55s both;
}

.openwhen-modal-overlay.is-active .modal-footer-actions {
  animation: modalElementReveal 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.62s both;
}

/* Tactile unboxing spring on envelope card */
.openwhen-card.is-unboxing {
  transform: translateY(-8px) scale(1.04) !important;
  box-shadow: 0 20px 45px rgba(216, 99, 128, 0.35), 0 0 25px rgba(244, 167, 185, 0.4) !important;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease !important;
}

.openwhen-card.is-unboxing .envelope-wax-seal {
  transform: scale(1.25) rotate(15deg);
  box-shadow: 0 0 22px rgba(216, 99, 128, 0.8);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (max-width: 640px) {
  .openwhen-modal-paper {
    padding: 1.75rem 1.2rem 1.75rem 1.2rem;
    max-height: calc(100dvh - 2rem);
    border-radius: 16px;
  }
}

/* Custom Parchment Scrollbar */
.openwhen-modal-paper::-webkit-scrollbar {
  width: 6px;
}
.openwhen-modal-paper::-webkit-scrollbar-track {
  background: #FFF8F5;
}
.openwhen-modal-paper::-webkit-scrollbar-thumb {
  background: #E28498;
  border-radius: 9999px;
}

/* Top Modal Navigation (Close & Stamp) */
.modal-top-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
  border-bottom: 1px dashed rgba(226, 132, 152, 0.4);
  padding-bottom: 1.25rem;
}

.modal-stamp-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.modal-vintage-stamp {
  width: 54px;
  height: 64px;
  background: #FFF8F5;
  border: 2px dashed #D86380;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transform: rotate(-3deg);
}

.modal-stamp-meta {
  font-family: var(--font-body, 'Lato', sans-serif);
  font-size: 0.78rem;
  color: #7A3C52;
  line-height: 1.35;
}

.modal-stamp-meta strong {
  color: #A02847;
  display: block;
}

.modal-close-btn {
  background: rgba(226, 132, 152, 0.15);
  border: 1px solid rgba(226, 132, 152, 0.35);
  color: #5C3A4A;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
}

.modal-close-btn:hover,
.modal-close-btn:focus-visible {
  background: #D86380;
  color: #FFF8F5;
  transform: rotate(90deg) scale(1.1);
  outline: none;
}

/* Letter Typography & Body */
.modal-letter-header {
  margin-bottom: 1.75rem;
}

.modal-salutation {
  font-family: 'Dancing Script', cursive;
  font-size: 2rem;
  color: #A02847;
  margin-bottom: 0.25rem;
}

.modal-letter-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  font-weight: 700;
  color: #2D1B2E;
  line-height: 1.3;
}

.modal-letter-body {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.15rem, 2.5vw, 1.35rem);
  line-height: 1.8;
  color: #38202D;
  margin-bottom: 2.5rem;
}

.modal-letter-body p {
  margin-bottom: 1.25rem;
}

.modal-letter-body p:first-of-type::first-letter {
  font-family: 'Playfair Display', serif;
  font-size: 3.4rem;
  float: left;
  line-height: 0.85;
  padding-right: 0.6rem;
  padding-top: 0.2rem;
  color: #A02847;
  font-weight: 700;
}

.modal-letter-body .quote-highlight {
  display: block;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 1.35rem;
  color: #8C1C38;
  background: rgba(244, 167, 185, 0.15);
  border-left: 4px solid #D86380;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 12px 12px 0;
  box-shadow: 0 4px 15px rgba(216, 99, 128, 0.08);
}

.modal-signature {
  margin-top: 2rem;
  text-align: right;
  border-top: 1px dashed rgba(226, 132, 152, 0.3);
  padding-top: 1.25rem;
}

.signature-signoff {
  font-family: 'Lato', sans-serif;
  font-size: 0.95rem;
  color: #7A3C52;
  margin-bottom: 0.25rem;
}

.signature-name {
  font-family: 'Dancing Script', cursive;
  font-size: 2.3rem;
  font-weight: 700;
  color: #A02847;
  display: inline-block;
  transform: rotate(-3deg);
}

.signature-sub {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: #8A556B;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

/* --------------------------------------------------------------------------
   04. INTERACTIVE LETTER FEATURES (UNIQUE TO EACH LETTER)
   -------------------------------------------------------------------------- */
.letter-interactive-widget {
  background: rgba(254, 232, 239, 0.5);
  border: 1px solid rgba(226, 132, 152, 0.4);
  border-radius: 16px;
  padding: 1.75rem;
  margin: 2.5rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(160, 40, 71, 0.06);
}

.widget-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  color: #8C1C38;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  display: block;
  font-weight: 700;
}

/* --- WIDGET 1: STEAMING HOT COCOA --- */
.cocoa-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.cocoa-cup-wrap {
  position: relative;
  width: 110px;
  height: 90px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cocoa-cup-wrap:hover {
  transform: scale(1.06);
}

.cocoa-cup-wrap:active {
  transform: scale(0.95);
}

.cocoa-cup {
  width: 90px;
  height: 75px;
  background: linear-gradient(135deg, #7A3C52, #501F31);
  border-radius: 6px 6px 36px 36px;
  position: relative;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
  margin: 0 auto;
  border-top: 6px solid #FFF8F5;
}

.cocoa-handle {
  position: absolute;
  top: 15px;
  right: -14px;
  width: 24px;
  height: 38px;
  border: 5px solid #7A3C52;
  border-radius: 0 16px 16px 0;
}

.cocoa-marshmallows {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
}

.marshmallow {
  width: 14px;
  height: 10px;
  background: #FFF;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* Steam Wisps */
.steam-group {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  pointer-events: none;
}

.steam-wisp {
  width: 6px;
  height: 25px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 9999px;
  filter: blur(2px);
  animation: steamRise 2s infinite ease-out;
}
.steam-wisp:nth-child(2) { animation-delay: 0.6s; height: 32px; }
.steam-wisp:nth-child(3) { animation-delay: 1.2s; height: 22px; }

@keyframes steamRise {
  0% { transform: translateY(10px) scaleX(1); opacity: 0; }
  50% { opacity: 0.8; }
  100% { transform: translateY(-25px) scaleX(2.5); opacity: 0; }
}

.cocoa-progress-wrap {
  width: 100%;
  max-width: 260px;
  height: 8px;
  background: rgba(216, 99, 128, 0.2);
  border-radius: 9999px;
  overflow: hidden;
  margin: 0.5rem auto;
}

.cocoa-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #D86380, #FFD6BA);
  transition: width 0.4s ease;
}

.cocoa-sip-btn {
  background: linear-gradient(135deg, #A02847, #7A1C34);
  color: #FFF;
  border: none;
  padding: 0.65rem 1.4rem;
  border-radius: 9999px;
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(160, 40, 71, 0.35);
  transition: all 0.25s ease;
}

.cocoa-sip-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(160, 40, 71, 0.5);
}

.cocoa-status-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-style: italic;
  color: #7A3C52;
}

/* --- WIDGET 2: DING AAYU'S BELL --- */
.bell-widget-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.bell-icon-container {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bell-svg {
  width: 58px;
  height: 58px;
  fill: #E89A38;
  filter: drop-shadow(0 4px 10px rgba(232, 154, 56, 0.4));
  transform-origin: top center;
}

.bell-svg.ringing {
  animation: bellWobble 0.9s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes bellWobble {
  0%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(24deg); }
  30% { transform: rotate(-22deg); }
  45% { transform: rotate(18deg); }
  60% { transform: rotate(-14deg); }
  75% { transform: rotate(8deg); }
  90% { transform: rotate(-4deg); }
}

.bell-ripple {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid #E89A38;
  opacity: 0;
  pointer-events: none;
}

.bell-ripple.pulse {
  animation: rippleSpread 0.9s ease-out forwards;
}

@keyframes rippleSpread {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

.ding-bell-btn {
  background: linear-gradient(135deg, #F5A623, #D47E08);
  color: #FFF;
  border: none;
  padding: 0.75rem 1.6rem;
  border-radius: 9999px;
  font-family: 'DM Mono', monospace;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(245, 166, 35, 0.4);
  transition: all 0.25s ease;
}

.ding-bell-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 22px rgba(245, 166, 35, 0.6);
}

.bell-feedback-card {
  background: #FFF8F5;
  border: 1px solid rgba(245, 166, 35, 0.4);
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  font-family: 'Lato', sans-serif;
  font-size: 0.95rem;
  color: #6C380E;
  display: none;
}

.bell-feedback-card.is-visible {
  display: block;
  animation: fadeInDown 0.35s ease-out;
}

/* --- WIDGET 3: STARRY NIGHT 2 AM LULLABY --- */
.lullaby-widget-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.lullaby-stars-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 16px;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.lullaby-stars-canvas.active {
  opacity: 1;
}

.lullaby-toggle-btn {
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, #372152, #1C0F2D);
  color: #F7E7A6;
  border: 1px solid rgba(247, 231, 166, 0.4);
  padding: 0.75rem 1.6rem;
  border-radius: 9999px;
  font-family: 'DM Mono', monospace;
  font-size: 0.88rem;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(28, 15, 45, 0.5);
  transition: all 0.3s ease;
}

.lullaby-toggle-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(155, 135, 245, 0.35);
}

.lullaby-breathing-ring {
  position: relative;
  z-index: 1;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px dashed rgba(155, 135, 245, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.5rem auto;
  font-family: 'Dancing Script', cursive;
  font-size: 1.25rem;
  color: #9B87F5;
  transition: all 4s ease-in-out;
}

.lullaby-breathing-ring.breathe-expand {
  transform: scale(1.3);
  border-color: #F7E7A6;
  color: #F7E7A6;
  box-shadow: 0 0 30px rgba(247, 231, 166, 0.3);
}

/* --- WIDGET 4: ROYAL GOLD COIN FLIP --- */
.coin-widget-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  perspective: 1000px;
}

.royal-coin {
  width: 90px;
  height: 90px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
}

.royal-coin-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 4px solid #DF9B20;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25),
              inset 0 3px 8px rgba(255, 255, 255, 0.6);
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  color: #5D3700;
  text-align: center;
  padding: 6px;
}

.royal-coin-front {
  background: radial-gradient(circle, #FFE17D 0%, #F5A623 70%, #C47900 100%);
}

.royal-coin-back {
  background: radial-gradient(circle, #FFD6BA 0%, #E28498 70%, #A02847 100%);
  color: #FFF;
  border-color: #A02847;
  transform: rotateY(180deg);
}

.coin-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.coin-sub {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
}

.flip-coin-btn {
  background: linear-gradient(135deg, #D47E08, #A35E00);
  color: #FFF8F5;
  border: none;
  padding: 0.75rem 1.6rem;
  border-radius: 9999px;
  font-family: 'DM Mono', monospace;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(212, 126, 8, 0.35);
  transition: all 0.25s ease;
}

.flip-coin-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 126, 8, 0.55);
}

.coin-verdict-box {
  background: #FFF8F5;
  border: 1px solid rgba(223, 155, 32, 0.4);
  border-radius: 12px;
  padding: 0.85rem 1.4rem;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.15rem;
  font-style: italic;
  color: #5D3700;
  max-width: 440px;
  margin: 0 auto;
}

/* --- WIDGET 5: INSTANT AFFIRMATION DISPENSER --- */
.affirmation-widget-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.dispense-affirmation-btn {
  background: linear-gradient(135deg, #E28498, #C92A52);
  color: #FFF;
  border: none;
  padding: 0.75rem 1.7rem;
  border-radius: 9999px;
  font-family: 'DM Mono', monospace;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(201, 42, 82, 0.35);
  transition: all 0.25s ease;
}

.dispense-affirmation-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 24px rgba(201, 42, 82, 0.55);
}

.affirmation-card-display {
  background: #FFFDF8;
  border: 2px dashed #E28498;
  border-radius: 14px;
  padding: 1.25rem 1.75rem;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.2rem;
  font-style: italic;
  color: #7A1C34;
  line-height: 1.5;
  max-width: 500px;
  box-shadow: 0 6px 20px rgba(226, 132, 152, 0.15);
  animation: ticketSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes ticketSlideIn {
  from { transform: translateY(20px) scale(0.9); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* --- WIDGET 6: EMERGENCY REEL POPPER --- */
.reel-popper-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.pop-reel-btn {
  background: linear-gradient(135deg, #FFB703, #FB8500);
  color: #2D1B2E;
  border: none;
  padding: 0.75rem 1.75rem;
  border-radius: 9999px;
  font-family: 'DM Mono', monospace;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(251, 133, 0, 0.35);
  transition: all 0.25s ease;
}

.pop-reel-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 22px rgba(251, 133, 0, 0.55);
}

.reel-chat-bubble {
  background: #FFF8F5;
  border: 1px solid rgba(251, 133, 0, 0.3);
  border-radius: 18px 18px 4px 18px;
  padding: 1rem 1.5rem;
  font-family: 'Lato', sans-serif;
  font-size: 1rem;
  color: #38202D;
  max-width: 460px;
  text-align: left;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  position: relative;
  animation: bubblePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bubblePop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* --------------------------------------------------------------------------
   05. UNIVERSAL ACTION: VIRTUAL HUG BUTTON & PARTICLES
   -------------------------------------------------------------------------- */
.modal-footer-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  margin-top: 2rem;
}

.virtual-hug-btn {
  position: relative;
  background: linear-gradient(135deg, #E28498 0%, #C92A52 50%, #A02847 100%);
  color: #FFF;
  border: none;
  padding: 1rem 2.4rem;
  border-radius: 9999px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 25px rgba(201, 42, 82, 0.4),
              0 0 0 2px rgba(255, 214, 186, 0.5) inset;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  overflow: hidden;
}

.virtual-hug-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.virtual-hug-btn:hover::before {
  transform: translateX(100%);
}

.virtual-hug-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 10px 35px rgba(201, 42, 82, 0.6),
              0 0 25px rgba(247, 231, 166, 0.5);
}

.virtual-hug-btn:active {
  transform: translateY(0) scale(0.97);
}

.hug-count-pill {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  color: #7A3C52;
  background: rgba(226, 132, 152, 0.15);
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
}

.modal-fold-btn {
  background: transparent;
  border: 1px solid rgba(122, 60, 82, 0.3);
  color: #7A3C52;
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-family: 'Lato', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-fold-btn:hover {
  background: rgba(226, 132, 152, 0.1);
  color: #A02847;
}

/* Floating Particles (Hearts, Sparkles) */
.openwhen-floating-particle {
  position: fixed;
  pointer-events: none;
  z-index: 10000;
  font-size: 1.5rem;
  line-height: 1;
  animation: floatParticleUp 1.8s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes floatParticleUp {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(0.6) rotate(0deg);
  }
  50% {
    opacity: 0.9;
    transform: translate(var(--tx, 0px), -80px) scale(1.2) rotate(var(--rot, 20deg));
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx, 0px), -180px) scale(0.8) rotate(var(--rot, 40deg));
  }
}

/* --------------------------------------------------------------------------
   06. ACCESSIBILITY & ANIMATION HELPERS
   -------------------------------------------------------------------------- */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .openwhen-card,
  .openwhen-modal-paper,
  .steam-wisp,
  .bell-svg.ringing,
  .openwhen-candlelight-glow,
  .openwhen-floating-particle {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}
