@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;700;900&display=swap');

#gameCanvas #star-catcher-wrapper {
    --sc-bg: radial-gradient(circle at bottom, #4b2c68 0%, #1a0b2e 100%);
    --sc-primary: #FFD700;
    --sc-accent: #ff007f;
    --sc-text: #ffffff;
    --sc-font: 'Poppins', sans-serif;

    position: relative; 
    width: 100%; 
    height: 500px; 
    background: var(--sc-bg);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    font-family: var(--sc-font);
    color: var(--sc-text);
    overflow: hidden;
    user-select: none;
    cursor: crosshair;
    /* IMPORTANT POUR MOBILE : Empêche le zoom/scroll au tap */
    touch-action: none; 
}

#gameCanvas #star-catcher-wrapper:fullscreen {
    border-radius: 0; width: 100vw; height: 100vh;
}

#gameCanvas .sc-hidden { display: none !important; }

/* ECRANS */
#gameCanvas .sc-screen {
    position: absolute; inset: 0;
    background: rgba(10, 5, 20, 0.9);
    backdrop-filter: blur(5px);
    display: none; 
    flex-direction: column; 
    justify-content: center; align-items: center;
    z-index: 50; text-align: center; gap: 20px;
    padding: 20px;
}

#gameCanvas .sc-screen.active { display: flex; animation: fadeIn 0.3s ease; }

#gameCanvas .sc-title {
    font-size: 2rem; margin: 0;
    background: linear-gradient(to right, #FFD700, #ff8a00);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

#gameCanvas .sc-rules {
    background: rgba(255,255,255,0.1); padding: 15px; border-radius: 10px;
    display: flex; gap: 15px; margin: 10px 0; font-size: 0.85rem; flex-wrap: wrap; justify-content: center;
}

/* UI JEU */
#gameCanvas #sc-ui-top {
    position: absolute; top: 0; left: 0; right: 0;
    height: 60px; padding: 0 15px;
    display: flex; justify-content: space-between; align-items: center;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
    z-index: 10; pointer-events: none; 
}

#gameCanvas .sc-stat-box {
    background: rgba(255,255,255,0.15); padding: 4px 12px; border-radius: 20px;
    font-weight: bold; font-size: 1rem; display: flex; align-items: center; gap: 6px;
    border: 1px solid rgba(255,255,255,0.2);
}
#gameCanvas .sc-level-badge {
    text-transform: uppercase; letter-spacing: 2px; font-weight: 900; 
    color: rgba(255,255,255,0.5); font-size: 1rem;
}

#gameCanvas .sc-controls { pointer-events: auto; display: flex; gap: 10px; }
#gameCanvas .sc-btn-icon {
    background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.3);
    color: white; width: 36px; height: 36px; border-radius: 50%;
    cursor: pointer; transition: 0.2s; display: flex; justify-content: center; align-items: center; font-size: 1rem;
}
#gameCanvas .sc-btn-icon:hover { background: white; color: #333; }

/* BOUTONS */
#gameCanvas .sc-btn-primary {
    background: linear-gradient(45deg, #FFD700, #ff8a00);
    border: none; padding: 10px 25px; border-radius: 50px;
    color: #330000; font-weight: 800; font-size: 1rem;
    cursor: pointer; box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    transition: transform 0.1s; text-transform: uppercase;
}
#gameCanvas .sc-btn-primary:active { transform: scale(0.95); }

#gameCanvas .sc-btn-secondary {
    background: rgba(255,255,255,0.2); border: 2px solid white;
    color: white; padding: 8px 20px; border-radius: 50px;
    font-weight: bold; cursor: pointer; transition: 0.2s;
}
#gameCanvas .sc-btn-secondary:hover { background: white; color: #333; }

/* GAME AREA & ETOILES */
#gameCanvas #sc-game-area { width: 100%; height: 100%; position: relative; z-index: 1; }

#gameCanvas .sc-star { 
    position: absolute; cursor: pointer; 
    display: flex; justify-content: center; align-items: center;
    line-height: 1; user-select: none;
    animation: sc-spawn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    filter: drop-shadow(0 0 10px currentColor);
    transform-origin: center;
}
@keyframes sc-spawn { from { transform: scale(0) rotate(-180deg); opacity: 0; } to { transform: scale(1) rotate(0deg); opacity: 1; } }

#gameCanvas .sc-star.fadeout { animation: sc-pop 0.15s ease-out forwards; pointer-events: none; }
@keyframes sc-pop { to { transform: scale(1.5); opacity: 0; } }

/* TYPES */
#gameCanvas .sc-star.bonus { animation: sc-pulse 0.8s infinite alternate; }
#gameCanvas .sc-star.time { animation: sc-spin 3s infinite linear; filter: drop-shadow(0 0 5px cyan); }
#gameCanvas .sc-star.malus { filter: grayscale(1) drop-shadow(0 0 5px red); }

@keyframes sc-pulse { from { transform: scale(1); } to { transform: scale(1.15); } }
@keyframes sc-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* PARTICULES & FLOTTANTS */
#gameCanvas .sc-particle { 
    position: absolute; width: 6px; height: 6px; border-radius: 50%; 
    pointer-events: none; animation: sc-burst 0.6s ease-out forwards; 
}
@keyframes sc-burst { 
    0% { transform: translate(0,0) scale(1); opacity: 1; } 
    100% { transform: var(--translate-end) scale(0); opacity: 0; } 
}

#gameCanvas .sc-floating-text {
    position: absolute; font-weight: bold; font-size: 1.2rem;
    pointer-events: none; animation: sc-floatUp 0.8s ease-out forwards;
    text-shadow: 0 0 3px black; z-index: 20;
}
@keyframes sc-floatUp { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(-30px); opacity: 0; } }

/* RESULTATS */
#gameCanvas .sc-result-circle {
    width: 100px; height: 100px; border-radius: 50%;
    background: rgba(255,255,255,0.1); border: 4px solid var(--sc-primary);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    font-size: 2rem; font-weight: 900; color: var(--sc-primary);
    margin-bottom: 20px;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
}
#gameCanvas .sc-result-circle small { font-size: 0.9rem; color: white; font-weight: normal; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }