/* Global styles */
* {
    box-sizing: border-box;
}

/* Background with blur and vignette */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.background-image {
    position: absolute;
    top: -40px;
    left: -40px;
    right: -40px;
    bottom: -40px;
    background-image: url('background.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(8px) brightness(0.4);
    will-change: transform;
}

.background-vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        rgba(0, 0, 0, 0.3) 30%,
        rgba(0, 0, 0, 0.7) 60%,
        rgba(0, 0, 0, 0.95) 100%
    );
    pointer-events: none;
}

@media (max-width: 768px) {
    .background-vignette {
        background: radial-gradient(
            ellipse at center,
            transparent 0%,
            rgba(0, 0, 0, 0.24) 36%,
            rgba(0, 0, 0, 0.58) 66%,
            rgba(0, 0, 0, 0.88) 100%
        );
    }

    .nav-container {
        padding: 0.75rem 0;
        gap: 0;
        display: flex;
        justify-content: space-between;
    }

    .nav-logo {
        flex: 0 0 auto;
        padding-left: 0.1rem;
    }

    .nav-center-links, .nav-right-links {
        display: flex;
        flex: 0 0 auto;
        gap: 0;
    }

    .nav-link {
        padding: 0.3rem 0.1rem;
        font-size: 0.7rem;
        gap: 0.1rem;
    }

    .nav-play-now {
        padding: 0.3rem 0.6rem !important;
        font-size: 0.7rem !important;
        white-space: nowrap !important;
        min-width: max-content !important;
    }

    .nav-mini-icon {
        width: 14px;
        height: 14px;
    }

    .nav-logo span {
        display: none;
    }

    .nav-links {
        gap: 0.25rem;
        justify-content: flex-end;
        flex: 0 1 auto;
    }

    .nav-link {
        padding: 0.4rem;
        font-size: 0.75rem;
    }
    
    .download-cards {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }
    
    h1 {
        font-size: 2.2rem;
    }
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background: transparent;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

html {
    background: black;
}

/* Typography */
h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    color: #eeeeee;
    border-bottom: 1px solid #333;
    padding-bottom: 0.5rem;
}

p, li {
    font-size: 1rem;
    color: #eeeeee;
    line-height: 1.6;
}

strong {
    color: white;
}

/* Layout components */
.container {
    width: 100%;
    /* padding: 2rem; */
    text-align: left;
    flex: 1;
}

.padded-container {
    padding: 2rem;
}

.centered-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-self: center;
}

.limited-width-text {
    max-width: 700px;
}

/* Components */
.button-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 2rem;
    margin-bottom: 2rem;
    max-width: 700px;
}

.play-now {
    display: flex;
    align-items: center;
    background-color: #000;
    border: 2px solid #A6A6A6;
    border-radius: 12px;
    padding: 10px 15px;
    color: white;
    text-decoration: none;
    box-sizing: border-box;
    height: 85px;
    width: 283px;
    margin: 20px;
}

.icon {
    height: 100%;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    margin-right: 16px;
}

.back-icon {
    width: 1em;
    height: 1em;
    fill: currentColor;
    vertical-align: -0.125em;
}

.text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    flex: 1;
    min-width: 0;
}

.line1 {
    font-family: 'Roboto', sans-serif;
    font-weight: 200;
    font-size: 15px;
    line-height: 15px;
    align-self: flex-start;
}

.line2 {
    font-family: 'Poppins', sans-serif;
    font-size: 32px;
    line-height: 32px;
    font-weight: 600;
}

/* Links and navigation */
.top-nav {
    position: sticky;
    top: 0;
    width: 100%;
    height: 60px;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: white;
    font-weight: 600;
    flex: 1;
}

.nav-center-links {
    display: flex;
    gap: 0.5rem;
    flex: 2;
    justify-content: center;
}

.nav-right-links {
    display: flex;
    justify-content: flex-end;
    flex: 1;
}

.nav-icon-small {
    width: 32px;
    height: 32px;
    border-radius: 4px;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    color: #ccc;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.15);
}

.nav-play-now {
    background: #fbbf24 !important;
    color: #000 !important;
    font-weight: 700 !important;
    padding: 0.5rem 1.25rem !important;
    border-radius: 50px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 10px rgba(251, 191, 36, 0.3);
}

.nav-play-now:hover {
    background: #f59e0b !important;
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(251, 191, 36, 0.5);
}

.nav-mini-icon-blue {
    filter: invert(48%) sepia(86%) saturate(1914%) hue-rotate(198deg) brightness(101%) contrast(97%);
}

.nav-mini-icon {
    width: 18px;
    height: 18px;
}

/* Download Cards on download.html */
.download-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
}

.download-card {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 300px;
    max-width: 350px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.download-card:hover {
    transform: translateY(-8px);
    background: rgba(20, 20, 20, 0.8);
    border-color: rgba(251, 191, 36, 0.4);
    box-shadow: 0 15px 40px rgba(0,0,0,0.7);
}

.card-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1.5rem;
}

.card-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.download-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
}

.download-card p {
    color: #ccc;
    font-size: 0.95rem;
    margin-bottom: 2rem;
    flex: 1;
}

.card-button {
    display: block;
    width: 100%;
    padding: 0.8rem;
    background: #fbbf24;
    color: #000;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.card-button:hover {
    background: #f59e0b;
}

.card-button.disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
    pointer-events: none;
}

/* Play Now Big Button */
.play-now-main {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2.5rem;
    background: #fbbf24;
    color: #000;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.5rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}

.play-now-main:hover {
    background: #f59e0b;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.6);
}

.play-now-main-icon {
    width: 28px;
    height: 28px;
}

.back-link {
    display: inline-block;
    margin: 1rem 0;
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.back-link:hover {
    color: #cccccc;
}

.socials a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    transition: color 0.3s;
}

.socials a:hover {
    color: #303843;
}

.socials-home {
    margin-bottom: 6rem;
    display: grid;
    width: 100%;
    max-width: 800px; /* Controls maximum width of the entire container */
    margin-left: auto;
    margin-right: auto;
    padding: 2rem;
    margin-top: 2rem;
}

/* 4x1 layout for larger screens */
@media (min-width: 768px) {
    .socials-home {
        grid-template-columns: repeat(4, auto);
        column-gap: clamp(2rem, 8vw, 8rem); /* Min 2rem, max 8rem gap */
        justify-content: space-between;
    }
}

/* 2x2 layout for smaller screens */
@media (max-width: 767px) {
    .socials-home {
        grid-template-columns: repeat(2, auto);
        grid-template-rows: repeat(2, auto);
        gap: clamp(2rem, 5vw, 5rem);
        justify-content: space-evenly;
    }
}

.socials-home a {
    font-size: 3rem;
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

/* Footer */
footer {
    margin-top: 2rem;
    margin-bottom: 2rem;
    padding: 1rem;
    font-size: 0.9rem;
    color: white;
    text-align: center;
    width: 100%;
    background-color: transparent;
}

footer a {
    color: white;
    text-decoration: underline;
}

/* Lists */
ul {
    margin-bottom: 1.5rem;
}

/* Add this to your styles.css file */
.home-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1 0 auto;
    min-height: 75vh; /* Ensures it takes enough vertical space */
}

/* =========================================
   Highscores Section
   ========================================= */

#highscores-section {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
    contain: content;
}

/* --- Shared button & input styles --- */
.hs-btn {
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    padding: 6px 14px;
    border: 1px solid #666;
    border-radius: 6px;
    background: rgba(30,30,40,0.85);
    color: #eee;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s;
}
.hs-btn:hover:not(:disabled) {
    background: rgba(50,50,65,0.95);
    border-color: #fbbf24;
    color: #fff;
}
.hs-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.hs-input {
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    padding: 6px 10px;
    border: 1px solid #666;
    border-radius: 6px;
    background: rgba(30,30,40,0.85);
    color: #eee;
    outline: none;
    min-width: 0; /* allow shrink in flex */
    transition: border-color 0.2s, background 0.2s;
}
.hs-input:focus {
    border-color: #fbbf24;
    background: rgba(40,40,55,0.95);
}
.hs-input::placeholder {
    color: #888;
}

.hs-message {
    color: #f88;
    font-size: 0.85rem;
    text-align: center;
    margin-top: 0.25rem;
}

/* --- Skill tabs --- */
#leaderboard-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 1rem;
}

#leaderboard-tabs .tab {
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    background: rgba(30,30,40,0.85);
    border: 1px solid #555;
    border-radius: 6px;
    padding: 4px 10px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: #ccc;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
#leaderboard-tabs .tab:hover {
    background: rgba(50,50,65,0.95);
    color: #fff;
}
#leaderboard-tabs .tab.active {
    background: rgba(60,50,20,0.9);
    border-color: #fbbf24;
    color: #fbbf24;
}
#leaderboard-tabs .tab img {
    width: 18px;
    height: 18px;
}

/* --- Navigation bar (back | pagination | search) --- */
#nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap; /* never wrap, let items shrink */
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

#nav-left {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
}
#nav-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    flex: 0 1 auto; /* don’t grow but can shrink; allows child to expand */
    min-width: 0;
}
#nav-right #search-input {
    flex: 1 1 auto; /* grow to fill available space, shrink when needed */
    min-width: 0;
    max-width: 145px;
    width: auto;
}
#paging-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
#page-indicator {
    font-size: 0.85rem;
    min-width: 4em;
    text-align: center;
}


/* --- Error --- */
#highscores-error {
    margin-top: 0.5rem;
    font-weight: bold;
    color: #f88;
}

/* --- Clickable usernames --- */
.username-cell {
    cursor: pointer;
    color: #fbbf24 !important;
}
.username-cell:hover {
    text-decoration: underline;
}

/* --- Leaderboard table --- */
#highscores-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    table-layout: fixed;
}

#highscores-table th,
#highscores-table td {
    border: 1px solid rgba(255,255,255,0.1);
    padding: 0.45rem 0.5rem;
    color: #eee;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(4px);
}

#highscores-table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #bbb;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
}

/* column widths */
#highscores-table th:nth-child(1),
#highscores-table td:nth-child(1) { width: 10%; }
#highscores-table th:nth-child(2),
#highscores-table td:nth-child(2) { width: 40%; }
#highscores-table th:nth-child(3),
#highscores-table td:nth-child(3) { width: 25%; }
#highscores-table th:nth-child(4),
#highscores-table td:nth-child(4) { width: 25%; }

/* --- Profile view --- */
#profile-container {
    text-align: left;
    margin-top: 1rem;
}
#profile-skills {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    table-layout: fixed;
}
#profile-skills th,
#profile-skills td {
    border: 1px solid rgba(255,255,255,0.1);
    padding: 0.4rem 0.5rem;
    color: #eee;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(4px);
}
#profile-skills th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #bbb;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
}
