/* --- ZMIENNE I BAZA (Dark Theme / TikTok Vibe) --- */
:root {
    --bg-dark: #0f0f13;
    --bg-card: rgba(25, 25, 30, 0.8);
    --text-main: #f0f0f2;
    --muted: #8b8b93;
    --border: #2a2a35;
    
    --pink: #ff0050;
    --cyan: #00f2fe;
    
    --radius: 16px;
    --transition: 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 80px; /* Miejsce na mobilne menu na dole */
}

a {
    color: inherit;
    text-decoration: none;
}

/* --- TYPOGRAFIA --- */
h1, h2, h3 { line-height: 1.2; }
.logo { font-size: 24px; font-weight: 900; letter-spacing: -1px; }

/* --- NAWIGACJA GÓRNA --- */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: rgba(15, 15, 19, 0.9);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

/* --- BUTTONY --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-size: 15px;
}

.btn-primary {
    background: linear-gradient(45deg, var(--pink), var(--cyan));
    color: #fff;
}
.btn-primary:hover { opacity: 0.9; transform: scale(0.98); }

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); }

/* --- SEKCJE I HERO --- */
.hero {
    text-align: center;
    padding: 60px 20px;
    max-width: 600px;
    margin: 0 auto;
}
.hero h1 { font-size: 44px; margin-bottom: 16px; font-weight: 900; }
.hero h1 span { background: linear-gradient(90deg, var(--pink), var(--cyan)); -webkit-background-clip: text; color: transparent; }
.hero p { color: var(--muted); margin-bottom: 32px; font-size: 17px; }

.section {
    padding: 24px;
    max-width: 800px;
    margin: 0 auto;
}

/* --- STATYSTYKI GLOBALNE --- */
.global-stats {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 0 24px 40px;
}
.gs-item { text-align: center; background: var(--bg-card); padding: 16px; border-radius: var(--radius); border: 1px solid var(--border); flex: 1; max-width: 160px; }
.gs-num { font-size: 24px; font-weight: 800; color: var(--cyan); }
.gs-label { color: var(--muted); font-size: 11px; text-transform: uppercase; font-weight: 700; margin-top: 4px; }

/* --- KARTY RANKINGU (STYL TIKTOK) --- */
.rank-card {
    display: block; 
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.rank-card:active, .rank-card:hover { background: rgba(255, 255, 255, 0.08); }

.rank-card-top {
    display: flex;
    align-items: center;
    margin-bottom: 16px; 
}
.rank-badge { font-weight: 900; font-size: 18px; color: var(--muted); min-width: 36px; }
.rank-avatar { 
    width: 52px; height: 52px; border-radius: 50%; object-fit: cover; margin-right: 12px;
    border: 2px solid transparent;
    background: linear-gradient(var(--bg-card), var(--bg-card)) padding-box, linear-gradient(45deg, var(--pink), var(--cyan)) border-box;
}
.rank-info { flex: 1; }
.rank-info b { font-size: 16px; display: block; color: var(--text-main); line-height: 1.2; }
.rank-info small { font-size: 13px; color: var(--muted); }

.rank-stats-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.3); 
    padding: 12px 16px;
    border-radius: 12px;
}
.stat-item { display: flex; flex-direction: column; align-items: center; flex: 1; }
.stat-item b { font-size: 16px; color: var(--text-main); font-weight: 800; }
.stat-item small { font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 600; margin-top: 2px;}
.score-item b { color: var(--cyan); }

/* --- DOLNE MENU MOBILNE (Bottom Nav) --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 15, 19, 0.95);
    backdrop-filter: blur(15px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 1000;
}
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    flex: 1;
    transition: var(--transition);
}
.bottom-nav-item i { font-size: 20px; margin-bottom: 4px; font-style: normal; }
.bottom-nav-item.active { color: var(--text-main); }
.bottom-nav-item.active i { color: var(--pink); }

/* --- PROFIL I DASHBOARD --- */
.dashboard-card { background: var(--bg-card); padding: 24px; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 24px; }
.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 24px; }
.v-card { position: relative; aspect-ratio: 9/16; background: #222; border-radius: 8px; overflow: hidden; }
.v-img { width: 100%; height: 100%; object-fit: cover; }
.v-meta { position: absolute; bottom: 0; width: 100%; background: linear-gradient(transparent, rgba(0,0,0,0.8)); padding: 8px; font-size: 11px; font-weight: 700; display: flex; justify-content: space-between; }

/* --- STOPKA --- */
.main-footer { text-align: center; padding: 40px 24px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); margin-top: 40px; }

/* --- MEDIA QUERIES (DESKTOP) --- */
@media (min-width: 768px) {
    body { padding-bottom: 0; }
    body:has(.sidebar) { display: flex; }
    .bottom-nav { display: none; } /* Ukrywamy dolne menu na PC */
    
    .sidebar { display: flex; flex-direction: column; width: 260px; height: 100vh; position: sticky; top: 0; background: var(--bg-card); padding: 32px 24px; border-right: 1px solid var(--border); }
    .nav-link { display: block; padding: 12px 16px; margin-bottom: 8px; border-radius: 12px; font-weight: 700; color: var(--muted); }
    .nav-link.active { background: rgba(255,255,255,0.05); color: var(--text-main); }
    .main { flex: 1; padding: 60px; }
    .video-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}