:root {
    --bg-dark: #1a1a1a;
    --sidebar-w: 280px;
    --accent: #007bff;
    --text-light: #f4f4f4;
}

body {
    margin: 0;
    display: flex;
    height: 100vh;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    overflow: hidden;
}

/* Overlay plein écran */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* Fond sombre transparent */
    backdrop-filter: blur(8px);    /* Flou d'arrière-plan */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;                /* S'assure qu'il est au-dessus de tout */
}
.modal-overlay .error {
    background: #ff4d4d;
    color: white;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-weight: bold;
}
/* Carte du Pop-up */
.modal-card {
    background: #252525;
    padding: 40px;
    border-radius: 15px;
    width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    text-align: center;
    border: 1px solid #333;
}

.modal-card h2 {
    margin-top: 0;
    color: var(--accent);
}

.modal-card p {
    color: #aaa;
    margin-bottom: 25px;
}

/* Formulaire */
.input-group {
    margin-bottom: 15px;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #444;
    background: #1a1a1a;
    color: white;
    box-sizing: border-box; /* Évite que l'input dépasse */
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Boutons */
.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #444;
    color: white;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
}

.btn-secondary:hover {
    background: #555;
}
.startGamePage{
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.startGamePage button{
    margin: 10px;
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    min-width: 150px;
}
.startGamePage input{
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #444;
    background: #1a1a1a;
    color: white;
    width: 200px;
}
#customObjectiveInput{
    border-radius: 8px 0px 0px 8px;
}
#setCustomObjectiveButton{
    min-width: auto;
    margin-left: 0px;
    border-radius: 0px 8px 8px 0px;
    border: 1px solid #444;
}
#target-page2{
    color: var(--text-light);
    font-weight: bold;
    text-decoration: underline;
    cursor: pointer;
}
.row{
    display: flex;
    flex-direction: row;
    width: 100%;
    justify-content: center;
    align-items: center;
}
.animatedLoader{
    width: 20px;
    height: 20px;
    fill: var(--accent);
    margin-left: 10px;
    cursor: pointer;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
.startGameButton{
    padding: 8px 15px;
    background: var(--accent);
    border-radius: 8px;
    color: white;
    font-weight: bold;
    margin-top: 30px;
    cursor: pointer;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-w);
    background: #252525;
    padding: 20px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #333;
}

.sidebar .logo{

    margin-bottom: 30px;
}

.sidebar .logo h1{
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent);
}

.sidebar .target-box {
    background: #333;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--accent);
    margin-bottom: 20px;
}

.sidebar .target-box strong {
    display: block;
    font-size: 1.2rem;
    margin-top: 5px;
}
.sidebar .playerContainer{
    display: flex;
    flex-direction: column;
}
.sidebar .playerCard{
    background: #333;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}
.playerClicks{
    width: fit-content;
}
.playerNameContainer{
    display: flex;
    justify-content: left;
    width: fit-content;
}
#ownerSVG{
    width: 16px;
    height: 16px;
    fill: #ffd700;
    margin-right: 6px;
    margin-left: 0px;
}
/* Zone de jeu */
.game-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.game-header {
    height: 60px;
    background: #252525;
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-size: 0.9rem;
    color: #888;
}

.wiki-viewport {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    background: #252525;
    margin: 10px;
    border-radius: 8px;
    overflow: scroll;
}

.wiki-viewport iframe {
    width: 100%;
    height: 100%;
}

.timer {
    margin-top: auto;
    font-size: 0.5rem;
    font-family: monospace;
    text-align: center;
    color: var(--accent);
}
#pageContainer{
    display: flex;
    background: linear-gradient(-45deg, #021931, #1a1a1a);
    width: 100%;
    height: 100%;   
    justify-content: center;
}
#pageContainer .winner-page h1{
    color: var(--accent);
    margin-top: 20px;
    font-size: 3rem;
    font-weight: bold;
}

.loader {
  width: 20px;
  height: 20px;
  border: 5px solid #FFF;
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  position: relative;
  animation: pulse 1s linear infinite;
}
.loader:after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 5px solid #FFF;
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  animation: scaleUp 1s linear infinite;
}

@keyframes scaleUp {
  0% { transform: translate(-50%, -50%) scale(0) }
  60% , 100% { transform: translate(-50%, -50%)  scale(1)}
}
@keyframes pulse {
  0% , 60% , 100%{ transform:  scale(1) }
  80% { transform:  scale(1.2)}
}
.winner-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    width: 100%;
    padding: 2rem;
    box-sizing: border-box;
    
    /* 2. CONFIGURATION DU DEGRADÉ ANIME */
    /* On crée un dégradé très large (400%) pour pouvoir le déplacer */
    
    
    font-family: 'Segoe UI', sans-serif;
    color: var(--text-light);
}

/* 3. EFFET DE FLOU POUR RENDRE LE TOUT PLUS DOUX (Optionnel) */
.winner-page::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.2); /* Assombrit légèrement pour la lisibilité */
    z-index: 0;
}

/* On s'assure que le contenu passe au-dessus du pseudo-élément ::before */
.winner-page > * {
    position: relative;
    z-index: 1;
}

/* --- Le reste du code reste identique à ma réponse précédente --- */

.winner-page h1 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    color: white;
    text-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
.winner-page .statDiv{
    padding: 10px 20px;
    background-color: var(--accent);
    font-weight: bold;
    margin: 5px 10px;
    border-radius: 10px;
    color: white;
    border: #87acd3 2px solid;
    min-width: 120px;
    text-align: center;
}

.winner-page ul {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    width: 100%;
    max-width: 600px;
    max-height: 40vh;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px); /* Effet de vitre fumée */
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.winner-page li {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.winner-page li a {
    color: var(--accent);
    text-decoration: none;
}

#restartButton {
    margin-top: 2rem;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    background: var(--accent);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    transition: 0.3s;
}

#restartButton:hover {
    transform: scale(1.05);
    background: white;
    color: var(--accent);
}


/* LOADING ANIMATION */

@keyframes loadingAnimation {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 100% 0;
    }
}

.rowLoading{
    display: flex;
    flex-direction: row;
    width: 100%;
    padding: 20px 0;
}
.loadingContainer {
    display: flex;
    flex-direction: column;
    height: calc(100% - 100px);
    width: calc(100% - 100px);
    padding: 50px ;
}
.loadingTitle {
    width: 300px;
    height: 35px;
    border-radius: 5px;
    background: linear-gradient(90deg, #292929 25%, #3a3a3a 50%, #292929 75%);
    background-size: 200% 100%;
    animation: loadingAnimation 1.5s infinite linear;
    margin: 5px 0;
}
.columnLoadingText{
    display: flex;
    flex-direction: column;
    width: 60%;
}
.loadingText{
    width: 100%;
    height: 150px;
    border-radius: 5px;
    background: linear-gradient(90deg, #292929 25%, #3a3a3a 50%, #292929 75%);
    background-size: 200% 100%;
    animation: loadingAnimation 1.5s infinite linear;
    margin-bottom: 20px;
}
.loadingMenu{
    width: 36%;
    margin-left: 4%;
    height: 650px;
    border-radius: 5px;
    background: linear-gradient(90deg, #292929 25%, #3a3a3a 50%, #292929 75%);
    background-size: 200% 100%;
    animation: loadingAnimation 1.5s infinite linear;

}

#pageLoader{
  width: 100%;
  height: 5px;
  display: inline-block;
  position: relative;
  background: rgba(255, 255, 255, 0.15);
  overflow-x: clip;
}
#pageLoader::after {
  content: '';
  width: 100%;
  height: 5px;
  background: #FFF;
  position: absolute;
  top: 0;
  left: 0;
  box-sizing: border-box;
  animation: animloader 2s linear infinite;
}

@keyframes animloader {
  0% {
    left: 0;
    transform: translateX(-100%);
  }
  100% {
    left: 100%;
    transform: translateX(0%);
  }
}
    