/* ============================================================
   MEUTE — Design System
   Palette : noir #0d0500, brun #1a0a00, or #c8922a, rouge #8b1a1a, vert #1a4a1a
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #0d0500;
    color: #e8dcc8;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* --- Animation de chargement "Le Village" --- */
.chargement {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease;
}

.chargement.fade-out {
    opacity: 0;
    pointer-events: none;
}

.village-svg {
    width: min(80vw, 400px);
    height: auto;
}

.village-trait {
    fill: none;
    stroke: #fff;
    stroke-width: 1.5;
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    animation: dessiner-village 2s ease forwards;
}

@keyframes dessiner-village {
    to { stroke-dashoffset: 0; }
}

/* Fenêtres qui s'allument */
.fenetre {
    fill: #c8922a;
    opacity: 0;
}

.fenetre-1 { animation: allumer 0.3s ease forwards 1.0s; }
.fenetre-2 { animation: allumer 0.3s ease forwards 1.15s; }
.fenetre-3 { animation: allumer 0.3s ease forwards 1.3s; }
.fenetre-4 { animation: allumer 0.3s ease forwards 1.45s; }
.fenetre-5 { animation: allumer 0.3s ease forwards 1.6s; }
.fenetre-6 { animation: allumer 0.3s ease forwards 1.7s; }
.fenetre-7 { animation: allumer 0.3s ease forwards 1.8s; }
.fenetre-8 { animation: allumer 0.3s ease forwards 1.9s; }
.fenetre-9 { animation: allumer 0.3s ease forwards 2.0s; }

.fenetre-rouge {
    fill: #8b1a1a;
    opacity: 0;
    animation: allumer 0.3s ease forwards 1.4s, pulse-rouge 1.5s ease-in-out infinite 1.7s;
}

@keyframes allumer {
    to { opacity: 0.9; }
}

@keyframes pulse-rouge {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; fill: #cc2a2a; }
}

/* Titre MEUTE lettre par lettre */
.meute-titre {
    margin-top: 1.5rem;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 2.5rem;
    letter-spacing: 0.5rem;
    color: #c8922a;
}

.lettre {
    opacity: 0;
    display: inline-block;
}

.l1 { animation: apparaitre-lettre 0.2s ease forwards 1.8s; }
.l2 { animation: apparaitre-lettre 0.2s ease forwards 1.95s; }
.l3 { animation: apparaitre-lettre 0.2s ease forwards 2.1s; }
.l4 { animation: apparaitre-lettre 0.2s ease forwards 2.25s; }
.l5 { animation: apparaitre-lettre 0.2s ease forwards 2.4s; }

@keyframes apparaitre-lettre {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Contenu principal --- */
.contenu {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 1rem;
    transition: opacity 0.4s ease;
}

.contenu.masque {
    display: none;
}

/* --- Header --- */
.header-page {
    text-align: center;
    padding: 1.5rem 0 1rem;
}

.titre-principal {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 2.5rem;
    color: #c8922a;
    letter-spacing: 0.3rem;
}

.titre-page {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.8rem;
    color: #c8922a;
    letter-spacing: 0.15rem;
}

.sous-titre {
    font-style: italic;
    color: #8a7a64;
    margin-top: 0.3rem;
    font-size: 0.95rem;
}

/* --- Boutons --- */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border: 2px solid #c8922a;
    background: transparent;
    color: #c8922a;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
    max-width: 360px;
}

.btn:hover {
    background: #c8922a;
    color: #0d0500;
}

.btn:active {
    transform: scale(0.97);
}

.btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    border-color: #5a4a32;
    color: #5a4a32;
}

.btn:disabled:hover {
    background: transparent;
    color: #5a4a32;
}

.btn-principal {
    background: #c8922a;
    color: #0d0500;
    font-weight: bold;
}

.btn-principal:hover {
    background: #daa83a;
    border-color: #daa83a;
}

.btn-lancer {
    background: #1a4a1a;
    border-color: #2a6a2a;
    color: #a0d4a0;
    font-weight: bold;
}

.btn-lancer:hover:not(:disabled) {
    background: #2a6a2a;
    color: #fff;
}

.btn-secondaire {
    font-size: 0.95rem;
    border-color: #5a4a32;
    color: #8a7a64;
}

.btn-secondaire:hover {
    background: #1a0a00;
    border-color: #c8922a;
    color: #c8922a;
}

.badge-joueurs {
    display: block;
    font-size: 0.75rem;
    font-family: -apple-system, sans-serif;
    opacity: 0.7;
    margin-top: 0.2rem;
}

/* --- Accueil --- */
.accueil-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.section-accueil {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

/* --- Sélecteur de mode --- */
.mode-selector {
    display: flex;
    gap: 0.75rem;
    width: 100%;
}

.btn-mode {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem 0.5rem;
    border: 2px solid #5a4a32;
    border-radius: 12px;
    background: rgba(26, 10, 0, 0.6);
    color: #a89878;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.btn-mode.actif {
    border-color: #c8922a;
    background: rgba(200, 146, 42, 0.15);
    color: #e8dcc8;
}

.btn-mode:hover {
    border-color: #c8922a;
}

.mode-icone {
    font-size: 1.8rem;
}

.mode-titre {
    font-weight: 700;
    font-size: 0.95rem;
}

.mode-desc {
    font-size: 0.7rem;
    opacity: 0.7;
}

/* --- Info auto-avancement MJ --- */
.info-auto {
    color: #a89878;
    font-style: italic;
    text-align: center;
    padding: 0.5rem;
}

/* --- Présentation du jeu --- */
.presentation-jeu {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(200, 146, 42, 0.15);
    text-align: left;
}

.pres-titre {
    color: #c8922a;
    font-size: 1.15rem;
    margin: 1.8rem 0 0.8rem;
    text-align: center;
    letter-spacing: 0.04em;
}

.pres-titre:first-child {
    margin-top: 0;
}

.pres-intro {
    text-align: center;
    color: #ccc0aa;
    line-height: 1.6;
    max-width: 32rem;
    margin: 0 auto 1.5rem;
    font-size: 0.95rem;
}

.pres-modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.pres-mode {
    background: rgba(200, 146, 42, 0.06);
    border: 1px solid rgba(200, 146, 42, 0.12);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.pres-mode-icone {
    font-size: 1.6rem;
    display: block;
    margin-bottom: 0.3rem;
}

.pres-mode h3 {
    color: #c8922a;
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}

.pres-mode p {
    color: #a89878;
    font-size: 0.82rem;
    line-height: 1.45;
}

.pres-roles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.pres-role {
    background: rgba(13, 5, 0, 0.5);
    border: 1px solid rgba(200, 146, 42, 0.1);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
}

.pres-role-icone {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.2rem;
}

.pres-role strong {
    color: #c8922a;
    font-size: 0.85rem;
    display: block;
    margin-bottom: 0.25rem;
}

.pres-role p {
    color: #a89878;
    font-size: 0.78rem;
    line-height: 1.4;
}

.pres-infos {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(200, 146, 42, 0.05);
    border-radius: 8px;
    text-align: center;
}

.pres-infos p {
    color: #a89878;
    font-size: 0.85rem;
    margin: 0.3rem 0;
}

@media (max-width: 400px) {
    .pres-modes,
    .pres-roles {
        grid-template-columns: 1fr;
    }
}

.section-accueil.masque,
.section-jouer.masque {
    display: none;
}

/* QR Code */
.qr-container {
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    display: inline-block;
}

.qr-code svg {
    display: block;
    width: 200px;
    height: 200px;
}

/* Room code */
.room-code-container {
    text-align: center;
}

.room-label {
    font-size: 0.85rem;
    color: #8a7a64;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
}

.room-code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 3rem;
    font-weight: bold;
    color: #c8922a;
    letter-spacing: 0.5rem;
    margin-top: 0.3rem;
}

/* --- Liste joueurs --- */
.joueurs-section {
    width: 100%;
}

.joueurs-titre {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.1rem;
    color: #8a7a64;
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #2a1a0a;
}

.liste-joueurs {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.joueur-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.8rem;
    background: #1a0a00;
    border: 1px solid #2a1a0a;
    border-radius: 4px;
    animation: apparaitre-joueur 0.3s ease;
}

@keyframes apparaitre-joueur {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.joueur-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.joueur-avatar svg {
    width: 100%;
    height: 100%;
}

.joueur-pseudo {
    font-size: 0.9rem;
    color: #e8dcc8;
}

/* --- Actions lobby --- */
.actions-lobby {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
    max-width: 360px;
    align-items: center;
}

/* --- Page Jouer --- */
.section-jouer {
    max-width: 420px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    padding-bottom: 2rem;
}

.room-info {
    color: #8a7a64;
    font-size: 0.9rem;
}

/* Avatar creator */
.avatar-creator {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.avatar-preview-container {
    width: 120px;
    height: 120px;
    border: 2px solid #2a1a0a;
    border-radius: 50%;
    overflow: hidden;
    background: #1a0a00;
}

.avatar-svg-preview {
    width: 100%;
    height: 100%;
}

.avatar-sliders {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.slider-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: #8a7a64;
}

.slider-label > span:first-child {
    width: 80px;
    flex-shrink: 0;
    text-align: right;
}

.slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #2a1a0a;
    border-radius: 3px;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #c8922a;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.slider::-webkit-slider-thumb:hover {
    background: #daa83a;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #c8922a;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.slider-val {
    width: 60px;
    flex-shrink: 0;
    font-size: 0.8rem;
    color: #c8922a;
}

.color-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    vertical-align: middle;
}

/* Pseudo form */
.pseudo-form {
    width: 100%;
    position: relative;
}

.input-pseudo {
    width: 100%;
    padding: 0.8rem 1rem;
    padding-right: 3.5rem;
    background: #1a0a00;
    border: 2px solid #2a1a0a;
    border-radius: 4px;
    color: #e8dcc8;
    font-size: 1.1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s ease;
}

.input-pseudo:focus {
    border-color: #c8922a;
}

.input-pseudo::placeholder {
    color: #5a4a32;
}

.pseudo-compteur {
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: #5a4a32;
}

/* Attente */
.attente-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0;
}

.mon-avatar-container {
    width: 80px;
    height: 80px;
    border: 2px solid #c8922a;
    border-radius: 50%;
    overflow: hidden;
}

.avatar-svg-grand {
    width: 100%;
    height: 100%;
}

.mon-pseudo {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.3rem;
    color: #c8922a;
}

.attente-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 1rem;
    background: #1a0a00;
    border-radius: 4px;
    width: 100%;
}

.attente-message p {
    font-style: italic;
    color: #8a7a64;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background: #c8922a;
    border-radius: 50%;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* --- Maître du Jeu --- */
.header-maitre {
    text-align: center;
    padding: 1.5rem 0;
}

.titre-maitre {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 2rem;
    color: #c8922a;
    letter-spacing: 0.3rem;
}

.maitre-badge {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.3rem 1rem;
    background: #8b1a1a;
    color: #e8dcc8;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15rem;
    border-radius: 4px;
}

.room-info-maitre {
    margin-top: 0.5rem;
    color: #8a7a64;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
}

.maitre-main {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.joueurs-titre-maitre {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.3rem;
    color: #8a7a64;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #2a1a0a;
}

.grille-joueurs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.carte-joueur {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: #1a0a00;
    border: 1px solid #2a1a0a;
    border-radius: 4px;
    animation: apparaitre-joueur 0.3s ease;
}

.carte-joueur .joueur-avatar {
    width: 60px;
    height: 60px;
}

.carte-joueur .joueur-pseudo {
    font-size: 1rem;
    text-align: center;
}

.maitre-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: #1a0a00;
    border: 1px solid #2a1a0a;
    border-radius: 4px;
}

.maitre-statut {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.statut-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #c8922a;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

#statut-texte {
    color: #8a7a64;
    font-style: italic;
}

.btn-lancer-maitre {
    display: inline-block;
    padding: 1rem 2.5rem;
    border: 2px solid #2a6a2a;
    background: #1a4a1a;
    color: #a0d4a0;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.3rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-lancer-maitre:hover:not(:disabled) {
    background: #2a6a2a;
    color: #fff;
}

.btn-lancer-maitre:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* --- Responsive --- */
@media (min-width: 768px) {
    .contenu {
        padding: 2rem;
    }

    .titre-principal {
        font-size: 3.5rem;
    }

    .qr-code svg {
        width: 250px;
        height: 250px;
    }

    .room-code {
        font-size: 3.5rem;
    }

    .grille-joueurs {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .section-jouer {
        max-width: 500px;
    }

    .avatar-preview-container {
        width: 150px;
        height: 150px;
    }
}

@media (min-width: 1200px) {
    .accueil-main {
        padding: 2rem 4rem;
    }

    .grille-joueurs {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1.5rem;
    }

    .maitre-main {
        max-width: 1200px;
    }

    .carte-joueur .joueur-avatar {
        width: 80px;
        height: 80px;
    }
}

/* Maître : paysage sur tablette */
@media (min-width: 768px) and (orientation: landscape) {
    .maitre-main {
        display: grid;
        grid-template-columns: 1fr 300px;
        gap: 2rem;
    }

    .maitre-actions {
        position: sticky;
        top: 1rem;
        align-self: start;
    }
}

/* --- Utilitaires --- */
.masque {
    display: none !important;
}

/* Scrollbar custom */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #0d0500;
}

::-webkit-scrollbar-thumb {
    background: #2a1a0a;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a4a32;
}

/* ============================================================
   SPRINT 2 — Phases de jeu, cartes de rôle, nuit/jour
   ============================================================ */

/* --- Carte de rôle (révélation) --- */
.revelation-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 0;
}

.carte-role {
    width: 200px;
    height: 280px;
    perspective: 800px;
    cursor: pointer;
}

.carte-role.retournee .carte-dos {
    transform: rotateY(180deg);
}

.carte-role.retournee .carte-recto {
    transform: rotateY(0deg);
}

.carte-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 8px;
    transition: transform 0.8s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.carte-dos {
    background: #1a0a00;
    border: 2px solid #c8922a;
    transform: rotateY(0deg);
}

.carte-dos-motif svg {
    width: 120px;
    height: 120px;
}

.carte-recto {
    background: linear-gradient(135deg, #1a0a00, #2a1a10);
    border: 2px solid #c8922a;
    transform: rotateY(-180deg);
    padding: 1rem;
    gap: 0.5rem;
}

.role-svg {
    width: 80px;
    height: 96px;
}

.role-nom {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
}

.role-description {
    font-size: 0.75rem;
    color: #8a7a64;
    text-align: center;
    line-height: 1.3;
}

.revelation-instruction {
    color: #8a7a64;
    font-style: italic;
    font-size: 0.9rem;
    animation: pulse-dot 2s ease-in-out infinite;
}

.coequipiers-info {
    background: #2a0a0a;
    border: 1px solid #8b1a1a;
    border-radius: 4px;
    padding: 0.8rem 1rem;
    text-align: center;
    width: 100%;
    max-width: 300px;
}

.coequipiers-info p {
    font-size: 0.85rem;
    color: #cc6666;
}

/* Couleurs par rôle */
.role-loup_garou { color: #cc3333; }
.role-villageois { color: #a0d4a0; }
.role-voyante { color: #9999ff; }
.role-sorciere { color: #cc66cc; }
.role-chasseur { color: #cc8833; }
.role-salvateur { color: #66ccaa; }
.role-cupidon { color: #ff99aa; }

/* --- Indicateur de phase --- */
.phase-indicateur, .phase-indicateur-maitre {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    border-radius: 4px;
    width: 100%;
    justify-content: center;
}

.phase-icone, .phase-icone-maitre {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.phase-texte, .phase-texte-maitre {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.1rem;
}

.tour-texte, .tour-texte-maitre {
    font-size: 0.8rem;
    color: #8a7a64;
    margin-left: auto;
}

/* Thèmes de phase */
.phase-nuit {
    background: #0a0a1a;
    border: 1px solid #1a1a3a;
}

.phase-nuit .phase-icone,
.phase-nuit .phase-icone-maitre {
    background: #4444aa;
    box-shadow: 0 0 8px #4444aa;
}

.phase-nuit .phase-texte,
.phase-nuit .phase-texte-maitre {
    color: #8888cc;
}

.phase-jour {
    background: #1a1a05;
    border: 1px solid #3a3a1a;
}

.phase-jour .phase-icone,
.phase-jour .phase-icone-maitre {
    background: #c8922a;
    box-shadow: 0 0 8px #c8922a;
}

.phase-jour .phase-texte,
.phase-jour .phase-texte-maitre {
    color: #c8922a;
}

.phase-aube {
    background: #1a0f05;
    border: 1px solid #3a2a1a;
}

.phase-aube .phase-icone,
.phase-aube .phase-icone-maitre {
    background: #cc6633;
    box-shadow: 0 0 8px #cc6633;
}

.phase-aube .phase-texte,
.phase-aube .phase-texte-maitre {
    color: #cc8855;
}

/* Body theme transitions */
body.theme-nuit {
    background-color: #050510;
    transition: background-color 1.5s ease;
}

body.theme-jour {
    background-color: #0d0500;
    transition: background-color 1.5s ease;
}

body.theme-aube {
    background-color: #100805;
    transition: background-color 1.5s ease;
}

/* --- Écrans de phase --- */
.ecran-phase {
    width: 100%;
    animation: fade-in-phase 0.5s ease;
}

.ecran-phase.masque {
    display: none !important;
}

@keyframes fade-in-phase {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.narration {
    text-align: center;
    padding: 1rem;
    margin-bottom: 1rem;
}

.narration-texte {
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    color: #8a7a64;
    font-size: 1rem;
    line-height: 1.6;
}

/* Grille de cibles (sélection de joueurs) */
.grille-cibles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.6rem;
    margin-bottom: 1rem;
    width: 100%;
}

.cible-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.6rem;
    background: #1a0a00;
    border: 2px solid #2a1a0a;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cible-item:hover {
    border-color: #c8922a;
}

.cible-item.selectionnee {
    border-color: #8b1a1a;
    background: #2a0a0a;
    box-shadow: 0 0 10px rgba(139, 26, 26, 0.3);
}

.cible-item .joueur-avatar {
    width: 40px;
    height: 40px;
}

.cible-item .joueur-pseudo {
    font-size: 0.7rem;
    text-align: center;
    word-break: break-all;
}

/* Bouton danger */
.btn-danger {
    background: #8b1a1a;
    border-color: #aa2a2a;
    color: #ffcccc;
    font-weight: bold;
}

.btn-danger:hover:not(:disabled) {
    background: #aa2a2a;
    color: #fff;
}

.btn-vert {
    background: #1a4a1a;
    border-color: #2a6a2a;
    color: #a0d4a0;
}

.btn-vert:hover:not(:disabled) {
    background: #2a6a2a;
    color: #fff;
}

/* Résultat vision voyante */
.resultat-vision {
    text-align: center;
    padding: 1rem;
    background: #1a1a2a;
    border: 1px solid #3a3a5a;
    border-radius: 4px;
    margin-top: 1rem;
    width: 100%;
}

.resultat-vision .role-vu {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.3rem;
    font-weight: bold;
}

/* Sorcière potions */
.sorciere-potions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
    align-items: center;
}

.info-victime {
    text-align: center;
    padding: 0.8rem;
    background: #2a0a0a;
    border: 1px solid #8b1a1a;
    border-radius: 4px;
    margin-bottom: 1rem;
    width: 100%;
}

/* Dormeur */
.dormeur-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
}

.dormeur-svg {
    width: 100px;
    height: 60px;
    animation: flotter 3s ease-in-out infinite;
}

@keyframes flotter {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.dormeur-texte {
    font-style: italic;
    color: #5a4a32;
    margin-top: 1rem;
}

/* Aube */
.aube-container {
    text-align: center;
    padding: 2rem 1rem;
}

.aube-titre {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.5rem;
    color: #cc8855;
    margin-bottom: 1.5rem;
}

.annonce-morts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.mort-annonce {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem;
    background: #2a0a0a;
    border: 1px solid #8b1a1a;
    border-radius: 4px;
    animation: apparaitre-mort 0.5s ease;
    width: 100%;
    max-width: 300px;
}

@keyframes apparaitre-mort {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.mort-annonce .joueur-avatar {
    width: 40px;
    height: 40px;
    opacity: 0.5;
    filter: grayscale(1);
}

.mort-annonce-texte {
    color: #cc6666;
    font-size: 0.9rem;
}

.aucune-mort {
    color: #a0d4a0;
    font-style: italic;
    padding: 1rem;
}

/* Jour */
.jour-container {
    text-align: center;
    padding: 1rem 0;
}

.jour-titre {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.5rem;
    color: #c8922a;
    margin-bottom: 0.5rem;
}

.jour-instruction {
    color: #8a7a64;
    font-style: italic;
    margin-bottom: 1.5rem;
}

.joueurs-vivants h3 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1rem;
    color: #8a7a64;
    margin-bottom: 0.8rem;
}

.grille-joueurs-mini {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}

.joueur-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.4rem;
}

.joueur-mini .joueur-avatar {
    width: 36px;
    height: 36px;
}

.joueur-mini .joueur-pseudo {
    font-size: 0.65rem;
}

.joueur-mini.est-mort .joueur-avatar {
    opacity: 0.3;
    filter: grayscale(1);
}

.joueur-mini.est-mort .joueur-pseudo {
    text-decoration: line-through;
    color: #5a4a32;
}

/* Mort du joueur */
.mort-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    gap: 1rem;
}

.mort-svg {
    width: 80px;
    height: 80px;
    animation: pulse-mort 2s ease-in-out infinite;
}

@keyframes pulse-mort {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.mort-titre {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.5rem;
    color: #8b1a1a;
}

.mort-role {
    color: #8a7a64;
    font-size: 0.9rem;
}

.mort-instruction {
    color: #5a4a32;
    font-style: italic;
    font-size: 0.85rem;
}

/* Fin de partie */
.fin-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
    text-align: center;
    gap: 1.5rem;
}

.fin-titre {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 2rem;
}

.fin-titre.victoire-village {
    color: #a0d4a0;
}

.fin-titre.victoire-loups {
    color: #cc3333;
}

.fin-description {
    color: #8a7a64;
    font-size: 1rem;
}

.fin-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
}

.fin-role-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: #1a0a00;
    border: 1px solid #2a1a0a;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* --- Maître : Console Sprint 2 --- */
.maitre-phase-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.maitre-controles {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
    align-items: center;
}

.btn-phase-suivante {
    display: inline-block;
    padding: 0.8rem 2rem;
    border: 2px solid #c8922a;
    background: #c8922a;
    color: #0d0500;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 300px;
    text-align: center;
}

.btn-phase-suivante:hover {
    background: #daa83a;
    border-color: #daa83a;
}

.btn-resoudre-nuit {
    background: #8b1a1a;
    border-color: #aa2a2a;
    color: #ffcccc;
}

.btn-resoudre-nuit:hover {
    background: #aa2a2a;
    color: #fff;
}

/* Journal narratif du maître */
.maitre-journal {
    width: 100%;
    margin-top: 1rem;
}

.journal-titre {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1rem;
    color: #8a7a64;
    margin-bottom: 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #2a1a0a;
}

.journal-contenu {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.journal-entry {
    font-size: 0.8rem;
    color: #8a7a64;
    padding: 0.3rem 0;
    border-bottom: 1px solid #1a0a00;
}

.journal-entry.important {
    color: #cc6666;
}

.journal-vide {
    color: #5a4a32;
    font-style: italic;
    font-size: 0.85rem;
}

/* Joueur mort dans grille maître */
.carte-joueur.est-mort {
    opacity: 0.4;
    border-color: #8b1a1a;
}

.carte-joueur.est-mort .joueur-avatar {
    filter: grayscale(1);
}

.carte-joueur .joueur-role {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 2px;
    background: #2a1a0a;
}

/* Responsive Sprint 2 */
@media (min-width: 768px) {
    .carte-role {
        width: 240px;
        height: 340px;
    }

    .grille-cibles {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }

    .maitre-journal .journal-contenu {
        max-height: 300px;
    }
}

/* --- Crépuscule (vote du village) --- */
.crepuscule-container {
    text-align: center;
    padding: 1rem 0;
}

.crepuscule-titre {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.5rem;
    color: #cc6633;
    margin-bottom: 0.5rem;
}

.crepuscule-instruction {
    color: #8a7a64;
    font-style: italic;
    margin-bottom: 1.5rem;
}

.vote-status {
    color: #c8922a;
    font-style: italic;
    font-size: 0.9rem;
    margin-top: 1rem;
    padding: 0.5rem;
    background: #1a0a00;
    border-radius: 4px;
}

/* --- Résultat du vote (révélation dramatique) --- */
.resultat-vote-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 2rem;
    text-align: center;
}

.resultat-vote-titre {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 2rem;
    margin-bottom: 1rem;
    animation: apparaitre-resultat 0.8s ease;
}

.resultat-vote-titre.elimine {
    color: #cc3333;
}

.resultat-vote-titre.survivant {
    color: #a0d4a0;
}

.resultat-vote-titre.egalite {
    color: #c8922a;
}

.resultat-vote-desc {
    font-size: 1.1rem;
    color: #8a7a64;
}

@keyframes apparaitre-resultat {
    0% { opacity: 0; transform: scale(0.5); }
    50% { transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

/* Thème mort (écran rouge) */
body.theme-mort {
    background-color: #1a0505 !important;
    transition: background-color 0.5s ease;
}

body.theme-mort .resultat-vote-container {
    background: radial-gradient(circle, #2a0a0a, #1a0505);
}

/* Thème survie (écran vert) */
body.theme-survie {
    background-color: #051a05 !important;
    transition: background-color 0.5s ease;
}

body.theme-survie .resultat-vote-container {
    background: radial-gradient(circle, #0a2a0a, #051a05);
}

/* Clignotement avant révélation */
@keyframes clignotement-suspense {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.1; }
}

.clignotement {
    animation: clignotement-suspense 0.15s ease-in-out 6;
}

/* --- Cupidon --- */
.cupidon-instruction {
    color: #ff99aa;
    font-style: italic;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    text-align: center;
}

.cupidon-selection {
    color: #ff99aa;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1rem;
    text-align: center;
    margin: 0.5rem 0;
}

/* --- Tir du chasseur --- */
.chasseur-tir-container {
    text-align: center;
    padding: 1.5rem 0;
    animation: flash-rouge 0.5s ease;
}

.chasseur-titre {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.5rem;
    color: #cc8833;
    margin-bottom: 0.5rem;
}

.chasseur-instruction {
    color: #8a7a64;
    font-style: italic;
    margin-bottom: 1.5rem;
}

@keyframes flash-rouge {
    0% { background-color: #4a0a0a; }
    100% { background-color: transparent; }
}

/* --- Décompte dramatique --- */
.decompte-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    background: radial-gradient(circle, #1a0a00, #050000);
}

.decompte-chiffre {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 8rem;
    color: #cc3333;
    text-shadow: 0 0 40px rgba(204, 51, 51, 0.5);
    transition: transform 0.2s ease;
}

.decompte-pop {
    animation: decompte-apparition 0.5s ease;
}

@keyframes decompte-apparition {
    0% { transform: scale(2); opacity: 0; }
    50% { transform: scale(0.9); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* Revelation mort dramatique */
.revelation-mort {
    animation: apparaitre-resultat 0.8s ease;
}

.revelation-survie {
    animation: apparaitre-resultat 0.8s ease;
}

/* --- Bots --- */
.bot-controles {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    background: #0d0500;
    border: 1px solid #2a1a0a;
    border-radius: 4px;
    width: 100%;
    justify-content: center;
}

.bot-controles.masque {
    display: none !important;
}

.bot-label {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 0.95rem;
    color: #8a7a64;
    margin-right: 0.3rem;
}

.btn-bot-ajust {
    width: 36px;
    height: 36px;
    border: 2px solid #5a4a32;
    background: transparent;
    color: #c8922a;
    font-size: 1.3rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.btn-bot-ajust:hover:not(:disabled) {
    background: #c8922a;
    color: #0d0500;
    border-color: #c8922a;
}

.btn-bot-ajust:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.nb-bots {
    font-family: 'Courier New', monospace;
    font-size: 1.4rem;
    font-weight: bold;
    color: #c8922a;
    min-width: 1.5rem;
    text-align: center;
}

/* Badge bot sur les joueurs */
.badge-bot {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: #2a2a3a;
    color: #8888cc;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    border-radius: 2px;
    border: 1px solid #3a3a5a;
}

.joueur-item .badge-bot,
.carte-joueur .badge-bot {
    margin-left: 0.3rem;
}

@media (min-width: 768px) and (orientation: landscape) {
    .maitre-main {
        display: grid;
        grid-template-columns: 1fr 350px;
        gap: 2rem;
    }
}
