h1, h2, h3, .about-title, .features-title, .how-to-play-title {
  margin-top: 0;   /* kill the default space above titles */
}

/* Navbar CSS */
.navbar {
  position: relative;
  top: 0;
  left: 0;
  width: 100%;
  background-color: white;
  border-bottom: 1px solid rgb(154, 154, 154);
  padding: clamp(0.5rem, 2vw, 1rem) clamp(1rem, 4vw, 2rem);;
  text-align: center;
  z-index: 1000;
}

.nav-list {
  list-style: none;
  display: inline-flex;
  font-size: clamp(15px, 25px, 25px);
  gap: clamp(2.5rem, 4vw, 5rem);
  margin: 0;
  padding: 0;
}

.nav-link {
  position: relative;
  text-decoration: none;
  color: #8f8f8f;
  font-weight: 500;
  font-size: clamp(20px, 2vw, 40px);
  gap: clamp(1rem, 4vw, 5rem);
  transition: color 0.3s;
  cursor: pointer;
}

.nav-link:hover {
  color: black;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: linear-gradient(270deg, #d40101, #ffb74c, #0059ff, #d40101);
  background-size: 300% 100%;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.6s ease;
}

.nav-link.active {
  color: black;
  font-weight: 600;
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
  transform-origin: left;
  animation: flashy-gradient 2s linear infinite;
}

@keyframes flashy-gradient {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

/* Hero Section CSS */
.hero-section {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 clamp(1rem, 5vw, 2rem);
  background: #ffffff;
  z-index: 1;
  box-sizing: border-box;
  margin-top: -60px;
}

.hero-title {
  font-size: clamp(5rem, 8vw, 10rem);
  font-weight: 600;
  background: linear-gradient(135deg, #d40101, #ffb74c, #0059ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

.hero-tagline {
  font-size: clamp(1.5rem, 2vw, 6rem);
  font-weight: 500;
  color: black;
  white-space: nowrap;
  overflow: hidden;
  border-right: 2px solid #0059ff;
  width: 0;
  animation: typing 4s steps(28, end) infinite alternate, blink 0.8s step-end infinite;
}

@keyframes typing {
  from { width: 0; }
  to { width: 25ch; }
}

@keyframes blink {
  50% { border-color: transparent; }
  100% { border-color: #0059ff; }
}

/* Hero Section - Start Game button */
.hero-btn {
  display: inline-block;
  margin-top: 1rem;
  padding: clamp(0.65rem, 2vw, 1.2rem) clamp(2rem, 5vw, 2.5rem);
  font-size: clamp(1.5rem, 2vw, 1.5rem);
  font-weight: 600;
  color: white;
  text-decoration: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #f75f5f, #ffb43c, #3499ff);
  background-size: 200% 200%;
  transition: all 0.4s ease, background-position 0.8s ease;
  letter-spacing: 0.5px;
  cursor: pointer;
}

.hero-btn:hover {
  background-position: right center;
  filter: brightness(1.1);
  box-shadow: 0 0 20px rgba(0, 89, 255, 0.6), 
              0 0 40px rgba(255, 183, 76, 0.4),
              0 0 60px rgba(212, 1, 1, 0.3);
}

/* Emojis Background */
.emoji-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  overflow: hidden;
  z-index: -1;
}

.emoji-bg span {
  position: absolute;
  display: inline-block;
  animation-name: floatVertical;
  animation-iteration-count: infinite;
  animation-direction: alternate;
  animation-timing-function: ease-in-out;
  z-index: 0;
  text-shadow: 0 0 6px rgba(0,0,0,0.15);
  font-size: clamp(2rem, 3vw, 3.2rem);
}

/* @keyframes floatCinematic {
  0% {
    transform: translateX(0) translateY(0) rotate(var(--rotate, 0deg)) scale(var(--scale, 1));
    opacity: var(--opacity, 1);
  }
  50% {
    transform: translateX(var(--floatX, 0px)) translateY(var(--floatY, 0px)) 
              rotate(calc(var(--rotate, 0deg) + 5deg)) 
              scale(calc(var(--scale,1) + 0.05));
    opacity: calc(var(--opacity, 1) - 0.1);
  }
  100% {
    transform: translateX(0) translateY(0) rotate(var(--rotate, 0deg)) scale(var(--scale, 1));
    opacity: var(--opacity, 1);
  }
} */

@keyframes floatVertical {
  0%   { transform: translateY(0) rotate(var(--rotate, 0deg)); }
  50%  { transform: translateY(var(--floatY, 25px)) rotate(calc(var(--rotate, 0deg) + 6deg)); }
  100% { transform: translateY(0) rotate(var(--rotate, 0deg)); }
}

@keyframes floatHorizontal {
  0%   { transform: translateX(0) rotate(var(--rotate, 0deg)); }
  50%  { transform: translateX(var(--floatX, 25px)) rotate(calc(var(--rotate, 0deg) - 6deg)); }
  100% { transform: translateX(0) rotate(var(--rotate, 0deg)); }
}

@keyframes floatDiagonal {
  0%   { transform: translate(0, 0) rotate(var(--rotate, 0deg)); }
  50%  { transform: translate(var(--floatX, 20px), var(--floatY, 20px)) rotate(calc(var(--rotate, 0deg) + 8deg)); }
  100% { transform: translate(0, 0) rotate(var(--rotate, 0deg)); }
}

@keyframes floatWave {
  0%   { transform: translate(0, 0) rotate(var(--rotate, 0deg)); }
  25%  { transform: translate(var(--floatX, 15px), 0) rotate(calc(var(--rotate, 0deg) + 5deg)); }
  50%  { transform: translate(0, var(--floatY, 25px)) rotate(calc(var(--rotate, 0deg) - 5deg)); }
  75%  { transform: translate(calc(var(--floatX, 15px) * -1), 0) rotate(calc(var(--rotate, 0deg) + 5deg)); }
  100% { transform: translate(0, 0) rotate(var(--rotate, 0deg)); }
}

/* Random placement + tilt */
/* Apple */
.emoji-bg span:nth-child(1) { top: 18%; left: 6%; --rotate: -10deg; font-size: 2.6rem; }

/* Cake */
.emoji-bg span:nth-child(2) { top: 18%; right: 8%; --rotate: 15deg; font-size: 2.8rem; }

/* Fries */
.emoji-bg span:nth-child(3) { top: 70%; left: 7%; --rotate: -25deg; font-size: 2.8rem; }

/* Carrot */
.emoji-bg span:nth-child(4) { top: 40%; right: 12%; --rotate: 12deg; font-size: 2.7rem; }

/* Drumstick */
.emoji-bg span:nth-child(5) { top: 80%; left: 65%; --rotate: -8deg; font-size: 2.8rem; }

/* Bagel */
.emoji-bg span:nth-child(6) { top: 16%; left: 75%; --rotate: 20deg; font-size: 2.8rem; }

/* Drink */
.emoji-bg span:nth-child(7) { top: 65%; right: 7%; --rotate: -30deg; font-size: 2.6rem; }

/* Vegetable */
.emoji-bg span:nth-child(8) { bottom: 35%; left: 20%; --rotate: 18deg; font-size: 2.7rem; }

/* Ice cream */
.emoji-bg span:nth-child(9) { top: 30%; left: 10%; --rotate: -12deg; font-size: 2.9rem; }

/* Sandwich */
.emoji-bg span:nth-child(10) { bottom: 19%; right: 13%; --rotate: 25deg; font-size: 3rem; }

/* Hamburger */
.emoji-bg span:nth-child(11) { top: 80%; left: 35%; --rotate: -15deg; font-size: 3.2rem; }

/* Potato */
.emoji-bg span:nth-child(12) { bottom: 12%; left: 15%; --rotate: 10deg; font-size: 2.5rem; }

/* Honey */
.emoji-bg span:nth-child(13) { top: 65%; left: 65%; --rotate: -22deg; font-size: 2.4rem; }

/* Fried egg on a pan */
.emoji-bg span:nth-child(14) { top: 15%; left: 45%; --rotate: 5deg; font-size: 2.8rem; }

/* Easter Egg Emojis CSS */
.emoji {
  position: relative;
  cursor: pointer;
  display: inline-block;
}

.emoji::after {
  content: attr(data-quote);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #d40101, #ffb74c, #0059ff);
  color: #fff;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 14px;
  border-radius: 12px;
  white-space: normal;
  max-width: 220px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 20;
  bottom: 120%;
}

.emoji::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 0; 
  height: 0; 
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid linear-gradient(135deg, #d40101, #ffb74c, #0059ff);
  opacity: 0;
  transition: opacity 0.3s;
  bottom: 110%;
}

.emoji:hover::after,
.emoji:hover::before {
  opacity: 1;
  pointer-events: auto;
}

.emoji[data-position="bottom"]::after {
  bottom: auto;
  top: 120%;
}

.emoji[data-position="bottom"]::before {
  bottom: auto;
  top: -6px;
  border-top: none;
  border-bottom: 6px solid linear-gradient(135deg, #d40101, #ffb74c, #0059ff);
}

/* About Section CSS */
.about-section {
  width: 100%;
  min-height: 80vh;
  padding: 1.8rem 2rem;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  overflow-x: hidden;
}

.about-title {
  font-size: clamp(4.5rem, 5rem, 6rem);
  text-align: center;
  background: linear-gradient(135deg, #d40101, #ffb74c, #0059ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.about-card {
  max-width: 950px;
  width: 90%;
  background: linear-gradient(135deg, #fff, #fdfaff);
  padding: 1.5rem 1.5rem;
  border-radius: 1.5rem;
  box-shadow: -6px 8px 20px rgba(0,0,0,0.08);
  line-height: 1.7;
  font-size: clamp(1.0rem, 1.5vw, 1.15rem);
  text-align: left;
  margin-bottom: 4rem;
  box-sizing: border-box;
}


.about-card ul li {
  font-size: clamp(0.95rem, 1.3vw, 2rem);
}

.about-emoji {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  flex-wrap: nowrap;
  width: 100%;
}

@media (max-width: 600px) {
  .about-emoji {
    flex-direction: column; 
    gap: 1.5rem;
  }

  .emoji-card {
    width: 100%;            
    max-width: 350px;
  }
}

.emoji-card {
  flex: 1 1 220px;            /* each card tries to be ~220px but can shrink evenly */
  max-width: 280px;           /* prevents one card from growing too large */
  min-width: 160px;           /* prevents cards from shrinking too much */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  padding: 1.5rem 2rem;
  background: #fff;
  border-radius: 1.2rem;
  box-shadow: 0 6px 14px rgba(0,0,0,0.1);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
  box-sizing: border-box;
}

.emoji-card:hover {
  transform: translateY(-8px) scale(1.05);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.emoji-card .emoji {
  font-size: 2.8rem;
  margin-bottom: 0.3rem;
  animation: bounce 2s infinite ease-in-out;
}

.emoji-title-health {
  color: #ff4d4d;
  font-size: 1.3rem;
  font-weight: 600;
}

.emoji-title-wallet {
  color: #ff9e43;
  font-size: 1.3rem;
  font-weight: 600;
}

.emoji-title-environment {
  color: #00c348;
  font-size: 1.3rem;
  font-weight: 600;
}

.emoji-card p {
  font-size: 0.9rem;
  color: #444;
  margin: 0;
  line-height: 1.4;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.emoji-card h3 {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
}

.emoji-card p {
  font-size: 1rem;
  margin: 0;
}

/* Feature Section CSS */
.features-section {
  padding: 80px 10%;
  text-align: center;
}

.features-title {
  font-size: clamp(4.5rem, 5rem, 6rem);
  text-align: center;
  background: linear-gradient(135deg, #d40101, #ffb74c, #0059ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: clamp(1.5rem, 4vw, 2rem);
}

.features-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
}

.feature-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 2rem;
  width: 100%;
  max-width: 900px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  transition: transform 0.3s, box-shadow 0.3s;
  text-align: center;
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}

/* .feature-icon {
  font-size: 2rem;
  display: inline-block;
  margin-bottom: 1rem;
} */

.feature-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
  color: #222;
}

.feature-info {
  font-size: 1.2rem;
  color: #555;
  line-height: 1.6;
}

/* How to Play Section CSS */
.how-to-play-section {
  width: 100%;
  padding: 4rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #ffffff;
  position: relative;
  box-sizing: border-box;
}

.how-to-play-title {
  font-size: 4.5rem;
  font-weight: 700;
  text-align: center;
  width: 100%;
  background: linear-gradient(135deg, #d40101, #ffb74c, #0059ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 2rem;
}

.how-to-play-container {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  width: 100%;
  max-width: 700px;
  padding-left: 2rem;
  margin: 0 auto;
  box-sizing: border-box;
}

.how-to-play-container::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(135deg, #d40101, #ffb74c, #0059ff);
  border-radius: 2px;
}

.how-to-play-card {
  flex: 1 1 clamp(250px, 30%, 350px);
  position: relative;
  background-color: #ffffff;
  border-radius: 1rem;
  padding: 1.5rem 2rem 1.5rem 4rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
}

.how-to-play-card:hover {
  /* transform: translateY(-6px) scale(1.03); */
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2);
}

.how-to-play-card::before {
  content: attr(data-icon);
  position: absolute;
  left: -48px;
  top: 50%;
  transform: translateY(-50%);
  font-size:clamp(2rem, 4vw, 3rem);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  border: 4px solid transparent;
  background-image: linear-gradient(#ffffff, #ffffff),
    linear-gradient(135deg, #d40101, #ffb74c, #0059ff);
  background-origin: border-box;
  background-clip: content-box, border-box;
}

.how-to-play-step {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
}

.how-to-play-info {
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  line-height: 1.7;
  color: #555555;
}

.start-game-btn {
  display: inline-block;
  margin-top: 1.1rem;
  padding: clamp(0.65rem, 2vw, 1.2rem) clamp(2rem, 5vw, 2.5rem);
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 600;
  color: white;
  text-decoration: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #f75f5f, #ffb43c, #3499ff);
  background-size: 200% 200%;
  transition: all 0.4s ease, background-position 0.8s ease;
  letter-spacing: 0.5px;
  cursor: pointer;
}

.start-game-btn:hover {
  background-position: right center;
  filter: brightness(1.1);
  box-shadow: 0 0 20px rgba(0, 89, 255, 0.6), 
              0 0 40px rgba(255, 183, 76, 0.4),
              0 0 60px rgba(212, 1, 1, 0.3);
}

/* Footer Section CSS */
.footer {
  width: 100%;
  padding: 2rem 2rem;
  border-top: 2px dashed #dcdcdc;
  background-color: #ffffff;
  text-align: center;
  box-sizing: border-box;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.footer p {
  margin: 0 0 1rem;
  font-size: clamp(0.9rem, 2vw, 1.2rem);
  font-weight: 500;
}

.github-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-size: 1rem;
  color: #333;
  transition: color 0.3s;
}

.github-link:hover {
  color: #0059ff;
}

.github-icon {
  width: 24px;
  height: 24px;
  color: #000;
}

/* Back to top button CSS */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: linear-gradient(135deg, #d40101, #ffb74c, #0059ff);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.9) translateY(20px);
  transition: 
    opacity 0.3s ease,
    visibility 0.3s ease,
    transform 0.3s ease,
    box-shadow 0.3s ease;
  z-index: 999;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

.back-to-top:hover {
  transform: scale(1.1) translateY(-6px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.back-to-top::after {
  content: "";
  position: absolute;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(rgba(255, 255, 255, 0.25), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.back-to-top:hover::after {
  opacity: 1;
}

.back-to-top-icon {
  width: 24px;
  height: 24px;
  filter: invert(1);
}

/* Landing page -> game page */
.page-transition {
  animation: fadeOut 0.6s ease forwards;
}

@keyframes fadeOut {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.98); }
}

