:root {
    --bg-main: #0B0A10;
    --bg-secondary: #171520;
    --bg-card: rgba(255, 255, 255, 0.03);
    
    --primary: #F00B51;
    --primary-hover: #D40947;
    --secondary: #6366F1;
    
    --text-light: #F8FAFC;
    --text-muted: #94A3B8;
    
    --success: #10B981;
    --danger: #EF4444;
    --border: rgba(255, 255, 255, 0.08);

    --font: 'Outfit', 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-light);
    font-family: var(--font);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Auth View */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.15), transparent 40%),
                radial-gradient(circle at bottom left, rgba(240, 11, 81, 0.15), transparent 40%);
}

.auth-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(16px);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff, #94A3B8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    padding: 14px 16px;
    border-radius: 12px;
    color: var(--text-light);
    font-family: var(--font);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(240, 11, 81, 0.2);
}

.btn {
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    border: none;
    font-family: var(--font);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: 0 4px 15px rgba(240, 11, 81, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(240, 11, 81, 0.4);
}

.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.auth-switch { color: var(--primary); cursor: pointer; text-decoration: underline; }

/* Dashboard View */
.dashboard-view {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background-color: rgba(23, 21, 32, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
}

.brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
}

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

.balance-pill {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    padding: 8px 20px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.balance-pill span { color: var(--success); }

/* Main Content Area */
.main-content {
    margin-top: 80px;
    flex: 1;
    display: flex;
    padding: 20px;
    gap: 20px;
}

/* Actions Sidebar */
.sidebar {
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: calc(100vh - 120px);
    overflow-y: auto;
}

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

.card h3 {
    margin-bottom: 10px;
    font-weight: 700;
    color: var(--text-light);
}

/* Game Area */
body {
    overscroll-behavior-y: none; /* Previne o bounce effect e refresh do mobile no topo */
}

.game-area {
    flex: 1;
    background-color: #000;
    border-radius: 20px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    touch-action: none; /* Bloqueia scroll do navegador sobre a area */
}

#game-canvas-container {
    flex: 1;
    width: 100%;
    touch-action: none;
}

.bet-hud {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(23, 21, 32, 0.9);
    backdrop-filter: blur(8px);
    padding: 16px 24px;
    border-radius: 16px;
    border: 1px solid var(--border);
    display: flex;
    gap: 16px;
    align-items: center;
}

.bet-hud input {
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--border);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    width: 120px;
    text-align: center;
}

.btn-play {
    background: var(--success);
    color: #fff;
    padding: 10px 30px;
    font-size: 1.1rem;
    border-radius: 8px;
    border: none;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    transition: transform 0.2s;
}
.btn-play:hover { transform: scale(1.05); }

/* Utilities */
.hidden { display: none !important; }
.qr-container { background: white; padding: 10px; border-radius: 12px; margin: 10px 0; display: inline-block; }
.qr-code { font-family: monospace; word-break: break-all; font-size: 0.8rem; background: rgba(0,0,0,0.3); padding: 8px; border-radius: 8px; }

/* Mobile Navigation Footer */
.mobile-nav { display: none; }

/* Game Mute Button */
#mute-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: rgba(23, 21, 32, 0.8);
    padding: 10px;
    border-radius: 50%;
    border: 1px solid var(--border);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    transition: 0.3s;
}
#mute-btn:hover { background: rgba(255, 255, 255, 0.1); }

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
        padding: 10px;
        margin-top: 70px;
        padding-bottom: 70px; /* Space for footer */
        gap: 10px;
    }
    
    .sidebar { width: 100%; height: auto; display: none; padding-bottom: 30px; margin-top: 15px; }
    
    /* Toggle visibility states baseadas nas classes do wrapper */
    .show-game .game-area { display: flex; min-height: 70vh; }
    .show-game .sidebar { display: none; }
    
    .show-dep .game-area { display: none; }
    .show-dep .sidebar { display: flex; }
    .show-dep .sidebar #card-withdraw { display: none; }
    .show-dep .sidebar #card-deposit { display: block; }
    
    .show-wit .game-area { display: none; }
    .show-wit .sidebar { display: flex; }
    .show-wit .sidebar #card-deposit { display: none; }
    .show-wit .sidebar #card-withdraw { display: block; }
    
    .bet-hud { 
        position: fixed;
        left: 0;
        transform: none;
        z-index: 100;
        bottom: 90px; 
        width: 100%; 
        border-radius: 0;
        border-left: none; border-right: none;
        justify-content: center;
        padding: 12px 10px;
    }
    .bet-hud input { width: 80px; padding: 10px; }
    .bet-hud .btn-play { padding: 10px 20px; }
    
    #go-title { font-size: 2.2rem !important; text-align: center; }
    #go-desc { font-size: 1rem !important; text-align: center; padding: 0 10px; }

    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        background: rgba(23, 21, 32, 0.98);
        backdrop-filter: blur(15px);
        border-top: 1px solid var(--border);
        z-index: 900;
    }

    .mobile-nav-btn {
        flex: 1;
        text-align: center;
        padding: 16px 0;
        color: var(--text-muted);
        font-weight: 600;
        font-size: 0.85rem;
        cursor: pointer;
        transition: 0.3s;
        border-top: 2px solid transparent;
    }
    
    .mobile-nav-btn.active {
        color: var(--primary);
        background: rgba(255, 255, 255, 0.03);
        border-top: 2px solid var(--primary);
    }
}
