body {
    margin: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #111827;
    overflow: hidden;
    font-family: sans-serif;
}

#pack-container {
    width: 250px;
    height: 400px;
    position: relative;
    cursor: pointer;
    filter: drop-shadow(0 15px 20px rgba(0,0,0,0.5));
    perspective: 1000px; /* Nécessaire pour la 3D de la carte */
}

/* ---- LA CARTE (FLIP 3D) ---- */
#card {
    position: absolute;
    top: 10px; left: 10px; right: 10px; bottom: 10px;
    z-index: 1;
    pointer-events: none; /* Inactive tant que le booster n'est pas ouvert */
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

/* Classe ajoutée par le JS pour retourner la carte */
.card-inner.flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden; /* Cache le dos quand la face est tournée */
    border-radius: 12px;
}

/* Face cachée (Dos) */
.card-back {
    background-color: #1f2937;
    box-shadow: inset 0 0 0 6px #374151;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-back-design {
    width: 90%;
    height: 94%;
    background: repeating-linear-gradient(45deg, #111827, #111827 10px, #1f2937 10px, #1f2937 20px);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-crest {
    width: 60px;
    height: 80px;
    background: linear-gradient(135deg, #fbbf24, #d97706);
    border: 3px solid #fef3c7;
    border-radius: 5px 5px 30px 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #78350f;
    font-size: 2.5rem;
    font-weight: 900;
}

/* Face avant (Le design est délégué à votre style_carte.css) */
.card-front {
    background-color: transparent; /* Laisse votre CSS faire le travail */
    transform: rotateY(180deg);
}


/* ---- LES ÉLÉMENTS DU BOOSTER ---- */
#booster-top {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 15%;
    z-index: 2;
    display: flex;
    flex-direction: column;
    transition: transform 0.6s cubic-bezier(0.5, 0, 0.2, 1), opacity 0.6s ease;
    border-radius: 8px 8px 0 0;
}

#booster-body {
    position: absolute;
    top: 15%; left: 0;
    width: 100%; height: 85%;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6 40%, #60a5fa 50%, #3b82f6 60%, #1e3a8a);
    border-radius: 0 0 8px 8px;
    box-shadow: inset 0 0 25px rgba(0,0,0,0.6);
    transition: transform 0.8s cubic-bezier(0.5, 0, 0.2, 1), opacity 0.8s ease;
}

.crimp {
    height: 25px;
    width: 100%;
    background: repeating-linear-gradient(90deg, #1e3a8a, #1e3a8a 3px, #3b82f6 3px, #3b82f6 6px);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5), inset 0 -2px 5px rgba(0,0,0,0.5);
}

.tear-section {
    flex-grow: 1;
    width: 100%;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6 40%, #60a5fa 50%, #3b82f6 60%, #1e3a8a);
    border-bottom: 2px dashed rgba(255, 255, 255, 0.4);
}

.booster-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #fbbf24;
    text-align: center;
    text-shadow: 0 2px 5px rgba(0,0,0,0.8);
    user-select: none;
}

.booster-content h1 { margin: 0; font-size: 1.8rem; font-weight: 900; letter-spacing: 1px; }
.booster-content p { margin: 5px 0 0 0; font-size: 1.1rem; color: #f3f4f6; font-weight: bold; text-transform: uppercase; letter-spacing: 2px; }


/* ---- ANIMATIONS ---- */
.shaking { animation: shake 0.4s ease-in-out infinite; }

@keyframes shake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-2px, 2px) rotate(-1deg); }
    50% { transform: translate(2px, -2px) rotate(1deg); }
    75% { transform: translate(-2px, -2px) rotate(-1deg); }
}

/* OUVERTURE : Le haut slide en l'air, le bas coule en bas */
.open #booster-top {
    transform: translateY(-100vh); /* Part tout droit vers le haut */
    opacity: 0;
    pointer-events: none;
}

.open #booster-body {
    transform: translateY(100vh);
    opacity: 0;
    pointer-events: none;
}
/* ==========================================
   COMPTEUR DE BOOSTERS
   ========================================== */
#booster-compteur {
    position: absolute;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    color: #fbbf24;
    font-weight: bold;
    letter-spacing: 1px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.9);
    white-space: nowrap;
}

#booster-compteur:empty {
    display: none;
}

/* ==========================================
   BOUTONS DE FIN (Collection & Rejouer)
   ========================================== */
/* ==========================================
   BOUTONS RECTANGLES CSS (UI Jeu Vidéo)
   ========================================== */
#action-buttons {
    position: absolute;
    bottom: 40px;
    display: flex;
    gap: 25px;
    z-index: 10;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

#action-buttons.visible {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
}

/* Le rectangle de base */
.rect-btn {
    position: relative;
    width: 220px;
    height: 50px;
    background: rgba(17, 24, 39, 0.85); /* Fond très sombre et légèrement transparent */
    border: 1px solid rgba(217, 119, 6, 0.4); /* Bordure orange discrète */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    overflow: hidden; /* Empêche l'animation de déborder du rectangle */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    transition: all 0.3s ease;
}

/* Le texte à l'intérieur */
.rect-btn span {
    color: #fbbf24; /* Jaune doré */
    font-family: sans-serif;
    font-size: 0.95rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    z-index: 2;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.9);
    transition: color 0.3s ease;
}

/* L'effet de rayon lumineux (Shine) qui va traverser le rectangle */
.rect-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%; /* Caché à gauche au départ */
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.4), transparent);
    transform: skewX(-25deg); /* Incline le rayon lumineux */
    transition: none; /* Pas d'animation au repos */
    z-index: 1;
}

/* --- EFFETS AU SURVOL --- */
.rect-btn:hover {
    border-color: #fbbf24; /* La bordure s'illumine en or */
    background: rgba(31, 41, 55, 0.95); /* Le fond s'éclaircit très légèrement */
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.4), inset 0 0 10px rgba(217, 119, 6, 0.3); /* Halo externe et interne */
    transform: translateY(-2px);
}

.rect-btn:hover span {
    color: #fff; /* Le texte devient blanc pur pour flasher */
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.8);
}

/* Animation du rayon lumineux au survol */
.rect-btn:hover::before {
    left: 200%; /* Le rayon traverse tout le rectangle de gauche à droite */
    transition: left 0.6s ease-in-out; /* Durée du balayage */
}

/* Effet lors du clic */
.rect-btn:active {
    transform: translateY(2px) scale(0.98); /* S'enfonce légèrement */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}

