@import url('https://fonts.googleapis.com/css2?family=Anton&family=Bebas+Neue&family=Gabarito:wght@400..900&family=PT+Sans:wght@400;700&display=swap');

:root {
    --clr-base: hsl(0 0 0);
    --clr-cards: hsl(0 0 5%);
    --clr-important: hsl(0 0 10%);
    --clr-box-background: hsl(0 0 0 / .7);
    --clr-text-white: hsl(0 0 95%);
    --clr-text-light: hsl(0 0 70%);
    --clr-text-gray: hsl(0 0 50%);
    --clr-primary: hsl(16 100 60);
    --clr-accent: hsl(32 93 54);
    --clr-accent-bright: hsl(32 93 70);
    --clr-primary-opacity: rgba(255, 107, 53, 0.8);
    --brdr: 1px solid rgba(255, 255, 255, 0.1);
    --box-shadow: 0 5px 10px rgba(0, 0, 0, 0.8);
}

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

.anton-regular {
    font-family: "Anton", sans-serif;
    font-weight: 400;
    font-style: normal;
}

.gabarito-regular {
    font-family: "Gabarito", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
}

.pt-sans {
    font-family: "PT Sans", sans-serif;
    font-weight: 400;
}

html, body {
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    position: relative;
    background: #0f0f0f;
    overflow-x: hidden;
    color: var(--clr-text-white);
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg,
        #1a0d08 0%,
        #331a0d 25%,
        #2d1610 50%,
        #1f1412 75%,
        #0f0f0f 100%
    );
    z-index: -2;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(247, 147, 30, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 60%, rgba(255, 107, 53, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(230, 85, 39, 0.05) 0%, transparent 50%);
    animation: gradientShift1 25s ease-in-out infinite;
    z-index: -1;
}

.gradient-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 70% 20%, rgba(255, 140, 66, 0.07) 0%, transparent 45%),
        radial-gradient(ellipse at 30% 70%, rgba(247, 147, 30, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 90%, rgba(255, 107, 53, 0.04) 0%, transparent 40%);
    animation: gradientShift2 30s ease-in-out infinite reverse;
    z-index: -1;
}

@keyframes gradientShift1 {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1) rotate(0deg);
    }
    33% {
        opacity: 0.8;
        transform: scale(1.05) rotate(2deg);
    }
    66% {
        opacity: 0.5;
        transform: scale(0.98) rotate(-2deg);
    }
}

@keyframes gradientShift2 {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1) translate(0, 0);
    }
    40% {
        opacity: 0.7;
        transform: scale(1.03) translate(20px, -10px);
    }
    70% {
        opacity: 0.4;
        transform: scale(0.97) translate(-15px, 15px);
    }
}

.background-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 120%;
    height: 120%;
    background: url("../images/YosemitePNG.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    opacity: 5%;
    filter: blur(3px);
    z-index: -1;
    animation: backgroundDrift 120s ease-in-out infinite;
}

@keyframes backgroundDrift {
    0% {
        transform: translate(0, 0) scale(1.15) rotate(0deg);
    }
    12% {
        transform: translate(-30px, 20px) scale(1.16) rotate(0.5deg);
    }
    25% {
        transform: translate(-50px, -10px) scale(1.14) rotate(-0.3deg);
    }
    37% {
        transform: translate(-35px, -40px) scale(1.17) rotate(0.4deg);
    }
    50% {
        transform: translate(0, -50px) scale(1.15) rotate(0deg);
    }
    62% {
        transform: translate(35px, -30px) scale(1.16) rotate(-0.5deg);
    }
    75% {
        transform: translate(55px, 10px) scale(1.14) rotate(0.3deg);
    }
    87% {
        transform: translate(30px, 40px) scale(1.17) rotate(-0.2deg);
    }
    100% {
        transform: translate(0, 0) scale(1.15) rotate(0deg);
    }
}

.particle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 1px;
    height: 4px;
    border-radius: 50%;
    filter: blur(1px);
    box-shadow: 0 0 6px rgba(255, 140, 66, 0.5);
    animation: particleFly linear infinite;
}

@keyframes particleFly {
    0% {
        transform: translate(0, 0);
        opacity: 0;
    }
    5% {
        opacity: 0.8;
    }
    95% {
        opacity: 0.8;
    }
    100% {
        transform: translate(var(--x-distance), var(--y-distance));
        opacity: 0;
    }
}

/* Back Button */
.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 107, 53, 0.3);
    border-radius: 8px;
    text-decoration: none;
    color: var(--clr-text-white);
    font-family: 'Anton', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.back-button:hover {
    background: rgba(255, 107, 53, 0.15);
    border-color: var(--clr-primary);
    transform: translateX(-3px);
}

/* Hamburger Menu */
.hamburger {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
}

.hamburger span {
    width: 30px;
    height: 3px;
    background: var(--clr-text-light);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger:hover span {
    background: var(--clr-primary);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: var(--clr-cards);
    z-index: 999;
    transition: right 0.3s ease;
    padding: 80px 30px 30px;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu nav {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.mobile-menu a {
    color: var(--clr-text-light);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 15px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.mobile-menu a:hover {
    color: var(--clr-primary);
    padding-left: 20px;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Leaderboard Container */
.leaderboard-container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 100px 20px 40px;
    width: 100%;
}

.leaderboard-box {
    background: rgba(255, 255, 255, 0.03);
    border: var(--brdr);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 50px 40px;
    border-radius: 20px;
    max-width: 1000px;
    width: 100%;
    box-shadow: var(--box-shadow);
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 2.5rem;
}

.main-title {
    background-image: linear-gradient(135deg, var(--clr-primary), var(--clr-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.date {
    font-size: 1.1rem;
    color: var(--clr-text-light);
}

/* Leaderboard Table */
.leaderboard-wrapper {
    margin-bottom: 2rem;
}

.leaderboard-table {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    overflow: hidden;
    border: var(--brdr);
}

.table-header,
.table-row {
    display: grid;
    grid-template-columns: 70px 1fr 70px 70px 70px 70px 70px 90px;
    gap: 0.75rem;
    padding: 0.9rem 1.25rem;
    align-items: center;
}

.table-header {
    background: rgba(255, 107, 53, 0.15);
    border-bottom: 2px solid rgba(255, 107, 53, 0.3);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    color: var(--clr-text-light);
}

.table-body {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom Scrollbar */
.table-body::-webkit-scrollbar {
    width: 8px;
}

.table-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.table-body::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 53, 0.4);
    border-radius: 10px;
}

.table-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 107, 53, 0.6);
}

.table-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.table-row:hover {
    background: rgba(255, 107, 53, 0.08);
}

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

.table-row.current-user {
    background: rgba(255, 107, 53, 0.15);
    border-left: 4px solid var(--clr-primary);
}

.table-row.current-user:hover {
    background: rgba(255, 107, 53, 0.2);
}

/* Table Columns */
.rank-col {
    font-size: 1.1rem;
    text-align: center;
}

.name-col {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.level-col,
.total-col {
    text-align: center;
    font-size: 0.9rem;
}

.total-col {
    font-size: 1.2rem;
    color: var(--clr-accent);
}

/* Rank Badges (instead of emojis) */
.rank-badge {
    display: inline-block;
    width: 32px;
    height: 32px;
    line-height: 32px;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
}

.rank-badge.rank-1 {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #1a0d08;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.rank-badge.rank-2 {
    background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
    color: #1a0d08;
    box-shadow: 0 0 15px rgba(192, 192, 192, 0.5);
}

.rank-badge.rank-3 {
    background: linear-gradient(135deg, #CD7F32, #B8860B);
    color: #1a0d08;
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.5);
}

/* You Badge */
.you-badge {
    background: var(--clr-primary);
    color: var(--clr-base);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 0.05em;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem 2rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: var(--brdr);
}

.no-results p {
    font-size: 1.1rem;
    color: var(--clr-text-gray);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.9rem 2rem;
    font-size: 1rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    letter-spacing: 0.05em;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--clr-primary);
    color: var(--clr-base);
}

.btn-primary:hover {
    background: var(--clr-accent-bright);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--clr-text-white);
    border: 2px solid var(--clr-text-light);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--clr-text-white);
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .table-header,
    .table-row {
        grid-template-columns: 60px 1fr 65px 65px 65px 65px 65px 85px;
        gap: 0.5rem;
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
    }

    .level-col,
    .total-col {
        font-size: 0.85rem;
    }

    .total-col {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .leaderboard-container {
        padding: 80px 15px 30px;
    }

    .leaderboard-box {
        padding: 30px 20px;
    }

    .back-button {
        top: 15px;
        left: 15px;
        padding: 8px 15px;
        font-size: 0.8rem;
    }

    .hamburger {
        top: 15px;
        right: 15px;
    }

    .table-header,
    .table-row {
        grid-template-columns: 50px 1fr 60px 80px;
        font-size: 0.8rem;
        padding: 0.7rem 0.8rem;
    }

    /* Hide L2, L3, L4, L5 columns on smaller screens */
    .table-header .level-col:nth-child(4),
    .table-header .level-col:nth-child(5),
    .table-header .level-col:nth-child(6),
    .table-header .level-col:nth-child(7),
    .table-row .level-col:nth-child(4),
    .table-row .level-col:nth-child(5),
    .table-row .level-col:nth-child(6),
    .table-row .level-col:nth-child(7) {
        display: none;
    }

    .rank-col {
        font-size: 1rem;
    }

    .name-col {
        font-size: 0.9rem;
    }

    .you-badge {
        font-size: 0.6rem;
        padding: 0.15rem 0.4rem;
    }

    .rank-badge {
        width: 28px;
        height: 28px;
        line-height: 28px;
        font-size: 0.9rem;
    }

    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }

    .background-layer {
        opacity: 15%;
        filter: blur(1px);
        animation: none;
    }

    body::after,
    .gradient-layer {
        animation: none !important;
    }

    .particle {
        display: none;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.8rem;
    }

    .date {
        font-size: 0.95rem;
    }

    .leaderboard-box {
        padding: 25px 15px;
    }

    .table-header,
    .table-row {
        grid-template-columns: 45px 1fr 55px 75px;
        gap: 0.3rem;
        padding: 0.6rem 0.5rem;
    }

    /* Hide L1 as well on very small screens */
    .table-header .level-col:nth-child(3),
    .table-row .level-col:nth-child(3) {
        display: none;
    }

    .action-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
    }
}
