body {
    font-family: 'Arial', sans-serif;
    background: #14191f;
    color: #fff;
    margin: 0;
    padding: 10px;
    user-select: none;

    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.game-container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    flex: 1 0 auto; 
    width: 100%;
}

.ad-banner {
    background: #000;
    color: #555;
    padding: 15px;
    text-align: center;
    font-size: 11px;
    border: 1px dashed #222;
    margin-bottom: 10px;
}

.top-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    min-height: 40px;
    position: relative;
}

/* Комбобокс выбора 16 языков */
.lang-selector {
    position: absolute;
    left: 10px;
    background: radial-gradient(circle, #103c1d 0%, #081d0a 100%);
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    outline: none;
    transition: all 0.2s ease;
    z-index: 100;
}

.lang-selector:hover {
    border-color: #ffd700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
    background: #103c1d;
}

.lang-selector option {
    background: #0f171e;
    color: #fff;
}

.status-msg {
    font-size: 22px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 1px 1px 6px rgba(0,0,0,0.8);
    min-width: 10px;
}

.status-msg::after {
    content: '|';
    animation: blink 0.7s infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.blackjack-table {
    background: radial-gradient(circle, #1a5e32 0%, #0d3b1e 100%);
    border: 12px solid #3d2314;
    border-radius: 40px;
    padding: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
    position: relative;
    min-height: 450px; 
}

.deck-shoe {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 74px;
    height: 110px;
    background: #222;
    border: 2px solid #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: -5px 5px 10px rgba(0,0,0,0.5);
    z-index: 10;
}

.pot-zone {
    position: absolute;
    top: 45%;
    left: 70px;
    transform: translateY(-50%);
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.4);
}

.bet-chips-stack { position: relative; width: 50px; height: 50px; }

.stacked-chip {
    position: absolute;
    width: 55px; height: 55px;
    border-radius: 50%; border: 3px dashed #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 14px; color: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.6);
    text-shadow: 1px 1px 2px #000;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
}

/* Облагороженная плашка Bet под фишками кона */
.pot-bet-counter {
    position: absolute; 
    bottom: -45px; 
    background: rgba(0, 0, 0, 0.85); 
    color: #ffd700;
    padding: 5px 16px; 
    border-radius: 14px; 
    font-size: 15px; 
    font-weight: bold;
    border: 1px solid #ffd700; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.6), 0 0 8px rgba(255, 215, 0, 0.2);
    white-space: nowrap; 
    z-index: 10;
    letter-spacing: 0.5px;
}

.flying-chip {
    position: absolute; width: 50px; height: 50px;
    border-radius: 50%; border: 3px dashed #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 13px; color: #fff;
    z-index: 9999; pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s;
    box-shadow: 0 6px 12px rgba(0,0,0,0.5);
    top: 0; left: 0;
}

/* --- КОНТЕЙНЕРЫ ДЛЯ НИЖНИХ ГОРОЧЕК --- */
.chip-stack-wrapper {
    position: relative;
    width: 60px; height: 110px;
    display: flex; flex-direction: column-reverse;
    align-items: center; cursor: pointer;
}

.base-stacked-chip {
    position: absolute;
    width: 55px; height: 55px;
    border-radius: 50%; border: 3px dashed #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 14px; color: #fff;
    box-shadow: 0 3px 5px rgba(0,0,0,0.5); text-shadow: 1px 1px 2px #000;
    transition: transform 0.2s;
}

.chip-stack-wrapper:hover .base-stacked-chip { transform: scale(1.05); }

.chip-500 { background-color: #e74c3c !important; border-color: #ff9f9f; }
.chip-100 { background-color: #9b59b6 !important; border-color: #e8dbff; }
.chip-10 { background-color: #3498db !important; border-color: #d1edff; }
.chip-5 { background-color: #2ecc71 !important; border-color: #d1ffd6; }
.chip-1 { background-color: #1abc9c !important; border-color: #cffff5; }

.chip-count-badge { position: absolute; bottom: -20px; font-size: 12px; color: #ffd700; font-weight: bold; }

/* Рамочки DEALER и YOU */
/* УЛУЧШЕНО: Идеальное центрирование рамок по центру стола с сохранением VIP-стиля */
.sector-title {
    display: block !important; /* Меняем inline-block на block для работы авто-отступов */
    width: max-content !important; /* Сжимаем рамку строго по ширине текста, чтобы она не растягивалась */
    margin-left: auto !important; /* Магия центрирования: браузер сам выровняет левый отступ */
    margin-right: auto !important; /* Магия центрирования: браузер сам выровняет правый отступ */
    margin-top: 5px !important;
    margin-bottom: 25px !important;
    
    /* Полностью сохраняем ваш оригинальный роскошный стиль */
    font-size: 16px; 
    font-weight: bold; 
    text-transform: uppercase; 
    letter-spacing: 1.5px;
    background: rgba(0, 0, 0, 0.85); 
    color: #ffffff; 
    padding: 6px 16px; 
    border-radius: 14px; 
    border: 1px solid #ffd700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 0 10px rgba(255, 215, 0, 0.15); 
}

.player-sector .sector-title {
    margin-top: 20px !important; /* Сохраняем ваш идеальный отступ, чтобы приподнять карты */
}

.cards-container { display: flex; justify-content: center; gap: 12px; min-height: 120px; margin: 10px 0; }
.card-wrapper { perspective: 1000px; }
.card-body { width: 74px; height: 110px; position: relative; transform-style: preserve-3d; transition: transform 0.6s ease; }
.animate-deal { animation: flyIn 0.4s ease-out forwards; }
@keyframes flyIn {
    0% { transform: translate(300px, -200px) rotate(45deg) scale(0.5); opacity: 0; }
    100% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
}
.card-body.flipped { transform: rotateY(180deg); }
.card-front, .card-back { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; border-radius: 6px; box-shadow: 2px 4px 8px rgba(0,0,0,0.4); box-sizing: border-box; }
.card-front { background: #fff; color: #000; padding: 6px; display: flex; flex-direction: column; justify-content: space-between; font-size: 18px; font-weight: bold; }
.card-front.red { color: #d63031; }
.card-front.black { color: #2d3436; }
.card-front .center-suit { font-size: 26px; align-self: center; }
.card-front .bottom-val { align-self: flex-end; transform: rotate(180deg); }
.card-back { background: repeating-linear-gradient(45deg, #130cb7, #130cb7 8px, #52e5e7 8px, #52e5e7 16px); border: 3px solid #fff; transform: rotateY(180deg); }

/* --- ПАНЕЛЬ ФИШЕК И БЛОК БАЛАНСА --- */
.betting-panel {
    margin: 15px 0; background: rgba(0,0,0,0.4); padding: 20px 25px 35px 25px; border-radius: 15px;
    display: flex !important; justify-content: space-between !important; align-items: flex-end !important; gap: 20px;
}
.chips-row { display: flex !important; gap: 30px !important; height: 110px !important; align-items: flex-end !important; flex-grow: 1 !important; }

.bankroll-balance-box {
    background: radial-gradient(circle, #0e2714 0%, #05140a 100%);
    border: 2px solid #2ecc71;
    padding: 10px 25px; border-radius: 12px;
    display: flex; flex-direction: column; align-items: center; min-width: 150px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    animation: neonGlow 3s infinite ease-in-out;
    margin-bottom: 15px !important; flex-shrink: 0 !important;
}

@keyframes neonGlow {
    0%, 100% { border-color: #2ecc71; box-shadow: 0 0 12px rgba(46, 204, 113, 0.3); }
    50% { border-color: #27ae60; box-shadow: 0 0 20px rgba(39, 174, 96, 0.6); }
}

.balance-label { font-size: 11px; font-weight: bold; color: #a5d6a7; letter-spacing: 1.5px; margin-bottom: 2px; text-transform: uppercase; }
.balance-value { font-size: 24px; font-weight: bold; color: #ffffff; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }

/* --- КНОПКИ УПРАВЛЕНИЯ НА СУКНЕ СТОЛА --- */
.action-panel {
    position: absolute; bottom: 25px; left: 50%; transform: translateX(-50%);
    display: flex; justify-content: center; gap: 20px; z-index: 20; width: 100%;
}

.btn {
    padding: 12px 40px; font-size: 16px; font-weight: bold; border-radius: 30px; cursor: pointer; text-transform: uppercase; letter-spacing: 1px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
    animation: fadeScaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes fadeScaleIn { 0% { transform: scale(0.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.btn-deal { background: linear-gradient(135deg, #2c3e50 0%, #0f171e 100%); color: #ffd700; border: 2px solid #ffd700; }
.btn-deal:hover { background: linear-gradient(135deg, #ffd700 0%, #cca100 100%); color: #000; box-shadow: 0 0 20px rgba(255, 215, 0, 0.7); transform: scale(1.05); }

.btn-hit { background: linear-gradient(135deg, #2c3e50 0%, #0f171e 100%); color: #e67e22; border: 2px solid #e67e22; }
.btn-hit:hover { background: linear-gradient(135deg, #e67e22 0%, #d35400 100%); color: #fff; box-shadow: 0 0 20px rgba(230, 126, 34, 0.7); transform: scale(1.05); }

.btn-stand { background: linear-gradient(135deg, #2c3e50 0%, #0f171e 100%); color: #2ecc71; border: 2px solid #2ecc71; }
.btn-stand:hover { background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%); color: #fff; box-shadow: 0 0 20px rgba(46, 204, 113, 0.7); transform: scale(1.05); }

.btn-clear-game { background: linear-gradient(135deg, #2c3e50 0%, #0f171e 100%); color: #e74c3c; border: 2px solid #e74c3c; }
.btn-clear-game:hover { background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); color: #fff; box-shadow: 0 0 20px rgba(231, 76, 60, 0.7); transform: scale(1.05); }

.btn:active { transform: scale(0.95) !important; box-shadow: 0 2px 4px rgba(0,0,0,0.6) !important; }

/* Модалка */
.modal-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(5px); border-radius: 40px; display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-content { background: linear-gradient(135deg, #1e272e 0%, #0f171e 100%); border: 3px solid #e74c3c; border-radius: 20px; padding: 30px; max-width: 400px; width: 90%; box-shadow: 0 0 30px rgba(231, 76, 60, 0.5); text-align: center; }
.modal-icon { font-size: 50px; margin-bottom: 10px; }
.modal-content h2 { margin: 10px 0; font-size: 26px; color: #e74c3c; }
.modal-content p { color: #ced6e0; font-size: 15px; line-height: 1.5; margin-bottom: 25px; }
.modal-buttons { display: flex; flex-direction: column; gap: 12px; }
.btn-modal-ad { background: linear-gradient(90deg, #e67e22, #e74c3c); color: white; border: none; padding: 14px; font-size: 16px; font-weight: bold; border-radius: 8px; cursor: pointer; }
.btn-modal-restart { background: #34495e; color: #bdc3c7; border: 1px solid #7f8c8d; padding: 12px; font-size: 14px; font-weight: bold; border-radius: 8px; cursor: pointer; }
.hud-box-bet-active { border-color: #ffd700 !important; box-shadow: 0 0 15px rgba(255, 215, 0, 0.3); }

/* ФИНАЛЬНЫЙ ШТРИХ: Идеальное выравнивание кнопки в один уровень с блоком БАЛАНС */
.btn-consolidate {
    background: linear-gradient(135deg, #143d20 0%, #0a1f10 100%);
    color: #a5d6a7;
    border: 1px solid #2ecc71;
    padding: 0 20px; 
    
    /* Точные размеры и скругления один в один как у блока баланса */
    height: 52px !important; 
    border-radius: 12px !important; 
    font-size: 11px; 
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4), inset 0 1px 2px rgba(255,255,255,0.05);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* ИСПРАВЛЕНО: Задаем точный нижний отступ, чтобы кнопка стояла в один уровень с балансом */
    margin-bottom: 15px !important; 
    margin-right: 15px; 
    
    white-space: nowrap; 
    min-width: 150px; 
    text-align: center;
    
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box; 
}

.btn-consolidate:hover {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: #fff;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.6);
    transform: translateY(-2px); /* Эффект приподнимания синхронно с балансом */
}

.btn-consolidate:active {
    transform: translateY(1px);
}