/* ===========================================================================
   Backstage — shared app shell (navbar, footer, feed, profile, settings, modals)
   Relies on theme variables defined in chat.css (:root) + applied by app.js
   =========================================================================== */
html, body {
    --bg: #0e1313;
    --bg-alt: black;
    --spacer: clamp(4em, 3em + 4vw, min(9em, 20vmin));

    --bgp-window: 80vh;
    --bgp-fade: 50%;

    --bgp-s: var(--spacer);
    --bgp-1: var(--bg);
    --bgp-2: var(--bg-alt);

    --bgp-hs: calc(var(--bgp-s) / 2);
    --bgp-hp-ss: var(--bgp-hs) var(--bgp-hs) / var(--bgp-s) var(--bgp-s);
    --bgp-0p-ss: 0 0 / var(--bgp-s) var(--bgp-s);

    --bgp-grad: var(--bgp-1) 0% 5%, 
        var(--bgp-2) 6% 15%, 
        var(--bgp-1) 16% 25%, 
        var(--bgp-2) 26% 35%, 
        var(--bgp-1) 36% 45%, 
        var(--bgp-2) 46% 55%, 
        var(--bgp-1) 56% 65%, 
        var(--bgp-2) 66% 75%, 
        var(--bgp-1) 76% 85%, 
        var(--bgp-2) 86% 95%, 
        transparent 96%
    ;

    background: 
        /* the 'window' that reveals the pattern */
        radial-gradient(
            175% var(--bgp-window) at top left, 
            transparent var(--bgp-fade), 
            var(--bg) 100%
        ), 
        /* the pattern, adapted from Temani Afif */
        radial-gradient(50% 50% at 100% 0, var(--bgp-grad)) var(--bgp-0p-ss), 
        radial-gradient(50% 50% at 0 100%, var(--bgp-grad)) var(--bgp-0p-ss), 
        radial-gradient(50% 50%, var(--bgp-grad)) var(--bgp-0p-ss), 
        radial-gradient(50% 50%, var(--bgp-grad)) var(--bgp-hp-ss), 
        var(--bgp-1)
    ;
    background-attachment: fixed;
}

/* Allow normal document scrolling on standard app pages (overrides style.css clip) */
html:has(body[data-page="legal"]), body[data-page="legal"] {
    overflow-y: auto;
    overflow-x: hidden;
}
html.app-scroll, body.app-scroll {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}
body.app-scroll {
    color: #e6eef0;
}

.modal-overlay[hidden] { display: none !important; }
[hidden] { display: none !important; }

/* ----------------------------- Navbar ----------------------------- */
.app-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: var(--bg-nav);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 9000;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}
.nav-inner {
    max-width: calc(100% - 32px);
    height: 100%;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    gap: 8px;
}
.nav-brand {
    color: var(--main-color);
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: 0.5px;
    text-decoration: none;
    text-shadow: 0 0 12px var(--standard-glow);
    white-space: nowrap;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-links a, .nav-bell {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border-radius: 0.55rem;
    color: var(--offline-txt-color);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.92rem;
    transition: color 0.15s, background 0.15s;
    position: relative;
}
.nav-links a i, .nav-bell i { font-size: 1.05rem; }
.nav-links a:hover, .nav-bell:hover { color: var(--main-color); background: rgba(255,255,255,0.04); }
.nav-links a.active { color: var(--main-color); }
.nav-links a.active::after {
    content: '';
    position: absolute;
    left: 12px; right: 12px; bottom: -2px;
    height: 2px;
    background: var(--main-color);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--standard-glow);
}
.nav-badge {
    position: absolute;
    top: 2px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #ff4d6d;
    color: #fff;
    font-size: 0.66rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    box-shadow: 0 0 6px rgba(255,77,109,0.6);
}

/* Profile dropdown */
.nav-profile { position: relative; }
.nav-avatar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 2rem;
    color: var(--offline-txt-color);
}
.nav-avatar-btn:hover { background: rgba(255,255,255,0.04); color: var(--main-color); }
.nav-avatar-btn img.pfp {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--accent-dark);
}
.nav-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--bg-modal);
    border: 1px solid var(--accent-dark);
    border-radius: 0.6rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 9500;
}
.nav-dropdown a, .nav-dropdown button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #c8d4d8;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.92rem;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}
.nav-dropdown a:hover, .nav-dropdown button:hover { background: var(--bg-row-hover); color: var(--main-color); }
.nav-dropdown button#navLogout:hover { color: #ff6b6b; }
.nav-dropdown i { width: 16px; text-align: center; }

@media only screen and (max-width: 750px) {
    body[data-page="mc-home"] .nav-brand, body[data-page="mc-bounties"] .nav-brand {
        display: none;
    }
    body[data-page="mc-home"] .nav-inner {
        justify-content: flex-end;
    }
    body:not([data-page="mc-home"]) .nav-inner {
        justify-content: space-between;
    }
}

/* ----------------------------- Page shell ----------------------------- */
.app-main {
    max-width: 700px;
    margin: 0 auto;
    padding: 78px 16px 40px;
    box-sizing: border-box;
    min-height: 100vh;
}
body[data-page="report"] .app-main {
    max-width: calc(100% - 256px);
}
.page-title {
    color: var(--main-color);
    margin: 4px 0 18px;
    font-size: 1.5rem;
}
body[data-page="report"] .app-main .page-title {
    text-align: center;
    width: 100%;
    padding: 0;
}

/* ----------------------------- Footer ----------------------------- */
.app-footer {
    border-top: 1px solid rgba(255,255,255,0.06);
    background: var(--bg-nav);
    margin-top: 24px;
}
.footer-inner {
    max-width: 940px;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--offline-txt-color);
    font-size: 0.78rem;
    height: fit-content;
}
.footer-inner a {
    color: var(--offline-txt-color);
    text-decoration: none;
    position: relative;
}
.footer-inner a:hover,
.footer-socials button:hover {
    color: var(--main-color);
}
.footer-inner a::after,
.footer-socials button::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translate(-50%, 0);
    height: 2px;
    background-color: white;
    color: white;
    pointer-events: none;
    width: 0;
    overflow: clip;
    transition: all 0.25s ease;
}
.footer-inner a:hover::after,
.footer-socials button:hover::after {
    width: 100%;
}
.footer-ver {
    opacity: 0.35;
    position: fixed;
    z-index: 9999;
    bottom: 1vh;
    right: 1vw;
    mix-blend-mode: difference;
    font-size: 6px;
    pointer-events: none;
}
.footer-inner .footer-section {
    width: 90%;
    height: fit-content;
    margin: 0;
    padding: 10px 0;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
}
.footer-inner .footer-section:first-child {
    border-bottom: 1px solid var(--main-color);
}
.footer-section .footer-logo, .footer-section .footer-nav {
    width: fit-content;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    cursor: default;
}
.footer-logo img {
    width: 100%;
    max-width: 256px;
    height: auto;
    margin-bottom: -5vh;
    pointer-events: none;
}
.footer-nav a {
    margin-bottom: 10px;
}
.footer-nav .footer-nav-name {
    font-size: 150%;
    font-weight: 800;
    filter: brightness(125%);
    height: fit-content;
    min-height: 6vh;
    margin-bottom: 2vh;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}
.footer-nav .nav-links-con {
    width: 100%;
    height: 12vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}
.footer-section .footer-socials {
    width: fit-content;
    min-width: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: row;
    cursor: default;
}
.footer-socials a, .footer-socials a i,
.footer-socials button, .footer-socials button i {
    cursor: pointer;
}
.footer-socials a, .footer-socials button {
    margin: 0 1vw;
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
@media only screen and (max-width: 675px) {
    .footer-inner .footer-section {
        flex-direction: column;
        justify-content: center;
    }
}

/* ----------------------------- Feed ----------------------------- */
.composer {
    background: var(--bg-modal);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 0.85rem;
    padding: 14px;
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    box-shadow: 0 0 24px var(--modal-glow);
}
.composer img.pfp {
    width: 42px; height: 42px; border-radius: 50%; object-fit: cover;
    border: 1px solid var(--accent-dark); flex-shrink: 0;
}
.composer-body { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.composer textarea {
    width: 100%;
    resize: none;
    background: var(--input-dark);
    border: none;
    outline: 1px solid transparent;
    border-radius: 0.6rem;
    color: #fff;
    padding: 10px 12px;
    font-size: 0.95rem;
    box-sizing: border-box;
    min-height: 46px;
    font-family: inherit;
}
.composer textarea:focus { outline: 1px solid var(--accent-mid); }
.composer-actions { display: flex; align-items: center; justify-content: space-between; }
.composer-count { font-size: 0.75rem; color: var(--offline-txt-color); }
.btn-primary {
    background: var(--btn-bg);
    color: var(--main-color);
    border: none;
    outline: 2px solid var(--btn-border);
    border-radius: 2rem;
    padding: 9px 22px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
}
.btn-primary:hover { background: var(--btn-bg-hover); outline-color: var(--btn-border-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.feed { display: flex; flex-direction: column; gap: 14px; }
.post {
    background: var(--bg-modal);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 0.85rem;
    padding: 14px 16px;
}
.post-head { display: flex; align-items: center; gap: 10px; }
.post-head img.pfp {
    width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
    border: 1px solid var(--accent-dark); cursor: pointer;
}
.post-meta { display: flex; flex-direction: column; line-height: 1.2; }
.post-author { color: var(--main-color); font-weight: 600; cursor: pointer; text-decoration: none; }
.post-author:hover { text-decoration: underline; }
.post-handle { color: var(--offline-txt-color); font-size: 0.78rem; }
.post-time { color: var(--offline-txt-color); font-size: 0.75rem; margin-left: auto; }
.post-body {
    color: #e6eef0;
    margin: 10px 0 12px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.55;
}
.post-body p { margin: 0 0 0.55em; }
.post-body p:last-child { margin-bottom: 0; }
.post-body h1, .post-body h2, .post-body h3,
.post-body h4, .post-body h5, .post-body h6 {
    font-weight: 700;
    line-height: 1.2;
    color: #f0f6f8;
    margin: 0.7em 0 0.3em;
}
.post-body h1 { font-size: 1.3em; }
.post-body h2 { font-size: 1.15em; }
.post-body h3 { font-size: 1.05em; }
.post-body h4, .post-body h5, .post-body h6 { font-size: 0.95em; }
.post-body code {
    background: rgba(255,255,255,0.09);
    border-radius: 4px;
    padding: 0.1em 0.38em;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.86em;
    color: #d4d4d4;
}
.post-body pre {
    background: rgba(0,0,0,0.45);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 0.8em 1em;
    overflow-x: auto;
    margin: 0.55em 0;
}
.post-body pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: 0.85em;
    color: #d4d4d4;
}
.post-body blockquote {
    border-left: 3px solid #4e9aff;
    margin: 0.5em 0;
    padding: 0.3em 0.85em;
    color: var(--offline-txt-color);
    font-style: italic;
}
.post-body ul, .post-body ol { padding-left: 1.5em; margin: 0.3em 0; }
.post-body li { margin: 0.15em 0; }
.post-body hr {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 0.8em 0;
}
.post-body a { color: #4e9aff; text-decoration: underline; word-break: break-all; }
.post-body a:hover { color: #7ab8ff; }
.post-body del, .post-body s { opacity: 0.6; }
.post-body strong, .post-body b { font-weight: 700; }
.post-body em, .post-body i { font-style: italic; }
.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5em 0;
    font-size: 0.88em;
}
.post-body th, .post-body td {
    border: 1px solid rgba(255,255,255,0.12);
    padding: 0.3em 0.65em;
    text-align: left;
}
.post-body th { background: rgba(255,255,255,0.06); font-weight: 600; }
.post-actions { display: flex; align-items: center; gap: 18px; }
.like-btn, .post-delete {
    background: none; border: none; cursor: pointer;
    color: var(--offline-txt-color);
    display: flex; align-items: center; gap: 7px;
    font-size: 0.9rem; padding: 2px 0;
    transition: color 0.15s, transform 0.1s;
}
.like-btn:hover { color: #ff4d6d; }
.like-btn.liked { color: #ff4d6d; }
.like-btn.liked i { font-weight: 900; }
.like-btn:active { transform: scale(1.15); }
.post-delete { margin-left: auto; }
.post-delete:hover { color: #ff6b6b; }

.feed-empty, .feed-loading {
    text-align: center;
    color: var(--offline-txt-color);
    padding: 40px 16px;
    font-size: 0.95rem;
}

/* ----------------------------- Notifications modal ----------------------------- */
.noti-modal-box { max-width: 420px; gap: 0.75rem; }
.noti-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.noti-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-row);
    border-radius: 0.6rem;
    cursor: pointer;
    border: none;
    width: 100%;
    text-align: left;
    color: #c8d4d8;
}
.noti-item:hover { background: var(--bg-row-hover); }
.noti-item img.pfp { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 1px solid var(--accent-dark); flex-shrink: 0; }
.noti-item-body { flex: 1; min-width: 0; }
.noti-item-title { color: var(--main-color); font-weight: 600; font-size: 0.9rem; display: flex; justify-content: space-between; gap: 8px; }
.noti-item-count {
    background: #ff4d6d; color: #fff; font-size: 0.7rem; font-weight: 700;
    border-radius: 10px; padding: 1px 7px; flex-shrink: 0;
}
.noti-item-preview {
    color: var(--offline-txt-color);
    font-size: 0.82rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.noti-empty { text-align: center; color: var(--offline-txt-color); padding: 24px 8px; }

/* ----------------------------- Profile page ----------------------------- */
.profile-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--bg-modal);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 0.85rem;
    padding: 22px;
    margin-bottom: 22px;
}
.profile-identity {
    display: flex;
    align-items: center;
    gap: 18px;
}
.profile-header img.pfp {
    width: 92px; height: 92px; border-radius: 50%; object-fit: cover;
    border: 2px solid var(--accent-dark); flex-shrink: 0;
}
.profile-info { flex: 1; min-width: 0; }
.profile-name { color: var(--main-color); font-size: 1.4rem; font-weight: 700; margin: 0; }
.profile-handle { color: var(--offline-txt-color); font-size: 0.9rem; margin: 2px 0 6px; display: block; }
.profile-presence { font-size: 0.8rem; color: var(--offline-txt-color); display: inline-flex; align-items: center; gap: 6px; }
.profile-presence .dot { width: 9px; height: 9px; border-radius: 50%; background: #808080; }
.profile-presence.online .dot { background: #00a800; }
.profile-bio { font-size: 0.9rem; color: var(--text-color); margin: 10px 0 0; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.section-label { color: var(--offline-txt-color); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 12px 2px; }
.profile-actions-row {
    display: flex;
    flex-direction: row;
    gap: 10px;
    flex-wrap: wrap;
}
.profile-action {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    background: var(--accent-dark); color: var(--accent-lightest);
    border: 1px solid var(--btn-border); border-radius: 0.6rem;
    padding: 9px 16px; font-size: 0.9rem; font-weight: 600;
    font-family: inherit;
    text-decoration: none; cursor: pointer; transition: background 0.15s;
    white-space: nowrap;
    box-sizing: border-box;
}
.profile-action:hover { background: var(--accent-dark-hover); }
.profile-action-block {
    background: rgba(200, 50, 50, 0.12);
    color: #ff7272;
    border-color: rgba(200, 50, 50, 0.3);
}
.profile-action-block:hover { background: rgba(200, 50, 50, 0.22); }
.profile-action-block.blocked {
    background: rgba(200, 50, 50, 0.25);
    color: #ff4f4f;
    border-color: rgba(200, 50, 50, 0.5);
}
@media only screen and (max-width: 640px) {
    .profile-actions-row { flex-direction: column; }
    .profile-action { width: 100%; }
}

/* ----------------------------- Settings page ----------------------------- */
.settings-card {
    background: var(--bg-modal);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 0.85rem;
    padding: 18px;
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.settings-card h3 { margin: 0; color: var(--main-color); font-size: 1.05rem; }

/* ----------------------------- Cropper modal ----------------------------- */
.crop-modal-box {
    background: var(--bg-modal);
    border: 1px solid var(--accent-dark);
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 0 30px var(--modal-glow);
    align-items: center;
    width: 90%;
    max-width: 360px;
}
.crop-modal-header { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.crop-hint { color: var(--offline-txt-color); font-size: 0.8rem; }
.crop-modal-actions { display: flex; gap: 0.75rem; width: 100%; }
#cropCanvas { border-radius: 8px; cursor: grab; display: block; width: 100%; max-width: 320px; touch-action: none; }
#cropCanvas:active { cursor: grabbing; }
.crop-zoom-row { display: flex; align-items: center; gap: 0.5rem; width: 100%; }
.crop-zoom-row input[type=range] { flex: 1; accent-color: var(--main-color); }
.crop-zoom-label { color: var(--offline-txt-color); font-size: 0.8rem; white-space: nowrap; }

/* Inline theme swatches on settings page */
.settings-card .theme-swatches { flex-wrap: wrap; }

/* ----------------------------- Legal pages ----------------------------- */
.legal-page { max-width: 760px; margin: 0 auto; padding: 48px 22px 80px; color: #cdd8da; line-height: 1.7; }
.legal-brand { display: block; color: var(--main-color); font-weight: 800; font-size: 1.4rem; letter-spacing: 0.5px; text-decoration: none; text-shadow: 0 0 12px var(--standard-glow); margin-bottom: 28px; }
.legal-page h1 { color: var(--main-color); font-size: 1.8rem; margin: 0 0 6px; }
.legal-updated { color: var(--offline-txt-color); font-size: 0.85rem; margin-bottom: 28px; }
.legal-page h2 { color: var(--accent-bright); font-size: 1.15rem; margin: 28px 0 8px; }
.legal-page p, .legal-page li { font-size: 0.95rem; }
.legal-page ul { padding-left: 22px; }
.legal-back { display: inline-block; margin-top: 36px; color: var(--main-color); text-decoration: none; }
.legal-back:hover { text-decoration: underline; }

/* ----------------------------- Messages page shell ----------------------------- */
/* Must establish a fixed, bounded container so the DM sidebar and
   messages-container (height:100% / overflow-y:auto) have a real height to work from.
   Without this the chat-con's height:90% has no anchor and user cards shrink/mismatch. */
.messages-shell {
    position: fixed;
    top: 60px;   /* below fixed navbar */
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}
.messages-shell .chat-con {
    width: 100%;
    height: 100%;   /* override chat.css's 90% — shell already excludes the navbar */
}

/* ----------------------------- Verified badge ----------------------------- */
.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    margin-left: 0.32em;
    border-radius: 50%;
    background: #1d9bf0;
    color: #fff;
    font-size: 0.82em;
    vertical-align: middle;
    flex-shrink: 0;
}
.verified-badge i { font-size: 0.62em; line-height: 1; }

/* ----------------------------- Premium badge ----------------------------- */
.premium-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    margin-left: 0.32em;
    border-radius: 50%;
    background: #d4a017;
    color: #fff;
    font-size: 0.82em;
    vertical-align: middle;
    flex-shrink: 0;
}
.premium-badge i { font-size: 0.62em; line-height: 1; }

/* ----------------------------- Admin moderation controls ----------------------------- */
.admin-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.85rem;
}
.admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.admin-btn.ban { background: rgba(255, 76, 76, 0.12); color: #ff6b6b; border-color: rgba(255, 76, 76, 0.35); }
.admin-btn.ban:hover { background: rgba(255, 76, 76, 0.22); }
.admin-btn.suspend { background: rgba(255, 184, 0, 0.12); color: #ffc24b; border-color: rgba(255, 184, 0, 0.35); }
.admin-btn.suspend:hover { background: rgba(255, 184, 0, 0.22); }
.admin-btn.unban { background: rgba(0, 200, 120, 0.12); color: #4fd99a; border-color: rgba(0, 200, 120, 0.35); }
.admin-btn.unban:hover { background: rgba(0, 200, 120, 0.22); }
.admin-btn.promote { background: rgba(29, 155, 240, 0.12); color: #6fc3ff; border-color: rgba(29, 155, 240, 0.35); }
.admin-btn.promote:hover { background: rgba(29, 155, 240, 0.22); }

/* ----------------------------- Promote modal ----------------------------- */
#promoteModal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    padding: 1rem;
}
.promote-modal {
    width: 100%;
    max-width: 360px;
    background: var(--bg-nav, #161b22);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 1.4rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.promote-modal h2 { margin: 0 0 0.3rem; font-size: 1.15rem; }
.promote-modal p { margin: 0 0 1rem; font-size: 0.9rem; opacity: 0.75; }
.promote-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.promote-actions .admin-btn { justify-content: center; padding: 0.65rem 0.9rem; }
.promote-cancel {
    margin-top: 1rem;
    width: 100%;
    padding: 0.55rem;
    border: none;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.07);
    color: #e6eef0;
    font-weight: 600;
    cursor: pointer;
}
.promote-cancel:hover { background: rgba(255, 255, 255, 0.12); }

.profile-mod-banner {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: 0.85rem;
    padding: 0.7rem 0.95rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.4;
}
.profile-mod-banner.banned { background: rgba(255, 76, 76, 0.12); color: #ff8a8a; border: 1px solid rgba(255, 76, 76, 0.3); }
.profile-mod-banner.suspended { background: rgba(255, 184, 0, 0.1); color: #ffce6b; border: 1px solid rgba(255, 184, 0, 0.3); }

/* ----------------------------- Post attachments ----------------------------- */
.post-attachment { margin-top: 10px; }
.post-attachment-img {
    max-width: 100%; height: auto; border-radius: 0.6rem;
    border: 1px solid rgba(255,255,255,0.07);
    display: block; max-height: 420px; object-fit: contain;
}
.post-attachment-file {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--bg-row); border-radius: 0.55rem;
    padding: 8px 14px; color: var(--main-color); text-decoration: none;
    font-size: 0.88rem; border: 1px solid rgba(255,255,255,0.07);
    transition: background 0.15s; max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.post-attachment-file:hover { background: var(--bg-row-hover); }
.post-attachment-file i { color: var(--accent-light); flex-shrink: 0; }

/* Composer attachment controls */
.composer-attach-btn {
    background: none; border: none; cursor: pointer;
    color: var(--offline-txt-color); font-size: 1rem;
    padding: 6px 8px; border-radius: 0.4rem;
    transition: color 0.15s, background 0.15s;
    display: inline-flex; align-items: center;
}
.composer-attach-btn:hover { color: var(--main-color); background: rgba(255,255,255,0.04); }
.composer-attach-preview {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-row); border-radius: 0.5rem; padding: 7px 10px;
    font-size: 0.85rem; margin-bottom: 2px;
}
.composer-attach-preview i { color: var(--accent-light); font-size: 1rem; flex-shrink: 0; }
.composer-attach-preview span {
    flex: 1; min-width: 0; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; color: var(--main-color);
}
.composer-attach-preview button {
    background: none; border: none; cursor: pointer;
    color: var(--offline-txt-color); padding: 2px 5px;
    border-radius: 0.3rem; font-size: 0.85rem; transition: color 0.15s;
}
.composer-attach-preview button:hover { color: #ff6b6b; }

/* ----------------------------- Moderation modal ----------------------------- */
.mod-modal-box { max-width: 480px; gap: 0; padding: 0; overflow: hidden; }
.mod-modal-box .modal-header { padding: 1.1rem 1.4rem; border-bottom: 1px solid rgba(255,255,255,0.07); }
.mod-modal-body { display: flex; flex-direction: column; padding: 0.5rem 0; }
.mod-section {
    padding: 0.9rem 1.4rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.mod-section:last-child { border-bottom: none; }
.mod-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--offline-txt-color);
    margin: 0 0 0.65rem;
}
.mod-section-btns { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.mod-open-btn { cursor: pointer; }

/* Extra admin-btn variants */
.admin-btn.demote { background: rgba(255, 120, 0, 0.12); color: #ffab5e; border-color: rgba(255, 120, 0, 0.35); }
.admin-btn.demote:hover { background: rgba(255, 120, 0, 0.22); }
.admin-btn.free-premium-add { background: rgba(255, 213, 0, 0.12); color: #ffe066; border-color: rgba(255, 213, 0, 0.35); }
.admin-btn.free-premium-add:hover { background: rgba(255, 213, 0, 0.22); }
.admin-btn.free-premium-remove { background: rgba(160, 100, 0, 0.12); color: #c9a040; border-color: rgba(160, 100, 0, 0.35); }
.admin-btn.free-premium-remove:hover { background: rgba(160, 100, 0, 0.22); }

/* ----------------------------- Post comments ----------------------------- */
.post-comments {
    border-top: 1px solid rgba(255,255,255,0.06);
    margin-top: 10px;
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.post-comments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.comment-item {
    display: flex;
    gap: 9px;
    align-items: flex-start;
}
.comment-pfp {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--accent-dark);
    flex-shrink: 0;
    margin-top: 1px;
}
.comment-body {
    flex: 1;
    min-width: 0;
    background: var(--bg-row);
    border-radius: 0.55rem;
    padding: 7px 10px;
}
.comment-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3px;
}
.comment-author {
    color: var(--main-color);
    font-weight: 600;
    font-size: 0.82rem;
    text-decoration: none;
}
.comment-author:hover { text-decoration: underline; }
.comment-delete {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--offline-txt-color);
    padding: 1px 4px;
    border-radius: 0.3rem;
    font-size: 0.8rem;
    transition: color 0.15s;
    line-height: 1;
}
.comment-delete:hover { color: #ff6b6b; }
.comment-text {
    font-size: 0.88rem;
    color: #e6eef0;
    line-height: 1.45;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}
.comments-loading, .comments-empty {
    color: var(--offline-txt-color);
    font-size: 0.82rem;
    text-align: center;
    padding: 8px 0;
}
.post-comment-form {
    display: flex;
    gap: 7px;
    align-items: center;
    padding-top: 4px;
}
.comment-input {
    flex: 1;
    background: var(--input-dark);
    border: none;
    outline: 1px solid transparent;
    border-radius: 1.5rem;
    color: #fff;
    padding: 7px 13px;
    font-size: 0.88rem;
    font-family: inherit;
}
.comment-input:focus { outline: 1px solid var(--accent-mid); }
.comment-submit {
    background: var(--btn-bg);
    color: var(--main-color);
    border: none;
    outline: 1px solid var(--btn-border);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    flex-shrink: 0;
    transition: background 0.15s;
}
.comment-submit:hover { background: var(--btn-bg-hover); }
.comment-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.comment-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--offline-txt-color);
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.9rem;
    padding: 2px 0;
    transition: color 0.15s;
}
.comment-btn:hover { color: var(--main-color); }

/* ----------------------------- DM swipe-to-delete + context menu ----------------------------- */
.dm-convo-wrap {
    overflow: hidden;
    border-radius: 0.65rem;
}
.dm-convo-slide {
    display: flex;
    align-items: stretch;
    min-width: calc(100% + 72px);
    will-change: transform;
}
.dm-convo-wrap .dm-convo {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    border-radius: 0;
}
.dm-swipe-delete {
    flex: 0 0 72px;
    min-width: 72px;
    background: #c0392b;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: background 0.15s;
}
.dm-swipe-delete:hover { background: #e74c3c; }
.dm-context-menu {
    position: fixed;
    z-index: 99999;
    background: var(--bg-modal);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0.55rem;
    box-shadow: 0 6px 24px rgba(0,0,0,0.5);
    min-width: 190px;
    overflow: hidden;
}
.dm-ctx-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 11px 15px;
    background: none;
    border: none;
    color: #c8d4d8;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: left;
}
.dm-ctx-item:hover { background: var(--bg-row-hover); }
.dm-ctx-delete { color: #ff6b6b; }
.dm-ctx-delete:hover { background: rgba(255,76,76,0.1); }

/* ----------------------------- Feed ads ----------------------------- */
.feed-ad {
    background: var(--bg-row);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 0.75rem;
    padding: 1rem 1.1rem;
    margin: 0.5rem 0;
    position: relative;
}
.feed-ad-label {
    position: absolute;
    top: 0.55rem;
    right: 0.8rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--offline-txt-color);
    opacity: 0.6;
}
.feed-ad-content { min-height: 60px; }

/* ----------------------------- External link warning modal ----------------------------- */
#linkWarnOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 99000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.link-warn-box {
    background: var(--bg-modal, #1e2a30);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 1rem;
    padding: 1.5rem 1.6rem 1.3rem;
    max-width: 420px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.link-warn-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--main-color);
    margin: 0;
}
.link-warn-msg {
    font-size: 0.9rem;
    color: #c8d4d8;
    margin: 0;
    line-height: 1.45;
}
.link-warn-url {
    font-size: 0.78rem;
    color: #4e9aff;
    background: rgba(78,154,255,0.08);
    border: 1px solid rgba(78,154,255,0.2);
    border-radius: 6px;
    padding: 0.4rem 0.65rem;
    word-break: break-all;
    max-height: 4.5em;
    overflow: hidden;
}
.link-warn-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 0.25rem;
}
.link-warn-cancel, .link-warn-go {
    border: none;
    border-radius: 0.55rem;
    padding: 0.5rem 1.2rem;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.link-warn-cancel {
    background: rgba(255,255,255,0.07);
    color: #c8d4d8;
}
.link-warn-cancel:hover { background: rgba(255,255,255,0.12); }
.link-warn-go {
    background: #4e9aff;
    color: #fff;
}
.link-warn-go:hover { background: #3a87f0; }

/* ----------------------------- Feed pagination ----------------------------- */
.feed-footer {
    display: flex;
    justify-content: center;
    padding: 1.2rem 0 0.4rem;
}
.load-more-btn {
    background: var(--bg-row);
    color: var(--main-color);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 2rem;
    padding: 0.55rem 1.6rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s;
}
.load-more-btn:hover:not(:disabled) {
    background: var(--bg-row-hover);
    border-color: rgba(255,255,255,0.2);
}
.load-more-btn:disabled { opacity: 0.5; cursor: default; }
.feed-end {
    color: var(--offline-txt-color);
    font-size: 0.85rem;
    text-align: center;
    padding: 0.25rem 0 0.5rem;
}
.feed-loading-more {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.6rem 0;
    color: var(--offline-txt-color);
    font-size: 1.1rem;
}

/* ----------------------------- DM older-message loader ----------------------------- */
.dm-older-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--offline-txt-color);
    font-size: 0.82rem;
    padding: 0.6rem 0 0.2rem;
}
.dm-older-loader i { font-size: 0.85rem; }

/* ----------------------------- Responsive ----------------------------- */
@media only screen and (max-width: 640px) {
    .nav-brand { font-size: 1rem; }
    .nav-links a span, .nav-bell span:not(.nav-badge) { display: none; }
    .nav-links a, .nav-bell { padding: 8px 9px; }
    .nav-avatar-btn .fa-caret-down { display: none; }
    .app-main { padding-top: 72px; }
}
@media only screen and (max-width: 750px) {
    body[data-page="mc-home"] .nav-brand { font-size: 1rem; }
    body[data-page="mc-home"] .nav-links a span, .nav-bell span:not(.nav-badge) { display: none; }
    body[data-page="mc-home"] .nav-links a, .nav-bell { padding: 8px 9px; }
    body[data-page="mc-home"] .nav-avatar-btn .fa-caret-down { display: none; }
    body[data-page="mc-home"] .app-main { padding-top: 72px; }
    body[data-page="mc-bounties"] .nav-brand { font-size: 1rem; }
    body[data-page="mc-bounties"] .nav-links a span, .nav-bell span:not(.nav-badge) { display: none; }
    body[data-page="mc-bounties"] .nav-links a, .nav-bell { padding: 8px 9px; }
    body[data-page="mc-bounties"] .nav-avatar-btn .fa-caret-down { display: none; }
    body[data-page="mc-bounties"] .app-main { padding-top: 72px; }
}

/* ----------------------------- Profile tabs ----------------------------- */
.profile-tabs {
    display: flex;
    gap: 20px;
    padding: 2px 2px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 12px;
}
.profile-tab {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--offline-txt-color);
    font-size: 0.85rem;
    font-family: inherit;
    text-decoration: none;
    transition: color 0.15s;
}
.profile-tab:hover { color: var(--main-color); }
.profile-tab.active { color: var(--main-color); text-decoration: underline; }

/* ----------------------------- Profile followers label ----------------------------- */
.profile-followers {
    font-size: 0.8rem;
    color: var(--offline-txt-color);
    margin-top: 4px;
    display: inline-block;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    text-decoration: underline dotted;
    text-underline-offset: 3px;
}
.profile-followers:hover { color: var(--accent-color); }

/* ----------------------------- Followers modal ----------------------------- */
#followersModal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
}
#followersModal[hidden] { display: none !important; }
.followers-modal-box {
    background: var(--card-bg, #1e1e1e);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    width: min(420px, 92vw);
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.followers-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    font-weight: 600;
    font-size: 0.95rem;
}
.followers-modal-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0.6;
    padding: 0 0.2rem;
}
.followers-modal-close:hover { opacity: 1; }
.followers-modal-body {
    overflow-y: auto;
    flex: 1;
    padding: 0.5rem 0;
}
.followers-modal-empty {
    text-align: center;
    color: var(--offline-txt-color);
    padding: 2rem 1rem;
    font-size: 0.9rem;
}
.follower-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.2rem;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}
.follower-item:hover { background: rgba(255,255,255,0.05); }
.follower-item img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.follower-item-info { display: flex; flex-direction: column; min-width: 0; }
.follower-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.follower-item-handle {
    font-size: 0.78rem;
    color: var(--offline-txt-color);
}

/* ===== Blur Styles (For Transparent Containers) + Cancel (Hide) Page Title ===== */
.page-title {
    height: 0;
    width: 0;
    overflow: clip;
    margi-bottom: 4vh;
}
.settings-card, .post, .composer,
.profile-header, .server-status-card,
.modpack-card, .bounty-card {
    background-color: var(--bg-modal-trans);
    backdrop-filter: blur(3px);
    box-shadow:
        0px 0px 4px 1px var(--bg-modal),
        inset 0px 0px 2px -2px rgba(255, 255, 255, 1);
}
.dm-convo-wrap {
    backdrop-filter: blur(4px) brightness(150%);
    border-radius: 0;
}
.dm-search {
    backdrop-filter: blur(4px) brightness(150%);
}
.bounty-form {
    background: linear-gradient(rgba(20,20,20,0.3), rgba(0,0,0,0.3)) padding-box,
    linear-gradient(145deg, transparent 35%,rgba(255,255,255,0.2), rgba(255,255,255,0.3)) border-box;
    backdrop-filter: blur(3px) brightness(115%);
    
}
.bounty-card.completed .bounty-complete-overlay,
.bounty-card.completed {
    backdrop-filter: blur(8px) brightness(75%);
    filter: grayscale(1);
}

/* ── Share modal ── */
.share-modal-box { max-width: 420px; gap: 1rem; }
.share-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.share-option-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: var(--main-color);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.share-option-btn i { font-size: 1.35rem; }
.share-option-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
}
.share-embed-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.share-embed-label {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.45);
}
.share-embed-code {
    width: 100%;
    box-sizing: border-box;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 5px;
    color: #cdd6da;
    font-family: monospace;
    font-size: 0.78rem;
    padding: 8px 10px;
    resize: none;
}
.share-link-row {
    display: flex;
    gap: 8px;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.07);
    padding-top: 12px;
}
.share-link-input {
    flex: 1;
    min-width: 0;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 5px;
    color: #cdd6da;
    font-size: 0.82rem;
    padding: 7px 10px;
    outline: none;
}
.share-copy-btn {
    background: rgba(0,251,255,0.1);
    border: 1px solid rgba(0,251,255,0.25);
    color: #00fbff;
    border-radius: 5px;
    padding: 7px 14px;
    font-size: 0.82rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    flex-shrink: 0;
}
.share-copy-btn:hover { background: rgba(0,251,255,0.2); }