body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  text-align: center;
  padding: 20px;
  min-height: 100vh;
  margin: 0;
  color: #f8f9fa;
  transition: all 0.5s ease;
  padding-top: 60px;
  padding-bottom: 0px;
}

.quiz-container {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  background: #0c1521;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: all 0.5s ease;
  border: 1px solid #4e4e50;
}

h1 {
  color: #f8f9fa;
  margin-bottom: 30px;
  text-shadow: 0 0 10px rgba(78, 84, 200, 0.5);
  position: relative;
}

h1::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 3px;
  background: #4e54c8;
  border-radius: 3px;
  box-shadow: 0 0 10px #4e54c8;
}

.scoreboard {
  display: flex;
  justify-content: space-between;
  margin-bottom: 30px;
  background: rgba(15, 52, 96, 0.7);
  padding: 15px;
  border-radius: 10px;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.3);
  border: 1px solid #4e4e50;
}

.scoreboard p {
  margin: 0;
  font-weight: bold;
  font-size: 1.1rem;
  color: #e2e2e2;
}

#score1, #score2 {
  color: #ff7b7b;
  font-size: 1.3rem;
  text-shadow: 0 0 5px rgba(255, 123, 123, 0.5);
}

#turn {
  color: #7fdbff;
  font-weight: bold;
  text-shadow: 0 0 5px rgba(127, 219, 255, 0.5);
}

#questionBox {
  font-size: 1.2rem;
  margin: 20px 0;
  letter-spacing: -0.2px;
  padding: 20px;
  background: rgba(15, 52, 96, 0.7);
  border-radius: 8px;
  min-height: 60px;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.3);
  border: 1px solid #4e4e50;
  color: #d8e2ee;
}

.answer-options {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 20px 0;
  width: 100%;
}

.answer-option {
  width: calc(100% - 30px);
  padding: 12px 15px;
  margin: 5px 0;
  background: rgba(26, 26, 46, 0.8);
  border: 2px solid #4e4e50;
  border-radius: 8px;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #f8f9fa;
}

.answer-option:hover {
  transform: translateX(5px);
  background: #4e54c8;
  border-color: #4e54c8;
  box-shadow: 0 0 10px rgba(78, 84, 200, 0.5);
}

button {
  padding: 12px 25px;
  margin: 10px 5px;
  cursor: pointer;
  border: none;
  background: #4e54c8;
  color: #fff;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: 0.5s;
}

button:hover::before {
  left: 100%;
}

button:hover {
  background: #6a5acd;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

#resultMsg {
  margin: 20px 0;
  font-weight: bold;
  font-size: 1.1rem;
  min-height: 30px;
  padding: 10px;
  border-radius: 5px;
  transition: all 0.3s;
}

.correct {
  background-color: rgba(46, 125, 50, 0.4);
  color: #a5d6a7;
  animation: correctPulse 0.5s;
}

.incorrect {
  background-color: rgba(198, 40, 40, 0.4);
  color: #ffffff;
  animation: shake 0.5s;
}

.player-active {
  color: #ff6b6b;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes correctPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.7); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); box-shadow: 0 0 20px 10px rgba(46, 125, 50, 0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

@keyframes glow {
  0% { box-shadow: 0 0 5px #4e54c8; }
  50% { box-shadow: 0 0 20px #4e54c8; }
  100% { box-shadow: 0 0 5px #4e54c8; }
}

.pulse {
  animation: pulse 0.5s;
}

/* ✅ Fixed Mobile responsiveness */
@media (max-width: 768px) {
  body {
    padding: 10px;
    padding-top: 40px;
    padding-bottom: 0px;
  }

  .quiz-container {
    padding: 20px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
  }

  .scoreboard {
    flex-direction: column;
    gap: 10px;
  }

  .answer-options {
    padding: 0;
    width: 100%;
  }

  .answer-option {
    width: 100%;
  }

  button {
    width: 100%;
    margin: 8px 0;
  }

  h1 {
    font-size: 1.5rem;
  }

  #questionBox {
    padding: 15px;
    font-size: 1.1rem;
  }
}

@media (max-width: 768px) {
  .scoreboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 10px;
    text-align: center;
  }

  .scoreboard p {
    margin: 0;
  }

  /* Force Turn to go full width below */
  .scoreboard p:nth-child(3) {
    grid-column: 1 / span 2;
    margin-top: 5px;
  }
}

body {
  overflow-y: hidden;
}

@media (max-width: 768px) {
  html, body {
    height: 100vh;
    overflow: hidden; /* prevent scrolling */
    margin: 0;
    padding: 0;
  }

  body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px 10px;
    box-sizing: border-box;
  }

  * {
    max-width: 100%;
    box-sizing: border-box;
  }
}


/* next button */
.next-button {
  background-color: #28a745; /* Green */
  color: white;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 15px;
  transition: background-color 0.3s ease;
}

.next-button:hover {
  background-color: #218838;
}

/* Default: disable body scroll */
html, body {
  height: 100vh;
  margin: 0;
  
  overflow: hidden;
}

/* On devices with height <= 668px, enable vertical scroll */
@media (max-height: 668px) {
  html, body {
    overflow-y: auto;
  }
}


/* added */
/* Result message after game over */
#resultMsg {
  font-size: 1.2em;
  font-weight: bold;
  margin-top: 15px;
}

/* Winner and final score text formatting */
#resultMsg p {
  margin: 6px 0;
}

/* Restart and Main Menu buttons */
#restartBtn,
#mainMenuBtn {
  display: none;
  margin: 10px 8px;
  padding: 10px 20px;
  background-color: #00bb54;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 400;
  font-size: 1em;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#restartBtn:hover,
#mainMenuBtn:hover {
  background-color: #555;
}

/* Optional: correct/incorrect coloring */
.correct {
  color: green;
}

.incorrect {
  color: red;
}


