/* =========================================================
   ATTRAPE MOI — ZONE DE JEU
   ========================================================= */

/* Conteneur général du jeu */
#game-area {
    width: 100%;
    max-width: 1000px;
    margin: 20px auto 0;
    box-sizing: border-box;
}


/* =========================================================
   HEADER DU JEU
   ========================================================= */

#attrape-game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin: 0 auto 12px;
    padding: 0 5px;

    font-size: 20px;
    font-weight: 700;
}


/* =========================================================
   STATISTIQUES
========================================================= */

.attrape-stats {

    width: 90%;

    max-width: 900px;

    margin: 15px auto;

    display: flex;

    flex-wrap: wrap;

    justify-content: center;

    gap: 10px;
}


.click-stat {

    min-width: 130px;

    padding: 12px 18px;

    background: #1f1f1f;

    border-radius: 10px;

    text-align: center;

    font-weight: bold;

    box-shadow:
        0 3px 10px rgba(0,0,0,0.4);
}


.click-stat strong {

    display: block;

    margin-top: 5px;

    font-size: 20px;
}

.click-stat.normal {

    border: 1px solid #1e90ff;

}

.click-stat.gold {

    border: 1px solid gold;

}

.click-stat.extra {

    border: 1px solid #ff00ff;

}

.click-stat.erreur {

    border: 1px solid #ff4444;

}


/* =========================================================
   ZONE DE JEU
   ========================================================= */

.attrape-zone {
    position: relative;

    width: 100%;
    max-width: 900px;
    height: 500px;

    margin: 0 auto;

    overflow: hidden;

    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 18px;

    background:
        radial-gradient(
            circle at center,
            rgba(255, 255, 255, 0.035),
            rgba(0, 0, 0, 0.12)
        );

    box-shadow:
        inset 0 0 25px rgba(0, 0, 0, 0.20),
        0 4px 18px rgba(0, 0, 0, 0.12);

    box-sizing: border-box;

    /* Empêche certains comportements tactiles gênants */
    touch-action: manipulation;
}


/* =========================================================
   CIBLE
   ========================================================= */

.attrape-target {
    position: absolute;

    display: flex;
    justify-content: center;
    align-items: center;

    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;

    z-index: 10;

    border-radius: 50%;

    /* Évite les petits débordements */
    overflow: hidden;

    transition:
        left 0.15s ease,
        top 0.15s ease,
        transform 0.12s ease,
        opacity 0.12s ease;

    /* Optimisation animation */
    will-change: transform, opacity, left, top;

    /* Meilleur comportement mobile */
    touch-action: manipulation;
}


.attrape-target img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;

    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}


.attrape-target:hover {
    transform: scale(1.08);
}


/* =========================================================
   ANIMATIONS CIBLE
   ========================================================= */

.target-pop {
    animation: targetPop 0.30s cubic-bezier(0.22, 1, 0.36, 1);
}


@keyframes targetPop {

    0% {
        opacity: 0;
        transform: scale(0.2) rotate(-180deg);
    }

    60% {
        opacity: 1;
        transform: scale(1.12) rotate(15deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}


.target-caught {
    animation: targetCaught 0.12s ease-out;
}


@keyframes targetCaught {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.35);
        opacity: 0;
    }
}

/* =========================================================
   CIBLE RATÉE
   ========================================================= */

.target-missed {
    animation: targetMissed 0.18s ease-in forwards;
}


@keyframes targetMissed {

    0% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }

    40% {
        opacity: 0.8;
        transform: scale(0.9) rotate(12deg);
    }

    100% {
        opacity: 0;
        transform: scale(0.55) rotate(-25deg);
    }
}





.bet-box {
    text-align: center;
    margin-bottom: 20px;
}

.bet-box input {
    padding: 8px;
    border-radius: 5px;
    border: none;
    width: 100px;
    text-align: center;
}

.bet-box button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(45deg, gold, orange);
    color: #000;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.bet-box button:hover {
    box-shadow: 0 0 15px gold;
    transform: scale(1.05);
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(45deg, gold, orange);
    color: #000;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

button:hover {
    box-shadow: 0 0 15px gold;
    transform: scale(1.05);
}

.regles-overlay { display: none; position: fixed; z-index: 99999; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.80); align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; } 
.regles-overlay.active { display: flex; }
.regles-popup { position: relative; width: 100%; max-width: 740px; max-height: 90vh; overflow-y: auto; background: #111; border: 1px solid gold; border-radius: 15px; padding: 20px; box-sizing: border-box; box-shadow: 0 10px 40px rgba(0,0,0,0.8), 0 0 25px rgba(255,215,0,0.15); } 
.regles-close { position: absolute; top: 10px; right: 10px; width: 35px; height: 35px; border: none; border-radius: 50%; background: #333; color: white; font-size: 20px; font-weight: bold; cursor: pointer; z-index: 2; } 
.regles-close:hover { background: #ff4444; } 
/* =========================================================
   TABLETTE
   ========================================================= */

@media (max-width: 700px) {

    #game-area {
        margin-top: 15px;
    }

    #attrape-game-header {
        font-size: 17px;
        gap: 10px;
    }

    .attrape-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        margin-bottom: 10px;
    }

    .attrape-stats > div {
        padding: 7px 8px;
        font-size: 13px;
    }

    .attrape-zone {
        height: 400px;
        border-radius: 14px;
    }
}


/* =========================================================
   PETIT MOBILE
   ========================================================= */

@media (max-width: 480px) {

    #game-area {
        margin-top: 10px;
    }

    #attrape-game-header {
        font-size: 16px;
        gap: 8px;
    }

    .attrape-stats {
        gap: 5px;
    }

    .attrape-stats > div {
        padding: 6px 5px;
        font-size: 12px;
        border-radius: 8px;
    }

    .attrape-zone {
        height: 350px;
        border-radius: 12px;
        border-width: 1px;
    }
}


/* =========================================================
   TRÈS PETIT ÉCRAN
   ========================================================= */

@media (max-width: 360px) {

    .attrape-stats > div {
        font-size: 11px;
        padding: 5px 3px;
    }

    .attrape-zone {
        height: 320px;
    }
}