/* Texas Hold'em Poker Game Styles */

.game-ui {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    background: rgba(0, 0, 0, 0.85) !important;
    color: white !important;
    padding: 5px !important;
    border-radius: 6px !important;
    font-family: Arial, sans-serif !important;
    width: 200px !important;
    height: 200px !important;
    max-width: 200px !important;
    max-height: 200px !important;
    z-index: 1000 !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    font-size: 10px !important;
    cursor: move !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.game-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
    margin-bottom: 5px !important;
    padding-bottom: 3px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
    flex-shrink: 0 !important;
}

.pot-display, .current-bet, .game-round {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pot-display .amount, .current-bet .amount {
    font-size: 12px !important;
    font-weight: bold !important;
    color: #FFD700 !important;
}

.game-round {
    margin-top: 10px;
}

.game-round .label {
    color: #ccc;
}

.betting-controls {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 2px !important;
    margin-bottom: 3px !important;
    flex-shrink: 0 !important;
}

.raise-amount {
    margin-bottom: 3px !important;
    display: flex !important;
    align-items: center !important;
    gap: 2px !important;
    flex-shrink: 0 !important;
    font-size: 8px !important;
}

.raise-amount label {
    color: #ccc;
    font-size: 14px;
}

.raise-amount input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 8px 12px;
    color: white;
    font-size: 16px;
    width: 80px;
}

.raise-amount input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
}

.game-controls {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    margin-bottom: 3px !important;
    flex-shrink: 0 !important;
}

.game-btn {
    padding: 2px 4px !important;
    border: none !important;
    border-radius: 3px !important;
    font-size: 8px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    min-width: 30px !important;
    flex: 1 !important;
}

.game-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.game-btn:active:not(:disabled) {
    transform: translateY(0);
}

.game-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

#fold-btn {
    background: linear-gradient(135deg, #F44336, #D32F2F);
    color: white;
}

#fold-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #D32F2F, #B71C1C);
}

#call-btn {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
}

#call-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #1976D2, #1565C0);
}

#raise-btn {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
}

#raise-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #F57C00, #EF6C00);
}

#check-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

#check-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #45a049, #3d8b40);
}

#deal-btn {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
    color: white;
}

#deal-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #7B1FA2, #6A1B9A);
}

#new-game-btn {
    background: linear-gradient(135deg, #607D8B, #546E7A);
    color: white;
}

#new-game-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #546E7A, #455A64);
}

.game-status {
    background: rgba(255, 255, 255, 0.1) !important;
    padding: 2px !important;
    border-radius: 3px !important;
    text-align: center !important;
    font-size: 8px !important;
    font-weight: bold !important;
    margin-bottom: 0 !important;
    min-height: 15px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    flex: 1 !important;
}

/* Community Cards Area */
.community-cards {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 100;
}

.community-label {
    color: white;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.card-positions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.card-spot {
    width: 80px;
    height: 120px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    position: relative;
}

.card-spot::before {
    content: attr(id);
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
}

/* Player Positions */
.players {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.player {
    position: absolute;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    padding: 15px;
    min-width: 200px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

/* Player 1 (Bottom - Human) */
#player-1 {
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: row;
}

#player-1 .player-cards {
    margin-right: 15px;
}

/* Player 2 (Right - AI) */
#player-2 {
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    flex-direction: column;
}

#player-2 .player-cards {
    margin-bottom: 10px;
}

/* Player 3 (Top - AI) */
#player-3 {
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: row-reverse;
}

#player-3 .player-cards {
    margin-left: 15px;
}

/* Player 4 (Left - AI) */
#player-4 {
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
    flex-direction: column-reverse;
}

#player-4 .player-cards {
    margin-top: 10px;
}

.player-cards {
    display: flex;
    gap: 10px;
}

.player-info {
    text-align: center;
    min-width: 120px;
}

.player-name {
    font-size: 16px;
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 5px;
}

.player-chips {
    font-size: 14px;
    color: #FFD700;
    margin-bottom: 5px;
}

.player-status {
    font-size: 12px;
    color: #ccc;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    min-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Card Styling */
.card {
    width: 70px;
    height: 100px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .game-ui {
        position: fixed;
        top: auto;
        bottom: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }

    .player {
        padding: 10px;
        min-width: 150px;
    }

    .player-name {
        font-size: 14px;
    }

    .player-chips {
        font-size: 12px;
    }

    .player-status {
        font-size: 10px;
        padding: 2px 6px;
    }

    .card-spot {
        width: 60px;
        height: 90px;
    }

    .card {
        width: 55px;
        height: 75px;
    }
}

@media (max-width: 768px) {
    .community-cards {
        top: 40%;
    }

    .community-label {
        font-size: 14px;
        margin-bottom: 15px;
    }

    .card-positions {
        gap: 10px;
    }

    .card-spot {
        width: 50px;
        height: 75px;
    }

    .players .player {
        padding: 8px;
        min-width: 120px;
    }

    .player-cards {
        gap: 5px;
    }

    .card {
        width: 45px;
        height: 60px;
    }

    .betting-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .game-btn {
        min-width: auto;
        padding: 10px 15px;
        font-size: 14px;
    }
}

/* Game State Specific Styling */
.game-over .game-status {
    background: rgba(255, 0, 0, 0.2);
    border-color: rgba(255, 0, 0, 0.4);
    color: #ffcccc;
}

.winner .game-status {
    background: rgba(0, 255, 0, 0.2);
    border-color: rgba(0, 255, 0, 0.4);
    color: #ccffcc;
}

/* Animation for chip updates */
.player-chips {
    transition: color 0.3s ease;
}

.player-chips.updated {
    animation: pulse 0.5s ease;
}

/* Card dealing animation */
@keyframes dealCard {
    0% {
        transform: scale(0) rotateY(180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotateY(90deg);
        opacity: 0.5;
    }
    100% {
        transform: scale(1) rotateY(0deg);
        opacity: 1;
    }
}

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

/* Loading state */
.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Current player highlight */
.player.current-player {
    border-color: #4CAF50;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.3);
}

.player.current-player .player-name {
    color: #81C784;
}

/* Folded player styling */
.player.folded {
    opacity: 0.6;
}

.player.folded .player-status {
    background: rgba(244, 67, 54, 0.2);
    color: #ffcccc;
}
