/**
 * PATRIX - Animations et Effets
 * Auteur: Emmanuel Payet
 */

/* Animation de gravité - blocs qui tombent */
@keyframes blockFall {
    0% {
        transform: translateY(-100%);
        opacity: 0.7;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.cell.falling {
    animation: blockFall 0.15s ease-in;
}

/* Animation de shake de la grille */
@keyframes gridShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

.board.shaking {
    animation: gridShake 0.4s ease-in-out;
}

/* Particules d'explosion */
.explosion-particle {
    position: absolute;
    pointer-events: none;
    font-size: 16px;
    color: #ffd700;
    animation: particle 1s ease-out forwards;
    z-index: 1000;
}

@keyframes particle {
    0% {
        transform: scale(1) translate(0, 0);
        opacity: 1;
    }
    100% {
        transform: scale(0.3) translate(var(--dx), var(--dy));
        opacity: 0;
    }
}

/* Particules de lumière qui montent */
.light-particle {
    animation: floatUp 1.5s ease-out forwards;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) scale(0.5);
        opacity: 0;
    }
}

/* Flash d'écran */
@keyframes flashFade {
    0% {
        opacity: 0.3;
    }
    100% {
        opacity: 0;
    }
}

/* Animation Wind Push - Particules de vent */
@keyframes windExplosion {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.9;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.5);
        opacity: 0;
    }
}

/* Onde de choc du Wind Push */
@keyframes shockwaveExpand {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
        border-width: 2px;
    }
    50% {
        opacity: 0.5;
        border-width: 3px;
    }
    100% {
        transform: translate(-50%, -50%) scale(15);
        opacity: 0;
        border-width: 1px;
    }
}

/* Messages spirituels */
@keyframes messageAppear {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes messageDisappear {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
}

/* Animations combo */
@keyframes comboAppear {
    0% {
        transform: translate(-50%, -50%) scale(0.5) rotate(-10deg);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1) rotate(5deg);
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes comboDisappear {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0;
    }
}

/* Styles des messages combo optimisés avec GPU acceleration */
.combo-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(255, 248, 225, 0.98), rgba(255, 250, 235, 0.98));
    padding: 15px 30px;
    border-radius: 12px;
    text-align: center;
    z-index: 10000;
    display: none;
    max-width: 90%;
    
    /* Optimisations GPU */
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    transform-style: preserve-3d;
}

.combo-text {
    font-size: 1.6em;
    font-weight: bold;
    color: #c9a66b;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.combo-extra {
    font-size: 1em;
    color: #d4af37;
    margin-top: 5px;
}

/* Animations combo optimisées avec GPU */
@keyframes comboAppear {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5) translateZ(0);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) translateZ(0);
    }
}

@keyframes comboDisappear {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) translateZ(0);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8) translateZ(0);
    }
}

/* Variantes d'intensité */
.combo-normal { border: 3px solid #d4af37; box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4); }
.combo-super { border: 3px solid #c9a66b; box-shadow: 0 4px 25px rgba(201, 166, 107, 0.5); }
.combo-mega { border: 3px solid #ffb86c; box-shadow: 0 6px 30px rgba(255, 184, 108, 0.6); }
.combo-amazing { border: 3px solid #ff9a76; box-shadow: 0 6px 35px rgba(255, 154, 118, 0.6); }
.combo-legendary { border: 3px solid #ff7e67; box-shadow: 0 8px 40px rgba(255, 126, 103, 0.7); }
.combo-ultimate { border: 3px solid #ff6b9d; box-shadow: 0 10px 50px rgba(255, 107, 157, 0.8); }

/* Styles des messages de ligne */
.line-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(255, 248, 225, 0.98), rgba(255, 250, 235, 0.98));
    padding: 15px 30px;
    border-radius: 12px;
    text-align: center;
    z-index: 9999;
    display: none;
    max-width: 90%;
    
    /* Optimisations GPU */
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    transform-style: preserve-3d;
}

.line-text {
    font-size: 1.6em;
    font-weight: bold;
}

.line-combo {
    font-size: 1em;
    margin-top: 5px;
}

/* Variantes d'intensité pour les lignes */
.line-single { border: 3px solid #4fc3f7; box-shadow: 0 4px 20px rgba(79, 195, 247, 0.4); }
.line-single .line-text { color: #4fc3f7; }
.line-single .line-combo { color: #29b6f6; }

.line-double { border: 3px solid #ffa500; box-shadow: 0 6px 25px rgba(255, 165, 0, 0.5); }
.line-double .line-text { color: #ffa500; }
.line-double .line-combo { color: #ff8c00; }

.line-triple { border: 3px solid #ff8c00; box-shadow: 0 6px 30px rgba(255, 140, 0, 0.6); }
.line-triple .line-text { color: #ff8c00; }
.line-triple .line-combo { color: #ff7f50; }

.line-patrix { border: 3px solid #ff6b9d; box-shadow: 0 8px 40px rgba(255, 107, 157, 0.8); }
.line-patrix .line-text { color: #ff6b9d; }
.line-patrix .line-combo { color: #ff1493; }

/* Effet de pulse sur cellule cliquable */
.cell.poppable {
    cursor: pointer;
    animation: cellPulse 1s ease-in-out infinite;
}

@keyframes cellPulse {
    0%, 100% {
        box-shadow: inset 0 0 0 2px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: inset 0 0 0 2px rgba(255, 215, 0, 0.7);
    }
}

/* Animation de transformation des lignes (ombre → lumière) */
@keyframes lineTransform {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.8;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* Animation pour pop combo display */
@keyframes comboPulse {
    0% {
        transform: scale(1);
        color: #ff8c00;
    }
    50% {
        transform: scale(1.3);
        color: #ffd700;
    }
    100% {
        transform: scale(1);
        color: #ff8c00;
    }
}

@keyframes comboPulseBig {
    0% {
        transform: scale(1) rotate(0deg);
        color: #ff8c00;
        text-shadow: 
            0 0 20px rgba(255, 140, 0, 0.8),
            0 0 40px rgba(255, 215, 0, 0.6);
    }
    50% {
        transform: scale(1.5) rotate(5deg);
        color: #ffd700;
        text-shadow: 
            0 0 40px rgba(255, 140, 0, 1),
            0 0 80px rgba(255, 215, 0, 0.8),
            0 0 120px rgba(255, 140, 0, 0.4);
    }
    100% {
        transform: scale(1.2) rotate(0deg);
        color: #ff8c00;
        text-shadow: 
            0 0 30px rgba(255, 140, 0, 0.9),
            0 0 60px rgba(255, 215, 0, 0.7);
    }
}

@keyframes comboPulseMega {
    0% {
        transform: scale(1);
        color: #ff0000;
        text-shadow: 
            0 0 20px rgba(255, 0, 0, 0.8),
            0 0 40px rgba(255, 140, 0, 0.6);
    }
    25% {
        transform: scale(1.15);
        color: #ff8c00;
        text-shadow: 
            0 0 40px rgba(255, 0, 0, 1),
            0 0 80px rgba(255, 140, 0, 1),
            0 0 120px rgba(255, 215, 0, 0.6);
    }
    50% {
        transform: scale(1.3);
        color: #ffd700;
        text-shadow: 
            0 0 50px rgba(255, 140, 0, 1),
            0 0 100px rgba(255, 215, 0, 1),
            0 0 150px rgba(255, 215, 0, 0.8);
    }
    75% {
        transform: scale(1.15);
        color: #ff8c00;
        text-shadow: 
            0 0 40px rgba(255, 140, 0, 1),
            0 0 80px rgba(255, 215, 0, 0.9);
    }
    100% {
        transform: scale(1.1);
        color: #ff6b00;
        text-shadow: 
            0 0 50px rgba(255, 140, 0, 1),
            0 0 100px rgba(255, 215, 0, 0.8);
    }
}

/* Affichage combo pop */
.pop-combo-display {
    position: fixed;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.8em;
    font-weight: 700;
    color: #ff8c00;
    text-shadow: 
        0 0 10px rgba(255, 140, 0, 0.6),
        0 2px 4px rgba(0, 0, 0, 0.3);
    -webkit-text-stroke: 2px white;
    text-stroke: 2px white;
    paint-order: stroke fill;
    z-index: 9998;
    display: none;
    pointer-events: none;
    letter-spacing: 2px;
    animation: comboPulse 0.5s ease-out;
    max-width: 90%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 10px 20px;
}

.pop-combo-display.pop-big {
    font-size: 2.0em;
    max-width: 85%;
}

.pop-combo-display.pop-mega {
    font-size: 2.3em;
    font-weight: 900;
    max-width: 80%;
}

/* Effet dynamique Wall Break */
.wall-break-effect {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    pointer-events: none;
}

.wall-break-icon {
    font-size: 5em;
    animation: wallBreakShake 0.6s ease-out;
    filter: drop-shadow(0 0 30px rgba(139, 69, 19, 0.8));
}

.wall-break-text {
    font-size: 2.5em;
    font-weight: 700;
    color: #d2691e;
    text-shadow: 
        0 0 20px rgba(139, 69, 19, 0.8),
        0 4px 8px rgba(0, 0, 0, 0.5);
    -webkit-text-stroke: 2px white;
    text-stroke: 2px white;
    paint-order: stroke fill;
    margin-top: 10px;
    animation: wallBreakText 0.6s ease-out;
    letter-spacing: 3px;
}

.wall-break-particles {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.wall-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #8b4513, #d2691e);
    border-radius: 2px;
    animation: wallParticleExplode 0.8s ease-out forwards;
    box-shadow: 0 0 10px rgba(139, 69, 19, 0.6);
}

@keyframes wallBreakShake {
    0%, 100% { transform: translate(0, 0) scale(1); }
    10% { transform: translate(-10px, -5px) scale(1.1) rotate(-5deg); }
    20% { transform: translate(10px, 5px) scale(1.15) rotate(5deg); }
    30% { transform: translate(-8px, -3px) scale(1.2) rotate(-3deg); }
    40% { transform: translate(8px, 3px) scale(1.25) rotate(3deg); }
    50% { transform: translate(-5px, -2px) scale(1.3) rotate(-2deg); }
    60% { transform: translate(5px, 2px) scale(1.2) rotate(2deg); }
    70% { transform: translate(-3px, -1px) scale(1.1) rotate(-1deg); }
    80% { transform: translate(3px, 1px) scale(1.05) rotate(1deg); }
    90% { transform: translate(0, 0) scale(1) rotate(0deg); }
}

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

@keyframes wallParticleExplode {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0) rotate(360deg);
        opacity: 0;
    }
}

/* Effet dynamique Swap */
.swap-effect {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    pointer-events: none;
}

.swap-icon {
    font-size: 5em;
    animation: swapRotate 0.8s ease-in-out;
    filter: drop-shadow(0 0 30px rgba(255, 140, 0, 0.8));
}

.swap-text {
    font-size: 2.5em;
    font-weight: 700;
    color: #ff8c00;
    text-shadow: 
        0 0 20px rgba(255, 140, 0, 0.8),
        0 4px 8px rgba(0, 0, 0, 0.5);
    -webkit-text-stroke: 2px white;
    text-stroke: 2px white;
    paint-order: stroke fill;
    margin-top: 10px;
    animation: swapTextBounce 0.6s ease-out;
    letter-spacing: 3px;
}

.swap-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.swap-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border: 4px solid #ff8c00;
    border-radius: 50%;
    animation: swapRingExpand 0.8s ease-out forwards;
    opacity: 0.8;
}

@keyframes swapRotate {
    0% { transform: rotate(0deg) scale(0.5); opacity: 0; }
    50% { transform: rotate(360deg) scale(1.3); opacity: 1; }
    100% { transform: rotate(720deg) scale(1); opacity: 1; }
}

@keyframes swapTextBounce {
    0% { 
        transform: translateY(20px) scale(0.8); 
        opacity: 0; 
    }
    60% { 
        transform: translateY(-5px) scale(1.1); 
        opacity: 1; 
    }
    100% { 
        transform: translateY(0) scale(1); 
        opacity: 1; 
    }
}

@keyframes swapRingExpand {
    0% {
        width: 80px;
        height: 80px;
        opacity: 0.8;
    }
    100% {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

/* Animations pour messages de récompense */
@keyframes rewardAppear {
    0% {
        transform: translate(-50%, -50%) scale(0.5) rotate(-5deg);
        opacity: 0;
    }
    60% {
        transform: translate(-50%, -50%) scale(1.1) rotate(2deg);
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes rewardDisappear {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* Panel d'info */
.info-panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    text-align: center;
    min-width: 220px;
}

.score-item {
    margin-bottom: 20px;
}

.score-label {
    font-size: 1em;
    color: #ffeb3b;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

.score-value {
    font-size: 2.5em;
    font-weight: 700;
    background: linear-gradient(45deg, #ffd700, #ffeb3b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Pièce suivante */
.next-piece {
    margin-top: 30px;
}

.next-piece h3 {
    font-weight: 500;
    margin-bottom: 15px;
    color: #ffeb3b;
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.next-grid {
    display: grid;
    grid-template-columns: repeat(4, 28px);
    gap: 3px;
    margin: 15px auto;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 12px;
}

.next-cell {
    width: 9px;
    height: 9px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
}

.next-cell.filled {
    border: none;
    opacity: 0.9;
}

/* Boutons */
.game-button {
    background: linear-gradient(135deg, #ffd700, #ffeb3b);
    border: none;
    border-radius: 12px;
    padding: 15px 40px;
    font-size: 1.2em;
    font-weight: 600;
    color: #1a1a2e;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.game-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

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

/* Game Over Panel - Style cristal blanc épuré */
.game-over-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(245, 241, 232, 0.98));
    backdrop-filter: blur(20px);
    border-radius: 15px;
    padding: 50px;
    text-align: center;
    border: 3px solid #d4af37;
    box-shadow: 0 20px 60px rgba(212, 175, 55, 0.3),
                inset 0 0 40px rgba(255, 255, 255, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 10000;
    max-width: 90%;
}

.game-over-panel.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: all;
}

.game-over-panel h2 {
    font-size: 3em;
    color: #d4af37;
    text-shadow: 0 2px 4px rgba(212, 175, 55, 0.3);
    margin-bottom: 20px;
    font-weight: 600;
    letter-spacing: 2px;
}

.game-over-panel p {
    font-size: 1.5em;
    color: #5a5a5a;
    margin-bottom: 30px;
}

/* Pause Panel - Style cristal blanc épuré */
.pause-panel {
    position: absolute;
    top: 15px;
    left: 15px;
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    backdrop-filter: blur(12px);
    border-radius: 50%;
    border: 2px solid rgba(129, 199, 132, 0.5);
    box-shadow: 0 4px 15px rgba(129, 199, 132, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 9999;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.pause-panel.show {
    opacity: 1;
    pointer-events: all;
}

.pause-panel.expanded {
    border-radius: 20px;
    width: 200px;
    height: auto;
    flex-direction: column;
    padding: 15px;
    cursor: default;
}

.pause-icon {
    font-size: 1.8em;
    transition: all 0.3s;
    user-select: none;
}

.pause-panel.expanded .pause-icon {
    font-size: 1.3em;
    margin-bottom: 8px;
}

.pause-content {
    display: none;
    width: 100%;
}

.pause-panel.expanded .pause-content {
    display: block;
    animation: fadeInContent 0.3s ease-out 0.2s both;
}

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

.pause-panel h2 {
    font-size: 1.3em;
    color: #66bb6a;
    text-shadow: 0 2px 4px rgba(129, 199, 132, 0.2);
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Boutons du menu pause */
.pause-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    width: 100%;
}

.pause-action-btn {
    background: linear-gradient(135deg, #c8e6c9, #dcedc8);
    border: 2px solid rgba(129, 199, 132, 0.4);
    border-radius: 10px;
    padding: 12px;
    font-size: 1.2em;
    font-weight: 600;
    color: #558b2f;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(129, 199, 132, 0.2);
    width: 100%;
}

.pause-action-btn:hover {
    background: linear-gradient(135deg, #a5d6a7, #c5e1a5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(129, 199, 132, 0.35);
    border-color: rgba(129, 199, 132, 0.6);
}

.pause-action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(129, 199, 132, 0.25);
}

.pause-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Menu Sauvegardes/Chargement */
.save-load-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.save-load-modal.show {
    display: flex;
}

.save-load-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 3px solid #d4af37;
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(212, 175, 55, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

.save-load-content h2 {
    font-size: 2em;
    color: #d4af37;
    text-shadow: 0 2px 4px rgba(212, 175, 55, 0.3);
    margin-bottom: 25px;
    text-align: center;
    font-weight: 600;
}

.save-slots {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.save-slot {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
    border: 2px solid #444;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.save-slot:hover {
    border-color: #d4af37;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

.save-slot.empty {
    border-style: dashed;
    opacity: 0.6;
}

.save-slot.empty:hover {
    opacity: 1;
}

.slot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.slot-number {
    font-size: 1.2em;
    font-weight: 600;
    color: #d4af37;
}

.slot-delete {
    background: #e74c3c;
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    color: white;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
}

.slot-delete:hover {
    background: #c0392b;
}

.slot-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    color: #bbb;
    font-size: 0.9em;
}

.slot-info-item {
    display: flex;
    flex-direction: column;
}

.slot-info-label {
    color: #888;
    font-size: 0.85em;
    text-transform: uppercase;
}

.slot-info-value {
    color: #fff;
    font-weight: 600;
    margin-top: 2px;
}

.slot-date {
    color: #888;
    font-size: 0.8em;
    margin-top: 8px;
    text-align: right;
}

.save-load-close {
    width: 100%;
    background: linear-gradient(135deg, #444, #666);
    border: 2px solid #888;
    border-radius: 8px;
    padding: 12px;
    font-size: 1.1em;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-load-close:hover {
    background: linear-gradient(135deg, #555, #777);
    border-color: #aaa;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Animation de pièce qui tombe et se brise (début de niveau) */
.level-break-piece {
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
}

@keyframes fragmentExplode {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--dx), var(--dy)) rotate(var(--rotation)) scale(0.3);
        opacity: 0;
    }
}

.piece-fragment {
    animation: fragmentExplode 1.2s ease-out forwards;
}

/* Mots d'encouragement qui montent au ciel */
.rising-word {
    white-space: nowrap;
}

@keyframes riseToHeaven {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(-400px) scale(1.3);
        opacity: 0;
    }
}

/* ===== ANIMATIONS COMBO ===== */

/* Texte combo explosif */
@keyframes comboExplode {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(-10deg);
        opacity: 0;
    }
    30% {
        transform: translate(-50%, -50%) scale(1.3) rotate(5deg);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1) rotate(-2deg);
        opacity: 1;
    }
    70% {
        transform: translate(-50%, -50%) scale(1.2) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -120%) scale(0.8) rotate(0deg);
        opacity: 0;
    }
}

/* Particules de combo */
@keyframes comboParticle {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
        opacity: 1;
    }
    20% {
        opacity: 1;
    }
    100% {
        transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.5) rotate(720deg);
        opacity: 0;
    }
}

/* Onde de choc du combo */
@keyframes shockwaveExpand {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(15);
        opacity: 0;
    }
}

/* Flash d'écran pour gros combos */
@keyframes screenFlash {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 0.4;
    }
    100% {
        opacity: 0;
    }
}

/* Style pour les éléments de combo */
.combo-text {
    font-family: 'Arial Black', sans-serif;
    letter-spacing: 2px;
    user-select: none;
}

.combo-particle {
    user-select: none;
}

.combo-shockwave {
    user-select: none;
}

/* Responsive */
@media (max-width: 768px) {
    .info-panel {
        padding: 20px;
        min-width: 160px;
    }
    
    .score-value {
        font-size: 2em;
    }
    
    .game-over-panel h2 {
        font-size: 2em;
    }
}

/* Section Profil dans le panneau Trophées - Épuré Pastel Beige */
.profile-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #fff8e1, #fffaeb);
    border-radius: 12px;
    margin-bottom: 20px;
    border: 2px solid rgba(245, 222, 179, 0.5);
    box-shadow: 0 2px 12px rgba(245, 222, 179, 0.15);
    pointer-events: auto;
}

.profile-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.profile-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.profile-name {
    font-size: 1.3em;
    font-weight: 600;
    color: #c9a66b;
    text-align: center;
}

.profile-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar svg {
    display: block;
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 2px 6px rgba(245, 222, 179, 0.25));
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    pointer-events: auto;
}

.profile-edit-btn {
    background: linear-gradient(135deg, #fff8e1, #fffaeb);
    border: 2px solid rgba(245, 222, 179, 0.6);
    border-radius: 8px;
    padding: 10px 20px;
    color: #d4a574;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(245, 222, 179, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(212, 165, 116, 0.2);
}

.profile-edit-btn:hover {
    background: linear-gradient(135deg, #fffaeb, #fff8e1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 222, 179, 0.3);
    border-color: rgba(245, 222, 179, 0.8);
}

.profile-edit-btn:active {
    transform: translateY(0);
}

.profile-share-btn {
    background: linear-gradient(135deg, #4fc3f7, #29b6f6);
    border: 2px solid rgba(79, 195, 247, 0.6);
    border-radius: 8px;
    padding: 12px 20px;
    color: white;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(79, 195, 247, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(79, 195, 247, 0.2);
    pointer-events: auto;
}

.profile-share-btn:hover {
    background: linear-gradient(135deg, #29b6f6, #03a9f4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 195, 247, 0.5);
    border-color: rgba(79, 195, 247, 0.8);
}

.profile-share-btn:active {
    transform: translateY(0);
}

.share-icon {
    font-size: 1.5em;
    flex-shrink: 0;
}

.share-text {
    font-size: 0.9em;
    line-height: 1.3;
    text-align: left;
}

/* Modal Édition Profil - Épuré Pastel Beige */
.profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(245, 238, 220, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    backdrop-filter: blur(8px);
}

.profile-modal.show {
    display: flex;
    animation: modalFadeIn 0.4s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.profile-modal-content {
    background: linear-gradient(135deg, #fff8e1, #fffaeb);
    border: 2px solid rgba(245, 222, 179, 0.6);
    border-radius: 15px;
    padding: 35px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 30px rgba(245, 222, 179, 0.2);
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    scroll-behavior: smooth;
}

.profile-modal-content h2 {
    color: #c9a66b;
    text-align: center;
    font-size: 2em;
    margin-bottom: 25px;
    font-weight: 600;
}

.profile-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 248, 225, 0.8);
    border: 2px solid rgba(245, 222, 179, 0.4);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: #c9a66b;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(245, 222, 179, 0.2);
}

.profile-modal-close:hover {
    color: #b8935c;
    background: rgba(255, 250, 235, 1);
    transform: rotate(90deg);
    box-shadow: 0 4px 12px rgba(245, 222, 179, 0.3);
}

.profile-form label {
    display: block;
    color: #c9a66b;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.profile-form input[type="text"] {
    width: 100%;
    padding: 14px;
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid rgba(245, 222, 179, 0.5);
    border-radius: 10px;
    color: #5a4a3a;
    font-size: 1.1em;
    margin-bottom: 20px;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(245, 222, 179, 0.15);
    font-weight: 500;
}

.profile-form input[type="text"]:focus {
    outline: none;
    border-color: rgba(245, 222, 179, 0.8);
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 12px rgba(245, 222, 179, 0.25);
    transform: translateY(-1px);
}

/* Grille d'avatars - Épuré Pastel Beige */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 12px;
    margin-bottom: 25px;
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(245, 222, 179, 0.15);
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    scroll-behavior: smooth;
}

.avatar-option {
    width: 70px;
    height: 70px;
    cursor: pointer;
    border: 2px solid rgba(245, 222, 179, 0.3);
    border-radius: 50%;
    transition: all 0.3s;
    padding: 5px;
    background: rgba(255, 248, 225, 0.6);
    box-shadow: 0 2px 8px rgba(245, 222, 179, 0.15);
}

.avatar-option:hover {
    border-color: rgba(245, 222, 179, 0.8);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(245, 222, 179, 0.25);
    background: rgba(255, 250, 235, 0.8);
}

.avatar-option.selected {
    border-color: #d4a574;
    border-width: 3px;
    background: rgba(255, 250, 235, 1);
    box-shadow: 0 4px 15px rgba(212, 165, 116, 0.3);
}

.avatar-option svg {
    width: 100%;
    height: 100%;
    display: block;
}

.profile-save-btn {
    width: 100%;
    background: linear-gradient(135deg, #fff8e1, #fffaeb);
    border: 2px solid rgba(245, 222, 179, 0.6);
    border-radius: 12px;
    padding: 16px;
    color: #c9a66b;
    font-size: 1.3em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(245, 222, 179, 0.2);
}

.profile-save-btn:hover {
    background: linear-gradient(135deg, #fffaeb, #fff8e1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 222, 179, 0.3);
    border-color: rgba(245, 222, 179, 0.8);
}

.profile-save-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(245, 222, 179, 0.2);
}

/* Guide des contrôles */
.controls-guide {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 5px 0;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(245, 222, 179, 0.4);
    border-radius: 8px;
    transition: all 0.3s;
}

.control-item:hover {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(245, 222, 179, 0.6);
    transform: translateX(5px);
}

.control-icon {
    font-size: 2em;
    min-width: 40px;
    text-align: center;
}

.control-text {
    flex: 1;
}

.control-text strong {
    display: block;
    color: #c9a66b;
    font-size: 1em;
    margin-bottom: 3px;
}

.control-text p {
    color: #8a7a6a;
    font-size: 0.85em;
    margin: 0;
}
