
/* =====================================
   GNOME DE CHATEAUROUX
   DESIGN GENERAL
===================================== */

:root {
    --background: #101F38;
    --panel: #172B49;
    --coral: #F5A18F;
    --pink: #F8C4B7;
    --text: #FFFFFF;
    --dark-text: #30252A;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--background);
    color: var(--text);
    font-family: Arial, sans-serif;
    min-height: 100vh;
}


/* =====================================
   ECRAN DE CHARGEMENT
===================================== */

#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;

    display: flex;
    justify-content: center;
    align-items: center;

    background: var(--background);
    transition: opacity 0.6s ease;
}

.loading-content {
    width: 90%;
    max-width: 450px;
    text-align: center;
}

.loading-content h1 {
    color: var(--coral);
    margin: 30px 0 15px;
    font-size: 25px;
    letter-spacing: 2px;
}

.loading-content p {
    color: var(--pink);
    margin-bottom: 15px;
}

/* Illustration du bonnet */

.hat-container {
    width: 220px;
    height: 220px;
    margin: 0 auto 20px;

    display: flex;
    justify-content: center;
    align-items: center;
}

#hat-image {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;

    clip-path: inset(100% 0 0 0);

    transition: clip-path 0.08s linear;
}

#loading-percentage {
    color: var(--coral);
    font-size: 20px;
    font-weight: bold;
}

 
/* =====================================
   BARRE DE NAVIGATION
===================================== */

header {
    background: var(--coral);
    padding: 18px 30px;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.account-buttons {
    margin-left: auto;
    margin-right: 15px;
}

.nav-links,
.account-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar button {
    background: transparent;
    border: none;
    color: var(--dark-text);

    font-size: 15px;
    font-weight: bold;

    cursor: pointer;
    transition: color 0.2s;
}

.navbar button:hover {
    color: white;
}

.logo {
    color: var(--dark-text);
    font-size: 23px;
    font-weight: bold;
}


/* =====================================
   CONTENU PRINCIPAL
===================================== */

main {
    min-height: 75vh;
    padding: 50px 5%;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page h1 {
    margin-bottom: 20px;
}


/* =====================================
   PAGE ACCUEIL
===================================== */

#accueil {
    display: none;

    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    gap: 30px;
}

#accueil.active {
    display: grid;
}

.welcome h1 {
    color: var(--coral);
    font-size: 38px;
    margin-bottom: 20px;
}

.welcome p {
    line-height: 1.7;
}

.mascot {
    text-align: center;
}

#gnome-character {
    font-size: 130px;
    cursor: pointer;
    transition: transform 0.2s;
}

#gnome-character:hover {
    transform: scale(1.1);
}

#gnome-message {
    margin-top: 15px;
    color: var(--pink);
}

.photo-placeholder {
    height: 250px;

    background: var(--panel);
    border: 2px solid var(--coral);
    border-radius: 15px;

    display: flex;
    align-items: center;
    justify-content: center;

    text-align: center;
    margin-top: 20px;
}


/* =====================================
   PIED DE PAGE
===================================== */

footer {
    background: var(--coral);
    color: var(--dark-text);

    text-align: center;
    padding: 25px;

    line-height: 1.8;
}


/* =====================================
   RESPONSIVE - TELEPHONE
===================================== */

@media (max-width: 900px) {

    .navbar {
        flex-wrap: wrap;
    }

    .nav-links {
        flex-wrap: wrap;
    }

    #accueil,
    #accueil.active {
        grid-template-columns: 1fr;
        text-align: center;
    }

}

@media (max-width: 500px) {

    header {
        padding: 15px;
    }

    .nav-links,
    .account-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .welcome h1 {
        font-size: 28px;
    }

    .loading-content h1 {
        font-size: 19px;
    }

}


/* =====================================
   ACCUEIL - THEME BLANC ROSE
===================================== */

#accueil {
    background: #FFF0ED;
    color: #30252A;

    padding: 40px;
    border-radius: 20px;

    min-height: 500px;
}

/* Titre de bienvenue */
#accueil .welcome h1 {
    color: #A84F5B;
}

/* Textes */
#accueil p {
    color: #49363A;
}

/* Message du Gnome */
#accueil #gnome-message {
    color: #A84F5B;
    font-weight: bold;
}

/* Zone des photos */
#accueil .photo-placeholder {
    background: #F9DCD7;
    border: 2px solid #E9A99F;
    color: #49363A;
}

.logo img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    display: block;
}

/* =====================================
   JUMPSCARE DU GNOME
===================================== */

#jumpscare-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: none;
    justify-content: center;
    align-items: center;

    background: black;
}

#jumpscare-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#gnome-character {
    width: 100%;
    max-width: 300px;
    height: 350px;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.2s;
}

#gnome-character:hover {
    transform: scale(1.05);
}

/* =====================================
   JUMPSCARE PLEIN ÉCRAN
===================================== */

#jumpscare-screen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: black;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    overflow: hidden;
}

#jumpscare-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* =====================================
   DIAPORAMA DU GNOME
===================================== */

.slideshow {
    width: 100%;
    max-width: 350px;
    text-align: center;
    background: #F9DCD7;
    border: 3px solid #E9A99F;
    border-radius: 18px;
    padding: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.slideshow img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    transition: opacity 0.6s ease;
}

#slideshow-caption {
    color: #49363A;
    font-weight: bold;
    margin-top: 12px;
    font-size: 15px;
}


/* =====================================
   PAGE JEUX
===================================== */

#jeux {
    padding: 40px;
    min-height: 600px;
}

.games-header {
    text-align: center;
    margin-bottom: 40px;
}

.games-header h1 {
    color: #F5A18F;
    font-size: 36px;
    margin-bottom: 10px;
}

.games-header p {
    color: white;
    font-size: 17px;
}

/* GRILLE DES JEUX */

.games-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: auto;
}

/* CARTE */

.game-card {
    background: #172B49;
    border: 2px solid #29466B;
    border-radius: 18px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* IMAGE PROVISOIRE */

.game-image {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
    font-weight: bold;
    color: white;
    letter-spacing: 3px;
}

.pixelwar-image {
    background: linear-gradient(135deg, #274B8A, #E65D65);
}

.rng-image {
    background: linear-gradient(135deg, #573B91, #D89B50);
}

.gnome-io-image {
    background: linear-gradient(135deg, #237A68, #7BCB76);
}

/* INFORMATIONS */

.game-info {
    padding: 22px;
    text-align: center;
}

.game-info h2 {
    color: #F5A18F;
    margin-bottom: 12px;
}

.game-info p {
    color: white;
    line-height: 1.6;
    min-height: 75px;
}

/* BOUTON JOUER */

.play-button {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 30px;
    background: #F5A18F;
    color: #30252A;
    text-decoration: none;
    font-weight: bold;
    border-radius: 10px;
    transition: background 0.3s ease, transform 0.3s ease;
}

.play-button:hover {
    background: #F8C4B7;
    transform: scale(1.05);
}


/* =====================================
   AUTHENTIFICATION DU SITE PRINCIPAL
===================================== */

.main-user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
    margin-right: 15px;
    color: #30252A;
    font-weight: bold;
}

.main-user-menu button {
    background: transparent;
    border: none;
    color: #30252A;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
}

.main-user-menu button:hover {
    color: white;
}

.main-auth-modal[hidden],
.main-user-menu[hidden] {
    display: none;
}

.main-auth-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: rgba(16, 31, 56, 0.8);
    backdrop-filter: blur(6px);
}

.main-auth-box {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 35px;
    border-radius: 18px;
    background: #FFF0ED;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.main-auth-box h2 {
    margin-bottom: 10px;
    color: #30252A;
    font-size: 27px;
}

.main-auth-box p {
    color: #66545A;
    margin-bottom: 20px;
}

.main-auth-close {
    position: absolute;
    top: 15px;
    right: 18px;
    border: none;
    background: transparent;
    color: #30252A;
    font-size: 22px;
    cursor: pointer;
}

.main-auth-box form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.main-auth-box input {
    width: 100%;
    padding: 13px 15px;
    border: 1px solid #E7B8AD;
    border-radius: 9px;
    background: white;
    color: #30252A;
    font-size: 15px;
}

.main-auth-box form button {
    padding: 13px;
    border: none;
    border-radius: 9px;
    background: #F5A18F;
    color: #30252A;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.main-auth-box form button:hover {
    background: #F8C4B7;
}

#main-auth-switch {
    border: none;
    background: transparent;
    color: #9B514B;
    font-weight: bold;
    cursor: pointer;
}

#main-auth-message {
    margin: 15px 0;
    font-size: 14px;
    overflow-wrap: anywhere;
}


/* =====================================
   ADMINISTRATION - DESIGN
===================================== */

.admin-header {
    text-align: center;
    margin: 35px 0;
}

.admin-header h1 {
    color: var(--dark-text);
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.admin-header p {
    color: #75636a;
}

/* Tableau de bord */

.admin-dashboard {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    max-width: 950px;
    margin: 30px auto;
}

.admin-card {
    background: white;
    padding: 25px;
    border-radius: 18px;
    box-shadow: 0 5px 18px rgba(48, 37, 42, 0.09);
    border: 1px solid #f3d8d1;
    transition: transform 0.2s, box-shadow 0.2s;
}

.admin-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 9px 24px rgba(48, 37, 42, 0.14);
}

.admin-card h2 {
    color: #30252A;
    margin-top: 0;
}

.admin-card p {
    color: #75636a;
}

/* Boutons administration */

.admin-card button,
.admin-content-panel button {
    background: #E99585;
    color: white;
    border: none;
    padding: 11px 18px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.admin-card button:hover,
.admin-content-panel button:hover {
    background: #D97868;
    transform: translateY(-2px);
}

/* Panneau de contenu */

.admin-content-panel {
    max-width: 1000px;
    margin: 35px auto;
    padding: 25px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(48, 37, 42, 0.08);
    border: 1px solid #f3d8d1;
    min-height: 100px;
}

/* Liste des joueurs */

#admin-player-list {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.admin-player-card {
    background: #FFF7F4;
    border: 1px solid #F3D8D1;
    border-radius: 14px;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-player-card h3 {
    margin: 0;
    color: #302526;
}

.admin-player-card p {
    margin: 4px 0;
    color: #75636a;
}

/* Mobile */

@media (max-width: 650px) {
    .admin-dashboard {
        grid-template-columns: 1fr;
    }

    .admin-content-panel {
        margin: 20px 10px;
        padding: 15px;
    }

    .admin-player-card {
        align-items: flex-start;
        flex-direction: column;
    }
}


.admin-back-button {
    margin-bottom: 20px;
}

.admin-role-select {
    padding: 10px 14px;
    border-radius: 9px;
    border: 1px solid #E99585;
    background: white;
    color: #30252A;
    font-weight: bold;
    cursor: pointer;
}

.admin-player-card button {
    background: #E99585;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 9px;
    cursor: pointer;
    font-weight: bold;
}

.admin-player-card button:hover {
    background: #D97868;
}