body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    text-align: center;
}
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #222;
    padding: 10px 20px;
    color: white;
}

.nav-links {
    display: flex;
    gap: 10px;
}
.nav-links button,.nav-links a button {
    background: #333;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    text-align: center;
}


nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

nav ul li {
    margin: 0 10px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    background: #444;
    border-radius: 5px;
}

nav ul li a.active {
    background: #777;
}

button {
    background-color: #333;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
}




.nav-links .active {
    background: #888;
}

.game-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 20px;
}

.style-selector {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}

.chess-board img {
    width: 300px;
    height: auto;
    border: 5px solid #222;
    border-radius: 10px;
}

.move-list {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    width: 250px;
}

.move-list h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

#moves-history {
    list-style-position: inside;
    padding-left: 10px;
}

#moves-history li {
    margin-bottom: 8px;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

#moves-history li:nth-child(odd) {
    background-color: #f5f5f5;
}

#moves-history li:hover {
    background-color: #e9e9e9;
}

#moves-history .white-move {
    color: #333;
}

#moves-history .black-move {
    color: #555;
    font-weight: bold;
}

#moves-history .capture {
    color: #d32f2f;
}

.game-controls {
    margin-top: 15px;
}

.control-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.control-btn:hover {
    background-color: #45a049;
}

#chessBoard {
  display: grid;
  grid-template-columns: repeat(8, 50px);
  grid-template-rows: repeat(8, 50px);
  gap: 0;
}

.square {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.piece {
 font-size: 30px;
}

.style {
    width: 250px;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 5px;
}

select {
    width: 100%;
    padding: 5px;
    margin-bottom: 10px;
    border-radius: 5px;
}

.style-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px;
    border: 1px solid #ccc;
    margin: 5px 0;
    border-radius: 5px;
}

.color-box {
    width: 20px;
    height: 20px;
    margin-right: 5px;
}

.edit-icon {
    cursor: pointer;
}

#styleEdit {
    cursor: pointer;
}

#styleCreate {
    margin-top: 10px;
    background: #00aaff;
    color: white;
    padding: 8px;
    cursor: pointer;
    border-radius: 5px;
}

.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    width: 400px;
    height: 400px;
    padding: 20px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    display: none; /* La popup est cachée par défaut */
    z-index: 1000;
}
  
.popup-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
  
.close-button {
    cursor: pointer;
    font-size: 20px;
    align-self: flex-end;
}

/* Style pour les boutons dans la popup */
.popup-content button {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#saveButton {
    background: #00aaff;
    color: white;
}

#cancelButton {
    background: #888;
    color: white;
}

/* Styles uniformisés avec accueil.css */
.auth-buttons button {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background: #333;
    color: white;
    width: 100%;
    text-align: center;
}

.auth-buttons .register {
    background: #00aaff;
    color: white;
    
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
}

.auth-buttons img {
    width: 35px;
    height: 35px; 
    object-fit: cover; 
    border-radius: 50%;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
}
/* Uniform button styling */
.nav-links button,
.nav-links a button,
.nav-links a {
    display: inline-block;
    background: #333;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    font-size: 16px;
    text-decoration: none;
    width: auto; /* Allow natural width */
    min-width: 100px; /* Ensure minimum width for consistent look */
}

.nav-links .active {
    background: #888;
}

/* Ensure all buttons in navbar have consistent sizing */
.navbar button,
.navbar a button {
    padding: 10px 15px;
    margin: 0;
}
/* Media Queries pour echec.css */
@media screen and (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 10px;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
        align-items: center;
      
        margin-bottom: 10px;
    }

    .nav-links button {
        width: 100%;
        text-align: center;
    }
    .auth-buttons a button{
        flex-direction: column;
        width: 100%;
        text-align: center;

    }

    .game-container {
        flex-direction: column;
        gap: 15px;
        padding: 10px;
    }

    #chessBoard {
        grid-template-columns: repeat(8, 40px);
        grid-template-rows: repeat(8, 40px);
        margin: 0 auto;
    }

    .square {
        width: 40px;
        height: 40px;
    }

    .style {
        width: 100%;
        max-width: 300px;
    }

    .move-list {
        width: 100%;
        max-width: 300px;
        max-height: 200px;
    }

    .popup {
        width: 90%;
        max-width: 350px;
        height: auto;
    }
}
.camera-box video {
    width: 100%;
    max-height: 300px;
    border: 2px solid #ddd;
    border-radius: 10px;
    margin-bottom: 1em;
  }
  .avatar-box img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #ccc;
    margin-bottom: 1em;
  }
/* Uniformisation des boutons dans la navbar et auth-buttons */
.navbar button,
.navbar a button,
.nav-links button,
.nav-links a button,
.auth-buttons button {
    min-width: 120px;
    max-width: 180px;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 15px;
    font-size: 16px;
    border-radius: 5px;
    background: #333;
    color: white;
    border: none;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s, color 0.2s;
}

.navbar .register,
.auth-buttons .register {
    background: #00aaff;
    color: white;
}

.navbar button.active,
.nav-links .active {
    background: #888;
    color: white;
}

.navbar button:disabled,
.auth-buttons button:disabled {
    background: #ccc;
    color: #888;
    cursor: not-allowed;
}
#logged {
    display: none;
}
#unlogged {
    display: none;
}
body.logged #logged {
    display: flex !important;
}
body.logged #unlogged {
    display: none !important;
}
body.unlogged #logged {
    display: none !important;
}
body.unlogged #unlogged {
    display: flex !important;
}
@media (max-width: 600px) {
    .navbar button,
    .navbar a button,
    .nav-links button,
    .nav-links a button,
    .auth-buttons button {
        min-width: 100px;
        font-size: 14px;
        padding: 8px 10px;
    }
}