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

body {
    background-color: #0d0f16;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #fff;
    height: 100vh;
    overflow: hidden;
    /* Запрещаем скролл body, скроллиться будет только игровая зона */
}

/* ==========================================================================
ПОЛНОЭКРАННАЯ ОБЕРТКА И НАВИГАЦИЯ
========================================================================== */
.roulette-fullscreen {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    background: radial-gradient(circle at top center, #1b1c31 0%, #0d0f16 100%);
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(18, 20, 32, 0.95);
    border-bottom: 1px solid #2a2c47;
}

.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;
    color: #fff;
    letter-spacing: 1px;
}

.logo span {
    color: #ffd700;
}

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

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

/* ==========================================================================
ИСТОРИЯ РОЛЛОВ
========================================================================== */
.roulette-history-bar {
    display: flex;
    gap: 15px;
    padding: 10px 20px;
    background: rgba(20, 22, 37, 0.8);
    border-bottom: 1px solid #2a2c47;
    height: 50px;
    align-items: center;
    overflow-x: auto;
    flex-shrink: 0;
}

.roulette-history-bar::-webkit-scrollbar {
    display: none;
}

.history-icon {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.history-slots {
    display: flex;
    gap: 10px;
}

.history-badge {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    flex-shrink: 0;
}

.history-badge.green {
    background: #2e7d32;
    border: 2px solid #4caf50;
}

.history-badge.red {
    background: #c62828;
    border: 2px solid #ef5350;
}

.history-badge.black {
    background: #1c1c24;
    border: 2px solid #666;
}

/* ==========================================================================
ИГРОВАЯ ЗОНА (С ПРОКРУТКОЙ)
========================================================================== */
.roulette-viewport {
    flex-grow: 1;
    overflow-y: auto;
    /* Включаем вертикальный скролл */
    display: flex;
    justify-content: center;
    padding: 20px;
}

.roulette-viewport::-webkit-scrollbar {
    width: 8px;
}

.roulette-viewport::-webkit-scrollbar-thumb {
    background: #373a5e;
    border-radius: 4px;
}

.roulette-content-wrapper {
    width: 100%;
    max-width: 1450px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    /* Отступ между блоками игры и инфо-карточками */
    padding-bottom: 30px;
}

.roulette-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 25px;
    align-items: start;
    /* ВАЖНО: Панели принимают свой естественный размер и не тянутся */
}

/* --- ЛЕВАЯ ПАНЕЛЬ --- */
.roulette-left-panel {
    background: #1a1c2a;
    border: 1px solid #2d2f4a;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wheel-canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1 / 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

.roulette-status-badge {
    width: 100%;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.4;
    font-size: 15px;
    font-weight: 700;
    color: #ffd700;
    background: rgba(179, 135, 40, 0.1);
    border: 1px solid rgba(179, 135, 40, 0.3);
    border-radius: 8px;
    padding: 10px 20px;
    margin: 25px 0;
    transition: 0.3s ease;
}

.roulette-status-badge.alert-red {
    background: rgba(220, 53, 69, 0.15);
    border-color: #dc3545;
    color: #ff6b6b;
}

.roulette-info-card {
    width: 100%;
    background: #121420;
    border: 1px solid #2d2f4a;
    border-radius: 8px;
    padding: 18px;
}

.info-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    color: #94a3b8;
}

.info-line:last-child {
    margin-bottom: 0;
}

.info-divider {
    border: 0;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    margin: 15px 0;
}

.val-gold {
    color: #ffd700;
    font-weight: 700;
}

.val-green {
    color: #52be80;
    font-weight: 800;
    font-size: 15px;
}

/* --- ПРАВАЯ ПАНЕЛЬ --- */
.roulette-right-panel {
    background: #1a1c2a;
    border: 1px solid #2d2f4a;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ==========================================================================
ИГРОВОЙ СТОЛ (КЛАССИЧЕСКИЕ ПРОПОРЦИИ)
========================================================================== */
.roulette-board {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 8px;
    background: #121420;
    padding: 18px;
    border: 1px solid #2d2f4a;
    border-radius: 12px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.board-cell {
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05);
    user-select: none;
    transition: all 0.2s ease;
    border-radius: 6px;
    position: relative;
}

.board-cell:hover {
    transform: scale(0.97);
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    z-index: 2;
}

.board-cell.selected {
    border-color: #ffd700 !important;
    background-color: rgba(255, 215, 0, 0.25) !important;
    box-shadow: inset 0 0 15px rgba(255, 215, 0, 0.5) !important;
}

.board-cell.confirmed {
    border-color: #52be80 !important;
    background-color: rgba(82, 190, 128, 0.35) !important;
    box-shadow: inset 0 0 20px rgba(82, 190, 128, 0.6) !important;
    color: #fff !important;
}

.zero-cell {
    grid-column: 1;
    grid-row: span 3;
    background: #2e7d32;
    font-size: 28px;
    height: 100%;
}

.board-grid-numbers {
    grid-column: 2;
    display: grid;
    grid-template-columns: repeat(13, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 8px;
}

.board-grid-dozens {
    grid-column: 2;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.board-grid-bottom {
    grid-column: 2;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.board-cell.red {
    background: #c62828;
}

.board-cell.black {
    background: #1c1c24;
}

.board-cell.action-cell {
    background: #2a2d45;
    border: 1px solid #3c405c;
    color: #ffd700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.board-cell.action-cell:hover {
    background: #373b5c;
}

/* 3D Фишки */
.board-chip {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.7),
        inset 0 0 5px rgba(255, 255, 255, 0.4);
    border: 2px dashed rgba(255, 255, 255, 0.8);
    z-index: 10;
    pointer-events: none;
    animation: dropChip 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.board-chip.chip-1k {
    background: #3498db;
}

.board-chip.chip-10k {
    background: #9b59b6;
}

.board-chip.chip-50k {
    background: #f1c40f;
    color: #000;
    border-color: rgba(0, 0, 0, 0.5);
}

.board-chip.chip-custom {
    background: #e74c3c;
}

@keyframes dropChip {
    from {
        transform: translate(-50%, -150%) scale(1.5);
        opacity: 0;
    }

    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* ==========================================================================
СЛОТЫ СТАВОК И ПАНЕЛЬ УПРАВЛЕНИЯ
========================================================================== */
.bets-tray-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

.bet-slot {
    background: linear-gradient(180deg, #1e2030 0%, #121420 100%);
    border: 1px solid #373a5e;
    border-radius: 10px;
    height: 105px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.bet-slot.empty {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    align-items: center;
    justify-content: center;
}

.bet-slot .empty-text {
    color: #64748b;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bet-slot.filled {
    border-color: rgba(255, 215, 0, 0.5);
}

.bet-slot.confirmed {
    border-color: #52be80;
}

.slot-zone {
    height: 60%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.slot-zone.red-zone {
    background: rgba(198, 40, 40, 0.2);
    color: #ff4d4d;
}

.slot-zone.black-zone {
    background: rgba(40, 40, 40, 0.4);
    color: #fff;
}

.slot-zone.green-zone {
    background: rgba(46, 125, 50, 0.2);
    color: #52be80;
}

.slot-zone.standard {
    background: rgba(255, 215, 0, 0.1);
    color: #ffd700;
}

.bet-slot.confirmed .slot-zone {
    color: #52be80;
}

.slot-amount {
    height: 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #cbd5e1;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.2);
}

.bet-slot.confirmed .slot-amount {
    color: #fff;
}

.remove-bet-btn {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    color: #ff4d4d;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.7;
    transition: 0.2s;
}

.remove-bet-btn:hover {
    opacity: 1;
    transform: scale(1.2);
}

.roulette-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #121420;
    border-radius: 12px;
    border: 1px solid #2d2f4a;
}

.chips-selector {
    display: flex;
    align-items: center;
    gap: 15px;
}

.custom-input-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
}

.step-badge {
    position: absolute;
    top: -22px;
    left: 0;
    font-size: 11px;
    color: #94a3b8;
    background: #121420;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
    border: 1px solid #2d2f4a;
    transition: 0.3s ease;
}

.step-badge.flash-success {
    color: #52be80;
    border-color: #52be80;
    box-shadow: 0 0 10px rgba(82, 190, 128, 0.4);
}

.custom-bet-input {
    background: #1a1c2a;
    border: 1px solid #373a5e;
    border-radius: 8px;
    color: #fff;
    height: 52px;
    padding: 0 15px;
    width: 130px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    outline: none;
    transition: 0.3s;
}

.custom-bet-input:focus {
    border-color: #ffd700;
    background: #121420;
}

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

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

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

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

.chip-btn.clear-btn:hover {
    background: #ef4444;
    color: #fff;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.action-btn {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    border: none;
    border-radius: 12px;
    color: #000;
    font-size: 18px;
    font-weight: 900;
    text-transform: uppercase;
    padding: 0 45px;
    height: 52px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.action-btn:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
    transform: translateY(-3px);
}

.action-btn:disabled {
    background: #2d2f4a;
    color: #6b7280;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================================================
НОВЫЙ БЛОК: ИНФО-КАРТОЧКИ (ПРАВИЛА И Т.Д.)
========================================================================== */
.bottom-info-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.b-info-card {
    background: #1a1c2a;
    border: 1px solid #2d2f4a;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: 0.3s ease;
}

.b-info-card:hover {
    border-color: #373a5e;
    background: #1e2030;
    transform: translateY(-2px);
}

.b-info-icon {
    font-size: 22px;
    color: #ffd700;
    background: rgba(179, 135, 40, 0.1);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid rgba(179, 135, 40, 0.3);
    flex-shrink: 0;
}

.b-info-text h3 {
    font-size: 16px;
    color: #fff;
    margin-bottom: 6px;
    font-weight: 700;
}

.b-info-text p {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.5;
}

/* ==========================================================================
МОДАЛКА РЕЗУЛЬТАТОВ
========================================================================== */
.res-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(13, 15, 22, 0.9);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.res-modal-card {
    background: #1a1c2a;
    border: 2px solid #ffd700;
    border-radius: 20px;
    padding: 35px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.2);
}

.res-icon {
    font-size: 48px;
    color: #ffd700;
    margin-bottom: 10px;
}

.res-number-badge {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #121420;
    border: 2px solid #ffd700;
    margin: 15px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    color: #fff;
}

.res-timer {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 15px;
}

/* АДАПТИВНОСТЬ */
@media (max-width: 1200px) {
    .bottom-info-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .roulette-layout {
        display: flex;
        flex-direction: column;
    }

    .roulette-left-panel,
    .roulette-right-panel {
        width: 100%;
    }
}
