/* 
 * Texas Hold'em Poker - Styles
 */

:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: #0f0f23;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-gold: #ffd700;
    --accent-green: #2ecc71;
    --accent-red: #e74c3c;
    --card-white: #fafafa;
    --card-red: #e74c3c;
    --card-black: #2c3e50;
    --felt-green: #2d5a27;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Screen Management */
.screen {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.hidden {
    display: none !important;
}

/* Setup Screen */
.setup-container {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow);
    text-align: center;
}

.setup-container h1 {
    color: var(--accent-gold);
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.setup-container .subtitle {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--bg-secondary);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-gold);
}

.start-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--accent-gold) 0%, #ffc107 100%);
    color: var(--bg-primary);
    border: none;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 20px;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

/* Game Screen */
.game-container {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
}

/* Poker Table */
.poker-table {
    background: linear-gradient(180deg, var(--felt-green) 0%, #1e4620 100%);
    border-radius: 50%;
    padding: 40px;
    margin: 80px auto 0;
    position: relative;
    box-shadow: 
        inset 0 0 50px rgba(0, 0, 0, 0.5),
        0 10px 40px rgba(0, 0, 0, 0.5);
    border: 8px solid #4a2c00;
}

/* Pot Display */
.pot-display {
    text-align: center;
    margin-bottom: 20px;
}

.pot-display h2 {
    color: var(--accent-gold);
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Community Cards */
.community-cards {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    min-height: 120px;
}

/* Card Styles */
.card {
    width: 70px;
    height: 100px;
    background: var(--card-white);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    position: relative;
}

.card.placeholder {
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
}

.card.face-down {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    background-image: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(255, 255, 255, 0.1) 10px,
            rgba(255, 255, 255, 0.1) 20px
        );
}

.card .rank {
    font-size: 1.5rem;
    font-weight: bold;
}

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

.card.red .rank,
.card.red .suit {
    color: var(--card-red);
}

.card.black .rank,
.card.black .suit {
    color: var(--card-black);
}

/* Bots Container */
.bots-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.bot-player {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 15px;
    min-width: 150px;
    text-align: center;
    position: relative;
    transition: all 0.3s;
}

.bot-player.active {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    border: 2px solid var(--accent-gold);
}

.bot-player.folded {
    opacity: 0.5;
}

.bot-info {
    margin-bottom: 10px;
}

.bot-name {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

.bot-chips {
    color: var(--accent-gold);
    font-size: 0.9rem;
}

.bot-cards {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.bot-cards .card {
    width: 50px;
    height: 70px;
}

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

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

/* Player Area */
.player-area {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    position: relative;
    margin-top: 20px;
    transition: all 0.3s;
}

.player-area.active {
    box-shadow: 0 0 30px rgba(46, 204, 113, 0.5);
    border: 3px solid var(--accent-green);
}

.player-area.folded {
    opacity: 0.5;
}

.player-info {
    margin-bottom: 15px;
}

.player-name {
    font-size: 1.3rem;
    font-weight: bold;
    margin-right: 15px;
}

.player-chips {
    color: var(--accent-gold);
    font-size: 1.2rem;
}

.current-bet {
    display: inline-block;
    margin-left: 15px;
    background: var(--accent-gold);
    color: var(--bg-primary);
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.9rem;
}

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

/* Overlays and Badges */
.fold-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: var(--accent-red);
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1.2rem;
}

.all-in-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-red);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: bold;
    animation: pulse 1s infinite;
}

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

/* Controls */
.controls-container {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 20px;
    margin-top: 20px;
    transition: opacity 0.3s;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.action-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.action-btn.fold {
    background: var(--accent-red);
    color: white;
}

.action-btn.check-call {
    background: var(--accent-green);
    color: white;
}

.action-btn.raise {
    background: var(--accent-gold);
    color: var(--bg-primary);
}

.action-btn.all-in {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

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

.raise-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.raise-slider {
    width: 200px;
    height: 8px;
    border-radius: 5px;
    appearance: none;
    background: var(--bg-secondary);
    cursor: pointer;
}

.raise-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-gold);
    cursor: pointer;
}

.raise-amount {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-gold);
    min-width: 80px;
}

/* Game Log */
.game-log {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 15px;
    margin-top: 20px;
    max-height: 150px;
    overflow-y: auto;
}

.game-log h3 {
    color: var(--accent-gold);
    margin-bottom: 10px;
    font-size: 1rem;
}

.log-entry {
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.log-entry:last-child {
    border-bottom: none;
}

/* End Screen */
.end-container {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 50px;
    text-align: center;
    max-width: 500px;
}

.end-container h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.end-container p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.play-again-btn {
    padding: 16px 40px;
    background: linear-gradient(135deg, var(--accent-green) 0%, #27ae60 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.play-again-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .poker-table {
        border-radius: 30px;
        padding: 20px;
    }

    .community-cards {
        gap: 5px;
    }

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

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

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

    .bots-container {
        gap: 10px;
    }

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

    .bot-cards .card {
        width: 40px;
        height: 55px;
    }

    .action-btn {
        padding: 12px 20px;
        font-size: 1rem;
    }

    .setup-container {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .setup-container h1 {
        font-size: 1.8rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
    }

    .raise-controls {
        flex-direction: column;
    }

    .raise-slider {
        width: 100%;
    }
}

/* Navigation Bar */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    padding: 15px 30px;
    display: flex;
    gap: 20px;
    box-shadow: var(--shadow);
    z-index: 1000;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s;
    font-weight: 500;
}

.nav-link:hover {
    color: var(--accent-gold);
    background: var(--bg-secondary);
}

.nav-link.active {
    color: var(--accent-gold);
    background: var(--bg-secondary);
}

/* Blackjack Table */
.blackjack-container {
    max-width: 1000px;
    margin: 0 auto;
}

.blackjack-table {
    background: linear-gradient(180deg, var(--felt-green) 0%, #1e4620 100%);
    border-radius: 20px;
    padding: 40px;
    margin: 80px auto 20px;
    box-shadow: 
        inset 0 0 50px rgba(0, 0, 0, 0.5),
        0 10px 40px rgba(0, 0, 0, 0.5);
    border: 8px solid #4a2c00;
}

.dealer-area,
.blackjack-table .player-area {
    margin: 30px 0;
    text-align: center;
}

.player-info {
    margin-bottom: 20px;
}

.player-info h3 {
    color: var(--accent-gold);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.player-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 10px 0;
    font-size: 1.1rem;
}

.chips-display,
.bet-display {
    color: var(--text-primary);
    font-weight: bold;
}

.hand-value {
    color: var(--accent-gold);
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hand-cards {
    display: flex;
    justify-content: center;
    gap: 10px;
    min-height: 120px;
    flex-wrap: wrap;
}

/* Card back style for hidden dealer card */
.card.card-back {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    background-image: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(255, 255, 255, 0.1) 10px,
            rgba(255, 255, 255, 0.1) 20px
        );
    color: var(--text-primary);
    font-size: 3rem;
}

/* Card corner layout */
.card-corner {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.8rem;
}

.card-corner.top-left {
    top: 5px;
    left: 5px;
}

.card-corner.bottom-right {
    bottom: 5px;
    right: 5px;
    transform: rotate(180deg);
}

.card-center {
    font-size: 2.5rem;
}

/* Betting Controls */
.betting-controls {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 30px;
    margin: 20px auto;
    max-width: 600px;
}

.betting-controls h3 {
    color: var(--accent-gold);
    margin-bottom: 20px;
    text-align: center;
}

.bet-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.bet-btn {
    padding: 12px 24px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--accent-gold);
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.bet-btn:hover {
    background: var(--accent-gold);
    color: var(--bg-primary);
    transform: translateY(-2px);
}

.custom-bet {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.custom-bet input {
    padding: 12px 16px;
    border: 2px solid var(--bg-secondary);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    width: 200px;
}

.custom-bet input:focus {
    outline: none;
    border-color: var(--accent-gold);
}

/* New Round Controls */
.new-round-controls {
    text-align: center;
    margin: 20px auto;
}

/* Responsive adjustments for blackjack */
@media (max-width: 768px) {
    .blackjack-table {
        padding: 20px;
        margin-top: 100px;
    }

    .player-stats {
        flex-direction: column;
        gap: 10px;
    }

    .bet-buttons {
        flex-direction: column;
    }

    .bet-btn {
        width: 100%;
    }

    .custom-bet {
        flex-direction: column;
    }

    .custom-bet input {
        width: 100%;
    }

    .nav-bar {
        padding: 10px 15px;
    }
}
