/* --- Global Header (Beautiful Glassmorphism) --- */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2000;
    padding: 0.5rem 2rem;
    pointer-events: none;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

@media (max-width: 768px) {
    .main-nav {
        justify-content: center;
        padding: 0.5rem 1rem;
    }
}

.main-nav>* {
    pointer-events: auto;
}

.nav-container {
    background: rgba(10, 12, 18, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 0.5rem 0.5rem;
    border-radius: 24px;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: background-color 160ms ease, border-color 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
    .nav-container:hover {
        background: rgba(15, 18, 26, 0.7);
    }
}

/* Nav Buttons */
.btn-nav-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    color: #bbb;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
}

.btn-nav-icon:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-nav-text {
    font-family: var(--font-tech);
    font-weight: 600;
    font-size: 0.9rem;
    color: #bbb;
    text-decoration: none;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    transition: all 0.2s;
    letter-spacing: 1px;
    background: transparent;
    border: none;
    cursor: pointer;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-nav-text:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

/* User Profile & Account */
.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #333;
    background-size: cover;
    background-position: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.balance-widget {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 40px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: #fff;
    font-family: var(--font-tech);
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 120ms cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

@media (hover: hover) and (pointer: fine) {
    .balance-widget:hover {
        background: rgba(25, 30, 40, 0.9);
        border-color: rgba(255, 215, 0, 0.5);
    }
}

.balance-widget:active {
    transform: scale(0.97);
}

.coin-icon-svg {
    flex-shrink: 0;
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.4));
}

/* Coin value text — golden, vertically centered */
.balance-widget .coin-value {
    color: #FFD700;
    font-family: var(--font-tech);
    font-style: normal;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    line-height: 1;
}

/* Coin icon inside nav widget — kill margins, fix alignment */
.balance-widget .coin-icon {
    margin-left: 0.1em !important;
    vertical-align: middle;
}

/* Cart icon — slightly separated from widget edge */
.balance-widget .nav-shop-icon {
    margin-right: 0.35rem;
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

.shop-add-icon {
    width: 20px;
    height: 20px;
    background: var(--primary-accent);
    color: #000;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.btn-profile-trigger {
    background: transparent;
    border: none;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 160ms ease, transform 120ms cubic-bezier(0.23, 1, 0.32, 1);
    color: #fff;
}

.btn-profile-trigger[aria-expanded='true'] {
    background: rgba(255, 255, 255, 0.05);
}

.btn-profile-trigger:active {
    transform: scale(0.97);
}

.dropdown-chevron {
    flex: none;
    transition: transform 180ms cubic-bezier(0.23, 1, 0.32, 1);
}

.btn-profile-trigger[aria-expanded='true'] .dropdown-chevron {
    transform: rotate(180deg);
}

.user-name {
    font-family: var(--font-tech);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    pointer-events: none;
}

/* Profile Dropdown Container */
.profile-dropdown-container {
    position: relative;
    display: inline-block;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    background: rgba(9, 14, 11, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.48);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px) scale(0.97);
    transform-origin: top right;
    transition: opacity 150ms cubic-bezier(0.23, 1, 0.32, 1), transform 180ms cubic-bezier(0.23, 1, 0.32, 1), visibility 0s linear 180ms;
    z-index: 2100;
}

.profile-dropdown.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    transition-delay: 0s;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    padding: 0.6rem 1rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-family: var(--font-tech);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background-color 160ms ease, color 160ms ease;
}

.dropdown-item svg {
    flex-shrink: 0;
}

.dropdown-item:hover {
    background: rgba(35, 139, 78, 0.15);
    color: var(--primary-accent);
}

.dropdown-item.text-danger:hover {
    background: rgba(255, 85, 85, 0.15);
    color: #ff5555;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.4rem 0;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.btn-logout:hover {
    color: #ff5555;
    background: rgba(255, 85, 85, 0.1);
}

.icon-logout-svg {
    width: 22px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --- Compact Language Switcher --- */
.lang-switcher-row {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 0.4rem 0.5rem;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-family: var(--font-tech);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 0.35rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    text-align: center;
    min-width: 44px;
    min-height: 44px;
}

.btn-profile-trigger:focus-visible,
.dropdown-item:focus-visible,
.lang-btn:focus-visible {
    outline: 2px solid #67e89a;
    outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
    .btn-profile-trigger:hover {
        background: rgba(255, 255, 255, 0.05);
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn-profile-trigger,
    .dropdown-chevron,
    .profile-dropdown {
        transition-duration: 1ms !important;
        transition-delay: 0ms !important;
    }

    .profile-dropdown {
        transform: none;
    }
}

/* Shared balance action used in the home and shop headers. */
.buy-coins-plus {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 0.5rem;
    flex: 0 0 20px;
    border-radius: 50%;
    background: var(--primary-accent);
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.lang-btn.active {
    background: rgba(35, 139, 78, 0.2);
    color: var(--primary-accent);
    border-color: var(--primary-accent);
}

/* Auth page language picker */
.auth-lang-picker {
    display: flex;
    justify-content: center;
    margin-top: 1.2rem;
}

.auth-lang-picker .lang-switcher-row {
    gap: 6px;
}
