* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6f9;
    color: #333;
}

header {
    background: url("imagens/banner.png") center/cover no-repeat;
    height: 240px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.logo {
    position: absolute;
    top: 20px;
    left: 30px;
    height: 70px;
    z-index: 2;
}

header h1 {
    position: relative;
    color: white;
    font-size: 2.8rem;
    z-index: 2;
    text-align: center;
}

nav {
    position: absolute;
    top: 25px;
    right: 40px;
    z-index: 2;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

nav a {
    text-decoration: none;
    color: white;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 6px;
    transition: 0.3s;
    font-size: 0.95rem;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.25);
}

main {
    max-width: 1100px;
    margin: 3rem auto;
    padding: 0 2rem;
}

main h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2a5298;
}

.hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.visible {
    opacity: 1;
    transform: translateY(0);
}

.active-link {
    background: rgba(255, 255, 255, 0.3);
}

header.shrink {
    height: 180px;
    transition: 0.3s ease;
}

footer {
    background: #111;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

footer a {
    color: #4ea8ff;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* ---------- Secções do leaderboard ---------- */

.leaderboard-search-section,
.podium-section,
.leaderboard-section,
.my-position-section {
    background-color: #ffffff;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.podium-section h2,
.leaderboard-section h2,
.my-position-section h2 {
    margin-bottom: 1.2rem;
    color: #1e3c72;
}

.search-input {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border-radius: 24px;
    border: 1px solid #ddd;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
}

/* ---------- Avatares ---------- */

.avatar {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

.avatar.avatar-sm {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
}

/* ---------- Pódio ---------- */

.podium {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
}

.podium-place {
    background: #ffffff;
    flex: 1 1 200px;
    max-width: 220px;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s ease;
}

.podium-place:hover {
    transform: translateY(-5px);
}

.podium-place.place-1 {
    order: 2;
    border: 2px solid #ffd54f;
    padding-top: 2.2rem;
}

.podium-place.place-2 {
    order: 1;
}

.podium-place.place-3 {
    order: 3;
}

.podium-medal {
    font-size: 2rem;
}

.podium-username {
    font-weight: 700;
    color: #222;
}

.podium-points {
    color: #2a5298;
    font-weight: 600;
}

/* ---------- Lista de classificação ---------- */

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background-color: #ffffff;
    padding: 14px 18px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s, transform 0.15s;
}

.leaderboard-item:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.rank {
    font-weight: 700;
    color: #2a5298;
    width: 40px;
    flex-shrink: 0;
}

.leaderboard-user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.leaderboard-username {
    font-weight: 700;
    color: #222;
    font-size: 0.95rem;
}

.leaderboard-level {
    font-size: 0.78rem;
    color: #888;
}

.leaderboard-points {
    font-weight: 700;
    color: #4CAF50;
    flex-shrink: 0;
}

/* ---------- A Sua Posição ---------- */

.my-position-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #eef3ff;
    border: 2px solid #3b5bdb;
    border-radius: 12px;
    padding: 16px 20px;
    flex-wrap: wrap;
}

.my-position-rank {
    font-size: 1.3rem;
    font-weight: 800;
    color: #3b5bdb;
    min-width: 90px;
}

.my-position-username {
    font-weight: 700;
    color: #222;
    flex: 1;
    min-width: 120px;
}

.my-position-level {
    color: #555;
    font-size: 0.9rem;
}

.my-position-xp {
    font-weight: 700;
    color: #4CAF50;
}

.my-position-empty {
    color: #777;
    text-align: center;
    padding: 10px 0;
}

/* ---------- Skeleton / estado vazio ---------- */

.skeleton {
    pointer-events: none;
}

.skeleton-block {
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

.skeleton-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    margin-top: 10px;
    width: 100%;
}

.skeleton-line.short {
    width: 40%;
    height: 10px;
    margin-top: 0;
}

.skeleton-line.shorter {
    width: 25%;
    height: 8px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #777;
}

.empty-emoji {
    font-size: 2.4rem;
    margin-bottom: 10px;
}

@media (max-width: 900px) {

    header {
        height: auto;
        padding: 2rem 1rem;
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }

    header::after {
        border-radius: 0;
    }

    .logo {
        position: static;
        height: 55px;
        margin-bottom: 1rem;
    }

    header h1 {
        font-size: 2rem;
        margin: 0.5rem 0;
    }

    nav {
        position: static;
        margin-top: 1rem;
        width: 100%;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 0.6rem;
    }

    nav a {
        display: block;
        width: 100%;
        text-align: center;
        padding: 10px;
    }

    .podium {
        flex-direction: column;
        align-items: center;
    }

    .podium-place,
    .podium-place.place-1,
    .podium-place.place-2,
    .podium-place.place-3 {
        order: 0;
        width: 100%;
        max-width: 320px;
    }

    .leaderboard-item {
        flex-wrap: wrap;
    }
}