:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --border-color: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(99, 102, 241, 0.2);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-dark: #4f46e5;
    --accent-green: #10b981;
    --accent-yellow: #f59e0b;
    --accent-red: #ef4444;
    --accent-pink: #ec4899;
    --accent-purple: #8b5cf6;
    --gradient-main: linear-gradient(135deg, #6366f1, #8b5cf6);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    background-image: radial-gradient(circle at 100% 0%, rgba(99, 102, 241, 0.05) 0%, transparent 50%), radial-gradient(circle at 0% 100%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.2); }

::selection { background: rgba(99, 102, 241, 0.2); }

/* ===== NAVIGATION ===== */
.nav-container {
    position: fixed;
    top: 16px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 1000;
    padding: 0 16px;
}

header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 12px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 920px;
    box-shadow: var(--shadow-md);
}

.logo {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s;
}

nav a:hover, nav a.active {
    color: var(--accent);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    background: var(--text-primary);
    color: #fff !important;
    text-decoration: none;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-accent {
    background: var(--gradient-main);
}

.btn-accent:hover {
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

.btn-danger { background: var(--accent-red); }
.btn-warning { background: var(--accent-yellow); color: #000; }

/* ===== LAYOUT ===== */
.container {
    max-width: 1100px;
    margin: 140px auto 60px;
    padding: 0 20px;
    flex: 1;
}

.form-container { max-width: 420px; margin: 0 auto; }
.mb-40 { margin-bottom: 40px; }
.mb-24 { margin-bottom: 24px; }
.mb-16 { margin-bottom: 16px; }

/* ===== HERO ===== */
.hero {
    text-align: center;
    margin-bottom: 48px;
}

.hero-tag {
    display: inline-block;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.hero h1 {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.2;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.hero p {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto 24px;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== BENTO GRID ===== */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    grid-auto-rows: minmax(200px, auto);
}

.bento-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.bento-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--border-hover);
}

.bento-wide { grid-column: span 2; }
.bento-full { grid-column: span 4; }
.bento-tall { grid-row: span 2; }

.bento-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.bento-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.bento-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.bento-stat {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.bento-stat-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 4px;
}

/* Server cards */
.server-version {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    display: inline-block;
    margin-bottom: 8px;
}

.server-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-green);
    animation: pulse 2s infinite;
}

.server-dot.offline { background: var(--text-muted); animation: none; }

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

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }

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

input, textarea, select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-error { color: var(--accent-red); font-size: 0.8rem; margin-top: 4px; }

/* ===== TABLES ===== */
.table-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

table { width: 100%; border-collapse: collapse; }

th, td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.02);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(0, 0, 0, 0.02); }

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-green { background: rgba(16, 185, 129, 0.1); color: var(--accent-green); }
.badge-red { background: rgba(239, 68, 68, 0.1); color: var(--accent-red); }
.badge-purple { background: rgba(139, 92, 246, 0.1); color: var(--accent-purple); }

/* ===== STAT CARDS ===== */
.stat-card { text-align: center; }

.stat-number { font-size: 2.5rem; font-weight: 800; color: var(--text-primary); }
.stat-label { color: var(--text-muted); font-size: 0.8rem; margin-top: 4px; }

/* ===== PROFILE ===== */
.profile-header { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--gradient-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.profile-name { font-size: 1.3rem; font-weight: 700; }
.profile-email { color: var(--text-secondary); font-size: 0.85rem; }

.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 20px; }

.profile-stat {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    text-align: center;
}

.profile-stat-value { font-size: 1.3rem; font-weight: 700; }
.profile-stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* ===== POINTS ===== */
.points-display {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--gradient-main);
    color: #fff;
    padding: 14px 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.points-value { font-size: 1.5rem; font-weight: 700; }
.points-label { font-size: 0.8rem; opacity: 0.9; }

.points-history-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.points-change { font-weight: 600; }
.points-change.positive { color: var(--accent-green); }
.points-change.negative { color: var(--accent-red); }

/* ===== LEADERBOARD ===== */
.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.leaderboard-rank {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #000; }
.rank-2 { background: #9ca3af; color: #fff; }
.rank-3 { background: #d97706; color: #fff; }
.rank-other { background: rgba(0, 0, 0, 0.05); color: var(--text-muted); }

.leaderboard-name { font-weight: 600; flex: 1; }
.leaderboard-score { font-weight: 700; color: var(--accent); }

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover { color: var(--text-primary); }

/* ===== TOAST ===== */
#toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: rgba(30, 41, 59, 0.95);
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: var(--shadow-lg);
}

.toast.error { background: rgba(239, 68, 68, 0.95); }
.toast.success { background: rgba(16, 185, 129, 0.95); }

/* ===== REVEAL ===== */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ===== SECTIONS ===== */
.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 16px;
}

/* ===== TABS ===== */
.tabs { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }

.tab-btn {
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    transition: all 0.2s;
}

.tab-btn:hover { color: var(--text-primary); }

.tab-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ===== EMPTY ===== */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .bento-grid { grid-template-columns: repeat(3, 1fr); }
    .bento-wide { grid-column: span 2; }
    .bento-full { grid-column: span 3; }
}

@media (max-width: 900px) {
    .bento-grid { grid-template-columns: repeat(2, 1fr); }
    .bento-wide, .bento-full { grid-column: span 2; }
    .profile-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    header {
        padding: 10px 20px;
        border-radius: var(--radius-lg);
    }

    .menu-toggle {
        display: flex;
        flex-direction: column;
        gap: 4px;
        cursor: pointer;
        z-index: 1001;
        padding: 6px;
    }

    .menu-toggle span {
        width: 20px;
        height: 2px;
        background: var(--text-primary);
        border-radius: 2px;
        transition: 0.3s;
    }

    nav {
        position: fixed;
        top: 12px;
        left: 12px;
        right: 12px;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-lg);
        padding: 70px 20px 20px;
        flex-direction: column;
        align-items: flex-start;
        box-shadow: var(--shadow-lg);
        opacity: 0;
        pointer-events: none;
        transform: translateY(-10px);
        transition: all 0.3s;
    }

    nav.active {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    nav a {
        font-size: 1.1rem;
        width: 100%;
        padding: 12px 0;
        border-bottom: 1px solid var(--border-color);
    }

    nav a.btn {
        border: none;
        padding: 14px;
        text-align: center;
        margin-top: 12px;
        width: 100%;
    }

    .menu-toggle.active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    .menu-toggle.active span:nth-child(2) { opacity: 0; }
    .menu-toggle.active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

    .bento-grid { grid-template-columns: 1fr !important; gap: 12px; grid-auto-rows: auto; }
    .grid-2 { grid-template-columns: repeat(2, 1fr) !important; }
    .bento-card { padding: 14px; border-radius: var(--radius-lg); min-height: auto; }
    .player-card { min-height: auto !important; }

    .hero {
        padding: 28px 16px !important;
        border-radius: var(--radius-lg) !important;
        margin-bottom: 24px !important;
    }
    .hero h1 { font-size: 1.8rem; }
    .hero p { margin-bottom: 0 !important; }

    .mb-40 { margin-bottom: 24px !important; }
    .mb-24 { margin-bottom: 16px !important; }

    .container { margin-top: 80px; }

    .profile-stats { grid-template-columns: 1fr; }
    .profile-stat { padding: 12px; }
}
