/* Shared by every page (home, server picker, server pages): the account menu
   and the Appearance dialog. Colours come from each page's theme tokens. */

/* Wall-E's Discord profile picture, used as the site logo. */
.brand-avatar {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 10px;
    object-fit: cover;
    background: var(--surf-2);
    box-shadow: 0 0 0 1px var(--line);
}

.nav .brand-avatar,
.site-header .brand-avatar {
    width: 38px;
    height: 38px;
    border-radius: 11px;
}

.account {
    position: relative;
}

.account-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: 42px;
    padding: 0 10px 0 5px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--glass, var(--surf));
    color: var(--text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.14s ease;
}

.account-btn:hover,
.account-btn[aria-expanded="true"] {
    border-color: var(--line-strong, var(--muted));
}

.account-btn img,
.account-head img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--surf-2);
}

.account-btn .account-name {
    max-width: 150px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.account-btn svg {
    stroke: var(--muted);
    flex-shrink: 0;
}

.account-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 100;
    width: 260px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surf);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    text-align: left;
}

.account-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 10px;
}

.account-head strong {
    display: block;
    overflow-wrap: anywhere;
}

.account-head span {
    color: var(--muted);
    font-size: 0.78rem;
}

.account-menu .menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 38px;
    padding: 6px 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
}

.account-menu .menu-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    stroke: var(--muted);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.account-menu .menu-item:hover,
.account-menu .menu-item:focus-visible {
    background: var(--surf-2);
    outline: none;
}

.account-menu .menu-item.danger {
    color: var(--bad);
}

.account-menu .menu-item.danger svg {
    stroke: var(--bad);
}

.account-menu .menu-sep {
    height: 1px;
    margin: 6px 4px;
    background: var(--line);
}

/* ------------------------------------------------------ Appearance dialog */

.ap-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(6px);
}

.ap-overlay[hidden] {
    display: none;
}

.ap-box {
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surf);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    color: var(--text);
    font-family: 'Geist', system-ui, sans-serif;
    font-size: 0.94rem;
    line-height: 1.5;
}

.ap-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.ap-head h2 {
    font-family: 'Bricolage Grotesque', 'Geist', sans-serif;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.ap-head p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.86rem;
}

.ap-close {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.ap-close:hover {
    background: var(--surf-2);
    color: var(--text);
}

.ap-label {
    margin-bottom: 8px;
    font-weight: 600;
}

.ap-themes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.ap-theme {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surf-2);
    color: var(--text);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.14s ease;
}

.ap-theme:hover {
    border-color: var(--muted);
}

.ap-theme[aria-pressed="true"] {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.ap-swatch {
    position: relative;
    height: 58px;
    overflow: hidden;
    border-radius: 9px;
}

.ap-swatch i {
    position: absolute;
    left: 8px;
    right: 8px;
    height: 10px;
    border-radius: 4px;
}

.ap-swatch i:nth-child(1) { top: 10px; width: 40%; }
.ap-swatch i:nth-child(2) { top: 26px; opacity: 0.9; }
.ap-swatch i:nth-child(3) { top: 42px; width: 60%; }

.ap-theme span {
    padding: 0 4px 2px;
}

.ap-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.ap-row p {
    color: var(--muted);
    font-size: 0.8rem;
}

.ap-seg {
    display: inline-flex;
    flex-shrink: 0;
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surf-2);
}

.ap-seg button {
    height: 30px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.ap-seg button[aria-pressed="true"] {
    background: var(--grad);
    color: var(--ink);
}

.ap-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
}

.ap-foot .ap-note {
    color: var(--muted);
    font-size: 0.78rem;
}

.ap-foot button {
    height: 40px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.ap-foot .ap-done {
    border: 0;
    background: var(--grad);
    color: var(--ink);
}

@media (max-width: 560px) {
    .ap-themes {
        grid-template-columns: minmax(0, 1fr);
    }

    .ap-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .account-btn .account-name {
        display: none;
    }
}
