/* Blackjack Premium Styles */

.blackjack-page-container {
    perspective: 1200px;
}

.blackjack-table-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    padding: 20px 0;
}

.blackjack-table {
    background: radial-gradient(circle at 50% 120%, #1e5c3a 0%, #0d3b25 70%); /* Casino Green */
    border-radius: 50% 50% 20px 20px / 30% 30% 20px 20px;
    min-height: 750px;
    position: relative;
    box-shadow: 
        0 20px 50px rgba(0,0,0,0.5),
        inset 0 0 100px rgba(0,0,0,0.5);
    border: 15px solid #3d2b1f; /* Wood border */
    overflow: hidden;
    padding: 20px;
}

.table-felt {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0IiBoZWlnaHQ9IjQiPgo8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI0IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9IjAuMDUiPjwvcmVjdD4KPC9zdmc+');
    opacity: 0.3;
    pointer-events: none;
}

/* Dealer Section */
.dealer-section {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 10;
}

/* Player Section */
.player-section {
    position: absolute;
    bottom: 110px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 10;
}

.hand-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.hand {
    display: flex;
    justify-content: center;
    min-height: 150px;
    padding-left: 40px; /* Offset for negative margin */
}

.hand .playing-card {
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-left: -40px; /* Real overlap */
    box-shadow: -5px 0 10px rgba(0,0,0,0.3);
}

.hand .playing-card:first-child {
    margin-left: 0;
}

.hand-label {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.6);
}

.hand-value {
    color: #ffd700;
    font-size: 1.2em;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Deck Visual */
.card-deck {
    position: absolute;
    top: 20px;
    right: 40px;
    z-index: 20;
}

.deck-stack {
    position: relative;
    width: 80px;
    height: 110px;
}

.deck-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid white;
    border-radius: 8px;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.5);
}

.deck-card-1 { top: 0; left: 0; z-index: 3; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.deck-card-2 { top: -2px; left: -2px; z-index: 2; opacity: 0.8; }
.deck-card-3 { top: -4px; left: -4px; z-index: 1; opacity: 0.6; }

/* Action Center */
.center-action-area {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    width: 80%;
    max-width: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.betting-overlay, .result-overlay {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    padding: 25px;
    border-radius: 24px;
    border: 1px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 40px 80px rgba(0,0,0,0.9);
    width: 90%;
    max-width: 400px; /* Reduced to avoid side overlap */
    text-align: center;
    position: relative;
    z-index: 100;
}

.result-card {
    background: transparent !important;
}

.result-text {
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 10px;
}

.text-glow-gold {
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.8);
    font-weight: 900;
}

/* Pot Visual */
.player-bet-pot {
    position: absolute;
    bottom: 220px;
    right: 12%; 
    z-index: 5;
    pointer-events: none;
    transform: scale(1.1);
}

.chip-stack {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
}

.chip {
    width: 40px;
    height: 6px;
    border-radius: 4px;
    margin-bottom: -2px;
    border: 1px solid rgba(0,0,0,0.2);
}

.chip-gold { background: #ffd700; }
.chip-silver { background: #c0c0c0; }

.bet-amount-label {
    background: rgba(0,0,0,0.6);
    padding: 2px 8px;
    border-radius: 10px;
    color: #ffd700;
    margin-top: 5px;
    font-weight: bold;
}

/* Actions */
.table-actions {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
}

.action-button {
    min-width: 140px;
    font-weight: 800 !important;
    letter-spacing: 1px;
}

/* Animations */
.anime-fade-in { animation: fadeIn 0.5s ease-out; }
.anime-pop-in { animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.pulse { animation: pulse 1.5s infinite; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Badge styles */
.hand-status-badge {
    position: absolute;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 900;
    font-size: 1.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 100;
}

.bust-badge {
    background: #d32f2f;
    top: -20px;
    transform: rotate(-10deg);
}

.bj-badge {
    background: #ffd700;
    color: #000;
    top: -20px;
    transform: rotate(10deg);
}

.text-glow {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Dealer Turn Indicator */
.dealer-turn-indicator {
    text-align: center;
    padding: 20px;
}

.pulse-text {
    animation: pulseText 1.5s infinite ease-in-out;
}

@keyframes pulseText {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.glow-text {
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

/* Mobile Responsiveness & Overlap Prevention */
@media (max-width: 768px) {
    .blackjack-table {
        min-height: 650px;
        padding: 15px;
        border-width: 10px;
    }

    .dealer-section {
        top: 20px;
    }

    .player-section {
        bottom: 100px;
    }

    .center-action-area {
        width: 95%;
        max-width: none;
    }

    .betting-overlay, .result-overlay {
        padding: 15px;
    }

    .player-bet-pot {
        right: 20px;
        bottom: 220px;
        transform: scale(0.8);
    }

    .hand .playing-card {
        margin-left: -50px; /* Tighter overlap on small screens */
    }

    .card-deck {
        top: 20px;
        right: 20px;
        transform: scale(0.7);
    }

    .hand-status-badge {
        font-size: 1.2rem;
        padding: 6px 12px;
    }

    .table-actions {
        bottom: 20px;
    }
}

@media (max-width: 480px) {
    .blackjack-table {
        min-height: 600px;
    }
    
    .hand-label {
        font-size: 0.8rem;
    }
    
    .action-button {
        min-width: 100px;
        padding: 8px 12px;
        font-size: 0.8rem !important;
    }
}

