#topbar {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 75px;
    padding: 0 5%;
    box-sizing: border-box;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    background: rgba(18, 18, 22, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 6789;
    transition: all 0.3s ease;
}

#topbar #top {
    display: flex;
    align-items: center;
    height: 100%;
}

#topbar #top a img {
    height: 32px;
    width: auto;
    transition: transform 0.3s ease;
}

#topbar #top a img:hover {
    transform: scale(1.03);
}

#topbar #menu { display: none; }

#topbar #menuwrap {
    display: flex;
    align-items: center;
}

#topbar #menuwrap ul {
    display: flex;
    align-items: center;
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}

#topbar #menuwrap ul li a,
#topbar #menuwrap ul li .btn-account {
    display: inline-block;
    padding: 10px 22px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    transition: all 0.3s ease;
    cursor: pointer;
}

#topbar #menuwrap ul li a:hover {
    background: rgba(255, 204, 0, 0.12);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-2px);
}

#topbar #menuwrap ul li .btn-account {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-warm));
    color: #000;
    font-weight: 800;
    border: none;
}

#topbar #menuwrap ul li .btn-account:hover {
    color: #000;
    box-shadow: 0 6px 20px var(--accent-glow);
    filter: brightness(1.1);
}

/* MOBIILIVALIKKO */
#topbar #lb_menu {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 36px;
    height: 36px;
    cursor: pointer;
}

#topbar #lb_menu div {
    width: 100%;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 4px;
    transition: all 0.3s ease;
}

@media screen and (max-width: 800px) {
    #topbar {
        height: 65px;
        padding: 0 20px;
    }
    
    #topbar #lb_menu {
        display: flex;
    }

    #topbar #menuwrap {
        position: fixed;
        top: 65px;
        left: 0;
        right: 0;
        background: rgba(18, 18, 22, 0.95);
        backdrop-filter: blur(20px);
        padding: 20px;
        border-bottom: 1px solid var(--border-subtle);
        display: none;
        flex-direction: column;
    }

    #topbar #menuwrap ul {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    #topbar #menuwrap ul li {
        width: 100%;
    }

    #topbar #menuwrap ul li a,
    #topbar #menuwrap ul li .btn-account {
        display: block;
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }

    #topbar #menu:checked + #menuwrap {
        display: flex;
    }

    #topbar #menu:checked ~ #lb_menu div:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    #topbar #menu:checked ~ #lb_menu div:nth-child(2) {
        opacity: 0;
    }
    #topbar #menu:checked ~ #lb_menu div:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
}

/* MODAL - KÄYTTÄJÄTILI */
#account_wrap {
    position: fixed;
    display: none;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgba(10, 10, 14, 0.85);
    backdrop-filter: blur(12px);
    z-index: 9400;
}

#account_wrap #loo { 
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    margin-bottom: 15px;
    background-color: var(--bgr-card-elev);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: transform 0.2s;
}

#account_wrap #loo:hover { transform: scale(1.1); }
#account_wrap #loo img { width: 20px; height: 20px; }

#logw:checked + #account_wrap { display: flex; }

#account_wrap .ac_view {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#account_wrap input[name='logview']:checked + .ac_view {
    display: flex;
}

#account_wrap .ac_view h3 {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 10px 0;
    color: var(--accent-primary);
}

#account_wrap .ac_view p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0 0 20px 0;
    text-align: center;
}

#account_wrap .ac_view .inp_row {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
}

#account_wrap .ac_view .inp_row input {
    width: 100%;
    height: 52px;
    border: 1px solid var(--border-subtle);
    outline: none;
    font-size: 1rem;
    background-color: var(--bgr-dark);
    color: var(--text-primary);
    padding: 0 18px;
    box-sizing: border-box;
    border-radius: 12px;
}

#account_wrap .ac_view .inp_row input:focus {
    border-color: var(--accent-primary);
}

#account_wrap .ac_view .inp_row label {
    position: absolute;
    top: -10px;
    left: 12px;
    background: var(--bgr-card);
    padding: 0 6px;
    font-size: 0.75rem;
    color: var(--accent-primary);
    font-weight: 600;
}

#account_wrap .ac_view .btt {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

#account_wrap .ac_view .btt label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
}

#account_wrap .ac_view .btt label:hover {
    color: var(--accent-primary);
}