/* div {
    border: 1px solid rgba(218, 218, 218, 0.1);
} */

body {
    background-color: var(--bg); background-image: var(--bg-gradient); background-attachment: fixed;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.site-name {
    font-size: 24px;
    font-weight: 600;
    color: white;
    font-family: "Noto Sans", sans-serif;
    margin-left: 15px;
}

.nav-bar {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin: 0 auto 20px;
    width: min(1420px, calc(100% - 12px));   /* 20px wider than the page content (1400px / 100% - 32px) */
    box-sizing: border-box;
    padding: 0px 30px;
    background: var(--surface);
    border-radius: 10px;
    box-shadow: inset 0 0 0 1px var(--border), 0 8px 24px rgba(0, 0, 0, 0.28);
    /* always at the top of the window while the page scrolls (above the page, below dialogs) */
    position: sticky;
    top: 8px;
    z-index: 40;
}
/* the gap above the stuck nav bar shows the page background, not the content scrolling past */
.nav-bar::before {
    content: ""; position: absolute; z-index: -1; left: -6px; right: -6px; top: -8px; height: 8px;
    background-color: var(--bg); background-image: var(--bg-gradient); background-attachment: fixed;
}
/* jumps to #anchors land below the nav bar instead of under it */
html { scroll-padding-top: 96px; }

.page-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
    width: min(1400px, calc(100% - 32px));
    box-sizing: border-box;
    padding: 0px 30px;
    background: var(--surface);
    border-radius: 10px;
}

.nav-buttons {
    display: flex;
    gap: 5px;
    /* background: rgba(0, 0, 0, 0.1); */
    border-radius: 10px;
    padding: 2px;
}

.nav-bar button:hover {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.nav-bar button {
    background: transparent;
    border: none;
    font-family: noto sans, roboto;
    font-weight: 600;
    color: white;
    font-size: 20px;
    padding: 10px 20px;
    position: relative;
}

.nav-bar button.active::after {
    content: '';
    position: absolute;
    bottom: 1px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 24px);
    height: 4px;
    background: var(--accent);
    border-radius: 3px;
}

.site-icon {
    width: 36px;
    height: 36px;
}

.hidden {
    display: none !important;
}

.user-area {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 110px;
    opacity: 0;
    transition: opacity 0.2s;
}

.user-area.auth-ready { opacity: 1; }

/* Fade-in template for auth-dependent page content (CTAs, skip checkbox, etc.) */
.cta-auth {
    opacity: 0;
    transition: opacity 0.2s;
}
.cta-auth.cta-ready { opacity: 1; }

/* Sync auth — set by inline script in <head> before first paint */
html.has-token #login-area    { display: none !important; }
html:not(.has-token) #user-menu { display: none !important; }

.user-pfp {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.25);
    transition: border-color 0.15s;
}

.user-pfp:hover {
    border-color: rgba(255, 255, 255, 0.8);
}

.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 4px;
    min-width: 120px;
    z-index: 100;
    box-shadow: var(--shadow);
}

.user-dropdown button {
    width: 100%;
    text-align: left;
    padding: 8px 14px;
    font-size: 15px;
    border-radius: 6px;
}

#login-area {
    position: relative;
}

#login-area .user-dropdown {
    min-width: 160px;
    padding: 6px;
}

.platform-login {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: "Noto Sans", sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: white;
    text-decoration: none;
    transition: background 0.12s;
}

.platform-login:hover {
    background: rgba(255, 255, 255, 0.1);
}

.platform-login svg,
.platform-login img {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    object-fit: contain;
}

.platform-login.twitch { color: #8659cb; }
.platform-login.kick   { color: #53fc18; }
/* menus: Core / Services, and "Mod for" next to the profile picture */
.nav-dd { position: relative; }
.nav-caret { font-size: .7em; opacity: .7; margin-left: 2px; }
.nav-dd-menu {
    position: absolute; left: 0; top: calc(100% + 6px); z-index: 100;
    display: flex; flex-direction: column; gap: 2px; min-width: 190px; padding: 5px;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.nav-dd-right { left: auto; right: 0; }
.nav-dd-menu a, .nav-bar .nav-dd-menu button {
    display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box;
    padding: 8px 12px; border: 0; border-radius: 6px; background: none; text-align: left; cursor: pointer;
    font: 600 15px "Noto Sans", sans-serif; color: white; text-decoration: none; white-space: nowrap;
}
.nav-dd-menu a:hover, .nav-dd-menu a:focus-visible,
.nav-bar .nav-dd-menu button:hover, .nav-bar .nav-dd-menu button:focus-visible { background: rgba(255, 255, 255, 0.1); outline: none; }
.nav-dd-menu a.on { color: var(--accent); }
.nav-dd-menu img, .nav-pic-empty { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: rgba(255, 255, 255, 0.15); display: inline-block; }
.nav-bar .nav-dd-menu button[aria-checked="true"] { background: rgba(0, 191, 255, 0.15); }
.nav-bar .nav-dd-menu button[aria-checked="true"]::after { content: '✓'; margin-left: auto; color: var(--accent); }
.nav-dd-menu .nav-dd-note { margin-top: 4px; padding: 6px 12px; border-top: 1px solid var(--border); border-radius: 0; font-size: 12px; font-weight: 400; color: rgba(255, 255, 255, 0.6); }
.user-area, #user-menu { gap: 10px; }
#user-menu { display: flex; align-items: center; position: relative; }
.nav-bar .nav-modfor .nav-dd-btn {
    display: flex; align-items: center; gap: 8px; padding: 5px 12px; font-size: 15px;
    border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 999px;
}
.nav-modfor .nav-dd-btn img, .nav-modfor .nav-dd-btn .nav-pic-empty { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.nav-modfor-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-modfor-text small { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); }
.nav-bar .nav-modfor.modding .nav-dd-btn { border-color: var(--accent); background: rgba(0, 191, 255, 0.12); }

/* small screens */
@media (max-width: 900px) {
    .nav-bar { padding: 0 12px; gap: 8px; }
    .nav-buttons { flex: 1; }
    .nav-bar button { font-size: 16px; padding: 10px 12px; white-space: nowrap; }
    .site-name { display: none; }
}
@media (max-width: 560px) {
    .nav-modfor-text { display: none; }
    .nav-bar .nav-dd-btn { padding: 10px 8px; }
}

/* the tools' line icons (UI.icon) in the nav: muted, brighter on hover and on the page you're on */
.nav-bar .ui-ico { flex-shrink: 0; color: var(--text-muted); transition: color .12s; }
.nav-bar button > .ui-ico { margin-right: 7px; vertical-align: -3px; }
.nav-bar button:hover > .ui-ico, .nav-bar button.active > .ui-ico, .nav-dd-menu a:hover .ui-ico, .nav-dd-menu a.on .ui-ico { color: var(--accent); }
