/* --- FIXED CSS: HIDDEN ON LOAD --- */
#starWarsOverlay {
  display: none; /* Hide everything initially */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  background: black;
}

.star-wars-container {
  display: flex;
  justify-content: center;
  position: relative;
  width: 100%;
  height: 100vh;
  color: #feda4a;
  font-family: 'Mali', sans-serif;
  overflow: hidden;
  perspective: 600px; /* Better width for the top of the text */

  /* Background Image Logic */
  background: black url('/static/images/earth/earth_g1.gif') no-repeat center bottom;
  background-size: cover;
}

.crawl-content {
  position: absolute;
  top: 100%;
  width: 95vw;
  max-width: 1100px;
  left: 50%;
  transform-origin: 50% 100%;
  transform: translateX(-50%) rotateX(20deg);
  text-align: justify;
  /* Animation removed from here */
  color: #feda4a;
  /* Adds a thick black glow around every letter */
font-weight: bold; /* Thicker font helps the shadow look better */

  /* 1. The first 4 lines create a solid 'outline'
     2. The next 4 lines thicken the corners
     3. The last 3 lines create the deep 'glow' */
  text-shadow:
    -2px -2px 0 #000,
     2px -2px 0 #000,
    -2px  2px 0 #000,
     2px  2px 0 #000,
    -3px  0px 0 #000,
     3px  0px 0 #000,
     0px -3px 0 #000,
     0px  3px 0 #000,
     0 0 15px #000,
     0 0 25px #000,
     0 0 35px #000;
}

.crawl-content p {

  /* Option B: Responsive size (Best for mobile) */
  /* Syntax: clamp(minimum, preferred, maximum) */
  font-size: clamp(1.5rem, 4vw, 3rem);

  line-height: 1.5; /* Adds space between lines for better readability */
  margin-bottom: 1.2em; /* Adds space between the dynamic paragraphs */
}


/* This class will be added by JS to start the movement */
:root {
  --crawl-speed: 45s; /* Default value */
}

.run-animation {
  animation: crawl var(--crawl-speed) linear forwards;
}

@keyframes crawl {
  0% { top: 100%; opacity: 1; }
  100% { top: -180%; opacity: 0.5; }
}

/* Fade and Button styles stay the same as your previous working versions */
.fade-overlay {
  position: absolute;
  top: 0; width: 100%; height: 30vh;
  background-image: linear-gradient(to bottom, black, transparent);
  z-index: 10000;
  pointer-events: none;
}

.start-btn {
  position: relative;
  z-index: 10001;
  pointer-events: auto;
  display: block;
  margin: 40px auto;
  padding: 15px 30px;
  background: black;
  border: 2px solid #feda4a;
  color: #feda4a;
  cursor: pointer;
}

.overlay-exit {
  position: fixed;
  left: 50%;
  bottom: 80px;              /* 👈 “little high” from bottom */
  transform: translateX(-50%);

  padding: 0.8rem 2.2rem;
  border-radius: 2.5rem;

  background: linear-gradient(180deg, #3b82f6, #2563eb);
  color: #fff;

  border: none;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;

  cursor: pointer;
  z-index: 9999;

  box-shadow:
    0 10px 25px rgba(37, 99, 235, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.3s ease;
}

/* hover */
.overlay-exit:hover {
  transform: translateX(-50%) translateY(-2px);
  box-shadow:
    0 14px 32px rgba(37, 99, 235, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* active (press) */
.overlay-exit:active {
  transform: translateX(-50%) translateY(1px);
  box-shadow:
    0 6px 14px rgba(37, 99, 235, 0.35);
}

/* hidden state */
.overlay-exit.hidden {
  opacity: 0;
  pointer-events: none;
}
