/* Blascreb font loaded via global.css */

/* Styles de base pour HTML et body */
html, body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background-color: #2c3e50;
    transition: background-color 1s;
    width: 100%;
    height: 100vh; /* Hauteur fixe */
    margin: 0;
    padding: 0;
    overflow: hidden; /* Pas de scroll ! */
    box-sizing: border-box;
}

body.error {
    background-color: #c0392b;
    transition: background-color 0s;
}

/* Mode duel - fond spécial */
body.duel-mode {
    background-color: #1e1e1e;
    position: relative;
}

/* Mode duel - Masquer le header normal */
body.duel-mode .header {
    display: none;
}

/* Mode duel - Masquer les steps */
body.duel-mode .steps {
    display: none;
}

/* Mode duel - Cases grises */
body.duel-mode .letter-box {
    background-color: #3a3a3a;
}

/* Mode duel - Feedback correct en rose */
body.duel-mode.correct {
    background-color: #c47a78;
}

body.duel-mode.correct .letter-box {
    background-color: transparent;
}

body.duel-mode.correct .duel-header {
    background: transparent;
}

body.duel-mode.correct .game-footer-malus {
    background: transparent;
}

/* === HEADER DUEL SPECIAL === */
.duel-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #1e1e1e;
    z-index: 100;
    padding: 8px 15px 5px 15px;
    box-sizing: border-box;
}

body.duel-mode .duel-header {
    display: block;
    position: relative;
}

.duel-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.duel-header-row:first-child {
    margin-bottom: 0;
}

.duel-player-name {
    color: white;
    font-weight: bold;
    font-size: 1rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Éclair centré qui couvre les 2 lignes */
.duel-header-bolt {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #c47a78;
    font-size: 4rem;
    z-index: 1;
    line-height: 1;
}

.duel-letters {
    display: flex;
    gap: 0;
    margin-top: -3px;
}

.duel-letter {
    font-size: 1.8rem;
    font-weight: bold;
    color: #fef3d8;
    transition: all 0.3s ease;
    font-family: 'Blascreb', sans-serif;
    filter: grayscale(1) brightness(0.5);
}

.duel-letter.filled {
    filter: none;
    text-shadow: 0 0 8px rgba(254, 243, 216, 0.4);
    animation: letterGlow 0.4s ease;
}

.duel-letters.opponent .duel-letter.filled {
    filter: none;
    text-shadow: 0 0 8px rgba(254, 243, 216, 0.4);
}

@keyframes letterGlow {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* Éclair central géant (caché par défaut) */
/* Masquer le chrono wrapper normal en mode duel */
body.duel-mode .chrono-wrapper-compact {
    display: none;
}

/* Notification duel */
.duel-notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-30px) scale(0.8);
    background: linear-gradient(135deg, #c47a78, #a8605e);
    color: white;
    padding: 10px 24px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    opacity: 0;
    pointer-events: none;
    z-index: 101;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 4px 20px rgba(196,122,120,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.duel-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
    animation: notifSlam 0.4s cubic-bezier(0.2, 0.8, 0.2, 1.2), notifGlow 2.5s ease-out;
}

@keyframes notifSlam {
    0% { transform: translateX(-50%) translateY(-30px) scale(0.5); opacity: 0; }
    60% { transform: translateX(-50%) translateY(4px) scale(1.05); opacity: 1; }
    100% { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
}

@keyframes notifGlow {
    0%, 30% { box-shadow: 0 4px 20px rgba(196,122,120,0.4), inset 0 1px 0 rgba(255,255,255,0.1); }
    15% { box-shadow: 0 4px 30px rgba(196,122,120,0.7), inset 0 1px 0 rgba(255,255,255,0.2); }
    100% { box-shadow: 0 4px 20px rgba(196,122,120,0.4), inset 0 1px 0 rgba(255,255,255,0.1); }
}

/* Countdown overlay pour duel */
.duel-countdown-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 30, 30, 0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.duel-countdown-overlay.active {
    display: flex;
}

.duel-countdown-number {
    font-size: 30vh;
    font-weight: bold;
    color: #c47a78;
    font-family: 'Blascreb', sans-serif;
    text-shadow: 0 0 50px rgba(196, 122, 120, 0.5);
    animation: countdownPulse 1s ease-in-out;
}

@keyframes countdownPulse {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 480px) {
    .duel-header {
        padding: 8px 12px 5px 12px;
    }
    .duel-player-name {
        font-size: 0.9rem;
        max-width: 80px;
    }
    .duel-letter {
        font-size: 1.5rem;
    }
    .duel-header-bolt {
        font-size: 3.5rem;
    }
}

/* Centrer les cases dans l'espace disponible en mode duel */
body.duel-mode .game-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    padding: 0;
    width: auto;
}

body.duel-mode .word-container {
    margin: 0;
}

/* Styles pour l'en-tête */
.header {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    left: 0;
    z-index: 1000;
    background-color: inherit;
    transition: background-color 1s;
    position: relative;
}

/* Logo centré */
.header .logo-container {
    display: flex;
    justify-content: center;
}

/* Logo en beige */
.header .logo {
    filter: brightness(0) saturate(100%) invert(95%) sepia(10%) saturate(500%) hue-rotate(350deg) brightness(103%) contrast(96%);
}

/* Bouton profil en position absolue à droite */
.header .profile-btn-game {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

/* Pseudo tronqué si trop long */
.header .profile-btn-game .profile-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mobile : logo à gauche, pas de pseudo */
@media (max-width: 480px) {
    .header {
        justify-content: flex-start;
    }
    
    .header .logo-container {
        justify-content: flex-start;
    }
    
    .header .profile-btn-game .profile-name {
        display: none;
    }
}

.header.correct {
    background-color: var(--color-green); /* Même vert que body.correct */
}

/* ========================================
   CHRONOMÈTRE
   ======================================== */
@media (max-width: 480px) {
}

/* Styles pour le badge beta */
/* ========================================
   BADGE CHALLENGE (header)
   ======================================== */
.challenge-badge {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1001;
    display: none; /* Caché par défaut, affiché via JS */
}

.challenge-badge a {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-green);
    color: #fff;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, box-shadow 0.2s;
}

.challenge-badge a:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.challenge-badge .badge-icon {
    font-size: 0.9rem;
}

.challenge-badge .badge-text {
    text-transform: capitalize;
}

/* Version compacte pour mobile */
@media (max-width: 480px) {
    .challenge-badge a {
        padding: 6px 10px;
        font-size: 0.7rem;
        gap: 5px;
    }
    
    .challenge-badge .badge-icon {
        font-size: 0.8rem;
    }
    
}

/* Ajustement du badge beta pour les appareils mobiles */
@media (max-width: 768px) {
}

@media (max-width: 480px) {
}

/* Styles pour le logo */
.logo {
    height: 45px;
    width: auto;
    margin: 5px 0;
    transition: transform 0.6s ease-in-out; /* Transition smooth pour la rotation */
}

/* Animation de rotation du logo */
.logo.spin {
    animation: spin360 0.6s ease-in-out;
}

@keyframes spin360 {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: auto;
}

/* Conteneur principal */
.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

/* Contenu principal */
/* Styles pour le conteneur du timer */
/* Timer désactivé pour l'instant - sera réactivé avec le système de points
*/

.score {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ecf0f1;
    font-size: 2rem;
    font-weight: bold;
    font-family: 'Blascreb', Arial, sans-serif;
    z-index: 1;
}

.circle {
    fill: none;
    stroke-width: 3.8;
    stroke: var(--color-green);
    transform-origin: 50% 50%;
}


/* Styles pour les petits écrans */
@media (max-width: 768px) {
}

/* Styles pour les très petits écrans */
@media (max-width: 480px) {
}

/* Styles pour le conteneur de jeu */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: 280px; /* Remonté de 420px à 280px */
    width: 100%;
    height: auto;
    box-sizing: border-box;
    padding: 0 20px; /* Ajouter un peu de padding horizontal */
    flex-shrink: 0;
    position: relative;
    z-index: 10; /* Au-dessus du footer */
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Conteneur des mots */
.word-container {
    display: flex;
    justify-content: center;
    margin-top: 80px; /* Réduit pour mobile */
    margin-bottom: 20px;
    width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
    pointer-events: none; /* Laisser passer la souris pour le Canvas */
    position: relative;
    z-index: 500; /* Au-dessus du canvas */
}

/* Sur desktop, plus d'espace */
@media (min-width: 768px) {
    .word-container {
        margin-top: 150px;
    }
}

/* Canvas pour les lettres avec physique */
#gameCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 100; /* Au-dessus de tout sauf des éléments UI */
    pointer-events: auto;
    touch-action: none; /* Empêche le navigateur d'intercepter les gestes tactiles */
}

/* Footer fixe (zone où tombent les lettres, contiendra score/chrono) */
/* === BLOC CHRONO UNIFIÉ avec ARCS SVG === */
.chrono-block {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 25px 0 15px 0;
    width: 100%;
}

.chrono-inner {
    position: relative;
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* SVG ring autour du chrono */
.steps-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    transform: rotate(-90deg); /* Commence en haut */
}

.steps-ring .step {
    fill: none;
    stroke: var(--color-teal, #17586a); /* À trouver = bleu foncé */
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke 0.3s ease;
}

/* Mot trouvé = vert */
.steps-ring .step.found {
    stroke: var(--color-green, #609E7C);
}

/* Mot en cours = rose pâle BLESC */
.steps-ring .step.current {
    stroke: #d4918f;
}

/* Responsive mobile */
@media (max-width: 480px) {
    .chrono-block {
        margin: 20px 0 10px 0;
    }
    
    .chrono-inner {
        width: 100px;
        height: 100px;
    }
    
    .steps-ring .step {
        stroke-width: 5;
    }
}

/* Mode duel - cacher le bloc chrono */
body.duel-mode .chrono-block {
    display: none;
}

/* === CERCLE CHRONO au centre === */
.chrono-wrapper-compact {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    margin: 0;
}

/* Chrono simple dans un rond */
.chrono-time-simple {
    font-size: 1.4rem;
    font-weight: 400;
    font-family: 'Barlow', 'Inter', sans-serif;
    color: var(--color-bg, #fef3d8);
    letter-spacing: 0;
    background: rgba(23, 88, 106, 0.6);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive mobile */
@media (max-width: 480px) {
    .chrono-wrapper-compact {
        /* Pas de margin en position absolute */
    }
    .chrono-time-simple {
        font-size: 1.2rem;
        width: 70px;
        height: 70px;
    }
}

/* === FOOTER JAUGE 7 SEGMENTS === */
.game-footer-gauge {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    display: flex;
    gap: 2px;
    z-index: 100;
}

.gauge-segment {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: opacity 0.3s ease, background 0.3s ease;
}

.gauge-segment span {
    position: relative;
    z-index: 1;
    color: var(--color-bg, #fef3d8);
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Barlow', sans-serif;
    transition: color 0.3s ease;
}

@media (max-width: 480px) {
    .game-footer-gauge {
        height: 55px;
    }
    .gauge-segment span {
        font-size: 0.85rem;
    }
}

/* Couleurs des segments */
.gauge-segment[data-stars="7"] { background: #609E7C; }
.gauge-segment[data-stars="6"] { background: #7ab892; }
.gauge-segment[data-stars="5"] { background: #c4a574; }
.gauge-segment[data-stars="4"] { background: #d4b896; }
.gauge-segment[data-stars="3"] { background: #d4918f; }
.gauge-segment[data-stars="2"] { background: #c47a78; }
.gauge-segment[data-stars="1"] { background: #375969; }

/* Segment futur (pas encore atteint) */
.gauge-segment.future {
    opacity: 0.5;
}

/* Segment passé (déjà dépassé) */
.gauge-segment.past {
    background: rgba(255,255,255,0.08);
}
.gauge-segment.past span {
    color: rgba(255,255,255,0.25);
}

/* Barre de progression dans le segment actuel */
/* Barre de progression dans le segment actuel */
.gauge-segment .progress-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100%;
    background: rgba(0,0,0,0.35);
    transition: width 0.1s linear;
    z-index: 0;
}

/* ========================================
   FOOTER MALUS (MODE DUEL)
   ======================================== */
.game-footer-malus {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 16px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top, #0a0a0a, #151515);
    border-top: 1px solid rgba(255,255,255,0.06);
    z-index: 100;
}

.malus-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 12px 14px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    background: rgba(255,255,255,0.06);
    color: white;
    cursor: pointer;
    transition: all 0.25s ease;
    flex: 1;
    max-width: 110px;
    position: relative;
    overflow: hidden;
}

/* Shimmer idle animation */
.malus-btn::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255,255,255,0.04), transparent 30%);
    animation: malusSpin 4s linear infinite;
}

@keyframes malusSpin {
    to { transform: rotate(360deg); }
}

.malus-btn::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 13px;
    background: inherit;
    z-index: 0;
}

.malus-btn > * {
    position: relative;
    z-index: 1;
}

/* === ALL MALUS BUTTONS — Pink theme === */
.malus-btn[data-malus="drop"],
.malus-btn[data-malus="hide"],
.malus-btn[data-malus="freeze"],
.malus-btn[data-malus="gravity"] {
    background: linear-gradient(145deg, rgba(196,122,120,0.2), rgba(140,70,68,0.12));
    border-color: rgba(196,122,120,0.3);
    box-shadow: 0 0 12px rgba(196,122,120,0.12), inset 0 1px 0 rgba(255,180,178,0.08);
}
.malus-btn[data-malus="drop"] i,
.malus-btn[data-malus="hide"] i,
.malus-btn[data-malus="freeze"] i,
.malus-btn[data-malus="gravity"] i {
    color: #d4918f;
    text-shadow: 0 0 10px rgba(196,122,120,0.5);
}
.malus-btn[data-malus="drop"]:active:not(:disabled):not(.used),
.malus-btn[data-malus="hide"]:active:not(:disabled):not(.used),
.malus-btn[data-malus="freeze"]:active:not(:disabled):not(.used),
.malus-btn[data-malus="gravity"]:active:not(:disabled):not(.used) {
    transform: scale(0.9);
    box-shadow: 0 0 25px rgba(196,122,120,0.5), inset 0 0 15px rgba(196,122,120,0.3);
}

/* Icons */
.malus-btn i {
    font-size: 1.5rem;
    transition: transform 0.2s, text-shadow 0.2s;
}

.malus-btn .malus-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
    white-space: nowrap;
}

/* Disabled */
.malus-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
    transform: none;
    filter: saturate(0);
}
.malus-btn:disabled::before {
    animation: none;
}

/* Used — shattered look */
.malus-btn.used {
    opacity: 0.15;
    pointer-events: none;
    filter: grayscale(1);
    border-style: dashed;
}
.malus-btn.used::before {
    animation: none;
}

@media (max-width: 480px) {
    .game-footer-malus {
        gap: 8px;
        padding: 10px 12px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }
    .malus-btn {
        padding: 10px 10px;
        border-radius: 12px;
    }
    .malus-btn i {
        font-size: 1.3rem;
    }
}

/* Hint progress bar along top of malus footer */
.malus-hint-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.06);
    overflow: hidden;
}

.malus-hint-fill {
    height: 100%;
    width: 0%;
    background: #c47a78;
    border-radius: 0 2px 2px 0;
    transition: width 0.2s linear;
    box-shadow: 0 0 6px rgba(196,122,120,0.6);
}

/* Animation malus reçu */
@keyframes malusFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes malusIcon {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    50% { transform: scale(1.3) rotate(0deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 0; }
}

/* Bouton bug et profil dans le header */
.header-right {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
}

.header .profile-btn-game {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
}

.bug-button-header {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.bug-button-header:hover {
    background: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.8);
}

/* Animation étoile gagnée */
.star-animation {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    pointer-events: none;
}

.star-animation svg {
    filter: drop-shadow(0 0 30px rgba(254, 243, 216, 0.6));
    animation: starPop 1.5s ease-out forwards;
}

@keyframes starPop {
    0% {
        transform: scale(0) rotate(-20deg);
        opacity: 0;
    }
    20% {
        transform: scale(1.2) rotate(5deg);
        opacity: 1;
    }
    40% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    80% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: scale(1.5) rotate(10deg);
        opacity: 0;
    }
}

/* === FOOTER V2 (avec fond pour que les lettres reposent dessus) === */
.game-footer-v2 {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255,255,255,0.08);
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    box-sizing: border-box;
}

/* === BOUTON INDICE CENTRÉ AVEC ASPECT BOUTON === */
/* === BOUTON PARTAGE DANS LE FOOTER === */
/* === AFFICHAGE CREDITS (header) === */
/* Bouton profil dans le jeu */
.profile-btn-game {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-green, #609E7C);
    color: var(--color-bg, #fef3d8);
    padding: 8px 14px;
    border-radius: 25px;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 100;
    transition: all 0.2s ease;
}

.profile-btn-game:hover {
    background: #4e8a6a;
}

.profile-btn-game i {
    font-size: 0.8rem;
}

.profile-btn-game .profile-credits {
    opacity: 0.85;
    margin-left: 4px;
    padding-left: 8px;
    border-left: 1px solid rgba(255,255,255,0.3);
}

/* Animation pulse sur le bouton profil */
.profile-btn-game.credits-pulse {
    animation: creditsPulse 0.4s ease;
}

/* Animation spécifique pour le bouton dans le header (qui a translateY) */
.header .profile-btn-game.credits-pulse {
    animation: creditsPulseHeader 0.4s ease;
}

@keyframes creditsPulseHeader {
    0% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.15); }
    100% { transform: translateY(-50%) scale(1); }
}

/* Animation pulse sur les credits */
@keyframes creditsPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

/* === POPUP +POINTS (GROS au centre puis s'envole) === */
.points-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
    font-size: 12rem;
    font-weight: 700;
    font-family: 'Barlow Condensed', sans-serif;
    color: #fef3d8;
    opacity: 0;
    z-index: 9999;
    text-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

.points-popup.show-center {
    opacity: 1 !important;
    transform: translate(-50%, -50%) scale(1) !important;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.points-popup.fly-to-credits {
    opacity: 0.9 !important;
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Couleur bleu marine pour le chrono après 60s (aide gratuite) */
/* === CACHER LE BADGE BETA === */
/* Cacher les anciens éléments */
.game-footer-clean,
.game-footer,
.chrono-display,
.share-button-side,
.share-button-top,
.chrono-wrapper,
.chrono-circle-big,
.hint-button-modern,
/* === SYSTEME DE PIECES === */

/* Solde dans le header */
.coins-container {
    position: absolute;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 5px 12px;
    color: #f5c842;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}

.coins-container i {
    font-size: 0.9rem;
}

#coins-display {
    color: var(--color-bg);
    min-width: 16px;
    text-align: center;
}

/* Ancien bouton Indice (garder pour compat) */
.hint-button {
    position: relative;
    padding: 10px 22px;
    font-size: 0.9rem;
    color: #f5c842;
    background-color: rgba(245, 200, 66, 0.1);
    border: 2px solid #f5c842;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-weight: bold;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    margin-top: 5px;
}

.hint-button:hover {
    background-color: #f5c842;
    color: var(--color-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 200, 66, 0.3);
}

.hint-button:active {
    transform: translateY(0);
}

.hint-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: rgba(245, 200, 66, 0.3);
}

.hint-disabled:hover {
    background-color: rgba(245, 200, 66, 0.1);
    color: #f5c842;
    transform: none;
    box-shadow: none;
}

/* Animation shake quand pas assez de pieces */
@keyframes hintShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.hint-shake {
    animation: hintShake 0.5s ease;
}

/* Animation gain de pieces */
@keyframes coinFloat {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-60px) scale(1.3); }
}

/* Responsive pieces */
@media (max-width: 768px) {
    .coins-container {
        right: 15px;
        padding: 4px 10px;
        font-size: 0.75rem;
    }
    
    .hint-button {
        font-size: 0.75rem;
        padding: 7px 16px;
        margin-top: 0;
    }
    
    .hint-button i {
        font-size: 0.9rem;
    }
    
}

/* Sur mobile : footer compact avec le bouton */
@media (max-width: 768px) {
    .game-footer {
        height: 75px; /* Encore plus compact */
    }
    
}

/* Modal "Appel à un·e ami·e" */
.friend-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.friend-modal-content {
    background: var(--color-bg);
    border-radius: 20px;
    padding: 30px 25px;
    max-width: 350px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    text-align: center;
    position: relative;
    animation: popIn 0.3s ease;
}

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

.friend-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--color-dark);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
}

.friend-modal-close:hover {
    opacity: 1;
}

.friend-modal-content h2 {
    color: var(--color-dark);
    font-family: 'Inter', Arial, sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 10px;
    margin-top: 10px;
}

.friend-modal-content p {
    color: var(--color-dark);
    margin-bottom: 15px;
    font-size: 0.95rem;
    opacity: 0.8;
}

.friend-modal-share {
    background: var(--color-green);
    color: var(--color-bg);
    border: none;
    border-radius: 50px;
    padding: 14px 28px;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.2s ease;
}

.friend-modal-share:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(96, 158, 124, 0.4);
}

#friend-canvas {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Styles pour les boîtes de lettres */
.letter-box {
    width: 5.5vw;
    height: 5.5vw;
    background-color: #17586A;
    margin: 0.5vw;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: #ecf0f1;
    transition: background-color 1s, border-radius 0.5s;
    opacity: 0;
    animation: fadeInBox 1s forwards;
    border-radius: 15%;
    position: relative;
    pointer-events: none; /* Laisser passer la souris pour le Canvas */
}

@keyframes fadeInBox {
    to {
        opacity: 1;
    }
}

/* Conteneur des lettres */
.letters {
    display: flex;
    justify-content: center;
    gap: 1vw;
    flex-wrap: wrap;
    min-height: 65px;
    width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
}

.letter {
    width: 6vw;
    height: 6vw;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    user-select: none;
    background-color: transparent;
    transition: border-radius 0.5s;
    border-radius: 10%; /* Utilisation des pourcentages pour un radius proportionnel */
    z-index: 1; /* Place les lettres normales au-dessus */
}

.letter img {
    width: 100%;
    height: 100%;
    transition: border-radius 0.5s;
    border-radius: 10%; /* Utilisation des pourcentages pour un radius proportionnel */
}

.correct { background-color: var(--color-green) !important; transition: background-color 0s !important; }
.correct-7 { background-color: #609E7C !important; transition: background-color 0s !important; }
.correct-6 { background-color: #7ab892 !important; transition: background-color 0s !important; }
.correct-5 { background-color: #c4a574 !important; transition: background-color 0s !important; }
.correct-4 { background-color: #d4b896 !important; transition: background-color 0s !important; }
.correct-3 { background-color: #d4918f !important; transition: background-color 0s !important; }
.correct-2 { background-color: #c47a78 !important; transition: background-color 0s !important; }
.correct-1 { background-color: #375969 !important; transition: background-color 0s !important; }

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Styles pour les petits écrans */
@media (max-width: 768px) {
    .letter, .letter-box {
        width: 9vw;
        height: 9vw;
        border-radius: 10%; /* Toujours en pourcentage */
    }

    .score {
        color: #ecf0f1;
        font-size: 1.5rem;
        text-align: center;
        position: relative;
        z-index: 1;
    }
    
    .game-container {
        width: 100%;
        max-width: 100%;
    }

}

/* Styles pour les très petits écrans */
@media (max-width: 480px) {
    .letter, .letter-box {
        width: 10vw;
        height: 10vw;
        border-radius: 10%; /* Toujours en pourcentage */
    }

    .score {
        font-size: 1rem;
    }

    /* HEADER avec hauteur fixe sur mobile */
    .header {
        height: 100px; /* Hauteur fixe : logo + padding */
        padding: 20px;
    }

    .game-container {
        width: 100%;
        max-width: 100%;
        margin-top: -30px; /* Remonte les cases de 30px ! */
        position: relative;
    }

}

/* Styles pour les écrans larges */
@media (min-width: 769px) {
    .container {
        padding-top: 10px; /* Ajouter un padding top pour descendre les éléments */
    }

    .game-container {
        margin-top: 50px; /* Ajouter de l'espace au-dessus de la zone de jeu */
    }

    .steps-container {
        padding: 10px; /* Ajouter de l'espace autour des étapes */
    }
}

/* Styles pour le bouton de rechargement */
/* Conteneur des étapes - Sous le header */
.steps-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin-top: 25px;
    margin-bottom: 15px;
}

.steps {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 10px; /* Adds horizontal spacing between the steps */
}

.step {
    width: 75px;
    height: 5px;
    background-color: #375969;
    margin: 0 5px; /* Adds horizontal spacing between the steps */
    flex-shrink: 0; /* Prevents the steps from shrinking */
}

.step.current {
    background-color: var(--color-green);
}

/* Styles pour les petits écrans */
@media (max-width: 768px) {
    .step {
        width: 50px; /* Adjust the width for smaller screens */
        margin: 0 2px; /* Reduce the margin for smaller screens */
    }
}

/* Styles pour les très petits écrans */
@media (max-width: 480px) {
    .step {
        width: 35px; /* Further adjust the width for very small screens */
        margin: 0 1px; /* Further reduce the margin for very small screens */
    }
}


/* ========================================
   VERROUILLAGE ORIENTATION PORTRAIT
   ======================================== */

/* Message pour paysage (landscape) */
@media (orientation: landscape) and (max-width: 1024px) {
    body::before {
        content: "📱";
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: var(--color-dark, #21333E);
        color: var(--color-bg, #fef3d8);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        font-size: 4rem;
        z-index: 99999;
    }
    
    body::after {
        content: "Tourne ton téléphone pour jouer";
        position: fixed;
        top: calc(50% + 40px);
        left: 0;
        width: 100vw;
        color: var(--color-bg, #fef3d8);
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        font-family: 'Inter', sans-serif;
        font-size: 1.1rem;
        font-weight: 500;
        padding: 20px;
        z-index: 99999;
        opacity: 0.8;
    }
    
    /* Cacher tout le contenu en landscape */
    body > * {
        display: none !important;
    }
}


/* =========================================
   BOUTON BUG REPORT
   ========================================= */
/* =========================================
   MODAL BUG REPORT
   ========================================= */
.bug-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.bug-modal-content {
    background: var(--color-bg);
    border-radius: 20px;
    padding: 30px 25px;
    text-align: center;
    max-width: 350px;
    width: 100%;
    position: relative;
    animation: popIn 0.3s ease;
}

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

.bug-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--color-dark);
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.bug-modal-close:hover {
    opacity: 1;
}

.bug-modal-content h2 {
    font-family: 'Inter', sans-serif;
    color: var(--color-dark);
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 10px;
}

.bug-modal-content h2 i {
    margin-right: 8px;
    color: #e74c3c;
}

.bug-modal-content p {
    color: var(--color-dark);
    font-size: 0.95rem;
    margin: 0 0 20px;
    opacity: 0.8;
}

.bug-modal-content textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-dark);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    resize: none;
    box-sizing: border-box;
}

.bug-modal-content textarea:focus {
    outline: none;
    border-color: var(--color-green);
}

.bug-modal-content textarea::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

.bug-modal-submit {
    margin-top: 20px;
    background: var(--color-green);
    color: var(--color-bg);
    border: none;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.bug-modal-submit:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(96, 158, 124, 0.4);
}

/* Animation succès bug report */
.bug-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.bug-success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--color-green);
    color: var(--color-dark);
    font-size: 2.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    animation: popSuccess 0.4s ease;
}

.bug-success p {
    color: var(--color-bg);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

@keyframes popSuccess {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* Shake animation pour textarea vide */
.shake {
    animation: shakeIt 0.5s ease;
}

@keyframes shakeIt {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Profile avatar (game header) */
.profile-avatar {
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;
    border-radius: 6px;
    background: rgba(254,243,216,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--color-bg);
    flex-shrink: 0;
    transform: rotate(-3deg);
    overflow: hidden;
    position: relative;
}
.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.friend-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}
.friend-modal[style*="display: flex"],
.friend-modal[style*="display:flex"] {
    display: flex !important;
}
.friend-modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    max-width: 480px;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.friend-modal-close {
    position: absolute;
    top: 12px; right: 16px;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #8a9ba8;
}
.friend-modal-close:hover { color: #21333e; }
.friend-modal-content h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #21333e;
    margin: 0;
}
.friend-modal-share {
    width: 100%;
    padding: 13px;
    border-radius: 25px;
    border: none;
    background: #00a5e8;
    color: #fff;
    font-weight: bold;
    font-size: 0.95rem;
    cursor: pointer;
}
.friend-modal-share:hover { opacity: 0.9; }


/* Bannière offline */
#offline-banner {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9000;
    background: #e67e22;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
    padding: 8px 36px 8px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    animation: slideDown 0.3s ease;
}
@keyframes slideDown {
    from { transform: translateY(-100%); }
    to   { transform: translateY(0); }
}
#offline-banner-close {
    position: absolute;
    right: 12px;
    cursor: pointer;
    opacity: 0.8;
    font-size: 1rem;
}
