:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-card: #1c2128;
    --bg-hover: #21262d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent-green: #2ea043;
    --accent-green-hover: #3fb950;
    --accent-red: #da3633;
    --accent-orange: #f0883e;
    --accent-gold: #e3b341;
    --accent-blue: #58a6ff;
    --border: #30363d;
    --border-light: #21262d;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    padding-bottom: 80px;
    overflow-x: hidden;
}

/* Header */
.top-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    font-weight: 800;
}

.logo i { color: var(--accent-orange); font-size: 1.5rem; }

.header-actions { display: flex; align-items: center; gap: 10px; }

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

.balance-pill i { color: var(--accent-gold); }

.btn-login, .btn-register {
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-login { color: var(--text-primary); border: 1px solid var(--border); }
.btn-login:hover { background: var(--bg-hover); }

.btn-register { background: var(--accent-green); color: white; border: 1px solid var(--accent-green); }
.btn-register:hover { background: var(--accent-green-hover); }

.btn-icon {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--bg-card); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-primary); text-decoration: none;
    transition: all 0.2s ease;
}
.btn-icon:hover { background: var(--bg-hover); }

/* Promo Banner */
.promo-banner {
    background: linear-gradient(90deg, #1a472a, #2ea043, #1a472a);
    overflow: hidden; white-space: nowrap;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}

.promo-track {
    display: inline-block;
    animation: scroll 20s linear infinite;
    font-size: 0.75rem; font-weight: 600; color: white;
}

.promo-track span { padding: 0 30px; }

@keyframes scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* Main Content */
.main-content { max-width: 1200px; margin: 0 auto; padding: 16px; }

/* Hero */
.hero-section {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    text-align: center;
}

.hero-section h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: 8px; }
.hero-section h1 span { color: var(--accent-orange); }
.hero-section p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 16px; }

.hero-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.btn-primary {
    background: var(--accent-green); color: white;
    padding: 12px 28px; border-radius: var(--radius-sm);
    text-decoration: none; font-weight: 700; font-size: 0.9rem;
    transition: all 0.2s ease; border: none; cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary:hover { background: var(--accent-green-hover); transform: translateY(-1px); }

.btn-secondary {
    background: var(--bg-hover); color: var(--text-primary);
    padding: 12px 28px; border-radius: var(--radius-sm);
    text-decoration: none; font-weight: 600; font-size: 0.9rem;
    transition: all 0.2s ease; border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-card); }

/* Section Headers */
.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px; margin-top: 24px;
}

.section-header h2 {
    font-size: 1.1rem; font-weight: 700;
    display: flex; align-items: center; gap: 8px;
}

.section-header h2 i { color: var(--accent-orange); }

.section-header a { color: var(--accent-blue); text-decoration: none; font-size: 0.8rem; font-weight: 600; }

/* Live Events */
.live-events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }

.live-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 14px;
    position: relative; overflow: hidden;
}

.live-card::before {
    content: ''; position: absolute; top: 0; left: 0;
    width: 3px; height: 100%; background: var(--accent-red);
}

.live-badge {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--accent-red); color: white;
    font-size: 0.65rem; font-weight: 700;
    padding: 2px 8px; border-radius: 4px; margin-bottom: 8px;
}

.live-badge .pulse {
    width: 6px; height: 6px; background: white;
    border-radius: 50%; animation: pulse 1.5s infinite;
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.live-teams { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.live-teams .team { font-size: 0.85rem; font-weight: 600; }
.live-score { font-size: 1.3rem; font-weight: 800; color: var(--accent-orange); }
.live-minute { font-size: 0.75rem; color: var(--accent-red); font-weight: 600; margin-bottom: 10px; }
.live-odds { display: flex; gap: 6px; flex-wrap: wrap; }

/* Sport Tabs */
.sport-tabs {
    display: flex; gap: 8px;
    overflow-x: auto; padding: 4px 0 12px;
    margin-bottom: 8px; scrollbar-width: none;
}

.sport-tabs::-webkit-scrollbar { display: none; }

.sport-tab {
    padding: 8px 16px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: 20px;
    color: var(--text-secondary); text-decoration: none;
    font-size: 0.8rem; font-weight: 600;
    white-space: nowrap; transition: all 0.2s ease;
    display: flex; align-items: center; gap: 6px;
}

.sport-tab.active, .sport-tab:hover {
    background: var(--accent-green); color: white; border-color: var(--accent-green);
}

/* Match Cards */
.match-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 14px 16px;
    margin-bottom: 10px; transition: all 0.2s ease;
}

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

.match-league { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }

.match-teams { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.match-teams .team-name { font-size: 0.95rem; font-weight: 600; }
.match-teams .match-time { font-size: 0.75rem; color: var(--text-muted); background: var(--bg-hover); padding: 2px 8px; border-radius: 4px; }

.odds-row { display: flex; gap: 8px; }

.odds-btn {
    flex: 1; background: var(--bg-hover); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 10px 6px;
    color: var(--text-primary); cursor: pointer;
    transition: all 0.2s ease;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
}

.odds-btn .label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; }
.odds-btn .value { font-size: 0.9rem; font-weight: 700; color: var(--accent-green); }
.odds-btn:hover { background: var(--bg-secondary); border-color: var(--accent-green); }
.odds-btn.selected { background: var(--accent-green); border-color: var(--accent-green); }
.odds-btn.selected .value, .odds-btn.selected .label { color: white; }

/* Aviator */
.aviator-container { max-width: 500px; margin: 0 auto; }

.aviator-game {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 16px;
}

.aviator-header {
    padding: 12px 16px;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--border);
}

.aviator-header h2 { font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.aviator-header h2 i { color: var(--accent-orange); }

.aviator-status { font-size: 0.75rem; padding: 3px 10px; border-radius: 10px; font-weight: 600; }
.aviator-status.flying { background: rgba(46,160,67,0.2); color: var(--accent-green); }
.aviator-status.crashed { background: rgba(218,54,51,0.2); color: var(--accent-red); }
.aviator-status.waiting { background: rgba(88,166,255,0.2); color: var(--accent-blue); }

.aviator-canvas-area {
    height: 280px;
    background: linear-gradient(180deg, #0d1117 0%, #161b22 100%);
    position: relative;
    display: flex; align-items: center; justify-content: center;
}

#aviatorCanvas { width: 100%; height: 100%; }

.aviator-multiplier {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3.5rem; font-weight: 800;
    color: var(--accent-green);
    text-shadow: 0 0 20px rgba(46,160,67,0.5);
    z-index: 10;
}

.aviator-multiplier.crashed { color: var(--accent-red); text-shadow: 0 0 20px rgba(218,54,51,0.5); }

.aviator-controls {
    padding: 16px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}

.aviator-bet-panel {
    background: var(--bg-hover); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 12px;
}

.aviator-bet-panel h4 { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.aviator-bet-panel h4 i { color: var(--accent-orange); }

.bet-input-row { display: flex; gap: 6px; margin-bottom: 10px; }
.bet-input-row input {
    flex: 1; background: var(--bg-primary); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 10px;
    color: var(--text-primary); font-size: 0.9rem; font-weight: 600;
}
.bet-input-row input:focus { outline: none; border-color: var(--accent-green); }

.bet-quick-amounts { display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }
.bet-quick-amounts button {
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text-secondary); padding: 4px 10px;
    border-radius: 4px; font-size: 0.7rem; cursor: pointer;
    transition: all 0.2s ease;
}
.bet-quick-amounts button:hover { background: var(--accent-green); color: white; border-color: var(--accent-green); }

.btn-aviator-bet {
    width: 100%; padding: 14px; border-radius: var(--radius-sm);
    border: none; font-size: 1rem; font-weight: 700;
    cursor: pointer; transition: all 0.2s ease;
}

.btn-aviator-bet.bet { background: var(--accent-green); color: white; }
.btn-aviator-bet.bet:hover { background: var(--accent-green-hover); }
.btn-aviator-bet.cashout { background: var(--accent-orange); color: white; animation: pulse-btn 0.8s infinite; }
.btn-aviator-bet.cashout:hover { background: #ff9f43; }
.btn-aviator-bet:disabled { background: var(--bg-secondary); color: var(--text-muted); cursor: not-allowed; animation: none; }

@keyframes pulse-btn { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.02); } }

/* Aviator History */
.aviator-history { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 16px; }
.aviator-history h3 { font-size: 0.85rem; margin-bottom: 10px; color: var(--text-secondary); }

.history-bubbles { display: flex; gap: 6px; flex-wrap: wrap; }
.history-bubble { padding: 4px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 700; }
.history-bubble.win { background: rgba(46,160,67,0.2); color: var(--accent-green); }
.history-bubble.loss { background: rgba(218,54,51,0.2); color: var(--accent-red); }

/* Jackpot */
.jackpot-hero {
    background: linear-gradient(135deg, #3d1f00 0%, #1a0f00 100%);
    border: 1px solid var(--accent-gold); border-radius: var(--radius-lg);
    padding: 24px; text-align: center; margin-bottom: 20px;
}

.jackpot-hero h2 { font-size: 1.3rem; color: var(--accent-gold); margin-bottom: 8px; }
.jackpot-hero .jackpot-amount { font-size: 2.2rem; font-weight: 800; color: var(--accent-gold); margin-bottom: 8px; }
.jackpot-hero p { color: var(--text-secondary); font-size: 0.85rem; }

.jackpot-games { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; }

.jackpot-game-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 0; border-bottom: 1px solid var(--border);
}
.jackpot-game-row:last-child { border-bottom: none; }

.jackpot-game-info { display: flex; align-items: center; gap: 12px; }
.jackpot-game-num {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--bg-hover);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700; color: var(--text-muted);
}
.jackpot-game-teams { font-size: 0.85rem; font-weight: 600; }
.jackpot-game-date { font-size: 0.7rem; color: var(--text-muted); }

.jackpot-selections { display: flex; gap: 6px; }
.jackpot-selections label { display: flex; align-items: center; gap: 4px; font-size: 0.75rem; color: var(--text-secondary); cursor: pointer; }
.jackpot-selections input[type="radio"] { accent-color: var(--accent-green); }

/* Auth Pages */
.auth-container { max-width: 400px; margin: 40px auto; padding: 0 16px; }

.auth-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; }
.auth-card .logo { justify-content: center; margin-bottom: 24px; font-size: 1.8rem; }
.auth-card h2 { text-align: center; margin-bottom: 24px; font-size: 1.2rem; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; }

.form-group input {
    width: 100%; background: var(--bg-primary); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 14px;
    color: var(--text-primary); font-size: 0.95rem; transition: all 0.2s ease;
}
.form-group input:focus { outline: none; border-color: var(--accent-green); }
.form-group input::placeholder { color: var(--text-muted); }

.btn-full {
    width: 100%; padding: 14px; background: var(--accent-green);
    color: white; border: none; border-radius: var(--radius-sm);
    font-size: 1rem; font-weight: 700; cursor: pointer; transition: all 0.2s ease;
}
.btn-full:hover { background: var(--accent-green-hover); }

.auth-footer { text-align: center; margin-top: 20px; font-size: 0.85rem; color: var(--text-secondary); }
.auth-footer a { color: var(--accent-blue); text-decoration: none; font-weight: 600; }

.error-message {
    background: rgba(218,54,51,0.1); border: 1px solid var(--accent-red);
    color: var(--accent-red); padding: 10px 14px;
    border-radius: var(--radius-sm); font-size: 0.85rem; margin-bottom: 16px;
}

/* Account Page */
.account-header {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 20px;
    margin-bottom: 16px;
    display: flex; justify-content: space-between; align-items: center;
}

.account-header .user-info h2 { font-size: 1.1rem; margin-bottom: 4px; }
.account-header .user-info p { font-size: 0.8rem; color: var(--text-secondary); }

.account-header .balance-box { text-align: right; }
.account-header .balance-box .label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; }
.account-header .balance-box .amount { font-size: 1.6rem; font-weight: 800; color: var(--accent-green); }

.deposit-form { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; margin-bottom: 16px; }
.deposit-form h3 { font-size: 1rem; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.deposit-form h3 i { color: var(--accent-gold); }

.mpesa-info { background: var(--bg-hover); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 16px; font-size: 0.8rem; color: var(--text-secondary); }
.mpesa-info strong { color: var(--accent-green); }

.bets-history { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; }
.bets-history h3 { font-size: 1rem; margin-bottom: 16px; }

.bet-history-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0; border-bottom: 1px solid var(--border);
}
.bet-history-item:last-child { border-bottom: none; }

.bet-history-info { flex: 1; }
.bet-history-info .bet-desc { font-size: 0.85rem; font-weight: 500; margin-bottom: 2px; }
.bet-history-info .bet-meta { font-size: 0.7rem; color: var(--text-muted); }

.bet-history-amount { text-align: right; }
.bet-history-amount .stake { font-size: 0.85rem; font-weight: 600; }
.bet-history-amount .status { font-size: 0.7rem; padding: 2px 8px; border-radius: 4px; font-weight: 600; }

.status-pending { background: rgba(88,166,255,0.1); color: var(--accent-blue); }
.status-won { background: rgba(46,160,67,0.1); color: var(--accent-green); }
.status-lost { background: rgba(218,54,51,0.1); color: var(--accent-red); }

/* Bet Slip Drawer */
.bet-slip-drawer {
    position: fixed; bottom: 70px; right: -100%;
    width: 100%; max-width: 420px; max-height: 70vh;
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    z-index: 200; display: flex; flex-direction: column;
    transition: right 0.3s ease;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
}

.bet-slip-drawer.open { right: 0; }

.bet-slip-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 16px; border-bottom: 1px solid var(--border);
}

.bet-slip-header h3 { font-size: 1rem; display: flex; align-items: center; gap: 8px; }

.bet-count { background: var(--accent-green); color: white; font-size: 0.7rem; padding: 2px 8px; border-radius: 10px; }

.close-btn { background: none; border: none; color: var(--text-secondary); font-size: 1.1rem; cursor: pointer; padding: 4px; }

.bet-slip-body { flex: 1; overflow-y: auto; padding: 12px 16px; }

.empty-slip { text-align: center; color: var(--text-muted); font-size: 0.85rem; padding: 24px 0; }

.bet-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 0; border-bottom: 1px solid var(--border);
}
.bet-item:last-child { border-bottom: none; }

.bet-info { flex: 1; }
.bet-match { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 2px; }
.bet-selection { font-size: 0.75rem; color: var(--accent-green); }

.remove-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; transition: color 0.2s; }
.remove-btn:hover { color: var(--accent-red); }

.bet-slip-footer { padding: 14px 16px; border-top: 1px solid var(--border); }

.stake-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.stake-row label { font-size: 0.8rem; color: var(--text-secondary); }
.stake-row input {
    width: 120px; background: var(--bg-primary); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 8px 10px;
    color: var(--text-primary); font-size: 0.9rem; text-align: right;
}
.stake-row input:focus { outline: none; border-color: var(--accent-green); }

.potential-win { display: flex; justify-content: space-between; margin-bottom: 12px; }
.potential-win span:first-child { font-size: 0.8rem; color: var(--text-secondary); }
.win-amount { font-size: 1.1rem; font-weight: 700; color: var(--accent-green); }

.btn-place-bet {
    width: 100%; padding: 14px; background: var(--accent-green);
    color: white; border: none; border-radius: var(--radius-sm);
    font-size: 1rem; font-weight: 700; cursor: pointer;
    transition: all 0.2s ease;
}
.btn-place-bet:hover { background: var(--accent-green-hover); }

/* Bet Slip Toggle */
.bet-slip-toggle {
    position: fixed; bottom: 90px; right: 16px;
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--accent-green); color: white;
    border: none; font-size: 1.3rem; cursor: pointer;
    display: none; align-items: center; justify-content: center;
    z-index: 150; box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    transition: all 0.2s ease;
}

.bet-slip-toggle:hover { transform: scale(1.05); }

.badge {
    position: absolute; top: -2px; right: -2px;
    background: var(--accent-red); color: white;
    font-size: 0.65rem; font-weight: 700;
    width: 20px; height: 20px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--bg-secondary); border-top: 1px solid var(--border);
    display: flex; justify-content: space-around; align-items: center;
    padding: 6px 0 10px; z-index: 100;
}

.nav-item {
    display: flex; flex-direction: column; align-items: center;
    gap: 3px; color: var(--text-muted); text-decoration: none;
    font-size: 0.65rem; font-weight: 500; padding: 4px 12px;
    transition: all 0.2s ease; flex: 1;
}

.nav-item i { font-size: 1.2rem; margin-bottom: 2px; }
.nav-item.active { color: var(--accent-green); }
.nav-item.nav-cta { position: relative; }

.nav-cta-ring {
    width: 48px; height: 48px;
    border-radius: 50%; background: linear-gradient(135deg, var(--accent-orange), var(--accent-red));
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 2px; box-shadow: 0 2px 8px rgba(240,136,62,0.4);
}

.nav-cta-ring i { color: white; font-size: 1.3rem; margin-bottom: 0; }

/* Responsive */
@media (max-width: 480px) {
    .header-inner { padding: 10px 12px; }
    .logo { font-size: 1.2rem; }
    .logo i { font-size: 1.3rem; }
    .hero-section h1 { font-size: 1.3rem; }
    .aviator-controls { grid-template-columns: 1fr; }
    .account-header { flex-direction: column; gap: 12px; text-align: center; }
    .account-header .balance-box { text-align: center; }
}
