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

body {
  font-family: 'Indie Flower', cursive;
  background-color: #393E46;
  color: #EEEEEE;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  position: relative;
}

/* --- THE GAME ARENA --- */
.container {
  position: relative;
  width: 90vw;
  max-width: 1000px;
  height: 80vh;
  max-height: 600px;
  background-color: #232931;
  border-radius: 20px;
  box-shadow: 0 2rem 4rem rgba(0, 0, 0, 0.4);
  display: flex; 
  overflow: hidden;
}

/* --- THE PLAYERS --- */
.player {
  flex: 50%; 
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  transition: all 0.5s ease;
}

.player--active {
  background-color: rgba(78, 204, 163, 0.15); 
}

.player--active .name {
  font-weight: bold;
  color: #4ECCA3;
}

.name {
  font-family: 'Lobster', cursive;
  font-size: 3rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1rem;
}

.score {
  font-family: 'Lobster', cursive;
  font-size: 6rem;
  color: #4ECCA3;
  margin-bottom: 3rem;
}

/* --- CURRENT ROUND SCORE BOX --- */
.current {
  background-color: #4ECCA3;
  color: #232931;
  border-radius: 10px;
  padding: 1.5rem 3rem;
  text-align: center;
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.current-label {
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  font-weight: bold;
  font-size: 1.2rem;
}

.current-score {
  font-size: 2.5rem;
}

/* --- THE DICE & CONTROLS --- */
.dice {
  position: absolute;
  left: 50%;
  top: 20%;
  transform: translateX(-50%);
  width: 120px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
  border-radius: 10px;
}

.hidden {
  display: none;
}

.controls {
  position: absolute;
  left: 50%;
  bottom: 10%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.btn {
  background-color: #EEEEEE;
  color: #232931;
  font-family: 'Indie Flower', cursive;
  font-size: 1.5rem;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  padding: 10px 30px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.btn:hover {
  background-color: #4ECCA3;
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

footer {
  position: absolute;
  bottom: 2%;
  color: #EEEEEE;
  font-size: 1.2rem;
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
  .container {
    flex-direction: column; 
    height: 90vh;
  }
  .dice {
    top: 45%;
    width: 80px;
  }
  .controls {
    flex-direction: row;
    bottom: 50%;
    transform: translate(-50%, 50%);
    width: 100%;
    justify-content: center;
  }
  .btn {
    font-size: 1rem;
    padding: 5px 15px;
  }
}


/* --- WINNER STATE --- */
.player--winner {
  background-color: #4ECCA3;
}
.player--winner .name {
  color: #393E46;
}
.player--winner .score {
  color: #393E46;
}

/* --- RULES BUTTON --- */
.btn--rules {
  position: absolute;
  top: 2rem;
  left: 2rem;
}

/* --- MODAL POP-UP --- */
.modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70%;
  max-width: 500px;
  background-color: #393E46;
  color: #EEEEEE;
  padding: 3rem;
  border: 3px solid #4ECCA3;
  border-radius: 15px;
  box-shadow: 0 3rem 5rem rgba(0, 0, 0, 0.5);
  z-index: 10;
  font-family: 'Indie Flower', cursive;
  font-size: 1.3rem;
  line-height: 1.8;
}

.modal h2 {
  font-family: 'Lobster', cursive;
  color: #4ECCA3;
  font-size: 2.5rem;
  margin-bottom: 1rem;
  text-align: center;
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 3rem;
  color: #EEEEEE;
  cursor: pointer;
  border: none;
  background: none;
  transition: color 0.2s;
}

.close-modal:hover {
  color: #4ECCA3;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  z-index: 5;
}