/* Game Lucky Draw Styles - Extracted from game.html */
:root {
    /* Map to Premium Theme Variables */
    --yellow-accent: var(--gold-primary);
    /* #fbbf24 */
    --dark-bg: var(--bg-app);
    /* #000000 */
    --card-bg: var(--bg-surface);
    /* #18181b */
    --border-color: rgba(255, 255, 255, 0.08);
    /* var(--glass-border) */

    --text-primary: var(--text-primary);
    /* #f4f4f5 */
    --text-secondary: var(--text-secondary);
    /* #a1a1aa */

    /* Game Specific Colors */
    --color-green: #10b981;
    /* XANH */
    --color-red: #ef4444;
    /* ĐỎ */
    --color-purple: #8b5cf6;
    /* TÍM */
    --color-yellow: #f59e0b;
    /* VÀNG */
    --color-black: #1f2937;
    /* ĐEN (Dùng cho Parity) */
    --color-white: #f3f4f6;
    /* TRẮNG (Dùng cho Parity) */
    --color-number-bg: #374151;
    /* Màu nền xám đậm cho nút số */

    /* SỬA: Thêm màu cho CHẴN/LẺ */
    --color-CHẴN: #1f2937;
    --color-LẺ: #f3f4f6;
}

body {
    font-family: 'Exo 2', sans-serif;
    /* Premium Font */
    background-color: var(--dark-bg);
    color: #e0e0e0;
    padding-top: 122px;
    /* Header + Sub-header */
    box-sizing: border-box;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex-grow: 1;
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
}

.header-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    /* Glass effect */
}

.sub-header-sticky {
    position: fixed;
    top: 61px;
    left: 0;
    right: 0;
    z-index: 30;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    /* Glass effect */
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.btn-yellow {
    background-color: var(--yellow-accent);
    color: #111827;
    font-weight: 700;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
}

.btn-yellow:hover:not(:disabled) {
    transform: scale(1.03);
    filter: brightness(1.1);
}

.btn-yellow:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-yellow:disabled {
    background-color: #4b5563;
    color: #9ca3af;
    cursor: not-allowed;
}

/* [GAME STYLES] */
.bet-btn {
    padding: 0.75rem 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 6px;
    border: 2px solid transparent;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    line-height: 1.25;
}

.bet-btn:hover {
    transform: scale(1.05);
    filter: brightness(1.15);
}

.bet-btn:active {
    transform: scale(0.95);
}

/* Màu cược */
.color-XANH {
    background-color: var(--color-green);
}

.color-ĐỎ {
    background-color: var(--color-red);
}

.color-TÍM {
    background-color: var(--color-purple);
}

.color-VÀNG {
    background-color: var(--color-yellow);
}

/* SỬA: Đổi tên */
.color-CHẴN {
    background-color: var(--color-CHẴN);
}

.color-LẺ {
    background-color: var(--color-LẺ);
    color: #111;
}

/* Nút số cụ thể */
.number-bet-btn {
    background-color: var(--color-number-bg);
    padding: 0.75rem 0;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 8px;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Orbitron', sans-serif;
    /* Number Font */
}

#countdown-timer {
    font-size: 3rem;
    line-height: 1;
    font-weight: 800;
    color: var(--yellow-accent);
    font-family: 'Orbitron', sans-serif;
}

#result-display-box {
    background-color: rgba(31, 41, 55, 0.5);
    /* Semi-transparent */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
}

/* CSS Spinner */
#spinner-container {
    background-color: var(--card-bg);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

#spinner-container::before,
#spinner-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    z-index: 10;
}

#spinner-container::before {
    left: 0;
    background: linear-gradient(to right, var(--card-bg), transparent);
}

#spinner-container::after {
    right: 0;
    background: linear-gradient(to left, var(--card-bg), transparent);
}

#spinner-reel {
    z-index: 5;
    transition-property: transform;
}

#spinner-line {
    position: absolute;
    left: 50%;
    top: 0;
    height: 100%;
    width: 3px;
    background-color: white;
    opacity: 1;
    box-shadow: 0 0 10px white, 0 0 5px white;
    transform: translateX(-50%);
    z-index: 15;
}

.spinner-cell {
    width: 50px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    border-right: 1px solid var(--border-color);
    box-sizing: border-box;
    font-family: 'Orbitron', sans-serif;
}

/* SỬA: Lịch sử cầu - THIẾT KẾ MỚI (Bảng Cầu) */
#trend-grid {
    display: grid;
    /* 7 cột */
    grid-template-columns: repeat(7, 1fr);
    /* 3 hàng */
    grid-template-rows: repeat(3, 1fr);
    /* Điền theo cột TỪ TRÊN XUỐNG */
    grid-auto-flow: column;
    gap: 8px;
    justify-items: center;
    width: 100%;
    padding: 0;
}

/* ===== [SỬA LỖI] ===== */
.trend-cell {
    /* ĐÃ BÌNH LUẬN: Bỏ width/height cố định để tự co giãn */
    /* width: 36px; */
    /* w-9 */
    /* height: 36px; */
    /* h-9 */

    /* ĐÃ THÊM: Tự động co giãn theo cột (100% width của 1fr) và giữ tỷ lệ 1:1 (vuông) */
    width: 100%;
    aspect-ratio: 1 / 1;

    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Giảm cỡ chữ một chút để vừa khi ô quá nhỏ */
    font-size: 0.875rem;
    /* text-sm */
    font-weight: 700;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-family: 'Orbitron', sans-serif;
}

/* ===== [HẾT SỬA LỖI] ===== */

/* Modal Lịch sử cược */
#history-content::-webkit-scrollbar {
    width: 6px;
}

#history-content::-webkit-scrollbar-track {
    background: #111;
}

#history-content::-webkit-scrollbar-thumb {
    background: var(--yellow-accent);
    border-radius: 10px;
}

/* CSS CHO MODAL VỚI HIỆU ỨNG */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease-in-out;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.modal-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 380px;
    margin: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: scale(0.95) translateY(10px);
    transition: all 0.3s ease-in-out;
}

.modal-overlay.visible .modal-card {
    transform: scale(1) translateY(0);
}

/* Nút điều chỉnh cược */
.mod-btn {
    background-color: #374151;
    color: white;
    font-weight: 700;
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
    transition: all 0.2s ease-in-out;
}

.mod-btn:hover {
    background-color: #4b5563;
    transform: scale(1.05);
    filter: brightness(1.1);
}

.mod-btn:active {
    transform: scale(0.95);
}

/* Nút chọn nhanh mệnh giá */
.quick-bet-btn {
    background-color: #2b2d35;
    color: var(--text-primary);
    font-weight: 600;
    border-radius: 8px;
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease-in-out;
}

.quick-bet-btn:hover {
    background-color: #374151;
    color: var(--yellow-accent);
    transform: scale(1.05);
}

.quick-bet-btn:active {
    transform: scale(0.95);
}

/* Ô nhập liệu trong modal */
#modal-bet-amount {
    background-color: var(--dark-bg);
    border: 1px solid var(--border-color);
    color: var(--yellow-accent);
    font-weight: 800;
    font-size: 1.5rem;
    line-height: 2rem;
    text-align: center;
    border-radius: 8px;
    padding: 0.75rem 0.5rem;
    width: 100%;
    font-family: 'Orbitron', sans-serif;
}

#modal-bet-amount::-webkit-outer-spin-button,
#modal-bet-amount::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#modal-bet-amount {
    -moz-appearance: textfield;
    /* Firefox */
}

/* THÊM CSS CHO LOADER TRONG MODAL */
.loader {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--yellow-accent);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}