@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

#gameCanvas #melo-game-wrapper {
    /* Palette */
    --mm-bg: linear-gradient(135deg, #240b36 0%, #c31432 100%); 
    --mm-pad-1: #4cd137; /* Vert */
    --mm-pad-2: #e84118; /* Rouge */
    --mm-pad-3: #fbc531; /* Jaune */
    --mm-pad-4: #0097e6; /* Bleu */
    --mm-text: #ffffff;
    
    font-family: 'Poppins', sans-serif;
    background: var(--mm-bg);
    display: flex; justify-content: center; align-items: center;
    overflow: hidden; position: relative;
    padding: 10px; width: 100%; min-height: 550px;
    border-radius: 20px;
}

/* PLEIN ECRAN */
#gameCanvas #melo-game-wrapper:fullscreen {
    width: 100vw; height: 100vh;
    border-radius: 0;
}

#gameCanvas .mm-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 30px;
    width: 100%; max-width: 500px; 
    height: 100%; min-height: 500px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    position: relative; overflow: hidden; z-index: 2;
    display: flex; flex-direction: column; align-items: center;
}

#gameCanvas .hidden { display: none !important; }
#gameCanvas .mm-hidden { display: none !important; }
#gameCanvas .active { display: flex !important; }

/* PARTICULES */
#gameCanvas .mm-background-particles { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
#gameCanvas .mm-particle { position: absolute; width: 6px; height: 6px; background: rgba(255, 255, 255, 0.2); border-radius: 50%; animation: mm-float 8s ease-in-out infinite; }
@keyframes mm-float { 0%, 100% { transform: translateY(0px) scale(0.5); opacity: 0; } 50% { transform: translateY(-50px) scale(1); opacity: 1; } }

/* ECRANS */
#gameCanvas .mm-screen { 
    position: absolute; inset: 0;
    display: none; flex-direction: column; justify-content: center; align-items: center; 
    background: rgba(36, 11, 54, 0.95); padding: 20px; z-index: 50;
    text-align: center; animation: fadeIn 0.4s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* UI */
#gameCanvas .mm-title { font-size: 2.5rem; margin: 0; background: linear-gradient(45deg, #ff9a9e, #fad0c4); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
#gameCanvas .mm-subtitle { color: #ddd; font-size: 1rem; margin-top: 10px; margin-bottom: 30px; }

#gameCanvas #mm-ui {
    width: 100%; display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;
    background: rgba(0,0,0,0.3); padding: 10px 20px; border-radius: 50px;
}
#gameCanvas .mm-score-box { font-size: 1.2rem; font-weight: bold; color: white; }
#gameCanvas #mm-message-display { color: #fbc531; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; font-size: 0.9rem; }

/* BOUTONS */
#gameCanvas .mm-btn-primary { 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white; border: none; padding: 15px 40px; font-size: 1.2rem; font-weight: 600; 
    border-radius: 50px; cursor: pointer; box-shadow: 0 8px 20px rgba(118, 75, 162, 0.4); 
    transition: transform 0.2s;
}
#gameCanvas .mm-btn-primary:hover { transform: translateY(-3px); }

#gameCanvas .mm-btn-secondary {
    background: transparent; border: 2px solid white; color: white;
    padding: 10px 30px; border-radius: 50px; font-weight: bold; cursor: pointer;
    transition: 0.2s; margin-top: 20px;
}
#gameCanvas .mm-btn-secondary:hover { background: white; color: #333; }

#gameCanvas .mm-btn-icon {
    background: rgba(255,255,255,0.2); border: none; color: white;
    width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
    display: flex; justify-content: center; align-items: center; font-size: 1.2rem;
}
#gameCanvas .mm-btn-icon:hover { background: rgba(255,255,255,0.4); }

/* PADS (Zone de jeu) - Version plus vive */
#gameCanvas #mm-pads-container { flex-grow: 1; display: flex; justify-content: center; align-items: center; width: 100%; }
#gameCanvas .mm-pads-grid { 
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; 
    width: 100%; max-width: 320px; aspect-ratio: 1; 
}
#gameCanvas .mm-pad { 
    border-radius: 20px; cursor: pointer; 
    box-shadow: 0 10px 20px rgba(0,0,0,0.3), inset 0 0 20px rgba(0,0,0,0.2); 
    transition: transform 0.1s, filter 0.1s;
    opacity: 0.85; /* Augmenté pour visibilité */
    position: relative;
    border: 2px solid rgba(255,255,255,0.1);
}
#gameCanvas .mm-pad[data-pad="0"] { background: var(--mm-pad-1); }
#gameCanvas .mm-pad[data-pad="1"] { background: var(--mm-pad-2); }
#gameCanvas .mm-pad[data-pad="2"] { background: var(--mm-pad-3); }
#gameCanvas .mm-pad[data-pad="3"] { background: var(--mm-pad-4); }

/* Effet allumé (Flash) */
#gameCanvas .mm-pad:active, #gameCanvas .mm-pad.mm-active { 
    opacity: 1; transform: scale(0.96); 
    box-shadow: 0 0 30px currentColor; /* Effet Néon */
    filter: brightness(1.5); /* Flash lumineux */
    z-index: 10;
}
#gameCanvas .mm-pad.mm-disabled { cursor: default; pointer-events: none; }

/* RESULTATS */
#gameCanvas .mm-result-card {
    background: white; border-radius: 20px; padding: 30px; width: 100%;
    color: #333; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
#gameCanvas .mm-score-circle {
    width: 100px; height: 100px; border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white; display: flex; flex-direction: column; justify-content: center; align-items: center;
    font-size: 2.5rem; font-weight: bold; margin: 0 auto 15px;
}
#gameCanvas .mm-score-circle small { font-size: 0.8rem; font-weight: normal; opacity: 0.8; }
#gameCanvas .mm-title-end { color: white; margin-bottom: 20px; font-size: 1.8rem; }