/* ==================== BLACKJACK GAME ==================== */

#screenBlackjack {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 80px 12px 80px 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    background: #08090d;
    min-height: 100vh;
    min-height: 100dvh;
}

#screenBlackjack.active { display: flex !important; }

.blackjack-container {
    width: 100%;
    max-width: 426px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.bj-scene {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    justify-content: center;
}

/* ==================== СТОЛ КАЗИНО ==================== */

.bj-table {
    width: 340px;
    min-height: 340px;
    background: radial-gradient(ellipse at center, #1a5c2a 0%, #0d3317 60%, #061a0b 100%);
    border-radius: 24px;
    border: 4px solid #2a1500;
    padding: 20px 12px;
    box-shadow: 
        0 0 0 2px #8B4513,
        0 8px 40px rgba(0,0,0,0.5),
        inset 0 2px 0 rgba(255,255,255,0.03);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.bj-dealer-area, .bj-player-area {
    width: 100%;
    text-align: center;
}

.bj-label {
    color: rgba(255,255,255,0.7);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 4px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.bj-player-label {
    margin-top: 8px;
    margin-bottom: 0;
}

.bj-cards {
    display: flex;
    justify-content: center;
    gap: 6px;
    min-height: 100px;
    flex-wrap: wrap;
    align-items: center;
}

.bj-empty-slot {
    width: 72px;
    height: 100px;
    border: 2px dashed rgba(255,255,255,0.1);
    border-radius: 8px;
}

/* ==================== КАРТЫ ==================== */

.bj-card {
    width: 72px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    flex-shrink: 0;
    animation: card-deal 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
    transform: translateY(-30px) rotate(-8deg) scale(0.8);
}

@keyframes card-deal {
    0% {
        opacity: 0;
        transform: translateY(-30px) rotate(-8deg) scale(0.8);
    }
    60% {
        opacity: 1;
        transform: translateY(4px) rotate(2deg) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotate(0) scale(1);
    }
}

.bj-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ==================== РЕЗУЛЬТАТ ==================== */

.bj-result {
    color: #FEB021;
    font-size: 16px;
    font-weight: 800;
    text-align: center;
    padding: 4px;
    text-shadow: 0 0 10px rgba(254,176,33,0.5);
    animation: result-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes result-pop {
    from { transform: scale(0.3); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ==================== БЛОК СТАВОК ==================== */

.bj-bet-section {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
    margin-top: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.bj-deal-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 15px;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #f0883e, #f5c842, #ffd700);
    color: #0a0f1a;
    border: 1px solid #f5c84260;
    box-shadow: 0 0 25px rgba(240,136,62,0.4);
    transition: all 0.25s;
    -webkit-tap-highlight-color: transparent;
}

.bj-deal-btn:active { transform: scale(0.98); }
.bj-deal-btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

/* ==================== КНОПКИ ИГРЫ ==================== */

.bj-actions { display: flex; gap: 10px; }

.bj-hit-btn {
    flex: 1; padding: 14px; border-radius: 12px; font-weight: 800; font-size: 15px;
    border: none; cursor: pointer; text-transform: uppercase; letter-spacing: 2px;
    background: #5ff57a; color: #0a0f1a; border: 1px solid #5ff57a60;
    box-shadow: 0 0 25px rgba(95,245,122,0.4); transition: all 0.25s; -webkit-tap-highlight-color: transparent;
}

.bj-stand-btn {
    flex: 1; padding: 14px; border-radius: 12px; font-weight: 800; font-size: 15px;
    border: none; cursor: pointer; text-transform: uppercase; letter-spacing: 2px;
    background: #e74c3c; color: #fff; border: 1px solid #e74c3c60;
    box-shadow: 0 0 25px rgba(231,76,60,0.4); transition: all 0.25s; -webkit-tap-highlight-color: transparent;
}

.bj-hit-btn:active, .bj-stand-btn:active { transform: scale(0.98); }

/* Лоадер карт */
.bj-cards-loader {
    width: 36px;
    height: 36px;
    margin: 32px auto;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: bj-spin 0.7s linear infinite;
}

@keyframes bj-spin {
    to { transform: rotate(360deg); }
}