body {
  font-family: 'Poppins', Arial, sans-serif;
  background: linear-gradient(to right, #1e3c72, #3d63bc);
  color: white;
  margin: 0;
  padding-top: 70px;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Styles de base pour le nav */
nav.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #1e1e2f;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

nav.navbar ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: 60px;
}

nav.navbar ul li a {
  display: block;
  padding: 0 20px;
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.3s;
}

nav.navbar ul li a:hover {
  background: rgba(255,255,255,0.1);
}

nav.navbar ul li a.logout-link {
  color: #ff6b6b;
  font-weight: bold;
  border-left: 1px solid rgba(255,255,255,0.1);
}

nav.navbar ul li a.logout-link:hover {
  background: rgba(255,0,0,0.1);
}

nav.navbar ul li a.debug-link {
  color: #4ecdc4;
  font-size: 0.9em;
  border-left: 1px solid rgba(255,255,255,0.1);
}

nav.navbar ul li a.debug-link:hover {
  background: rgba(78,205,196,0.1);
}

nav.navbar .nav-toggle {
  display: none;
}

nav.navbar .burger {
  display: none;
  cursor: pointer;
  padding: 0 20px;
}

nav.navbar .burger div {
  width: 25px;
  height: 3px;
  background: #fff;
  margin: 5px 0;
  transition: all 0.3s;
}

/* Disposition principale */
.container {
  position: absolute;
  left: 50%;
  top: 100px;
  transform: translateX(-50%);
  width: 100%;
  max-width: 800px;
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
  z-index: 1;
}

/* Mini-jeu à gauche */
.game-container {
  position: absolute;
  left: 20px;
  top: 100px;
  width: 25%;
  max-width: 300px;
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
  z-index: 2;
}

/* Styles pour les boutons */
.buttons {
  margin-bottom: 20px;
}

button {
  background-color: #4CAF50;
  border: none;
  color: white;
  padding: 15px 30px;
  margin: 10px;
  font-size: 18px;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.3s;
}

button:hover {
  background-color: #45a049;
}

.status {
  margin-top: 20px;
}

.status-indicator {
  font-weight: bold;
}

.status-indicator.on {
  color: #00ff00;
}

.status-indicator.off {
  color: #ff0000;
}

/* Zone de jeu */
.game-area {
  position: relative;
  width: 100%;
  height: 200px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  margin-bottom: 20px;
  overflow: hidden;
}

.score-display {
  font-size: 18px;
  margin-bottom: 15px;
}

.random-button {
  position: absolute;
  padding: 10px 15px;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: transform 0.1s;
}

.random-button:hover {
  transform: scale(1.1);
}

/* Graphique TPS */
#tpsChart {
  background: #ffffff;
  border: 2px solid #00bcd4;
  border-radius: 20px;
  padding: 20px;
  margin-top: 20px;
  box-shadow: 0 4px 15px rgba(0, 188, 212, 0.4);
  max-width: 100%;
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Tableau des scores */
.scoreboard {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 20px;
  max-height: 300px;
  overflow-y: auto;
}

.scoreboard table {
  width: 100%;
  border-collapse: collapse;
}

.scoreboard th, .scoreboard td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.scoreboard th {
  background: rgba(0, 0, 0, 0.3);
  color: #4CAF50;
}

/* Utilitaires */
.hidden {
  display: none;
}

button.disabled {
  filter: grayscale(100%);
  opacity: 0.5;
  pointer-events: none;
}

/* Login */
.auth-container, .login-container {
  max-width: 400px;
  margin: 100px auto;
  padding: 30px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
  text-align: center;
}

.form-group {
  margin-bottom: 15px;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  color: #ffffff;
}

.form-group input, .login-container input {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.8);
}

.error-message, .login-container .error {
  color: #ff6b6b;
  margin-top: 10px;
}

/* Responsive : écrans moyens */
@media (max-width: 1200px) {
  .container {
    width: 60%;
  }
  
  .game-container {
    width: 30%;
  }
}

/* Responsive : écrans <= 768px */
@media (max-width: 768px) {
  .container, .game-container {
    position: static;
    width: 90%;
    max-width: none;
    margin: 80px auto 20px;
    transform: none;
  }
  
  nav.navbar ul {
    position: fixed;
    top: 60px;
    right: -100%;
    width: 200px;
    flex-direction: column;
    background: #1e1e2f;
    transition: right 0.3s;
    height: auto;
  }

  nav.navbar .burger {
    display: block;
  }

  nav.navbar .nav-toggle:checked ~ ul {
    right: 0;
  }

  nav.navbar .nav-toggle:checked + .burger .line1 {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  nav.navbar .nav-toggle:checked + .burger .line2 {
    opacity: 0;
  }
  
  nav.navbar .nav-toggle:checked + .burger .line3 {
    transform: rotate(-45deg) translate(5px, -5px);
  }
}
