@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

/*  reset & body */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  height: 100%;
  overflow: hidden;
  font-family: 'Poppins', sans-serif;
}

button {
  cursor: pointer;
  transition: 0.3s;
}

/* background & canvas */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: #111;
}

/* hidden class */
.hidden {
  display: none;
}

/* landing page */
.landing {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #0ff;
}

.landing h1 {
  font-size: 3em;
  text-shadow: 0 0 20px #0ff, 0 0 40px #0ff;
  animation: floatGlow 2.5s ease-in-out infinite alternate, fadeIn 1.5s ease forwards;
  opacity: 0;
}

.landing p {
  margin: 10px 0 20px;
  font-size: 1.2em;
  animation: moveRightLeft 3s ease-in-out infinite;
}

.subject-selection {
  text-align: center;
  margin: 20px 0;
}

.subject-selection h2 {
  display: inline-block;
  padding: 12px 25px;
  border: 2px solid #0ff;
  border-radius: 15px;
  background: rgba(0, 255, 255, 0.05);
  color: #0ff;
  font-size: 1.8em;
  font-weight: 700;
  text-shadow: 0 0 5px #0ff, 0 0 15px #0ff;
  box-shadow: 0 0 10px #0ff, 0 0 25px #0ff inset;
  transition: all 0.3s ease-in-out;
  position: relative;
  overflow: hidden;
}

.subject-selection h2::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, rgba(0,255,255,0.2), rgba(0,255,255,0.6), rgba(0,255,255,0.2));
  transform: rotate(0deg);
  animation: rotateGlow 3s linear infinite;
  pointer-events: none;
}

@keyframes rotateGlow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.subject-selection h2:hover {
  color: #111;
  background: rgba(0, 255, 255, 0.2);
  box-shadow: 0 0 20px #0ff, 0 0 50px #0ff inset;
  transform: scale(1.05);
}

.subject-selection button {
  padding: 12px 20px;
  margin: 10px;
  font-size: 1em;
  border-radius: 12px;
  border: none;
  background: #0ff;
  color: #111;
  box-shadow: 0 0 15px #0ff, 0 0 30px #0ff;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}

/* start button */
#start-btn {
  padding: 15px 30px;
  font-size: 1.2em;
  border: none;
  border-radius: 15px;
  background: #0ff;
  color: #111;
  box-shadow: 0 0 20px #0ff, 0 0 40px #0ff;
}

/* hover animations */
@keyframes bounceHover {
  0% { transform: translateY(0) scale(1.1); }
  15% { transform: translateY(-6px) scale(1.12); }
  30% { transform: translateY(4px) scale(1.11); }
  45% { transform: translateY(-4px) scale(1.12); }
  60% { transform: translateY(2px) scale(1.11); }
  75% { transform: translateY(-1px) scale(1.12); }
  100% { transform: translateY(0) scale(1.1); }
}

#start-btn:hover,
.subject-selection button:hover {
  animation: bounceHover 1s ease-in-out infinite;
  box-shadow: 0 0 35px #0ff, 0 0 60px #0ff;
}

/* quiz container */
.quiz-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.85);
  padding: 30px 40px;
  border-radius: 20px;
  box-shadow: 0 0 50px rgba(0,255,255,0.5);
  text-align: center;
  width: 400px;
  color: #fff;
}

.quiz-container h1 {
  color: #0ff;
  text-shadow: 0 0 10px #0ff, 0 0 20px #0ff;
}

/* answer button */
.btn-container button {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 12px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  color: #0ff;
  background: #111;
  box-shadow: 0 0 10px #0ff;
  transition: all 0.3s ease;
}

.btn-container button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px #0ff, 0 0 50px #0ff;
}

.correct {
  background: #2ecc71;
  color: #fff;
  box-shadow: 0 0 20px #2ecc71;
}

.wrong {
  background: #e74c3c;
  color: #fff;
  box-shadow: 0 0 20px #e74c3c;
}

/* timer */
#timer-bar {
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
  overflow: hidden;
  height: 15px;
  margin: 10px 0;
}

#timer-fill {
  height: 100%;
  width: 100%;
  background: #0ff;
  transition: width 1s linear, background 0.5s;
}

/* navigation button */
#next-btn,
#restart-btn {
  margin-top: 15px;
  padding: 12px 18px;
  border-radius: 12px;
  border: none;
  background: #0ff;
  color: #111;
  box-shadow: 0 0 15px #0ff, 0 0 30px #0ff;
}

#next-btn:hover,
#restart-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px #0ff, 0 0 50px #0ff;
}

/* scoreboard */
.scoreboard {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #0ff;
}

.scoreboard h1 {
  font-size: 3em;
  text-shadow: 0 0 20px #0ff;
}

.scoreboard p {
  font-size: 2em;
  margin: 20px 0;
}

.scoreboard button {
  padding: 15px 30px;
  font-size: 1.2em;
  border: none;
  border-radius: 15px;
  background: #0ff;
  color: #111;
  box-shadow: 0 0 20px #0ff, 0 0 40px #0ff;
}

.scoreboard button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 35px #0ff, 0 0 60px #0ff;
}

/* animasi */
.animated {
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.hidden {
  opacity: 0;
  transform: translateY(-50px);
}

/* welcome text */
@keyframes floatGlow {
  0% { transform: translateY(0) scale(1); text-shadow: 0 0 20px #0ff, 0 0 40px #0ff; }
  50% { transform: translateY(-15px) scale(1.05); text-shadow: 0 0 30px #0ff, 0 0 60px #0ff; }
  100% { transform: translateY(0) scale(1); text-shadow: 0 0 20px #0ff, 0 0 40px #0ff; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* move right-left */
@keyframes moveRightLeft {
  0% { transform: translateX(0); }
  25% { transform: translateX(10px); }
  50% { transform: translateX(20px); }
  75% { transform: translateX(10px); }
  100% { transform: translateX(0); }
}
