/* =========================================
   BGX Gaming Platform - Main Stylesheet
   Dark Professional Gaming Theme
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Exo+2:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --primary: #00f5ff;
    --primary-dim: rgba(0,245,255,0.15);
    --primary-glow: 0 0 20px rgba(0,245,255,0.4);
    --secondary: #7c3aed;
    --accent: #f59e0b;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;

    --bg-base: #050810;
    --bg-card: #0d1117;
    --bg-card2: #111827;
    --bg-input: #0a0f1a;
    --bg-hover: #161f2e;

    --border: rgba(0,245,255,0.12);
    --border-strong: rgba(0,245,255,0.3);

    --text: #e2e8f0;
    --text-muted: #64748b;
    --text-dim: #94a3b8;

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 18px;

    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font-main: 'Exo 2', sans-serif;
    --font-display: 'Rajdhani', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

html { scroll-behavior: smooth; }

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

/* Animated background */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 20% 10%, rgba(0,245,255,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(124,58,237,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(245,158,11,0.02) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* =========================================
   NAVIGATION
   ========================================= */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(5,8,16,0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.navbar-logo {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    box-shadow: var(--primary-glow);
}

.navbar-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(0,245,255,0.5);
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
}

.nav-link {
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    letter-spacing: 0.5px;
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background: var(--primary-dim);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: var(--primary-glow);
}

.navbar-balance {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-dim);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 0.4rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 600;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.avatar:hover {
    border-color: var(--primary);
    box-shadow: var(--primary-glow);
}

/* =========================================
   LAYOUT
   ========================================= */
.page-wrapper {
    min-height: 100vh;
    padding-top: 68px;
    position: relative;
    z-index: 1;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-fluid {
    max-width: 100%;
    padding: 0 1.5rem;
}

.page-content {
    padding: 2rem 0;
}

/* Sidebar layout */
.layout-sidebar {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
    align-items: start;
    padding: 2rem 0;
}

.sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: sticky;
    top: 88px;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.85rem 1.5rem;
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-item a:hover, .sidebar-item.active a {
    background: var(--primary-dim);
    color: var(--primary);
    border-left-color: var(--primary);
}

.sidebar-item a svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-section {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 1rem 1.5rem 0.5rem;
}

/* =========================================
   CARDS
   ========================================= */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover { border-color: var(--border-strong); }

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.5px;
}

.card-body { padding: 1.5rem; }

/* Glow card */
.card-glow {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    box-shadow: 0 0 30px rgba(0,245,255,0.05);
}

/* Stat cards */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 80px; height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--stat-color, var(--primary)) 0%, transparent 70%);
    opacity: 0.1;
    transform: translate(20px, -20px);
}

.stat-card:hover {
    border-color: var(--stat-color, var(--primary));
    box-shadow: 0 0 20px rgba(0,245,255,0.08);
    transform: translateY(-2px);
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--stat-color, var(--primary));
    line-height: 1.2;
}

.stat-value.mono { font-family: var(--font-mono); font-size: 1.6rem; }

.stat-icon {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: var(--primary-dim);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--stat-color, var(--primary));
}

/* =========================================
   GAME CARDS
   ========================================= */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 8px 40px rgba(0,245,255,0.12);
}

.game-card-banner {
    height: 140px;
    background: linear-gradient(135deg, #0d1117, #1a1f35);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.game-card-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--game-color1, #00f5ff), var(--game-color2, #7c3aed));
    opacity: 0.12;
}

.game-icon-big {
    font-size: 3rem;
    position: relative;
    z-index: 1;
}

.game-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--primary-dim);
    border: 1px solid var(--border-strong);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.game-card-body { padding: 1.25rem; }

.game-card-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.game-card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.game-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.game-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82rem;
    color: var(--text-dim);
}

.game-meta-item svg { width: 14px; height: 14px; color: var(--primary); }

/* =========================================
   BUTTONS
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.65rem 1.5rem;
    border-radius: var(--radius);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #0099cc);
    color: #000;
    box-shadow: 0 4px 15px rgba(0,245,255,0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,245,255,0.4);
    background: linear-gradient(135deg, #00ffff, var(--primary));
}

.btn-secondary {
    background: var(--secondary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(124,58,237,0.25);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124,58,237,0.4);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--border-strong);
}

.btn-outline:hover {
    background: var(--primary-dim);
    border-color: var(--primary);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 4px 15px rgba(239,68,68,0.25);
}

.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(239,68,68,0.4); }

.btn-success {
    background: var(--success);
    color: #fff;
    box-shadow: 0 4px 15px rgba(16,185,129,0.25);
}

.btn-success:hover { transform: translateY(-2px); }

.btn-warning {
    background: var(--warning);
    color: #000;
}

.btn-sm { padding: 0.4rem 1rem; font-size: 0.82rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; }
.btn-full { width: 100%; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* Glowing button */
.btn-glow {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: 0 0 20px rgba(0,245,255,0.3), 0 0 40px rgba(124,58,237,0.2);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(0,245,255,0.3), 0 0 40px rgba(124,58,237,0.2); }
    50% { box-shadow: 0 0 30px rgba(0,245,255,0.5), 0 0 60px rgba(124,58,237,0.3); }
}

/* =========================================
   FORMS
   ========================================= */
.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.form-control {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: 0.75rem 1rem;
    font-family: var(--font-main);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
    -webkit-appearance: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,245,255,0.1);
    background: rgba(0,245,255,0.03);
}

.form-control::placeholder { color: var(--text-muted); }

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group .form-control { padding-left: 2.8rem; }

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    width: 18px;
    height: 18px;
    pointer-events: none;
    z-index: 2;
}

.input-suffix {
    position: absolute;
    right: 1rem;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    pointer-events: none;
}

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

select.form-control option { background: var(--bg-card2); }

/* =========================================
   TABLES
   ========================================= */
.table-responsive { overflow-x: auto; border-radius: var(--radius); }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th {
    background: var(--bg-card2);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.9rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text);
    vertical-align: middle;
}

.table tr:hover td { background: var(--bg-hover); }

.table tr:last-child td { border-bottom: none; }

/* =========================================
   BADGES
   ========================================= */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.badge-success { background: rgba(16,185,129,0.15); color: var(--success); border: 1px solid rgba(16,185,129,0.3); }
.badge-danger { background: rgba(239,68,68,0.15); color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--warning); border: 1px solid rgba(245,158,11,0.3); }
.badge-info { background: rgba(0,245,255,0.12); color: var(--primary); border: 1px solid var(--border-strong); }
.badge-muted { background: rgba(100,116,139,0.15); color: var(--text-muted); border: 1px solid rgba(100,116,139,0.3); }
.badge-purple { background: rgba(124,58,237,0.15); color: #a78bfa; border: 1px solid rgba(124,58,237,0.3); }

/* =========================================
   ALERTS
   ========================================= */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    border-left: 4px solid;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

.alert-success { background: rgba(16,185,129,0.1); border-color: var(--success); color: #6ee7b7; }
.alert-danger { background: rgba(239,68,68,0.1); border-color: var(--danger); color: #fca5a5; }
.alert-warning { background: rgba(245,158,11,0.1); border-color: var(--warning); color: #fcd34d; }
.alert-info { background: rgba(0,245,255,0.08); border-color: var(--primary); color: var(--primary); }

/* =========================================
   MODALS
   ========================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(20px);
    transition: var(--transition);
    box-shadow: 0 25px 60px rgba(0,0,0,0.5);
}

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

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}

.modal-close {
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    background: var(--bg-card2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.modal-body { padding: 1.5rem; }

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* =========================================
   PAGE HEADER
   ========================================= */
.page-header {
    margin-bottom: 2rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 1px;
}

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

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.page-actions { display: flex; gap: 0.75rem; align-items: center; }

/* =========================================
   GRID SYSTEM
   ========================================= */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

/* =========================================
   UTILITIES
   ========================================= */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; } .gap-2 { gap: 1rem; } .gap-3 { gap: 1.5rem; }

.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }

.fw-bold { font-weight: 700; }
.fs-sm { font-size: 0.85rem; }

.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

.glow-text {
    color: var(--primary);
    text-shadow: 0 0 20px rgba(0,245,255,0.5);
}

/* =========================================
   SCROLLBAR
   ========================================= */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: rgba(0,245,255,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,245,255,0.4); }

/* =========================================
   TOAST NOTIFICATIONS
   ========================================= */
#toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    min-width: 280px;
    max-width: 380px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.hiding { animation: slideOutRight 0.3s ease forwards; }

@keyframes slideOutRight {
    to { transform: translateX(100%); opacity: 0; }
}

.toast-icon { width: 20px; height: 20px; flex-shrink: 0; }
.toast-title { font-weight: 700; font-size: 0.9rem; }
.toast-msg { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }
.toast-success { border-left: 3px solid var(--success); }
.toast-success .toast-icon { color: var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-error .toast-icon { color: var(--danger); }
.toast-info { border-left: 3px solid var(--primary); }
.toast-info .toast-icon { color: var(--primary); }

/* =========================================
   LEADERBOARD
   ========================================= */
.leaderboard-rank {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
}

.rank-1 { color: #ffd700; }
.rank-2 { color: #c0c0c0; }
.rank-3 { color: #cd7f32; }

/* =========================================
   SPIN WHEEL
   ========================================= */
.spin-container { text-align: center; padding: 2rem; }

.wheel-wrapper {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto 2rem;
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
    border: 4px solid var(--primary);
    box-shadow: 0 0 30px rgba(0,245,255,0.3), inset 0 0 30px rgba(0,0,0,0.5);
}

.wheel-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 25px solid var(--primary);
    filter: drop-shadow(0 0 8px rgba(0,245,255,0.7));
    z-index: 10;
}

/* =========================================
   PROGRESS BAR
   ========================================= */
.progress {
    height: 6px;
    background: var(--bg-card2);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(0,245,255,0.4);
}

/* =========================================
   HERO SECTION (index/home)
   ========================================= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 6rem 0 4rem;
}

.hero-content { position: relative; z-index: 2; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-dim);
    border: 1px solid var(--border-strong);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.hero-title .highlight {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-stats {
    display: flex;
    gap: 3rem;
    margin-top: 4rem;
}

.hero-stat-num {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

.hero-stat-label { font-size: 0.85rem; color: var(--text-muted); }

/* Floating animation */
.float-anim { animation: float 3s ease-in-out infinite; }
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-5 { grid-template-columns: repeat(3, 1fr); }
    .layout-sidebar { grid-template-columns: 1fr; }
    .sidebar { position: static; }
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .navbar { padding: 0 1rem; }
    .navbar-nav { display: none; }
    .page-title { font-size: 1.5rem; }
    .hero-stats { gap: 1.5rem; }
    .game-grid { grid-template-columns: 1fr; }
    .container { padding: 0 1rem; }
}

/* =========================================
   GAME AREA
   ========================================= */
.game-arena {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    min-height: 400px;
    overflow: hidden;
    position: relative;
}

.game-header {
    background: var(--bg-card2);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.game-timer {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    text-shadow: var(--primary-glow);
}

.game-score {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.game-body { padding: 2rem; }

/* Reaction targets */
.target {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    cursor: pointer;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 0 20px rgba(0,245,255,0.4);
    animation: targetPop 0.2s ease;
    transition: transform 0.1s;
}

.target:hover { transform: scale(1.1); }
.target:active { transform: scale(0.9); }

@keyframes targetPop {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* =========================================
   ADMIN SPECIFIC
   ========================================= */
.admin-topbar {
    background: linear-gradient(90deg, rgba(124,58,237,0.15), rgba(0,245,255,0.08));
    border-bottom: 1px solid rgba(124,58,237,0.3);
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    color: #a78bfa;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.admin-sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    min-height: calc(100vh - 68px);
    position: fixed;
    left: 0;
    top: 68px;
    overflow-y: auto;
    z-index: 100;
}

.admin-content {
    margin-left: 260px;
    padding: 2rem;
    min-height: calc(100vh - 68px);
}

.admin-nav-section {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 1.5rem 1.25rem 0.5rem;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.75rem 1.25rem;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.admin-nav-link svg { width: 16px; height: 16px; flex-shrink: 0; }

.admin-nav-link:hover, .admin-nav-link.active {
    background: var(--primary-dim);
    color: var(--primary);
    border-left-color: var(--primary);
}

.admin-nav-link.active { font-weight: 600; }

@media (max-width: 1024px) {
    .admin-sidebar { width: 220px; }
    .admin-content { margin-left: 220px; }
}

@media (max-width: 768px) {
    .admin-sidebar { display: none; }
    .admin-content { margin-left: 0; padding: 1rem; }
}

/* =========================================
   MOBILE FIXES — Complete Responsive Layer
   ========================================= */

/* ---- Hamburger always visible on mobile ---- */
@media (max-width: 768px) {
    #hamburger { display: flex !important; }

    /* Mobile nav drawer */
    .navbar-nav {
        display: none;
        position: fixed;
        top: 68px; left: 0; right: 0;
        background: rgba(5,8,16,0.98);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 1rem 1.5rem;
        gap: 0.25rem;
        z-index: 999;
    }
    .navbar-nav.open { display: flex !important; }
    .navbar-nav .nav-link { padding: 0.75rem 1rem; font-size: 1rem; border-radius: var(--radius); }

    /* Navbar tweaks */
    .navbar { padding: 0 1rem; }
    .navbar-title { font-size: 1.1rem; }
    .navbar-balance { font-size: 0.78rem; padding: 0.35rem 0.75rem; }

    /* Page layout */
    .page-wrapper { padding-top: 68px; }
    .container { padding: 0 0.85rem; }
    .page-content { padding: 1.25rem 0; }

    /* Hero */
    .hero { padding: 4rem 0 2.5rem; }
    .hero > .container > div {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    .hero-title { font-size: clamp(1.8rem, 8vw, 2.8rem); }
    .hero-desc { font-size: 0.95rem; }
    .hero-actions { flex-direction: column; gap: 0.75rem; }
    .hero-actions .btn { width: 100%; justify-content: center; }
    .hero-stats { gap: 1.2rem; flex-wrap: wrap; }
    .hero-stat-num { font-size: 1.8rem; }

    /* Right side visual in hero — hide on mobile */
    .hero > .container > div > div:last-child { display: none; }

    /* Grids collapse */
    .grid-2, .grid-3, .grid-4, .grid-5 {
        grid-template-columns: 1fr !important;
    }

    /* 2-col grids that should stay 2-col on mobile */
    .grid-2.keep-2 { grid-template-columns: 1fr 1fr !important; }

    /* Game grid */
    .game-grid { grid-template-columns: 1fr !important; }

    /* Stat cards */
    .stat-card { padding: 1.1rem; }
    .stat-value { font-size: 1.6rem; }
    .stat-value.mono { font-size: 1.3rem; }
    .stat-icon { display: none; }

    /* Cards */
    .card-body { padding: 1rem; }
    .card-header { padding: 0.9rem 1rem; }

    /* Tables — make scrollable */
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table th, .table td { padding: 0.7rem 0.85rem; font-size: 0.82rem; white-space: nowrap; }

    /* Buttons */
    .btn-lg { padding: 0.75rem 1.25rem; font-size: 0.95rem; }

    /* Page header */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .page-title { font-size: 1.5rem; }
    .page-actions { width: 100%; flex-wrap: wrap; }
    .page-actions .btn { flex: 1; min-width: 120px; justify-content: center; }

    /* Dashboard layout */
    .layout-sidebar {
        grid-template-columns: 1fr !important;
        padding: 1rem 0;
    }
    .sidebar { position: static !important; }

    /* Admin */
    .admin-sidebar { display: none !important; }
    .admin-content { margin-left: 0 !important; padding: 1rem !important; }

    /* Form grids */
    form .grid-2, form .grid-3 { grid-template-columns: 1fr !important; }

    /* Leaderboard podium */
    .leaderboard-rank { font-size: 1.1rem; }

    /* Modals */
    .modal { max-width: 95vw !important; margin: 0 auto; }

    /* Spin wheel */
    .wheel-wrapper { width: 240px !important; height: 240px !important; }
    #wheel-canvas { width: 240px !important; height: 240px !important; }

    /* Feature grid on homepage */
    .features-grid { grid-template-columns: 1fr !important; }

    /* Quick actions in dashboard */
    .card-body > .grid { grid-template-columns: 1fr 1fr !important; }

    /* Game arena */
    .game-header { flex-direction: column; gap: 0.75rem; align-items: flex-start; }
    .game-header > div:last-child { width: 100%; justify-content: space-between; display: flex; }
    .game-timer { font-size: 1.3rem; }
    .game-body { padding: 1rem; }

    /* Toast */
    #toast-container { right: 0.75rem; left: 0.75rem; bottom: 1rem; }
    .toast { min-width: unset; width: 100%; }

    /* Footer */
    footer > .container > div {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    footer .navbar-logo { margin: 0 auto; }
}

/* ---- Small phones (< 400px) ---- */
@media (max-width: 400px) {
    .navbar-balance { display: none; }
    .hero-title { font-size: 1.6rem; }
    .stat-value { font-size: 1.4rem; }
    .btn { padding: 0.6rem 1rem; font-size: 0.85rem; }
    .card-body .grid { grid-template-columns: 1fr !important; }
}

/* ---- Tablet (768px – 1024px) ---- */
@media (min-width: 769px) and (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-5 { grid-template-columns: repeat(3, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .game-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-sidebar { width: 200px !important; }
    .admin-content { margin-left: 200px !important; }
    .hero > .container > div { gap: 2rem !important; }
}

/* ---- Fix navbar balance on tablet ---- */
@media (max-width: 900px) {
    .navbar-nav { gap: 0; }
    .nav-link { padding: 0.4rem 0.6rem; font-size: 0.82rem; }
}

/* ---- Fix game cards hover on touch ---- */
@media (hover: none) {
    .game-card:hover { transform: none; }
    .stat-card:hover { transform: none; }
    .btn:hover { transform: none; }
    .btn-primary:hover { box-shadow: 0 4px 15px rgba(0,245,255,0.25); }
}

/* ---- Admin mobile top bar ---- */
@media (max-width: 768px) {
    .admin-topbar { display: none; }

    /* Add mobile hamburger for admin */
    .admin-mobile-toggle {
        display: flex !important;
        position: fixed;
        bottom: 1.5rem;
        right: 1.5rem;
        width: 52px;
        height: 52px;
        border-radius: 50%;
        background: var(--secondary);
        color: #fff;
        border: none;
        box-shadow: 0 4px 20px rgba(124,58,237,0.5);
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 999;
        font-size: 1.2rem;
    }

    .admin-sidebar.mobile-open {
        display: block !important;
        position: fixed;
        top: 68px;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        z-index: 500;
        overflow-y: auto;
    }
}

/* ---- Deposit/Withdraw grid fix ---- */
@media (max-width: 768px) {
    .deposit-grid, .withdraw-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ---- Leaderboard podium mobile ---- */
@media (max-width: 600px) {
    .podium-wrap {
        flex-direction: column !important;
        align-items: center !important;
    }
    .podium-wrap > div { max-width: 280px !important; width: 100%; }
}

/* ---- Horizontal scroll hint for tables ---- */
.table-responsive::after {
    content: '';
    display: none;
}
@media (max-width: 600px) {
    .table-responsive {
        position: relative;
    }
    .table-responsive::before {
        content: '← scroll →';
        display: block;
        text-align: center;
        font-size: 0.7rem;
        color: var(--text-muted);
        padding: 0.25rem;
        background: var(--bg-card2);
        border-bottom: 1px solid var(--border);
        letter-spacing: 1px;
    }
}

/* =========================================
   GAME PAGE MOBILE FIXES
   ========================================= */
@media (max-width: 600px) {
    .g-head { padding: .65rem .85rem; }
    .g-head-title { font-size: .95rem; }
    .g-stats { gap: 1rem; }
    .g-stat-val { font-size: 1.2rem; }
    .g-body { padding: .85rem .75rem; }
    .ans-grid { grid-template-columns: 1fr 1fr; gap: .5rem; max-width: 100%; }
    .ans-btn { font-size: 1.1rem; padding: .75rem; }
    .math-q { font-size: clamp(1.6rem,7vw,2.5rem); margin-bottom: 1rem; }
    .result-wrap { padding: 1rem .75rem; }
    .result-title { font-size: 1.4rem; }
    .result-table-wrap { font-size: .8rem; }
    .lobby-card { max-width: 100%; }
    .game-type-banner { height: 110px; font-size: 2.5rem; }
}

/* =========================================
   LUCK GAME MOBILE FIXES
   ========================================= */
@media (max-width: 600px) {
    .luck-layout { gap: 1rem; }
    .spin-body { padding: 1rem .85rem; }
    .wheel-outer { width: 200px !important; height: 200px !important; }
    #spin-canvas { width: 200px !important; height: 200px !important; }
    .bet-area { padding: .75rem; }
    .quick-bets { gap: .3rem; }
    .qbet { padding: .25rem .55rem; font-size: .74rem; }
}

/* =========================================
   GAMES LIST MOBILE
   ========================================= */
@media (max-width: 480px) {
    .g-grid { grid-template-columns: 1fr; gap: .75rem; }
    .gc-banner { height: 100px; }
    .gc-icon { font-size: 2.5rem; }
    .gc-body { padding: .85rem; }
    .gc-title { font-size: 1rem; }
    .gc-meta { gap: .65rem; }
    .filter-bar { gap: .3rem; }
    .fbtn { padding: .35rem .75rem; font-size: .76rem; }
}

/* =========================================
   NAVBAR MOBILE TWEAKS
   ========================================= */
@media (max-width: 768px) {
    .navbar-balance span { display: none; }
    .navbar-balance::after { content: 'BGX'; margin-left: 2px; }
}
@media (max-width: 420px) {
    .navbar-balance { display: none !important; }
}

/* =========================================
   TOUCH IMPROVEMENTS
   ========================================= */
@media (hover: none) {
    .ans-btn:hover { border-color: var(--border); background: var(--bg-card2); }
    .ans-btn:active { border-color: var(--primary); background: var(--primary-dim); transform: scale(.97); }
    .gc:active { transform: scale(.98); }
    .btn:active { transform: scale(.97) !important; }
}

/* Prevent zoom on input focus (iOS) */
input, select, textarea {
    font-size: 16px !important;
}
@media (min-width: 769px) {
    input, select, textarea { font-size: inherit !important; }
}
