/* ============================================================
   wall-modern.css — the modern look for the Wall and Leaderboards.
   Loads AFTER wall.css and ub-theme.css (colours come from ub-theme.css).

   Design language
   - Layered navy cards with soft depth, 20px corners, tinted accents.
   - A single feed dropdown (default All) + a Tags search button.
   - Story-style rings for the people you follow, avatar rings on posts.
   - Pill actions, a floating "write" button on phones, big tap targets.
   - Leaderboards: hero + group tabs, podium for the top 3, ranked rows
     with progress bars, "YOU" highlight, friendly empty states.
   - Same 680px column as the Ultimate Bible "Today" page.

   TO UNDO: remove the wall-modern.css / ub-theme.css <link> lines.
   ============================================================ */

:root {
    --wm-radius: 20px;
    --wm-gap: 12px;
    --wm-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 28px rgba(0,0,0,.28);
    --wm-grad: linear-gradient(135deg, var(--ub-gold, #ffc940), var(--ub-accent, #38b6f5));
    --wm-bar: rgba(11,21,32,.82);
    --wm-safe-b: env(safe-area-inset-bottom, 0px);
    --wm-safe-l: env(safe-area-inset-left, 0px);
    --wm-safe-r: env(safe-area-inset-right, 0px);
    --wm-gold: #ffc940; --wm-silver: #c9d3dc; --wm-bronze: #e0955b;
}
body.light-theme {
    --wm-shadow: 0 1px 2px rgba(80,60,10,.06), 0 8px 24px rgba(80,60,10,.07);
    --wm-bar: rgba(250,246,234,.86);
    --wm-gold: #e6a800; --wm-silver: #8d99a5; --wm-bronze: #b8692a;
}

html { -webkit-text-size-adjust: 100%; }
body { font-size: 17px; -webkit-tap-highlight-color: transparent; padding-bottom: calc(96px + var(--wm-safe-b)); overflow-x: hidden; }
button, a, summary { touch-action: manipulation; }

/* ---------- the column ---------- */
.wall-container, .wall-load, .lb-wrap, .wall-hero {
    max-width: 680px; width: 100%; margin-left: auto; margin-right: auto; box-sizing: border-box;
    padding-left: calc(14px + var(--wm-safe-l)); padding-right: calc(14px + var(--wm-safe-r));
}
.wall-layout { display: block !important; max-width: none; margin: 0; padding: 0; gap: 0; }
.wall-feed { width: 100%; max-width: none; min-width: 0; }
.wall-header, .ub-hero { display: none !important; }      /* old headers, replaced by .wall-hero */

/* ============================================================
   WALL HERO (greeting)
   ============================================================ */
.wall-hero { margin-top: 16px; margin-bottom: 4px; }
.wh-card {
    position: relative; overflow: hidden; isolation: isolate;
    display: flex; align-items: center; gap: 18px; padding: 18px 16px;
    border-radius: 24px; border: 1px solid var(--ub-line, #22384c);
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(255,201,64,.16), transparent 55%),
        radial-gradient(120% 140% at 0% 100%, rgba(56,182,245,.16), transparent 55%),
        var(--ub-card, #122130);
    box-shadow: var(--wm-shadow);
}
body.light-theme .wh-card {
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(240,168,24,.22), transparent 55%),
        radial-gradient(120% 140% at 0% 100%, rgba(10,114,178,.12), transparent 55%),
        var(--ub-card, #fff);
}
.wh-avatar {
    flex: none; width: 64px; height: 64px; border-radius: 50%;
    display: grid; place-items: center; font-weight: 800; font-size: 1.5rem; color: #1a1410;
    background: var(--wm-grad) center / cover; box-shadow: 0 0 0 4px var(--ub-card, #122130), 0 0 0 7px var(--wm-gold);
}
.wh-text { min-width: 0; flex: 1; }
.wh-eyebrow { white-space: nowrap; font-size: 1.1rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ub-mut, #a3b5c5); font-weight: 700; }
.wh-eyebrow .ub-jud { font-family: 'Manakahthey', serif; letter-spacing: 0; font-size: 1.25em; color: var(--ub-accent, #38b6f5); margin-inline-end: 4px; text-transform: none; }
.wh-title { margin: 4px 0 0; font-family: var(--ub-head, 'Roboto Slab', Georgia, serif); font-size: 1.5rem; font-weight: 800; color: var(--ub-tx, #f4f1e6); line-height: 1.2; overflow-wrap: anywhere; }
#whName { font-family: 'Manakahthey', serif; font-weight: 400; font-size: 1.2em; letter-spacing: 0; color: var(--ub-accent, #38b6f5); }
.wh-sub { margin: 4px 0 0; font-size: .95rem; color: var(--ub-mut, #a3b5c5); }
.wh-actions { display: flex; gap: 8px; flex: none; }
.wh-btn {
    width: 54px; height: 54px; border-radius: 17px; display: grid; place-items: center; font-size: 1.6rem; text-decoration: none;
    background: var(--ub-tint, rgba(56,182,245,.14)); border: 1px solid var(--ub-line2, #2e4b64);
    transition: transform .15s, background .15s;
}
.wh-btn:hover { transform: translateY(-2px); background: var(--ub-tint2, rgba(255,201,64,.14)); }
.wh-actions { flex: none; display: flex; flex-direction: column; gap: 8px; }
.wh-shalom { min-height: 44px; padding: 0 16px; border-radius: 999px; font-size: 1rem; white-space: nowrap; cursor: pointer; }
@media (max-width: 560px) { .wh-avatar { width: 52px; height: 52px; font-size: 1.2rem; } .wh-title { font-size: 1.25rem; } .wh-sub { display: none; } .wh-eyebrow { font-size: 1rem; letter-spacing: .06em; } .wh-shalom { padding: 0 12px; font-size: .92rem; } }

/* ============================================================
   FEED SWITCHER — one dropdown (default "All") + a Tags button
   Phones: the list slides up as a bottom sheet. Desktop: a popover.
   ============================================================ */
.fs-wrap { position: relative; margin: 8px 0 var(--wm-gap); }   /* no z-index here: the sheet must sit above the nav bar */
.feed-switch { display: flex; gap: 8px; }
.fs-btn, .fs-tag {
    display: flex; align-items: center; gap: 14px; min-height: 68px; border-radius: 20px; cursor: pointer; font-family: inherit;
    background: var(--ub-card, #122130); border: 1px solid var(--ub-line, #22384c); color: var(--ub-tx, #f4f1e6); box-shadow: var(--wm-shadow);
    transition: border-color .15s, transform .12s;
}
.fs-btn:hover, .fs-tag:hover { border-color: var(--ub-accent, #38b6f5); }
.fs-btn:active, .fs-tag:active { transform: scale(.98); }
.fs-btn { flex: 1; min-width: 0; padding: 0 14px 0 12px; text-align: left; }
.fs-ico { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; background: var(--ub-tint, rgba(56,182,245,.14)); }
.fs-ico img, .fs-ico svg { max-width: 20px; max-height: 20px; }
.fs-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.fs-text small { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ub-mut, #a3b5c5); font-weight: 700; }
.fs-text b { font-size: 1.3rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-chev { flex: none; width: 9px; height: 9px; border-right: 2px solid var(--ub-mut, #a3b5c5); border-bottom: 2px solid var(--ub-mut, #a3b5c5); transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.fs-btn[aria-expanded="true"] .fs-chev { transform: rotate(-135deg) translateY(-2px); }
.fs-tag { flex: none; padding: 0 20px; font-weight: 800; font-size: 1.1rem; max-width: 46%; }
.fs-tag-ico { font-size: 1.35rem; }
.fs-tag #fsTagLabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-tag.on { background: var(--ub-tint2, rgba(255,201,64,.14)); border-color: var(--wm-gold, #ffc940); }

/* the list (this is the old tab row, now a menu) */
.wall-tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 2001; display: flex; flex-direction: column; gap: 2px;
    max-height: 78vh; overflow-y: auto; -webkit-overflow-scrolling: touch; margin: 0;
    padding: 14px 10px calc(14px + var(--wm-safe-b)); border: 1px solid var(--ub-line, #22384c); border-bottom: 0; border-radius: 26px 26px 0 0;
    background: var(--ub-card, #122130); box-shadow: 0 -18px 50px rgba(0,0,0,.45);
    transform: translateY(105%); visibility: hidden; transition: transform .26s cubic-bezier(.2,.9,.3,1), visibility 0s .26s;
}
.wall-tabs::before { content: ""; align-self: center; width: 42px; height: 5px; border-radius: 3px; background: var(--ub-line2, #2e4b64); margin-bottom: 8px; flex: none; }
.wall-tabs.open { transform: none; visibility: visible; transition: transform .26s cubic-bezier(.2,.9,.3,1), visibility 0s; }
.wall-tab {
    position: relative; flex: none; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 62px; padding: 0 14px;
    background: transparent; border: 0; border-radius: 14px; box-shadow: none; text-align: left; text-decoration: none; cursor: pointer;
    color: var(--ub-tx, #f4f1e6); font-family: inherit; font-weight: 700; font-size: 1.15rem; line-height: 1; transition: background .12s;
}
.wall-tab::after { display: none; }
.wall-tab:hover { background: var(--ub-tint, rgba(56,182,245,.14)); }
.wall-tab .tab-icon { flex: none; width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-size: 1.3rem; background: var(--ub-card2, #172a3c); }
.wall-tab .tab-text { flex: 1; }
.wall-tab.active { background: var(--ub-tint, rgba(56,182,245,.14)); color: var(--ub-tx, #f4f1e6); border: 0; }
.wall-tab.active::after { display: block; content: ""; width: 7px; height: 12px; margin-right: 6px; border-right: 3px solid var(--ub-accent, #38b6f5); border-bottom: 3px solid var(--ub-accent, #38b6f5); transform: rotate(45deg); }
body.light-theme .wall-tab.active { color: var(--ub-tx, #14212b) !important; }
.wall-tab-link { color: var(--ub-gold, #ffc940); border-top: 1px solid var(--ub-line, #22384c); border-radius: 0 0 14px 14px; margin-top: 4px; }
.support-badge { margin-left: auto; }

/* tag search panel */
.fs-panel {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 2001; max-height: 82vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 18px 16px calc(18px + var(--wm-safe-b)); border: 1px solid var(--ub-line, #22384c); border-bottom: 0; border-radius: 26px 26px 0 0;
    background: var(--ub-card, #122130); box-shadow: 0 -18px 50px rgba(0,0,0,.45);
    transform: translateY(105%); visibility: hidden; transition: transform .26s cubic-bezier(.2,.9,.3,1), visibility 0s .26s;
}
.fs-panel.open { transform: none; visibility: visible; transition: transform .26s cubic-bezier(.2,.9,.3,1), visibility 0s; }
.fs-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.fs-panel-head b { font-family: var(--ub-head, 'Roboto Slab', Georgia, serif); font-size: 1.1rem; }
.fs-x { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--ub-card2, #172a3c); color: var(--ub-mut, #a3b5c5); font-size: 1rem; cursor: pointer; }
.fs-search { width: 100%; box-sizing: border-box; height: 50px; padding: 0 16px; border-radius: 16px; font-size: 16px; font-family: inherit;
    background: var(--ub-card2, #172a3c); color: var(--ub-tx, #f4f1e6); border: 1px solid var(--ub-line2, #2e4b64); outline: none; }
.fs-search:focus { border-color: var(--ub-accent, #38b6f5); box-shadow: 0 0 0 3px var(--ub-tint, rgba(56,182,245,.14)); }
.fs-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.fs-tags .tag-pill {
    min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--ub-line2, #2e4b64); background: var(--ub-card2, #172a3c);
    color: var(--ub-tx, #f4f1e6); font-family: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.fs-tags .tag-pill:hover { border-color: var(--ub-accent, #38b6f5); }
.fs-tags .tag-pill-active { background: var(--ub-btn, #2aaef2); border-color: var(--ub-btn, #2aaef2); color: var(--ub-on-btn, #04202f); }
.fs-tags .tag-count { font-size: .72rem; opacity: .7; }
.fs-clear { display: block; width: 100%; min-height: 46px; margin-top: 14px; border: 1px solid var(--ub-line2, #2e4b64); border-radius: 14px; background: transparent; color: var(--ub-accent, #38b6f5); font-weight: 800; font-family: inherit; cursor: pointer; }

.fs-backdrop { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.55); opacity: 0; visibility: hidden; transition: opacity .2s, visibility 0s .2s; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.fs-backdrop.show { opacity: 1; visibility: visible; transition: opacity .2s; }
body.fs-lock { overflow: hidden; }

/* desktop: popovers under the buttons instead of bottom sheets */
@media (min-width: 700px) {
    .wall-tabs, .fs-panel { position: absolute; left: 0; right: auto; bottom: auto; top: calc(100% + 8px); width: 320px; max-height: min(70vh, 540px);
        border: 1px solid var(--ub-line2, #2e4b64); border-radius: 20px; padding: 8px; box-shadow: 0 24px 60px rgba(0,0,0,.45);
        transform: translateY(-6px); opacity: 0; transition: transform .18s, opacity .18s, visibility 0s .18s; }
    .wall-tabs.open, .fs-panel.open { transform: none; opacity: 1; transition: transform .18s, opacity .18s, visibility 0s; }
    .wall-tabs::before, .fs-x { display: none; }
    .fs-panel { right: 0; left: auto; width: 360px; padding: 16px; }
    .fs-backdrop { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ============================================================
   CARDS
   ============================================================ */
.sidebar-card, .feed-item, #postComposer, .state-container {
    background: var(--ub-card, #122130);
    border: 1px solid var(--ub-line, #22384c);
    border-radius: var(--wm-radius);
    box-shadow: var(--wm-shadow);
    color: var(--ub-tx, #f4f1e6);
}
.sidebar-card { padding: 16px; margin: 0 0 var(--wm-gap); }
.sidebar-card h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-family: var(--ub-head, 'Roboto Slab', Georgia, serif); font-size: 1.25rem; font-weight: 800; color: var(--ub-tx, #f4f1e6); }
.sidebar-subtitle { margin: 0 0 12px; font-size: .8rem; color: var(--ub-mut, #a3b5c5); }
.loading-small { color: var(--ub-mut, #a3b5c5); font-size: .85rem; text-align: center; padding: 10px 0; }

.sidebar-item { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 10px; border-radius: 14px; text-decoration: none; color: inherit; transition: background .12s; }
.sidebar-item:hover { background: var(--ub-tint, rgba(56,182,245,.14)); }
.sidebar-avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--ub-tint, rgba(56,182,245,.14)); color: var(--ub-accent, #38b6f5); background-size: cover; background-position: center; }
.sidebar-item-name { color: var(--ub-tx, #f4f1e6); font-weight: 700; font-size: .94rem; }
.sidebar-item-meta { color: var(--ub-mut, #a3b5c5); font-size: .8rem; }

/* ---------- stories strip: people you follow ---------- */
.flame-sidebar { padding: 14px 14px 12px; background: transparent; border: 0; box-shadow: none; }
.flame-sidebar h3 { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ub-mut, #a3b5c5); font-family: inherit; font-weight: 800; margin-bottom: 10px; }
.flame-sidebar .sidebar-subtitle { display: none; }
.flame-sidebar-list { display: flex; gap: 16px; overflow-x: auto; scrollbar-width: none; padding: 4px 4px 6px; -webkit-overflow-scrolling: touch; }
.flame-sidebar-list::-webkit-scrollbar { display: none; }
.flame-sidebar-list > p { margin: 0; font-size: .86rem !important; color: var(--ub-mut, #a3b5c5) !important; text-align: left !important; }
.flame-sidebar-avatar {
    flex: none; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
    font-weight: 800; font-size: 1.2rem; color: var(--ub-tx, #f4f1e6); text-decoration: none;
    background-color: var(--ub-card2, #172a3c); background-size: cover; background-position: center;
    box-shadow: 0 0 0 3px var(--ub-bg, #0b1520), 0 0 0 5.5px var(--wm-gold);
    transition: transform .15s;
}
.flame-sidebar-avatar:hover { transform: scale(1.06); }

/* ---------- collapsible quick boxes ---------- */
.ub-fold { background: var(--ub-card, #122130); border: 1px solid var(--ub-line, #22384c); border-radius: 16px; margin: 0 0 8px; overflow: hidden; }
.ub-fold > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 58px; padding: 0 18px; cursor: pointer; font-weight: 800; font-size: 1.1rem; color: var(--ub-tx, #f4f1e6); }
.ub-fold > summary::-webkit-details-marker { display: none; }
.ub-fold > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--ub-mut, #a3b5c5); border-bottom: 2px solid var(--ub-mut, #a3b5c5); transform: rotate(45deg); margin-right: 4px; transition: transform .2s; }
.ub-fold[open] > summary::after { transform: rotate(-135deg); }
.ub-fold .sidebar-card { border: 0; border-radius: 0; margin: 0; padding: 0 16px 14px; background: transparent; box-shadow: none !important; }
.ub-fold .sidebar-card > h3, .ub-fold .sidebar-card > .sidebar-subtitle:first-of-type { display: none; }

/* ============================================================
   COMPOSER — collapsed it is one friendly line
   ============================================================ */
#postComposer { display: flex; align-items: flex-start; gap: 14px; padding: 16px; margin-bottom: var(--wm-gap); }
.composer-avatar { flex: none; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #1a1410; background: var(--wm-grad) center / cover; box-shadow: 0 0 0 2px var(--ub-card, #122130), 0 0 0 3.5px var(--wm-gold); }
.composer-input-area { flex: 1; min-width: 0; }
.composer-actions { display: flex; align-items: center; gap: 10px; }
.share-hint {
    flex: 1; min-width: 0; display: flex; align-items: center; height: 54px; padding: 0 20px; border-radius: 999px;
    background: var(--ub-card2, #172a3c); border: 1px solid var(--ub-line, #22384c); color: var(--ub-mut, #a3b5c5);
    font-size: 1.1rem; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.share-btn {
    flex: none; width: 54px; height: 54px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; padding: 0;
    background: var(--wm-grad); box-shadow: 0 6px 16px rgba(56,182,245,.3); transition: transform .15s;
}
.share-btn:active { transform: scale(.93); }
.share-btn svg { width: 28px; height: 28px; }
.share-btn svg path { stroke: #0b1520 !important; fill: none !important; }
.share-btn svg path:last-child { fill: #0b1520 !important; stroke: none !important; }
.composer-icon-row { display: flex; gap: 8px; margin: 0 0 10px; flex-wrap: wrap; }
.composer-icon-btn { min-height: 44px; min-width: 44px; display: inline-grid; place-items: center; border-radius: 14px; border: 1px solid var(--ub-line, #22384c); background: var(--ub-card2, #172a3c); cursor: pointer; }
.composer-icon-btn:hover { border-color: var(--ub-accent, #38b6f5); }
#postComposer textarea, #postComposer input[type=text], #postComposer input[type=url], #postComposer [contenteditable] {
    font-size: 16px; color: var(--ub-tx, #f4f1e6); border-radius: 14px;
}
#postComposer textarea, #postComposer input[type=text], #postComposer input[type=url] { background: var(--ub-card2, #172a3c); border: 1px solid var(--ub-line2, #2e4b64); }

/* ============================================================
   POSTS
   ============================================================ */
.feed-items { display: flex; flex-direction: column; gap: var(--wm-gap); }
.feed-item { padding: 20px 20px 10px; margin: 0; overflow: hidden; transition: border-color .2s, transform .2s; }
.feed-item:hover { border-color: var(--ub-line2, #2e4b64); }
.feed-item-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.feed-avatar {
    flex: none; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
    font-weight: 800; font-size: 1.25rem; color: #1a1410; background-size: cover; background-position: center;
    box-shadow: 0 0 0 2px var(--ub-card, #122130), 0 0 0 3.5px rgba(255,201,64,.6);
}
.feed-item-meta { flex: 1; min-width: 0; }
.feed-item-author { font-weight: 800; font-size: 1.2rem; color: var(--ub-tx, #f4f1e6); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.feed-item-author a { color: inherit; text-decoration: none; }
.feed-item-author a:hover { color: var(--ub-accent, #38b6f5); }
.feed-item-time { margin-top: 2px; font-size: .9rem; color: var(--ub-mut, #a3b5c5); }
.feed-item-badge { flex: none; margin-left: auto; padding: 7px 14px; font-size: .82rem; font-weight: 800; letter-spacing: .02em; border-radius: 999px; background: var(--ub-tint, rgba(56,182,245,.14)); color: var(--ub-accent, #38b6f5); border: 1px solid transparent; }
.feed-item-content, .feed-item-text { color: var(--ub-tx, #f4f1e6); font-size: 1.18rem; line-height: 1.65; overflow-wrap: anywhere; }
.feed-item-image, .feed-item img { max-width: 100%; height: auto; border-radius: 16px; }
.feed-item-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 12px; padding: 6px 0 4px; border-top: 1px solid var(--ub-line, #22384c); }
.action-btn, .feed-item-actions button {
    min-height: 48px; padding: 0 18px; border-radius: 999px; border: 0; background: transparent;
    color: var(--ub-mut, #a3b5c5); font-family: inherit; font-weight: 700; font-size: 1rem; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px; transition: background .15s, color .15s, transform .12s;
}
.action-btn:hover, .feed-item-actions button:hover { background: var(--ub-tint, rgba(56,182,245,.14)); color: var(--ub-tx, #f4f1e6); }
.action-btn:active, .feed-item-actions button:active { transform: scale(.94); }
.load-more-btn { display: block; width: 100%; min-height: 50px; margin: 14px 0; border-radius: 16px; border: 1px solid var(--ub-line2, #2e4b64); background: var(--ub-card, #122130); color: var(--ub-accent, #38b6f5); font-weight: 800; font-family: inherit; cursor: pointer; box-shadow: var(--wm-shadow); }
.active-tag-filter-pill { border-radius: 999px; }

/* floating write button (phones) */
.wall-fab {
    display: none; position: fixed; z-index: 40; right: calc(16px + var(--wm-safe-r)); bottom: calc(96px + var(--wm-safe-b));
    width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer; font-size: 1.5rem; color: #0b1520;
    background: var(--wm-grad); box-shadow: 0 10px 26px rgba(0,0,0,.4), 0 0 0 4px rgba(56,182,245,.18);
    transition: transform .18s;
}
.wall-fab:active { transform: scale(.9); }
@media (max-width: 700px) { .wall-fab.show { display: grid; place-items: center; } }
.scroll-top-btn { left: calc(16px + var(--wm-safe-l)) !important; right: auto !important; bottom: calc(24px + var(--wm-safe-b)) !important; }

/* ---------- states, skeleton ---------- */
.state-container { max-width: 680px; margin: 24px auto; padding: 32px 20px; text-align: center; }
.state-title { font-family: var(--ub-head, 'Roboto Slab', Georgia, serif); color: var(--ub-tx, #f4f1e6); }
.state-text { color: var(--ub-mut, #a3b5c5); }
.wall-load .wl-sk { background: var(--ub-card, #122130) !important; border-color: var(--ub-line, #22384c) !important; border-radius: var(--wm-radius) !important; }
.wall-load .wl-sk::after { background: linear-gradient(90deg, transparent, var(--ub-tint, rgba(56,182,245,.14)), transparent) !important; }
.wall-load-text { color: var(--ub-mut, #a3b5c5) !important; }

@media (max-width: 480px) { .feed-item, .sidebar-card { padding-left: 16px; padding-right: 16px; } }

/* ============================================================
   LEADERBOARDS
   ============================================================ */
.lb-hero { position: relative; text-align: center; padding: 26px 20px 14px; overflow: hidden; }
.lb-hero-glow { position: absolute; inset: -40% -10% auto -10%; height: 260px; background: radial-gradient(closest-side, rgba(255,201,64,.22), transparent 70%); pointer-events: none; }
.lb-hero-trophy { position: relative; display: inline-grid; place-items: center; width: 92px; height: 92px; border-radius: 28px; margin-bottom: 8px;
    background: radial-gradient(circle at 30% 20%, rgba(255,224,138,.35), rgba(255,201,64,.08)); border: 1px solid rgba(255,201,64,.35); box-shadow: 0 14px 34px rgba(240,168,24,.25); animation: lbFloat 4s ease-in-out infinite; }
.lb-hero-trophy svg { width: 60px; height: 60px; }
@keyframes lbFloat { 50% { transform: translateY(-5px) rotate(-2deg); } }
.lb-hero-title { position: relative; margin: 0; font-family: var(--ub-head, 'Roboto Slab', Georgia, serif); font-size: 2rem; font-weight: 800; color: var(--ub-tx, #f4f1e6); letter-spacing: .01em; }
.lb-hero-sub { position: relative; margin: 6px 0 0; font-size: .92rem; color: var(--ub-mut, #a3b5c5); }

.lb-tabs { position: sticky; top: 8px; z-index: 25; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 5px; margin: 6px 0 16px;
    background: var(--wm-bar); border: 1px solid var(--ub-line, #22384c); border-radius: 18px; box-shadow: var(--wm-shadow);
    -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); }
.lb-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px; border: 0; border-radius: 14px; background: transparent; color: var(--ub-mut, #a3b5c5); font: inherit; font-weight: 800; font-size: .76rem; cursor: pointer; transition: background .18s, color .18s, transform .12s; }
.lb-tab span { font-size: 1.25rem; line-height: 1; }
.lb-tab:active { transform: scale(.95); }
.lb-tab.active { background: var(--wm-grad); color: #0b1520; box-shadow: 0 6px 16px rgba(56,182,245,.25); }
@media (min-width: 560px) { .lb-tab { flex-direction: row; gap: 8px; font-size: .88rem; } }
.lb-sec[hidden] { display: none !important; }
.lb-sec { animation: lbIn .3s ease both; }
@keyframes lbIn { from { opacity: 0; transform: translateY(8px); } }

/* board card */
.lb-wrap .sidebar-card { --bc: var(--wm-gold); position: relative; padding: 0; overflow: hidden; margin-bottom: 16px; scroll-margin-top: 80px; }
.lb-wrap .sidebar-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--bc), transparent 85%); }
.lb-wrap .word-masters-leaders, .lb-wrap .scriptorial-hall, .lb-wrap .elder-hall { --bc: #ffc940; }
.lb-wrap .mastery-champions-leaders, .lb-wrap .victors { --bc: #4fd1a5; }
.lb-wrap .typing-champions-leaders, .lb-wrap .syntax-scholars { --bc: #38b6f5; }
.lb-wrap .matching-champions-leaders { --bc: #ff6fa5; }
.lb-wrap .workbook-words-leaders { --bc: #9d84ff; }
.lb-wrap .workbook-mastery-leaders { --bc: #35c2b0; }
.lb-wrap .on-fire { --bc: #ff8a3d; }
.lb-wrap .hot-debates { --bc: #ff6f61; }
.lb-wrap .sidebar-card > h3 { padding: 18px 16px 2px; margin: 0; }
.lb-wrap .sidebar-card > h3 a { color: inherit; text-decoration: none; }
.lb-ico { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; font-size: 1.5rem; background: var(--ub-tint, rgba(56,182,245,.14)); background: color-mix(in srgb, var(--bc) 20%, transparent); border: 1px solid color-mix(in srgb, var(--bc) 35%, transparent); }
.lb-title { min-width: 0; }
.lb-wrap .sidebar-subtitle { margin: -4px 16px 14px 74px; }
.lb-wrap .wall-time-filters { display: flex; gap: 4px; margin: 0 16px 14px; padding: 4px; background: var(--ub-card2, #172a3c); border-radius: 14px; }
.lb-wrap .wall-tf { flex: 1; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--ub-mut, #a3b5c5); font-family: inherit; font-weight: 800; font-size: .8rem; cursor: pointer; transition: background .15s, color .15s; }
.lb-wrap .wall-tf.active { background: var(--bc); color: #0b1520; box-shadow: 0 3px 10px rgba(0,0,0,.25); }
.lb-wrap .sidebar-list { padding: 0 12px 14px; }
.lb-wrap .leaderboard-inner-title { display: none; }

/* avatars */
.lb-av { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .95rem; color: var(--ub-tx, #f4f1e6); background-color: var(--ub-card2, #172a3c); background-size: cover; background-position: center; border: 1px solid var(--ub-line2, #2e4b64); }
.lb-av-big { width: 60px; height: 60px; font-size: 1.3rem; }

/* podium */
.lb-podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; padding: 34px 4px 0; margin-bottom: 8px; }
.lb-spot { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.lb-spot .lb-av-big { box-shadow: 0 0 0 3px var(--ub-card, #122130), 0 0 0 5px var(--ring); }
.lb-p1 { --ring: var(--wm-gold); }
.lb-p2 { --ring: var(--wm-silver); }
.lb-p3 { --ring: var(--wm-bronze); }
.lb-p1 .lb-av-big { width: 76px; height: 76px; font-size: 1.6rem; }
.lb-crown { position: absolute; top: -26px; font-size: 1.6rem; filter: drop-shadow(0 4px 8px rgba(255,201,64,.5)); animation: lbFloat 3s ease-in-out infinite; }
.lb-p1 { padding-top: 22px; }
.lb-spot-name { margin-top: 12px; max-width: 100%; font-weight: 800; font-size: .84rem; line-height: 1.2; color: var(--ub-tx, #f4f1e6); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lb-spot-score { margin: 3px 0 8px; font-size: .72rem; font-weight: 700; color: var(--ub-mut, #a3b5c5); line-height: 1.25; }
.lb-block { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; padding-top: 8px; border-radius: 14px 14px 0 0;
    background: linear-gradient(180deg, color-mix(in srgb, var(--ring) 32%, transparent), transparent); border: 1px solid color-mix(in srgb, var(--ring) 40%, transparent); border-bottom: 0; }
.lb-p1 .lb-block { height: 92px; } .lb-p2 .lb-block { height: 66px; } .lb-p3 .lb-block { height: 50px; }
.lb-block span { font-size: 1.15rem; line-height: 1; }
.lb-block b { font-size: 1.05rem; font-weight: 900; color: var(--ring); }
.lb-spot.is-me .lb-spot-name { color: var(--ub-accent, #38b6f5); }

/* ranked rows */
.lb-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.lb-row { display: grid; grid-template-columns: 30px 38px 1fr auto; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 14px; border: 1px solid transparent; transition: background .15s; }
.lb-row:hover { background: var(--ub-tint, rgba(56,182,245,.14)); }
.lb-rank { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; font-weight: 900; font-size: .8rem; background: var(--ub-card2, #172a3c); color: var(--ub-mut, #a3b5c5); }
.lb-first .lb-rank { background: var(--wm-gold); color: #0b1520; }
.lb-info { min-width: 0; }
.lb-name { font-weight: 800; font-size: .92rem; color: var(--ub-tx, #f4f1e6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-bar { height: 5px; margin-top: 6px; border-radius: 99px; background: var(--ub-track, #203548); overflow: hidden; }
.lb-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--bc, var(--wm-gold)), var(--ub-accent, #38b6f5)); }
.lb-score { font-size: .76rem; font-weight: 800; color: var(--ub-mut, #a3b5c5); text-align: right; white-space: nowrap; max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
.is-me.lb-row { background: var(--ub-tint2, rgba(255,201,64,.14)); border-color: rgba(255,201,64,.45); }
.lb-you { display: inline-block; vertical-align: middle; margin-left: 4px; padding: 2px 7px; border-radius: 99px; background: var(--wm-gold); color: #0b1520; font-size: .6rem; font-weight: 900; letter-spacing: .06em; }
.lb-foot { text-align: center; padding-top: 12px; }
.lb-play { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 20px; border-radius: 999px; background: var(--ub-btn, #2aaef2); color: var(--ub-on-btn, #04202f); font-weight: 800; font-size: .88rem; text-decoration: none; box-shadow: 0 6px 16px rgba(56,182,245,.25); }
body.light-theme .lb-play { color: #fff !important; }
.lb-play:active { transform: scale(.96); }

/* empty + loading */
.lb-empty { text-align: center; padding: 18px 16px 8px; }
.lb-empty-ico { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 22px; font-size: 1.9rem; margin-bottom: 8px; background: var(--ub-tint2, rgba(255,201,64,.14)); filter: grayscale(.4); opacity: .85; }
.lb-empty-t { font-weight: 800; color: var(--ub-tx, #f4f1e6); }
.lb-empty-s { margin: 4px 0 14px; font-size: .84rem; color: var(--ub-mut, #a3b5c5); }
.lb-wrap .loading-small { height: 150px; margin: 0 4px; border-radius: 16px; font-size: 0; position: relative; overflow: hidden; background: var(--ub-card2, #172a3c); }
.lb-wrap .loading-small::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); animation: lbShim 1.3s infinite; background: linear-gradient(90deg, transparent, var(--ub-tint, rgba(56,182,245,.14)), transparent); }
@keyframes lbShim { to { transform: translateX(100%); } }

/* other boards (Elder Hall, On Fire, Victors, Hot Debates) */
.lb-wrap .sidebar-item { padding: 10px; }
.lb-wrap .shalom-empty, .lb-wrap .sidebar-list > p { color: var(--ub-mut, #a3b5c5) !important; font-size: .86rem !important; padding: 8px 0; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Shalom ticker: slow, quiet "X said Shalom" notification */
.shalom-ticker { position: fixed; left: 50%; bottom: calc(24px + var(--wm-safe-b, 0px)); z-index: 800; transform: translate(-50%, 10px); opacity: 0;
    display: flex; align-items: center; gap: 10px; max-width: calc(100% - 120px); padding: 12px 20px; border-radius: 999px; text-decoration: none;
    background: var(--ub-card, #122130); color: var(--ub-tx, #f4f1e6); border: 1px solid var(--ub-line, rgba(56,182,245,.35));
    box-shadow: 0 8px 24px rgba(0,0,0,.28); font-size: 1.02rem; transition: opacity 1.2s ease, transform 1.2s ease; }
.shalom-ticker.is-on { opacity: 1; transform: translate(-50%, 0); }
.shalom-ticker[hidden] { display: none; }
.shalom-ticker .st-wave { font-size: 1.3rem; }
.shalom-ticker .st-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shalom-ticker b { font-weight: 800; }
.shalom-ticker i { font-style: normal; color: var(--ub-accent, #38b6f5); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .shalom-ticker { transition: opacity .2s; } }

.wh-say { flex: none; border: 1px solid var(--ub-line, rgba(56,182,245,.4)); background: var(--ub-tint, rgba(56,182,245,.14)); color: var(--ub-tx, #f4f1e6); font-family: inherit; font-weight: 700; }
.wh-say:disabled { opacity: .7; cursor: default; }

/* Small phones: greeting card wraps so the name is never squeezed; button goes on its own row */
@media (max-width: 420px) {
    .wh-card { flex-wrap: wrap; }
    .wh-text { flex: 1 1 140px; min-width: 0; }
    .wh-say { flex: 1 1 100%; }
    .fs-text b { font-size: 1.1rem; }
    .fs-tag { padding: 0 14px; }
}

/* Mobile: "Share something" + share button always sit on ONE row (beats any older wall.css mobile rule) */
@media (max-width: 768px) {
    #postComposer { flex-direction: row !important; flex-wrap: nowrap !important; align-items: center !important; padding: 12px !important; gap: 10px !important; }
    #postComposer .composer-avatar { width: 44px !important; height: 44px !important; flex: none !important; }
    #postComposer .composer-input-area { flex: 1 1 0 !important; min-width: 0 !important; width: auto !important; }
    #postComposer .composer-actions { display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; align-items: center !important; gap: 8px !important; width: 100% !important; }
    #postComposer .share-hint { flex: 1 1 0 !important; min-width: 0 !important; height: 48px !important; padding: 0 16px !important; font-size: 1rem !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
    #postComposer .share-btn { flex: none !important; width: 48px !important; height: 48px !important; }
    #postComposer .share-btn svg { width: 24px !important; height: 24px !important; }
}
/* While writing a post the composer opens up, so let it stack again */
#postComposer.is-open, #postComposer.open, #postComposer.expanded { flex-wrap: wrap; }

/* Dropdown list: the words must always show, also on phones (older wall.css hides .tab-text on small screens) */
#fsMenu .wall-tab .tab-text, .wall-tabs .wall-tab .tab-text {
    display: block !important; visibility: visible !important; opacity: 1 !important;
    position: static !important; width: auto !important; height: auto !important; max-width: none !important; overflow: visible !important; clip: auto !important;
    flex: 1 1 auto !important; font-size: 1.15rem !important; font-weight: 700 !important; text-align: left; white-space: normal;
    color: var(--ub-tx, #f4f1e6) !important;
}
#fsMenu .wall-tab { justify-content: flex-start !important; flex-direction: row !important; width: 100% !important; }

/* Posts with an image or video: the picture/video comes FIRST, then the words under it */
.feed-item-content { display: flex; flex-direction: column; }
.feed-item-content > .feed-item-image,
.feed-item-content > .video-embed,
.feed-item-content > .video-link { order: -1; margin: 0 0 12px !important; width: 100%; }
.feed-item-content > .feed-item-image { display: block; max-height: 520px; object-fit: cover; border-radius: 16px !important; }
