/**
 * ============================================================================
 * SURPRISES HUB & GOLDEN TICKET STYLESHEET (surprises-hub.css)
 * ============================================================================
 * Premium romantic gold-gradient styling (#f0db4a -> #f7b733 -> #ff6f61)
 * Dedicated styles for /meow/surprises/ and the Home teaser ticket.
 *
 * Rules:
 * - Standalone styles with zero impact on existing components.
 * - Hardware-accelerated CSS (transform & opacity only).
 * - Fully responsive (375px, 768px, 1024px, 1440px).
 * - Full prefers-reduced-motion support.
 * ============================================================================
 */

/* ----------------------------------------------------------------------------
 * 1. COMPACT GOLDEN TICKET TEASER (ON HOMEPAGE index.php)
 * ---------------------------------------------------------------------------- */
.golden-ticket-section {
  padding: 40px 0 20px;
  position: relative;
  z-index: 5;
}

.golden-ticket-banner {
  display: block;
  text-decoration: none !important;
  color: var(--color-text-main, #3a2e1f) !important;
  background: linear-gradient(135deg, rgba(255, 253, 240, 0.96) 0%, rgba(255, 247, 215, 0.92) 50%, rgba(255, 240, 220, 0.95) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 2px solid rgba(240, 219, 74, 0.85);
  border-radius: 24px;
  padding: 28px 36px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(247, 183, 51, 0.18), inset 0 0 20px rgba(255, 255, 255, 0.8);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}

.golden-ticket-banner:hover,
.golden-ticket-banner:focus-visible {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 20px 50px rgba(240, 219, 74, 0.32), inset 0 0 25px rgba(255, 255, 255, 0.9);
  border-color: #f7b733;
}

/* Shimmer Light Stripe */
.ticket-glow-effect {
  position: absolute;
  top: -50%;
  left: -60%;
  width: 50%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: rotate(25deg);
  pointer-events: none;
  transition: transform 0.8s ease;
}

.golden-ticket-banner:hover .ticket-glow-effect {
  transform: translateX(350%) rotate(25deg);
}

/* Ticket Side Notches (Cutout stub look) */
.ticket-notches .notch {
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-bg-base, #fffaf0);
  border: 2px solid rgba(240, 219, 74, 0.85);
  transform: translateY(-50%);
  z-index: 2;
}

.ticket-notches .notch-left {
  left: -12px;
}

.ticket-notches .notch-right {
  right: -12px;
}

.ticket-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.ticket-badge-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  background: rgba(240, 219, 74, 0.25);
  border: 1px solid rgba(240, 219, 74, 0.6);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a06e12;
}

.ticket-main-info {
  flex: 1 1 380px;
}

.ticket-title {
  font-family: var(--font-heading, 'Playfair Display', serif);
  font-size: 1.55rem;
  color: #3a2e1f;
  margin-bottom: 6px;
  line-height: 1.3;
}

.ticket-desc {
  font-size: 0.95rem;
  color: var(--color-text-muted, #6b5b45);
  line-height: 1.55;
  margin: 0;
}

.ticket-cta-wrap {
  flex-shrink: 0;
}

.btn-ticket-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #f0db4a 0%, #f7b733 50%, #ff6f61 100%);
  color: #3a2e1f;
  font-weight: 700;
  font-size: 0.96rem;
  padding: 12px 26px;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(247, 183, 51, 0.3);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.golden-ticket-banner:hover .btn-ticket-action {
  transform: scale(1.05);
  box-shadow: 0 10px 26px rgba(247, 183, 51, 0.45);
}

/* ----------------------------------------------------------------------------
 * 2. DEDICATED SURPRISES HUB PAGE (/meow/surprises/)
 * ---------------------------------------------------------------------------- */
.surprises-hub-section {
  position: relative;
  min-height: calc(100vh - 120px);
  padding: 60px 0 100px;
  overflow: hidden;
}

/* Ambient Gold Aurora Light Orbs */
.hub-aurora-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 1;
  animation: hubOrbFloat 14s infinite alternate ease-in-out;
}

.hub-orb-1 {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, #f0db4a 0%, rgba(247, 183, 51, 0.4) 70%, transparent 100%);
  top: -80px;
  left: -120px;
}

.hub-orb-2 {
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, #ff6f61 0%, rgba(247, 183, 51, 0.35) 70%, transparent 100%);
  bottom: 80px;
  right: -100px;
  animation-duration: 18s;
  animation-delay: -5s;
}

.hub-orb-3 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, #fff7dc 0%, rgba(240, 219, 74, 0.3) 70%, transparent 100%);
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-duration: 12s;
  animation-delay: -2s;
}

@keyframes hubOrbFloat {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(30px, -40px, 0) scale(1.08); }
  100% { transform: translate3d(-30px, 30px, 0) scale(0.95); }
}

.surprises-hub-container {
  position: relative;
  z-index: 2;
  max-width: 1140px;
}

.surprises-hero-head {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 36px;
}

.surprises-shimmer-title {
  font-family: var(--font-heading, 'Playfair Display', serif);
  font-size: clamp(2.4rem, 5.5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.2;
  color: #3a2e1f;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.surprises-hub-desc {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--color-text-muted, #6b5b45);
  line-height: 1.7;
  max-width: 660px;
  margin: 0 auto;
}

/* ----------------------------------------------------------------------------
 * 3. TREASURE DISCOVERY PROGRESS TRACKER
 * ---------------------------------------------------------------------------- */
.treasure-progress-panel {
  max-width: 680px;
  margin: 0 auto 50px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(240, 219, 74, 0.65);
  border-radius: 26px;
  padding: 24px 30px;
  box-shadow: 0 10px 30px rgba(247, 183, 51, 0.12);
}

.tracker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.tracker-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8c765a;
}

.tracker-counter-badge {
  font-size: 0.84rem;
  font-weight: 700;
  color: #a06e12;
  background: rgba(240, 219, 74, 0.25);
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid rgba(240, 219, 74, 0.5);
}

.treasure-medallions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.medallion-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 3;
}

.medallion-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fffdf5;
  border: 2px solid rgba(240, 219, 74, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.35s ease;
}

.medallion-check {
  display: none;
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #27ae60;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #ffffff;
}

.medallion-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #8c765a;
  white-space: nowrap;
  transition: color 0.3s ease;
}

/* Completed State */
.medallion-item.completed .medallion-circle {
  background: linear-gradient(135deg, #f0db4a 0%, #f7b733 100%);
  border-color: #d49b22;
  box-shadow: 0 6px 18px rgba(247, 183, 51, 0.4);
}

.medallion-item.completed .medallion-check {
  display: flex;
}

.medallion-item.completed .medallion-title {
  color: #3a2e1f;
  font-weight: 800;
}

/* Connecting Golden Path */
.medallion-connector {
  flex-grow: 1;
  height: 3px;
  background: rgba(240, 219, 74, 0.35);
  margin: 0 10px -20px;
  position: relative;
  z-index: 1;
  transition: background 0.4s ease;
}

.medallion-connector.filled {
  background: linear-gradient(90deg, #f0db4a, #f7b733);
}

/* ----------------------------------------------------------------------------
 * 4. 3 GLOWING TREASURE CARDS GRID (WITH 3D TILT ON DESKTOP)
 * ---------------------------------------------------------------------------- */
.treasures-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 50px;
}

.treasure-card-wrapper {
  perspective: 1000px;
}

.treasure-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 2px solid rgba(240, 219, 74, 0.55);
  border-radius: 26px;
  padding: 34px 28px;
  text-decoration: none !important;
  color: #3a2e1f !important;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(247, 183, 51, 0.1);
  transform-style: preserve-3d;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}

.treasure-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #f0db4a, #f7b733, #ff6f61);
  opacity: 0.85;
}

.treasure-card:hover,
.treasure-card:focus-visible {
  border-color: #f7b733;
  box-shadow: 0 22px 55px rgba(240, 219, 74, 0.28);
}

/* Top bar with badge & status */
.treasure-card-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.treasure-card-badge {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a06e12;
  background: rgba(240, 219, 74, 0.2);
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(240, 219, 74, 0.5);
}

.treasure-status-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.treasure-status-badge.badge-new {
  background: rgba(255, 111, 97, 0.15);
  color: #ff6f61;
  border: 1px solid rgba(255, 111, 97, 0.4);
  animation: badgeSparkleGlow 2.5s infinite alternate ease-in-out;
}

.treasure-status-badge.badge-completed {
  background: rgba(39, 174, 96, 0.15);
  color: #27ae60;
  border: 1px solid rgba(39, 174, 96, 0.4);
}

@keyframes badgeSparkleGlow {
  0% { transform: scale(1); opacity: 0.85; }
  100% { transform: scale(1.08); opacity: 1; }
}

/* Animated Card Icons */
.treasure-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 247, 220, 0.8) 0%, rgba(255, 255, 255, 0.95) 100%);
  border: 1.5px solid rgba(240, 219, 74, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  margin-bottom: 20px;
  box-shadow: 0 8px 20px rgba(247, 183, 51, 0.15);
  transition: transform 0.3s ease;
}

/* Floating Heart Animation */
.floating-heart {
  animation: floatHeart 3s infinite ease-in-out;
}
@keyframes floatHeart {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

/* Twinkling Star Animation */
.twinkling-star {
  animation: twinkleStar 2.6s infinite ease-in-out;
}
@keyframes twinkleStar {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.1) rotate(6deg); }
}

/* Turning Golden Key Animation */
.turning-key {
  animation: turnKey 3.2s infinite ease-in-out;
}
@keyframes turnKey {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-12deg); }
}

.treasure-card:hover .treasure-icon-wrap {
  transform: scale(1.15);
}

.treasure-card-title {
  font-family: var(--font-heading, 'Playfair Display', serif);
  font-size: 1.45rem;
  color: #3a2e1f;
  margin-bottom: 12px;
  line-height: 1.35;
}

.treasure-card-desc {
  font-size: 0.94rem;
  color: var(--color-text-muted, #6b5b45);
  line-height: 1.65;
  margin-bottom: 26px;
  flex-grow: 1;
}

.treasure-card-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--color-coral, #ff6f61);
  padding-top: 16px;
  border-top: 1px dashed rgba(240, 219, 74, 0.45);
}

.treasure-card-cta .cta-arrow {
  transition: transform 0.25s ease;
}

.treasure-card:hover .treasure-card-cta .cta-arrow {
  transform: translateX(6px);
}

/* Completed Surprise Cards: Disabled & Non-Clickable State */
.treasure-card.surprise-completed {
  cursor: not-allowed !important;
  opacity: 0.82;
  border-color: rgba(39, 174, 96, 0.4) !important;
  background: rgba(255, 255, 255, 0.85) !important;
  box-shadow: 0 8px 24px rgba(39, 174, 96, 0.08) !important;
}

.treasure-card.surprise-completed:hover,
.treasure-card.surprise-completed:focus-visible {
  transform: none !important;
  border-color: rgba(39, 174, 96, 0.5) !important;
  box-shadow: 0 8px 24px rgba(39, 174, 96, 0.12) !important;
}

.treasure-card.surprise-completed:hover .treasure-icon-wrap {
  transform: none !important;
}

.treasure-card.surprise-completed .treasure-card-cta {
  color: #8c765a !important;
  border-top-color: rgba(39, 174, 96, 0.35) !important;
  cursor: not-allowed !important;
  font-weight: 700;
  opacity: 0.85;
}

.treasure-card.surprise-completed .treasure-card-cta .cta-label {
  color: #8c765a !important;
  cursor: not-allowed !important;
}

/* Forward Journey Row (Continue to Memories) */
.hub-forward-cta-wrap {
  text-align: center;
  margin-top: 44px;
  margin-bottom: 24px;
}

.hub-continue-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 40px;
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none !important;
  color: var(--color-text-main, #3a2e1f) !important;
  background: var(--grad-sunset, linear-gradient(135deg, #f0db4a 0%, #f7b733 50%, #ff6f61 100%));
  border-radius: 9999px;
  box-shadow: 0 8px 25px rgba(247, 183, 51, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
  cursor: pointer;
}

.hub-continue-btn:hover:not(.disabled) {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 35px rgba(240, 219, 74, 0.45);
}

.hub-continue-btn.disabled {
  opacity: 0.42;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(40%);
  box-shadow: none;
}

.hub-continue-hint {
  font-size: 0.88rem;
  color: var(--color-text-muted, #8c765a);
  margin-top: 10px;
  font-style: italic;
  font-weight: 500;
}

/* Return Row */
.hub-return-row {
  text-align: center;
  margin-top: 20px;
}

.hub-return-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 0.95rem;
}

/* ----------------------------------------------------------------------------
 * 5. RESPONSIVE BREAKPOINTS (375px, 768px, 1024px)
 * ---------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .treasures-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* BUG 1: Home Ticket Teaser - Content-fitted with 20px gap before button */
  .golden-ticket-section {
    padding: 24px 0 10px;
  }
  .golden-ticket-banner {
    padding: 22px 18px;
    border-radius: 20px;
  }
  .ticket-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }
  .ticket-badge-pill {
    margin-bottom: 12px;
  }
  .ticket-main-info {
    flex: 0 0 auto;
    width: 100%;
    margin-bottom: 0;
  }
  .ticket-title {
    font-size: 1.25rem;
    margin-bottom: 8px;
    line-height: 1.35;
  }
  .ticket-desc {
    font-size: 0.92rem;
    line-height: 1.5;
    margin-bottom: 20px;
  }
  .ticket-cta-wrap {
    width: 100%;
    margin-top: 0;
  }
  .btn-ticket-action {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
    padding: 12px 20px;
  }

  /* BUG 3: Hub Section Padding (Header Clearance & Bottom Nav Clearance) */
  .surprises-hub-section {
    padding-top: calc(77px + 16px);
    padding-bottom: calc(85px + env(safe-area-inset-bottom, 0px) + 24px);
    scroll-margin-top: calc(77px + 16px);
  }

  .treasures-cards-grid {
    grid-template-columns: 1fr;
  }

  /* BUG 3: Tracker Medallions Row - Exact Center Alignment */
  .treasure-progress-panel {
    padding: 20px 16px;
  }
  .treasure-medallions-row {
    align-items: flex-start;
  }
  .medallion-item {
    gap: 8px;
  }
  .medallion-circle {
    width: 44px;
    height: 44px;
    font-size: 1.15rem;
  }
  .medallion-title {
    font-size: 0.72rem;
  }
  .medallion-connector {
    align-self: flex-start;
    margin: 20.5px 8px 0;
  }
}

@media (max-width: 375px) {
  .treasure-card {
    padding: 24px 18px;
  }
  .surprises-shimmer-title {
    font-size: 2rem;
  }
}

/* ----------------------------------------------------------------------------
 * 6. PREFERS REDUCED MOTION FALLBACKS
 * ---------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .hub-aurora-orb,
  .floating-heart,
  .twinkling-star,
  .turning-key,
  .ticket-glow-effect,
  .treasure-status-badge.badge-new {
    animation: none !important;
    transition: none !important;
  }
  .golden-ticket-banner:hover,
  .treasure-card:hover {
    transform: none !important;
  }
}
