/* =============================================================================
   APP SHELL — sidebar layout for dashboard / players / tournaments / settings
   PUBLIC NAV — top bar for home / login
   ============================================================================= */

/* -----------------------------------------------------------------------
   Brand lockup (shared)
   ----------------------------------------------------------------------- */

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 19px;
    color: var(--ivory);
    letter-spacing: 0.01em;
}

.brand .brand-mark {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.brand .brand-mark rect,
.brand .brand-mark line {
    stroke: var(--brass-bright);
}

.brand .brand-mark circle {
    fill: var(--brass-bright);
}

.brand small {
    display: block;
    font-family: var(--font-eyebrow);
    font-size: 10px;
    letter-spacing: 0.18em;
    color: var(--brass-dim);
    text-transform: uppercase;
    margin-top: 1px;
}

/* -----------------------------------------------------------------------
   Public top nav (home, login)
   ----------------------------------------------------------------------- */

.public-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(21, 15, 10, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line-soft);
}

.public-nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.public-nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ivory-dim);
}

.public-nav-links a {
    transition: color 0.15s ease;
}

.public-nav-links a:hover {
    color: var(--brass-bright);
}

.public-nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--ivory);
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
}

/* -----------------------------------------------------------------------
   App shell (logged-in pages)
   ----------------------------------------------------------------------- */

.app-shell {
    display: grid;
    grid-template-columns: 252px 1fr;
    min-height: 100vh;
}

.app-sidebar {
    background: var(--bg-soft);
    border-right: 1px solid var(--line-soft);
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.app-sidebar .brand {
    padding: 6px 10px 28px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    font-weight: 500;
    color: var(--ivory-dim);
    border: 1px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sidebar-nav a svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.85;
}

.sidebar-nav a:hover {
    background: var(--panel-2);
    color: var(--ivory);
}

.sidebar-nav a.active {
    background: linear-gradient(90deg, rgba(207, 157, 62, 0.14), rgba(207, 157, 62, 0.03));
    color: var(--brass-bright);
    border-color: rgba(207, 157, 62, 0.25);
}

.sidebar-nav .nav-section-label {
    font-family: var(--font-eyebrow);
    font-size: 10.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ivory-faint);
    padding: 18px 12px 8px;
}

.sidebar-play-cta {
    margin: 6px 0 14px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid var(--line-soft);
    margin-top: 10px;
}

.sidebar-user .name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ivory);
}

.sidebar-user .role {
    font-size: 11.5px;
    color: var(--ivory-faint);
}

.sidebar-user a.logout {
    margin-left: auto;
    color: var(--ivory-faint);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-user a.logout:hover {
    background: rgba(193, 92, 55, 0.15);
    color: var(--clay-bright);
}

.sidebar-user a.logout svg {
    width: 16px;
    height: 16px;
}

.app-main {
    padding: 32px 40px 60px;
    min-width: 0;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(21, 15, 10, 0.85);
    backdrop-filter: blur(10px);
    padding: 20px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -40px;
    margin-top: -32px;
    margin-bottom: 30px;
    gap: 20px;
    flex-wrap: wrap;
}

.app-topbar h1 {
    font-size: 26px;
}

.app-topbar .subtitle {
    color: var(--ivory-faint);
    font-size: 14px;
    margin-top: 4px;
}

/* -----------------------------------------------------------------------
   Responsive: collapse sidebar on small screens
   ----------------------------------------------------------------------- */

@media (max-width: 900px) {
    .app-topbar {
        position: sticky;
        top: 0;
        z-index: 30;
        background: rgba(21, 15, 10, 0.85);
        backdrop-filter: blur(10px);
        padding: 20px 30px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin: -18px;
        margin-top: -32px;
        margin-bottom: 30px;
        gap: 20px;
        flex-wrap: wrap;
    }

    .app-topbar > div {
        max-width: 80%;
    }

    .app-topbar h1, .app-topbar .subtitle {
        text-align: right;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 252px;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: var(--shadow-lift);
    }

    .app-sidebar.open {
        transform: translateX(0);
    }

    .app-main {
        padding: 24px 18px 50px;
    }

    .mobile-nav-toggle {
        display: inline-flex;
    }

    .public-nav-links {
        display: none;
    }
}

.sidebar-scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 45;
}

.sidebar-scrim.open {
    display: block;
}