/* === Global Setup === */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: 'Poppins', 'Segoe UI', sans-serif;
  background: radial-gradient(circle at 50% 50%, #060b23 0%, #000000 100%);
  color: white;
}

/* === Sparkling Star Background === */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: transparent url('https://raw.githubusercontent.com/JulianLaval/canvas-particle-animation/master/images/stars.png') repeat;
  animation: moveStars 200s linear infinite, starDrift 60s ease-in-out infinite alternate;
  z-index: -2;
  opacity: 0.45;
}

@keyframes moveStars {
  from { background-position: 0 0; }
  to { background-position: -4000px 4000px; }
}

@keyframes starDrift {
  0% { transform: scale(1) translate(0%, 0%); }
  50% { transform: scale(1.05) translate(2%, -2%); }
  100% { transform: scale(1.1) translate(-1%, 3%); }
}

/* === Section Layout === */
section {
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  text-align: center;
}

/* === Intro Screen === */
#intro-screen {
  background: radial-gradient(circle at center, #0a1931, #000);
  color: #fff;
  animation: fadeIn 3s ease;
}

#intro-screen h1 {
  font-size: 2.8rem;
  letter-spacing: 2px;
  text-shadow: 0 0 25px rgba(173, 216, 255, 0.8);
}

#intro-screen p {
  max-width: 650px;
  font-size: 1.2rem;
  line-height: 1.6;
  margin: 1.2rem auto;
  color: #d3d9ff;
}

#start-button {
  margin-top: 2rem;
  padding: 1rem 2.2rem;
  font-size: 1.2rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(90deg, #00d4ff, #5f2c82);
  color: white;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(0, 213, 255, 0.5);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#start-button:hover {
  transform: scale(1.08);
  box-shadow: 0 0 35px rgba(0, 213, 255, 0.9);
}



/* === Scene Titles (Scenes 1–4) === */
#poem-word-title {
  font-size: 2.8rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow:
    0 0 15px rgba(255, 255, 255, 0.6),
    0 0 30px rgba(100, 200, 255, 0.5),
    0 0 45px rgba(0, 150, 255, 0.4);
  animation: cosmicGlow 6s ease-in-out infinite alternate;
  margin-bottom: 1.2rem;
  z-index: 5;
}

@keyframes cosmicGlow {
  0% {
    text-shadow:
      0 0 15px rgba(255, 255, 255, 0.5),
      0 0 35px rgba(100, 200, 255, 0.4),
      0 0 55px rgba(0, 120, 255, 0.3);
    transform: scale(1);
  }
  100% {
    text-shadow:
      0 0 25px rgba(255, 255, 255, 0.8),
      0 0 55px rgba(150, 220, 255, 0.7),
      0 0 90px rgba(0, 200, 255, 0.6);
    transform: scale(1.05);
  }
}


/* Floating words as glowing stars */
#floating-words-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.floating-word {
  position: absolute;
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 0 10px #58a6ff, 0 0 20px #58a6ff;
  transition: transform 0.4s ease, text-shadow 0.3s ease, color 0.3s ease;
  cursor: pointer;
}

.floating-word:hover {
  transform: scale(1.4);
  text-shadow: 0 0 20px #00d4ff, 0 0 40px #00d4ff;
}

.floating-word.zoomed {
  transform: scale(2.3);
  z-index: 10;
  text-shadow: 0 0 35px #fff, 0 0 60px #00d4ff;
}

/* === Poem Screen – Cosmic Animated Background === */
#poem-screen {
  position: relative;
  width: 100vw;
  height: 100vh;
  background-color: #000;
  transition: opacity 2s ease-in-out;
  overflow: hidden;
  z-index: 1;
}

/* === Scene 1 – Indigo Nebula === */
@keyframes nebulaBlue {
  0%   { background-color: #1e1758; }
  25%  { background-color: #2a2374; }
  50%  { background-color: #342b8f; }
  75%  { background-color: #29216a; }
  100% { background-color: #1e1758; }
}

/* === Scene 2 – Violet Aurora === */
@keyframes nebulaViolet {
  0%   { background-color: #2d145d; }
  25%  { background-color: #3a1b7a; }
  50%  { background-color: #462297; }
  75%  { background-color: #34186a; }
  100% { background-color: #2d145d; }
}

/* === Scene 3 – Magenta Nebula === */
@keyframes nebulaCyan {
  0%   { background-color: #4a0f3e; }
  25%  { background-color: #5e1252; }
  50%  { background-color: #751567; }
  75%  { background-color: #3c0b32; }
  100% { background-color: #4a0f3e; }
}

/* === Scene 4 – Crimson Supernova === */
@keyframes nebulaGreen {
  0%   { background-color: #520914; }
  25%  { background-color: #6b0c1c; }
  50%  { background-color: #820f22; }
  75%  { background-color: #3a060f; }
  100% { background-color: #520914; }
}



/* === Gentle moving overlay for subtle cosmic light === */
#poem-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.05), transparent 70%);
  opacity: 0.2;
  mix-blend-mode: overlay;
  animation: driftGlow 14s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

@keyframes driftGlow {
  0% { transform: translate(-5%, 0%) scale(1); opacity: 0.1; }
  50% { transform: translate(5%, 2%) scale(1.05); opacity: 0.25; }
  100% { transform: translate(-5%, 0%) scale(1); opacity: 0.1; }
}

#close-info-button {
  margin-top: 1rem;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.2rem;
  color: white;
  cursor: pointer;
  transition: all 0.5s ease;
}

/* === Scene 1 – Indigo === */
.word-info-blue #close-info-button {
  background: #4033a2;
  box-shadow: 0 0 15px rgba(64, 51, 162, 0.6);
}
.word-info-blue #close-info-button:hover {
  background: #6254c9;
  box-shadow: 0 0 25px rgba(98, 84, 201, 0.9);
}

/* === Scene 2 – Violet === */
.word-info-violet #close-info-button {
  background: #581eb7;
  box-shadow: 0 0 15px rgba(88, 30, 183, 0.6);
}
.word-info-violet #close-info-button:hover {
  background: #6723d5;
  box-shadow: 0 0 25px rgba(103, 35, 213, 0.9);
}

/* === Scene 3 – Magenta === */
.word-info-magenta #close-info-button {
  background: #830b67;
  box-shadow: 0 0 15px rgba(196, 17, 155, 0.5);
}
.word-info-magenta #close-info-button:hover {
  background: #a40e81;
  box-shadow: 0 0 25px rgba(255, 60, 190, 0.9);
}

/* === Scene 4 – Crimson === */
.word-info-red #close-info-button {
  background: #890522;
  box-shadow: 0 0 15px rgba(206, 7, 51, 0.6);
}
.word-info-red #close-info-button:hover {
  background: #ce0733;
  box-shadow: 0 0 25px rgba(255, 70, 100, 0.9);
}


#word-info {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(10, 20, 40, 0.85);
  border: 1px solid #444;
  border-radius: 15px;
  padding: 2rem 3rem;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.05);
  display: none;
  text-align: center;
  max-width: 80%;
  z-index: 10;
  transition: all 1s ease;
}

#word-info h2, #word-info p {
  transition: color 1s ease, text-shadow 1s ease;
}
/* === Scene 1 – Indigo === */
.word-info-blue {
  border-color: #4033a2;
  box-shadow: 0 0 25px rgba(64, 51, 162, 0.5);
}
.word-info-blue h2 { color: #8c84ff; text-shadow: 0 0 10px #4b3bbe; }
.word-info-blue p  { color: #cfd2ff; }

/* === Scene 2 – Violet === */
.word-info-violet {
  border-color: #581eb7;
  box-shadow: 0 0 25px rgba(88, 30, 183, 0.5);
}
.word-info-violet h2 { color: #b694ff; text-shadow: 0 0 10px #6723d5; }
.word-info-violet p  { color: #e2d6ff; }

/* === Scene 3 – Magenta === */
.word-info-magenta {
  border-color: #830b67;
  box-shadow: 0 0 25px rgba(196, 17, 155, 0.4);
}
.word-info-magenta h2 { color: #ff8ad7; text-shadow: 0 0 12px #c4119b; }
.word-info-magenta p  { color: #ffd6f0; }

/* === Scene 4 – Crimson === */
.word-info-red {
  border-color: #890522;
  box-shadow: 0 0 25px rgba(206, 7, 51, 0.4);
}
.word-info-red h2 { color: #ff9aa7; text-shadow: 0 0 12px #ce0733; }
.word-info-red p  { color: #ffe0e3; }


#close-info-button {
  margin-top: 1rem;
  background: #00d4ff;
  border: none;
  color: white;
  border-radius: 8px;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.3s ease;
}

#close-info-button:hover {
  transform: scale(1.1);
  background: #00bcd4;
}

/* === Navigation Buttons === */
#navigation-buttons {
  position: absolute;
  bottom: 4%;
  display: flex;
  gap: 1rem;
}

#navigation-buttons button {
  background: rgba(255, 255, 255, 0.1);
  color: #00eaff;
  border: 1px solid #00eaff;
  border-radius: 8px;
  padding: 0.7rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  text-shadow: 0 0 8px #00eaff;
  transition: all 0.3s ease;
}

#navigation-buttons button:hover {
  background: #00eaff;
  color: #000;
  box-shadow: 0 0 15px #00eaff;
}


/* === Final Page (Galaxy Scene) === */
#final-page {
  display: none;
  flex-direction: column;
  justify-content: flex-start;  /* 👈 Align content to the top */
  align-items: center;           /* Center horizontally */
  background: radial-gradient(circle at 50% 50%, #020c1b, #000);
  color: #ffffff;
  overflow: hidden;
  position: relative;
  height: 100vh;
  padding-top: 3rem;             /* Space from top edge */
  text-align: center;
}



/* === Final Page Title (Magical Reveal) === */
#final-poem-title {
  font-size: 3rem;
  font-weight: 600;
  letter-spacing: 2px;
  color: #ffffff;
  text-shadow:
    0 0 20px rgba(255, 255, 255, 0.6),
    0 0 40px rgba(0, 200, 255, 0.4),
    0 0 80px rgba(120, 180, 255, 0.3);
  opacity: 0;
  transform: scale(0.95);
  animation: magicalReveal 3s ease forwards, starPulse 6s ease-in-out infinite alternate 3s;
}

/* === Magical fade-in from cosmic light === */
@keyframes magicalReveal {
  0% {
    opacity: 0;
    transform: scale(0.8);
    text-shadow:
      0 0 5px rgba(255, 255, 255, 0.2),
      0 0 15px rgba(0, 180, 255, 0.1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
    text-shadow:
      0 0 40px rgba(255, 255, 255, 0.6),
      0 0 80px rgba(0, 200, 255, 0.4);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    text-shadow:
      0 0 25px rgba(255, 255, 255, 0.8),
      0 0 60px rgba(120, 180, 255, 0.6),
      0 0 100px rgba(0, 200, 255, 0.5);
  }
}

/* === Gentle breathing glow after reveal === */
@keyframes starPulse {
  0% {
    text-shadow:
      0 0 25px rgba(255, 255, 255, 0.8),
      0 0 60px rgba(120, 180, 255, 0.6);
  }
  100% {
    text-shadow:
      0 0 35px rgba(255, 255, 255, 1),
      0 0 100px rgba(120, 200, 255, 0.8);
  }
}


/* Message below title */
#final-message {
  margin-top: 1rem;
  backdrop-filter: blur(8px);
  animation: fadeIn 2s ease;
  max-width: 650px;
}

#final-message p {
  font-size: 1.2rem;
  color: #d6e9ff;
  line-height: 1.6;
  text-shadow: 0 0 10px rgba(100, 200, 255, 0.3);
  margin-bottom: 1.5rem;
  letter-spacing: 0.5px;
}

/* Restart button below message */
#restart-button {
  background: linear-gradient(90deg, #5f2c82, #49a09d);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 0 25px rgba(79, 207, 255, 0.6);
  transition: transform 0.3s ease, background 0.4s ease;
  z-index: 2;
}

#restart-button:hover {
  transform: scale(1.1);
  background: linear-gradient(90deg, #49a09d, #5f2c82);
}

/* Floating translations fill the rest of the screen */
#scrolling-translations-container {
  position: absolute;
  top: 25%; /* 👈 starts below your text + button */
  width: 100%;
  height: 75%;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}


.translation {
  position: absolute;
  bottom: -10%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  white-space: nowrap;
  color: #bde0fe;
  font-size: 1.2rem;
  text-shadow: 0 0 15px #00d4ff;
  animation: scrollUpFade 10s linear forwards;
}

/* === Final Page Animation (Star Twinkle Fade) === */
@keyframes scrollUpFade {
  0%   { bottom: -10%; opacity: 0; text-shadow: 0 0 5px #00d4ff; }
  20%  { opacity: 1; text-shadow: 0 0 20px #00ffff; }
  50%  { opacity: 1; text-shadow: 0 0 30px #bde0fe; }
  80%  { opacity: 0.5; text-shadow: 0 0 15px #00d4ff; }
  100% { bottom: 55%; opacity: 0; text-shadow: 0 0 5px #00d4ff; }
}

/* === Restart Button === */
#restart-button {
  margin-top: 2rem;
  background: linear-gradient(90deg, #5f2c82, #49a09d);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 0 25px rgba(79, 207, 255, 0.6);
  transition: transform 0.3s ease, background 0.4s ease;
}

#restart-button:hover {
  transform: scale(1.1);
  background: linear-gradient(90deg, #49a09d, #5f2c82);
}

/* === Generic Fade Animation === */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}



/* === Copyright Footer === */
#copyright {
  position: fixed;
  bottom: 10px;
  left: 15px;
  font-size: 0.9rem;
  color: rgba(200, 220, 255, 0.6);
  letter-spacing: 0.5px;
  font-family: 'Poppins', 'Segoe UI', sans-serif;
  z-index: 9999;
  text-shadow: 0 0 8px rgba(100, 180, 255, 0.3);
  transition: opacity 0.4s ease;
}

#copyright:hover {
  color: #b8d8ff;
  opacity: 1;
  text-shadow: 0 0 12px rgba(140, 200, 255, 0.8);
}





