/* css/style_historia.css - VERSÃO 53.1 - CORREÇÃO DEFINITIVA PARA IMAGEM EM TEXTO ACIMA/ABAIXO */

:root {
  --pink: #fde2e4;
  --white: #ffffff;
  --gold: #c9a959;
  --deep-purple: #1a0a24;
  --light-purple: #3d1e52;
  --dark-container: rgba(15, 5, 25, 0.9);
  --glow-color: rgba(201, 169, 89, 0.2);
  --font-title: 'Playfair Display', serif;
  --font-body: 'Poppins', sans-serif;
  --moon-standard-color: #fcf8e8;
  --moon-full-color: #fafdff;
  --moon-harvest-color: #f7dcb1;
  --moon-terminator-color: rgba(0, 0, 0, 0.5);
  --moon-dark-phase-color: #585858;
  --moon-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Ccircle cx='15' cy='20' r='5' fill='rgba(0,0,0,0.5)'/%3E%3Ccircle cx='50' cy='50' r='10' fill='rgba(0,0,0,0.4)'/%3E%3Ccircle cx='80' cy='30' r='8' fill='rgba(0,0,0,0.3)'/%3E%3Ccircle cx='75' cy='80' r='6' fill='rgba(0,0,0,0.5)'/%3E%3Ccircle cx='30' cy='75' r='4' fill='rgba(0,0,0,0.2)'/%3E%3Ccircle cx='5' cy='45' r='3' fill='rgba(0,0,0,0.4)'/%3E%3Ccircle cx='65' cy='90' r='7' fill='rgba(0,0,0,0.3)'/%3E%3Ccircle cx='40' cy='5' r='9' fill='rgba(0,0,0,0.25)'/%3E%3Ccircle cx='95' cy='5' r='3.5' fill='rgba(0,0,0,0.2)'/%3E%3Ccircle cx='8' cy='92' r='4.5' fill='rgba(0,0,0,0.35)'/%3E%3C/svg%3E");
  --moon-shadow-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Ccircle cx='25' cy='60' r='7' fill='rgba(0,0,0,0.6)'/%3E%3Ccircle cx='65' cy='15' r='4' fill='rgba(0,0,0,0.5)'/%3E%3Ccircle cx='85' cy='70' r='9' fill='rgba(0,0,0,0.4)'/%3E%3Ccircle cx='5' cy='5' r='5' fill='rgba(0,0,0,0.45)'/%3E%3Ccircle cx='55' cy='95' r='6' fill='rgba(0,0,0,0.55)'/%3E%3Ccircle cx='90' cy='40' r='3' fill='rgba(0,0,0,0.3)'/%3E%3C/svg%3E");
  --moon-shadow-tx: 0%;
  --moon-shadow-scale: 1.0;
  --dynamic-shadow-color: var(--moon-terminator-color);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: auto;
}

body {
  font-family: var(--font-body);
  background: linear-gradient(135deg, var(--deep-purple) 0%, var(--light-purple) 100%);
  color: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

.background-fix,
#hearts-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.background-fix {
  z-index: -3;
  background: linear-gradient(135deg, var(--deep-purple) 0%, var(--light-purple) 100%);
}

#hearts-canvas {
  z-index: -2;
}

.story-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
}

.story-section {
  padding: 30px 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.interactive-container {
  position: relative;
  background-color: var(--dark-container);
  padding: 60px 20px;
  border-radius: 20px;
  box-shadow: 0 0 30px var(--glow-color);
  backdrop-filter: blur(5px);
  margin-bottom: 60px;
  width: 100%;
  overflow: hidden;
  transform: translateZ(0);
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.2s ease-out, transform 1s ease-out;
  will-change: transform, opacity;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.section-title {
  font-family: var(--font-title);
  font-size: 2.8rem;
  color: var(--pink);
  text-align: center;
  margin-bottom: 40px;
}

.section-subtitle {
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  margin-top: -30px;
  margin-bottom: 30px;
}

.scroll-arrow {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--gold);
  text-decoration: none;
  transition: all 0.3s ease;
  opacity: 0.3;
  z-index: 10;
}

.scroll-arrow-up {
  top: 15px;
}

.scroll-arrow-down {
  bottom: 15px;
}

.scroll-arrow:hover {
  opacity: 1;
  background: var(--gold);
  color: var(--deep-purple);
  transform: translateX(-50%) scale(1.1);
}

.story-section.single-photo-layout .interactive-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 90vh;
}

.single-photo-layout .section-title {
  font-size: var(--title-font-size, 2rem);
  margin-top: 20px;
  margin-bottom: 20px;
  flex-shrink: 0;
  width: 100%;
  padding: 0 10px;
}

.single-photo-layout .gallery-grid {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: auto;
  overflow: hidden;
  padding: 0 1rem;
  margin: 0 !important;
}

.single-photo-layout .memory-card {
  position: relative; 
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: transparent;
  box-shadow: none;
  border: none;
  padding: 0;
  width: 100% !important;
  height: 100% !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  --transform: none !important;
}

.single-photo-layout .memory-card-inner {
  position: relative;
  justify-content: center;
  align-items: center;
  background-color: transparent;
  box-shadow: none;
  border: none;
  padding: 0;
  width: 100%;
  height: 100%;
}

.single-photo-layout .gallery-grid img {
  display: block;
  object-fit: contain;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-height: 50px;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}


.solar-system {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 20px auto 40px;
  transition: transform 0.3s ease-out;
}

.sun {
  width: 50px;
  height: 50px;
  background-color: #f1c40f;
  border-radius: 50%;
  box-shadow: 0 0 25px #f1c40f, 0 0 50px #e67e22, inset 0 0 10px rgba(255, 255, 255, 0.5);
  z-index: 2;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: sun-pulse 5s infinite ease-in-out;
}

@keyframes sun-pulse {
  50% {
    box-shadow: 0 0 30px #f1c40f, 0 0 60px #e67e22, inset 0 0 12px rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%) scale(1.03);
  }
}

.earth-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 180px;
  height: 180px;
  margin: -90px 0 0 -90px;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  animation: orbit-path-rotation 40s linear infinite;
}

.earth {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 0;
  margin-top: -10px;
  margin-left: -10px;
  background: radial-gradient(circle at 5px 5px, #98c5e9, #3498db);
  box-shadow: 0 0 10px #3498db;
  animation: earth-rotation 4s linear infinite;
  overflow: hidden;
}

.earth-land {
  position: absolute;
  width: 8px;
  height: 9px;
  background: #4f963c;
  border-radius: 50% 50% 40% 60%;
  top: 2px;
  left: 8px;
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.earth-land::before,
.earth-land::after {
  content: '';
  position: absolute;
  background: #6a994e;
  z-index: 1;
}

.earth-land::before {
  width: 6px;
  height: 5px;
  border-radius: 40% 60% 50% 50%;
  top: 9px;
  left: -3px;
}

.earth-land::after {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  top: 12px;
  left: 9px;
}

.earth-cloud-1,
.earth-cloud-2,
.earth-cloud-3 {
  position: absolute;
  background: rgba(255, 255, 255, 0.8);
  width: 12px;
  height: 12px;
  z-index: 3;
}

@keyframes cloud-drift {
  0% {
    transform: translateX(-25px);
  }

  100% {
    transform: translateX(25px);
  }
}

.earth-cloud-1 {
  top: 1px;
  left: 6px;
  clip-path: polygon(20% 50%, 30% 20%, 60% 10%, 80% 25%, 90% 60%, 75% 90%, 40% 95%, 15% 75%);
  animation: cloud-drift 12s infinite ease-in-out alternate;
}

.earth-cloud-2 {
  width: 15px;
  height: 8px;
  top: 12px;
  left: -2px;
  clip-path: polygon(10% 60%, 30% 20%, 70% 20%, 90% 50%, 75% 80%, 25% 80%);
  animation: cloud-drift 10s infinite ease-in-out 1s alternate;
}

.earth-cloud-3 {
  width: 8px;
  height: 8px;
  top: 8px;
  left: 0px;
  clip-path: polygon(30% 20%, 70% 20%, 90% 50%, 70% 80%, 30% 80%, 10% 50%);
  animation: cloud-drift 15s infinite ease-in-out 0.5s alternate;
}

@keyframes orbit-path-rotation {
  from {
    transform: rotate(0);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes earth-rotation {
  from {
    transform: rotate(0);
  }

  to {
    transform: rotate(-360deg);
  }
}

.cosmic-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 30px;
}

.cosmic-item {
  text-align: center;
}

.cosmic-item .cosmic-icon-wrapper {
  height: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 15px;
}

.cosmic-item .fa-sun {
  font-size: 3.5rem;
  color: #f1c40f;
  filter: drop-shadow(0 0 15px #f1c40f);
}

.cosmic-item h3 {
  font-family: var(--font-title);
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.cosmic-item p {
  color: rgba(255, 255, 255, 0.8);
  max-width: 300px;
  margin: 0 auto;
  line-height: 1.6;
}

.cosmic-item .moon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 15px auto;
  position: relative;
  background-color: var(--moon-standard-color);
  box-shadow: inset -5px -5px 15px rgba(0, 0, 0, 0.1), 0 0 20px rgba(252, 248, 232, 0.4);
  transition: background-color 0.8s ease-in-out;
  overflow: hidden;
  background-image: var(--moon-texture);
  background-blend-mode: multiply;
  background-size: 100px;
}

.moon::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--dynamic-shadow-color);
  background-image: var(--moon-shadow-texture);
  background-blend-mode: multiply;
  background-size: 100px;
  transform: translateX(var(--moon-shadow-tx)) scale(var(--moon-shadow-scale));
  transition: transform 1.5s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.8s ease-in-out;
}

.feature-card {
  text-align: center;
}

.feature-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
}

.feature-icon {
  font-size: 3.5rem;
  color: var(--gold);
  text-shadow: 0 0 15px var(--gold);
  z-index: 1;
}

.feature-name {
  font-family: var(--font-title);
  font-size: 2.2rem;
}

.feature-text {
  font-style: italic;
  color: rgba(255, 255, 255, 0.85);
  max-width: 550px;
  margin: 30px auto 0;
  line-height: 1.7;
  font-size: 0.95rem;
}

.feature-details {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 25px;
}

.detail-box {
  background: rgba(0, 0, 0, 0.2);
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-box .detail-label {
  display: block;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

.detail-box .detail-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold);
}

.zodiac-wrapper {
  height: 80px;
  width: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
  transform: rotate(-1080deg) scale(0.5);
  opacity: 0;
  transition: transform 3s cubic-bezier(0.25, 1, 0.5, 1) 0.5s, opacity 1s ease 0.5s;
}

.is-visible .zodiac-wrapper {
  transform: rotate(0deg) scale(1);
  opacity: 1;
}

.zodiac-icon {
  font-size: 3.5rem;
  color: var(--gold);
  text-shadow: 0 0 15px var(--gold);
}

.constellation-container {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 20px auto;
  transition: transform 0.3s ease-out;
}

.constellation-container::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150%;
  height: 150%;
  background: radial-gradient(circle, rgba(201, 169, 89, 0.1), transparent 70%);
  border-radius: 50%;
  z-index: 0;
}

.constellation-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  z-index: 1;
}

.constellation-svg line {
  stroke: rgba(201, 169, 89, 0.5);
  stroke-width: 1;
  stroke-dasharray: 150;
  stroke-dashoffset: 150;
}

.is-visible .constellation-svg line {
  animation: draw-line 4s cubic-bezier(0.25, 1, 0.5, 1) 0.5s forwards;
}

@keyframes draw-line {
  to {
    stroke-dashoffset: 0;
  }
}

.constellation-svg circle {
  fill: var(--white);
  filter: drop-shadow(0 0 3px var(--white));
  animation: twinkle 4s infinite ease-in-out alternate;
}

@keyframes twinkle {
  from {
    r: 3;
    opacity: 1;
  }

  to {
    r: 1.5;
    opacity: 0.6;
  }
}

/* === GALERIA E LAYOUTS === */
.gallery-grid {
  position: relative;
  width: 100%;
  height: 0;
}

.gallery-grid.portrait-duo-layout,
.gallery-grid.timeline-layout {
  height: auto;
  padding-bottom: 0;
}

.memory-card {
  position: absolute;
  background-color: transparent;
  transition: all 0.5s ease-out;
  transform: var(--transform, rotate(0deg));
}

.memory-caption {
  line-height: 1.4;
  transition: opacity 0.4s;
}

.memory-caption.text-align-left {
  text-align: left;
}

.memory-caption.text-align-center {
  text-align: center;
}

.memory-caption.text-align-right {
  text-align: right;
}

.memory-caption h3 {
  font-family: var(--font-title);
  color: var(--white);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
  margin: 0;
  font-size: var(--title-font-size, 1.2rem);
  line-height: 1.2;
}

/* ===== CORREÇÃO DEFINITIVA (LEGENDA INTERNA) ===== */
.memory-card-inner {
    position: relative; /* ESSENCIAL: Contêiner para a legenda absoluta */
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--deep-purple);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    transition: transform 0.4s ease-out;
}

.memory-card-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 8px;
}

.memory-card.caption-inside {
    padding: 0;
    border: none;
    overflow: hidden;
}

.memory-card.caption-inside .memory-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 12% 8% 4%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 50%, transparent 100%);
    opacity: 1; /* Visível por padrão em todos os dispositivos */
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.4s ease;
}

@media (hover: hover) and (min-width: 1024px) {
    .memory-card.caption-inside .memory-caption {
        opacity: 0;
    }
    .memory-card.caption-inside:hover .memory-caption {
        opacity: 1;
    }
    .memory-card:hover .memory-card-inner {
        transform: scale(1.03);
    }
}
/* ===== FIM DA CORREÇÃO (LEGENDA INTERNA) ===== */

/* ===== CORREÇÃO DEFINITIVA (LEGENDA ACIMA/ABAIXO) ===== */
.memory-card.caption-above,
.memory-card.caption-below {
  display: flex;
  flex-direction: column;
  padding: 8px;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  height: 100%; /* Garante que o flex container ocupe o espaço */
  overflow: hidden;
}

.memory-card.caption-above .memory-card-inner,
.memory-card.caption-below .memory-card-inner {
  flex-grow: 1; /* Ocupa o espaço restante */
  min-height: 0; /* Hack de flexbox para permitir que o item encolha */
  box-shadow: none; /* Remove a sombra duplicada */
}

.memory-card.caption-above .memory-caption,
.memory-card.caption-below .memory-caption {
  flex-shrink: 0; /* Impede que o texto seja espremido */
}

.memory-card.caption-above .memory-caption {
  order: 1;
  padding: 0 4px 12px;
}

.memory-card.caption-above .memory-card-inner {
  order: 2;
}

.memory-card.caption-below .memory-caption {
  order: 2;
  padding: 12px 4px 0;
}

.memory-card.caption-below .memory-card-inner {
  order: 1;
}

.memory-card.caption-above .memory-caption h3,
.memory-card.caption-below .memory-caption h3 {
  text-shadow: none;
  color: var(--pink);
}
/* ===== FIM DA CORREÇÃO (LEGENDA ACIMA/ABAIXO) ===== */


.memory-card.no-text .memory-caption {
  display: none;
}

.memory-card.caption-above.no-text,
.memory-card.caption-below.no-text {
  padding: 0;
  background-color: transparent;
  border: none;
}

.memory-card.caption-above.no-text .memory-card-inner,
.memory-card.caption-below.no-text .memory-card-inner {
  height: 100%;
  border-radius: 8px;
}

.gallery-grid.portrait-duo-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 2%;
}

.gallery-grid.portrait-duo-layout .memory-card {
  position: static;
  flex: 0 0 49%;
  margin-bottom: 0;
}

.gallery-grid.timeline-layout {
  position: relative;
  padding: 20px 0;
}

.gallery-grid.timeline-layout::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: rgba(201, 169, 89, 0.3);
  transform: translateX(-50%);
}

.gallery-grid.timeline-layout .memory-card {
  position: relative;
  width: 45%;
  margin-bottom: 40px;
}

.gallery-grid.timeline-layout .memory-card:nth-child(odd) {
  left: 0;
}

.gallery-grid.timeline-layout .memory-card:nth-child(even) {
  left: 55%;
}

.video-container {
  position: relative;
  width: 100%;
  background-color: #000;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  padding-top: 56.25%;
}

#player {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.final-content-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.final-title {
  font-family: var(--font-title);
  font-size: 2.2rem;
}

.final-subtitle {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 600px;
  margin: 15px 0 40px;
  line-height: 1.7;
}

.final-content-wrapper h3 {
  margin-bottom: 20px;
  font-size: 1.1rem;
  font-weight: 400;
}

.countdown {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 50px;
}

.countdown-item {
  background: rgba(0, 0, 0, 0.2);
  padding: 10px;
  border-radius: 10px;
  min-width: 75px;
  text-align: center;
}

.countdown-number {
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--gold);
}

.countdown-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

#love-button-wrapper {
  position: relative;
}

.love-btn {
  background-color: var(--white);
  color: var(--deep-purple);
  border: none;
  padding: 12px 30px;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.love-btn:hover {
  transform: scale(1.05);
}

.love-btn .fa-heart {
  color: #e74c3c;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  50% {
    transform: scale(1.2);
  }
}

.love-rain-heart {
  position: absolute;
  color: #e74c3c;
  font-size: var(--heart-size, 1rem);
  pointer-events: none;
  z-index: 0;
  opacity: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
  animation: rain-fall-fade-halfway-desktop ease-in forwards;
}

@keyframes rain-fall-fade-halfway-desktop {
  0% {
    transform: translateY(0) scale(0.6);
    opacity: 1;
  }

  50% {
    opacity: 1;
  }

  100% {
    transform: translateY(300px) scale(1);
    opacity: 0;
  }
}

.story-footer {
  text-align: center;
  padding: 20px 40px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

.story-footer p {
  margin: 0;
}

.story-footer strong {
  color: var(--gold);
  font-weight: 600;
}

.preview-watermark {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9998;
  pointer-events: none;
  overflow: hidden;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='175' height='125'%3E%3Ctext x='50%25' y='50%25' font-size='24' fill='rgba(255,255,255,0.04)' font-family='Poppins, sans-serif' font-weight='700' text-anchor='middle' dominant-baseline='middle' transform='rotate(-30, 125, 100)'%3EPRÉVIA%3C/text%3E%3C/svg%3E");
  background-repeat: repeat;
}

#interaction-gate {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--deep-purple);
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  z-index: 10000;
  cursor: pointer;
  color: var(--white);
  transition: opacity 0.8s ease-out;
  opacity: 0;
  pointer-events: none;
}

#interaction-gate.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#interaction-gate.gate-exit-animation {
  animation: gate-zoom-out 1.2s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

@keyframes gate-zoom-out {
  0% {
    opacity: 1;
    transform: scale(1.1);
  }
}

body:has(#interaction-gate:not(.hidden)) {
  overflow: hidden;
}

.gate-content {
  animation: pulse-text 2.5s infinite ease-in-out;
}

.gate-icon {
  font-size: 3rem;
  color: var(--gold);
  margin-bottom: 20px;
}

.gate-content h1 {
  font-family: var(--font-title);
  font-size: 2.5rem;
  color: var(--pink);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.gate-content p {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
}

@keyframes pulse-text {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.03);
  }

  100% {
    transform: scale(1);
  }
}

@media (min-width: 769px) {
  .cosmic-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }

  .countdown {
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .story-section {
    min-height: 0;
    padding-top: 60px;
    padding-bottom: 60px;
  }

  .interactive-container {
    padding: 60px 15px;
  }

  .detail-box {
    background: rgba(0, 0, 0, 0.2);
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .feature-text {
    font-style: italic;
    color: rgba(255, 255, 255, 0.85);
    max-width: 550px;
    margin: 30px auto 0;
    line-height: 1.7;
    font-size: 0.8rem;
  }

  .story-section.single-photo-layout .interactive-container {
    padding: 15px;
    min-height: 80vh;
  }

  .section-title {
    font-size: calc(2.8rem * 0.45);
  }

  .scroll-arrow {
    display: none !important;
    opacity: 0;
  }

  .solar-system,
  .constellation-container {
    display: block;
    margin: 10px auto 20px;
    transform: scale(0.9);
    transform-origin: center center;
  }

  .cosmic-grid {
    grid-template-columns: 1fr 1fr;
    align-items: flex-start;
    gap: 10px;
  }

  .cosmic-item .cosmic-icon-wrapper {
    height: 60px;
    margin-bottom: 8px;
  }

  .cosmic-item .fa-sun {
    font-size: 2.5rem;
  }

  .cosmic-item .moon {
    width: 60px;
    height: 60px;
    margin-bottom: 8px;
  }

  .cosmic-item h3 {
    font-size: 1.2rem;
  }

  .cosmic-item p {
    font-size: 0.8rem;
    line-height: 1.4;
  }

  .feature-name {
    font-size: calc(2.2rem * 0.7);
  }

  .final-title {
    font-size: calc(2.2rem * 0.55);
  }

  .final-subtitle {
    font-size: calc(1.1rem * 0.55);
  }

  .countdown {
    gap: 5px;
  }

  .countdown-item {
    padding: 6px;
    min-width: 3rem; 
  }

  .countdown-number {
    font-size: 1.2rem;
  }

  .countdown-label {
    font-size: 0.5rem;
  }

  .love-rain-heart {
    animation-name: rain-fall-fade-halfway-mobile;
  }

  @keyframes rain-fall-fade-halfway-mobile {
    100% {
      transform: translateY(650px) scale(1);
      opacity: 0;
    }
  }

  .gallery-grid.portrait-duo-layout .memory-card {
    flex: 0 0 100%;
    margin-bottom: 4%;
  }

  .gallery-grid.timeline-layout {
    padding: 20px 0;
  }

  .gallery-grid.timeline-layout::before {
    left: 10px;
  }

  .gallery-grid.timeline-layout .memory-card {
    position: static;
    width: calc(100% - 30px);
    margin: 0 0 20px 30px;
  }

  .gallery-grid.timeline-layout .memory-caption {
    text-align: center;
  }
}

@media (max-width: 319px) {
  html {
    font-size: 85%;
  }

  .interactive-container {
    padding: 40px 10px;
  }
  
  .story-container {
    padding: 20px 10px;
  }

  .countdown-item {
    padding: 5px;
  }

  .solar-system, 
  .constellation-container {
    transform: scale(0.8);
  }
}