@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;700;900&family=Rajdhani:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #060610;
    --bg-card: #0d0d1f;
    --bg-card2: #111128;
    --accent: #f5c842;
    --accent2: #ff6b35;
    --accent3: #00d4aa;
    --purple: #7c3aed;
    --text: #e8e8f0;
    --text-muted: #6b6b8a;
    --border: rgba(255,255,255,0.07);
    --glow: 0 0 20px rgba(245,200,66,0.3);
    --coin: #f5c842;
    --radius: 16px;
    --radius-sm: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { font-size: 16px; }

body {
    font-family: 'Rajdhani', sans-serif;
    background: var(--bg-primary);
    color: var(--text);
    min-height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    overflow-x: hidden;
    padding-bottom: 80px;
}

/* Background grid effect */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        linear-gradient(rgba(245,200,66,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(245,200,66,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(6,6,16,0.95);
    backdrop-filter: blur(20px);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-family: 'Orbitron', monospace;
    font-weight: 900;
    font-size: 18px;
    color: var(--accent);
    letter-spacing: 2px;
    text-decoration: none;
}
.logo span { color: var(--accent2); }

.header-coins {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(245,200,66,0.1);
    border: 1px solid rgba(245,200,66,0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-family: 'Orbitron', monospace;
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
}

.coin-icon {
    width: 20px;
    height: 20px;
    background: radial-gradient(circle at 35% 35%, #ffe566, #f5c842, #c9960a);
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 0 8px rgba(245,200,66,0.5);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #7a5500;
    font-weight: 900;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: rgba(6,6,16,0.97);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    z-index: 200;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 10px;
    transition: all 0.2s;
    min-width: 50px;
}

.nav-item svg { width: 22px; height: 22px; }

.nav-item.active {
    color: var(--accent);
}

.nav-item.active svg {
    filter: drop-shadow(0 0 6px var(--accent));
}

.nav-item:active { transform: scale(0.9); }

/* Page Content */
.page { 
    position: relative;
    z-index: 1;
    padding: 16px;
}

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

.card-highlight {
    background: linear-gradient(135deg, #1a1535, #0d1a2e);
    border: 1px solid rgba(124,58,237,0.3);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    -webkit-user-select: none;
    user-select: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #e6a800);
    color: #060610;
}

.btn-primary:hover { box-shadow: var(--glow); }

.btn-secondary {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-success {
    background: linear-gradient(135deg, #00d4aa, #00a882);
    color: #060610;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #fff;
}

.btn-full { width: 100%; }

.btn-lg { padding: 16px 24px; font-size: 17px; border-radius: 14px; }

/* Input */
.form-group { margin-bottom: 14px; }

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 13px 16px;
    color: var(--text);
    font-family: 'Rajdhani', sans-serif;
    font-size: 15px;
    transition: border-color 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(245,200,66,0.1);
}

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

/* Coin display big */
.coin-display {
    text-align: center;
    padding: 24px 0 16px;
}

.coin-display .amount {
    font-family: 'Orbitron', monospace;
    font-size: 40px;
    font-weight: 900;
    color: var(--accent);
    text-shadow: 0 0 30px rgba(245,200,66,0.5);
    line-height: 1;
}

.coin-display .label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Task item */
.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.task-item:active { transform: scale(0.99); background: var(--bg-card2); }

.task-item.completed {
    opacity: 0.5;
    pointer-events: none;
}

.task-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.task-icon.youtube { background: rgba(255,0,0,0.15); color: #ff4444; }
.task-icon.facebook { background: rgba(24,119,242,0.15); color: #1877f2; }
.task-icon.telegram { background: rgba(0,136,204,0.15); color: #0088cc; }
.task-icon.star { background: rgba(245,200,66,0.15); color: var(--accent); }
.task-icon.play { background: rgba(0,212,170,0.15); color: var(--accent3); }
.task-icon.users { background: rgba(124,58,237,0.15); color: var(--purple); }
.task-icon.default { background: rgba(255,255,255,0.05); color: var(--text-muted); }

.task-icon svg { width: 22px; height: 22px; }

.task-info { flex: 1; min-width: 0; }

.task-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.task-reward {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'Orbitron', monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}

/* Mining section */
.mining-card {
    background: linear-gradient(135deg, #0d1520, #0d0d1f);
    border: 1px solid rgba(0,212,170,0.2);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.mining-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(0,212,170,0.05) 0%, transparent 60%);
    animation: pulse-slow 4s ease-in-out infinite;
}

@keyframes pulse-slow {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
}

.mining-rate {
    font-family: 'Orbitron', monospace;
    font-size: 13px;
    color: var(--accent3);
    letter-spacing: 1px;
}

/* Tap button */
.tap-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
}

.tap-btn {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ffe566, #f5c842, #c9960a);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    font-family: 'Orbitron', monospace;
    font-size: 28px;
    font-weight: 900;
    color: #060610;
    box-shadow: 0 0 40px rgba(245,200,66,0.4), inset 0 -4px 0 rgba(0,0,0,0.2);
    transition: all 0.1s;
    position: relative;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
}

.tap-btn:active {
    transform: scale(0.94);
    box-shadow: 0 0 20px rgba(245,200,66,0.2);
}

.tap-btn svg { width: 60px; height: 60px; }

.energy-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    margin-top: 16px;
    overflow: hidden;
}

.energy-fill {
    height: 100%;
    background: linear-gradient(90deg, #f5c842, #ff6b35);
    border-radius: 3px;
    transition: width 0.3s;
}

.energy-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Float +coins animation */
.coin-float {
    position: fixed;
    pointer-events: none;
    font-family: 'Orbitron', monospace;
    font-weight: 900;
    font-size: 20px;
    color: var(--accent);
    text-shadow: 0 0 10px rgba(245,200,66,0.8);
    z-index: 9999;
    animation: float-up 1s ease-out forwards;
}

@keyframes float-up {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-80px) scale(1.2); opacity: 0; }
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    transition: width 0.5s ease;
}

/* Ads */
.ad-banner {
    width: 100%;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-banner img { width: 100%; display: block; }

/* Notification badge */
.badge {
    background: var(--accent2);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    padding: 2px 6px;
    min-width: 18px;
    text-align: center;
}

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

.section-title {
    font-family: 'Orbitron', monospace;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text);
}

/* Stat grid */
.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    text-align: center;
}

.stat-value {
    font-family: 'Orbitron', monospace;
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Alert/Toast */
.toast {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card2);
    border: 1px solid var(--border);
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    z-index: 9999;
    white-space: nowrap;
    animation: toast-in 0.3s ease;
    max-width: 90%;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.toast-success { border-color: var(--accent3); color: var(--accent3); }
.toast-error { border-color: #ef4444; color: #ef4444; }
.toast-info { border-color: var(--accent); color: var(--accent); }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    padding: 0;
    animation: fade-in 0.2s ease;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: 24px 24px 0 0;
    padding: 24px 20px max(24px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    animation: slide-up 0.3s ease;
}

@keyframes slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal-handle {
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 16px;
}

.modal-title {
    font-family: 'Orbitron', monospace;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    text-align: center;
}

/* Referral */
.referral-box {
    background: rgba(245,200,66,0.07);
    border: 1px solid rgba(245,200,66,0.2);
    border-radius: var(--radius-sm);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.referral-code {
    font-family: 'Orbitron', monospace;
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 2px;
    flex: 1;
}

/* Withdraw calculator */
.calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.calc-row:last-child { border-bottom: none; }

.calc-label { color: var(--text-muted); }
.calc-value { font-weight: 700; color: var(--text); }
.calc-value.highlight { color: var(--accent3); font-family: 'Orbitron', monospace; }

/* Scratch card */
.scratch-container {
    position: relative;
    width: 280px;
    height: 160px;
    margin: 20px auto;
    border-radius: var(--radius);
    overflow: hidden;
    touch-action: none;
}

.scratch-result {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1535, #0d1a2e);
    border-radius: var(--radius);
}

.scratch-canvas {
    position: absolute;
    inset: 0;
    cursor: crosshair;
    border-radius: var(--radius);
}

/* Level badge */
.level-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(124,58,237,0.2);
    border: 1px solid rgba(124,58,237,0.4);
    color: #a78bfa;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    font-family: 'Orbitron', monospace;
    letter-spacing: 0.5px;
}

/* Video task */
.video-wrapper {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #000;
}

.video-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.video-timer {
    text-align: center;
    padding: 12px;
    font-family: 'Orbitron', monospace;
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
}

.video-timer-label {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Notification list */
.notif-item {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.notif-item.unread {
    border-color: rgba(245,200,66,0.2);
    background: rgba(245,200,66,0.04);
}

.notif-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

/* Leaderboard */
.leader-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.leader-rank {
    font-family: 'Orbitron', monospace;
    font-size: 16px;
    font-weight: 900;
    width: 28px;
    text-align: center;
    color: var(--text-muted);
}

.leader-rank.gold { color: #ffd700; }
.leader-rank.silver { color: #c0c0c0; }
.leader-rank.bronze { color: #cd7f32; }

.leader-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    flex-shrink: 0;
}

/* Streak */
.streak-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin: 12px 0;
}

.streak-day {
    aspect-ratio: 1;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--text-muted);
    border: 1px solid transparent;
}

.streak-day.done { background: rgba(245,200,66,0.15); border-color: rgba(245,200,66,0.3); color: var(--accent); }
.streak-day.today { border-color: var(--accent); background: rgba(245,200,66,0.1); }

/* Divider */
.divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

/* Login page */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 40px 20px 20px;
    background: var(--bg-primary);
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo .name {
    font-family: 'Orbitron', monospace;
    font-size: 32px;
    font-weight: 900;
    color: var(--accent);
    text-shadow: 0 0 30px rgba(245,200,66,0.5);
    letter-spacing: 3px;
}

.auth-logo .tagline {
    color: var(--text-muted);
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 4px;
}

.tg-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #0088cc, #006ba8);
    color: #fff;
    border: none;
    padding: 16px 24px;
    border-radius: 14px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.tg-login-btn:active { transform: scale(0.98); }

.separator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: 1px;
}

.separator::before, .separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Profile avatar */
.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple), #4c1d95);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    border: 3px solid var(--accent);
    margin: 0 auto;
    box-shadow: 0 0 20px rgba(245,200,66,0.3);
}

/* Tab system */
.tabs {
    display: flex;
    background: rgba(255,255,255,0.04);
    border-radius: var(--radius-sm);
    padding: 3px;
    margin-bottom: 16px;
}

.tab {
    flex: 1;
    text-align: center;
    padding: 9px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.tab.active {
    background: var(--bg-card2);
    color: var(--accent);
}

/* Glow effects */
.glow-text { text-shadow: 0 0 20px currentColor; }

/* Scrollable */
.scroll-x {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.scroll-x::-webkit-scrollbar { display: none; }

/* Chip */
.chip {
    white-space: nowrap;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background: var(--bg-card2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
}

.chip.active {
    background: rgba(245,200,66,0.15);
    border-color: rgba(245,200,66,0.4);
    color: var(--accent);
}
