.case-opening{
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 2%;
    padding: 2% 2% 2% 2%;
}

.left-media{
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.media-stage{
    position: absolute;
    left: 72%;
    top: 400px; /* Position fixe en pixels pour maintenir une distance constante du haut */
    transform: translate(-50%, -50%);
    width: min(42vw, 1000px);
    max-width: 800px;
    height: auto;
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* n'affecte pas les interactions */
    z-index: 20; /* premier plan */
}

.media-stage img,
.media-stage video{
    height: 100%;
    width: auto;
    object-fit: contain;
}

/* Ensure media (image/video) are perfectly centered and crossfading */
.media-item{
    position: absolute;
    inset: 0;          /* top:0 right:0 bottom:0 left:0 */
    margin: auto;
    width: auto;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 220ms ease;
}

.winner-overlay{
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 38%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,.35);
    pointer-events: none;
    z-index: 25;
    transition: opacity 220ms ease, transform 220ms ease;
}

.ticker-container{
    position: absolute;
    left: 50%;
    top: 30%;
    transform: translate(-50%, -50%) scale(.8);
    width: 75%;
    height: 340px;
    background: transparent; /* pas de fond */
    overflow: hidden;
    pointer-events: none;
    transition: opacity 400ms ease;
    opacity: 0;
}

.ticker-track{
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 0;
    will-change: transform;
    transform: translate3d(0,0,0);
    backface-visibility: hidden;
    contain: layout paint;
}

.ticker-item{
    width: 204px;
    height: 204px;
    border-radius: 12px;
    overflow: hidden;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.75);
    transition: transform 120ms ease;
}

.ticker-container.fade-out{ opacity: 0; }
.ticker-container.visible{ opacity: 1; }
.ticker-indicator.fade-out{ opacity: 0; }

.ticker-item img{
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ticker-indicator{
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    height: 100%;
    width: 4px;
    background: #39A9FF;
    transition: opacity 300ms ease;
    display: none;
}

.right-controls{
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

/* Hauteur fixe commune pour les deux éléments */
.right-controls .open-case-btn,
.right-controls .case-counter{
    height: 48px;
    box-sizing: border-box;
}

.open-case-btn{
    background: #ffffff;
    border: 2px solid #000000;
    border-radius: 100px;
    padding: 0 18px;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
    box-shadow: none;
    min-width: 200px;
    max-width: 440px;
    width: fit-content;
    display: flex;
    align-items: center;
    justify-content: center;
}
.case-counter{
    min-width: 48px;
    width: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    user-select: none;
}
.open-case-btn.disabled{ opacity: .5; cursor: not-allowed; }

/* S'assurer que le menu passe au dessus de la scène */
.shop_menu, .menu, header, nav{ position: relative; z-index: 50; }

.open-case-btn:hover{ transform: translateY(-2px); background: #2C123B; color: #ffffff !important; }
.open-case-btn:active{ transform: translateY(0); }

.winner{
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    background: transparent;
    color: inherit;
}

/* (styles spécifiques du toast supprimés, retour au style initial) */

/* Toaster de gain (case opening) */
.case-toaster{
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: #000000;
    background-color: #ffffff;
    border: 2px solid #000000; /* 2px comme demandé */
    z-index: 10000;
    max-width: 360px;
    box-shadow: 0 6px 14px rgba(0,0,0,.12);
    display: flex;
    align-items: center;
    gap: 12px;
}

.case-toaster__img{
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    flex: 0 0 48px;
}

.case-toaster__texts{
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.case-toaster__rarity{
    font-weight: 800;
    font-size: 14px;
    line-height: 1.2;
}

.case-toaster__title{
    font-weight: 700;
    font-size: 14px;
    line-height: 1.2;
}

/* Couleurs associées aux raretés */
.rarity--common{ color: #5e6c84; }
.rarity--uncommon{ color: #2e8b57; }
.rarity--rare{ color: #3b82f6; }
.rarity--epic{ color: #a855f7; }
.rarity--legendary{ color: #f59e0b; }

/* Pour les écrans très larges, limiter la largeur du contenu principal */
@media (min-width: 1400px) {
    .shop_content {
        max-width: 1400px;
        margin: 0 auto;
    }
}

@media (max-width: 1000px){
    .case-opening{ flex-direction: column; }
}

@media (max-width: 1000px){
    .media-stage{
        position: static;
       width: 100%;
       left:0%;
       transform: translate(0%, 0%);


        aspect-ratio: 1/1;
        margin-top: -100px;
    }
    .media-stage img,
    .media-stage video{
        width: 100%;
        height: auto;
    }
    .ticker-container{
        top: 36%;
        transform: translate(-50%, -50%) scale(.7);
        width: 80%;
    
    }

}


@media (max-width: 500px){
    .media-stage{
        position: static;
       width: 100%;
       left:0%;
       transform: translate(0%, 0%);


        aspect-ratio: 1/1;
        margin-top: auto;
    }
}