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

body {
    background-color: #0d0f16;
    font-family: 'Inter', sans-serif;
    color: #fff;
    height: 100vh;
    overflow: hidden;
}

.bj-fullscreen {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

/* === НАВИГАЦИЯ (КАК В ДРУГИХ ИГРАХ) === */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(18, 20, 32, 0.95);
    border-bottom: 1px solid #2a2c47;
    z-index: 10;
}

.top-nav-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.back-btn {
    background: #1a1c2a;
    border: 1px solid #2d2f4a;
    color: #94a3b8;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-size: 12px;
    transition: 0.2s;
}

.back-btn:hover {
    background: #2d2f4a;
    color: #fff;
}

.logo {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 1px;
}

.logo span {
    color: #52be80;
}

.balance-box {
    background: #1a1c2a;
    padding: 8px 20px;
    border-radius: 8px;
    border: 1px solid #52be80;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 0 10px rgba(82, 190, 128, 0.2);
}

.balance-box span:first-child {
    color: #52be80;
}

.text-gold {
    color: #ffd700;
}

/* === ИГРОВОЙ СТОЛ (СУКНО) === */
.bj-viewport {
    flex-grow: 1;
    position: relative;
    background: radial-gradient(circle at center, #1b3a28 0%, #0a1710 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.8);
}

.table-felt {
    width: 100%;
    max-width: 1000px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 20px;
    position: relative;
}

/* === ЗОНЫ КАРТ И СЧЕТА === */
.dealer-area,
.player-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.cards-container {
    display: flex;
    justify-content: center;
    min-height: 135px;
    /* Высота карты + отступы */
}

.score-badge {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s;
}

.score-badge.visible {
    opacity: 1;
}

.center-message {
    text-align: center;
    font-size: 28px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #ffd700;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: all 0.3s;
}

.center-message.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

/* === КАРТЫ И СПРАЙТ-ЛИСТ === */
.playing-card {
    width: 90px;
    height: 126px;
    /* Пропорции 2.5 : 3.5 */
    border-radius: 6px;
    overflow: hidden;
    color: #111827;
    background: linear-gradient(145deg, #fff, #eef0f4);
    border: 1px solid rgba(17, 24, 39, 0.22);
    box-shadow: -2px 5px 10px rgba(0, 0, 0, 0.5);
    margin-left: -40px;
    /* Карты ложатся внахлест */
    position: relative;
    transform: translateY(-50px);
    opacity: 0;
    animation: dealCard 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.playing-card.red {
    color: #c81e3a;
}

.card-corner {
    position: absolute;
    top: 7px;
    left: 8px;
    display: grid;
    justify-items: center;
    font-size: 16px;
    font-weight: 900;
    line-height: 0.9;
}

.card-corner.bottom {
    top: auto;
    right: 8px;
    bottom: 7px;
    left: auto;
    transform: rotate(180deg);
}

.card-corner small {
    margin-top: 3px;
    font-size: 13px;
}

.card-suit-center {
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: 39px;
    transform: translate(-50%, -50%);
}

.playing-card:first-child {
    margin-left: 0;
}

@keyframes dealCard {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Рубашка карты (когда скрыта) */
.playing-card.hidden {
    background-image: none;
    background: repeating-linear-gradient(45deg, #1b1c31, #1b1c31 10px, #2a2c47 10px, #2a2c47 20px);
    border: 3px solid #fff;
}

.playing-card.hidden .card-corner,
.playing-card.hidden .card-suit-center {
    display: none;
}

/* === ПАНЕЛЬ УПРАВЛЕНИЯ === */
.bj-controls {
    background: #121420;
    border-top: 1px solid #2d2f4a;
    padding: 20px;
    z-index: 10;
}

.control-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: 20px;
}

.bet-info {
    font-size: 16px;
    font-weight: 700;
    color: #94a3b8;
    min-width: 200px;
}

/* Фишки (взято из рулетки) */
.chips-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-bet-input {
    background: #1a1c2a;
    border: 1px solid #373a5e;
    border-radius: 8px;
    color: #fff;
    height: 46px;
    padding: 0 15px;
    width: 110px;
    font-weight: 700;
    outline: none;
}

.custom-bet-input::-webkit-inner-spin-button {
    display: none;
}

.chip-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #1a1c2a;
    border: 2px dashed #ffd700;
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
}

.chip-btn:hover,
.chip-btn.active {
    background: #ffd700;
    color: #000;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.chip-btn.clear-btn {
    border-color: #ef4444;
    color: #ef4444;
    font-size: 11px;
}

.chip-btn.clear-btn:hover {
    background: #ef4444;
    color: #fff;
}

/* Кнопки действий */
.game-actions {
    display: flex;
    gap: 15px;
    flex-grow: 1;
    justify-content: flex-end;
}

.action-btn {
    padding: 0 25px;
    height: 50px;
    border-radius: 8px;
    border: none;
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.2s;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.action-btn:active:not(:disabled) {
    transform: translateY(2px);
}

.btn-deal {
    background: linear-gradient(135deg, #52be80, #27ae60);
    box-shadow: 0 4px 15px rgba(82, 190, 128, 0.3);
}

.btn-hit {
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn-stand {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.btn-double {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    color: #000;
    box-shadow: 0 4px 15px rgba(241, 196, 15, 0.3);
}
