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

:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #12122a;
    --bg-card: #1a1a3a;
    --bg-card-hover: #22224a;
    --text-primary: #f0f0ff;
    --text-secondary: #8888bb;
    --text-muted: #555588;
    --accent-1: #6366f1;
    --accent-2: #a855f7;
    --accent-3: #ec4899;
    --gradient-1: linear-gradient(135deg, #6366f1, #a855f7);
    --gradient-2: linear-gradient(135deg, #a855f7, #ec4899);
    --gradient-hero: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
    --success: #22c55e;
    --warning: #eab308;
    --danger: #ef4444;
    --border: rgba(255,255,255,0.08);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-card: 0 4px 24px rgba(0,0,0,0.3);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.loading-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader { position: relative; width: 64px; height: 64px; }
.moon-icon { font-size: 32px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2; }
.spinner {
    width: 64px; height: 64px;
    border: 3px solid var(--border);
    border-top-color: var(--accent-1);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { margin-top: 20px; color: var(--text-secondary); font-size: 14px; }

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10,10,26,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 32px;
}
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo-icon { font-size: 24px; }
.logo-text { font-size: 20px; font-weight: 800; background: var(--gradient-1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.nav { display: flex; gap: 24px; margin-right: auto; }
.nav-link { color: var(--text-secondary); text-decoration: none; font-size: 14px; font-weight: 500; transition: color 0.2s; }
.nav-link:hover { color: var(--text-primary); }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary { background: var(--gradient-1); color: white; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(99,102,241,0.4); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-connect { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); }
.btn-connect:hover { background: var(--bg-card-hover); border-color: var(--accent-1); }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-full { width: 100%; justify-content: center; }

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: 0.3s;
}

.mobile-menu {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 99;
}
.mobile-menu .nav-link { font-size: 16px; }
.mobile-menu .btn { width: 100%; justify-content: center; }

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 24px 80px;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(99,102,241,0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 30% 50%, rgba(168,85,247,0.06) 0%, transparent 40%),
                radial-gradient(ellipse at 70% 30%, rgba(236,72,153,0.04) 0%, transparent 40%);
    pointer-events: none;
}
.hero-content {
    text-align: center;
    max-width: 720px;
    position: relative;
    z-index: 1;
}
.hero-title {
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 16px;
}
.gradient-text {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-subtitle {
    font-size: clamp(16px, 2.5vw, 22px);
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.5;
}
.hero-search {
    display: flex;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto 48px;
}
.search-input {
    flex: 1;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--accent-1); }

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
}
.stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.stat-value { font-size: 28px; font-weight: 800; }
.stat-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }

/* Vote Page */
.vote-page {
    padding: 104px 24px 80px;
    min-height: 100vh;
}
.vote-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.vote-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-card);
}
.card-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.token-icon-container { flex-shrink: 0; }
.token-icon { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.token-icon-placeholder {
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--bg-card-hover);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 700; color: var(--text-muted);
}
.token-name { font-size: 22px; font-weight: 700; }
.token-symbol { font-size: 14px; color: var(--text-secondary); font-weight: 500; }
.token-details { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.detail-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.detail-row:last-child { border-bottom: none; }
.detail-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.detail-value { font-size: 14px; font-weight: 600; }
.detail-value.mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px; color: var(--text-secondary); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.token-links { display: flex; gap: 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.external-link { color: var(--accent-1); text-decoration: none; font-size: 13px; font-weight: 500; transition: color 0.2s; }
.external-link:hover { color: var(--accent-2); }

.card-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; }

/* Vote Progress */
.vote-progress { margin-bottom: 20px; }
.progress-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.progress-label { font-size: 13px; color: var(--text-secondary); }
.progress-count { font-size: 13px; font-weight: 600; color: var(--accent-1); }
.progress-bar {
    height: 12px;
    background: var(--bg-primary);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}
.progress-fill {
    height: 100%;
    background: var(--gradient-1);
    border-radius: 6px;
    transition: width 0.5s ease;
}
.progress-target { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); }

/* Vote Deadline */
.vote-deadline {
    text-align: center;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}
.deadline-label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.deadline-timer { font-size: 24px; font-weight: 700; font-family: 'SF Mono', 'Fira Code', monospace; }
.vote-requirements { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.7; text-align: center; }

/* Vote Success */
.vote-success {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.3);
    border-radius: var(--radius-sm);
    margin-top: 16px;
    font-weight: 600;
    color: var(--success);
}
.success-icon { font-size: 20px; }

/* Recent Voters */
.recent-votes-list { display: flex; flex-direction: column; gap: 8px; }
.vote-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
}
.voter-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--gradient-1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}
.voter-address { font-size: 13px; font-family: 'SF Mono', 'Fira Code', monospace; color: var(--text-secondary); flex: 1; }
.voter-time { font-size: 11px; color: var(--text-muted); }
.vote-placeholder { text-align: center; padding: 20px; color: var(--text-muted); font-size: 14px; }

/* Chart */
.chart-container { min-height: 200px; display: flex; align-items: center; justify-content: center; }
.chart-placeholder { color: var(--text-muted); font-size: 14px; }

/* How It Works */
.section { padding: 80px 24px; }
.section-inner { max-width: 900px; margin: 0 auto; }
.section-title {
    text-align: center;
    font-size: clamp(28px, 4vw, 36px);
    font-weight: 800;
    margin-bottom: 48px;
}
.steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.step { text-align: center; padding: 32px 16px; background: var(--bg-card); border-radius: var(--radius-lg); border: 1px solid var(--border); }
.step-number {
    width: 48px; height: 48px;
    margin: 0 auto 16px;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
}
.step-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.step-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

/* Leaderboard */
.leaderboard-tabs { display: flex; gap: 8px; margin-bottom: 24px; justify-content: center; }
.tab-btn {
    padding: 8px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.tab-btn.active { background: var(--gradient-1); color: white; border-color: transparent; }
.tab-btn:hover:not(.active) { border-color: var(--accent-1); color: var(--text-primary); }

.leaderboard-list { display: flex; flex-direction: column; gap: 8px; }
.leaderboard-placeholder { text-align: center; padding: 40px; color: var(--text-muted); font-size: 14px; }

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.rank { font-size: 16px; font-weight: 800; color: var(--text-muted); min-width: 32px; }
.rank-1 { color: #ffd700; }
.rank-2 { color: #c0c0c0; }
.rank-3 { color: #cd7f32; }
.lb-token-icon { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.lb-token-icon-placeholder { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-card-hover); display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--text-muted); flex-shrink: 0; }
.lb-token-info { flex: 1; }
.lb-token-name { font-size: 14px; font-weight: 600; }
.lb-token-symbol { font-size: 12px; color: var(--text-muted); }
.lb-votes { font-size: 14px; font-weight: 700; color: var(--accent-1); }
.lb-votes-label { font-size: 11px; color: var(--text-muted); display: block; }

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    animation: slideIn 0.3s ease;
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Footer */
.footer {
    padding: 40px 24px;
    border-top: 1px solid var(--border);
    text-align: center;
}
.footer-inner { max-width: 600px; margin: 0 auto; }
.footer-brand { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 8px; }
.footer-text { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.footer-links { display: flex; justify-content: center; gap: 24px; }
.footer-link { color: var(--text-secondary); text-decoration: none; font-size: 13px; transition: color 0.2s; }
.footer-link:hover { color: var(--text-primary); }

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav { display: none; }
    .header-inner .btn-connect { display: none; }
    .mobile-menu-btn { display: flex; }
    .hero-search { flex-direction: column; }
    .hero-stats { flex-wrap: wrap; gap: 24px; }
    .steps { grid-template-columns: repeat(2, 1fr); }
    .token-links { flex-wrap: wrap; }
    .detail-value.mono { max-width: 160px; }
}

@media (max-width: 480px) {
    .steps { grid-template-columns: 1fr; }
    .hero { padding: 100px 16px 60px; }
    .vote-page { padding: 88px 16px 60px; }
    .section { padding: 60px 16px; }
    .vote-card { padding: 20px; }
}
