@font-face {
    font-family: 'Agharti';
    src: url('./AghartiVF.ttf');
}

:root {
    --c-main: #4F28FE;
}

a {
    all: unset;
    cursor: pointer;
}

h2, h3, h4 {
    font-weight: 76;
}

button {
    font-family: 'Agharti', sans-serif;
    font-weight: 76;
    letter-spacing: 1.68px;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #131313;
    font-family: 'Agharti', sans-serif;
    font-style: normal;
    font-weight: 76;
    line-height: normal;
    letter-spacing: 1.68px;
    text-transform: uppercase;
}

#webgl-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
}

.ui-layer {
    position: relative;
    z-index: 1;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    width: 100%;
}

.ui-layer header {
    width: 100%;
    max-width: 1400px;
    margin-top: 5vh;
    padding: 0 40px; /* Évite que ça touche les bords sur grand écran */
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 84;
    font-size: 2.25rem;
}

.ui-layer header svg {
    width: 17.5vh;
}

.ui-layer header span.main {
    color: var(--c-main);
}

.main-content {
    width: 100%;
    max-width: 1400px;
    margin: 4vh auto;
    padding: 0 40px;
    padding-top: 10vh;
    box-sizing: border-box;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Grille principale (Lobby) */
.layout-grid {
    display: flex;
    flex-wrap: wrap; /* Autorise le retour à la ligne si besoin */
    gap: 60px;
    width: 100%;
    align-items: flex-start;
}

.col-left {
    flex: 1 1 350px;
    max-width: 450px;
    display: flex;
    flex-direction: column;
}

.col-right {
    flex: 2 1 500px;
    position: relative;
}

h2.section-title {
    font-size: 1.8rem;
    margin: 0 0 20px 0;
    letter-spacing: 2px;
}

.sub-text {
    font-size: 1.2rem;
    color: #888;
}

/* Liste des joueurs */
#player-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#player-list li {
    border-radius: 8px;
    padding: 16px 20px;
    font-size: 1.4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: background-color 0.3s ease;
}

#start-btn {
    background: var(--c-main);
    color: white;
    border: none;
    padding: 20px;
    font-size: 1.6rem;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    font-family: inherit;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: opacity 0.3s, transform 0.1s;
    box-shadow: 0 5px 15px rgba(79, 40, 254, 0.3);
}

#start-btn:active {
    transform: scale(0.98);
}

#start-btn:disabled {
    background: #242121;
    color: #555;
    cursor: not-allowed;
    box-shadow: none;
}

/* Classement */
#leaderboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
    margin-top: 0;
}
#leaderboard-table th {
    background: transparent;
    color: var(--c-main);
    font-size: 1.2rem;
    text-align: left;
    padding: 0 20px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}
#leaderboard-table td {
    background: #242121;
    padding: 20px;
    font-size: 1.4rem;
}
#leaderboard-table td:first-child {
    border-radius: 8px 0 0 8px;
}
#leaderboard-table td:last-child {
    border-radius: 0 8px 8px 0;
}

.hidden { display: none !important; }

/* ------------------------------------
   ÉCRAN DE JEU
   ------------------------------------ */
#game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Maintient le chrono et le rond bien au centre */
    flex: 1;
    width: 100%;
}

#countdown {
    font-size: 8rem;
    color: var(--c-main);
    text-shadow: 0 0 20px rgba(79,40,254,0.5);
}

/* Carte de révélation */
#reveal-screen {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap; /* S'adapte mieux si la fenêtre est redimensionnée */
    justify-content: center;
    gap: 40px;
    background: #242121;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    max-width: 1000px;
    width: 100%;
    align-items: center;
    text-align: left;
    margin-top: 20px;
}

#reveal-cover {
    width: 100%;
    max-width: 320px;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    object-fit: cover;
}

.reveal-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
    min-width: 300px;
}

#reveal-year {
    font-size: 4.5rem;
    color: var(--c-main);
    margin: 0;
    line-height: 1;
}

#reveal-title {
    font-size: 3rem;
    margin: 0;
    color: #fff;
    line-height: 1.1;
}

#reveal-artist {
    font-size: 2rem;
    color: #888;
    margin: 0;
}

#reveal-winner {
    font-size: 1.5rem;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #333;
    color: var(--c-main);
}

/* Toast pour les erreurs */
#wrong-toast {
    position: fixed;
    bottom: 40px;
    right: 40px;
    background: #ff3b30;
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    font-size: 1.5rem;
    box-shadow: 0 10px 25px rgba(255, 59, 48, 0.4);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 100;
    font-family: 'Agharti', sans-serif;
}
#wrong-toast.show { opacity: 1; }

.modes-grid {
    display: grid;
    /* Règle vitale pour garder de beaux carrés sur un grand écran de PC */
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
    position: relative;
}
.mode-card {
    background-color: #242121;
    border-radius: 8px;
    aspect-ratio: 1 / 1; /* Force le format carré strict */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: rgba(255,255,255,0.2);
    border: 3px solid transparent;
    transition: all 0.2s ease-out;
    font-size: 1.8rem;
    box-sizing: border-box;
}

.mode-card.active {
    border-color: #4F28FE;
    color: white;
}

.layout-single {
    margin: 0 auto;
    width: 100%;
    max-width: 800px; /* Empêche le classement de s'étirer sur toute la largeur */
}
.ranking-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ranking-list li {
    background-color: #242121;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.75rem;
}
.full-width-btn {
    width: 100%;
    background-color: #4F28FE;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 1.75rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: transform 0.1s;
}
.full-width-btn:hover {
    transform: scale(1.02);
}