/**
 * ShotWars — Topbar (full-width sticky glass)
 * Matches mockup: vault/ShotWars/Design/01-landing.html
 */

/* ── TOPBAR ── */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sticky, 100);
    height: 56px;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 40px;
    background: var(--glass-nav);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--border);
}

/* ── LOGO ── */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 800;
    font-size: 18px;
    color: var(--t-bright);
    letter-spacing: -0.4px;
    flex-shrink: 0;
}

.logo-mark {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--violet) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-sw {
    color: var(--accent-l);
}

/* ── TOPBAR NAV ── */
.topbar-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
}

.nav-link {
    padding: 6px 14px;
    border-radius: 8px;
    color: var(--t-dim);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: 150ms ease;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--t-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--t-bright);
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px var(--border-accent);
}

/* ── TOPBAR RIGHT ── */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: 150ms ease;
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}

.btn-ghost {
    color: var(--t-dim);
    background: transparent;
    border-color: transparent;
}

.btn-ghost:hover {
    color: var(--t-main);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border);
}

.btn-filled {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-filled:hover {
    background: var(--accent-d);
    box-shadow: 0 4px 20px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-outline {
    color: var(--accent-l);
    border-color: var(--accent);
    background: transparent;
}

.btn-outline:hover {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 20px var(--accent-glow);
}

/* ── USER CHIP ── */
.nav-user-wrap { position: relative; }

.nav-user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 6px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease;
    font-family: inherit;
    color: inherit;
    text-decoration: none;
}

.nav-user-chip:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border);
}

.nav-user-chip.open {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--border-m);
}

.nav-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 0 8px var(--accent-glow);
    user-select: none;
}

.nav-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--t-main);
}

.nav-user-chevron {
    font-size: 9px;
    color: var(--t-ghost);
    transition: transform 150ms ease;
    flex-shrink: 0;
}

.nav-user-chip.open .nav-user-chevron {
    transform: rotate(180deg);
}

/* ── ICON BUTTONS (sound, theme) ── */
.nav-btn {
    min-width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--t-dim);
    font-size: 14px;
    cursor: pointer;
    transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
    font-family: inherit;
    padding: 0;
}

.nav-btn:hover {
    color: var(--t-bright);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border);
}

.nav-btn.sound-on { color: var(--cyan); }
.nav-btn.sound-on:hover { color: var(--t-bright); }

.nav-sep {
    width: 1px;
    height: 18px;
    background: var(--border);
    margin: 0 4px;
    flex-shrink: 0;
}

/* ── DROPDOWN ── */
.nav-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: rgba(14, 14, 24, 0.99);
    border: 1px solid var(--border-m);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.70), 0 0 0 1px rgba(99, 102, 241, 0.07);
    display: none;
    animation: dropdown-open 200ms cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
}

@keyframes dropdown-open {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.nav-user-wrap.open .nav-dropdown { display: block; }

.dd-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 4px;
}

.dd-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 0 12px var(--accent-glow);
}

.dd-info-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--t-bright);
    display: block;
}

.dd-info-role {
    font-size: 11px;
    color: var(--accent-l);
    font-weight: 600;
    display: block;
    margin-top: 1px;
}

.dd-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 0;
}

.dd-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--t-main);
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: color 150ms ease, background 150ms ease;
    border: none;
    background: transparent;
    width: 100%;
    font-family: inherit;
    text-align: left;
}

.dd-item:hover {
    color: var(--t-bright);
    background: rgba(255, 255, 255, 0.04);
}

.dd-item-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.dd-item.danger { color: var(--wrong); }
.dd-item.danger:hover { background: rgba(239, 68, 68, 0.09); color: #fca5a5; }

/* ── MOBILE HAMBURGER ── */
.nav-hamburger {
    display: none;
    min-width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    color: var(--t-dim);
    transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
    flex-shrink: 0;
    font-family: inherit;
    margin-left: auto;
    padding: 0;
}

.nav-hamburger:hover {
    color: var(--t-bright);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border);
}

.hbg-lines {
    display: flex;
    flex-direction: column;
    gap: 4px;
    pointer-events: none;
}

.hbg-line {
    display: block;
    height: 1.5px;
    background: currentColor;
    border-radius: 99px;
    transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1), opacity 150ms ease, width 150ms ease;
    transform-origin: center;
}

.hbg-line:nth-child(1) { width: 18px; }
.hbg-line:nth-child(2) { width: 13px; }
.hbg-line:nth-child(3) { width: 18px; }

.nav-hamburger.open .hbg-line:nth-child(1) {
    transform: translateY(5.5px) rotate(45deg);
    width: 18px;
}
.nav-hamburger.open .hbg-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.nav-hamburger.open .hbg-line:nth-child(3) {
    transform: translateY(-5.5px) rotate(-45deg);
    width: 18px;
}

/* ── DRAWER BACKDROP ── */
.drawer-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: var(--z-overlay, 200);
    animation: bd-fade-in 200ms ease;
}

@keyframes bd-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.drawer-backdrop.open { display: block; }

/* ── DRAWER ── */
.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    background: var(--base);
    border-left: 1px solid var(--border-m);
    z-index: var(--z-modal, 300);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.60);
}

.drawer.open { transform: translateX(0); }

.drawer-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px 14px;
    border-bottom: 1px solid var(--border);
}

.drawer-avatar {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 0 12px var(--accent-glow);
    user-select: none;
}

.drawer-user-info { flex: 1; min-width: 0; }

.drawer-username {
    font-size: 14px;
    font-weight: 700;
    color: var(--t-bright);
    display: block;
}

.drawer-role {
    font-size: 11px;
    color: var(--accent-l);
    font-weight: 600;
    display: block;
    margin-top: 2px;
}

.drawer-close {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--t-dim);
    cursor: pointer;
    transition: color 150ms ease, background 150ms ease;
    flex-shrink: 0;
    font-family: inherit;
    font-size: 14px;
    padding: 0;
}

.drawer-close:hover {
    color: var(--t-bright);
    background: rgba(255, 255, 255, 0.08);
}

.drawer-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.drawer-status-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--t-main);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: color 150ms ease, background 150ms ease;
    font-family: inherit;
    min-height: 44px;
}

.drawer-status-btn:hover {
    color: var(--t-bright);
    background: rgba(255, 255, 255, 0.07);
}

.drawer-status-btn.sound-on { color: var(--cyan); border-color: rgba(34, 211, 238, 0.22); }
.drawer-status-btn.sound-on:hover { color: var(--t-bright); }

.drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 8px;
    flex: 1;
    overflow-y: auto;
}

.drawer-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--t-main);
    text-decoration: none;
    border-radius: 10px;
    transition: color 150ms ease, background 150ms ease;
    min-height: 44px;
}

.drawer-link:hover {
    color: var(--t-bright);
    background: rgba(255, 255, 255, 0.04);
}

.drawer-link.active {
    color: var(--t-bright);
    font-weight: 600;
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.24);
}

.drawer-link-icon {
    font-size: 16px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.drawer-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 4px 8px 0;
    padding: 13px;
    font-size: 14px;
    font-weight: 700;
    color: var(--cyan);
    background: var(--cyan-soft);
    border: 1px solid rgba(34, 211, 238, 0.28);
    border-radius: 10px;
    text-decoration: none;
    transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;
    min-height: 44px;
}

.drawer-cta:hover {
    background: var(--cyan);
    color: #07070d;
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.38);
}

.drawer-footer {
    padding: 10px 8px 28px;
    border-top: 1px solid var(--border);
}

.drawer-logout {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--t-dim);
    border-radius: 10px;
    text-decoration: none;
    cursor: pointer;
    transition: color 150ms ease, background 150ms ease;
    min-height: 44px;
    border: none;
    background: transparent;
    width: 100%;
    font-family: inherit;
    text-align: left;
}

.drawer-logout:hover {
    color: var(--wrong);
    background: rgba(239, 68, 68, 0.08);
}

/* ── RESPONSIVE ── */
@media (max-width: 767px) {
    .topbar { padding: 0 16px; gap: 12px; }
    .topbar-nav { display: none; }
    .nav-btn, .nav-sep { display: none; }
    .nav-hamburger { display: flex; }

    /* Shrink right zone to just hamburger */
    .topbar-right { gap: 4px; }
    .topbar-right .btn { display: none; }
}
