:root {
    --bg-color: #080612;
    --bg-gradient: radial-gradient(circle at 50% 50%, #151030 0%, #06040d 100%);
    --panel-bg: rgba(13, 10, 28, 0.92);
    --panel-bg-medium: rgba(22, 18, 48, 0.95);
    --panel-bg-dark: rgba(10, 8, 24, 0.98);
    --sidebar-bg: #06040c;
    --header-bg: rgba(0,0,0,0.3);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(255, 183, 3, 0.15);
    --input-bg: rgba(0, 0, 0, 0.25);
    --hover-bg: rgba(255, 255, 255, 0.07);
    --canvas-bg: radial-gradient(circle at center, #1b1540, #040309);
    --primary: #ffb703;
    --primary-gradient: linear-gradient(135deg, #ffb703 0%, #fb8500 100%);
    --danger: #ff4d6d;
    --success: #06d6a0;
    --text-main: #f8f9fa;
    --text-muted: #9fa7b8;
    --font: 'Outfit', sans-serif;
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    --glow-shadow: 0 0 15px rgba(255, 183, 3, 0.25);
    --backdrop: blur(2px);
}

body.light-theme {
    --bg-color: #f0f2f5;
    --bg-gradient: radial-gradient(circle at center, #ffffff 0%, #e3e6eb 100%);
    --panel-bg: rgba(248, 249, 250, 0.95);
    --panel-bg-medium: rgba(255, 255, 255, 0.98);
    --panel-bg-dark: rgba(235, 238, 243, 0.98);
    --sidebar-bg: #ffffff;
    --header-bg: rgba(255,255,255,0.4);
    --border-color: rgba(0, 0, 0, 0.08);
    --border-glow: rgba(251, 133, 0, 0.1);
    --input-bg: #ffffff;
    --hover-bg: rgba(0, 0, 0, 0.05);
    --canvas-bg: radial-gradient(circle at center, #ffffff, #dbe2ef);
    --text-main: #111827;
    --text-muted: #6b7280;
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.08);
    --glow-shadow: 0 0 15px rgba(251, 133, 0, 0.2);
    --backdrop: blur(2px);
}

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

body {
    background-color: var(--bg-color);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    background-size: cover;
    color: var(--text-main);
    font-family: var(--font);
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.app-container {
    width: 100%;
    max-width: 1000px;
    background: var(--panel-bg);
    backdrop-filter: var(--backdrop);
    -webkit-backdrop-filter: var(--backdrop);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: visible;
}

header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 20px 30px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
}

header .logo {
    display: none; /* Hide duplicate logo in top header */
}

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

.logo span {
    color: var(--primary);
}

.balance-container {
    font-size: 18px;
    font-weight: 500;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s;
    color: var(--text-main);
}

.game-area {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.canvas-container {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 1; /* Match the canvas 1200x600 drawing buffer aspect ratio to prevent distortion */
    background: var(--canvas-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.multiplier-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 80px;
    font-weight: 900;
    color: var(--primary);
    text-shadow: 0 0 20px rgba(243, 195, 0, 0.4);
    pointer-events: none;
    transition: color 0.3s;
}

.multiplier-display.crashed {
    color: var(--danger);
    text-shadow: 0 0 20px rgba(230, 57, 70, 0.4);
}

.crash-message {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    font-weight: 700;
    color: var(--danger);
    background: rgba(230, 57, 70, 0.2);
    padding: 10px 20px;
    border-radius: 8px;
    display: none;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.countdown-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(11, 14, 20, 0.85);
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

.countdown-circle-container {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.countdown-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 6;
}

.circle-progress {
    fill: none;
    stroke: var(--primary);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.1s linear, stroke 0.3s ease;
}

.countdown-text-overlay {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: 'Outfit', sans-serif;
}

.countdown-title {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 2px;
}

#countdownTimerVal {
    font-size: 32px;
    font-weight: 900;
    color: white;
    line-height: 1;
}

.countdown-unit {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 1px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    background: var(--panel-bg-dark);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 12px;
}

.bet-controls, .admin-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

input[type="number"] {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 12px;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 16px;
    width: 120px;
    outline: none;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-family: var(--font);
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.bet-btn {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 15px rgba(42, 157, 143, 0.3);
}

.bet-btn:hover:not(:disabled) {
    background: #21867a;
    transform: translateY(-2px);
}

.cashout-btn {
    background: var(--primary);
    color: #000;
    box-shadow: 0 4px 15px rgba(243, 195, 0, 0.3);
}

.cashout-btn:hover:not(:disabled) {
    background: #d4aa00;
    transform: translateY(-2px);
}

.start-btn {
    background: #3a0ca3;
    color: white;
}

.start-btn:hover:not(:disabled) {
    background: #31088c;
}

.log-area {
    background: var(--panel-bg-dark);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 12px;
    max-height: 150px;
    overflow-y: auto;
}

.log-area h3 {
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
}

#gameLog {
    list-style: none;
    font-size: 14px;
}

#gameLog li {
    padding: 5px 0;
    border-bottom: 1px solid var(--border-color);
}

#gameLog li span.success { color: var(--success); }
#gameLog li span.danger { color: var(--danger); }
#gameLog li span.info { color: #4cc9f0; }

/* Sidebar Layout & Footer */
.main-wrapper { display: flex; width: 100%; min-height: 100vh; }
.site-sidebar { 
    width: 250px; 
    background: var(--sidebar-bg); 
    border-right: 1px solid var(--border-color); 
    padding: 30px 20px; 
    display: flex; 
    flex-direction: column;
    box-shadow: 5px 0 25px rgba(0,0,0,0.15);
}
.site-sidebar .logo { 
    margin-bottom: 40px; 
    font-size: 24px; 
    text-align: center; 
    font-weight: 900;
    letter-spacing: 1px;
}
.nav-links { list-style: none; flex: 1; }
.nav-links > li > a { 
    display: block; 
    padding: 9px 16px; 
    color: var(--text-muted); 
    text-decoration: none; 
    border-radius: 8px; 
    margin-bottom: 3px; 
    font-weight: bold; 
    font-size: 14px; 
    border-left: 3px solid transparent;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.nav-links > li > a:hover, .nav-links > li > a.active { 
    background: var(--hover-bg); 
    color: var(--text-main); 
    border-left: 3px solid var(--primary);
    transform: translateX(4px); 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.menu-section-title {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1.3px;
    margin-top: 16px;
    margin-bottom: 6px;
    padding-left: 16px;
    opacity: 0.6;
}
.nav-links > li:first-child.menu-section-title {
    margin-top: 0;
}
.sidebar-support { 
    margin-top: auto; 
    padding: 20px 15px; 
    border-top: 1px solid var(--border-color); 
    text-align: center; 
}
.telegram-support-btn { 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0088cc;
    color: #ffffff !important;
    text-decoration: none;
    font-weight: bold;
    font-size: 13px;
    padding: 10px 18px;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.2);
    width: 80%;
    margin: 0 auto;
}
.telegram-support-btn:hover {
    background: #0099ff;
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4);
    transform: translateY(-2px);
    text-shadow: none !important;
}

.site-content { flex: 1; display: flex; flex-direction: column; background: var(--bg-color); overflow-y: auto; height: 100vh; }
.app-container { margin: 40px auto; flex-shrink: 0; } /* Prevent flex squishing in viewport */

.site-footer { background: var(--bg-color); padding: 40px 20px; text-align: center; border-top: 1px solid var(--border-color); margin-top: 40px; }
.footer-content { max-width: 800px; margin: 0 auto; color: #888; font-size: 13px; line-height: 1.8; }
.crypto-icons span { margin: 0 10px; font-weight: bold; color: #bbb; }
.footer-links { margin: 15px 0; }
.footer-links a { color: #888; text-decoration: none; margin: 0 10px; text-transform: uppercase; font-size: 11px; font-weight: bold; letter-spacing: 1px; }
.footer-links a:hover { color: white; }

/* Mobile Responsive Adjustments */
@media screen and (max-width: 768px) {
    .bet-panels-container { flex-direction: column; gap: 10px; }
    .main-wrapper { flex-direction: column; }
    .site-content { order: 1; height: auto; overflow: visible; }
    .site-sidebar { order: 2; width: 100%; padding: 15px; border-right: none; border-top: 1px solid rgba(255,255,255,0.05); border-bottom: none; height: auto; }
    .site-sidebar .logo { display: none; }
    header .logo { display: block; margin-bottom: 10px; }
    .nav-links { display: flex; flex-wrap: wrap; justify-content: center; }
    .nav-links li { flex: 1 1 40%; text-align: center; }
    .app-container {
        border-radius: 0;
        margin: 0;
        min-height: auto;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 15px;
    }
    
    header > div {
        flex-wrap: wrap;
        justify-content: center;
    }

    .header-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .canvas-container {
        height: auto; /* Allow aspect-ratio to scale the height proportionally on mobile */
    }
    
    .game-area {
        padding: 10px;
        gap: 10px;
    }

    .controls {
        padding: 10px;
    }

    .bet-controls {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
    }

    .bet-controls input {
        width: 100%;
        margin-bottom: 5px;
        padding: 15px;
        font-size: 18px;
        text-align: center;
    }

    .bet-controls .btn {
        flex: 1;
        padding: 15px 5px;
        font-size: 14px;
        width: auto;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .sidebar a {
        flex: 1;
        text-align: center;
        margin: 0;
        white-space: nowrap;
    }
    
    .sidebar a.logout {
        margin-top: 0;
    }

    .panel {
        padding: 15px;
        overflow-x: auto;
    }
    
    .multiplier-display {
        font-size: 50px;
    }
}

/* Crash History Bar */
.history-container {
    position: relative;
    margin-bottom: 12px;
    z-index: 10;
}
.history-top-bar {
    display: flex;
    align-items: center;
    background: rgba(18, 18, 29, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 30px;
    padding: 6px 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.history-ticker {
    flex: 1;
    display: flex;
    gap: 8px;
    overflow: hidden;
    white-space: nowrap;
    padding: 4px 0;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 15%);
    mask-image: linear-gradient(to right, transparent 0%, #000 15%);
}
.history-toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.2s ease;
    font-size: 12px;
}
.history-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}
.history-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(18, 18, 29, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}
.history-close {
    cursor: pointer;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.05);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-muted);
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.history-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}
.crash-history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
}
.history-item {
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.5px;
}
.history-item:hover {
    transform: translateY(-2px) scale(1.05);
    background: rgba(255, 255, 255, 0.08);
}
.history-item.low {
    color: #4cc9f0;
    background: rgba(76, 201, 240, 0.08);
    border-color: rgba(76, 201, 240, 0.25);
    box-shadow: 0 2px 10px rgba(76, 201, 240, 0.15);
    text-shadow: 0 0 4px rgba(76, 201, 240, 0.4);
}
.history-item.low:hover {
    border-color: rgba(76, 201, 240, 0.5);
    box-shadow: 0 4px 15px rgba(76, 201, 240, 0.35);
}
.history-item.mid {
    color: #c155ff;
    background: rgba(193, 85, 255, 0.08);
    border-color: rgba(193, 85, 255, 0.25);
    box-shadow: 0 2px 10px rgba(193, 85, 255, 0.15);
    text-shadow: 0 0 4px rgba(193, 85, 255, 0.4);
}
.history-item.mid:hover {
    border-color: rgba(193, 85, 255, 0.5);
    box-shadow: 0 4px 15px rgba(193, 85, 255, 0.35);
}
.history-item.high {
    color: #ff2e93;
    background: rgba(255, 46, 147, 0.08);
    border-color: rgba(255, 46, 147, 0.25);
    box-shadow: 0 2px 10px rgba(255, 46, 147, 0.15);
    text-shadow: 0 0 4px rgba(255, 46, 147, 0.4);
}
.history-item.high:hover {
    border-color: rgba(255, 46, 147, 0.5);
    box-shadow: 0 4px 15px rgba(255, 46, 147, 0.35);
}
.history-item.epic {
    color: #ffb703;
    background: rgba(255, 183, 3, 0.1);
    border-color: rgba(255, 183, 3, 0.3);
    box-shadow: 0 2px 12px rgba(255, 183, 3, 0.2);
    text-shadow: 0 0 6px rgba(255, 183, 3, 0.6);
    animation: epicPulse 2s infinite ease-in-out;
}
.history-item.epic:hover {
    border-color: rgba(255, 183, 3, 0.6);
    box-shadow: 0 4px 18px rgba(255, 183, 3, 0.45);
}
@keyframes epicPulse {
    0%, 100% { box-shadow: 0 2px 12px rgba(255, 183, 3, 0.2); }
    50% { box-shadow: 0 2px 20px rgba(255, 183, 3, 0.45); }
}

/* Advanced Bet Panel */
.bet-panels-container { display: flex; gap: 20px; }
.adv-bet-panel { 
    flex: 1; 
    background: var(--panel-bg-medium); 
    border: 1px solid var(--border-color); 
    border-radius: 16px; 
    padding: 20px; 
    box-shadow: var(--shadow);
    backdrop-filter: var(--backdrop);
    -webkit-backdrop-filter: var(--backdrop);
}
.bet-tabs { display: flex; justify-content: center; gap: 5px; margin-bottom: 15px; }
.b-tab { background: transparent; border: none; color: var(--text-muted); padding: 6px 22px; border-radius: 20px; cursor: pointer; font-weight: bold; font-size: 13px; transition: all 0.2s; }
.b-tab.active { background: var(--hover-bg); color: var(--text-main); box-shadow: inset 0 1px 3px rgba(0,0,0,0.2); }
.bet-main-row { display: flex; gap: 12px; }
.amount-section { flex: 1.4; }
.amount-input-group { display: flex; background: var(--panel-bg-dark); border-radius: 8px; overflow: hidden; align-items: center; border: 1px solid var(--border-color); height: 48px; }
.qty-btn { background: transparent; color: var(--text-muted); border: none; padding: 4px; cursor: pointer; width: 32px; font-weight: bold; font-size: 18px; transition: 0.2s; }
.qty-btn:hover { color: var(--text-main); background: var(--hover-bg); }
.amount-input-group input { flex: 1; background: transparent; border: none; color: var(--text-main); text-align: center; font-weight: bold; font-family: var(--font); width: 100%; outline: none; font-size: 16px; min-width: 0; }
.amount-input-group input[type=number]::-webkit-inner-spin-button, 
.amount-input-group input[type=number]::-webkit-outer-spin-button,
.auto-mult-input::-webkit-inner-spin-button, 
.auto-mult-input::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}
.amount-input-group input[type=number],
.auto-mult-input { 
    -moz-appearance: textfield; 
}
.quick-amounts { display: flex; gap: 6px; margin-top: 10px; }
.quick-amounts button { 
    flex: 1; 
    background: var(--panel-bg-dark); 
    color: var(--text-muted); 
    border: 1px solid var(--border-color); 
    border-radius: 20px; 
    padding: 6px 0; 
    font-size: 12px; 
    font-weight: 600;
    cursor: pointer; 
    transition: all 0.2s ease;
}
.quick-amounts button:hover { 
    color: var(--text-main); 
    border-color: var(--primary); 
    background: var(--hover-bg);
}
.action-section { flex: 1; }
.big-action-btn { 
    width: 100%; 
    height: 100%; 
    min-height: 90px;
    border: none; 
    border-radius: 12px; 
    cursor: pointer; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    font-family: var(--font); 
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 
    box-shadow: 0 4px 15px rgba(0,0,0,0.3); 
}
.big-action-btn:hover:not(:disabled) { 
    transform: translateY(-2px); 
}
.big-action-btn.btn-green { 
    background: linear-gradient(135deg, #06d6a0 0%, #05a87d 100%); 
    color: white; 
    box-shadow: 0 0 20px rgba(6, 214, 160, 0.35);
}
.big-action-btn.btn-green:hover {
    box-shadow: 0 0 25px rgba(6, 214, 160, 0.5);
}
.big-action-btn.btn-orange { 
    background: linear-gradient(135deg, #ffb703 0%, #fb8500 100%); 
    color: #000; 
    box-shadow: 0 0 20px rgba(255, 183, 3, 0.35);
}
.big-action-btn.btn-orange:hover {
    box-shadow: 0 0 25px rgba(255, 183, 3, 0.5);
}
.big-action-btn.btn-red { 
    background: linear-gradient(135deg, #ff4d6d 0%, #c9184a 100%); 
    color: white; 
    box-shadow: 0 0 20px rgba(255, 77, 109, 0.35);
}
.big-action-btn .btn-title { font-size: 20px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.5px; }
.big-action-btn .btn-val { font-size: 14px; font-weight: 900; opacity: 0.9; margin-top: 2px; }
.auto-controls { display: flex; gap: 15px; margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--border-color); flex-wrap: wrap; align-items: center; }
.switch-lbl { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 12px; font-weight: bold; }
.switch-lbl input[type='checkbox'] { display: none; }
.slider { width: 34px; height: 18px; background: var(--panel-bg-dark); border-radius: 18px; position: relative; cursor: pointer; border: 1px solid var(--border-color); }
.slider::before { content: ''; position: absolute; width: 14px; height: 14px; background: var(--text-muted); border-radius: 50%; top: 1px; left: 2px; transition: 0.2s; }
.switch-lbl input:checked + .slider { background: #28a745; border-color: #28a745; }
.switch-lbl input:checked + .slider::before { background: white; transform: translateX(14px); }
.auto-mult-input { width: 50px; background: var(--panel-bg-dark); border: 1px solid var(--border-color); color: var(--text-main); border-radius: 15px; padding: 2px 8px; text-align: center; font-family: var(--font); font-size: 12px; outline: none; margin-left: 5px; }
@media (max-width: 768px) { .bet-panels-container { flex-direction: column; } }

/* Cashout Alert Animation */
.cashout-alert {
    background: rgba(40, 167, 69, 0.95);
    color: white;
    padding: 10px 25px;
    border-radius: 30px;
    font-family: var(--font);
    font-weight: 900;
    font-size: 18px;
    box-shadow: 0 5px 20px rgba(40, 167, 69, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: cashoutPop 2.5s ease-out forwards;
}
.cashout-alert .co-mult {
    font-size: 24px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
@keyframes cashoutPop {
    0% { transform: scale(0.5) translateY(20px); opacity: 0; }
    10% { transform: scale(1.1) translateY(0); opacity: 1; }
    20% { transform: scale(1) translateY(0); opacity: 1; }
    80% { transform: scale(1) translateY(-20px); opacity: 1; }
    100% { transform: scale(0.9) translateY(-40px); opacity: 0; }
}

/* Custom Scrollbar for sleek UI */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}
::-webkit-scrollbar-corner {
    background: transparent;
}

/* Theme Toggle Button Style */
.theme-toggle-btn, .sound-toggle-btn {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    cursor: pointer;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    outline: none;
}
.theme-toggle-btn:hover, .sound-toggle-btn:hover {
    background: var(--hover-bg);
    transform: translateY(-1px);
}
.theme-toggle-btn svg, .sound-toggle-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Level Up Celebration Styling */
.level-up-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.85);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.level-up-overlay.active {
    display: flex;
    opacity: 1;
}
.level-up-card {
    background: linear-gradient(135deg, #1e1e2f 0%, #11111e 100%);
    border: 2px solid #f3c300;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 0 50px rgba(243, 195, 0, 0.4);
    transform: scale(0.7);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 400px;
    width: 90%;
    position: relative;
    overflow: hidden;
}
body.light-theme .level-up-card {
    background: linear-gradient(135deg, #ffffff 0%, #f3f4f6 100%);
    box-shadow: 0 0 50px rgba(243, 195, 0, 0.2);
}
.level-up-overlay.active .level-up-card {
    transform: scale(1);
}
.level-up-title {
    font-size: 36px;
    font-weight: 900;
    background: linear-gradient(90deg, #f3c300, #ff5e00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    text-transform: uppercase;
}
.level-up-num {
    font-size: 72px;
    font-weight: 900;
    color: #f3c300;
    margin: 20px 0;
    text-shadow: 0 0 20px rgba(243, 195, 0, 0.5);
    animation: pulse 1.5s infinite;
}
.level-up-badge-name {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-main);
    margin-bottom: 25px;
    text-transform: uppercase;
}
.level-up-close {
    background: var(--primary);
    color: #000;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 15px rgba(243, 195, 0, 0.3);
}
.level-up-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 195, 0, 0.5);
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Floating XP Animation */
.floating-xp {
    position: absolute;
    pointer-events: none;
    font-size: 14px;
    font-weight: 900;
    color: #f3c300;
    text-shadow: 0 0 5px rgba(0,0,0,0.8);
    animation: floatUpXp 1s ease-out forwards;
    z-index: 1000;
}
@keyframes floatUpXp {
    0% { transform: translate(-50%, 0) scale(0.5); opacity: 0; }
    20% { transform: translate(-50%, -20px) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -60px) scale(1); opacity: 0; }
}

/* Glassmorphic Panel Card */
.panel {
    background: var(--panel-bg) !important;
    border: 1px solid var(--border-color) !important;
    backdrop-filter: var(--backdrop) !important;
    -webkit-backdrop-filter: var(--backdrop) !important;
    box-shadow: var(--shadow) !important;
    border-radius: 12px !important;
    padding: 30px !important;
    margin-bottom: 25px !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}
.panel:hover {
    border-color: rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5) !important;
}

/* Stat Cards */
.stat-card {
    background: var(--panel-bg-medium) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow) !important;
    border-radius: 12px !important;
    padding: 25px !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}
.stat-card:hover {
    border-color: rgba(255, 255, 255, 0.15) !important;
    transform: translateY(-2px) !important;
}

/* Deposit/Withdraw Panel overrides */
.deposit-panel, .withdraw-panel, .profile-panel, .kyc-panel {
    background: var(--panel-bg) !important;
    border: 1px solid var(--border-color) !important;
    backdrop-filter: var(--backdrop) !important;
    -webkit-backdrop-filter: var(--backdrop) !important;
    box-shadow: var(--shadow) !important;
    border-radius: 12px !important;
    padding: 30px !important;
}

/* Inputs, Selects, and Textareas */
input[type="text"], input[type="number"], input[type="email"], input[type="password"], input[type="date"], select, textarea {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 8px;
    padding: 12px 16px;
    font-family: var(--font);
    outline: none;
    transition: all 0.2s ease-in-out;
}
input[type="text"]:focus, input[type="number"]:focus, input[type="email"]:focus, input[type="password"]:focus, input[type="date"]:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(255, 183, 3, 0.15);
}

/* Tables styling */
table.tx-table, table {
    width: 100%;
    border-collapse: collapse;
}
table th, table td {
    padding: 15px !important;
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
}
table th {
    color: var(--text-muted) !important;
    text-transform: uppercase;
    font-size: 12px !important;
    font-weight: 600 !important;
}

/* Uniform Buttons styling override */
.btn {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}
.btn:hover:not(:disabled) {
    transform: translateY(-2px) !important;
    box-shadow: var(--glow-shadow) !important;
    filter: brightness(1.1) !important;
}

/* Button Save styling */
.btn-save {
    background: var(--primary-gradient) !important;
    color: #000 !important;
    font-weight: 800 !important;
    border-radius: 8px !important;
    padding: 14px 24px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border: none !important;
    cursor: pointer !important;
    box-shadow: 0 4px 15px rgba(255, 183, 3, 0.3) !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}
.btn-save:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(255, 183, 3, 0.5) !important;
}

/* Status Messages */
.msg, .alert {
    padding: 12px 20px !important;
    border-radius: 8px !important;
    margin-bottom: 20px !important;
    text-align: center !important;
    font-weight: bold !important;
    font-size: 14px !important;
}
.msg.success, .alert-success {
    background: rgba(6, 214, 160, 0.1) !important;
    color: #06d6a0 !important;
    border: 1px solid rgba(6, 214, 160, 0.25) !important;
}
.msg.error, .alert-danger {
    background: rgba(255, 77, 109, 0.1) !important;
    color: #ff4d6d !important;
    border: 1px solid rgba(255, 77, 109, 0.25) !important;
}

/* Custom Toast Container */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 380px;
    width: calc(100% - 48px);
    pointer-events: none;
}

/* Custom Toast Item */
.custom-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 12px;
    background: rgba(15, 12, 34, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #f4f4f5;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    opacity: 0;
    position: relative;
    overflow: hidden;
}

.custom-toast.show {
    transform: translateX(0);
    opacity: 1;
}

/* Accent border indicator */
.custom-toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary, #ffb703);
}

/* Success Type */
.custom-toast.success::before {
    background: #06d6a0;
}
.custom-toast.success {
    border-color: rgba(6, 214, 160, 0.25);
    box-shadow: 0 10px 30px rgba(6, 214, 160, 0.08), 0 4px 12px rgba(0,0,0,0.3);
}
.custom-toast.success .toast-title {
    color: #06d6a0;
}

/* Error Type */
.custom-toast.error::before {
    background: #ff4d6d;
}
.custom-toast.error {
    border-color: rgba(255, 77, 109, 0.25);
    box-shadow: 0 10px 30px rgba(255, 77, 109, 0.08), 0 4px 12px rgba(0,0,0,0.3);
}
.custom-toast.error .toast-title {
    color: #ff4d6d;
}

/* Info Type */
.custom-toast.info::before {
    background: #2196f3;
}
.custom-toast.info {
    border-color: rgba(33, 150, 243, 0.25);
    box-shadow: 0 10px 30px rgba(33, 150, 243, 0.08), 0 4px 12px rgba(0,0,0,0.3);
}
.custom-toast.info .toast-title {
    color: #2196f3;
}

/* Icon, Text and Title */
.toast-icon {
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.toast-message {
    font-family: 'Outfit', sans-serif;
    font-size: 13.5px;
    color: #e4e4e7;
    line-height: 1.4;
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}
.toast-close:hover {
    color: #ffffff;
}