/* ==============================
   СТИЛИ ДЛЯ ИГРЫ "21 ОЧКО" — ПК
   ============================== */

/* Общий контейнер игры */
.game-container {
    padding: 60px 20px;
    background: var(--darker);
    min-height: 100vh;
}

/* Заголовок игры */
.game-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--white);
    text-align: center;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5), 0 0 20px rgba(255, 215, 0, 0.3);
}

.game-header p {
    color: var(--gray);
    font-size: 1rem;
    text-align: center;
    margin-bottom: 30px;
}

/* ==============================
   ПАНЕЛЬ СЧЁТА И СТАВОК
   ============================== */
.score-panel {
    display: flex;
    flex-direction: column; /* ← ВСЁ В СТОЛБИК */
    gap: 15px;              /* ← расстояние между строками */
    align-items: center;
    margin: 25px auto 5px auto;
    padding: 20px;
    background: rgba(10, 26, 63, 0.4);
    border-radius: 12px;
    max-width: 900px;
}

.balance-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}
.balance, .current-bet {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--cyan);
    white-space: nowrap;
}

.bet-controls,
.multiplier-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.bet-btn {
    padding: 8px 16px;
    background: transparent;
    border: 2px solid var(--cyan);
    color: var(--cyan);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.bet-btn:hover {
    background: var(--cyan);
    color: var(--dark);
}

.bet-btn.all-in {
    background: linear-gradient(135deg, #ff0000, #ff6b00);
    color: white;
    border: 2px solid #ff0000;
    font-weight: 700;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.bet-btn.all-in:hover {
    background: linear-gradient(135deg, #ff6b00, #ff0000);
    transform: scale(1.05);
}

#multiplier {
    padding: 6px 10px;
    border: 2px solid var(--gold);
    border-radius: 6px;
    color: var(--gold);
    font-weight: 600;
    background: transparent;
    font-size: 0.95rem;
}

#start-btn {
    margin: 0;
    padding: 8px 18px;
    font-size: 1rem;
    align-self: center;
}

/* Объединяем ставку, коэф и кнопку в одну строку */
.bet-controls,
.multiplier-controls,
#start-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ==============================
   ИГРОВОЕ ПОЛЕ (ДИЛЕР И ИГРОК)
   ============================== */
.game-area {
    display: flex;
    justify-content: space-around;
    gap: 30px;
    margin: 5px auto 15px auto; /* ← сильно подняли вверх */
    max-width: 900px;
}

.dealer-area,
.player-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 400px;
    background: rgba(10, 26, 63, 0.2);
    padding: 16px;
    border-radius: 12px;
    box-sizing: border-box;
}

.header-with-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 12px;
}

.header-with-total h3 {
    font-size: 1.4rem;
    margin: 0;
    color: var(--white);
}

.total {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--cyan);
    min-width: 45px;
    text-align: right;
}

/* ==============================
   КАРТЫ
   ============================== */
.cards {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    min-height: 100px;
    width: 100%;
}

.card {
    width: 80px;
    height: 120px;
    border-radius: 8px;
    position: relative;
    perspective: 1000px;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px) rotateY(5deg);
}

.card-front {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 10px 4px;
    box-sizing: border-box;
    border-radius: 6px;
}

.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    transform: rotateY(180deg);
    background: linear-gradient(45deg, #0A1A3F, #060710);
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.2rem;
    opacity: 0.8;
}

.card-value {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
}

.card-suit {
    font-size: 1.8rem;
    line-height: 1;
}

.card-spade,
.card-club {
    color: #FFFFFF;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.card-heart,
.card-diamond {
    color: #FF0000;
    text-shadow: 0 0 8px rgba(255, 0, 0, 0.5);
}

/* ==============================
   БЛОК РЕЗУЛЬТАТА
   ============================== */
.result {
    text-align: center;
    font-size: 1.2rem;
    padding: 15px;
    margin: 5px auto 10px auto; /* ← уменьшены отступы */
    background: rgba(10, 26, 63, 0.4);
    border-radius: 12px;
    color: var(--white);
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 600px;
}

.result.win {
    color: #00FF00;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.result.lose {
    color: #FF0000;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.result.draw {
    color: #FFFF00;
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.5);
}

/* ==============================
   КНОПКИ ДЕЙСТВИЙ
   ============================== */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 0 auto 20px auto; /* ← уменьшены отступы */
    flex-wrap: wrap;
}

.action-buttons button {
    padding: 10px 20px;
    font-size: 0.9rem;
}

.dogon-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--gray);
    color: var(--gray);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.dogon-btn:hover,
.dogon-btn[style*="opacity: 1"] {
    background: var(--cyan);
    color: var(--dark);
    border-color: var(--cyan);
}

/* ==============================
   АДАПТИВ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ
   ============================== */
@media (max-width: 768px) {
    /* Уменьшаем отступы */
    .game-container {
        padding: 25px 10px;
    }

    .game-header h1 {
        font-size: 1.7rem;
    }

    .game-header p {
        font-size: 0.95rem;
    }

    /* Панель ставок — компактнее */
    .score-panel {
        gap: 8px;
        padding: 10px;
        flex-direction: column;
        align-items: stretch;
    }

    .bet-controls,
    .multiplier-controls {
        justify-content: center;
    }

    .bet-btn, #multiplier {
        padding: 5px 10px;
        font-size: 0.85rem;
    }

    #start-btn {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
        max-width: 200px;
        align-self: center;
    }

    /* Игровое поле — в столбик */
    .game-area {
        flex-direction: row !important;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
        margin: 10px auto 15px auto;
    }

    /* Карты — меньше */
    .card {
        width: 48px;
        height: 72px;
    }

    .card-value {
        font-size: 1.1rem;
    }

    .card-suit {
        font-size: 1.4rem;
    }

    /* Кнопки действий — в одну строку без переноса */
    .action-buttons {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding: 0 10px;
        gap: 10px;
    }

    .action-buttons button {
        min-width: 110px;
        padding: 8px 12px;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    /* Блок результата — компактнее */
    .result {
        padding: 12px;
        font-size: 0.95rem;
        min-height: 45px;
        margin: 10px auto;
    }
}