* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
  background-color: #424242;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

/* --- START SCREEN --- */
#start-screen {
  text-align: center;
  animation: fadeIn 0.5s ease-in;
}

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

#play-btn {
  padding: 15px 50px;
  font-size: 1.5rem;
  font-weight: bold;
  background-color: #00e640;
  color: #111;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0, 230, 64, 0.4);
  transition: transform 0.2s;
}

#play-btn:hover { transform: scale(1.05); }

/* --- GAME SCREEN --- */
#game-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

#game-container {
  position: relative;
  width: 85vmin; 
  height: 85vmin;
  min-width: 280px;
  min-height: 280px;
  max-width: 500px;
  max-height: 500px;
  border-radius: 50%;
  background-color: #232323;
  padding: 4%;
  box-shadow: 0 0 20px rgba(0,0,0,0.9);
  display: flex;
  flex-wrap: wrap;
  gap: 4%;
}

/* Button Styles */
.color-btn {
  width: 48%;
  height: 48%;
  border: none;
  cursor: pointer;
  opacity: 0.8; 
  transition: all 0.1s;
}

#green { background-color: #00ff00; border-top-left-radius: 100%; }
#red { background-color: #ff0033; border-top-right-radius: 100%; }
#yellow { background-color: #FFEA00; border-bottom-left-radius: 100%; }
#blue { background-color: #009dff; border-bottom-right-radius: 100%; }

.color-btn.active {
  opacity: 1;
  transform: scale(0.98);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.8), 0 0 20px rgba(255, 255, 255, 0.5);
  filter: brightness(1.3);
}

/* Center Logo */
#game-container::after {
  content: "SIMON";
  font-family: 'Arial Black', sans-serif;
  font-weight: 900;
  font-size: 5vmin; 
  letter-spacing: 1px;
  color: #fff;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 35%;
  height: 35%;
  background-color: #181818;
  border-radius: 50%;
  border: 1.5vmin solid #232323;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

#game-status {
  margin-top: 20px;
  text-align: center;
}

.my-text {
  font-size: 1.2rem;
  margin: 5px 0;
}

/* --- POPUP MODAL STYLES --- */
#modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85); /* Dark background */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  
  /* Smooth Fade In for background */
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none; /* Click through when hidden */
}

/* Class to trigger fade in */
#modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

#modal-box {
  background-color: #333;
  padding: 30px;
  border-radius: 15px;
  text-align: center;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  border: 2px solid #555;
  
  /* Start slightly smaller for pop effect */
  transform: scale(0.8);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Bouncy effect */
}

/* Class to trigger pop up */
#modal-overlay.show #modal-box {
  transform: scale(1);
}

#modal-title {
  color: #00e640;
  margin-bottom: 10px;
}

#modal-message {
  margin-bottom: 20px;
  font-size: 1.1rem;
  color: #ddd;
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#primary-btn, #secondary-btn {
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
}

#primary-btn {
  background-color: #00e640;
  color: #000;
}

#secondary-btn {
  background-color: #ff3333;
  color: #fff;
}

/* Fake Ad Spinner */
.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 10px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

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