@media (min-width: 769px) {

    .navbar {
        display: flex;
        align-items: center;
        position: relative;
    }

    .top-bar {
        display: contents;
    }

    /* LOGO */
    .logo {
        order: 1;
    }

    /* MENU CENTRATO DAVVERO */
    .menu {
        position: absolute;
        left: 42%;

        display: flex;
        gap: 25px;
    }

    /* RIGHT A DESTRA */
    .right {
        order: 3;
        margin-left: auto;
        display: flex;
        gap: 15px;
        align-items: center;
    }
}



.top-bar {
    display: contents;
}

.navbar * {
    box-sizing: border-box;
    font-family: montserrat, sans-serif;
    /* 🔥 font fix */
}


.navbar {
    position: fixed;
    column-gap: 24px;
    padding: 10px 30px;
    top: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;

    align-items: center;
    justify-content: flex-start;
    gap: 30px;
    padding: 10px 30px;

    background: #0f172a;
    color: white;

    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}



.logo {
    font-family: 'Audiowide', sans-serif;
    font-size: 30px;
    font-weight: 400;
    color: #38bdf8;

    letter-spacing: 1.5px;
    text-shadow: 0 0 3px rgba(56, 189, 248, 0.6),
        0 0 12px rgba(56, 189, 248, 0.4);
    cursor: pointer;

    margin-right: 30px;
    justify-self: start;
}

.logo:hover {
    text-shadow:
        0 0 2px #38bdf8,
        0 0 4px #38bdf8,
        0 0 6px #38bdf8;
}

.menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 25px;
    margin: 0;
    padding: 0;

    width: max-content;
}

.menu a {
    text-decoration: none;
    color: #e2e8f0;
    font-size: 16px;
    transition: 0.2s;
}

.menu a:hover {
    color: #38bdf8;
}

.menu li {
    position: relative;
}

.right {
    display: flex;
    align-items: center;
    /* 🔥 FIX layout */
    gap: 15px;

    margin-left: auto;

    justify-self: end;
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    top: 100%;
    left: 0;

    display: none;
    flex-direction: column;

    position: absolute;

    background: #0f172a;
    border-radius: 10px;
    padding: 10px 0;
    min-width: 180px;

    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    z-index: 2000;
}

.dropdown-menu li {
    list-style: none;
}

.dropdown-menu a {
    display: block;
    padding: 10px 15px;
    color: #e2e8f0;
    text-decoration: none;
    transition: 0.2s;
}

.dropdown-menu a:hover {
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
}

.dropdown:hover>.dropdown-menu {
    display: block;
}



.anilist-btn {
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
}

.anilist-btn:first-child {
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.5);
}

.anilist-btn:first-child:hover {
    background: rgba(56, 189, 248, 0.15);
}

.anilist-btn:last-child {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    color: #0f172a;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
}

.anilist-btn:last-child:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.6);
}




.anilist-sync-btn {
    padding: 6px 16px;
    border-radius: 999px;

    border: 1px solid rgba(34, 197, 94, 0.6);
    background: transparent;

    color: #22c55e;
    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition: all 0.25s ease;
}

.anilist-sync-btn:hover {
    background: rgba(34, 197, 94, 0.15);
    border-color: #22c55e;
    transform: translateY(-1px);
}

.anilist-sync-btn:active {
    transform: scale(0.95);
}


.search {
    position: relative;
    display: flex;
    align-items: center;
}

.search input {
    padding: 6px 12px;
    border-radius: 20px;
    border: none;
    outline: none;
}



.search-results {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);

    width: 300px;
    /* o quello che vuoi */

    background: #0f172a;
    border-radius: 10px;
    overflow: hidden;

    opacity: 0.95;

    margin-top: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    cursor: pointer;
}

.search-item:hover {
    background: #1a1a1a;
}

.search-thumb {
    width: 40px;
    height: 55px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.search-box {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);

    display: flex;
    align-items: center;
    gap: 8px;

    background: #0f172a;
    padding: 6px 10px;
    border-radius: 20px;

    opacity: 0;
    pointer-events: none;
    transition: 0.3s;

    z-index: 2000;
}

.search.active .search-box {
    opacity: 1;
    pointer-events: auto;
}

.search-box input {
    background: #1e293b;
    /* blu scuro */
    color: #e2e8f0;

    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 20px;

    padding: 6px 12px;
    font-size: 14px;

    transition: all 0.25s ease;
}

/* PLACEHOLDER */
.search-box input::placeholder {
    color: rgba(226, 232, 240, 0.6);
}

/* FOCUS */
.search-box input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

/* BOTTONE LENTE */
.search-toggle {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.4);

    color: #38bdf8;

    padding: 6px 8px;
    border-radius: 50%;

    cursor: pointer;
    transition: 0.25s;
}

/* HOVER LENTE */
.search-toggle:hover {
    background: rgba(56, 189, 248, 0.2);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

/* CLOSE BUTTON */
.search-close {
    color: #94a3b8;
    transition: 0.2s;
}

.search-close:hover {
    color: #38bdf8;
}



.user button {
    padding: 6px 16px;
    border-radius: 999px;

    border: 1px solid rgba(56, 189, 248, 0.5);
    background: transparent;

    color: #38bdf8;
    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition: all 0.25s ease;
}

.user button:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: #38bdf8;
    transform: translateY(-1px);
}

.user button:active {
    transform: scale(0.95);
}

.user button {
    padding: 6px 16px;
    border-radius: 999px;

    border: 1px solid rgba(56, 189, 248, 0.5);
    background: transparent;

    color: #38bdf8;
    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition: all 0.25s ease;
}

.user button:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: #38bdf8;
    transform: translateY(-1px);
}

.user button:active {
    transform: scale(0.95);
}


.activeNav {
    color: lime !important;
}

.mobile-only {
    display: none;
}

.hidden {
    display: none;
}

@font-face {
    font-family: 'Audiowide';
    src: url('../fonts/Audiowide-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}



@media (max-width: 768px) {

    /* Nascondi elementi generici */
    .mobile-only.hidden {
        display: none;
    }

    .mobile-nav {
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1000;
    }

    .mobile-nav button {
        background: rgba(0, 0, 0, 0.5);
        border: none;
        color: white;
        padding: 10px;
        border-radius: 50%;
        backdrop-filter: blur(10px);
        font-size: 18px;
    }

    .mobile-only {
        display: flex;
        justify-content: center;
        position: fixed;
        top: 12px;
        /* 🔥 più vicino al bordo */
        left: 0;
        width: 100%;
        z-index: 1000;
        pointer-events: none;
    }

    .home-btn {
        pointer-events: auto;
        padding: 8px 18px;
        /* 🔥 prende tutta la scritta */
        border-radius: 999px;
        border: 1px solid rgba(56, 189, 248, 0.5);
        background: linear-gradient(135deg, #38bdf8, #0ea5e9);
        color: #0f172a;
        font-size: 14px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        /* spazio tra icone e testo */
        cursor: pointer;
        box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
        transition: all 0.25s ease;
        backdrop-filter: blur(4px);
    }

    .home-btn:active {
        transform: scale(0.95);
        box-shadow: 0 2px 8px rgba(56, 189, 248, 0.5);
    }


    .navbar {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 15px;
        gap: 8px;
    }

    /* TOP BAR */
    .top-bar {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        flex: 1;
        gap: 20px;
    }

    /* LOGO */
    .logo {
        font-size: 22px;
    }

    /* NAV MENU (IMPORTANTE) */
    .menu {
        display: flex;
        justify-content: space-around;
        width: 100%;
        margin-top: 5px;
        gap: 10px;
    }

    .menu a {
        font-size: 13px;
    }

    /* RIGHT = SOLO USER */
    .right {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    /* NASCONDI SEARCH */
    .search {
        position: relative;
    }

    /* BOTTONE LENTE */
    .search-toggle {
        background: rgba(0, 0, 0, 0.5);
        border: none;
        color: white;
        padding: 8px;
        border-radius: 50%;
        font-size: 16px;
        cursor: pointer;
    }

    .search.active::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1500;
    }

    /* USER COMPATTO */
    .user span {
        display: none;
    }

    .user a,
    .user button {
        padding: 4px 8px;
        font-size: 11px;
    }

    /* DROPDOWN MOBILE */
    .dropdown-menu {
        position: static;
        background: transparent;
        box-shadow: none;
    }
}