/* Title Screen Background with title and buttons */
#title-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('https://raw.githubusercontent.com/Bokicraft/Musicforintroduction/main/IMG_0457.jpeg') no-repeat center top;
  background-size: auto 100%; /* fit vertically */
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* move content to top */
  align-items: center;
  padding-top: 40px;
  z-index: 100;
}

/* Title text with flicker */
#title-screen h1 {
  font-size: 50px;
  color: white;
  text-align: center;
  letter-spacing: 6px;
  text-shadow:
    0 0 10px rgba(0,0,0,0.8),
    0 0 20px rgba(0,0,0,0.6),
    0 0 40px rgba(0,0,0,0.4);
  animation: flicker 1.5s infinite;
}

/* Subtitle in black */
#title-screen .subtitle {
  color: black;
  font-size: 24px;
  margin-bottom: 40px;
  text-align: center;
}

/* Buttons with black fill */
#title-screen .start-btn,
#title-screen .credits-btn {
  margin: 10px;
  padding: 15px 50px;
  font-size: 20px;
  letter-spacing: 3px;
  color: white;
  background: black;
  border: 2px solid white;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.3s;
}

#title-screen .start-btn:hover,
#title-screen .credits-btn:hover {
  background: white;
  color: black;
  box-shadow: 0 0 10px white, 0 0 20px white, 0 0 40px white;
}

/* Flicker animation */
@keyframes flicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% { opacity: 1; }
  20%, 22%, 24%, 55% { opacity: 0.3; }
}
/* Flickering letters for title */
.flicker-title {
  font-size: 80px;
  color: white;
  text-align: center;
  letter-spacing: 6px;
  text-shadow:
    0 0 10px rgba(0,0,0,0.8),
    0 0 20px rgba(0,0,0,0.6),
    0 0 40px rgba(0,0,0,0.4);
}

.flicker-title span {
  display: inline-block;
  animation: flicker-letter 1.5s infinite;
}

/* Randomize */
.flicker-title span:nth-child(1) { animation-delay: 0s; }
.flicker-title span:nth-child(2) { animation-delay: 0.1s; }
.flicker-title span:nth-child(3) { animation-delay: 0.2s; }
.flicker-title span:nth-child(4) { animation-delay: 0.3s; }
.flicker-title span:nth-child(5) { animation-delay: 0.05s; }
.flicker-title span:nth-child(6) { animation-delay: 0.15s; }
.flicker-title span:nth-child(7) { animation-delay: 0.25s; }
.flicker-title span:nth-child(8) { animation-delay: 0.35s; }
.flicker-title span:nth-child(9) { animation-delay: 0.12s; }
.flicker-title span:nth-child(10) { animation-delay: 0.22s; }
.flicker-title span:nth-child(11) { animation-delay: 0.32s; }
.flicker-title span:nth-child(12) { animation-delay: 0.42s; }
.flicker-title span:nth-child(13) { animation-delay: 0.18s; }

/* Flicker */
@keyframes flicker-letter {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% { opacity: 1; }
  20%, 22%, 24%, 55% { opacity: 0.2; }
}
/* this is style.css */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@700&display=swap');

html, body {
  margin: 0;
  height: 100%;
  font-family: 'Cinzel', serif;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: radial-gradient(circle at center, #111 0%, #000 100%);
}

h1 {
  margin-top: 60px;
  font-size: 90px;
  color: white;
  text-align: center;
  letter-spacing: 6px;
  text-shadow:
    0 0 10px rgba(255,255,255,0.8),
    0 0 20px rgba(255,255,255,0.6),
    0 0 40px rgba(255,255,255,0.4);
  opacity: 0;
  transform: translateY(-20px);
  animation: fadeIn 2s ease forwards;
}

.subtitle {
  color: #ccc;
  text-align: center;
  margin-top: -20px;
  letter-spacing: 3px;
  opacity: 0;
  animation: fadeIn 3s ease forwards;
}

.start-btn, .credits-btn {
  margin-top: 20px;
  padding: 15px 50px;
  font-size: 20px;
  letter-spacing: 3px;
  color: white;
  background: transparent;
  border: 2px solid white;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: 0.3s;
  opacity: 0;
  animation: fadeIn 4s ease forwards;
}

.start-btn:hover, .credits-btn:hover {
  background: white;
  color: black;
  box-shadow: 0 0 10px white, 0 0 20px white, 0 0 40px white;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Credits */
#credits {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: black;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  z-index: 2000;
}

#credits.show {
  opacity: 1;
  pointer-events: all;
}

#credits button {
  margin-top: 20px;
  padding: 15px 50px;
  font-size: 20px;
  letter-spacing: 3px;
  color: white;
  background: transparent;
  border: 2px solid white;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.3s;
}

#credits button:hover {
  background: white;
  color: black;
  box-shadow: 0 0 20px white;
}

/* Game container */
#game-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: black;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
  z-index: 1000;
}

#game-container.show {
  opacity: 1;
  pointer-events: all;
}

canvas {
  display: block;
  border: 2px solid black;
}

#settings-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s ease, transform 0.2s ease;
  display: none; /* hidden initially */
  z-index: 1500;
}

/* Show button */
#settings-btn.show {
  display: block;
}

/* Hover effects: fade + scale + spin */
#settings-btn:hover {
  opacity: 1;
  transform: scale(1.1) rotate(360deg);
  transition: transform 0.5s ease, opacity 0.2s ease;
}

/* Settings panel */
#settings-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  padding: 20px;
  background: #222;
  color: white;
  border: 2px solid white;
  display: none;
  text-align: center;
  z-index: 2000;
}

#settings-panel button {
  margin-top: 15px;
  padding: 10px 20px;
  cursor: pointer;
}
/* Mute button in bottom-right corner */
#mute-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  cursor: pointer;
  z-index: 2000;
}
/* Popup overlay */
#click-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3000;
}

/* Popup box */
.popup-box {
  background: #111;
  border: 2px solid white;
  padding: 30px;
  text-align: center;
  color: white;
  font-size: 20px;
}

/* Button */
#popup-ok {
  margin-top: 20px;
  padding: 10px 30px;
  font-size: 18px;
  background: transparent;
  border: 2px solid white;
  color: white;
  cursor: pointer;
}

#popup-ok:hover {
  background: white;
  color: black;
}