/* Покращені стилі для гри в блекджек */
.blackjack-game {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 20px;
    border-radius: 20px;
    background: linear-gradient(145deg, #1e6b43, #277c4e);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.blackjack-table {
    width: 100%;
    background: radial-gradient(ellipse at center, #277c4e 0%, #1b5c38 100%);
    border-radius: 15px;
    padding: 30px 20px;
    margin-bottom: 20px;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.4),
                0 8px 16px rgba(0, 0, 0, 0.2);
    border: 4px solid #1b5c38;
    position: relative;
    transition: all 0.4s ease;
}

.blackjack-table::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%2322784a' fill-opacity='0.2' fill-rule='evenodd'/%3E%3C/svg%3E");
    border-radius: 12px;
    z-index: 0;
    opacity: 0.6;
}

.table-decoration {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
}

.table-decoration::before, .table-decoration::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.table-decoration::before {
    width: 80px;
    height: 80px;
    top: 20px;
    right: 40px;
}

.table-decoration::after {
    width: 120px;
    height: 120px;
    bottom: 30px;
    left: 60px;
}

.dealer-area, .player-area {
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
    padding: 15px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.dealer-area {
    background: rgba(0, 0, 0, 0.1);
}

.player-area {
    background: rgba(255, 255, 255, 0.05);
}

.active-turn {
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    animation: pulseBorder 1.5s infinite;
}

.dealer-area h3, .player-area h3 {
    color: white;
    margin: 0 0 15px;
    font-size: 20px;
    text-align: left;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    font-family: 'Arial', sans-serif;
    display: flex;
    align-items: center;
}

.dealer-area h3::before, .player-area h3::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-right: 10px;
    background-size: contain;
    background-repeat: no-repeat;
}

.dealer-area h3::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-1-13h2v6h-2zm0 8h2v2h-2z'/%3E%3C/svg%3E");
}

.player-area h3::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E");
}

.score-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 8px;
    border-radius: 12px;
    margin-left: 8px;
    font-weight: bold;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.win-score {
    background: rgba(255, 215, 0, 0.3);
    color: #FFD700;
    animation: scoreFlash 1s infinite;
}

.bust-score {
    background: rgba(220, 20, 60, 0.3);
    color: #FF6B6B;
}

.blackjack-score {
    background: rgba(50, 205, 50, 0.3);
    color: #7CFC00;
    animation: scoreFlash 1s infinite;
}

.cards-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 140px;
    perspective: 1000px;
    padding: 10px;
}

.card {
    width: 90px;
    height: 130px;
    background: white;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3),
                0 0 2px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                box-shadow 0.3s ease;
    transform-style: preserve-3d;
    animation: dealCard 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.card:hover {
    transform: translateY(-5px) rotateY(5deg);
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.4);
    z-index: 2;
}

.card.hidden-card {
    background: linear-gradient(135deg, #1e5799 0%, #2989d8 50%, #207cca 51%, #7db9e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.card.hidden-card .card-back,
.card.hidden-card .card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.card-back {
    background: linear-gradient(135deg, #1e5799 0%, #2989d8 50%, #207cca 51%, #7db9e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.card-pattern {
    width: 80%;
    height: 80%;
    margin: auto;
    background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0px, rgba(255, 255, 255, 0.1) 2px, transparent 2px, transparent 4px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-logo {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #1e5799;
    font-size: 20px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.card.red {
    color: #e74c3c;
    background: linear-gradient(to bottom, #ffffff 0%, #f5f5f5 100%);
}

.card.black {
    color: #2c3e50;
    background: linear-gradient(to bottom, #ffffff 0%, #f5f5f5 100%);
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
}

.card-corner {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px;
    font-weight: bold;
}

.card-value {
    font-size: 18px;
    line-height: 1;
}

.card-suit {
    font-size: 16px;
    line-height: 1;
}

.top-left {
    position: absolute;
    top: 5px;
    left: 5px;
    text-align: left;
}

.bottom-right {
    position: absolute;
    bottom: 5px;
    right: 5px;
    transform: rotate(180deg);
}

.card-center {
    font-size: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);
}

.blackjack-result {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 25px;
    min-height: 40px;
    text-align: center;
    transition: all 0.3s ease;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.blackjack-result.win-animation {
    animation: winPulse 1.5s ease infinite;
    font-size: 26px;
    color: #f1c40f;
    background: rgba(0, 0, 0, 0.2);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.blackjack-result.lose-animation {
    animation: losePulse 1.5s ease;
    color: #ff6b6b;
    background: rgba(0, 0, 0, 0.2);
    text-shadow: 0 0 10px rgba(220, 20, 60, 0.5);
}

.blackjack-result.draw-animation {
    animation: drawPulse 1.5s ease;
    color: #3498db;
    background: rgba(0, 0, 0, 0.2);
    text-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

.blackjack-controls {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    position: relative;
    z-index: 1;
}

/* .btn {
    position: relative;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
    z-index: 1;
}

.btn span {
    position: relative;
    z-index: 2;
}

.btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
} */

/* .btn-yellow {
    background: linear-gradient(145deg, #f1c40f, #f39c12);
    color: white;
}

.btn-yellow:hover {
    background: linear-gradient(145deg, #f39c12, #e67e22);
}

.btn-green {
    background: linear-gradient(145deg, #27ae60, #2ecc71);
    color: white;
}

.btn-green:hover {
    background: linear-gradient(145deg, #2ecc71, #27ae60);
}

.btn-red {
    background: linear-gradient(145deg, #c0392b, #e74c3c);
    color: white;
}

.btn-red:hover {
    background: linear-gradient(145deg, #e74c3c, #c0392b);
} */

.btn:disabled {
    background: linear-gradient(145deg, #95a5a6, #7f8c8d);
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
}

.btn:disabled:hover {
    transform: none;
}

.btn-icon {
    margin-right: 8px;
    font-size: 18px;
}

.chip-container {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 0;
}

.chip {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: white;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.chip-red { background: #e74c3c; }
.chip-blue { background: #3498db; }
.chip-green { background: #2ecc71; }
.chip-purple { background: #9b59b6; }
.chip-yellow { background: #f1c40f; }

@keyframes dealCard {
    0% {
        transform: translateY(-100px) rotateX(90deg) scale(0.5);
        opacity: 0;
    }
    70% {
        transform: translateY(10px) rotateX(-10deg) scale(1.05);
        opacity: 1;
    }
    100% {
        transform: translateY(0) rotateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes revealCard {
    0% {
        transform: rotateY(180deg);
    }
    100% {
        transform: rotateY(0);
    }
}

@keyframes winPulse {
    0% { transform: scale(1); box-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(255, 215, 0, 0.7); }
    100% { transform: scale(1); box-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }
}

@keyframes losePulse {
    0% { transform: scale(1); }
    10% { transform: scale(1.05); }
    20% { transform: scale(1); }
    30% { transform: scale(1.05); }
    40% { transform: scale(1); }
    50% { transform: scale(1.05); }
    60% { transform: scale(1); }
}

@keyframes drawPulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

@keyframes scoreFlash {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

@keyframes pulseBorder {
    0% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.6); }
    100% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.3); }
}

@keyframes cardHighlight {
    0% { box-shadow: 0 0 5px rgba(255, 255, 255, 0.5); }
    50% { box-shadow: 0 0 15px rgba(255, 255, 255, 0.8); }
    100% { box-shadow: 0 0 5px rgba(255, 255, 255, 0.5); }
}

/* Confetti animation */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #f1c40f;
    opacity: 0;
}

/* Адаптивність для блекджека */
@media (max-width: 768px) {
    .blackjack-game {
        padding: 10px;
    }
    
    .blackjack-table {
        padding: 15px 10px;
    }
    
    .dealer-area h3, .player-area h3 {
        font-size: 16px;
    }
    
    .card {
        width: 70px;
        height: 100px;
    }
    
    .card-value {
        font-size: 14px;
    }
    
    .card-suit {
        font-size: 12px;
    }
    
    .card-center {
        font-size: 32px;
    }
    
    .blackjack-controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .btn {
        padding: 10px 18px;
        font-size: 14px;
    }
    
    .blackjack-result {
        font-size: 18px;
        padding: 8px 16px;
    }
    
    .blackjack-result.win-animation {
        font-size: 20px;
    }
    
    .chip {
        width: 24px;
        height: 24px;
        font-size: 8px;
    }
}

@media (max-width: 480px) {
    .card {
        width: 55px;
        height: 80px;
    }
    
    .card-value {
        font-size: 12px;
    }
    
    .card-suit {
        font-size: 10px;
    }
    
    .card-center {
        font-size: 24px;
    }
    
    .blackjack-controls button {
        padding: 8px 14px;
        font-size: 13px;
    }
}