
/* --- CSS LOBBY et ROOM PART --- */

/* Centrage et conteneur de la section */
#play .section-body {
max-width: 960px;
margin: 0 auto;
padding: 30px 20px;
}

#hostSettingsModal {
    display: flex; 
    position: fixed; 
    top: 0px; 
    left: 0px; 
    width: 100%; 
    height: 100%; 
    background: rgba(0, 0, 0, 0.5); 
    z-index: 1000; 
    align-items: center; 
    justify-content: center;
}

#hostSettingsHolder {
    background-color: light-dark(#ffffff, #464646);
    padding: 25px;
    border-radius: 8px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

#nicknameBox {
    background: light-dark(#f7f7f5, #333333);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

/* Blocs Formulaire & Liste */
.create-session-box, .session-list-box {
    background-color: light-dark(#ffffff, #464646);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.create-session-box h3, .session-list-box h3 {
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-size: 28px;
    font-weight: 500;
    color: var(--nav-link-color); /* #8cc63f */
    margin-top: 0;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--nav-link-color);
    padding-bottom: 6px;
}

/* Formulaire de création */
.form-group {
    display: flex;
    gap: 12px;
}

.form-group input {
    flex: 1;
    padding: 10px 16px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-title);
    color: var(--nav-link-color); /* #8cc63f */
    font-family: 'Open Sans', sans-serif;
    font-size: 15px;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input::placeholder {
    color: #a0a0a0;
    font-weight: 400;
}

.form-group input:focus {
    border-color: var(--nav-link-color);
    box-shadow: 0 0 0 3px rgba(140, 198, 63, 0.2);
    background-color: light-dark(#ffffff, #464646);
}

/* Tableau stylisé */
.session-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 10px;
    text-align: left;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.session-table th {
    background-color: var(--bg-title);
    color: var(--nav-link-color); /* #8cc63f */
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-size: 22px;
    font-weight: 600;
    padding: 12px 16px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.session-table td {
    padding: 14px 16px;
    color: var(--nav-link-color); /* #8cc63f */
    font-size: 15px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    background-color: light-dark(#ffffff, #464646);
    transition: background-color 0.2s ease;
}

.session-table tr:last-child td {
    border-bottom: none;
}

/* Alignement centré sur les chiffres */
.session-table th:nth-child(2), .session-table td:nth-child(2),
.session-table th:nth-child(3), .session-table td:nth-child(3),
.session-table th:nth-child(4), .session-table td:nth-child(4),
.session-table th:nth-child(5), .session-table td:nth-child(5) {
    text-align: center;
}

.session-table th:last-child, .session-table td:last-child {
    text-align: right;
}

/* Effet Hover sur la ligne */
.session-table tbody tr:hover td {
    background-color: #f7fbf0; /* Fond vert très léger au survol */
}

/* Boutons (Vert Bla5t) */
.btn-primary, .btn-join {
    background-color: var(--nav-link-color);
    color: #ffffff;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-size: 20px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.btn-primary:hover, .btn-join:hover {
    background-color: var(--nav-link-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary:active, .btn-join:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Badges de statut */
.badge {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    margin-left: 8px;
    display: inline-block;
    vertical-align: middle;
}

.badge.waiting {
    background-color: #eaf5d8;
    color: #4b7a13;
    border: 1px solid #8cc63f;
}

.badge.started {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.loading-text, .empty-text {
    color: var(--nav-link-color); /* #8cc63f */
    font-style: italic;
    padding: 10px 0;
}

/* Animation de rotation pour le sablier */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hourglass-spin {
    display: inline-block;
    animation: spin 2s linear infinite;
    margin-left: 5px;
}

/* Animation de pulsation bi-couleur (Rouge <-> Vert) */
@keyframes pulse-ready {
    0% {
        background-color: #d9534f; /* Rouge pastel */
        box-shadow: 0 0 4px rgba(217, 83, 79, 0.4);
    }
    50% {
        background-color: #5cb85c; /* Vert pastel */
        box-shadow: 0 0 12px rgba(92, 184, 92, 0.7);
    }
    100% {
        background-color: #d9534f; /* Rouge pastel */
        box-shadow: 0 0 4px rgba(217, 83, 79, 0.4);
    }
}

/* Classe active tant que le joueur n'a pas cliqué */
.btn-pulse-waiting {
    animation: pulse-ready 2.5s infinite ease-in-out;
    color: #ffffff !important;
    transition: all 0.3s ease;
}

/* État fixe quand le joueur EST prêt (Vert fixe) */
.btn-ready-active {
    background-color: #5cb85c !important;
    color: #ffffff !important;
    box-shadow: none;
}
.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    filter: grayscale(80%);
}

.btn-start-active {
    opacity: 1 !important;
    cursor: pointer !important;
    filter: grayscale(0%) !important;
    box-shadow: 0 0 10px rgba(43, 108, 176, 0.6);
    animation: pulse-start 1.5s infinite;
}

@keyframes pulse-start {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

/* --- Bouton Superviseur / Spectateur --- */
.btn-supervisor {
    background-color: #17a2b8;
    color: #ffffff;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.25);
}

.btn-supervisor:hover {
    background-color: #138496;
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.35);
    transform: translateY(-1px);
}

.btn-supervisor:active {
    background-color: #117a8b;
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center;
}

.modal-title {
    margin-top: 0;
    color: #e53e3e;
    font-size: 1.25rem;
}

.modal-body-text {
    color: #4a5568;
    margin: 16px 0 24px 0;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    justify-content: center;
}

/* Conteneur global de l'en-tête */
.lobby-header-wrapper {
    width: 100%;
    margin-bottom: 20px;
}

/* Image bannière plein bloc */
.lobby-banner-container {
    width: 100%;
    max-height: 360px;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    margin-bottom: 15px;
}

.lobby-banner-img {
    width: 100%;
    height: 360px;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Barre d'actions (Titre à gauche/centre, Boutons à droite) */
.lobby-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.lobby-header-title {
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-size: 32px;
    color: var(--nav-link-color);
    margin: 0;
    line-height: 1.2;
}

/* Groupe de boutons à droite */
.lobby-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-lobby-action {
    padding: 8px 16px;
    border-radius: 6px;
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-size: 18px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-lobby-action:hover {
    transform: translateY(-1px);
}

.btn-back {
    background-color: #4a5568;
    color: #ffffff;
}

.btn-back:hover {
    background-color: #2d3748;
}

.btn-leave {
    background-color: #d9534f;
    color: #ffffff;
}

.btn-leave:hover {
    background-color: #c9302c;
}

/* Adaptation Mobile */
@media (max-width: 600px) {
    .lobby-header-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .lobby-header-actions {
        justify-content: center;
        width: 100%;
    }

    .btn-lobby-action {
        flex: 1;
    }
}
