/* StupidBlindShowdown - Game-Specific Styles */
/* � DO NOT redefine global classes: .glass-card, .form-input, .btn-custom, etc. */

/* ============================================
   Game Table Layout
   ============================================ */

#gameTableContainer {
    position: relative;
}

.btn-fullscreen {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

    .btn-fullscreen:hover {
        background: rgba(255, 255, 255, 1);
        transform: scale(1.1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .btn-fullscreen i {
        font-size: 1.2rem;
        color: #667eea;
    }

/* Fullscreen mode */
#gameTableContainer:fullscreen {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

    #gameTableContainer:fullscreen #gameTable {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        border-radius: 0;
    }

    #gameTableContainer:fullscreen .btn-fullscreen {
        top: 20px;
        right: 20px;
    }

/* For webkit browsers */
#gameTableContainer:-webkit-full-screen {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

    #gameTableContainer:-webkit-full-screen #gameTable {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        border-radius: 0;
    }

#gameTable {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-height: 600px;
    height: 600px;
    margin: 0;
    padding: 20px;
    background: radial-gradient(ellipse at center, #2d5016 0%, #1a3409 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
}

/* ============================================
   Player Seats (4 positions)
   ============================================ */

.player-seat {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

    /* Reduce horizontal gap for left/right players */
    .player-seat.left,
    .player-seat.right {
        gap: 0.25rem;
    }

    .player-seat.top {
        top: 20px;
        left: 50%;
        transform: translateX(-50%);
    }

        .player-seat.top .card-container {
            transform: rotate(180deg);
        }

    .player-seat.bottom {
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
    }

        .player-seat.bottom .card-container {
            transform: rotate(0deg);
        }

    .player-seat.left {
        /* left value is dynamically set by JavaScript based on card count */
        transform: rotate(90deg);
        /*flex-direction: column;
        align-items: center;*/
    }

    .player-seat.right {
        /* right value is dynamically set by JavaScript based on card count */
        transform: rotate(-90deg);
        /*flex-direction: column;
        align-items: center;*/
    }

/* Player Info Badge */
.player-info {
    background: rgba(255, 255, 255, 0.95);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0; /* Prevent shrinking */
}

/* Rotate player info to match card orientation */
.player-seat.top .player-info {
    transform: rotate(180deg);
}

/* Player Hand Info (Best Hand Type) */
.player-hand-info {
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
    margin-top: 0.25rem;
    flex-shrink: 0; /* Prevent shrinking */
}

/* Rotate hand info to match card orientation */
.player-seat.top .player-hand-info {
    transform: rotate(180deg);
}

/* ============================================
   Playing Cards
   ============================================ */

.card-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 360px; /* Force wrapping at exactly 5 cards: (60px * 5) + (8px * 4) = 332px */
}

.playing-card {
    width: 60px;
    height: 90px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    perspective: 1000px;
}

    .playing-card:hover {
        transform: translateY(-5px) scale(1.05);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    }

    /* Card Face Down (Back) - Classic Poker Card Design */
    .playing-card.face-down {
        background:
        /* Red and white diamond checkerboard pattern */
        linear-gradient(45deg, #dc143c 25%, #fff 25%, #fff 75%, #dc143c 75%), linear-gradient(45deg, #dc143c 25%, #fff 25%, #fff 75%, #dc143c 75%);
        background-size: 16px 16px;
        background-position: 0 0, 8px 8px;
        border-radius: 8px;
    }

    /* Card Face Up */
    .playing-card.face-up {
        background: white;
        border: 2px solid #e2e8f0;
        flex-direction: column;
        padding: 0.25rem;
    }

    /* Winning Combination Highlight */
    .playing-card.winning-combination {
        border: 3px solid #dc3545;
        box-shadow: 0 0 12px rgba(220, 53, 69, 0.6);
    }

    /* Red suits */
    .playing-card.suit-heart,
    .playing-card.suit-diamond {
        color: #dc3545;
    }

    /* Black suits */
    .playing-card.suit-spade,
    .playing-card.suit-club {
        color: #212529;
    }

.card-rank {
    font-size: 1.2rem;
    font-weight: bold;
    line-height: 1;
}

.card-suit {
    font-size: 1.5rem;
    line-height: 1;
}

/* ============================================
   Card Flip Animation
   ============================================ */

@keyframes flipCard {
    0% {
        transform: rotateY(0deg);
    }

    50% {
        transform: rotateY(90deg);
    }

    100% {
        transform: rotateY(0deg);
    }
}

.playing-card.flipping {
    animation: flipCard 0.6s ease-in-out;
}

/* ============================================
   Center Panel (Control Area)
   ============================================ */

.center-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding:0.5rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    text-align: center;
}

    .center-panel h4 {
        margin-bottom: 1rem;
        color: #667eea;
        font-family: 'Poppins', sans-serif;
    }

/* ============================================
   Result Display
   ============================================ */

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    transition: all 0.3s ease;
}

    .result-item.winner {
        background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
        color: white;
        box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
        transform: scale(1.02);
    }

.result-player-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.result-hand-type {
    background: rgba(255, 255, 255, 0.9);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.result-item.winner .result-hand-type {
    background: rgba(255, 255, 255, 0.95);
    color: #38a169;
}

.result-cards {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

    .result-cards .playing-card {
        width: 40px;
        height: 60px;
        font-size: 1rem;
    }

/* ============================================
   Game Statistics Chart
   ============================================ */

.chart-wrapper {
    position: relative;
    height: 300px;
    margin-top: 1rem;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    #gameTable {
        height: 500px;
        max-width: 100%;
    }

    .playing-card {
        width: 50px;
        height: 75px;
        font-size: 1.2rem;
    }

    .card-rank {
        font-size: 1rem;
    }

    .card-suit {
        font-size: 1.2rem;
    }


    .result-cards .playing-card {
        width: 35px;
        height: 52px;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    #gameTable {
        height: 400px;
    }

    .playing-card {
        width: 40px;
        height: 60px;
        font-size: 1rem;
    }

    .card-rank {
        font-size: 0.9rem;
    }

    .card-suit {
        font-size: 1rem;
    }


        .center-panel h4 {
            font-size: 0.9rem;
        }

    .result-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
}

/* ============================================
   Animations
   ============================================ */

@keyframes dealCard {
    0% {
        opacity: 0;
        transform: translateY(-50px) scale(0.5);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.playing-card.dealing {
    animation: dealCard 0.5s ease-out;
}

@keyframes winnerGlow {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
    }

    50% {
        box-shadow: 0 8px 24px rgba(72, 187, 120, 0.8);
    }
}

.result-item.winner {
    animation: winnerGlow 2s ease-in-out infinite;
}
