@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;700;900&family=Press+Start+2P&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #73c2ed;
  /* Light sky blue */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  overflow: hidden;
  font-family: 'Outfit', sans-serif;
  color: #fff;
}

#gameWrapper {
  position: relative;
  width: auto;
  height: 100%;
  aspect-ratio: 1 / 1.28;
  max-width: 100vw;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #73c2ed;
}

#ui {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'Outfit', sans-serif;
}

#score {
  margin-top: 1vh;
  color: #fff;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 900;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
  letter-spacing: 1px;
}

#energyContainer {
  width: 40%;
  max-width: 200px;
  height: 16px;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid #fff;
  border-radius: 8px;
  margin-top: 5vh;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

#energyFill {
  width: 100%;
  height: 100%;
  background: #00ff00;
  transition: width 0.1s linear, background-color 0.3s;
}

#questionModal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  color: #333;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  flex-direction: column;
  align-items: center;
  z-index: 100;
  width: 85%;
  max-width: 400px;
  pointer-events: all;
  display: flex;
}

#questionModal.hidden {
  display: none !important;
}

#questionModal h2 {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  margin-bottom: 25px;
  text-align: center;
  line-height: 1.4;
}

.options-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
}

.optionBtn {
  background: #73c2ed;
  color: #fff;
  border: none;
  padding: 15px;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  border-radius: 10px;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  box-shadow: 0 4px 0 #4da8da;
  transition: transform 0.1s, box-shadow 0.1s;
}

.optionBtn:active {
  transform: translateY(4px);
  box-shadow: none;
}

#overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(115, 194, 237, 0.9);
  backdrop-filter: blur(4px);
  pointer-events: all;
}

#overlay h1 {
  font-family: 'Press Start 2P', monospace;
  color: #fff;
  font-size: clamp(1.5rem, 4vw, 3rem);
  text-shadow: 4px 4px 0 #000;
  text-align: center;
  line-height: 1.5;
  margin: 20px 0;
}

#overlay p {
  color: #e2e8f0;
  font-size: clamp(1rem, 2.5vw, 1.8rem);
  text-align: center;
  line-height: 1.8;
  margin-bottom: 20px;
  font-weight: 700;
  letter-spacing: 1px;
}

#startBtn {
  pointer-events: all;
  background: #ff5252;
  color: #fff;
  border: 4px solid #fff;
  padding: 18px 48px;
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(1rem, 2vw, 1.5rem);
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 0 #b71c1c;
  transition: all 0.1s ease;
  margin-top: 20px;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 #b71c1c;
}

#startBtn:hover {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #b71c1c;
  background: #ff1744;
}

#startBtn:active {
  transform: translateY(4px);
  box-shadow: none;
}

#bestScore {
  font-family: 'Press Start 2P', monospace;
  color: #fbbf24;
  font-size: clamp(0.8rem, 2vw, 1.2rem);
  text-align: center;
  margin-top: 20px;
  text-shadow: 2px 2px 0 #000;
}

#title-bird {
  height: clamp(80px, 15vw, 150px);
  width: auto;
  object-fit: contain;
  animation: bob 0.8s ease-in-out infinite alternate, glow 2s ease-in-out infinite alternate;
}

@keyframes bob {
  from {
    transform: translateY(-10px) rotate(-5deg);
  }

  to {
    transform: translateY(10px) rotate(5deg);
  }
}

@keyframes glow {
  from {
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.4));
  }

  to {
    filter: drop-shadow(0 0 30px rgba(251, 191, 36, 0.8));
  }
}

.game-over-icon {
  font-size: clamp(4rem, 10vw, 8rem);
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {

  0%,
  100% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(-10deg);
  }

  75% {
    transform: rotate(10deg);
  }
}