/* PREMIER FLIP COIN GAME - COMPLETE REWRITE */

.premier-flip-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

.premier-coin-scene {
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #0a0a0a, #1a1a1a);
    border-radius: 20px;
    min-height: 500px;
    position: relative;
}

/* Coin display area */
.premier-coin-area {
    position: relative;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 3rem;
}

/* Coin wrapper - BIGGER SIZE */
.premier-coin-holder {
    position: relative;
    width: 200px;
    height: 200px;
    perspective: 1000px;
}

/* Make coin clickable when ready to flip */
.premier-coin-holder.clickable {
    cursor: pointer;
}

.premier-coin-holder.clickable:hover .premier-coin {
    filter: brightness(1.1);
}

/* The actual coin container - ALWAYS VISIBLE */
.premier-coin {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    transform-style: preserve-3d;
    transform: rotateY(0deg);
    transition: none;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Animation class for flipping */
.premier-coin.flipping {
    animation: superFlip 1.5s ease-in-out;
}

@keyframes superFlip {
    0% { 
        transform: rotateY(0deg) scale(1);
    }
    50% { 
        transform: rotateY(1080deg) scale(1.1);
    }
    100% { 
        transform: rotateY(2160deg) scale(1);
    }
}

/* Result positions - FORCED WITH IMPORTANT */
.premier-coin.result-heads {
    transform: rotateY(0deg) !important;
    animation: none !important;
}

.premier-coin.result-tails {
    transform: rotateY(180deg) !important;
    animation: none !important;
}

/* The coin faces with correct URLs */
.premier-coin-heads,
.premier-coin-tails {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    backface-visibility: hidden;
    border-radius: 50%;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
}

.premier-coin-heads {
    background: #FFD700 url('https://premierwincompetitions.co.uk/uploads/coin-head.png') center/cover no-repeat;
    transform: rotateY(0deg);
    z-index: 2;
}

.premier-coin-tails {
    background: #FFD700 url('https://premierwincompetitions.co.uk/uploads/coin-tails.png') center/cover no-repeat;
    transform: rotateY(180deg);
    z-index: 1;
}

/* Shadow that stays put */
.premier-coin-shadow {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 160px;
    height: 30px;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.4) 0%, transparent 70%);
    border-radius: 50%;
}

/* Controls section */
.premier-flip-controls {
    text-align: center;
    position: relative;
    z-index: 10;
}

/* Choice buttons with images */
.premier-choice-buttons {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.premier-choice-btn {
    flex: 1;
    max-width: 200px;
    padding: 1.25rem;
    background: rgba(0,0,0,0.5);
    border: 3px solid rgba(255,215,0,0.3);
    border-radius: 15px;
    color: white;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.premier-choice-btn:hover {
    background: rgba(255,215,0,0.1);
    transform: translateY(-3px);
    border-color: #FFD700;
    box-shadow: 0 10px 30px rgba(255,215,0,0.3);
}

.premier-choice-btn.active {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: black;
    border-color: #FFD700;
    box-shadow: 0 0 30px rgba(255,215,0,0.5);
    transform: scale(1.05);
}

/* Mini coin icons in buttons */
.premier-choice-icon {
    width: 70px;
    height: 70px;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 50%;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

.premier-heads-icon {
    background-image: url('https://premierwincompetitions.co.uk/uploads/coin-head.png');
}

.premier-tails-icon {
    background-image: url('https://premierwincompetitions.co.uk/uploads/coin-tails.png');
}

/* Flip button - BIGGER */
.premier-flip-button {
    padding: 1.25rem 3.5rem;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: black;
    border: none;
    border-radius: 35px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(255,215,0,0.4);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.premier-flip-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(255,215,0,0.5);
}

.premier-flip-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Info section */
.premier-flip-info {
    display: flex;
    justify-content: space-around;
    margin: 2.5rem 0;
    padding: 1.5rem;
    background: rgba(0,0,0,0.4);
    border-radius: 12px;
    border: 1px solid rgba(255,215,0,0.2);
}

.premier-flips-remaining,
.premier-current-choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.premier-info-label {
    color: #999;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.premier-info-value {
    color: #FFD700;
    font-size: 28px;
    font-weight: bold;
    text-shadow: 0 0 20px rgba(255,215,0,0.3);
}

/* Result popup - FIXED POSITIONING */
.premier-flip-result {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 1000;
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    min-width: 320px;
    border: 3px solid #FFD700;
    box-shadow: 0 30px 80px rgba(0,0,0,0.8);
    opacity: 0;
    transition: all 0.3s ease;
}

.premier-flip-result.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.premier-result-icon {
    font-size: 56px;
    margin-bottom: 1rem;
}

.premier-result-icon.winner {
    color: #FFD700;
    filter: drop-shadow(0 0 20px rgba(255,215,0,0.5));
}

.premier-result-icon.loser {
    color: #ef4444;
}

.premier-result-text {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 0.75rem;
}

.premier-result-text.winner {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.premier-result-text.loser {
    color: #ef4444;
}

.premier-result-prize {
    font-size: 22px;
    color: white;
    font-weight: bold;
}

/* History section */
.premier-flip-history {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(0,0,0,0.4);
    border-radius: 15px;
    border: 1px solid rgba(255,215,0,0.2);
}

.premier-history-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.premier-history-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
}

.premier-history-item.win {
    background: rgba(255,215,0,0.2);
    border: 2px solid #FFD700;
    color: #FFD700;
}

.premier-history-item.lose {
    background: rgba(255,255,255,0.05);
    border: 2px solid #444;
    color: #999;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .premier-flip-container {
        padding: 1rem;
    }
    
    .premier-coin-scene {
        padding: 2rem 1rem;
        min-height: 450px;
    }
    
    .premier-coin-area {
        height: 220px;
    }
    
    .premier-coin-holder {
        width: 160px;
        height: 160px;
        cursor: pointer; /* Make coin clickable on mobile */
    }
    
    /* Keep buttons side by side on mobile */
    .premier-choice-buttons {
        gap: 1rem;
        flex-direction: row; /* Force horizontal */
    }
    
    .premier-choice-btn {
        padding: 1rem 0.75rem;
        font-size: 14px;
        flex: 1;
        max-width: 150px;
    }
    
    .premier-choice-icon {
        width: 50px;
        height: 50px;
    }
    
    .premier-flip-button {
        padding: 1rem 2.5rem;
        font-size: 18px;
    }
    
    .premier-info-value {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    /* Still keep buttons side by side even on small screens */
    .premier-choice-buttons {
        flex-direction: row;
        justify-content: center;
    }
    
    .premier-choice-btn {
        width: auto;
        min-width: 120px;
        max-width: 150px;
        padding: 0.75rem 0.5rem;
        font-size: 12px;
    }
    
    .premier-choice-icon {
        width: 45px;
        height: 45px;
    }
    
    .premier-coin-holder {
        width: 140px;
        height: 140px;
    }
}