/* Winners Feed Styles - Purple Theme Adapter */
.winner-wrapper {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(46, 0, 62, 0.4);
    /* Purple Tint */
    backdrop-filter: blur(5px);
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    padding: 2px 0;
    /* Minimal padding, rely on gameBox margin */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    /* Enable Flexbox */
    align-items: center;
}

.winner-label {
    flex-shrink: 0;
    color: #FFD700;
    font-weight: 800;
    font-size: 12px;
    padding: 5px 2px;
    /* Vertical padding, minimal horizontal */
    margin-right: 2px;
    border-right: 1px solid rgba(255, 215, 0, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    z-index: 10;
    background: rgba(46, 0, 62, 0.1);

    /* Vertical Text Magic */
    writing-mode: vertical-lr;
    text-orientation: upright;
    letter-spacing: 0;
    /* Tighten up */
    max-height: 60px;
    /* Constrain height to force wrap */
    white-space: normal;
    /* Allow wrapping to new column */
    word-break: break-word;
    /* Break long words */
    line-height: 1.2;
    /* Tighter line spacing */
}

.track-mask {
    flex: 1;
    overflow: hidden;
    /* Clip horizontally to stop overlapping left label */
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
    /* Hack: Expand visual box upwards so badge isn't clipped top */
    padding-top: 20px;
    margin-top: -20px;
}

.winner-track {
    display: flex;
    width: max-content;
    height: 100%;
    align-items: center;
    animation: scrollLeft 600s linear infinite;
    /* Ultra slow speed */
    will-change: transform;
    /* Hint browser to optimize */
    transform: translate3d(0, 0, 0);
    /* Force GPU */
    backface-visibility: hidden;
}

/* Pause on hover (PC) */
.winner-track:hover {
    animation-play-state: paused;
}

/* Pause class for JS control (Mobile) */
.winner-track.paused {
    animation-play-state: paused !important;
}

.gameBox {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Spread columns */
    margin: 8px 15px;
    padding: 8px 12px;
    background: linear-gradient(145deg, rgba(60, 20, 90, 0.9), rgba(30, 10, 50, 0.95));
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 10px;
    color: #fff;
    min-width: 220px;
    /* Slightly wider for 3 cols */
    /* Slightly wider for 3 cols */
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s;
    will-change: transform;
    /* Optimize hover scale */
    transform: translateZ(0);
    /* Fix jitter */
}

.gameBox:hover {
    transform: scale(1.02);
    border-color: rgba(255, 215, 100, 0.6);
}

/* Col 1 */
.col-icon img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    object-fit: cover;
    /* scaling */
    image-rendering: -webkit-optimize-contrast;
    /* crisp edges */
    backface-visibility: hidden;
    /* prevents blur during animation */
}

/* Col 2 */
.col-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: 10px;
    margin-right: 10px;
}

.top-row {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: #ccc;
    margin-bottom: 2px;
}

.username {
    margin-right: 0;
    /* Handled by gap */
}

.game-name {
    font-size: 13px;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
    /* No wrapping */
    overflow: hidden;
    text-overflow: ellipsis;
    /* Add ... if too long */
    max-width: 110px;
    /* Limit width */
}

/* Col 3 */
.col-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    /* Right align text */
    justify-content: flex-end;
    /* Push to bottom to clear badge area */
    padding-bottom: 5px;
    /* Slight lift from bottom edge */
    min-width: 70px;
}

.base-bet {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 2px;
}

.amount-display {
    /* No absolute positioning */
    color: #ffd700;
    font-weight: 800;
    font-family: 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    /* Clean text */
}

/* Animations - Desktop */
@keyframes scrollLeft {
    0% {
        transform: translateX(1000px);
        /* Start at container width to enter immediately */
    }

    100% {
        transform: translateX(-100%);
    }
}

/* Animations - Mobile Override */
@media (max-width: 1000px) {
    @keyframes scrollLeft {
        0% {
            transform: translateX(100vw);
        }

        100% {
            transform: translateX(-100%);
        }
    }
}

/* Multiplier Wrapper & Badge (Rocket Logic) */
.multiplier-wrapper {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: visible;
}

/* Standard (Small/Medium < 50x) */
.multiplier-badge {
    position: absolute;
    top: -9px;
    /* Overflow nicely into the margin space */
    right: -4px;
    font-size: 9px;
    color: #fff;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 6px;
    z-index: 20;

    background: linear-gradient(135deg, #FF8C00 0%, #FFD700 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);

    opacity: 0;
    transform: translateY(60px) scale(0.5);
}

/* Big Win (50x - 100x) - Red/Gold */
.multiplier-badge.big-win {
    background: linear-gradient(135deg, #d32f2f 0%, #ff6f00 100%);
    box-shadow: 0 0 6px rgba(211, 47, 47, 0.6);
}

/* Super Win (> 100x) - Purple/Gold/Diamond */
.multiplier-badge.super-win {
    background: linear-gradient(135deg, #7b1fa2 0%, #ffD700 50%, #7b1fa2 100%);
    border: 1px solid #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    font-size: 10px;
    /* Slightly larger */
}

/* Firework Launch Animation */
.multiplier-badge.launching {
    animation: fireworkAscent 0.6s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

@keyframes fireworkAscent {
    0% {
        opacity: 0;
        transform: translateY(60px) scale(0.5);
    }

    60% {
        opacity: 1;
        /* Slight overshoot only, not huge */
        transform: translateY(-5px) scale(1.05);
    }

    80% {
        transform: translateY(2px) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        /* Land at exactly 1.0 size */
    }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .winner-wrapper {
        border-radius: 8px;
        margin-top: 5px;
        /* Ensure horizontal consistency */
        max-width: 100%;
        border: none;
        background: rgba(46, 0, 62, 0.2);
    }

    .winner-track {
        /* Force horizontal row on mobile too */
        flex-direction: row;
        width: max-content;
        height: auto;
        animation: scrollLeft 600s linear infinite;
        /* Match PC speed or slightly faster if needed */
    }

    .gameBox {
        min-width: 200px;
        /* Reduced from 240px for extreme compactness */
        margin: 8px 4px 4px 4px;
        /* Tighter margins */
        padding: 5px 8px;
        /* Tighter padding */
        transform: translateZ(0);
    }

    /* Mobile: Shrink Icon */
    .col-icon img {
        width: 28px;
        /* Small icon */
        height: 28px;
        border-radius: 6px;
        /* Slightly smaller radius */
    }

    @keyframes scrollUp {
        0% {
            transform: translateY(0);
        }

        100% {
            transform: translateY(-50%);
        }
    }
}