body {
  font-family: 'Comic Sans MS', cursive, sans-serif;
  background: #FEFBE3;
  text-align: center;
  padding: 20px;
  color: #333;
}

h1 {
  color: #F27021;
  font-size: 5em;
  text-shadow: 2px 2px #fff;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 70px);
  grid-gap: 15px;
  justify-content: center;
  margin-top: 20px;
}

.cell {
  width: 70px;
  height: 70px;
  background: #F4832D;
  border-radius: 20px;
  box-shadow: 0 5px 10px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
  cursor: pointer;
}

.cell:hover {
  transform: scale(1.05);
}

.cell.selected {
  background: #FBC498;
}

.cell.removed {
  background: #E7E5E4;
  cursor: not-allowed;
}

button {
  border: none;
  padding: 10px 20px;
  margin: 10px;
  font-size: 16px;
  border-radius: 12px;
  cursor: pointer;
  color: white;
  font-weight: bold;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

button:hover {
  opacity: 0.9;
}

button:first-of-type {
  background-color: #FEC62B;
}

button:last-of-type {
  background-color: #F4A52D;
}

#status {
  font-size: 1.5em;
  margin: 15px 0;
}

.winner {
  font-size: 2em;
  color: #fff;
  padding: 15px;
  background: linear-gradient(to right, #F27021, #FBC498);
  border-radius: 15px;
  margin-top: 20px;
  box-shadow: 0 0 20px #fff;
  animation: glow 1s ease-in-out infinite alternate;
}

.hidden {
  display: none;
}

#startScreen button {
  font-size: 22px;
  padding: 14px 28px;
}

#modeSelect h2 {
  font-size: 3em;
  color: #F27021;
  margin-bottom: 20px;
}

#notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #F27021;
  color: white;
  padding: 20px 40px;
  border-radius: 15px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  z-index: 1000;
  text-align: center;
  max-width: 80%;
  animation: fadeIn 0.3s ease-out, fadeOut 0.3s ease-in 1.5s forwards;
}

/* Rules Modal Styles */
.rules-btn {
  background-color: #FEC62B !important;
  margin-top: 10px !important;
}

#rulesModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.7);
  z-index: 1001;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#rulesModal.active {
  opacity: 1;
  pointer-events: auto;
}

.rules-content {
  background-color: #FEFBE3;
  padding: 30px;
  border-radius: 15px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 5px 15px rgba(105, 78, 57, 0.959);
  position: relative;
}

.rules-content ol {
  text-align: left;
  margin: 20px 0;
  padding-left: 20px;
}

.rules-content li {
  margin-bottom: 10px;
  font-size: 1.1em;
}

.rules-content button {
  background-color: #F27021 !important;
  margin-top: 20px !important;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -60%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes glow {
  from {
    box-shadow: 0 0 10px #fff;
  }
  to {
    box-shadow: 0 0 25px #fff;
  }
}