/* KhiladiBattle - Main CSS */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #6C2BFF;
    --primary-dark: #5420D4;
    --secondary: #0A2540;
    --dark-bg: #0B1929;
    --card-bg: #0D2137;
    --card-border: #1A3A5C;
    --text-white: #FFFFFF;
    --text-muted: #7BA0C0;
    --gold: #FFB800;
    --green: #00C853;
    --red: #FF3B3B;
    --success: #00E676;
    --warning: #FFB800;
    --danger: #FF3B3B;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--dark-bg);
    color: var(--text-white);
    min-height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
}

/* Header */
.header {
    background: var(--secondary);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header .logo { font-size: 20px; font-weight: 800; color: var(--primary); }
.header .right { display: flex; align-items: center; gap: 12px; }
.coin-badge {
    background: rgba(255,184,0,0.15);
    border: 1px solid var(--gold);
    border-radius: 20px;
    padding: 4px 12px;
    display: flex; align-items: center; gap: 6px;
    font-size: 14px; font-weight: 700; color: var(--gold);
}
.bell-btn { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; color: var(--text-white); font-size: 18px; }

/* Page Title Bar */
.page-header {
    background: var(--secondary);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky; top: 0; z-index: 100;
}
.back-btn { color: var(--text-white); font-size: 20px; text-decoration: none; }
.page-title { font-size: 18px; font-weight: 700; }

/* Banner / Announcement */
.announcement {
    background: rgba(108,43,255,0.15);
    border-left: 3px solid var(--primary);
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-muted);
    display: flex; align-items: center; gap: 10px;
    overflow: hidden;
}
.announcement marquee { flex: 1; }

/* Slider Banner */
.banner-slider { position: relative; overflow: hidden; border-radius: 12px; margin: 12px 16px; }
.banner-slider img { width: 100%; border-radius: 12px; display: block; }
.banner-overlay { position: absolute; bottom: 16px; left: 16px; }
.banner-btn {
    background: var(--primary);
    color: white; border: none; border-radius: 20px;
    padding: 8px 18px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.slider-dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--card-border); }
.dot.active { background: var(--primary); }

/* My Matches Section */
.section { padding: 16px; }
.section-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; text-align: center; }

.match-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.match-tab {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 16px 8px;
    text-align: center; cursor: pointer; text-decoration: none;
    display: block;
    transition: all 0.2s;
}
.match-tab:hover { border-color: var(--primary); }
.match-tab .tab-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; margin: 0 auto 8px;
}
.tab-ongoing .tab-icon { background: #00C85320; color: var(--green); }
.tab-upcoming .tab-icon { background: #00B0FF20; color: #00B0FF; }
.tab-completed .tab-icon { background: #00C85320; color: var(--green); }
.match-tab .tab-label { font-size: 13px; font-weight: 600; color: var(--text-white); }

/* Games Grid */
.games-section { padding: 0 16px 16px; }
.games-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.game-card {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    text-decoration: none;
    display: block;
}
.game-card img { width: 100%; height: 130px; object-fit: cover; display: block; }
.game-card-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    padding: 24px 10px 10px;
}
.game-name { font-size: 12px; font-weight: 700; color: white; }
.game-players {
    position: absolute; bottom: 10px; right: 10px;
    display: flex; align-items: center; gap: 4px;
    font-size: 12px; font-weight: 700; color: var(--green);
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

/* Bottom Navigation */
.bottom-nav {
    background: var(--secondary);
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 480px;
    border-top: 1px solid var(--card-border);
    padding: 8px 0;
    z-index: 200;
}
.nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    color: var(--text-muted); text-decoration: none; font-size: 11px;
    padding: 6px; cursor: pointer; transition: color 0.2s;
}
.nav-item.active, .nav-item:hover { color: var(--primary); }
.nav-item .nav-icon { font-size: 22px; }

/* Content area - add bottom padding for nav */
.content { padding-bottom: 80px; }

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

/* Contest Card */
.contest-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    margin: 0 16px 12px;
    overflow: hidden;
}
.contest-header { padding: 12px 14px; border-bottom: 1px solid var(--card-border); }
.contest-title { font-size: 15px; font-weight: 700; }
.contest-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.contest-body { padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; }
.prize-box { text-align: center; }
.prize-label { font-size: 11px; color: var(--text-muted); }
.prize-value { font-size: 18px; font-weight: 800; color: var(--gold); }
.join-btn {
    background: var(--primary); color: white; border: none;
    border-radius: 20px; padding: 10px 24px;
    font-size: 14px; font-weight: 700; cursor: pointer;
    text-decoration: none; display: inline-block;
    transition: background 0.2s;
}
.join-btn:hover { background: var(--primary-dark); }
.join-btn.free { background: var(--green); }

/* Leaderboard */
.tab-selector {
    display: flex; gap: 8px; padding: 16px;
}
.tab-btn {
    flex: 1; padding: 10px; border-radius: 8px;
    border: 1px solid var(--card-border);
    background: var(--card-bg); color: var(--text-muted);
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: all 0.2s;
}
.tab-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

.lb-header {
    background: var(--primary);
    display: grid; grid-template-columns: 60px 1fr 100px;
    padding: 12px 16px; font-size: 13px; font-weight: 700;
    border-radius: 8px; margin: 0 16px 8px;
}
.lb-row {
    display: grid; grid-template-columns: 60px 1fr 100px;
    padding: 12px 16px; font-size: 14px;
    background: var(--card-bg); border: 1px solid var(--card-border);
    border-radius: 8px; margin: 0 16px 8px;
    align-items: center;
}
.lb-rank { font-weight: 800; font-size: 16px; }
.lb-rank.gold { color: var(--gold); }
.lb-rank.silver { color: #C0C0C0; }
.lb-rank.bronze { color: #CD7F32; }
.lb-coins { display: flex; align-items: center; gap: 6px; justify-content: flex-end; font-weight: 700; color: var(--gold); }

/* Profile / Menu */
.profile-section {
    background: white;
    padding: 24px 16px;
    text-align: center;
}
.profile-avatar {
    width: 80px; height: 80px; border-radius: 50%;
    border: 4px solid var(--gold);
    background: var(--primary); margin: 0 auto 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; color: white; font-weight: 800;
}
.profile-username { color: var(--primary); font-size: 20px; font-weight: 800; }
.stats-row {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 1px; background: #e0e0e0;
    border: 1px solid #e0e0e0; border-radius: 12px;
    overflow: hidden; margin: 16px;
}
.stat-box { background: white; padding: 14px 8px; text-align: center; }
.stat-value { font-size: 22px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 11px; color: #999; margin-top: 2px; }

.menu-list { background: white; }
.menu-item {
    display: flex; align-items: center; gap: 14px;
    padding: 16px; border-bottom: 1px solid #f0f0f0;
    text-decoration: none; color: #333;
    font-size: 15px; transition: background 0.2s;
}
.menu-item:hover { background: #f8f8f8; }
.menu-icon { width: 36px; height: 36px; border-radius: 8px; background: #E8F0FE; display: flex; align-items: center; justify-content: center; font-size: 18px; color: #1877F2; }
.menu-arrow { margin-left: auto; color: #999; }

/* Wallet */
.wallet-hero {
    background: var(--secondary);
    text-align: center; padding: 30px 16px;
}
.wallet-total { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.wallet-amount { font-size: 42px; font-weight: 800; color: var(--gold); }
.wallet-sub { display: flex; justify-content: center; gap: 24px; margin-top: 12px; font-size: 13px; color: var(--text-muted); }
.wallet-sub span { color: var(--green); font-weight: 600; }
.wallet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; }
.btn-buy { background: var(--green); color: white; border: none; border-radius: 10px; padding: 14px; font-size: 15px; font-weight: 700; cursor: pointer; }
.btn-withdraw { background: var(--red); color: white; border: none; border-radius: 10px; padding: 14px; font-size: 15px; font-weight: 700; cursor: pointer; }

/* Transaction History */
.tx-item {
    background: #112236;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 14px;
    margin: 0 16px 10px;
    font-size: 13px;
}
.tx-row { display: flex; justify-content: space-between; margin-bottom: 4px; }
.tx-type { color: var(--green); font-weight: 700; }
.tx-date { color: var(--text-muted); }
.tx-desc { color: var(--text-muted); font-size: 12px; }
.tx-amount { color: var(--gold); font-weight: 700; }

/* Forms */
.form-section { background: white; padding: 16px; }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; font-weight: 600; color: #333; margin-bottom: 8px; }
.form-control {
    width: 100%; padding: 12px 14px; border: 1px solid #ddd;
    border-radius: 8px; font-size: 15px; outline: none;
    transition: border-color 0.2s;
}
.form-control:focus { border-color: var(--primary); }
.form-select {
    width: 100%; padding: 12px 14px; border: 1px solid #ddd;
    border-radius: 8px; font-size: 15px; background: white; outline: none;
}
.btn-primary {
    width: 100%; background: var(--red); color: white;
    border: none; border-radius: 10px; padding: 14px;
    font-size: 16px; font-weight: 700; cursor: pointer;
}
.btn-cancel {
    width: 100%; background: var(--red); color: white;
    border: none; border-radius: 10px; padding: 14px;
    font-size: 16px; font-weight: 700; cursor: pointer;
}

/* Login Page */
.login-page { background: white; min-height: 100vh; padding: 40px 24px; }
.login-title { font-size: 32px; font-weight: 800; color: var(--primary); margin-bottom: 36px; line-height: 1.2; }
.login-input {
    width: 100%; padding: 16px 18px;
    border: none; background: #f0f0f0; border-radius: 30px;
    font-size: 15px; outline: none; margin-bottom: 14px;
}
.login-btn {
    width: 100%; background: var(--primary); color: white;
    border: none; border-radius: 30px; padding: 16px;
    font-size: 16px; font-weight: 700; cursor: pointer; margin: 8px 0;
}
.divider { text-align: center; color: #999; margin: 20px 0; font-size: 14px; }
.social-btn { display: flex; justify-content: center; gap: 16px; }
.google-btn {
    width: 56px; height: 56px; border-radius: 50%;
    background: #f5f5f5; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.signup-link { text-align: center; margin-top: 24px; font-size: 14px; color: #666; }
.signup-link a { color: #000; font-weight: 800; text-decoration: none; }

/* Redeem Page */
.redeem-grid { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.redeem-item {
    background: var(--card-bg); border: 1px solid var(--card-border);
    border-radius: 12px; padding: 16px;
    display: flex; align-items: center; gap: 14px;
    cursor: pointer; text-decoration: none;
    transition: border-color 0.2s;
}
.redeem-item:hover { border-color: var(--primary); }
.paytm-logo { width: 48px; height: 48px; border-radius: 50%; background: white; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: #00B9F1; }
.redeem-info { flex: 1; }
.redeem-title { font-size: 14px; font-weight: 700; }
.redeem-sub { font-size: 12px; color: var(--text-muted); }
.redeem-amount { font-size: 18px; font-weight: 800; color: var(--primary); }

/* Refer Page */
.refer-hero { background: var(--primary); padding: 30px 20px; text-align: center; }
.refer-title { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.refer-gift { font-size: 64px; margin: 16px 0; }
.refer-desc { font-size: 14px; line-height: 1.6; opacity: 0.9; }
.referral-box {
    margin: 20px 16px;
    border: 2px dashed rgba(255,255,255,0.4);
    border-radius: 12px; padding: 16px;
}
.referral-label { font-size: 12px; color: rgba(255,255,255,0.7); margin-bottom: 8px; }
.referral-code-row {
    background: white; border-radius: 8px;
    padding: 12px 14px; display: flex; align-items: center; justify-content: space-between;
}
.referral-code { font-size: 18px; font-weight: 800; color: #333; }
.copy-btn { background: none; border: none; font-size: 20px; cursor: pointer; }
.share-label { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.share-btns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; padding: 0 16px 16px; }
.share-btn { border: none; border-radius: 8px; padding: 12px; font-size: 14px; font-weight: 700; color: white; cursor: pointer; }
.telegram-btn { background: #0088CC; }
.facebook-btn { background: #1877F2; }
.whatsapp-btn { background: #25D366; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 8px; margin: 12px 16px; font-size: 14px; }
.alert-success { background: rgba(0,230,118,0.1); border: 1px solid var(--success); color: var(--success); }
.alert-danger { background: rgba(255,59,59,0.1); border: 1px solid var(--danger); color: var(--danger); }

/* Withdraw form */
.withdraw-hero { background: var(--secondary); padding: 20px 16px; text-align: center; }
.withdraw-label { font-size: 14px; color: var(--text-muted); }
.withdraw-amount { font-size: 36px; font-weight: 800; color: var(--text-white); }
.withdraw-form { background: white; margin: 0 16px; border-radius: 12px; padding: 16px; color: #333; }
.wf-label { font-size: 14px; font-weight: 700; color: #333; margin-bottom: 10px; }
.wf-select, .wf-input {
    width: 100%; padding: 12px; border: none; border-bottom: 1px solid #ddd;
    font-size: 15px; outline: none; background: white; color: #333; margin-bottom: 16px;
}
.wf-amount { font-size: 32px; font-weight: 800; color: #333; }
.withdraw-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.btn-red { background: var(--red); color: white; border: none; border-radius: 8px; padding: 14px; font-size: 15px; font-weight: 700; cursor: pointer; }
.btn-gray { background: #ccc; color: white; border: none; border-radius: 8px; padding: 14px; font-size: 15px; font-weight: 700; cursor: pointer; }

/* Responsive */
@media (max-width: 360px) {
    .games-grid { grid-template-columns: 1fr; }
}
