* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
  font-family: Arial, sans-serif;
  background: linear-gradient(180deg, hsl(231 46 12), hsl(254 60 17), hsl(270 60 23), hsl(335 100 75));
  color: white;
}

button {
  padding: 15px 25px;
  border: none;
  border-radius: 15px;
  font-size: 1rem;
  cursor: pointer;
  background: #ffcc00;
  transition: 0.3s;
  font-weight: bold;
}

button:hover {
  transform: scale(1.08);
}

.next-btn {
  font-size: 2rem;
  width: fit-content;
  background: white;
}

.container {
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

.panel {
  height: 100vh;
  scroll-snap-align: start;

  h2 {
    margin-block-start: 2em;
  }
}

section {
  padding: 80px 20px;
  text-align: center;
  min-height: 100vh;

  &:not(.final-message) {
    display: grid;
    grid-template-rows: 1fr auto;
    justify-items: center;
  }
}

.section-content-wrapper {
  display: grid;
  justify-items: center;
  align-content: center;
}

/* --- HERO SECTION --------------------------------------------------------- */
.glow {
  font-size: 4rem;
  animation: glow 2s infinite alternate;
}

@keyframes glow {
  from {
    text-shadow: 0 0 10px #fff;
  }

  to {
    text-shadow:
      0 0 20px #ff0,
      0 0 40px #ff00ff;
  }
}

.hero h2 {
  font-size: 2rem;
}

.section h2 {
  font-size: 2.5rem;
}

.name {
  text-decoration-line: underline;
  text-decoration-style: wavy;
  text-decoration-color: #ffd93d;
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
  transition:
    color 0.3s ease,
    text-shadow 0.3s ease;
  cursor: pointer;
}

.name:hover {
  color: #ffe66d;
  text-shadow: 0 0 10px rgba(255, 255, 150, 0.8);
}

.traits-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 4rem;
  padding-inline: 2em;
  max-width: 800px;
  position: relative;
  top: 50px;
  opacity: 0;
  transition:
    opacity 0.5s ease,
    top 0.5s ease;
}

.section-content-wrapper:has(.name:hover) .traits-container {
  opacity: 1;
  top: 0;
  transition:
    opacity 0.5s ease,
    top 0.5s ease;
}

.trait-chip {
  padding: 14px 22px;
  border-radius: 999px;
  background: hsl(0 0 100 / 0.5);
  border: 2px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  font-size: 1rem;
  font-weight: bold;
  color: white;
  transition:
    transform 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease;
  cursor: default;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 1em;
}

.emoji-wrapper {
  font-size: 1.5rem;
  position: relative;

  &::before {
    content: "";
    position: absolute;
    inset: 0;
    width: 120%;
    height: 120%;
    transform: translate(-7.5%, -7.5%);
    background: white;
    z-index: -1;
    border-radius: 9999px;
  }
}

/* --- CANDLES SECTION ------------------------------------------------------ */
.cake-container {
  margin-block: 2em;
  width: 800px;
}

.candles {
  display: flex;
  justify-content: space-evenly;
  gap: 32px;
  padding-top: 10px;
  min-width: 100%;
}

.candle:first-of-type {
  margin-inline-start: 32px;
}
.candle:last-of-type {
  margin-inline-end: 32px;
}

.flame {
  width: 40px;
  height: 40px;
  background: linear-gradient(-45deg, yellow, orange, red);
  border-radius: 100% 100% 0% 100%;
  transform: rotate(-135deg);
  box-shadow:
    0 0 20px 2px hsl(16 100 50 / 0.5),
    0 0 60px 10px hsl(16 100 50 / 0.5);
  animation: flicker 0.5s infinite alternate;
}

.candle-stem {
  width: 20px;
  height: 120px;
  background: white;
  margin-inline: auto;
}

@keyframes flicker {
  0% {
    transform: rotate(-135deg) scale(1);
    opacity: 0.8;
  }
  100% {
    transform: rotate(-135deg) scale(1.2);
    opacity: 1;
  }
}

.cake {
  width: 100%;
  height: 30vh;
  display: grid;
  grid-template-rows: 10% 35% 20% 35%;
  border-radius: 16px;
  overflow: hidden;
}

.layer-one {
  background-color: white;
}
.layer-two,
.layer-four {
  background-color: pink;
}
.layer-three {
  background-color: white;
}

#blowCandlesBtn {
  width: fit-content;
  background: hsl(230 50 10);
  color: white;
}

/* --- GAME ----------------------------------------------------------------- */
#gameArea {
  width: 800px;
  max-width: 700px;
  height: 400px;
  margin-inline: auto;
  margin-top: 30px;
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  border: 4px solid white;
  background: linear-gradient(to bottom, #1b1b3a, #2a2a72);
}

#player {
  width: 70px;
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  user-select: none;
  pointer-events: none;
}

.enemy {
  position: absolute;
  width: 50px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
}

p {
  margin-top: 20px;
  font-size: 1.2rem;
  font-weight: bold;
}

#startGameBtn {
  margin-top: 20px;
}

#gameMessage {
  font-size: 2rem;
}

#score {
  font-size: 1.5rem;
}

/* --- MESSAGE -------------------------------------------------------------- */
.final-message {
  max-width: 800px;
  margin-inline: auto;
  display: grid;
  align-content: center;
  gap: 4em;

  p {
    font-size: 1.5rem;
  }

  h2 {
    margin: 0;
  }

  h3 {
    font-size: 2rem;
  }
}

/* --- UTILITIES ------------------------------------------------------------ */
.hidden {
  display: none !important;
}
.visibility-hidden {
  visibility: hidden;
}
