/* ========= VARIABILI CSS (TEMA SCURO PREDEFINITO) ========= */
:root {
    --bg-dark: #0b1025;
    --bg-medium: #00060f;
    --bg-light: #374151;
    --text-light: #F9FAFB;
    --text-grey: #9CA3AF;
    --accent-blue: #3bdaf6;
    --accent-blue-hover: #25c7e0;
}

/* ========= STILI GLOBALI ========= */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
html, body {
    height: 100%; /* Assicura che html e body possano occupare tutta l'altezza */
}
body {
    margin: 0;
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    background-color: var(--bg-medium);
    color: var(--text-light);
    overflow-x: hidden;
    display: flex; /* NUOVA REGOLA */
    flex-direction: column; /* NUOVA REGOLA */
}
a {
    text-decoration: none;
    color: inherit;
}
.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.fade-in-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in-element.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========= PRELOADER ========= */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-medium);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
#preloader.preloader-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.preloader-logo {
    max-width: 150px;
    animation: pulse 1.5s infinite ease-in-out;
}

/* ========= HEADER ========= */
.site-header-dark {
    background-color: var(--bg-dark);
    padding: 15px 0;
    border-bottom: 1px solid var(--bg-light);
    position: relative;
    z-index: 1000;
}
.site-header-dark .header-content-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}
.site-header-dark .header-left {
    display: flex;
    align-items: center;
    gap: 50px;
}
.header-logo {
    height: 55px;
}
.main-navigation {
    display: flex;
    gap: 25px;
}
.main-navigation a {
    color: var(--text-grey);
    font-weight: 600;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
}
.main-navigation a:hover, .main-navigation a.active {
    color: var(--text-light);
}
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}
.theme-switcher-button {
    background: var(--bg-light);
    border: none;
    color: var(--text-grey);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
}
.theme-switcher-button:hover i {
    animation: spin 0.5s linear;
}

/* ========= RICERCA MODALE ========= */
.header-search-trigger {
    background-color: var(--bg-light);
    padding: 8px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-grey);
    transition: background-color 0.2s;
}
.header-search-trigger:hover {
    background-color: #4b5563;
}
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 6, 15, 0.8);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    padding-top: 10vh;
    opacity: 1;
    transition: opacity 0.3s ease;
}
.search-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
.search-modal-content {
    position: relative;
    width: 100%;
    max-width: 600px;
}
.search-close-btn {
    position: absolute;
    top: 10px;
    right: 0;
    background: none;
    border: none;
    color: var(--text-grey);
    font-size: 2.5em;
    cursor: pointer;
}
.search-modal-icon {
    position: absolute;
    top: 23px;
    left: 20px;
    color: var(--text-grey);
    font-size: 1.2em;
}
#search-modal-input {
    width: 100%;
    background-color: var(--bg-dark);
    border: 1px solid var(--bg-light);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 1.5em;
    padding: 20px 20px 20px 60px;
    box-sizing: border-box;
}
.search-results-container {
    background-color: var(--bg-dark);
    border: 1px solid var(--bg-light);
    border-top: none;
    border-radius: 0 0 8px 8px;
    margin-top: -1px;
}
.search-result-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid var(--bg-light);
    color: var(--text-light);
    text-decoration: none;
}
.search-result-item:last-child {
    border-bottom: none;
}
.search-result-item:hover {
    background-color: var(--bg-light);
}
.search-result-item img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
}

/* ========= STILI MAIN CONTENT (PER CENTRATURA) ========= */
main {
    flex-grow: 1; /* Permette al main di espandersi */
    display: flex; /* Lo rende un contenitore flex */
    flex-direction: column; /* Allinea i figli in colonna */
}
.player-stats-page-wrapper, .leaderboard-page-wrapper {
    display: flex; /* Usa flex per centrare il .content-wrapper */
    flex-direction: column;
    justify-content: center; /* NUOVA REGOLA: Centra verticalmente */
    flex-grow: 1;
    padding: 40px 0;
}

/* ========= SEZIONE HERO ========= */
.hero-section {
    position: relative;
    height: 80vh;
    min-height: 700px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
    background-color: var(--bg-dark);
}
.hero-background {
    position: absolute;
    inset: 0;
    z-index: 1;
}
.hero-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(8px);
    transform: scale(1.1);
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(17, 24, 39, 0.6);
    z-index: 2;
}
.hero-content {
    position: relative;
    width: 1250px;
    height: 750px;
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}
.hero-content-video-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
}
.hero-content-video-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-content-inner {
    position: relative;
    z-index: 2;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hero-logo {
    max-height: 180px;
    margin-bottom: 25px;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.6));
}
.hero-content p {
    font-size: 1.3em;
    color: var(--text-light);
    margin-bottom: 35px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
    font-weight: 500;
    max-width: 600px;
}
.hero-button {
    background-color: transparent;
    border: 2px solid var(--text-light);
    color: var(--text-light);
    padding: 14px 28px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1em;
    text-transform: uppercase;
    cursor: pointer;
}
.hero-button:hover {
    background-color: var(--text-light);
    color: var(--bg-dark);
}

/* ========= ONDA DIVISORIA SOTTO HERO ========= */
.how-to-join-section {
    padding: 120px 0 80px 0;
    background-color: var(--bg-medium);
    position: relative;
    z-index: 5;
}
.how-to-join-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background-color: var(--bg-medium);
    transform: translateY(-100%);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120'%3E%3Cpath fill='%23ffffff' d='M0,32L48,42.7C96,53,192,75,288,74.7C384,75,480,53,576,48C672,43,768,53,864,58.7C960,64,1056,64,1152,58.7C1248,53,1344,43,1392,37.3L1440,32L1440,120L1392,120C1344,120,1248,120,1152,120C1056,120,960,120,864,120C768,120,672,120,576,120C480,120,384,120,288,120C192,120,96,120,48,120L0,120Z'%3E%3C/path%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120'%3E%3Cpath fill='%23ffffff' d='M0,32L48,42.7C96,53,192,75,288,74.7C384,75,480,53,576,48C672,43,768,53,864,58.7C960,64,1056,64,1152,58.7C1248,53,1344,43,1392,37.3L1440,32L1440,120L1392,120C1344,120,1248,120,1152,120C1056,120,960,120,864,120C768,120,672,120,576,120C480,120,384,120,288,120C192,120,96,120,48,120L0,120Z'%3E%3C/path%3E%3C/svg%3E");
    -webkit-mask-size: cover;
    mask-size: cover;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

/* ========= SEZIONE "COME ENTRARE" ========= */
.how-to-join-section .content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}
.join-text h2 {
    font-size: 2.5em;
    line-height: 1.2;
    margin-bottom: 20px;
    color: #ffe600c2;
}
.join-text p {
    color: var(--text-grey);
    margin-bottom: 30px;
}
.copy-ip-button {
    background-color: var(--accent-blue);
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    color: #000;
}
.copy-ip-button:hover {
    background-color: var(--accent-blue-hover);
}
.join-info {
    background-color: var(--bg-dark);
    border-radius: 10px;
    position: relative;
    display: flex;
    overflow: visible;
    padding: 40px;
    border: 2px solid var(--text-light);
}
.version-tag {
    position: absolute;
    top: -15px;
    left: 20px;
    background-color: var(--accent-blue);
    color: #000;
    padding: 8px 22px;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 700;
    transform: skewX(-15deg);
    z-index: 1;
}
.join-info-content {
    flex-grow: 1;
}
.join-info h3 {
    font-size: 1.5em;
    border-bottom: 1px solid var(--bg-light);
    padding-bottom: 15px;
    margin-bottom: 20px;
    margin-top: 10px;
}
.join-info-skin {
    width: 330px;
    align-self: flex-end;
    margin-bottom: -40px;
    margin-right: -50px;
    image-rendering: pixelated;
}
.info-box {
    margin-bottom: 5px;
}
.info-box label {
    display: block;
    color: var(--text-grey);
    font-size: 0.9em;
    margin-bottom: 8px;
}
.display-box {
    background-color: var(--bg-medium);
    padding: 15px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
}
.display-box.with-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.display-box button {
    background-color: var(--accent-blue);
    border: none;
    color: #000;
    font-size: 1.2em;
    cursor: pointer;
    border-radius: 6px;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.display-box button:hover {
    background-color: var(--accent-blue-hover);
}

/* ========= SEZIONE MODALITÀ (CON IMMAGINI E GRADIENTI) ========= */
.gamemodes-section {
    background-color: var(--bg-medium);
    padding: 40px 0 80px 0;
    text-align: center;
}
.gamemodes-section h2 {
    font-size: 2.8em;
    text-transform: uppercase;
    font-weight: 800;
    color: #00fff2f1;
}
.gamemodes-section p {
    color: var(--text-grey);
    max-width: 600px;
    margin: 20px auto 40px auto;
}
.slider-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    overflow: hidden;
}
.slider-container {
    display: flex;
}
.slides {
    display: flex;
    transition: transform 0.7s cubic-bezier(0.25, 1, 0.5, 1);
}
.slide.image-slide {
    min-width: calc(50% - 16px);
    flex-shrink: 0;
    margin: 0 8px;
    height: 300px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 25px;
    box-sizing: border-box;
    background-size: cover;
    background-position: center;
}
.slide-kitpvp { background-image: url('images/KITPVPslide.png'); }
.slide-smp { background-image: url('images/inarrivo.png'); }
.slide-duels { background-image: url('images/inarrivo.png'); }
.slide-skyprison { background-image: url('images/inarrivo.png'); }

.slide-overlay {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 60%);
    z-index: 1;
}
.slide-content {
    position: relative;
    z-index: 2;
    text-align: left;
    color: #fff;
}
.slide-version-tag {
    background-color: var(--bg-light);
    color: var(--text-grey);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 10px;
}
.slide-title {
    font-size: 2.8em;
    margin: 0;
    text-transform: uppercase;
    font-weight: 900;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}
.slide-kitpvp .slide-title { background-image: linear-gradient(45deg, #00d9ff, #0084ff); }
.slide-smp .slide-title { background-image: linear-gradient(45deg, #ffca28, #ff8f00); }
.slide-duels .slide-title { background-image: linear-gradient(45deg, #ff5252, #c62828); }
.slide-skyprison .slide-title { background-image: linear-gradient(45deg, #ff5252, #c62828); }

.slide-features {
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0;
    font-weight: 500;
}
.slide-features li {
    padding: 8px 15px;
    background-color: rgba(0,0,0,0.5);
    margin-top: 4px;
    border-radius: 4px;
    transform: skewX(-15deg);
}
.slide-features li span {
    display: inline-block;
    transform: skewX(15deg);
}
.slider-dots {
    text-align: center;
    padding-top: 30px;
}
.dot {
    cursor: pointer;
    height: 12px;
    width: 12px;
    margin: 0 5px;
    background-color: var(--bg-light);
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.3s ease;
}
.dot.active, .dot:hover {
    background-color: var(--accent-blue);
}

/* ========= SEZIONE DISCORD ========= */
.discord-cta-section {
    position: relative;
    padding: 120px 0;
    background: linear-gradient(160deg, #3B82F6, #2563EB);
    color: var(--text-light);
    overflow: hidden;
}
.discord-cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background-color: var(--bg-medium);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80'%3E%3Cpath fill='%23ffffff' d='M0,32L48,42.7C96,53,192,75,288,74.7C384,75,480,53,576,48C672,43,768,53,864,58.7C960,64,1056,64,1152,58.7C1248,53,1344,43,1392,37.3L1440,32L1440,0L1392,0C1344,0,1248,0,1152,0C1056,0,960,0,864,0C768,0,672,0,576,0C480,0,384,0,288,0C192,0,96,0,48,0L0,0Z'%3E%3C/path%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80'%3E%3Cpath fill='%23ffffff' d='M0,32L48,42.7C96,53,192,75,288,74.7C384,75,480,53,576,48C672,43,768,53,864,58.7C960,64,1056,64,1152,58.7C1248,53,1344,43,1392,37.3L1440,32L1440,0L1392,0C1344,0,1248,0,1152,0C1056,0,960,0,864,0C768,0,672,0,576,0C480,0,384,0,288,0C192,0,96,0,48,0L0,0Z'%3E%3C/path%3E%3C/svg%3E");
    -webkit-mask-size: cover;
    mask-size: cover;
}
.discord-cta-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background-color: var(--bg-dark);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80'%3E%3Cpath fill='%23ffffff' d='M0,32L48,42.7C96,53,192,75,288,74.7C384,75,480,53,576,48C672,43,768,53,864,58.7C960,64,1056,64,1152,58.7C1248,53,1344,43,1392,37.3L1440,32L1440,80L1392,80C1344,80,1248,80,1152,80C1056,80,960,80,864,80C768,80,672,80,576,80C480,80,384,80,288,80C192,80,96,80,48,80L0,80Z'%3E%3C/path%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80'%3E%3Cpath fill='%23ffffff' d='M0,32L48,42.7C96,53,192,75,288,74.7C384,75,480,53,576,48C672,43,768,53,864,58.7C960,64,1056,64,1152,58.7C1248,53,1344,43,1392,37.3L1440,32L1440,80L1392,80C1344,80,1248,80,1152,80C1056,80,960,80,864,80C768,80,672,80,576,80C480,80,384,80,288,80C192,80,96,80,48,80L0,80Z'%3E%3C/path%3E%3C/svg%3E");
    -webkit-mask-size: cover;
    mask-size: cover;
}
.discord-cta-section .content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    position: relative;
    z-index: 2;
}
.discord-char {
    max-width: 250px;
    margin-bottom: 20px;
}
.discord-text h2 {
    font-size: 2.2em;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}
.discord-text p {
    max-width: 600px;
    margin: 0 auto 30px auto;
    opacity: 0.9;
    font-size: 1.1em;
    line-height: 1.6;
}
.discord-button {
    background-color: var(--text-light);
    color: #3B82F6;
    padding: 14px 30px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1em;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    text-decoration: none;
}
.discord-button:hover {
    background-color: #f0f0f0;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* ========= FOOTER ========= */
.site-footer {
    background-color: var(--bg-dark);
    color: var(--text-grey);
    padding: 40px 0;
    font-size: 0.9em;
    position: relative;
    z-index: 2;
}
.footer-content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.footer-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--bg-light);
}
.footer-left {
    display: flex;
    align-items: center;
    gap: 20px;
}
.footer-logo {
    max-width: 80px;
}
.footer-right {
    display: flex;
    align-items: center;
    gap: 15px;
}
.footer-nav a {
    background-color: var(--bg-medium);
    padding: 8px 20px;
    border-radius: 20px;
}
.back-to-top {
    width: 40px;
    height: 40px;
    background-color: var(--accent-blue);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #000;
}
.footer-sub {
    display: flex;
    justify-content: space-between;
    padding-top: 25px;
    font-size: 0.8em;
}

/* ========= NOTIFICA TOAST ========= */
.toast {
    visibility: hidden;
    min-width: 280px;
    background-color: #00b36b;
    color: #fff;
    text-align: left;
    border-radius: 5px;
    padding: 16px;
    position: fixed;
    z-index: 1001;
    right: -300px;
    bottom: 30px;
    font-size: 17px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: right 0.5s ease-in-out, visibility 0.5s ease-in-out;
}
.toast.show {
    visibility: visible;
    right: 30px;
}
.toast i {
    font-size: 1.4em;
}

/* ========= RESPONSIVE DESIGN ========= */
@media (max-width: 992px) {
    .how-to-join-section .content-wrapper {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .header-search-trigger {
        display: none;
    }
    .main-navigation {
        display: none;
    }
    .discord-cta-section .content-wrapper {
        flex-direction: column;
        text-align: center;
    }
    .footer-main, .footer-sub {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    .slide.image-slide {
        min-width: calc(100% - 16px);
    }
    .hero-section {
        height: auto;
        min-height: 600px;
        padding-bottom: 100px;
    }
    .hero-content {
        height: auto;
    }
    .how-to-join-section {
        padding-top: 120px;
    }
}

/* ========= PAGINA STATISTICHE E LEADERBOARD ========= */
.stats-page-wrapper, .leaderboard-page-wrapper {
    padding: 40px 0;
}
.stats-page-header, .leaderboard-header {
    text-align: center;
    margin-bottom: 40px;
}
.stats-page-header h1, .leaderboard-header h1 {
    font-size: 2.8em;
    margin-bottom: 10px;
}
.stats-page-header p, .leaderboard-header p {
    font-size: 1.1em;
    color: var(--text-grey);
}
.stats-gamemode-selector {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}
.stats-gamemode-card {
    background-color: var(--bg-dark);
    border: 1px solid var(--bg-light);
    border-radius: 8px;
    padding: 20px;
    width: 250px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.stats-gamemode-card:hover, .stats-gamemode-card.active {
    border-color: var(--accent-blue);
    transform: translateY(-5px);
}
.stats-gamemode-card i {
    font-size: 2em;
    margin-bottom: 15px;
    color: var(--accent-blue);
}
.stats-gamemode-card h3 {
    font-size: 1.5em;
    margin-top: 0;
    margin-bottom: 10px;
}
.stats-gamemode-card p {
    color: var(--text-grey);
    font-size: 0.9em;
    line-height: 1.5;
}
.leaderboard-table-container {
    background-color: var(--bg-dark);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--bg-light);
    overflow-x: auto;
}
.leaderboard-table-container table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    white-space: nowrap;
}
.leaderboard-table-container th, 
.leaderboard-table-container td {
    padding: 15px;
    border-bottom: 1px solid var(--bg-light);
}
.leaderboard-table-container thead th {
    color: var(--text-grey);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9em;
}
.leaderboard-table-container tbody tr:last-child td {
    border-bottom: none;
}
.leaderboard-table-container tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}
.rank {
    font-weight: 700;
    font-size: 1.1em;
}
.rank-1, .rank-2, .rank-3 {
    color: var(--accent-blue);
}
.player-cell {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 600;
    color: var(--text-light);
    text-decoration: none;
}
.player-cell:hover {
    color: var(--accent-blue);
}
.player-cell img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    image-rendering: pixelated;
}
.kd-ratio.positive { color: #4ade80; }
.kd-ratio.neutral { color: #facc15; }
.kd-ratio.negative { color: #ef4444; }


/* ========= STILI PAGINA STATISTICHE GIOCATORE ========= */
.back-to-leaderboard-btn {
    display: inline-block;
    margin-bottom: 20px;
    background-color: var(--bg-light);
    padding: 10px 20px;
    border-radius: 8px;
    color: var(--text-light);
    transition: background-color 0.2s;
}
.back-to-leaderboard-btn:hover {
    background-color: #4b5563;
}
.player-stats-page-wrapper {
    padding: 40px 0;
}
.player-header {
    background-color: var(--bg-dark);
    border-radius: 12px;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 30px;
    border: 1px solid var(--bg-light);
}
.player-avatar-container img {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    image-rendering: pixelated;
}
.player-details h1 {
    margin: 0 0 5px 0;
    font-size: 2.5em;
    color: var(--text-light);
}
.player-rank {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}
.player-rank.donatore {
    background-color: var(--accent-blue);
    color: #000;
}
.player-status {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9em;
    color: var(--text-grey);
    text-align: right;
}
.player-status i {
    margin-right: 5px;
}
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}
.stat-card {
    background-color: var(--bg-dark);
    border-radius: 12px;
    padding: 25px;
    border: 1px solid var(--bg-light);
}
.stat-card-title {
    margin: 0 0 20px 0;
    font-size: 1.5em;
    border-bottom: 1px solid var(--bg-light);
    padding-bottom: 15px;
}
.stat-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}
.stat-item {
    background-color: var(--bg-medium);
    padding: 15px;
    border-radius: 8px;
}
.stat-label {
    display: block;
    font-size: 0.9em;
    color: var(--text-grey);
    margin-bottom: 5px;
}
.stat-value {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--text-light);
}
.stat-value.money { color: #facc15; }

/* ========= PROFILO UTENTE HEADER ========= */
#user-profile-container {
    position: relative;
}
.login-button-header {
    background-color: var(--accent-blue);
    color: #000;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}
.login-button-header:hover {
    background-color: var(--accent-blue-hover);
}
.user-profile-button {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--bg-light);
    border: 1px solid transparent;
    padding: 6px 15px 6px 6px;
    border-radius: 25px;
    cursor: pointer;
    color: var(--text-light);
    font-weight: 500;
    transition: all 0.2s ease;
}
.user-profile-button:hover {
    border-color: var(--accent-blue);
}
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    image-rendering: pixelated;
}
.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}
.user-info .username {
    font-weight: 600;
}
.user-info .user-rank {
    font-size: 0.8em;
    color: var(--text-grey);
}
.dropdown-menu {
    display: none;
    position: absolute;
    top: 115%;
    right: 0;
    background-color: var(--bg-light);
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    padding: 8px;
    z-index: 1100;
    width: 200px;
    border: 1px solid var(--bg-dark);
}
#user-profile-container .dropdown:hover .dropdown-menu {
    display: block;
}
.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: var(--text-grey);
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}
.dropdown-menu a:hover {
    background-color: var(--accent-blue);
    color: #000;
}


/* ========= TEMA CHIARO ========= */
body.light-theme {
    --bg-dark: #F9FAFB;
    --bg-medium: #FFFFFF;
    --bg-light: #F3F4F6;
    --text-light: #111827;
    --text-grey: #6B7280;
}
body.light-theme .site-header-dark {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}
body.light-theme .hero-overlay {
    background-color: rgba(249, 250, 251, 0.4);
}
body.light-theme .hero-content p,
body.light-theme .hero-button {
    color: var(--text-light);
    text-shadow: none;
}
body.light-theme .hero-button:hover {
    background-color: var(--bg-light);
    color: var(--text-light);
}
body.light-theme .how-to-join-section::before,
body.light-theme .discord-cta-section::before {
    background-color: var(--bg-medium);
}
body.light-theme .discord-cta-section::after {
    background-color: var(--bg-dark);
}
body.light-theme .join-info {
    border-color: #e5e7eb;
}
body.light-theme .user-profile-button,
body.light-theme .dropdown-menu {
    background-color: var(--bg-light);
    border-color: #d1d5db;
}
body.light-theme .user-profile-button:hover {
    border-color: var(--accent-blue);
}
body.light-theme .dropdown-menu a:hover {
    background-color: var(--accent-blue);
    color: #000;
}
body.light-theme .copy-ip-button,
body.light-theme .display-box button,
body.light-theme .back-to-top,
body.light-theme .player-rank.donatore,
body.light-theme .login-button-header,
body.light-theme .version-tag {
    color: #000;
}
body.light-theme .discord-button {
    color: #3B82F6;
}