/* ============================================
   CONFIGURATION DES COULEURS ET POLICES
   ============================================ */
:root {
    --color-bg: #0a0a0b;
    --color-surface: #151518;
    --color-surface-hover: #1e1e22;
    --color-border: #2a2a30;
    --color-text: #f5f5f5;
    --color-text-muted: #888;
    --color-accent: #c9a962;
    --color-accent-light: #e5d4a1;
    --font-display: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
}

/* Police PP Editorial New (pour "out" du logo) */
@font-face {
    font-family: 'PP Editorial New';
    src: url('fonts/PPEditorialNew-Italic.otf') format('opentype');
    font-weight: 400;
    font-style: italic;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    overflow-x: hidden;
    /* Transitions de page */
    opacity: 1;
    transition: opacity 0.4s ease-out;
}

body.fade-out {
    opacity: 0;
}

body.fade-in {
    animation: pageEnter 0.5s ease-out forwards;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   PHASES CONTAINER
   ============================================ */
.phase {
    display: none;
    min-height: 100vh;
    padding: 2rem;
    animation: fadeIn 0.6s ease-out;
}

.phase.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* ============================================
   PHASE: INTRO (ÉCRAN INTERMÉDIAIRE)
   ============================================ */
#phase-intro {
    position: relative;
    background: #2d2d2d;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 2rem;
}

.intro-card {
    background: #ffffff;
    border-radius: 30px;
    padding: 4rem 5rem;
    max-width: 650px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
}

.intro-text {
    font-family: 'DM Sans', sans-serif;
    font-size: 2rem;
    font-weight: 400;
    color: #2d2d2d;
    line-height: 1.4;
}

.intro-hint {
    position: absolute;
    bottom: 3rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.02em;
}

/* ============================================
   PHASE: WELCOME (ACCUEIL) - NOUVEAU DESIGN
   ============================================ */
#phase-welcome {
    position: relative;
    background: #2d2d2d;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 2rem;
}

/* Carte blanche centrale */
.welcome-card {
    position: relative;
    background: #ffffff;
    border-radius: 40px;
    padding: 8rem 7rem 7rem;
    max-width: 1100px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

/* Image peintre à gauche */
.welcome-painter {
    position: absolute;
    left: 0%;
    bottom: 0%;
    height: 68%;
    max-height: 900px;
    z-index: 2;
    pointer-events: none;
    filter: drop-shadow(5px 5px 15px rgba(0, 0, 0, 0.4));
}

/* Image nature morte en haut à droite */
.welcome-nature-morte {
    position: absolute;
    top: -70px;
    right: -10px;
    width: 325px;
    height: auto;
    z-index: 3;
    pointer-events: none;
    filter: drop-shadow(3px 3px 10px rgba(0, 0, 0, 0.3));
}

/* Logo Blackout */
.welcome-logo {
    display: flex;
    align-items: baseline;
    justify-content: center;
    margin-bottom: 0.5rem;
    position: relative;
}

.logo-black {
    font-family: 'DM Sans', sans-serif;
    font-size: 8.5rem;
    font-weight: 700;
    color: #693CFF;
    letter-spacing: -0.02em;
}

.logo-out {
    font-family: 'PP Editorial New', serif;
    font-size: 8.5rem;
    font-weight: 400;
    font-style: italic;
    color: #2d2d2d;
    letter-spacing: -0.02em;
}

/* Image des traits décoratifs à côté du logo */
.logo-lines-img {
    width: 50px;
    height: auto;
    margin-left: 7px;
    align-self: flex-start;
    margin-top: -12px;
}

/* Slogan / Tagline */
.welcome-tagline {
    font-family: 'DM Sans', sans-serif;
    font-size: 2.2rem;
    font-weight: 400;
    color: #2d2d2d;
    margin-bottom: 3rem;
    letter-spacing: 0.02em;
}

/* Bouton Lancer la partie - penché et déborde */
.start-btn {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%) rotate(-3deg);
    background: #693CFF;
    border: none;
    color: #ffffff;
    padding: 0.8rem 1.7rem;
    border-radius: 12px;
    font-size: 1.7rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'DM Sans', sans-serif;
    white-space: nowrap;
    z-index: 10;
}

.start-btn .arrow {
    margin-left: 0.5rem;
    font-weight: 600;
    font-size: 1.5rem;
}

.start-btn:hover {
    transform: translateX(-50%) rotate(-3deg) translateY(-4px);
    background: #5930E0;
}

.start-btn:active {
    transform: translateX(-50%) rotate(-3deg) translateY(-2px);
}

/* Responsive */
@media (max-width: 900px) {
    .welcome-painter {
        left: -15%;
        height: 55%;
    }

    .welcome-card {
        padding: 3rem 2.5rem 4rem;
    }

    .logo-black,
    .logo-out {
        font-size: 3.5rem;
    }

    .welcome-nature-morte {
        width: 150px;
        top: -20px;
        right: -15px;
    }
}

@media (max-width: 600px) {
    .welcome-painter {
        display: none;
    }

    .welcome-card {
        padding: 2.5rem 1.5rem 4rem;
        border-radius: 25px;
    }

    .logo-black,
    .logo-out {
        font-size: 2.8rem;
    }

    .welcome-tagline {
        font-size: 1.1rem;
    }

    .welcome-nature-morte {
        width: 120px;
        top: -15px;
        right: -10px;
    }

    .start-btn {
        font-size: 1rem;
        padding: 0.9rem 2rem;
    }
}

/* ============================================
   PHASE: OBSERVATION
   ============================================ */
#phase-observation {
    position: relative;
}

.observation-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: #693CFF;
    margin-bottom: 1rem;
    text-align: center;
    letter-spacing: 0.05em;
}

.observation-subtitle {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    text-align: center;
}

/* Image plus grande, SANS effet de zoom */
.observation-container {
    position: relative;
    max-width: 950px;
    width: 95%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    /* PAS d'animation de zoom ici */
}

.observation-container img {
    width: 100%;
    height: auto;
    display: block;
}

.timer-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #693CFF, #9B7DFF);
    width: 100%;
    transform-origin: left;
    animation: timerShrink 10s linear forwards;
}

@keyframes timerShrink {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

.timer-text {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.painting-info {
    margin-top: 1rem;
    text-align: center;
    color: #ffffff;
    font-family: var(--font-display);
    font-size: 1.2rem;
}

#painting-author {
    font-style: italic;
    font-weight: 400;
}

/* ============================================
   PHASE: CONSTRUCTION (QUIZ) - NOUVEAU DESIGN
   ============================================ */
#phase-construction {
    padding: 2rem;
}

#phase-construction.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Carte principale du quiz */
.quiz-card {
    position: relative;
    background: #693CFF;
    border-radius: 25px;
    border: 3px solid rgba(100, 50, 200, 0.5);
    padding: 1.5rem 2rem 1.5rem;
    max-width: 650px;
    width: 90%;
    box-shadow: 0 0 40px rgba(105, 60, 255, 0.4);
}

/* Bulle du numéro de question */
.question-number-bubble {
    position: absolute;
    top: -20px;
    left: -20px;
    width: 80px;
    height: 80px;
    background: #693CFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'PP Editorial New', 'Playfair Display', serif;
    font-style: italic;
    font-size: 2.5rem;
    color: #ffffff;
    box-shadow: 0 8px 25px rgba(105, 60, 255, 0.4);
    z-index: 10;
}

.question-number {
    font-family: inherit;
    font-style: italic;
}

/* Barre de progression chainée */
.progress-chain {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 1rem;
    padding: 0 1rem;
}

.progress-chain .chain-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: transparent;
    transition: all 0.3s ease;
    position: relative;
}

.progress-chain .chain-dot.completed {
    background: #ffffff;
    border-color: #ffffff;
}

.progress-chain .chain-dot.active {
    background: #ffffff;
    border-color: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

/* Liens entre les points (chain links) */
.progress-chain .chain-link {
    width: 12px;
    height: 2px;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}

.progress-chain .chain-link.completed {
    background: #ffffff;
}

/* Zone de la question */
.question-box {
    background: #ffffff;
    border-radius: 20px;
    padding: 2rem 2.5rem;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.question-text {
    font-family: 'DM Sans', var(--font-body);
    font-size: 1.4rem;
    font-weight: 400;
    font-style: italic;
    color: #2d2d2d;
    text-align: center;
    line-height: 1.5;
    margin: 0;
}

/* Boutons de choix */
.choices {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.choice-btn {
    background: #693CFF;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 0.9rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'DM Sans', var(--font-body);
    min-width: 100px;
}

.choice-btn:hover {
    background: #5930E0;
    border-color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.choice-btn:active {
    transform: translateY(-1px);
}

/* ============================================
   PHASE: COMPARISON
   ============================================ */
#phase-comparison {
    padding: 1rem;
}

.comparison-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: #693CFF;
    margin-bottom: 0.5rem;
    text-align: center;
}

.comparison-subtitle {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    text-align: center;
}

.score-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.score-value {
    font-size: 4rem;
    font-weight: 700;
    color: #693CFF;
    font-family: 'DM Sans', var(--font-body);
    line-height: 1;
}

.score-label {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin-top: 0.3rem;
}

.comparison-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    max-width: 1200px;
    width: 100%;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .comparison-container {
        grid-template-columns: 1fr;
    }
}

.comparison-side {
    position: relative;
}

.comparison-label {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
    text-align: center;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.comparison-frame {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
}

.comparison-frame img {
    width: 100%;
    height: auto;
    display: block;
}

.comparison-frame img.layer {
    position: absolute;
    top: 0;
    left: 0;
}

.end-game-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.replay-btn {
    background: linear-gradient(135deg, #693CFF, #5930E0);
    border: none;
    color: #ffffff;
    padding: 1rem 3rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-body);
    box-shadow: 0 10px 30px rgba(105, 60, 255, 0.3);
}

.replay-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(105, 60, 255, 0.4);
}

/* ============================================
   FADE TRANSITION
   ============================================ */
.fade-out {
    animation: fadeOut 0.6s ease-out forwards;
}