/* Import 8-bit font */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* Reset & base */
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family: 'Arial', sans-serif; line-height:1.6; background:#121212; color:#f5f5f5; }

/* Preloader Styles */
#preloader {
  display: flex; 
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(-45deg, #121212, #002b40, #121212, #0a3a4a);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  z-index: 9999;
  transition: opacity 0.75s ease;
  justify-content: center;
  align-items: center;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* --- LOADER STYLES --- */
.loader-container {
  width: 300px;
  max-width: 90%;
  text-align: center;
  position: absolute;
  top: 50%;
  left: 50%;
  /* This is where JavaScript adds the floating offset */
  transform: translate(-50%, -50%); 
}

.loader-text {
  font-size: 1rem;
  font-weight: bold;
  /* Red color and glow */
  color: #ff4d4d; 
  text-transform: uppercase;
  margin-bottom: 1rem;
  animation: 
    floatText 3s ease-in-out infinite,
    glowText 2.5s infinite alternate;
  font-family: 'Press Start 2P', system-ui;
  line-height: 1.4; 
}

/* Red glow for loading text */
@keyframes glowText {
  0% { text-shadow: 0 0 10px rgba(255, 77, 77, 0.6), 0 0 20px rgba(255, 77, 77, 0.4); } 
  50% { text-shadow: 0 0 18px rgba(255, 77, 77, 0.8), 0 0 36px rgba(255, 77, 77, 0.6); }
  100% { text-shadow: 0 0 12px rgba(255, 77, 77, 0.7), 0 0 24px rgba(255, 77, 77, 0.5); }
}

.loader-bar-container {
  width: 100%;
  height: 10px;
  background: #333;
  border-radius: 5px;
}

.loader-bar {
  width: 0%; 
  height: 100%;
  background: linear-gradient(90deg, #00bfff, #1da1f2, #00ffff);
  border-radius: 5px;
  animation: load 10s linear forwards;
  animation-play-state: paused; 
  position: relative;
}

/* Loader GIF */
.loader-gif {
  position: absolute;
  right: 0; 
  bottom: 8px; 
  width: 50px; 
  height: 50px;
  transform: translateX(50%); 
  z-index: 10; 
}

/* SPARK SHOWER EFFECT */
.spark {
  position: absolute;
  top: 50%;
  right: -2px; 
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  background: #fff;
  border-radius: 50%;
  opacity: 0;
  box-shadow: 
    0 0 10px 2px #fff,
    0 0 15px 5px #00ffff;
  animation: fall-spark 1s linear infinite;
  animation-play-state: paused; 
  z-index: 9; 
}

.spark:nth-child(1) {
  animation-duration: 1.1s;
  animation-delay: 0.1s;
}
.spark:nth-child(2) {
  animation-duration: 0.9s;
  animation-delay: 0.3s;
}
.spark:nth-child(3) {
  animation-duration: 1.2s;
  animation-delay: 0.6s;
}
.spark:nth-child(4) {
  animation-duration: 0.8s;
  animation-delay: 0.8s;
}
.spark:nth-child(5) {
  animation-duration: 1.1s;
  animation-delay: 1.0s;
}
.spark:nth-child(6) {
  animation-duration: 0.9s;
  animation-delay: 1.2s;
}
.spark:nth-child(7) {
  animation-duration: 1.2s;
  animation-delay: 1.4s;
}
.spark:nth-child(8) {
  animation-duration: 0.8s;
  animation-delay: 1.5s;
}


@keyframes fall-spark {
  0% {
    opacity: 1;
    transform: translateY(-50%) translateX(0); 
  }
  50% {
    opacity: 1; 
  }
  100% {
    opacity: 0; 
    transform: translateY(40px) translateX(-10px); 
  }
}
/* END SPARKS STYLES */


@keyframes load {
  0% { width: 0%; }
  100% { width: 100%; }
}

@keyframes floatText {
  0% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
  100% { transform: translateY(0); }
}


/* This class will be added by JS when loading is done */
body.loaded .hero {
  opacity: 1; /* Show hero section */
}

body.loaded #preloader {
  opacity: 0; /* Fade out preloader */
  visibility: hidden; /* Hide it completely after fade */
}


/* Hero Section */
.hero {
  position: relative;
  display:flex;
  flex-direction:column;
  justify-content:center; 
  align-items:center;
  height:100vh;
  text-align:center;
  padding: 2rem 1rem;
  overflow: hidden;
  background:#121212;
  color:#f5f5f5;
  
  /* Start hidden, will be shown by JS */
  opacity: 0; 
  transition: opacity 5s ease;
}

/* FLOATING SHAPES BACKGROUND */
@keyframes float-shape {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.7;
  }
  100% {
    transform: translateY(-110vh) rotate(720deg);
    opacity: 0;
  }
}

#shape-background {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.shape {
  position: absolute;
  display: block;
  width: 80px;
  height: 80px;
  background: rgba(0, 191, 255, 0.2);
  border-radius: 50%;
  filter: blur(20px);
  box-shadow: 0 0 20px rgba(0, 191, 255, 0.3),
              0 0 40px rgba(0, 191, 255, 0.2);
  bottom: -150px; 
  animation: float-shape 25s linear infinite;
}

.shape:nth-child(1) {
  left: 10%;
  width: 80px; height: 80px;
  animation-duration: 25s;
  animation-delay: 0s;
}
.shape:nth-child(2) {
  left: 20%;
  width: 50px; height: 50px;
  animation-duration: 18s;
  animation-delay: 2s;
}
.shape:nth-child(3) {
  left: 35%;
  width: 120px; height: 120px;
  animation-duration: 30s;
  animation-delay: 4s;
}
.shape:nth-child(4) {
  left: 50%;
  width: 70px; height: 70px;
  animation-duration: 22s;
  animation-delay: 1s;
}
.shape:nth-child(5) {
  left: 65%;
  width: 90px; height: 90px;
  animation-duration: 28s;
  animation-delay: 6s;
}
.shape:nth-child(6) {
  left: 80%;
  width: 60px; height: 60px;
  animation-duration: 20s;
  animation-delay: 3s;
}
.shape:nth-child(7) {
  left: 90%;
  width: 100px; height: 100px;
  animation-duration: 26s;
  animation-delay: 7s;
}
/* END FLOATING SHAPES */


.hero h1, .hero p, .hero .hero-buttons, .note-text, .visitor-counter { 
  position: relative; 
  z-index: 1; 
}

.hero-title {
  font-size:3.2rem;
  margin-bottom:1rem;
  font-weight:bold;
  
  background: linear-gradient(90deg, #00bfff, #1da1f2, #00ffff, #1da1f2, #00bfff);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  
  animation: shimmer 4s infinite linear;
  
  font-family: 'Press Start 2P', system-ui;
  line-height: 1.2;
}

@keyframes shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.hero-tagline {
  font-size:1.5rem;
  margin-bottom:2rem;
  font-weight:bold;
  text-transform:uppercase;
  animation: pulse 2s infinite alternate;
}

@keyframes pulse {
  0% { opacity:0.8; }
  50% { opacity:1; }
  100% { opacity:0.8; }
}

/* Hero Buttons Container */
.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: nowrap; 
  flex-direction: row;
}

/* CTA Buttons */
.cta-btn {
  position: relative;
  padding: .75rem 1.5rem;
  background: #00bfff;
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  border-radius: 50px;
  transition: all .3s ease, box-shadow .3s ease, transform .3s ease;
  animation: pulseGlow 2.5s infinite alternate;
  display:flex;
  align-items:center;
  justify-content: center; 
}

/* Button Content Wrappers */
.btn-content {
  display: flex;
  align-items: center;
  gap: 0.5rem; 
}
.btn-countdown {
  display: none;
  font-size: 1.2rem;
  font-weight: bold;
}


/* Droplet Animation */
.click-emoji {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 1.5rem;
  opacity: 1;
  z-index: 10; 
  transform: translate(-50%, -50%); 
  animation: splash-out 2.5s ease-out forwards;
}

@keyframes splash-out {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.5) rotate(0deg);
    text-shadow: 0 0 8px rgba(0,191,255,0.6);
  }
  50% {
    opacity: 1;
    transform: translate(var(--splash-x), var(--splash-y)) scale(1.2) rotate(var(--rotation));
    text-shadow: 0 0 18px rgba(0,191,255,0.8), 0 0 36px rgba(0,191,255,0.6);
  }
  100% {
    opacity: 0;
    transform: translate(var(--splash-x), calc(var(--splash-y) - 40px)) scale(1.2) rotate(var(--rotation));
    text-shadow: 0 0 10px rgba(0,191,255,0);
  }
}
/* END */


@keyframes pulseGlow {
  0% { box-shadow: 0 0 10px rgba(0,191,255,0.6), 0 0 20px rgba(0,191,255,0.4); }
  50% { box-shadow: 0 0 18px rgba(0,191,255,0.8), 0 0 36px rgba(0,191,255,0.6); }
  100% { box-shadow: 0 0 12px rgba(0,191,255,0.7), 0 0 24px rgba(0,191,255,0.5); }
}

.cta-secondary { 
  background:#1da1f2; 
  animation: pulseGlowX 2.5s infinite alternate; 
}

@keyframes pulseGlowX {
  0% { box-shadow: 0 0 10px rgba(29,161,242,0.6), 0 0 20px rgba(29,161,242,0.4); }
  50% { box-shadow: 0 0 18px rgba(29,161,242,0.8), 0 0 36px rgba(29,161,242,0.6); }
  100% { box-shadow: 0 0 12px rgba(29,161,242,0.7), 0 0 24px rgba(29,161,242,0.5); }
}

/* FIX: Button Logo Consistency */
.btn-logo { 
  width: 24px; 
  height: 24px; 
  padding: 1px;
}
.hero-buttons a:nth-child(1) .btn-logo {
    transform: scale(1.2); 
}
/* END FIX */

/* Note text */
.note-text { 
  font-size:0.75rem; 
  font-weight:bold; 
  margin-top:1rem; 
  color:#00ffff; 
  display:inline-block; 
  background:rgba(0,0,0,0.2); 
  padding:0.3rem 0.5rem; 
  border-radius:5px; 
  text-transform:uppercase; 
  line-height:1.2; 
  text-align:center;
  max-width:90vw; 
  word-wrap:break-word;
}

/* NEW: Visitor Counter Style */
.visitor-counter {
  font-size: 0.9rem;
  margin-top: 2rem;
  color: #00ffff;
  position: relative;
  z-index: 1;
  font-family: 'Press Start 2P', system-ui;
  text-shadow: 0 0 5px rgba(0, 255, 255, 0.4);
}
#unique-visitors {
  color: #fff;
  margin-left: 0.5rem;
}
/* END NEW */

/* Fade-in animation */
.fade-in {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}
.fade-in.visible { opacity:1; transform: translateY(0); }

/* Responsive */
@media(max-width:768px) { 
  .hero-title { font-size:2.5rem; }
  .hero-tagline { font-size:1.2rem; }
  .note-text { font-size:0.65rem; }
}