:root {
    --crea-purple: #7141FF;
    --comm-yellow: #FFFF00;
    --dev-blue: #5BE2FF;
    --bg-dark: #000000;
    --text-dark: #000000;
    --text-light: #FFFFFF;
}

body {
    background: var(--bg-dark);
    color: var(--text-light);
    font-family: 'Arial Black', 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    text-transform: uppercase;
}

/* Header style "Post-Internet" */
.game-header {
    background: var(--text-light);
    color: var(--bg-dark);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid var(--bg-dark);
}

h1 { margin: 0; font-size: 1.2rem; letter-spacing: -1px; }

/* Structure du logiciel */
.editor {
    display: grid;
    grid-template-columns: 320px 1fr;
    grid-template-rows: 1fr 200px;
    height: calc(100vh - 60px);
    gap: 4px;
    background: var(--bg-dark);
}

/* Bibliothèque - Pôle CRÉA */
.library {
    grid-row: 1 / 3;
    background: var(--crea-purple);
    padding: 20px;
    display: flex;
    flex-direction: column;
    border-right: 4px solid var(--bg-dark);
}

.library label { color: white; margin-bottom: 10px; font-size: 0.8rem; }

select {
    background: var(--bg-dark);
    color: white;
    border: none;
    padding: 10px;
    font-family: inherit;
    margin-bottom: 20px;
}

.draggable-item {
    background: white;
    color: var(--bg-dark);
    padding: 15px;
    margin-bottom: 10px;
    font-weight: 900;
    cursor: grab;
    border: 3px solid var(--bg-dark);
    transition: transform 0.1s;
}

.draggable-item:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0px var(--bg-dark);
}

/* Zone de Visualisation - Pôle COMM */
.workspace {
    background: var(--comm-yellow);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.player-zone {
    background: black;
    border: 4px solid var(--bg-dark);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#game-feedback {
    background: var(--bg-dark);
    color: var(--comm-yellow);
    padding: 10px;
    text-align: center;
    font-size: 0.8rem;
}

.actions {
    display: flex;
    gap: 10px;
    padding-top: 15px;
}

button {
    flex: 1;
    padding: 15px;
    border: 3px solid var(--bg-dark);
    font-family: inherit;
    font-weight: 900;
    cursor: pointer;
}

.play { background: var(--dev-blue); color: var(--bg-dark); }
.reset { background: #FF4D4D; color: var(--bg-dark); }

/* Timeline - Pôle DEV */
.timeline {
    background: var(--dev-blue);
    padding: 20px;
    border-top: 4px solid var(--bg-dark);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.track-info {
    color: var(--bg-dark);
    font-size: 0.7rem;
    font-weight: 900;
}

.drop-zone {
    background: rgba(0,0,0,0.1);
    border: 3px dashed var(--bg-dark);
    min-height: 80px;
    display: flex;
    gap: 10px;
    padding: 10px;
    align-items: center;
}

/* Modal Victoire */
.modal-content {
    background: var(--crea-purple);
    border: 6px solid var(--bg-dark);
    color: white;
    padding: 40px;
    box-shadow: 15px 15px 0px var(--comm-yellow);
}

.modal-content button {
    background: var(--comm-yellow);
    margin-top: 20px;
}
/* ... Garde tes racines :root précédentes ... */

.full-screen {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--bg-dark);
}

/* Écran Nom */
.login-box {
    text-align: center;
    background: var(--crea-purple);
    padding: 50px;
    border: 4px solid white;
    box-shadow: 15px 15px 0px var(--dev-blue);
}

input[type="text"] {
    background: black;
    border: 3px solid white;
    color: white;
    padding: 15px;
    font-family: 'Arial Black', sans-serif;
    font-size: 1.2rem;
    margin-bottom: 20px;
    width: 300px;
}

/* Écran Sélection */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding: 40px;
    max-width: 1200px;
}

.movie-card {
    background: white;
    border: 4px solid var(--bg-dark);
    cursor: pointer;
    transition: transform 0.2s;
}

.movie-card:hover {
    transform: scale(1.05);
    box-shadow: 10px 10px 0px var(--comm-yellow);
}

.poster-placeholder {
    height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    font-weight: 900;
    border-bottom: 4px solid black;
}

.movie-card h2 {
    color: black;
    font-size: 0.9rem;
    padding: 15px;
    margin: 0;
}

/* Layout spécifique au jeu */
.user-info {
    font-size: 0.7rem;
    background: black;
    padding: 5px;
    margin-bottom: 20px;
    border: 1px solid var(--dev-blue);
}

.jpo-logo { max-width: 200px; margin-bottom: 40px; }

/* Transition fluide pour le lecteur */
#main-player {
    background: black;
    transition: opacity 0.3s ease-in-out; /* Le fondu */
    object-fit: cover;
}

/* Classe pour masquer la vidéo pendant le chargement du clip suivant */
.video-transition {
    opacity: 0;
}
/* Bouton Skip discret mais accessible */
.skip-btn {
    position: absolute;
    bottom: 60px; /* Juste au dessus de la barre de feedback */
    right: 15px;
    background: rgba(0,0,0,0.7);
    color: var(--comm-yellow);
    border: 2px solid var(--comm-yellow);
    font-size: 0.7rem;
    padding: 5px 10px;
    z-index: 5;
    cursor: pointer;
}

.skip-btn:hover { background: var(--comm-yellow); color: black; }

/* Panneau d'Erreur */
.error-panel {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.error-content {
    background: var(--comm-yellow);
    color: black;
    padding: 30px;
    border: 6px solid black;
    box-shadow: 15px 15px 0px var(--crea-purple);
    max-width: 80%;
    text-align: center;
}

.error-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-retry { background: black; color: white; border: none; padding: 10px; cursor: pointer; flex: 1; font-weight: bold; }
.btn-preview { background: var(--dev-blue); color: black; border: 2px solid black; padding: 10px; cursor: pointer; flex: 1; font-weight: bold; }
/* Animation de la Modal de Victoire */
.victory-animation {
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 10px solid black !important;
}

@keyframes popIn {
    0% { transform: scale(0.5); rotate: -10deg; opacity: 0; }
    100% { transform: scale(1); rotate: 0deg; opacity: 1; }
}

.victory-banner {
    background: var(--comm-yellow);
    color: black;
    font-size: 2.5rem;
    font-weight: 900;
    padding: 10px;
    margin-bottom: 20px;
    border: 4px solid black;
    /* Animation de flash de couleur */
    animation: flashColors 0.4s infinite;
}

@keyframes flashColors {
    0% { background: var(--comm-yellow); }
    50% { background: var(--dev-blue); }
    100% { background: var(--crea-purple); color: white; }
}

.btn-next {
    background: black;
    color: white;
    padding: 20px 40px;
    border: none;
    font-family: inherit;
    font-weight: 900;
    cursor: pointer;
    margin-top: 20px;
    transition: 0.2s;
}

.btn-next:hover {
    transform: translate(-5px, -5px);
    box-shadow: 8px 8px 0px var(--dev-blue);
}