* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  color: #fff;
  text-align: center;
  min-height: 100vh;
  padding: 2rem;
}

h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.4);
}

h2 {
  font-size: 1.4rem;
  margin-top: 2rem;
  opacity: 0.9;
  line-height: 1.5;
}

.scoreboard {
  display: flex;
  justify-content: center;
  gap: 40px;
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

.scoreboard span {
  font-weight: bold;
}

#start-btn {
  padding: 12px 25px;
  font-size: 1.2rem;
  font-weight: bold;
  background-color: #34495e;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#start-btn:hover {
  background-color: #2c3e50;
}

.btn-container {
  display: grid;
  grid-template-columns: repeat(2, 160px);
  gap: 25px;
  justify-content: center;
  margin-top: 2rem;
}

.btn {
  height: 160px;
  width: 160px;
  border-radius: 20px;
  border: 6px solid #fff;
  font-size: 1.8rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  transition: transform 0.1s ease, box-shadow 0.3s ease;
  user-select: none;
}

.btn:active {
  transform: scale(0.96);
}

.red {
  background-color: #e74c3c;
}
.green {
  background-color: #2ecc71;
}
.yellow {
  background-color: #f1c40f;
  color: #000;
}
.purple {
  background-color: #9b59b6;
}

.flash {
  animation: flashAnim 0.3s ease;
  background-color: #ecf0f1 !important;
}
.userflash {
  animation: flashAnim 0.3s ease;
  background-color: #1abc9c !important;
}

@keyframes flashAnim {
  0% { opacity: 1; }
  50% { opacity: 0.4; }
  100% { opacity: 1; }
}

body.game-over {
  background-color: #e74c3c !important;
  animation: shake 0.3s;
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  50% { transform: translateX(10px); }
  75% { transform: translateX(-10px); }
  100% { transform: translateX(0); }
}

/* Rules Button */
.btn-rules {
  padding: 10px 20px;
  font-size: 16px;
  margin-top: 1rem;
  background-color: #444;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.btn-rules:hover {
  background-color: #666;
}

/* Modal Styling */
.modal {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(4px);
  background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
  background-color: #fff;
  padding: 2rem;
  border-radius: 10px;
  max-width: 400px;
  text-align: left;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  position: relative;
}

.modal-content h2 {
  margin-bottom: 1rem;
}

.modal-content ul {
  padding-left: 1.2rem;
}

.modal-content li {
  margin-bottom: 0.5rem;
}

/* Close Button */
.close {
  position: absolute;
  right: 16px;
  top: 8px;
  font-size: 24px;
  cursor: pointer;
}

/* Hide Modal Initially */
.hidden {
  display: none;
}


