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

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #1a5f3f 0%, #2d8659 50%, #4fb3d9 100%);
    min-height: 100vh;
    color: #333;
    padding: 20px;
}

.game-container {
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.game-header {
    text-align: center;
    margin-bottom: 30px;
}

.game-header h1 {
    color: #1a5f3f;
    font-size: 2.5em;
    margin-bottom: 20px;
    font-weight: 700;
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    font-weight: 600;
}

.stat span {
    color: #2d8659;
    font-weight: 700;
}

.dealer-area, .player-area {
    margin: 30px 0;
    padding: 20px;
    border-radius: 15px;
    background: rgba(45, 134, 89, 0.1);
}

.dealer-area h2, .player-area h2 {
    margin-bottom: 15px;
    color: #1a5f3f;
    font-size: 1.5em;
}

.score {
    background: #2d8659;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    margin-left: 10px;
}

.score.hidden {
    background: #ccc;
}

.cards-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    min-height: 110px;
    align-items: center;
}

.card {
    width: 80px;
    height: 110px;
    border-radius: 8px;
    background: white;
    border: 2px solid #ddd;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
}

.card.red {
    color: #e74c3c;
}

.card.black {
    color: #2c3e50;
}

.card.hidden {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
}

.card.hidden::before {
    content: "🂠";
    font-size: 40px;
}

.card-value {
    font-size: 18px;
    line-height: 1;
}

.card-suit {
    font-size: 20px;
    margin-top: 5px;
}

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

@keyframes dealCard {
    from {
        transform: translateY(-100px) rotate(180deg);
        opacity: 0;
    }
    to {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
}

.betting-area {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: rgba(79, 179, 217, 0.1);
    border-radius: 15px;
}

.betting-area h3 {
    color: #1a5f3f;
    margin-bottom: 15px;
}

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

.bet-btn {
    padding: 10px 20px;
    border: 2px solid #2d8659;
    border-radius: 25px;
    background: white;
    color: #2d8659;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.bet-btn:hover {
    background: #2d8659;
    color: white;
    transform: translateY(-2px);
}

.bet-btn:disabled {
    background: #ccc;
    border-color: #ccc;
    color: #666;
    cursor: not-allowed;
    transform: none;
}

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

.custom-bet input {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    width: 150px;
    text-align: center;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 16px;
}

.btn.primary {
    background: #2d8659;
    color: white;
}

.btn.primary:hover {
    background: #1a5f3f;
    transform: translateY(-2px);
}

.btn.secondary {
    background: #6c757d;
    color: white;
}

.btn.secondary:hover {
    background: #495057;
    transform: translateY(-2px);
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.result-area {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    border-radius: 15px;
    background: rgba(231, 76, 60, 0.1);
}

.result-message {
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1a5f3f;
}

.result-message.win {
    color: #27ae60;
}

.result-message.lose {
    color: #e74c3c;
}

.result-message.tie {
    color: #f39c12;
}

.game-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 30px 0;
}

.rules, .strategy-tips {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
}

.rules h3, .strategy-tips h3 {
    color: #1a5f3f;
    margin-bottom: 15px;
}

.rules ul, .strategy-tips ul {
    list-style: none;
    padding-left: 0;
}

.rules li, .strategy-tips li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.rules li::before, .strategy-tips li::before {
    content: "♠️";
    position: absolute;
    left: 0;
    color: #2d8659;
}

.statistics {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin-top: 30px;
}

.statistics h3 {
    color: #1a5f3f;
    margin-bottom: 15px;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.stat-label {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5em;
    font-weight: 700;
    color: #2d8659;
}

.blackjack-celebration {
    animation: blackjackWin 2s ease-in-out;
}

@keyframes blackjackWin {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.bust-animation {
    animation: bustShake 0.5s ease-in-out;
}

@keyframes bustShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

@media (max-width: 768px) {
    .game-container {
        padding: 20px;
        margin: 10px;
    }
    
    .game-header h1 {
        font-size: 2em;
    }
    
    .game-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .game-info {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .bet-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .card {
        width: 60px;
        height: 85px;
        font-size: 14px;
    }
}