/* === Fond vidéo en arrière-plan === */
.video-background {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: -1;
}

.video-background video {
  position: absolute;
  top: 50%; left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  filter: brightness(0.8); 
}

/*  Style général */
body {
  position: relative;
  z-index: 0;
  font-family: Arial, sans-serif;
  text-align: center;
  margin: 0;
  padding: 20px;
  background-color: white;
  transition: background-color 0.3s;
  overflow-x: hidden;
}


body.error::before {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(255, 0, 0, 0.5);
  z-index: 10;
  pointer-events: none;
}

/* === Menus === */
#menu, #game, #next-player-screen, #results {
  display: none;
  position: relative;
  z-index: 1;
}

#menu {
  max-width: 600px;
  max-height: 1000px;
  margin: 20px auto;
  background: rgba(255, 255, 255, 0.85);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  text-align: center;
  display: flex;
  flex-direction: column;   
  align-items: center;      
  justify-content: center;  
  height: 60vh; 
}

#next-player-screen, #game, #results {
  max-width: 800px;
  margin: 40px auto;
  background: rgba(255, 255, 255, 0.85);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.form-group {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 15px;
  width: 100%;
  max-width: 500px; 
}

.form-group label {
  width: 35%;         
  text-align: right;  
  margin-right: 10px; 
  font-weight: bold;
  color: #222;
}

.form-group select,
.form-group input[type="number"],
.form-group input[type="text"] {
  width: 60%;          
  padding: 8px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-sizing: border-box;
}



h1, h2 {
  margin-bottom: 20px;
  size: 20px;
  color: #333;
}

/* === Barre d'info === */
.info-bar {
  display: flex;
  justify-content: space-around;
  margin-bottom: 15px;
  font-size: 18px;
  color: #222;
}


input[type="number"], input[type="text"], select {
  padding: 8px;
  margin: 8px 5px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 5px;
  width: 100px;
}

label {
  font-weight: bold;
  margin-right: 10px;
  color: #222;
}


button {
  padding: 12px 24px;
  font-size: 18px;
  margin: 20px 10px 10px 10px;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  background-color: #007bff;
  color: white;
  transition: background-color 0.3s ease;
  box-shadow: 0 4px 6px rgba(0,123,255,0.4);
}

button:hover {
  background-color: #0056b3;
}


#minefield {
  display: grid;
  grid-template-columns: repeat(9, 50px);
  gap: 4px;
  justify-content: center;
  margin: 20px auto;
  user-select: none;
}

.cell {
  width: 50px;
  height: 50px;
  border: 2px solid #777;
  background: linear-gradient(145deg, #ffffff, #129cca);
  font-weight: bold;
  font-size: 24px;
  line-height: 50px;
  text-align: center;
  cursor: pointer;
  border-radius: 8px;
  box-shadow:
    3px 3px 6px #a0aaff88,
    inset 1px 1px 4px #ffffffaa;
  color: #2c3e50;
  transition:
    background 0.3s ease,
    color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.15s ease;
  user-select: none;
}

.cell:hover:not(.revealed):not(.flagged) {
  background: linear-gradient(145deg, #cad4ff, #7f9fff);
  box-shadow:
    4px 4px 8px #8099ffcc,
    inset 1px 1px 5px #d0d8ffdd;
  transform: translateY(-2px);
  color: #1a2a55;
}

.cell:active:not(.revealed):not(.flagged) {
  transform: translateY(1px);
  box-shadow:
    inset 3px 3px 6px #6578ffcc;
  background: linear-gradient(145deg, #7080ff, #4050cc);
  color: white;
}

.cell.revealed {
  background: linear-gradient(145deg, #f8f9fb, #d6dbe9);
  cursor: default;
  box-shadow: inset 2px 2px 6px #b0b8c7;
  color: #222;
  transition: background 0.4s ease, color 0.4s ease;
}

.cell.bomb.revealed {
  background: #ff4c4c;
  color: white;
  box-shadow: 0 0 10px 3px rgba(255, 76, 76, 0.8);
  font-weight: bolder;
}

.cell.flagged {
  background: linear-gradient(145deg, #ffb3b3, #ff6666);
  color: #660000;
  box-shadow: 0 0 8px #ff6666aa;
  font-weight: bolder;
  cursor: pointer;
  transition: background 0.3s ease;
}

.cell.flagged:hover {
  background: linear-gradient(145deg, #ff9999, #ff3333);
  box-shadow: 0 0 12px #ff3333cc;
  color: white;
}


#ranking {
  list-style: none;
  padding: 0;
  font-size: 18px;
  color: #222;
}

#ranking li {
  margin: 10px 0;
}


@media (max-width: 600px) {
  #minefield {
    grid-template-columns: repeat(9, 35px);
  }
  .cell {
    width: 35px;
    height: 35px;
    font-size: 18px;
    line-height: 35px;
  }
}

.top-scores-section {
  margin-top: 20px;
  background: rgba(255, 255, 255, 0.8);
  padding: 10px;
  border-radius: 10px;
}
