/* ═══════════════════════════════════════════════════════════════
   HoboStreamer.com — Main Stylesheet
   Dark theme with campfire amber/brown accents
   ═══════════════════════════════════════════════════════════════ */

/* ── Variables ────────────────────────────────────────────────── */
:root {
    --bg-primary: #0d0d0f;
    --bg-secondary: #16161a;
    --bg-tertiary: #1e1e24;
    --bg-card: #1a1a20;
    --bg-hover: #242430;
    --bg-input: #12121a;

    --text-primary: #e8e6e3;
    --text-secondary: #9a9a9a;
    --text-muted: #666;

    --accent: #c0965c;           /* Campfire amber */
    --accent-light: #dbb077;
    --accent-dark: #8a6a3a;

    --live-red: #e74c3c;
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #3498db;

    --border: #2a2a32;
    --border-light: #3a3a44;

    --radius: 8px;
    --radius-sm: 4px;
    --radius-lg: 12px;

    --shadow: 0 2px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);

    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-mono: 'Consolas', 'Courier New', monospace;

    --navbar-h: 56px;
    --chat-w: clamp(300px, 22vw, 400px);
    --content-max: 1440px;
    --glass: rgba(22, 22, 26, 0.78);
    --glass-strong: rgba(18, 18, 24, 0.92);
    --shadow-soft: 0 12px 40px rgba(0,0,0,0.28);
    --ring-accent: 0 0 0 1px rgba(192,150,92,0.18), 0 18px 40px rgba(0,0,0,0.28);
}

/* ── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at top left, rgba(192, 150, 92, 0.14), transparent 28%),
        radial-gradient(circle at top right, rgba(52, 152, 219, 0.08), transparent 24%),
        linear-gradient(180deg, #101015 0%, #0d0d0f 36%, #0c0d12 100%);
}
body::before,
body::after {
    content: '';
    position: fixed;
    pointer-events: none;
    z-index: 0;
    filter: blur(70px);
    opacity: 0.32;
}
body::before {
    top: -80px;
    left: -30px;
    width: 280px;
    height: 280px;
    background: rgba(192, 150, 92, 0.28);
}
body::after {
    right: -40px;
    top: 25vh;
    width: 240px;
    height: 240px;
    background: rgba(52, 152, 219, 0.15);
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-light); }
img { max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
main#app { position: relative; z-index: 1; }

/* ── Scrollbar ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dark); }

/* ═══════════════════════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════════════════════ */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    height: var(--navbar-h);
    background: var(--glass);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex; align-items: center;
    padding: 0 16px;
    gap: 16px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.22);
    overflow: visible;
}
.nav-brand {
    display: flex; align-items: center; gap: 8px;
    font-size: 1.2rem; cursor: pointer; white-space: nowrap;
    color: var(--accent); position: relative;
}
.nav-brand i { font-size: 1.4rem; }
.brand-text-wrap {
    display: flex; flex-direction: column; align-items: flex-end;
    line-height: 1; gap: 0;
}
.brand-text { color: var(--text-primary); }
.brand-text strong { color: var(--accent); }

/* Alpha badge — sits above "Streamer" */
.alpha-badge {
    font-size: 0.45rem; font-weight: 800; letter-spacing: 0.08em;
    padding: 1px 4px; border-radius: 3px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24, #ff6b6b);
    background-size: 200% 200%;
    color: #fff; line-height: 1;
    text-transform: uppercase;
    animation: alpha-pulse 2.5s ease-in-out infinite;
    box-shadow: 0 0 6px rgba(238, 90, 36, 0.35);
    margin-bottom: -1px;
}
@keyframes alpha-pulse {
    0%, 100% { background-position: 0% 50%; box-shadow: 0 0 8px rgba(238, 90, 36, 0.4); }
    50% { background-position: 100% 50%; box-shadow: 0 0 14px rgba(238, 90, 36, 0.7); }
}

/* Brand hover tooltip */
.nav-brand[data-brand-tooltip]::after {
    content: attr(data-brand-tooltip);
    position: absolute;
    top: 100%; left: 0;
    margin-top: 8px;
    padding: 8px 12px; border-radius: 8px;
    background: var(--bg-tertiary); color: var(--text-secondary);
    border: 1px solid var(--border);
    font-size: 0.75rem; font-weight: 400; line-height: 1.4;
    white-space: normal; width: 260px;
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1002;
    box-shadow: var(--shadow-lg);
}
.nav-brand[data-brand-tooltip]:hover::after { opacity: 1; }

.nav-links-wrap {
    display: flex; align-items: center; flex: 1; min-width: 0;
    position: relative;
}

.nav-links {
    display: flex; gap: 4px; flex: 1; min-width: 0;
    overflow-x: auto; overflow-y: visible;
    align-items: center;
    scrollbar-width: none;
    scroll-behavior: smooth;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-link {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: var(--radius);
    color: var(--text-secondary); font-size: 0.9rem;
    transition: all 0.2s; cursor: pointer;
    white-space: nowrap; flex-shrink: 0;
    border: 1px solid transparent;
}
.nav-link:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.08);
    color: var(--text-primary);
}
.nav-link.active {
    background: linear-gradient(180deg, rgba(192,150,92,0.16), rgba(192,150,92,0.08));
    border-color: rgba(192,150,92,0.28);
    color: var(--accent-light);
}

/* ── Nav Dropdown (Game → HoboGame / Canvas) ──────────────────── */
.nav-dropdown {
    position: relative;
    flex-shrink: 0;
}

.nav-dropdown .nav-link {
    user-select: none;
}

.nav-dd-caret {
    font-size: 0.6rem;
    margin-left: 2px;
    transition: transform 0.2s;
}

.nav-dropdown:hover .nav-dd-caret,
.nav-dropdown.open .nav-dd-caret {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    display: none;
    position: fixed;
    min-width: 180px;
    background: var(--bg-tertiary, #1a1a2e);
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: var(--radius, 8px);
    box-shadow: var(--shadow-lg, 0 12px 28px rgba(0,0,0,0.4));
    z-index: 1002;
    overflow: hidden;
    padding: 4px 0;
}

/* Open on hover (desktop) or click — JS positions the fixed menu */
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-primary, #e8e6e3);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.nav-dropdown-menu a:hover {
    background: var(--bg-hover, rgba(255,255,255,0.06));
    color: var(--accent-light, #dbb077);
}

.nav-dropdown-menu a:hover i {
    color: var(--accent, #c0965c);
}

.nav-dropdown-menu a i {
    width: 18px;
    text-align: center;
    color: var(--text-secondary, #9a9a9a);
    transition: color 0.15s;
}

/* ── Nav Scroll Arrows (visible when nav links overflow) ────── */
.nav-scroll-btn {
    display: none;
    width: 28px;
    min-width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary, #1a1a2e);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    z-index: 10;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.nav-scroll-btn:hover {
    background: var(--accent, #c0965c);
    color: #fff;
}
.nav-scroll-btn.visible { display: flex; }

/* Live indicator on Go Live nav link */
.nav-live-dot {
    font-size: 0.45rem; color: #e74c3c; margin-left: 4px;
    animation: nav-live-pulse 1.5s ease-in-out infinite;
    vertical-align: middle;
}
@keyframes nav-live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.85); }
}
.nav-link.nav-live {
    background: linear-gradient(180deg, rgba(231,76,60,0.18), rgba(231,76,60,0.08));
    border-color: rgba(231,76,60,0.35);
    color: #f1948a;
    box-shadow: 0 0 8px rgba(231,76,60,0.15);
}
.nav-link.nav-live:hover {
    background: linear-gradient(180deg, rgba(231,76,60,0.25), rgba(231,76,60,0.12));
    border-color: rgba(231,76,60,0.45);
    color: #f5b7b1;
    box-shadow: 0 0 12px rgba(231,76,60,0.25);
}

.nav-right {
    display: flex; align-items: center; gap: 12px;
    flex-shrink: 0; white-space: nowrap;
}
#nav-auth-anon,
#nav-auth-user {
    display: flex;
    align-items: center;
    gap: 10px;
}
.nav-balance {
    display: flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 12px;
    background: linear-gradient(135deg, #2a200e, #1a1508);
    border: 1px solid var(--accent-dark);
    color: var(--accent); font-size: 0.85rem; font-weight: 600;
    cursor: pointer;
}
.nav-avatar-wrap {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer; position: relative;
    padding: 4px 8px; border-radius: var(--radius);
}
.nav-avatar-wrap:hover { background: var(--bg-hover); }
.nav-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--accent); color: #000; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem;
}
#nav-username { font-size: 0.9rem; color: var(--text-primary); }

.nav-avatar-wrap { position: relative; }
.user-dropdown {
    display: none; position: absolute; top: 100%; right: 0;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    border-radius: var(--radius); min-width: 200px;
    box-shadow: var(--shadow-lg); z-index: 1001;
    overflow: hidden;
}
.user-dropdown.show { display: block; }
.user-dropdown a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; color: var(--text-primary);
    font-size: 0.9rem; cursor: pointer;
}
.user-dropdown a:hover { background: var(--bg-hover); }
.user-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

.nav-hamburger {
    display: none; background: none; border: none;
    color: var(--text-primary); font-size: 1.3rem;
    padding: 8px; cursor: pointer;
    border-radius: 10px;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.nav-hamburger:hover { background: rgba(255,255,255,0.06); }
.nav-hamburger.open {
    background: rgba(192,150,92,0.12);
    color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--radius);
    font-size: 0.9rem; font-weight: 500;
    border: 1px solid transparent; transition: all 0.2s; cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,0.14);
}
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: var(--accent-light); transform: translateY(-1px); }
.btn-outline {
    background: transparent; color: var(--text-primary);
    border: 1px solid var(--border-light);
    box-shadow: none;
}
.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(192,150,92,0.08);
}
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c0392b; transform: translateY(-1px); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #27ae60; transform: translateY(-1px); }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-small { padding: 4px 8px; font-size: 0.8rem; }
.btn-follow { background: var(--live-red); color: #fff; }
.btn-follow.following { background: var(--bg-hover); color: var(--text-secondary); }
.btn-subscribe { background: var(--accent); color: #000; }
.btn-hobo-bucks {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff; width: 100%; justify-content: center;
    padding: 6px 12px; font-size: 0.85rem;
}
.btn-hobo-bucks-mini {
    flex-shrink: 0;
    padding: 6px 8px; background: transparent;
    border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--accent); font-size: 0.85rem; cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    line-height: 1;
}
.btn-hobo-bucks-mini:hover {
    background: var(--accent); color: #fff;
    border-color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════ */
.container {
    max-width: var(--content-max); margin: 0 auto;
    padding: 0 clamp(16px, 2vw, 28px);
}
.content-container {
    max-width: var(--content-max); margin: 0 auto;
    padding: 0 clamp(16px, 2vw, 28px);
}
.page { display: none; padding-top: var(--navbar-h); min-height: 100vh; padding-bottom: 32px; }
.page.active { display: block; }

/* ═══════════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════════ */
.hero {
    background: linear-gradient(135deg, #1a150e 0%, #0d0d0f 50%, #0e1018 100%);
    border-bottom: 1px solid var(--border);
    padding: clamp(48px, 8vw, 84px) 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before,
.hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.hero::before {
    width: 520px;
    height: 520px;
    top: -260px;
    left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(192,150,92,0.18), transparent 68%);
}
.hero::after {
    width: 260px;
    height: 260px;
    right: 10%;
    bottom: -110px;
    background: radial-gradient(circle, rgba(52,152,219,0.12), transparent 70%);
}
.hero-content {
    position: relative;
    z-index: 1;
    max-width: 780px;
    margin: 0 auto;
}
.hero h1 {
    font-size: clamp(2.2rem, 5vw, 4rem); color: var(--accent);
    margin-bottom: 8px;
    letter-spacing: -0.03em;
}
.hero p {
    color: var(--text-secondary);
    font-size: clamp(1rem, 2.2vw, 1.16rem);
    margin: 0 auto 24px;
    max-width: 640px;
}
.hero-tagline {
    display: block;
    text-align: center;
    line-height: 1.4;
    white-space: nowrap;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.network-hub {
    background: linear-gradient(135deg, #1a150e 0%, #16161a 50%, #1a1520 100%);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 32px 24px;
    overflow: hidden;
}
.network-hub-header {
    display: flex; align-items: center; gap: 14px; justify-content: center;
    margin-bottom: 24px; text-align: center;
}
.network-hub-header > i {
    font-size: 1.6rem; color: var(--accent); flex-shrink: 0;
    background: rgba(192,150,92,0.1); padding: 12px; border-radius: 12px;
}
.network-hub-header h3 {
    font-size: 1.15rem; font-weight: 800; color: var(--text-primary); margin: 0;
    letter-spacing: -0.3px;
}
.network-hub-header p {
    font-size: 0.82rem; color: var(--text-secondary); margin: 3px 0 0;
}
.network-hub-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-width: 960px; margin: 0 auto;
}
.network-card {
    display: flex; align-items: center; gap: 12px;
    background: rgba(255,255,255,0.03); border: 1px solid var(--border);
    border-radius: 12px; padding: 14px 16px;
    text-decoration: none; color: var(--text-primary);
    transition: all 0.2s ease;
}
.network-card:hover {
    background: rgba(255,255,255,0.06);
    border-color: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.network-card-featured {
    border-color: rgba(231,76,60,0.25);
    background: rgba(231,76,60,0.04);
}
.network-card-featured:hover { border-color: rgba(231,76,60,0.5); }
.network-card-icon {
    width: 40px; height: 40px; border-radius: 10px;
    background: color-mix(in srgb, var(--card-accent, var(--accent)) 12%, transparent);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: var(--card-accent, var(--accent));
    flex-shrink: 0;
}
.network-card-info { flex: 1; min-width: 0; }
.network-card-info strong {
    display: block; font-size: 0.85rem; font-weight: 700;
    color: var(--text-primary); margin-bottom: 2px;
}
.network-card-info span {
    display: block; font-size: 0.72rem; color: var(--text-secondary);
    line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.network-card-arrow {
    color: var(--text-secondary); font-size: 0.75rem;
    opacity: 0; transition: opacity 0.2s, transform 0.2s;
    flex-shrink: 0;
}
.network-card:hover .network-card-arrow { opacity: 1; transform: translateX(3px); }

@media (max-width: 960px) {
    .network-hub-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
}
@media (max-width: 768px) {
    .network-hub-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .network-hub { padding: 24px 16px; }
    .network-hub-header { flex-direction: column; gap: 8px; }
    .network-card-info span { white-space: normal; }
}
@media (max-width: 480px) {
    .network-hub-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .network-hub { padding: 20px 12px; }
    .network-card { padding: 12px; gap: 10px; }
    .network-card-icon { width: 36px; height: 36px; font-size: 1rem; border-radius: 8px; }
    .network-card-info strong { font-size: 0.8rem; }
    .network-card-info span { font-size: 0.68rem; }
    .network-card-arrow { display: none; }
}
@media (max-width: 360px) {
    .network-hub-grid { grid-template-columns: 1fr; gap: 8px; }
    .network-hub { padding: 16px 10px; }
}

/* ── HoboApp Popover ─────────────────────────────────────────── */
.hoboapp-popover {
    max-height: 0; overflow: hidden; opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.4,0,0.2,1), opacity 0.3s ease;
    pointer-events: none;
}
.hoboapp-popover.open {
    max-height: 800px; opacity: 1; pointer-events: auto;
    overflow-y: auto;
}
.hoboapp-popover-inner {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--accent-dark);
    box-shadow: var(--shadow-lg);
    padding: 28px 32px 24px;
    max-width: 860px; margin: 0 auto;
    position: relative;
}
.hoboapp-popover-close {
    position: absolute; top: 12px; right: 16px;
    background: none; border: none; color: var(--text-muted); font-size: 1.1rem;
    cursor: pointer; padding: 4px 8px; border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
}
.hoboapp-popover-close:hover { color: var(--text-primary); background: var(--bg-hover); }
.hoboapp-header {
    display: flex; align-items: center; gap: 16px; margin-bottom: 12px;
}
.hoboapp-logo {
    width: 52px; height: 52px; border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; color: #fff; flex-shrink: 0;
}
.hoboapp-header h2 {
    font-size: 1.4rem; color: var(--text-primary); margin: 0; line-height: 1.2;
}
.hoboapp-version {
    font-size: 0.75rem; font-weight: 400;
    background: var(--accent-dark); color: #fff; padding: 2px 7px;
    border-radius: 10px; vertical-align: middle; margin-left: 6px;
}
.hoboapp-tagline {
    color: var(--text-muted); font-size: 0.85rem; margin: 2px 0 0;
}
.hoboapp-desc {
    color: var(--text-secondary); font-size: 0.88rem; line-height: 1.6;
    margin-bottom: 18px; max-width: 700px;
}
.hoboapp-desc strong { color: var(--accent); }
.hoboapp-live-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.hoboapp-meta-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    border: 1px solid var(--border);
}
.hoboapp-meta-label {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.hoboapp-meta-card strong {
    font-size: 1.02rem;
    color: var(--text-primary);
}
.hoboapp-meta-sub {
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.35;
}
.hoboapp-latest-change {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
}
.hoboapp-latest-change-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.hoboapp-latest-change-head strong {
    color: var(--text-primary);
    font-size: 0.86rem;
}
.hoboapp-latest-change-head a {
    color: var(--accent);
    font-size: 0.78rem;
    text-decoration: none;
}
.hoboapp-latest-change-head a:hover { text-decoration: underline; }
.hoboapp-latest-change p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.45;
    font-size: 0.88rem;
}
.hoboapp-features {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    gap: 10px; margin-bottom: 20px;
}
.hoboapp-feat {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius);
    background: var(--bg-tertiary); border: 1px solid var(--border);
    transition: border-color 0.2s, background 0.2s;
}
.hoboapp-feat:hover { border-color: var(--accent-dark); background: var(--bg-hover); }
.hoboapp-feat-icon {
    width: 32px; height: 32px; border-radius: var(--radius-sm);
    background: rgba(192,150,92,0.12); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; flex-shrink: 0; margin-top: 1px;
}
.hoboapp-feat strong {
    display: block; font-size: 0.82rem; color: var(--text-primary); margin-bottom: 2px;
}
.hoboapp-feat span {
    font-size: 0.76rem; color: var(--text-muted); line-height: 1.35;
}
.hoboapp-cta {
    text-align: center; padding-top: 4px;
}
.hoboapp-dl-btn {
    padding: 12px 32px; font-size: 1rem; gap: 10px;
    display: inline-flex; align-items: center;
}
.hoboapp-cta-sub {
    color: var(--text-muted); font-size: 0.78rem; margin-top: 10px;
    display: flex; align-items: center; justify-content: center; gap: 4px;
}
@media (max-width: 600px) {
    .hoboapp-popover-inner { padding: 20px 16px 18px; }
    .hoboapp-live-meta { grid-template-columns: 1fr; }
    .hoboapp-features { grid-template-columns: 1fr; }
    .hoboapp-header { flex-direction: column; text-align: center; }
    .hoboapp-latest-change-head { flex-direction: column; align-items: flex-start; }
}

/* ═══════════════════════════════════════════════════════════════
   STREAM GRID (Home page cards)
   ═══════════════════════════════════════════════════════════════ */
.section-header {
    display: flex; align-items: center; gap: 10px;
    margin: 24px 0 16px;
    justify-content: space-between;
    flex-wrap: wrap;
}
.section-header > * { min-width: 0; }
.section-header h2 { font-size: 1.2rem; }
.badge {
    background: var(--live-red); color: #fff;
    padding: 2px 8px; border-radius: 10px;
    font-size: 0.75rem; font-weight: 600;
}
.live-dot {
    color: var(--live-red); font-size: 0.6rem;
    animation: pulse-live 1.5s infinite;
}
@keyframes pulse-live {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.stream-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 18px;
    margin-bottom: 32px;
}
.stream-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-shadow: var(--shadow-soft);
    background-image: linear-gradient(180deg, rgba(255,255,255,0.02), transparent 45%);
}
.stream-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-dark);
    box-shadow: var(--ring-accent);
}
.stream-card-thumb {
    aspect-ratio: 16/9;
    background: var(--bg-tertiary);
    position: relative;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.stream-card-thumb i { font-size: 2rem; color: var(--text-muted); }
.stream-card-thumb img {
    position: absolute; inset: 0;
    width: 100%; height: 100%; object-fit: cover;
    border-radius: var(--radius) var(--radius) 0 0;
}
.stream-card-live {
    position: absolute; top: 8px; left: 8px;
    background: var(--live-red); color: #fff;
    padding: 2px 8px; border-radius: var(--radius-sm);
    font-size: 0.7rem; font-weight: 700;
    text-transform: uppercase;
}
.stream-card-thumb .protocol-badge {
    position: absolute; bottom: 8px; left: 8px;
}
.stream-card-viewers {
    position: absolute; bottom: 8px; right: 8px;
    background: rgba(0,0,0,0.7); color: #fff;
    padding: 2px 8px; border-radius: var(--radius-sm);
    font-size: 0.75rem;
    display: flex; align-items: center; gap: 4px;
}
.stream-card-nsfw {
    position: absolute; top: 8px; right: 8px;
    background: var(--danger); color: #fff;
    padding: 2px 6px; border-radius: var(--radius-sm);
    font-size: 0.65rem; font-weight: 700;
}
.badge-unlisted {
    display: inline-block;
    background: var(--text-muted); color: #fff;
    padding: 2px 8px; border-radius: var(--radius-sm);
    font-size: 0.75rem; font-weight: 600; margin-bottom: 6px;
}

/* Protocol badges */
.protocol-badge {
    display: inline-block;
    padding: 2px 7px; border-radius: var(--radius-sm);
    font-size: 0.65rem; font-weight: 700; letter-spacing: 0.5px;
    text-transform: uppercase; vertical-align: middle;
}
.protocol-jsmpeg { background: #4a9eff; color: #fff; }
.protocol-webrtc { background: #10b981; color: #fff; }
.protocol-rtmp   { background: #f59e0b; color: #1a1a2e; }
.stream-card-info { padding: 12px; }
.stream-card-title {
    font-size: 0.98rem; font-weight: 650;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
    line-height: 1.35;
}
.stream-card-streamer {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.85rem; color: var(--text-secondary);
    flex-wrap: wrap;
}
.stream-card-avatar {
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--accent); color: #000; font-size: 0.65rem;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; flex-shrink: 0;
}
.stream-card-tags {
    display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap;
}
.stream-card-tag {
    background: var(--bg-hover); color: var(--text-secondary);
    padding: 1px 6px; border-radius: 8px;
    font-size: 0.7rem;
}

.empty-state {
    grid-column: 1/-1;
    text-align: center; padding: 48px 20px;
    color: var(--text-muted);
}
.empty-state i { margin-bottom: 16px; opacity: 0.5; }
.muted { color: var(--text-muted); font-size: 0.9rem; }

/* ═══════════════════════════════════════════════════════════════
   HERO ROTATING TAGLINE
   ═══════════════════════════════════════════════════════════════ */
.hero-rotate-wrap {
    display: inline-block;
    text-align: left;
    position: relative;
    min-width: 0;
    vertical-align: baseline;
}
.hero-rotate {
    display: inline-block;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    color: var(--accent);
    font-weight: 650;
    white-space: nowrap;
}
.hero-rotate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════════
   STREAM CARD EXTRAS (duration, ago badge)
   ═══════════════════════════════════════════════════════════════ */
.stream-card-duration {
    position: absolute; bottom: 8px; left: 8px;
    background: rgba(0,0,0,0.8); color: #fff;
    padding: 2px 6px; border-radius: var(--radius-sm);
    font-size: 0.7rem; font-weight: 600;
}
.stream-card-ago {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════
   STREAMING CTA BANNER
   ═══════════════════════════════════════════════════════════════ */
.home-cta-banner {
    background: linear-gradient(135deg, rgba(192,150,92,0.12), rgba(52,152,219,0.09));
    border: 1px solid rgba(192,150,92,0.18);
    border-radius: var(--radius-lg);
    padding: clamp(20px, 4vw, 36px) clamp(16px, 3vw, 30px);
    margin: 24px 0 32px;
    text-align: center;
    box-shadow: 0 12px 32px rgba(0,0,0,0.18);
}
.home-cta-inner { max-width: 780px; margin: 0 auto; }
.home-cta-text h3 {
    font-size: 1.45rem; margin-bottom: 8px; color: var(--text-primary);
}
.home-cta-text h3 i { color: var(--accent); }
.home-cta-text p {
    color: var(--text-secondary); font-size: 0.98rem; margin-bottom: 22px; line-height: 1.7;
}
.home-cta-steps {
    display: flex; align-items: center; justify-content: center;
    gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.home-cta-step {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    min-width: 100px;
}
.home-cta-step-icon {
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--bg-hover); display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; color: var(--accent); margin-bottom: 4px;
    border: 1px solid var(--border);
}
.home-cta-step strong { font-size: 0.88rem; color: var(--text-primary); }
.home-cta-step span { font-size: 0.75rem; color: var(--text-muted); }
.home-cta-step-arrow { color: var(--text-muted); font-size: 0.9rem; }

/* ── Feature highlight grid inside CTA banner ──────────── */
.home-cta-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 8px 0 22px;
    text-align: left;
}
.home-cta-feature {
    display: flex; flex-direction: column; gap: 4px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border, rgba(255,255,255,0.06));
    transition: background 0.15s, border-color 0.15s;
}
.home-cta-feature:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(192,150,92,0.25);
}
.home-cta-feature > i {
    font-size: 1.1rem; color: var(--accent); margin-bottom: 2px;
}
.home-cta-feature > strong {
    font-size: 0.84rem; color: var(--text-primary);
}
.home-cta-feature > span {
    font-size: 0.76rem; color: var(--text-muted); line-height: 1.5;
}
.home-cta-buttons {
    display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
}
@media (max-width: 800px) {
    .home-cta-features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .home-cta-step-arrow { display: none; }
    .home-cta-steps { gap: 12px; }
    .home-cta-text h3 { font-size: 1.15rem; }
    .home-cta-text p { font-size: 0.88rem; }
    .home-cta-features { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   FOUNDER STORY — Timeline Layout
   ═══════════════════════════════════════════════════════════════ */
.founder-story {
    margin: 16px 0 34px;
    border: 1px solid rgba(192,150,92,0.13);
    border-radius: 20px;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(192,150,92,0.10), transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(52,152,219,0.07), transparent 45%),
        linear-gradient(180deg, rgba(18,18,24,0.95), rgba(12,12,16,0.98));
    box-shadow: 0 24px 64px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.04);
    overflow: hidden;
    position: relative;
}

/* ── Header ───────────────────────────────────────────────── */
.founder-story-header {
    padding: clamp(28px, 5vw, 48px) clamp(20px, 4vw, 42px) 0;
    text-align: center;
}
.founder-story-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(192,150,92,0.12);
    border: 1px solid rgba(192,150,92,0.22);
    color: var(--accent-light);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}
.founder-story-header h2 {
    font-size: clamp(1.65rem, 3.5vw, 2.65rem);
    line-height: 1.10;
    letter-spacing: -0.03em;
    margin: 0 0 12px;
    color: var(--text-primary);
}
.founder-story-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ── Timeline ─────────────────────────────────────────────── */
.founder-timeline {
    position: relative;
    padding: 36px clamp(20px, 4vw, 42px) 12px;
    margin-left: 32px;
}
/* Vertical line */
.founder-timeline::before {
    content: '';
    position: absolute;
    left: clamp(20px, 4vw, 42px);
    top: 36px;
    bottom: 32px;
    width: 2px;
    background: linear-gradient(180deg,
        rgba(192,150,92,0.5),
        rgba(52,152,219,0.4) 30%,
        rgba(231,76,60,0.3) 55%,
        rgba(46,204,113,0.4) 75%,
        rgba(231,76,60,0.5));
}

.timeline-chapter {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 0 22px;
    margin-bottom: 32px;
    position: relative;
}
.timeline-marker {
    display: flex;
    justify-content: center;
    padding-top: 2px;
    position: relative;
    z-index: 2;
}
.timeline-marker span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #fff;
    box-shadow: 0 0 18px rgba(0,0,0,0.35);
}
.timeline-marker .marker-note {
    font-size: 0.9rem;
}

/* Chapter-specific marker colours */
.timeline-shed .timeline-marker span   { background: linear-gradient(135deg, #8b6914, #c0965c); }
.timeline-grind .timeline-marker span  { background: linear-gradient(135deg, #1a5276, #3498db); }
.timeline-music .timeline-marker span  { background: linear-gradient(135deg, #922b21, #e74c3c); }
.timeline-leap .timeline-marker span   { background: linear-gradient(135deg, #1e8449, #2ecc71); }
.timeline-now .timeline-marker span    { background: linear-gradient(135deg, #b03a2e, #e74c3c); box-shadow: 0 0 22px rgba(231,76,60,0.35); }

.timeline-body {
    padding-bottom: 8px;
}
.timeline-era {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.timeline-shed .timeline-era   { background: rgba(192,150,92,0.14); color: #c0965c; }
.timeline-grind .timeline-era  { background: rgba(52,152,219,0.12); color: #5dade2; }
.timeline-music .timeline-era  { background: rgba(231,76,60,0.12);  color: #ec7063; }
.timeline-leap .timeline-era   { background: rgba(46,204,113,0.12); color: #58d68d; }
.timeline-now .timeline-era    { background: rgba(231,76,60,0.14);  color: #ec7063; }

.timeline-body h3 {
    font-size: clamp(1.05rem, 2vw, 1.32rem);
    line-height: 1.25;
    margin-bottom: 10px;
    color: var(--text-primary);
}
.timeline-body p {
    color: var(--text-secondary);
    font-size: 0.94rem;
    line-height: 1.82;
    margin-bottom: 12px;
    max-width: 700px;
}
.timeline-body strong {
    color: var(--text-primary);
}
.timeline-mission {
    color: var(--accent-light) !important;
    font-weight: 600;
    font-size: 1rem !important;
}

/* ── YouTube Link Card ────────────────────────────────────── */
.timeline-yt-link {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 14px;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid rgba(231,76,60,0.22);
    background: linear-gradient(135deg, rgba(231,76,60,0.08), rgba(192,24,24,0.04));
    text-decoration: none;
    transition: all 0.25s ease;
}
.timeline-yt-link:hover {
    border-color: rgba(231,76,60,0.45);
    background: linear-gradient(135deg, rgba(231,76,60,0.14), rgba(192,24,24,0.08));
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(231,76,60,0.15);
}
.timeline-yt-link > .fa-youtube {
    font-size: 1.8rem;
    color: #e74c3c;
    flex-shrink: 0;
}
.timeline-yt-link div {
    flex: 1;
    min-width: 0;
}
.timeline-yt-link strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.92rem;
    margin-bottom: 2px;
}
.timeline-yt-link span {
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.4;
}
.timeline-yt-link > .fa-arrow-up-right-from-square {
    color: var(--text-muted);
    font-size: 0.78rem;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.timeline-yt-link:hover > .fa-arrow-up-right-from-square {
    opacity: 1;
    color: #e74c3c;
}

/* ── Pull Quote ───────────────────────────────────────────── */
.founder-story-pullquote {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin: 12px clamp(20px, 4vw, 42px) 0;
    padding: 26px 28px;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 0;
    padding-bottom: clamp(28px, 5vw, 42px);
}
.founder-story-pullquote > i {
    color: var(--accent);
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 3px;
    opacity: 0.7;
}
.founder-story-pullquote blockquote {
    margin: 0;
    padding: 0;
    border: 0;
    color: var(--text-primary);
    font-size: 1.06rem;
    line-height: 1.72;
    font-style: italic;
    font-weight: 500;
    letter-spacing: -0.01em;
}

/* ═══════════════════════════════════════════════════════════════
   HOME — RECENT PASTES
   ═══════════════════════════════════════════════════════════════ */
.home-pastes-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin-bottom: 32px;
}
.home-paste-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); text-decoration: none; color: var(--text-primary);
    transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}
.home-paste-card:hover {
    border-color: var(--accent-dark); background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(0,0,0,0.2);
}
.home-paste-media {
    position: relative;
    height: 150px;
    background: linear-gradient(135deg, rgba(192,150,92,0.08), rgba(52,152,219,0.08));
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.home-paste-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.home-paste-icon {
    width: 52px; height: 52px; border-radius: 14px;
    background: rgba(13,13,15,0.58); display: flex; align-items: center; justify-content: center;
    font-size: 1rem; color: var(--text-primary); flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(6px);
}
.home-paste-body {
    padding: 14px 15px 15px;
}
.home-paste-info { min-width: 0; flex: 1; }
.home-paste-title {
    font-weight: 600; font-size: 0.92rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.home-paste-preview {
    color: var(--text-muted); font-size: 0.8rem; margin-top: 8px;
    overflow: hidden;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    font-family: 'SF Mono', 'Fira Code', monospace;
    line-height: 1.55;
}
.home-paste-meta {
    color: var(--text-muted); font-size: 0.75rem; margin-top: 10px;
}
.home-paste-lang {
    background: var(--bg-tertiary); padding: 1px 5px; border-radius: 4px;
    font-size: 0.7rem;
}
.home-paste-type {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 999px;
    background: rgba(13,13,15,0.78);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.08);
}
.home-paste-snippet {
    width: 100%;
    height: 100%;
    padding: 14px 16px;
    overflow: hidden;
    color: var(--text-secondary);
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.78rem;
    line-height: 1.55;
    white-space: pre-wrap;
}

@media (max-width: 640px) {
    .hero-tagline { white-space: normal; }
    .hero-rotate-wrap { min-width: 0; }
    .founder-timeline { margin-left: 0; padding-left: clamp(16px, 3vw, 24px); padding-right: clamp(16px, 3vw, 24px); }
    .founder-timeline::before { left: clamp(16px, 3vw, 24px); }
    .timeline-chapter { grid-template-columns: 40px 1fr; gap: 0 14px; }
    .timeline-marker span { width: 32px; height: 32px; font-size: 0.65rem; }
    .timeline-body h3 { font-size: 1rem; }
    .timeline-body p { font-size: 0.88rem; }
    .timeline-yt-link { padding: 12px 14px; gap: 10px; }
    .timeline-yt-link > .fa-youtube { font-size: 1.4rem; }
    .founder-story-pullquote { padding: 20px 18px; gap: 12px; }
    .founder-story-pullquote blockquote { font-size: 0.94rem; }
    .home-pastes-list { grid-template-columns: 1fr; }
    .home-paste-media { height: 136px; }
}

/* ═══════════════════════════════════════════════════════════════
   HOME — HOBOQUEST LEADERBOARDS
   ═══════════════════════════════════════════════════════════════ */
.home-leaderboards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
    gap: 14px; margin-bottom: 32px;
}
.home-lb-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 16px; overflow: hidden;
}
.home-lb-title {
    font-weight: 650; font-size: 0.88rem; margin-bottom: 10px;
    color: var(--text-secondary);
    display: flex; align-items: center; gap: 6px;
}
.home-lb-title i { color: var(--accent); font-size: 0.85rem; }
.home-lb-entries { display: flex; flex-direction: column; gap: 6px; }
.home-lb-row {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.82rem; padding: 4px 0;
    border-bottom: 1px solid var(--border);
}
.home-lb-row:last-child { border-bottom: none; }
.home-lb-rank {
    width: 20px; text-align: center;
    font-weight: 700; color: var(--text-muted); font-size: 0.75rem;
}
.home-lb-row:nth-child(1) .home-lb-rank { color: #ffd700; }
.home-lb-row:nth-child(2) .home-lb-rank { color: #c0c0c0; }
.home-lb-row:nth-child(3) .home-lb-rank { color: #cd7f32; }
.home-lb-name {
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--text-primary);
}
.home-lb-score {
    font-weight: 600; color: var(--accent); font-size: 0.78rem;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════
   HOME — CANVAS PREVIEW
   ═══════════════════════════════════════════════════════════════ */
.home-canvas-preview { margin-bottom: 32px; }
.home-canvas-wrap {
    display: flex; flex-direction: column; align-items: center;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 24px; text-align: center;
}
.home-canvas-wrap canvas {
    max-height: 300px; width: auto;
}
.home-canvas-stats {
    display: flex; gap: 24px; margin-top: 16px; flex-wrap: wrap;
    justify-content: center;
}
.home-canvas-stat {
    display: flex; flex-direction: column; align-items: center;
}
.home-canvas-stat strong {
    font-size: 1.3rem; color: var(--accent); line-height: 1.2;
}
.home-canvas-stat span {
    font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════════════════
   STREAM VIEWER LAYOUT
   ═══════════════════════════════════════════════════════════════ */
.stream-layout {
    display: flex; height: calc(100vh - var(--navbar-h));
}
#page-channel .stream-layout {
    height: calc(100vh - var(--navbar-h)); /* dynamic: no tabs bar deduction when tabs hidden */
}
#page-channel.has-live-tabs .stream-layout {
    height: calc(100vh - var(--navbar-h) - 44px); /* account for live tabs bar when visible */
}
.stream-main {
    flex: 1; overflow-y: auto;
    display: flex; flex-direction: column;
}

/* Video Container */
.video-container {
    position: relative; width: 100%;
    background: #000; aspect-ratio: 16/9;
    flex-shrink: 0; max-height: 80vh;
    transition: aspect-ratio 0.3s ease, max-height 0.3s ease;
}

/* ── Vertical (9:16) stream on desktop ────────────────────── */
/* Narrows the container so the video doesn't have massive black bars.
   The stream-main flex item shrinks, giving chat sidebar more room. */
@media (min-width: 769px) {
    .video-container.is-vertical {
        aspect-ratio: unset;
        max-height: 85vh;
    }
    .video-container.is-vertical #video-element,
    .video-container.is-vertical #video-canvas {
        max-height: 85vh;
    }
    /* Widen the chat sidebar when stream is vertical — the video is narrow so there's room */
    .stream-layout:has(.video-container.is-vertical) .chat-sidebar {
        width: clamp(340px, 35vw, 500px);
        transition: width 0.3s ease;
    }
}
.video-placeholder {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    color: var(--text-muted); gap: 12px;
    padding: 16px;
    text-align: center;
    font-size: clamp(0.82rem, 2vw, 1rem);
}
#video-canvas {
    width: 100%; height: 100%;
    display: none;
}
#video-element {
    width: 100%; height: 100%;
    display: none; object-fit: contain;
}
.video-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    padding: 0; opacity: 0;
    transition: opacity 0.3s;
    z-index: 5;
}
.video-container:hover .video-overlay { opacity: 1; }
.video-container.always-show-controls .video-overlay { opacity: 1; }

/* ── Custom Themed Player Controls ──────────────────────────── */
.video-controls {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px;
}
.vc-btn {
    background: none; border: none; color: #fff;
    font-size: 1rem; padding: 6px 8px; border-radius: var(--radius-sm);
    opacity: 0.9; transition: all 0.2s; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    min-width: 32px; min-height: 32px;
}
.vc-btn:hover { opacity: 1; background: rgba(255,255,255,0.15); color: var(--accent-light); }
.vc-btn:active { transform: scale(0.92); }
.vc-btn.active { color: var(--accent); }
.vc-spacer { flex: 1; }

/* Volume group */
.vc-volume-group {
    display: flex; align-items: center; gap: 2px;
}
.vc-volume-group .volume-slider {
    width: 0; opacity: 0; transition: width 0.3s, opacity 0.3s;
    overflow: hidden;
}
.vc-volume-group:hover .volume-slider,
.vc-volume-group .volume-slider:focus {
    width: 80px; opacity: 1;
}
.volume-slider {
    -webkit-appearance: none; appearance: none;
    height: 4px; background: rgba(255,255,255,0.3);
    border-radius: 2px; outline: none; cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--accent); cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 0 4px rgba(0,0,0,0.4);
}
.volume-slider::-moz-range-thumb {
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--accent); cursor: pointer;
    border: 2px solid #fff;
}
.volume-slider::-webkit-slider-runnable-track {
    height: 4px; border-radius: 2px;
}

/* Badges */
.viewer-badge, .uptime-badge {
    font-size: 0.75rem; color: rgba(255,255,255,0.85);
    display: flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.08);
}
.viewer-badge i { color: var(--live-red); }
.uptime-badge i { color: var(--accent); }

/* ── DVR Progress Bar (Live Stream Seeking) ─────────────────── */
.dvr-progress-wrap {
    width: 100%; padding: 4px 12px 0;
    cursor: pointer;
}
.dvr-progress-bar {
    position: relative;
    height: 4px; background: rgba(255,255,255,0.2);
    border-radius: 2px; overflow: visible;
    transition: height 0.15s;
}
.dvr-progress-wrap:hover .dvr-progress-bar {
    height: 6px;
}
.dvr-progress-fill {
    height: 100%; background: #e53e3e;
    border-radius: 2px; width: 100%;
    position: relative; transition: none;
}
.dvr-progress-fill::after {
    content: '';
    position: absolute; right: -6px; top: 50%;
    transform: translateY(-50%) scale(0);
    width: 12px; height: 12px; border-radius: 50%;
    background: #e53e3e; border: 2px solid #fff;
    box-shadow: 0 0 4px rgba(0,0,0,0.4);
    transition: transform 0.15s;
}
.dvr-progress-wrap:hover .dvr-progress-fill::after {
    transform: translateY(-50%) scale(1);
}
.dvr-progress-buffer {
    position: absolute; top: 0; left: 0;
    height: 100%; background: rgba(255,255,255,0.15);
    border-radius: 2px; width: 0%;
}
/* DVR in non-live (rewound) mode: use accent color instead of red */
.dvr-rewound .dvr-progress-fill { background: var(--accent); }
.dvr-rewound .dvr-progress-fill::after { background: var(--accent); }

.dvr-time-display {
    font-size: 0.75rem; color: rgba(255,255,255,0.85);
    font-family: var(--font-mono);
    white-space: nowrap; padding: 0 4px;
    min-width: 82px; text-align: center;
}

.dvr-live-btn {
    background: #e53e3e !important; color: #fff !important;
    font-size: 0.7rem !important; font-weight: 700;
    padding: 3px 10px !important; border-radius: 4px !important;
    gap: 4px; letter-spacing: 0.5px;
    animation: livePulse 1.5s infinite;
}
.dvr-live-btn:hover { background: #c53030 !important; }
.dvr-live-btn.dvr-behind {
    background: rgba(255,255,255,0.15) !important;
    border: 1px solid rgba(255,255,255,0.3);
    animation: none;
}

/* Progress bar (for VOD/clip players) */
.vc-progress-wrap {
    width: 100%; padding: 4px 12px 0;
    cursor: pointer;
}
.vc-progress-bar {
    position: relative;
    height: 4px; background: rgba(255,255,255,0.2);
    border-radius: 2px; overflow: visible;
    transition: height 0.15s;
}
.vc-progress-wrap:hover .vc-progress-bar {
    height: 6px;
}
.vc-progress-fill {
    height: 100%; background: var(--accent);
    border-radius: 2px; width: 0%;
    position: relative; transition: none;
}
.vc-progress-fill::after {
    content: '';
    position: absolute; right: -6px; top: 50%;
    transform: translateY(-50%) scale(0);
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--accent); border: 2px solid #fff;
    box-shadow: 0 0 4px rgba(0,0,0,0.4);
    transition: transform 0.15s;
}
.vc-progress-wrap:hover .vc-progress-fill::after {
    transform: translateY(-50%) scale(1);
}
.vc-progress-buffer {
    position: absolute; top: 0; left: 0;
    height: 100%; background: rgba(255,255,255,0.15);
    border-radius: 2px; width: 0%;
}
.vc-time-display {
    font-size: 0.75rem; color: rgba(255,255,255,0.85);
    font-family: var(--font-mono);
    white-space: nowrap; padding: 0 4px;
    min-width: 82px; text-align: center;
}
.vc-speed-btn {
    font-size: 0.7rem; padding: 2px 6px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.85);
    font-family: var(--font-mono);
    border: none; cursor: pointer;
    transition: all 0.2s;
}
.vc-speed-btn:hover { background: rgba(255,255,255,0.2); color: var(--accent-light); }

/* ── VOD/Clip Custom Player ─────────────────────────────────── */
.vod-player-container {
    position: relative; width: 100%;
    background: #000; border-radius: 0;
    overflow: hidden;
}
.vod-player-container video,
.vod-player-container .vod-video {
    width: 100%; max-height: 70vh;
    display: block; object-fit: contain;
}
.vod-player-container .video-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    padding: 0; opacity: 0;
    transition: opacity 0.3s; z-index: 5;
}
.vod-player-container:hover .video-overlay { opacity: 1; }
.vod-player-container.paused .video-overlay { opacity: 1; }

/* Live VOD indicator */
.vp-live-indicator {
    position: absolute; top: 12px; right: 12px;
    display: flex; align-items: center; gap: 8px;
    z-index: 10; opacity: 1; pointer-events: auto;
}
.vp-live-badge {
    background: #e53e3e; color: #fff;
    padding: 4px 10px; border-radius: 4px;
    font-size: 12px; font-weight: 700;
    letter-spacing: 0.5px;
    display: flex; align-items: center; gap: 5px;
}
.vp-live-badge i { font-size: 8px; animation: livePulse 1.5s infinite; }
@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.vp-jump-live-btn {
    background: rgba(255,255,255,0.15); color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 4px 10px; border-radius: 4px;
    font-size: 11px; cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
}
.vp-jump-live-btn:hover { background: rgba(255,255,255,0.3); }

/* Live progress bar: red tint for the fill */
.vp-live-mode .vc-progress-fill { background: #e53e3e; }
.vp-live-mode .vc-progress-fill::after { background: #e53e3e; }

/* Fullscreen adaptations */
.video-container:fullscreen { max-height: none; }
.video-container:fullscreen .video-overlay { opacity: 0; }
.video-container:fullscreen:hover .video-overlay { opacity: 1; }
.vod-player-container:fullscreen video { max-height: 100vh; }
.vod-player-container:fullscreen .video-overlay { opacity: 0; }
.vod-player-container:fullscreen:hover .video-overlay { opacity: 1; }

.fullscreen-chat-overlay {
    position: absolute;
    inset: 0;
    display: none;
    pointer-events: none;
    z-index: 18;
    padding: 18px;
}
.video-container:fullscreen.fs-chat-enabled .fullscreen-chat-overlay {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
}
.fullscreen-chat-messages {
    width: min(420px, 34vw);
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: auto;
}
.fullscreen-chat-msg {
    align-self: flex-end;
    width: 100%;
    padding: 10px 12px;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, rgba(12, 15, 24, 0.88), rgba(12, 15, 24, 0.62));
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 14px 34px rgba(0,0,0,0.34);
    backdrop-filter: blur(10px);
    line-height: 1.45;
    word-break: break-word;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.45s ease, transform 0.45s ease;
}
.fullscreen-chat-msg.is-fading {
    opacity: 0;
    transform: translateY(-6px);
}
.fullscreen-chat-msg.system {
    color: rgba(255,255,255,0.82);
    font-style: italic;
}
.fullscreen-chat-msg.donation {
    border-color: rgba(192,150,92,0.5);
    background: linear-gradient(135deg, rgba(96, 70, 22, 0.88), rgba(28, 22, 12, 0.72));
}
.fullscreen-chat-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.fullscreen-chat-user {
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.fullscreen-chat-text {
    color: rgba(255,255,255,0.96);
}
.fullscreen-chat-text .chat-emote {
    vertical-align: middle;
}
.fullscreen-chat-chrome {
    width: min(420px, 34vw);
    max-width: 100%;
    margin-top: 12px;
    pointer-events: auto;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.fullscreen-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: rgba(255,255,255,0.86);
    font-size: 0.8rem;
    padding: 0 4px 8px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.45);
}
.fullscreen-chat-header span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.fullscreen-chat-hint {
    color: rgba(255,255,255,0.56);
    font-size: 0.72rem;
}
.fullscreen-chat-input-area {
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(10, 12, 18, 0.82);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.35);
}
.fullscreen-chat-textarea {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.12);
    color: #fff;
}
.fullscreen-chat-textarea::placeholder {
    color: rgba(255,255,255,0.55);
}
.video-container:fullscreen.fs-chat-idle .fullscreen-chat-chrome {
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
}

@media (max-width: 900px) {
    .fullscreen-chat-messages,
    .fullscreen-chat-chrome {
        width: min(100%, 420px);
    }
}

/* Stream Info */
.stream-info { padding: 16px 20px; }
.stream-info-header {
    display: flex; align-items: flex-start; gap: 12px;
    flex-wrap: wrap;
}
.streamer-avatar {
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--accent); color: #000;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; font-weight: 700; flex-shrink: 0;
}
.stream-info-text { flex: 1; min-width: 200px; }
.stream-info-text h2 { font-size: 1.2rem; line-height: 1.3; }
.stream-info-text p { color: var(--text-secondary); font-size: 0.9rem; }
.stream-actions {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.follower-count { font-size: 0.85rem; color: var(--text-muted); }

.stream-description {
    margin-top: 12px; padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    font-size: 0.9rem; line-height: 1.6;
    color: var(--text-secondary);
    max-height: 200px; overflow-y: auto;
}

/* Donation Goal Bar */
.goal-bar-wrap {
    margin: 16px 0; padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius); border: 1px solid var(--border);
}
.goal-label { font-weight: 600; margin-bottom: 6px; color: var(--accent); }
.goal-bar {
    height: 20px; background: var(--bg-primary);
    border-radius: 10px; overflow: hidden;
}
.goal-fill {
    height: 100%; background: linear-gradient(90deg, var(--accent-dark), var(--accent));
    border-radius: 10px; transition: width 0.5s ease;
}
.goal-amounts {
    font-size: 0.8rem; color: var(--text-secondary);
    text-align: right; margin-top: 4px;
}

/* Controls Panel */
.controls-panel {
    margin: 16px 0; padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius); border: 1px solid var(--border);
}
.controls-header h3 { font-size: 1rem; color: var(--accent); margin-bottom: 8px; }
.controls-grid {
    display: flex; gap: 8px; flex-wrap: wrap;
}
.control-btn {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 10px 14px; background: var(--bg-hover);
    border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--text-primary); font-size: 0.8rem;
    min-width: 60px; cursor: pointer;
    transition: all 0.15s;
}
.control-btn:hover { border-color: var(--accent); color: var(--accent); }
.control-btn:active { background: var(--accent); color: #000; }
.control-btn i { font-size: 1.2rem; }
.control-btn.on-cooldown { opacity: 0.5; pointer-events: none; }

/* Multi-cam */
.multicam-bar {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 20px; background: var(--bg-secondary);
    border-top: 1px solid var(--border); font-size: 0.9rem;
    color: var(--text-secondary);
}
.multicam-bar button {
    padding: 4px 12px; border-radius: var(--radius);
    background: var(--bg-hover); border: 1px solid var(--border);
    color: var(--text-primary); font-size: 0.8rem;
}
.multicam-bar button.active { background: var(--accent); color: #000; border-color: var(--accent); }

/* VOD Section */
.vod-section { padding: 16px 20px; }
.tab-bar { display: flex; gap: 4px; margin-bottom: 12px; }
.tab-btn {
    padding: 6px 16px; border-radius: var(--radius);
    background: none; border: 1px solid var(--border);
    color: var(--text-secondary); font-size: 0.85rem;
    transition: all 0.2s;
}
.tab-btn:hover { border-color: var(--accent-dark); }
.tab-btn.active { background: var(--accent); color: #000; border-color: var(--accent); }

/* ═══════════════════════════════════════════════════════════════
   CHAT SIDEBAR
   ═══════════════════════════════════════════════════════════════ */
.chat-sidebar {
    width: var(--chat-w); background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    display: flex; flex-direction: column;
    flex-shrink: 0;
}
.chat-header {
    padding: 10px 14px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.85rem; font-weight: 700; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.chat-header-actions { display: flex; align-items: center; gap: 2px; }
.chat-settings-btn { background: none; border: none; color: var(--text-muted); font-size: 1rem; cursor: pointer; padding: 4px 6px; border-radius: var(--radius-sm); transition: all 0.15s; }
.chat-settings-btn:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.mobile-chat-close { display: none; background: none; border: none; color: var(--text-muted); font-size: 1.1rem; cursor: pointer; padding: 4px 8px; border-radius: var(--radius-sm); transition: all 0.15s; }
.mobile-chat-close:hover { color: var(--text-primary); background: var(--bg-tertiary); }

/* ── Chat Users Panel ────────────────────────────────────── */
.chat-users-panel {
    display: none; background: var(--bg-tertiary); border-bottom: 1px solid var(--border);
    max-height: 280px; overflow-y: auto; font-size: 0.82rem;
    animation: cspSlideDown 0.15s ease-out;
}
.chat-users-panel.open { display: block; }
.chat-users-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; font-weight: 600; color: var(--text-secondary);
    font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border); position: sticky; top: 0;
    background: var(--bg-tertiary); z-index: 1;
}
.chat-users-close {
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    padding: 2px 4px; border-radius: var(--radius-sm); font-size: 0.85rem;
}
.chat-users-close:hover { color: var(--text-primary); }
.chat-users-list { padding: 4px 0; }
.chat-users-row {
    display: flex; align-items: center; gap: 8px; padding: 4px 12px;
    transition: background 0.1s;
}
.chat-users-row:hover { background: var(--bg-secondary); }
.chat-users-link {
    display: flex; align-items: center; gap: 8px;
    color: var(--text-primary); text-decoration: none; width: 100%;
}
.chat-users-avatar {
    width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.chat-users-avatar-default {
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-secondary); color: var(--text-muted); font-size: 0.65rem;
}
.chat-users-name { font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-users-badge {
    font-size: 0.65rem; padding: 1px 4px; border-radius: 3px; flex-shrink: 0; margin-left: auto;
}
.chat-users-badge.admin { color: #ff6b6b; }
.chat-users-badge.mod { color: #51cf66; }
.chat-users-badge.streamer { color: #9775fa; }
.chat-users-anon { color: var(--text-muted); }
.chat-users-empty { padding: 16px 12px; text-align: center; color: var(--text-muted); }

/* ── Chat Settings Panel ─────────────────────────────────── */
.chat-settings-panel {
    background: var(--bg-tertiary); border-bottom: 1px solid var(--border);
    max-height: 400px; overflow-y: auto; font-size: 0.82rem;
    animation: cspSlideDown 0.15s ease-out;
}
@keyframes cspSlideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 400px; }
}
.csp-section { padding: 8px 14px 4px; }
.csp-section + .csp-section { border-top: 1px solid var(--border); }
.csp-title {
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.6px; color: var(--text-muted); margin-bottom: 6px;
    display: flex; align-items: center; gap: 5px;
}
.csp-title i { font-size: 0.65rem; }
.csp-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 4px 0; color: var(--text-secondary); cursor: pointer;
    gap: 8px;
}
.csp-row:hover { color: var(--text-primary); }
.csp-row span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.csp-row input[type="checkbox"] {
    width: 15px; height: 15px; accent-color: var(--accent);
    cursor: pointer; flex-shrink: 0;
}
.csp-row select {
    background: var(--bg-input); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 2px 6px; font-size: 0.78rem; font-family: var(--font);
    cursor: pointer; max-width: 100px;
}
.csp-row select:focus { outline: none; border-color: var(--accent-dark); }
.csp-footer {
    padding: 6px 14px 10px; border-top: 1px solid var(--border);
    text-align: center;
}
.csp-footer .btn { font-size: 0.72rem; padding: 4px 12px; opacity: 0.7; }
.csp-footer .btn:hover { opacity: 1; }

/* ── Chat Settings Toggle Classes ────────────────────────── */
/* Font sizes */
.chat-font-small .chat-msg { font-size: 0.75rem; }
.chat-font-small .chat-msg.system { font-size: 0.7rem; }
.chat-font-large .chat-msg { font-size: 1rem; }
.chat-font-large .chat-msg.system { font-size: 0.9rem; }
/* Hide avatars */
.chat-hide-avatars .chat-avatar-wrap { display: none !important; }
/* Hide badges */
.chat-hide-badges .chat-badge { display: none !important; }
/* Alternating backgrounds */
.chat-alt-bg .chat-msg:nth-child(even) { background: rgba(255,255,255,0.02); border-radius: 2px; padding: 2px 4px; }
/* Hide system messages */
.chat-hide-system .chat-msg.system { display: none !important; }
/* Disable animated emotes — freeze GIFs by converting to static first frame */
.chat-no-animated-emotes .chat-emote-animated { animation: none !important; animation-play-state: paused !important; }
/* Emote scale */
.chat-emote-small .chat-emote { height: 1.1em; }
.chat-emote-large .chat-emote { height: 2.2em; }
/* Mention highlight */
.chat-msg-mention {
    background: rgba(255, 200, 50, 0.12); border-left: 2px solid var(--accent);
    padding: 2px 4px 2px 6px; border-radius: 2px;
    animation: mentionFlash 0.4s ease-out;
}
@keyframes mentionFlash {
    0% { background: rgba(255, 200, 50, 0.3); }
    100% { background: rgba(255, 200, 50, 0.12); }
}

.chat-messages {
    flex: 1; overflow-y: auto;
    padding: 8px 12px;
    display: flex; flex-direction: column;
    gap: 2px;
}
.chat-msg {
    font-size: 0.85rem; line-height: 1.4;
    padding: 2px 0; word-break: break-word;
    position: relative;
}

/* ── Reply button (hover action) ─────────────────────────── */
.chat-msg-hoverable .chat-reply-btn {
    display: none;
    position: absolute;
    right: 4px; top: 2px;
    padding: 2px 6px;
    font-size: 0.65rem;
    background: var(--bg-card, #1e1e2e);
    border: 1px solid var(--border, #333);
    border-radius: var(--radius-sm, 4px);
    color: var(--text-muted, #888);
    cursor: pointer;
    z-index: 5;
    line-height: 1;
    transition: color 0.15s, border-color 0.15s;
}
.chat-msg-hoverable:hover .chat-reply-btn { display: inline-flex; }
.chat-msg-hoverable .chat-reply-btn:hover {
    color: var(--accent, #c0965c);
    border-color: var(--accent, #c0965c);
}

/* ── Reply header (on replied messages) ──────────────────── */
.chat-reply-header {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    color: var(--text-muted, #888);
    padding: 1px 0 2px 0;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 100%;
    margin-left: 2px;
}
.chat-reply-header:hover { color: var(--text-secondary, #aaa); }
.chat-reply-header i { font-size: 0.6rem; opacity: 0.7; flex-shrink: 0; }
.chat-reply-user { font-weight: 600; color: var(--text-secondary, #aaa); flex-shrink: 0; }
.chat-reply-snippet {
    opacity: 0.6;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-left: 4px;
}

/* ── Reply context bar (above chat input) ────────────────── */
.chat-reply-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    margin-bottom: 4px;
    background: color-mix(in srgb, var(--accent, #c0965c) 8%, var(--bg-card, #1e1e2e));
    border: 1px solid color-mix(in srgb, var(--accent, #c0965c) 20%, var(--border, #333));
    border-radius: var(--radius, 6px);
    font-size: 0.78rem;
    color: var(--text-secondary, #aaa);
    overflow: hidden;
    animation: chat-reply-bar-in 0.15s ease-out;
}
@keyframes chat-reply-bar-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.chat-reply-bar-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.chat-reply-bar-content i {
    color: var(--accent, #c0965c);
    font-size: 0.7rem;
    flex-shrink: 0;
}
.chat-reply-bar-content strong {
    color: var(--text-primary, #fff);
    flex-shrink: 0;
}
.chat-reply-bar-snippet {
    opacity: 0.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-left: 4px;
}
.chat-reply-bar-close {
    flex-shrink: 0;
    padding: 2px 5px;
    border: none;
    background: transparent;
    color: var(--text-muted, #888);
    cursor: pointer;
    font-size: 0.8rem;
    border-radius: var(--radius-sm, 4px);
    transition: color 0.15s, background 0.15s;
}
.chat-reply-bar-close:hover {
    color: var(--text-primary, #fff);
    background: rgba(255,255,255,0.08);
}

/* ── Reply flash (scroll-to highlight) ───────────────────── */
.chat-msg-reply-flash {
    animation: reply-flash 1.5s ease-out;
}
@keyframes reply-flash {
    0%   { background: color-mix(in srgb, var(--accent, #c0965c) 25%, transparent); }
    100% { background: transparent; }
}

.chat-msg .chat-user {
    font-weight: 600; cursor: pointer;
}
.chat-msg .chat-user:hover { text-decoration: underline; }
.chat-msg.system {
    color: var(--text-muted); font-style: italic;
    font-size: 0.8rem;
}
.chat-msg.donation {
    background: linear-gradient(90deg, rgba(192,150,92,0.15), transparent);
    padding: 6px 8px; border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
}
.chat-msg.gotti {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(192,150,92,0.14), rgba(116,92,255,0.08));
    border: 1px solid rgba(192,150,92,0.18);
}
.gotti-card {
    flex: 1 1 100%;
    margin-left: 28px;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(0,0,0,0.24);
    border: 1px solid rgba(255,255,255,0.08);
}
.gotti-card-media {
    background: rgba(0,0,0,0.25);
}
.gotti-card-image,
.fullscreen-chat-gotti {
    display: block;
    width: 100%;
    height: auto;
    max-height: 280px;
    object-fit: cover;
}
.gotti-card-copy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
}
.gotti-card-title {
    font-weight: 700;
    color: var(--text-primary, #fff);
}
.gotti-card-link {
    flex-shrink: 0;
    color: var(--accent, #c0965c);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 700;
}
.gotti-card-link:hover {
    text-decoration: underline;
}
.fullscreen-chat-msg.gotti {
    border-left: 3px solid var(--accent, #c0965c);
}
.fullscreen-chat-gotti {
    margin-top: 8px;
    border-radius: 10px;
    max-height: 180px;
}

@media (max-width: 640px) {
    .gotti-card {
        margin-left: 0;
    }

    .gotti-card-copy {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ── New messages indicator (shown when user scrolls up) ──── */
.chat-new-msgs-indicator {
    display: none; position: relative; margin: 0 auto;
    z-index: 10; padding: 5px 14px; border-radius: 20px 20px 0 0;
    background: var(--accent, #c0965c); color: #fff; font-size: 0.78rem; font-weight: 600;
    border: none; cursor: pointer; gap: 6px; align-items: center; justify-content: center;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.3);
    transition: opacity 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.chat-new-msgs-indicator:hover { opacity: 0.85; }
.chat-new-msgs-indicator i { font-size: 0.7rem; }

/* ── Cross-feed messages (global/other streams in stream chat) ── */
.chat-msg-crossfeed {
    border-left: 2px solid rgba(255,255,255,0.08);
    padding-left: 6px;
    opacity: 0.85;
}
.chat-crossfeed-badge {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 0.65rem; font-weight: 600;
    padding: 1px 5px; border-radius: 3px;
    vertical-align: middle; margin-right: 3px;
}
.chat-crossfeed-global {
    background: rgba(99, 179, 237, 0.18); color: #63b3ed;
}
.chat-crossfeed-stream {
    background: rgba(237, 137, 54, 0.18); color: #ed8936;
}
.csp-hint {
    font-size: 0.72rem; color: var(--text-muted, #888);
    margin: 0 0 6px 0; padding: 0;
}

.chat-msg .chat-badge {
    display: inline-flex; align-items: center;
    margin-right: 4px;
}
.chat-msg .chat-badge i { font-size: 0.7rem; }
.chat-badge-streamer { color: var(--live-red); }
.chat-badge-mod { color: var(--success); }
.chat-badge-admin { color: var(--warning); }
.chat-badge-sub { color: var(--info); }

.chat-input-area {
    border-top: 1px solid var(--border);
    padding: 8px;
}

/* ── Slow Mode Indicator ──────────────────────────────────── */
.chat-slowmode-banner {
    display: none;
    margin-bottom: 6px;
    padding: 5px 8px;
    background: color-mix(in srgb, var(--warning) 12%, var(--bg-card));
    border: 1px solid color-mix(in srgb, var(--warning) 25%, var(--border));
    border-radius: var(--radius);
    font-size: 0.75rem;
    color: var(--text-muted);
    overflow: hidden;
    position: relative;
}
.chat-slowmode-info {
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
    z-index: 1;
}
.chat-slowmode-info i {
    color: var(--warning);
    font-size: 0.7rem;
}
.chat-slowmode-label {
    font-weight: 600;
    color: var(--text-secondary, var(--text-muted));
}
.chat-slowmode-duration {
    color: var(--warning);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.chat-slowmode-bar {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: transparent;
}
.chat-slowmode-fill {
    height: 100%;
    width: 0%;
    background: var(--warning);
    border-radius: 0 0 var(--radius) var(--radius);
    opacity: 0.5;
}
.chat-slowmode-banner.cooldown .chat-slowmode-info i {
    animation: slowmode-pulse 1s ease-in-out infinite;
}
.chat-send-btn.disabled {
    opacity: 0.4;
    pointer-events: none;
}
@keyframes slowmode-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.donation-quick { margin-bottom: 6px; }
.chat-input-row {
    display: flex; gap: 4px; align-items: flex-end;
}
.chat-textarea {
    flex: 1; min-width: 0; padding: 8px 10px;
    background: var(--bg-input); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: var(--radius);
    font-family: var(--font); font-size: 0.85rem; outline: none;
    transition: border-color 0.2s;
    resize: none; overflow-y: hidden;
    line-height: 1.4;
    min-height: 36px; max-height: 108px; /* ~4 lines */
    field-sizing: content; /* modern browsers auto-size */
}
.chat-textarea::placeholder {
    color: var(--text-muted);
}
.chat-textarea:focus {
    border-color: var(--accent-dark);
}
/* Legacy fallback selector for any remaining input[type=text] */
.chat-input-row input[type="text"] {
    flex: 1; min-width: 0; padding: 8px 10px;
    background: var(--bg-input); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: var(--radius);
    font-family: var(--font); font-size: 0.85rem; outline: none;
    transition: border-color 0.2s;
}
.chat-input-row input[type="text"]::placeholder {
    color: var(--text-muted);
}
.chat-input-row input[type="text"]:focus {
    border-color: var(--accent-dark);
}
.chat-send-btn {
    flex-shrink: 0;
    padding: 8px 10px; background: var(--accent-dark);
    border: none; border-radius: var(--radius);
    color: var(--text-primary); font-size: 0.9rem;
    cursor: pointer; transition: background 0.15s;
}
.chat-send-btn:hover { background: var(--accent); color: #000; }

/* ── Chat Autocomplete Popup ──────────────────────────────── */
.chat-autocomplete-popup {
    position: fixed;
    background: var(--bg-card, #1e1e2e);
    border: 1px solid var(--border, #333);
    border-radius: var(--radius, 8px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.45);
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 0;
    font-family: var(--font);
    font-size: 0.84rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border, #444) transparent;
    animation: ac-fade-in 0.1s ease;
}
@keyframes ac-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.chat-autocomplete-popup::-webkit-scrollbar { width: 5px; }
.chat-autocomplete-popup::-webkit-scrollbar-thumb {
    background: var(--border, #444); border-radius: 3px;
}
.ac-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    color: var(--text-primary, #cdd6f4);
    transition: background 0.08s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ac-item:hover, .ac-item.ac-selected {
    background: var(--bg-hover, rgba(255,255,255,0.08));
}
.ac-item.ac-selected {
    background: color-mix(in srgb, var(--accent-dark, #7c3aed) 25%, var(--bg-card, #1e1e2e));
}
.ac-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}
.ac-desc {
    color: var(--text-muted, #888);
    font-size: 0.75rem;
    margin-left: auto;
    flex-shrink: 0;
    padding-left: 8px;
}
.ac-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-size: 0.75rem;
    color: var(--text-muted, #888);
    flex-shrink: 0;
}
.ac-emote-thumb {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 3px;
}
.ac-user-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.chat-tts-toggle {
    flex-shrink: 0;
    padding: 6px 8px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0.5;
}
.chat-tts-toggle.tts-active {
    color: var(--accent);
    border-color: var(--accent-dark);
    opacity: 1;
}
.chat-tts-toggle:hover {
    background: var(--bg-hover);
    color: var(--accent);
    opacity: 1;
}

.tts-toggle {
    font-size: 0.8rem; color: var(--text-muted);
    margin-bottom: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   CHAT AVATARS
   ═══════════════════════════════════════════════════════════════ */
.chat-avatar-wrap {
    display: inline-flex; align-items: center; vertical-align: middle;
    margin-right: 4px;
}
.chat-avatar {
    width: 20px; height: 20px; border-radius: 50%;
    object-fit: cover; vertical-align: middle;
}
.chat-avatar-letter {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%;
    font-size: 0.65rem; font-weight: 700;
    color: #fff; vertical-align: middle;
    text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════════
   CHAT CONTEXT MENU
   ═══════════════════════════════════════════════════════════════ */
.chat-context-menu {
    position: fixed; z-index: 9999;
    min-width: min(240px, calc(100vw - 16px)); max-width: min(300px, calc(100vw - 16px));
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    overflow: hidden;
    animation: ctxFadeIn 0.12s ease-out;
}
@keyframes ctxFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.chat-context-menu .ctx-loading {
    padding: 16px; text-align: center; color: var(--text-muted);
    font-size: 0.85rem;
}
.ctx-header {
    display: flex; align-items: center; gap: 10px;
    padding: 12px; background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
}
.ctx-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    object-fit: cover; flex-shrink: 0;
}
.ctx-avatar-letter {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%;
    font-size: 1rem; font-weight: 700;
    color: #fff; flex-shrink: 0;
    text-transform: uppercase;
}
.ctx-info {
    display: flex; flex-direction: column; gap: 1px;
    min-width: 0; overflow: hidden;
}
.ctx-name {
    font-weight: 600; font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ctx-name .chat-badge { margin-right: 3px; }
.ctx-meta {
    font-size: 0.75rem; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ctx-stats {
    display: flex; gap: 12px; padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}
.ctx-stat {
    font-size: 0.8rem; color: var(--text-secondary);
    display: flex; align-items: center; gap: 4px;
}
.ctx-stat i { font-size: 0.7rem; color: var(--text-muted); }
.ctx-game {
    padding: 8px 12px; border-bottom: 1px solid var(--border);
}
.ctx-game-level {
    font-size: 0.8rem; color: var(--accent);
    margin-bottom: 4px;
}
.ctx-skills {
    display: flex; flex-wrap: wrap; gap: 6px;
}
.ctx-skills span {
    font-size: 0.75rem; color: var(--text-secondary);
    display: flex; align-items: center; gap: 2px;
}
.ctx-skills span i { font-size: 0.65rem; color: var(--text-muted); }
.ctx-divider {
    height: 1px; background: var(--border);
}
.ctx-actions {
    display: flex; flex-direction: column;
    padding: 4px;
}
.ctx-btn {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 8px 10px;
    background: transparent; border: none;
    color: var(--text-primary); font-size: 0.85rem;
    border-radius: var(--radius-sm);
    cursor: pointer; text-align: left;
    transition: background 0.1s;
}
.ctx-btn:hover { background: var(--bg-hover); }
.ctx-btn i { width: 16px; text-align: center; color: var(--text-muted); font-size: 0.8rem; }
.ctx-btn-danger { color: var(--danger); }
.ctx-btn-danger i { color: var(--danger); }
.ctx-btn-danger:hover { background: rgba(231,76,60,0.12); }
.ctx-btn-warn { color: var(--warning, #f39c12); }
.ctx-btn-warn i { color: var(--warning, #f39c12); }
.ctx-btn-warn:hover { background: rgba(243,156,18,0.12); }

/* Deleted message fade-out */
.chat-msg-deleted {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.3s, transform 0.3s;
    max-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* ── Rename submenu ── */
.ctx-rename-group { position: relative; }
.ctx-rename-group > .ctx-btn { justify-content: flex-start; }
.ctx-rename-arrow { margin-left: auto; font-size: 0.65rem; transition: transform 0.15s; }
.ctx-rename-group.open .ctx-rename-arrow { transform: rotate(90deg); }
.ctx-rename-submenu {
    display: none; flex-direction: column;
    padding: 2px 0 2px 18px;
}
.ctx-rename-group.open .ctx-rename-submenu { display: flex; }
.ctx-rename-submenu .ctx-btn { font-size: 0.8rem; padding: 6px 10px; }

/* ═══════════════════════════════════════════════════════════════
   CHAT LOGS MODAL
   ═══════════════════════════════════════════════════════════════ */
.chat-logs-modal {
    display: flex; flex-direction: column;
    max-height: 70vh; min-height: 300px;
}
.chat-logs-header {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}
.chat-logs-header h3 {
    margin: 0 0 8px; font-size: 1rem;
    color: var(--text-primary);
}
.chat-logs-search-row {
    display: flex; gap: 6px;
}
.chat-logs-search {
    flex: 1; padding: 6px 10px;
    background: var(--bg-input); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 0.85rem; outline: none;
}
.chat-logs-search:focus { border-color: var(--accent-dark); }
.chat-logs-body {
    flex: 1; overflow-y: auto;
    display: flex; flex-direction: column; gap: 1px;
    min-height: 200px; max-height: 50vh;
    padding: 4px 0;
}
.chat-logs-loading {
    text-align: center; padding: 20px;
    color: var(--text-muted); font-size: 0.85rem;
}
.log-entry {
    padding: 4px 8px; font-size: 0.82rem;
    line-height: 1.4; border-radius: var(--radius-sm);
    word-break: break-word;
}
.log-entry:hover { background: var(--bg-hover); }
.log-time {
    color: var(--text-muted); font-size: 0.75rem;
    margin-right: 6px;
}
.log-stream {
    font-size: 0.72rem; color: var(--accent);
    background: rgba(192,150,92,0.1);
    padding: 1px 5px; border-radius: 3px;
    margin-right: 4px;
}
.log-user { font-weight: 600; }
.log-text { color: var(--text-secondary); }
.chat-logs-footer {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; padding-top: 8px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}
.log-page-info {
    font-size: 0.8rem; color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   EMOTES
   ═══════════════════════════════════════════════════════════════ */
/* Emote picker button */
.emote-picker-btn {
    flex-shrink: 0;
    padding: 8px 10px; background: transparent;
    border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--text-muted); font-size: 1rem; cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.emote-picker-btn:hover {
    color: var(--accent); border-color: var(--accent);
}

/* Emote picker panel */
.emote-picker {
    position: absolute; bottom: 100%; left: 0; right: 0;
    max-height: 320px; margin-bottom: 4px;
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    z-index: 100; flex-direction: column; overflow: hidden;
}
.emote-picker-header { padding: 6px 8px; border-bottom: 1px solid var(--border); }
.emote-search {
    width: 100%; padding: 6px 10px;
    background: var(--bg-input); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 0.8rem; outline: none;
}
.emote-search:focus { border-color: var(--accent-dark); }

.emote-picker-tabs {
    display: flex; gap: 0; border-bottom: 1px solid var(--border);
    overflow-x: auto;
}
.emote-tab-btn {
    flex: 1; padding: 5px 8px; background: transparent;
    border: none; border-bottom: 2px solid transparent;
    color: var(--text-muted); font-size: 0.72rem; cursor: pointer;
    text-transform: uppercase; letter-spacing: 0.3px;
    white-space: nowrap;
}
.emote-tab-btn:hover { color: var(--text-primary); }
.emote-tab-btn.active {
    color: var(--accent); border-bottom-color: var(--accent);
}

.emote-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
    gap: 2px; padding: 6px; overflow-y: auto;
    max-height: 220px;
}
.emote-picker-item {
    display: flex; align-items: center; justify-content: center;
    padding: 4px; border-radius: var(--radius-sm);
    cursor: pointer; transition: background 0.12s;
}
.emote-picker-item:hover {
    background: var(--bg-hover);
}
.emote-picker-item img {
    max-width: 32px; max-height: 32px; object-fit: contain;
}
.emote-picker-empty {
    grid-column: 1 / -1; text-align: center;
    padding: 24px; color: var(--text-muted); font-size: 0.85rem;
}

/* In-line chat emotes */
.chat-emote {
    display: inline-block; vertical-align: middle;
    height: 1.6em; width: auto; margin: -2px 1px;
    object-fit: contain;
}
.chat-emote-animated { image-rendering: auto; }

/* Chat input area needs relative position for picker */
.chat-input-area { position: relative; }

/* ── Dashboard Emotes ──────────────────────────────────────── */
.dash-emote-upload {
    display: flex; gap: 8px; align-items: center;
    flex-wrap: wrap; margin-bottom: 12px;
}
.dash-emote-upload .form-input { max-width: 200px; }
.dash-emote-upload input[type="file"] {
    font-size: 0.8rem; color: var(--text-muted);
}
.dash-emotes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
    gap: 8px;
}
.dash-emote-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px;
    background: var(--bg-input); border-radius: var(--radius);
    border: 1px solid var(--border);
}
.dash-emote-item img {
    width: 32px; height: 32px; object-fit: contain;
}
.dash-emote-code {
    flex: 1; font-family: monospace; font-size: 0.82rem;
    color: var(--text-primary); word-break: break-all;
}
.dash-emote-item .btn-danger {
    margin-left: auto; padding: 4px 8px; font-size: 0.7rem;
}
.dash-emote-sources {
    display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px;
    padding: 10px 12px; background: var(--bg-input); border-radius: var(--radius);
    border: 1px solid var(--border);
}
.emote-source-toggle {
    display: flex; align-items: center; gap: 5px; cursor: pointer;
    font-size: 0.82rem; color: var(--text-secondary);
    user-select: none;
}
.emote-source-toggle input[type="checkbox"] {
    accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer;
}
.emote-src-label { white-space: nowrap; }
.emote-src-label i { margin-right: 2px; }

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD
   ═══════════════════════════════════════════════════════════════ */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr));
    gap: 20px; margin-top: 20px;
}
.dash-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 18px; padding: 20px;
    box-shadow: var(--shadow-soft);
    background-image: linear-gradient(180deg, rgba(255,255,255,0.02), transparent 60%);
}
.dash-card h3 {
    font-size: 1rem; color: var(--accent);
    margin-bottom: 16px;
    display: flex; align-items: center; gap: 8px;
}
.dash-card-wide { grid-column: 1/-1; }

.form-group { margin-bottom: 12px; }
.form-group label {
    display: block; font-size: 0.85rem;
    color: var(--text-secondary); margin-bottom: 4px;
}
.form-input {
    width: 100%; padding: 10px 12px;
    background: var(--bg-input); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 0.9rem; outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.form-input:focus {
    border-color: var(--accent-dark);
    box-shadow: 0 0 0 3px rgba(192,150,92,0.12);
    background: rgba(18,18,26,0.96);
}
select.form-input { cursor: pointer; }
textarea.form-input { resize: vertical; min-height: 60px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

.key-display { display: flex; gap: 6px; flex-wrap: wrap; }
.key-display .form-input { flex: 1; }

.endpoint-info {
    margin-top: 12px; padding: 12px;
    background: var(--bg-primary); border-radius: var(--radius);
    font-family: var(--font-mono); font-size: 0.8rem;
    color: var(--text-secondary); word-break: break-all;
    white-space: pre-wrap;
}

.funds-display {
    text-align: center; margin-bottom: 16px;
}
.funds-amount {
    font-size: 2rem; font-weight: 700;
    color: var(--accent);
}
.funds-usd {
    display: block; font-size: 0.9rem;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   ADMIN PANEL
   ═══════════════════════════════════════════════════════════════ */
.admin-stats {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
    gap: 12px; margin: 20px 0;
}
.admin-stat {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px; text-align: center;
}
.admin-stat-value { font-size: 1.8rem; font-weight: 700; color: var(--accent); }
.admin-stat-label { font-size: 0.8rem; color: var(--text-muted); }

.admin-tabs { display: flex; gap: 4px; margin-bottom: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-tabs .tab-btn { flex-shrink: 0; }
.admin-content {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px;
    min-height: 300px;
    overflow-x: auto;
    box-shadow: var(--shadow-soft);
}

/* Admin Table */
.admin-table {
    width: 100%; border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 720px;
}
.admin-table th {
    text-align: left; padding: 8px 12px;
    border-bottom: 2px solid var(--border);
    color: var(--text-secondary); font-weight: 600;
}
.admin-table td {
    padding: 8px 12px; border-bottom: 1px solid var(--border);
}
.admin-table tr:hover { background: var(--bg-hover); }

.admin-sensitive-field {
    display: grid;
    gap: 8px;
    margin-top: 4px;
}

.admin-sensitive-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-secret-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
}

.admin-secret-value {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
    background: var(--bg-input);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.admin-secret-value.is-masked {
    letter-spacing: 0.08em;
    user-select: none;
}

.admin-sensitive-textarea {
    transition: filter 0.15s ease;
}

.admin-sensitive-textarea.is-masked {
    filter: blur(6px);
    user-select: none;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════
   PROFILE
   ═══════════════════════════════════════════════════════════════ */
.profile-header {
    text-align: center; padding: 40px 20px;
}
.profile-avatar {
    width: 80px; height: 80px; border-radius: 50%;
    background: var(--accent); color: #000;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 700;
    margin-bottom: 12px;
}
.profile-header h2 { font-size: 1.5rem; }
.profile-header .profile-bio {
    color: var(--text-secondary); max-width: 500px;
    margin: 8px auto; font-size: 0.95rem;
}

/* ═══════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════ */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.7); z-index: 2000;
    align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
    background: var(--bg-tertiary); border: 1px solid var(--border);
    border-radius: 20px; padding: 24px;
    max-width: 440px; width: 90%;
    max-height: 80vh; overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
    background-image: linear-gradient(180deg, rgba(255,255,255,0.03), transparent 55%);
}
.modal-close {
    position: absolute; top: 12px; right: 16px;
    background: none; border: none; color: var(--text-muted);
    font-size: 1.4rem; line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }
.modal h3 {
    font-size: 1.2rem; margin-bottom: 16px;
    color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════ */
.toast-container {
    position: fixed; bottom: 20px; right: 20px;
    z-index: 3000; display: flex; flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 12px 20px; border-radius: var(--radius);
    background: var(--bg-tertiary); color: var(--text-primary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    font-size: 0.9rem;
    display: flex; align-items: center; gap: 8px;
    animation: toast-in 0.3s ease;
    max-width: min(350px, calc(100vw - 32px));
    backdrop-filter: blur(16px);
}
.toast.success { border-color: var(--success); }
.toast.success i { color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.error i { color: var(--danger); }
.toast.info { border-color: var(--info); }
.toast.info i { color: var(--info); }
@keyframes toast-in {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 8px 16px;
}
.footer-content {
    max-width: 1400px; margin: 0 auto;
    display: flex; align-items: center; justify-content: center;
    gap: 10px; flex-wrap: wrap; font-size: 0.8rem;
}
.footer-brand { color: var(--accent); font-weight: 600; }
.footer-brand i { margin-right: 4px; }
.footer-content a { color: var(--text-muted); font-size: 1rem; transition: color 0.15s; }
.footer-content a:hover { color: var(--accent); }
.footer-divider { color: var(--border-light); font-size: 0.7rem; }
.footer-copy { color: var(--text-muted); font-size: 0.75rem; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
/* 1200px: Compact nav labels, tighten spacing */
@media (max-width: 1200px) {
    .navbar { gap: 12px; padding: 0 12px; }
    .nav-link { padding: 8px 10px; gap: 5px; font-size: 0.85rem; }
    .nav-right { gap: 8px; }
    #nav-username { display: none; }
    .nav-avatar-wrap { gap: 4px; padding: 4px; }
    .nav-balance, .nav-coins { padding: 4px 8px; font-size: 0.8rem; }
    #nav-auth-anon, #nav-auth-user { gap: 8px; }
}

/* 1024px: Hamburger menu + hide nav links (catches Steam Deck & small laptops) */
@media (max-width: 1024px) {
    .navbar { gap: 8px; padding: 0 10px; }
    .nav-brand { font-size: 1.1rem; }
    .nav-brand i { font-size: 1.2rem; }

    /* Hide inline nav links — hamburger takes over */
    .nav-links { display: none; }
    .nav-links-wrap { display: contents; }
    .nav-links-wrap .nav-scroll-btn { display: none !important; }
    .nav-hamburger { display: flex; }

    /* Mobile nav drawer */
    .nav-links.show {
        display: flex; flex-direction: column;
        position: fixed; top: var(--navbar-h); left: 0; right: 0;
        background: var(--glass-strong);
        border-bottom: 1px solid var(--border);
        padding: 10px 12px; z-index: 1001;
        overflow-y: auto;
        max-height: calc(100vh - var(--navbar-h));
        max-height: calc(100dvh - var(--navbar-h));
        gap: 4px;
        box-shadow: 0 18px 40px rgba(0,0,0,0.35);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        animation: nav-drawer-in 0.2s ease-out;
    }
    @keyframes nav-drawer-in {
        from { opacity: 0; transform: translateY(-8px); }
        to { opacity: 1; transform: translateY(0); }
    }

    /* Restore labels & lay out vertically in dropdown */
    .nav-links.show .nav-link {
        flex-shrink: 1;
        justify-content: flex-start;
        padding: 11px 14px;
        border-color: rgba(255,255,255,0.05);
        background: rgba(255,255,255,0.03);
        border-radius: 10px;
        font-size: 0.92rem;
    }
    .nav-links.show .nav-link span { display: inline; }
    .nav-links.show .nav-link[data-tooltip]::after { display: none; }
    .nav-links.show .nav-link.active {
        background: linear-gradient(180deg, rgba(192,150,92,0.14), rgba(192,150,92,0.06));
        border-color: rgba(192,150,92,0.22);
    }

    /* Nav dropdown in mobile: always show items inline, no floating menu */
    .nav-links.show .nav-dropdown { width: 100%; }
    .nav-links.show .nav-dropdown .nav-dd-caret { display: none; }
    .nav-links.show .nav-dropdown-menu {
        display: flex;
        flex-direction: column;
        position: static;
        background: none;
        border: none;
        box-shadow: none;
        padding: 0 0 0 18px;
        gap: 4px;
        margin-top: 4px;
    }
    .nav-links.show .nav-dropdown-menu a {
        padding: 10px 14px;
        border-radius: 10px;
        border: 1px solid rgba(255,255,255,0.05);
        background: rgba(255,255,255,0.03);
        font-size: 0.9rem;
    }
    .nav-links.show .nav-dropdown > .nav-link { display: none; }

    /* Nav-right stays visible, pushed to end before hamburger */
    .nav-right { margin-left: auto; gap: 6px; }
    /* Compact currency badges */
    .nav-balance, .nav-coins { padding: 4px 7px; font-size: 0.75rem; gap: 3px; border-radius: 10px; }
    /* Smaller avatar, hide caret */
    .nav-avatar-wrap { gap: 0; padding: 2px; }
    .nav-avatar-wrap > .fa-caret-down { display: none; }
    .nav-avatar { width: 30px; height: 30px; font-size: 0.78rem; }

    /* User dropdown needs to not overflow right edge */
    .user-dropdown { right: -8px; min-width: 190px; }
}

/* 900px: Compact currency, hide brand text (keep "Hobo" on mobile) */
@media (max-width: 900px) {
    .brand-text-wrap .alpha-badge { display: none; }
    .brand-text-wrap .brand-streamer { display: none; }
    .brand-text-wrap { flex-direction: row; align-items: center; }
    .brand-text { font-size: 1rem; font-weight: 700; }
    .nav-balance, .nav-coins { padding: 4px 8px; min-width: 0; font-size: 0.78rem; }
    .nav-right .btn span { display: none; }
    .nav-right .btn { padding: 6px 10px; font-size: 0.85rem; gap: 0; }
    #nav-auth-anon, #nav-auth-user { gap: 6px; }

    /* Chat replay sidebar stacks below video */
    .vod-player-row { flex-direction: column; }
    .chat-replay-sidebar {
        width: 100%; max-height: 280px;
        border-left: none; border-top: 1px solid var(--border);
    }
}

/* ─── Mobile FAB (Floating Action Button) for chat ─────────── */
.mobile-chat-toggle {
    display: none; /* hidden on desktop */
    position: fixed;
    bottom: 20px; right: 16px;
    width: 52px; height: 52px;
    border-radius: 50%;
    background: var(--accent-dark);
    color: #fff;
    border: none;
    font-size: 1.3rem;
    align-items: center; justify-content: center;
    z-index: 901;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
.mobile-chat-toggle:hover { background: var(--accent); }
.mobile-chat-toggle:active { transform: scale(0.92); }
.mobile-chat-badge {
    position: absolute; top: -4px; right: -4px;
    min-width: 20px; height: 20px;
    background: var(--live-red); color: #fff;
    font-size: 0.65rem; font-weight: 700;
    border-radius: 10px; padding: 0 5px;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
}

/* 768px: Mobile stream layout + compact content */
@media (max-width: 768px) {
    .navbar { padding: 0 8px; gap: 6px; }
    .nav-brand { gap: 6px; }
    .nav-brand i { font-size: 1.1rem; }
    .brand-text { font-size: 0.92rem; }
    .nav-hamburger { padding: 6px; font-size: 1.2rem; }
    .nav-right { gap: 4px; }
    .nav-balance, .nav-coins { padding: 3px 6px; font-size: 0.72rem; gap: 2px; }
    .nav-avatar { width: 28px; height: 28px; font-size: 0.72rem; }
    .nav-avatar-wrap { padding: 2px; }

    /* Sign in button compact */
    #nav-auth-anon .btn { padding: 6px 10px; font-size: 0.82rem; }

    /* User dropdown full-width on mobile */
    .user-dropdown {
        position: fixed; top: var(--navbar-h); left: 8px; right: 8px;
        width: auto; min-width: 0; max-height: calc(100vh - var(--navbar-h) - 16px);
        max-height: calc(100dvh - var(--navbar-h) - 16px);
        overflow-y: auto;
        border-radius: 12px;
        animation: nav-drawer-in 0.15s ease-out;
    }
    .user-dropdown a { padding: 12px 16px; font-size: 0.92rem; }

    /* Nav drawer tighter */
    .nav-links.show { padding: 8px 10px; gap: 3px; }
    .nav-links.show .nav-link { padding: 10px 12px; font-size: 0.88rem; }
    .nav-links.show .nav-dropdown-menu a { padding: 9px 12px; font-size: 0.86rem; }

    .hero h1 { font-size: 1.6rem; }
    .hero { padding-left: 16px; padding-right: 16px; }
    .vod-player-info,
    .comments-section { padding: 16px; border-radius: 16px; }
    .comment-item { gap: 10px; }
    .comment-meta { flex-wrap: wrap; }

    /* ─── Mobile Stream Layout ─────────────────────────────── */
    .stream-layout {
        flex-direction: column;
        height: calc(100vh - var(--navbar-h));
        height: calc(100dvh - var(--navbar-h)); /* dvh = dynamic viewport height, excludes mobile browser chrome */
        overflow: hidden;
        position: relative;
    }
    #page-channel .stream-layout {
        height: calc(100vh - var(--navbar-h));
        height: calc(100dvh - var(--navbar-h));
    }
    #page-channel.has-live-tabs .stream-layout {
        height: calc(100vh - var(--navbar-h) - 40px);
        height: calc(100dvh - var(--navbar-h) - 40px);
    }
    .stream-main {
        flex: 1;
        overflow-y: auto;
        min-height: 0; /* allow shrink in flex column */
    }
    .video-container {
        max-height: none; /* remove 80vh/50vh cap — let video fill available space */
        aspect-ratio: unset; /* allow video to size naturally */
        width: 100%;
        flex-shrink: 0;
    }
    /* For horizontal video, limit height so info bar is visible */
    #video-element,
    #video-canvas {
        max-height: calc(100vh - var(--navbar-h) - 100px);
        max-height: calc(100dvh - var(--navbar-h) - 100px);
    }

    /* ─── Chat as hidden bottom sheet ──────────────────────── */
    .chat-sidebar {
        position: fixed;
        left: 0; right: 0; bottom: 0;
        width: 100%; height: 55vh;
        max-height: 55vh;
        max-height: 55dvh;
        border-left: none;
        border-top: 1px solid var(--border);
        background: var(--bg-secondary);
        z-index: 900;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
    }
    .chat-sidebar.mobile-chat-open {
        transform: translateY(0);
    }
    .chat-header {
        padding: 8px 14px;
        /* Add a drag handle visual */
        position: relative;
    }
    .chat-sidebar .chat-header::before {
        content: '';
        display: block;
        width: 36px; height: 4px;
        background: var(--border-light);
        border-radius: 2px;
        margin: 0 auto 6px;
    }

    /* Mobile close button in chat header */
    .mobile-chat-close { display: inline-flex; align-items: center; justify-content: center; }

    /* Hide FAB when chat bottom sheet is open */
    body.mobile-chat-visible .mobile-chat-toggle { display: none !important; }

    /* Hide TTS / Coins / Bucks buttons on mobile to reduce clutter */
    .chat-input-row .chat-tts-toggle,
    .chat-input-row .btn-hobo-coins-mini,
    .chat-input-row .btn-hobo-bucks-mini { display: none; }

    /* Mobile chat toggle FAB */
    .mobile-chat-toggle {
        display: flex;
    }

    /* Info bar compact */
    .ch-info-bar { flex-wrap: wrap; gap: 10px; padding: 8px 12px; }
    .ch-info-bar .ch-avatar { width: 36px; height: 36px; font-size: 0.95rem; }
    .ch-info-bar-right { width: 100%; justify-content: space-between; }
    .ch-info-bar-top h2 { font-size: 0.95rem; }
    .ch-stream-title { font-size: 0.8rem; }
    .ch-weather-widget { max-width: 100%; }
    .weather-hourly-scroll { max-width: calc(100vw - 32px); }
    .ch-media-strip { padding: 5px 12px; gap: 8px; font-size: 0.74rem; }

    .live-stream-tabs { height: 38px; padding: 0; }
    .live-tab { padding: 0 10px; font-size: 0.75rem; gap: 5px; }
    .live-tab-title { max-width: 120px; }
    .live-tab-uptime { display: none; }
    .live-tab-badges { display: none; }
    .live-tab-num { width: 16px; height: 16px; font-size: 0.6rem; }
    .live-tabs-summary { font-size: 0.7rem; padding: 0 8px; }
    .ch-cumulative-viewers { gap: 6px; }
    .ch-share-stream { display: none; }
    .ch-offline-header { flex-wrap: wrap; gap: 12px; padding: 16px; }
    .ch-avatar-lg { width: 56px; height: 56px; font-size: 1.4rem; }

    .call-device-selects { flex-direction: column; }
    .call-device-group { min-width: 0; }

    .dash-grid { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; }
    .stream-grid { grid-template-columns: 1fr; }
    .admin-stats { grid-template-columns: repeat(2, 1fr); }

    /* Video controls compact for mobile */
    .video-controls { padding: 4px 8px; gap: 3px; }
    .vc-btn { min-width: 28px; min-height: 28px; padding: 4px 5px; font-size: 0.9rem; }
    .viewer-badge, .uptime-badge { font-size: 0.68rem; padding: 2px 5px; }

    /* Controls panel compact */
    .controls-panel { padding: 8px; }
    .controls-header h3 { font-size: 0.9rem; }

    /* Mobile chat is open — no scrim over video, keep it visible */

    /* Offline global chat responsive */
    .offline-global-chat { height: 50vh; max-height: 350px; margin: 16px 12px; }

    /* Emote picker full-width on mobile */
    .emote-picker { max-height: 260px; }

    /* Key display stacks on mobile */
    .key-display { flex-direction: column; }
    .key-display .btn { width: 100%; justify-content: center; }

    /* Ensure video element fills container width */
    #video-element, #video-canvas { width: 100%; }

    /* Tab bars should scroll — no overflow hidden */
    .tab-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .tab-bar .tab-btn { flex-shrink: 0; }

    /* ─── VOD/Clip Player Mobile ───────────────────────────── */
    .vod-player-row {
        flex-direction: column;
        max-height: none; /* remove desktop height constraint */
        border-radius: 12px;
    }
    .chat-replay-sidebar {
        width: 100%;
        max-height: 250px;
        border-left: none;
        border-top: 1px solid var(--border);
    }
    .vod-player-layout { gap: 12px; }
    .vod-player-info h2 { font-size: 1.1rem; }
    .vod-player-meta { gap: 8px; font-size: 0.82rem; }
    .vod-extra-details { flex-wrap: wrap; }
    .vod-extra-details .detail-chip { font-size: 0.72rem; }

    /* ─── Stream Grid (VODs/Clips list pages) ─────────────── */
    .stream-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
        gap: 12px;
    }

    /* ─── Pastes Page Mobile ───────────────────────────────── */
    .page-header { flex-wrap: wrap; gap: 10px; }
    .page-header h1 { font-size: 1.3rem; }
    .page-header .page-subtitle { font-size: 0.82rem; }

    /* ─── Section headers ──────────────────────────────────── */
    .section-header { flex-wrap: wrap; gap: 8px; }
    .section-header h2 { font-size: 1.1rem; }

    /* ─── Channel below-fold (vods/clips on channel page) ── */
    .channel-below-fold { padding: 0 8px 24px; }
    .channel-below-fold .section-header { padding: 12px 0; }
}

@media (max-width: 480px) {
    :root { --chat-w: 100%; }
    .navbar { padding: 0 6px; gap: 4px; }
    .nav-brand { gap: 5px; }
    .nav-brand i { font-size: 1rem; }
    .brand-text { font-size: 0.88rem; }
    .nav-hamburger { padding: 6px; font-size: 1.15rem; }
    .nav-balance, .nav-coins { padding: 2px 5px; font-size: 0.68rem; }
    .nav-avatar { width: 26px; height: 26px; font-size: 0.68rem; }

    /* Sign in button — icon only on tiny screens */
    #nav-auth-anon .btn span { display: none; }
    #nav-auth-anon .btn { padding: 6px 10px; font-size: 0.82rem; gap: 0; }

    .stream-card { border-radius: 16px; }
    .modal { width: 95%; border-radius: var(--radius); }
    .admin-stats { grid-template-columns: 1fr; }
    .section-header { align-items: flex-start; }
    .reply-form button,
    .comment-form-actions .btn { width: 100%; justify-content: center; }

    /* Even tighter video controls on small phones */
    .vc-btn { min-width: 26px; min-height: 26px; padding: 3px 4px; font-size: 0.82rem; }
    #btn-clip { display: none; } /* hide clip button on tiny screens to save space */
    .viewer-badge, .uptime-badge { font-size: 0.62rem; padding: 1px 4px; }

    .ch-info-bar { padding: 6px 10px; gap: 8px; }
    .ch-info-bar .ch-avatar { width: 32px; height: 32px; font-size: 0.85rem; }
    .ch-info-bar-top h2 { font-size: 0.88rem; }
    .ch-media-strip { padding: 4px 10px; gap: 6px; font-size: 0.7rem; }

    .mobile-chat-toggle { width: 48px; height: 48px; font-size: 1.1rem; bottom: 16px; right: 12px; }

    /* Control buttons compact on small phones */
    .control-btn { min-width: 50px; padding: 8px 10px; font-size: 0.75rem; }
    .control-btn i { font-size: 1rem; }

    /* Offline global chat tighter on small screens */
    .offline-global-chat { height: 45vh; margin: 12px 8px; }

    /* Context menu fits small screens */
    .chat-context-menu {
        min-width: 0; width: calc(100vw - 16px); max-width: 300px;
        max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px);
        overflow-y: auto;
        /* Center on mobile if near edges */
        left: 8px !important;
    }

    /* Dashboard reward cards stack actions */
    .dash-reward-card { flex-wrap: wrap; }
    .dash-reward-actions { width: 100%; justify-content: flex-end; }

    /* Smaller section headers */
    .section-header h2 { font-size: 1.1rem; }

    /* VOD player tighter on small phones */
    .vod-player-info { padding: 12px; border-radius: 12px; }
    .vod-player-info h2 { font-size: 1rem; }
    .comments-section { padding: 12px; border-radius: 12px; }
    .chat-replay-sidebar { max-height: 200px; }

    /* Pastes page header buttons stack */
    .page-header { flex-direction: column; align-items: flex-start; }
    .page-header > div:last-child { width: 100%; display: flex; gap: 6px; }
    .page-header > div:last-child .btn { flex: 1; justify-content: center; font-size: 0.8rem; }
    .paste-card-thumb, .paste-card-code { height: 120px; }

    /* Stream grid single column */
    .stream-grid { grid-template-columns: 1fr; gap: 10px; }
}

/* ─── Portrait-specific: mobile phone streaming vertically ──── */
@media (max-width: 768px) and (orientation: portrait) {
    /* Video fills width — no forced aspect ratio, let object-fit handle it */
    .video-container {
        aspect-ratio: unset;
        max-height: 65vh;
        max-height: 65dvh;
    }
    #video-element {
        object-fit: contain;
        max-height: 65vh;
        max-height: 65dvh;
    }
    #video-canvas {
        max-height: 65vh;
        max-height: 65dvh;
    }

    /* If the stream IS vertical (9:16), give it more room */
    #video-element[style*="object-fit: cover"],
    .video-container.is-vertical {
        aspect-ratio: unset;
        max-height: 75vh;
        max-height: 75dvh;
    }

    /* Chat bottom sheet takes more room in portrait */
    .chat-sidebar {
        height: 50vh;
        max-height: 50vh;
    }
    /* no scrim in portrait either */

    /* Compact info bar even more in portrait — minimal vertical footprint */
    .ch-info-bar {
        padding: 6px 10px; gap: 6px;
    }
    .ch-info-bar .ch-avatar { width: 30px; height: 30px; font-size: 0.8rem; }
    .ch-info-bar-top h2 { font-size: 0.88rem; }
    .ch-stream-title { font-size: 0.75rem; }
    .ch-info-bar-right { gap: 8px; }
    .ch-follower-count { font-size: 0.75rem; }
    .btn-follow { font-size: 0.78rem; padding: 4px 10px; }

    /* Hide live stream tabs in portrait if only one stream (JS also handles this) */
    .live-stream-tabs:not(:has(.live-tab:nth-child(2))) { display: none; }
    .live-tab-badges { display: none; }
}

/* 360px: Very small phones (iPhone SE, Galaxy S series) */
@media (max-width: 360px) {
    .navbar { padding: 0 4px; gap: 3px; }
    .nav-brand i { font-size: 0.95rem; }
    .brand-text { font-size: 0.82rem; }
    /* Hide currency on tiny screens to save space */
    .nav-balance, .nav-coins { display: none; }
    .nav-avatar { width: 24px; height: 24px; font-size: 0.65rem; }
    .nav-hamburger { padding: 5px; font-size: 1.1rem; }
    #nav-auth-anon .btn { padding: 5px 8px; font-size: 0.78rem; }

    .hero h1 { font-size: 1.3rem; }
    .hero p { font-size: 0.85rem; }
    .ch-info-bar-top h2 { font-size: 0.82rem; }
    .ch-stream-title { font-size: 0.72rem; }
    .controls-header h3 { font-size: 0.82rem; }
    .control-btn { min-width: 44px; padding: 6px 8px; font-size: 0.7rem; }
    .control-btn i { font-size: 0.9rem; }
    .btn-follow { font-size: 0.72rem; padding: 3px 8px; }
    .dash-card { padding: 14px; border-radius: 14px; }
    .dash-card h3 { font-size: 0.9rem; }
    .modal { width: 98%; padding: 16px; border-radius: 14px; }
    .mobile-chat-toggle { width: 44px; height: 44px; font-size: 1rem; }
    .rewards-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 100px), 1fr)); }
    .stream-card-info { padding: 8px; }
    .stream-card-title { font-size: 0.88rem; }
    .emote-picker-grid { grid-template-columns: repeat(auto-fill, minmax(32px, 1fr)); }
    .chat-msg { font-size: 0.8rem; }
}

/* Short viewports: landscape phones or low-res devices */
@media (max-height: 500px) and (max-width: 768px) {
    .video-container { max-height: 55vh; }
    #video-element, #video-canvas { max-height: 55vh; }
    .ch-info-bar { padding: 4px 8px; gap: 6px; }
    .ch-info-bar .ch-avatar { width: 28px; height: 28px; font-size: 0.8rem; }
    .ch-info-bar-top h2 { font-size: 0.85rem; }
    .ch-stream-title { display: none; } /* hide title in landscape to save vertical space */
    .chat-sidebar { height: 70vh; max-height: none; }
    .controls-panel { padding: 4px 8px; margin: 8px 0; }
    .mobile-chat-toggle { bottom: 8px; right: 8px; width: 40px; height: 40px; font-size: 0.95rem; }
}

/* ═══════════════════════════════════════════════════════════════
   Channel Page (Kick/Twitch-style layout)
   ═══════════════════════════════════════════════════════════════ */

/* ── Live Stream Tabs (above video, platform-wide) ────────── */
.live-stream-tabs {
    display: flex; align-items: stretch;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0;
    height: 42px;
    overflow: hidden;
    position: relative;
}
.live-tabs-scroll {
    display: flex; gap: 0; overflow-x: auto; align-items: stretch;
    scrollbar-width: none; -ms-overflow-style: none;
    flex: 1; scroll-behavior: smooth;
}
.live-tabs-scroll::-webkit-scrollbar { display: none; }
.live-tab {
    display: flex; align-items: center; gap: 8px;
    padding: 0 14px; border: none;
    background: transparent;
    color: var(--text-muted); font-size: 0.8rem;
    white-space: nowrap; cursor: pointer;
    transition: color 0.15s, background 0.15s;
    font-family: var(--font);
    position: relative; flex-shrink: 0;
    border-bottom: 2px solid transparent;
    outline: none;
}
.live-tab:hover { background: var(--bg-hover); color: var(--text-primary); }
.live-tab:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}
.live-tab.active {
    color: var(--text-primary); font-weight: 600;
    background: rgba(255,255,255,0.03);
    border-bottom-color: var(--accent);
}
.live-tab-num {
    font-size: 0.62rem; font-weight: 700;
    color: var(--text-muted);
    background: rgba(255,255,255,0.06);
    width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; line-height: 1;
}
.live-tab.active .live-tab-num {
    background: var(--accent); color: var(--bg-main);
}
.live-tab-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--live-red); flex-shrink: 0;
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.live-tab-title {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.live-tab-badges {
    font-size: 0.6rem; font-weight: 600;
    color: var(--text-muted);
    background: rgba(255,255,255,0.06);
    padding: 1px 6px; border-radius: 4px;
    text-transform: uppercase; letter-spacing: 0.5px;
    display: inline-flex; align-items: center; gap: 4px;
}
.live-tab.active .live-tab-badges {
    color: rgba(255,255,255,0.55);
    background: rgba(255,255,255,0.1);
}
.live-tab-viewers {
    font-size: 0.72rem; font-weight: 700;
    color: var(--text-secondary);
    display: inline-flex; align-items: center; gap: 3px;
    line-height: 1; margin-left: auto;
}
.live-tab-viewers i { font-size: 0.62rem; }
.live-tab.active .live-tab-viewers {
    color: rgba(255,255,255,0.85);
}
.live-tab-uptime {
    font-size: 0.65rem; color: var(--text-muted);
    display: inline-flex; align-items: center; gap: 3px;
}
.live-tab-uptime i { font-size: 0.58rem; }
.live-tab.active .live-tab-uptime { color: rgba(255,255,255,0.5); }
.live-tab-separator {
    width: 1px; height: 18px;
    background: var(--border); flex-shrink: 0;
    margin: 0 2px; align-self: center;
}
.live-tabs-summary {
    font-size: 0.72rem; color: var(--text-muted);
    padding: 0 14px; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 6px;
    border-left: 1px solid var(--border);
    flex-shrink: 0; align-self: center;
}
.live-tabs-summary strong { color: var(--text-primary); font-weight: 600; }
.live-tabs-summary i { color: var(--accent); font-size: 0.68rem; }

/* ── Stream Switch Loading Overlay ─────────────────────────── */
.stream-switch-overlay {
    position: absolute; inset: 0; z-index: 20;
    display: none; flex-direction: column;
    align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    color: var(--text-muted); gap: 14px;
    font-size: 0.88rem; backdrop-filter: blur(4px);
    transition: opacity 0.2s;
}
.stream-switch-overlay.visible {
    display: flex; animation: fadeIn 0.15s ease;
}
.stream-switch-spinner {
    width: 36px; height: 36px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Cumulative Viewers (below video info bar) ──────────── */
.ch-cumulative-viewers {
    display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap; margin-top: 4px;
}
.ch-viewer-total {
    font-size: 0.78rem; color: var(--text-muted);
    display: inline-flex; align-items: center; gap: 5px;
}
.ch-viewer-total i { color: var(--accent); }
.ch-viewer-total strong { color: var(--text-primary); }
.ch-rs-badge {
    font-size: 0.72rem; font-weight: 600;
    color: #4fc3f7; background: rgba(79, 195, 247, 0.08);
    padding: 2px 8px; border-radius: 10px;
    display: inline-flex; align-items: center; gap: 5px;
    text-decoration: none; transition: all 0.15s;
}
.ch-rs-badge:hover { background: rgba(79, 195, 247, 0.16); filter: brightness(1.2); }
.ch-rs-badge i { font-size: 0.7rem; }
.ch-restream-badge {
    font-size: 0.72rem; font-weight: 600;
    text-decoration: none;
    padding: 2px 8px; border-radius: 10px;
    display: inline-flex; align-items: center; gap: 5px;
    background: rgba(255, 255, 255, 0.06);
    transition: all 0.15s;
}
.ch-restream-badge:hover { background: rgba(255, 255, 255, 0.12); filter: brightness(1.3); }
.ch-restream-badge i { font-size: 0.7rem; }
@keyframes pulse-live {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.ch-share-stream {
    font-size: 0.72rem; color: var(--text-muted);
    background: none; border: 1px solid var(--border);
    padding: 2px 8px; border-radius: 10px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 4px;
    font-family: var(--font); transition: all 0.15s;
}
.ch-share-stream:hover { color: var(--accent); border-color: var(--accent); }

/* ── Streamer Info Bar (below video, Kick/Twitch style) ───── */
.ch-info-bar {
    display: flex; align-items: center; gap: 16px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}
.ch-info-bar-left {
    display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0;
}
.ch-info-bar .ch-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--primary, var(--accent)); color: var(--bg-main, #000);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; font-weight: 700; flex-shrink: 0;
}
.ch-info-bar-text { min-width: 0; flex: 1; }
.ch-info-bar-top {
    display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.ch-info-bar-top h2 {
    font-size: 1.05rem; margin: 0; line-height: 1.3;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ch-info-bar-top .ch-username {
    color: var(--text-muted); font-size: 0.82rem; margin: 0;
}
.ch-info-bar-top .ch-category-badge {
    font-size: 0.72rem; padding: 1px 8px;
}
.ch-stream-title {
    font-size: 0.85rem; color: var(--text-secondary);
    margin: 2px 0 0; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.ch-stream-description {
    font-size: 0.8rem; color: var(--text-muted);
    margin: 2px 0 0; line-height: 1.3;
    overflow: hidden; text-overflow: ellipsis;
    line-clamp: 2;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.ch-info-bar-right {
    display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.ch-info-bar-right .ch-follower-count {
    font-size: 0.82rem; color: var(--text-muted); white-space: nowrap;
}

/* ── Media Request Strip (below info bar) ────────────────── */
.ch-media-strip {
    display: flex; align-items: center; gap: 12px;
    padding: 6px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    font-size: 0.78rem; color: var(--text-muted);
    flex-wrap: wrap;
}
.ch-media-strip-info {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 999px;
    background: rgba(192, 150, 92, .10); border: 1px solid rgba(192, 150, 92, .18);
    color: var(--text-secondary); white-space: nowrap;
}
.ch-media-strip-info i { color: var(--primary, var(--accent)); font-size: 0.72rem; }
.ch-media-strip-info strong { color: var(--text-primary); }
.ch-media-strip-sep { opacity: 0.4; }
.ch-media-strip-link {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 999px;
    background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .10);
    color: var(--text-secondary); text-decoration: none;
    transition: all 0.15s; white-space: nowrap;
}
.ch-media-strip-link:hover { background: rgba(255, 255, 255, .10); color: var(--text-primary); }
.ch-media-strip-link i { font-size: 0.68rem; }

/* ── Weather Widget ──────────────────────────────────────── */
.ch-weather-widget {
    display: flex; flex-direction: column; gap: 6px;
    font-size: 0.82rem; color: var(--text-secondary);
    max-width: 340px;
}
.weather-current {
    display: flex; align-items: center; gap: 10px;
}
.weather-main {
    display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.weather-icon { font-size: 1.3rem; color: var(--primary, var(--accent)); }
.weather-temp { font-size: 1.15rem; font-weight: 700; color: var(--text-primary); }
.weather-topline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.weather-details {
    display: flex; flex-direction: column; gap: 1px; min-width: 0;
}
.weather-condition { font-weight: 600; color: var(--text-primary); font-size: 0.8rem; }
.weather-location { font-size: 0.72rem; color: var(--text-muted); }
.weather-meta { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.weather-unit-toggle {
    border: 1px solid var(--border);
    background: var(--bg-elevated, rgba(255, 255, 255, 0.06));
    color: var(--text-primary);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
}
.weather-unit-toggle:hover { border-color: var(--accent); color: var(--accent); }
.weather-hourly {
    overflow: hidden; margin-top: 2px;
}
.weather-hourly-scroll {
    display: flex; gap: 2px; overflow-x: auto; padding-bottom: 4px;
    scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.weather-hourly-scroll::-webkit-scrollbar { height: 4px; }
.weather-hourly-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.weather-hour {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 4px 6px; border-radius: 6px;
    background: var(--bg-tertiary, var(--bg-secondary));
    min-width: 46px; flex-shrink: 0;
}
.wh-time { font-size: 0.68rem; color: var(--text-muted); font-weight: 600; }
.wh-icon { font-size: 0.8rem; color: var(--primary, var(--accent)); }
.wh-temp { font-size: 0.78rem; font-weight: 700; color: var(--text-primary); }
.wh-precip { font-size: 0.62rem; color: var(--info, #60a5fa); }
.wh-precip i { font-size: 0.55rem; }
.wh-extra { font-size: 0.58rem; color: var(--text-muted); }
.weather-hour.wh-now {
    background: color-mix(in srgb, var(--primary, var(--accent)) 18%, var(--bg-tertiary, var(--bg-secondary)));
    border: 1px solid color-mix(in srgb, var(--primary, var(--accent)) 35%, transparent);
}
.wh-now .wh-time { color: var(--primary, var(--accent)); font-weight: 700; }

/* Offline area weather gets more room */
#ch-weather-widget-offline .ch-weather-widget,
#ch-weather-widget-offline { max-width: 500px; }

/* ── Offline Area ────────────────────────────────────────── */
.ch-offline-area { padding: 0; }
.ch-offline-header {
    display: flex; align-items: center; gap: 20px;
    padding: 24px; background: var(--bg-card); border-bottom: 1px solid var(--border);
}
.ch-offline-header-info { flex: 1; min-width: 0; }
.ch-offline-header-info h1 { margin: 0 0 2px; font-size: 1.4rem; }
.ch-avatar-lg { width: 80px; height: 80px; font-size: 2rem; }
.ch-username { color: var(--text-muted); margin: 0 0 4px; font-size: 0.9rem; }
.ch-description { color: var(--text-secondary); margin: 0 0 8px; font-size: 0.9rem; }
.ch-meta { display: flex; gap: 12px; align-items: center; font-size: 0.85rem; }
.ch-follower-count { color: var(--text-muted); }
.ch-actions { flex-shrink: 0; }
.ch-offline-banner {
    text-align: center; padding: 60px 20px;
    background: var(--bg-card); border-radius: 0;
    color: var(--text-muted);
}
.ch-offline-banner i { margin-bottom: 16px; color: var(--primary, var(--accent)); }
.ch-offline-banner p { margin: 4px 0; }

/* ── Offline Global Chat ─────────────────────────────────── */
.offline-global-chat {
    max-width: 700px; margin: 24px auto; border: 1px solid var(--border);
    border-radius: var(--radius); background: var(--bg-secondary);
    display: flex; flex-direction: column; height: 400px;
}
.offline-global-chat .chat-header { padding: 10px 16px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.05em; color: var(--text-muted); }
.offline-global-chat .chat-messages { flex: 1; overflow-y: auto; padding: 8px; }
.offline-global-chat .chat-input-area { border-top: 1px solid var(--border); }
.offline-global-chat .chat-input-row { display: flex; gap: 6px; padding: 8px; }
.offline-global-chat .chat-input-row input,
.offline-global-chat .chat-input-row .chat-textarea { flex: 1; background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; font-size: 0.9rem; }

/* ── Global Chat Page (Voice Channels + Chat Layout) ───── */
.chat-voice-layout {
    display: flex; gap: 0;
    height: calc(100vh - var(--navbar-h, 56px) - 48px);
    max-width: 1400px; margin: 0 auto; padding: 16px;
}
.global-chat-main {
    flex: 1; display: flex; flex-direction: column; min-height: 0;
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: 0 var(--radius) var(--radius) 0; overflow: hidden;
}
.global-chat-header { padding: 16px 20px 12px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; justify-content: space-between; }
.global-chat-header h2 { margin: 0 0 4px; font-size: 1.2rem; }
.global-chat-header .muted { margin: 0; font-size: 0.85rem; }
.global-chat-messages {
    flex: 1; overflow-y: auto; padding: 8px 12px;
}
.global-chat-main .chat-input-area { border-top: 1px solid var(--border); }
.global-chat-main .chat-input-row { display: flex; gap: 6px; padding: 10px 12px; }
.global-chat-main .chat-input-row input,
.global-chat-main .chat-input-row .chat-textarea { flex: 1; background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; font-size: 0.9rem; }

/* Stream source badge in global chat */
.chat-stream-badge {
    display: inline-block; font-size: 0.7rem; padding: 1px 6px;
    background: var(--accent); color: var(--bg-primary);
    border-radius: 3px; margin-right: 4px; font-weight: 600;
    vertical-align: middle; opacity: 0.85;
}
.chat-stream-badge:hover { opacity: 1; cursor: pointer; }
.chat-time-inline {
    font-size: 0.7rem; color: var(--text-muted); margin-right: 4px;
}

.btn-follow.following { background: var(--text-muted); }
.btn-follow.following:hover { background: var(--danger); }

.channel-below-fold { padding-top: 16px; }

/* ── Channel Analytics ───────────────────────────────────── */
.ch-analytics-period-btns { display:flex; gap:4px; margin-left:auto; }
.ch-analytics-period-btns .btn { padding:4px 10px; font-size:0.75rem; border-radius:6px; }
.ch-analytics-period-btns .btn.active { background:var(--accent); color:#fff; }
.analytics-stat-cards {
    display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr));
    gap:12px; margin-bottom:20px;
}
.analytics-stat-card {
    background:var(--card-bg,rgba(22,22,26,0.74)); border:1px solid var(--border,#333);
    border-radius:10px; padding:14px 16px; text-align:center;
}
.analytics-stat-card .stat-value {
    font-size:1.35rem; font-weight:700; color:var(--text,#fff); line-height:1.2;
}
.analytics-stat-card .stat-label {
    font-size:0.72rem; color:var(--text-muted,#888); text-transform:uppercase;
    letter-spacing:0.04em; margin-top:2px;
}
.analytics-chart-wrap {
    background:var(--card-bg,rgba(22,22,26,0.74)); border:1px solid var(--border,#333);
    border-radius:10px; padding:16px; margin-bottom:20px;
}
.analytics-chart-wrap canvas { max-height:240px; width:100%; }
.analytics-chart-title { font-size:0.85rem; color:var(--text-muted,#888); margin:0 0 10px; font-weight:500; }
.analytics-streams-table { margin-bottom:24px; }
.analytics-streams-table h3 { font-size:0.95rem; margin:0 0 10px; color:var(--text,#fff); }
.table-responsive { overflow-x:auto; }
.analytics-table {
    width:100%; border-collapse:collapse; font-size:0.82rem;
    background:var(--card-bg,rgba(22,22,26,0.74)); border-radius:10px; overflow:hidden;
}
.analytics-table th { text-align:left; padding:10px 12px; color:var(--text-muted,#888);
    font-weight:600; font-size:0.72rem; text-transform:uppercase; letter-spacing:0.03em;
    border-bottom:1px solid var(--border,#333);
}
.analytics-table td { padding:8px 12px; border-bottom:1px solid var(--border,#222); color:var(--text,#ddd); }
.analytics-table tbody tr:hover { background:rgba(255,255,255,0.03); }
.analytics-table tbody tr:last-child td { border-bottom:none; }

/* ═══════════════════════════════════════════════════════════════
   VOD / Clip Player Pages
   ═══════════════════════════════════════════════════════════════ */
.vod-player-layout { max-width: 1200px; margin: 0 auto; }
.vod-player-layout {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.vod-video {
    width: 100%; max-height: 70vh; background: #000;
    border-radius: 0; display: block;
}
.vod-player-info { margin-bottom: 24px; }
.vod-player-info {
    background: rgba(22,22,26,0.74);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 18px;
    padding: 20px;
    box-shadow: var(--shadow-soft);
}
.vod-player-info h2 { margin: 0 0 8px; }
.vod-player-meta {
    display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
    margin-bottom: 12px; font-size: 0.9rem;
}
.vod-player-streamer {
    display: flex; align-items: center; gap: 8px;
    font-weight: 600;
}
.vod-player-description {
    color: var(--text-secondary); font-size: 0.9rem;
    line-height: 1.5; white-space: pre-wrap;
}
.vod-source-info {
    margin-top: 6px; font-size: 0.85rem;
    color: var(--text-muted); display: flex; align-items: center; gap: 6px;
}
.vod-source-info i { color: var(--accent); }

/* Private VOD notice ─────────────────────────────────────── */
.vod-private-notice {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; height: 300px; background: var(--bg-secondary);
    border-radius: var(--radius); border: 1px solid var(--border);
}

/* Enhanced details row ───────────────────────────────────── */
.vod-extra-details {
    display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 4px;
    font-size: 0.8rem; color: var(--text-muted);
}
.vod-extra-details .detail-chip {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--bg-secondary); padding: 3px 10px;
    border-radius: 12px; border: 1px solid var(--border);
}
.vod-extra-details .detail-chip i { color: var(--accent); font-size: 0.75rem; }

/* VOD Clip Creator Modal ────────────────────────────────────── */
.clip-modal-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.75); backdrop-filter: blur(6px);
    display: flex; justify-content: center; align-items: center;
    padding: 16px; animation: fadeIn 0.2s ease;
}
.clip-modal {
    background: var(--bg-card, #1e1e24); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 18px; width: 100%; max-width: 720px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6); overflow: hidden;
    animation: modalSlideUp 0.25s ease;
}
@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.clip-modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.07);
}
.clip-modal-header h3 {
    margin: 0; font-size: 1.1rem; display: flex; align-items: center; gap: 8px;
}
.clip-modal-close {
    background: none; border: none; color: var(--text-secondary); cursor: pointer;
    padding: 6px 8px; border-radius: 8px; font-size: 1.1rem; transition: all 0.15s;
}
.clip-modal-close:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.clip-modal-body { padding: 16px 20px 12px; }
.clip-modal-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 12px 20px 16px; border-top: 1px solid rgba(255,255,255,0.07);
}

/* Preview player */
.clip-preview-wrap {
    position: relative; border-radius: 12px; overflow: hidden;
    background: #000; margin-bottom: 16px; aspect-ratio: 16/9;
}
.clip-preview-video { width: 100%; height: 100%; object-fit: contain; display: block; }
.clip-preview-badge {
    position: absolute; top: 10px; left: 10px;
    background: rgba(0,0,0,0.65); color: #fff; font-size: 0.72rem;
    padding: 3px 8px; border-radius: 6px; pointer-events: none;
    text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600;
}
.clip-preview-play-btn {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.3); border: none; color: #fff; font-size: 2rem;
    cursor: pointer; transition: background 0.2s; opacity: 0;
}
.clip-preview-wrap:hover .clip-preview-play-btn { opacity: 1; }
.clip-preview-play-btn:hover { background: rgba(0,0,0,0.5); }

/* Timeline section */
.clip-timeline-section { margin-bottom: 16px; }
.clip-timeline-label {
    font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 8px;
}
.clip-timeline-wrap {
    position: relative; padding: 12px 8px 20px; cursor: pointer;
    user-select: none; -webkit-user-select: none;
}
.clip-timeline-bar {
    position: relative; height: 8px; border-radius: 4px;
    background: rgba(255,255,255,0.1);
}
.clip-timeline-fill {
    position: absolute; top: 0; height: 100%; border-radius: 4px;
    background: linear-gradient(90deg, var(--accent, #c0965c), #dbb077);
    opacity: 0.5; transition: left 0.05s, width 0.05s;
    pointer-events: none;
}
.clip-handle {
    position: absolute; top: 50%; transform: translate(-50%, -50%);
    width: 20px; height: 28px; cursor: ew-resize; z-index: 3;
    display: flex; align-items: center; justify-content: center;
    transition: left 0.05s;
}
.clip-handle-grip {
    width: 12px; height: 22px; border-radius: 4px;
    background: var(--accent, #c0965c); border: 2px solid rgba(255,255,255,0.35);
    box-shadow: 0 1px 6px rgba(0,0,0,0.4);
    transition: transform 0.15s, box-shadow 0.15s;
}
.clip-handle:hover .clip-handle-grip,
.clip-handle:active .clip-handle-grip {
    transform: scaleY(1.15); box-shadow: 0 2px 10px rgba(192,150,92,0.5);
}
.clip-handle-start .clip-handle-grip { border-radius: 4px 2px 2px 4px; }
.clip-handle-end .clip-handle-grip { border-radius: 2px 4px 4px 2px; }
.clip-playhead {
    position: absolute; top: -4px; width: 2px; height: 16px;
    background: #fff; border-radius: 1px; z-index: 2;
    transform: translateX(-1px); display: none; pointer-events: none;
    box-shadow: 0 0 4px rgba(255,255,255,0.5);
}
.clip-timeline-ticks {
    position: relative; height: 14px; margin-top: 4px;
}
.clip-tick {
    position: absolute; font-size: 0.65rem; color: var(--text-muted, #666);
    transform: translateX(-50%); white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Time controls row */
.clip-time-controls {
    display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px;
}
.clip-time-field {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.clip-time-field label {
    font-size: 0.75rem; color: var(--text-secondary); font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.clip-time-input-group {
    display: flex; align-items: center; gap: 4px;
}
.clip-time-display {
    font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums;
    padding: 4px 10px; min-width: 60px; text-align: center;
    background: rgba(255,255,255,0.05); border-radius: 8px;
}
.clip-nudge-btn {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary); cursor: pointer; border-radius: 6px;
    padding: 4px 7px; font-size: 0.75rem; transition: all 0.15s;
    display: flex; align-items: center; justify-content: center;
}
.clip-nudge-btn:hover { background: rgba(255,255,255,0.12); color: var(--text-primary); }
.clip-nudge-btn.clip-nudge-sm { font-weight: 700; min-width: 26px; }
.clip-set-btn {
    background: none; border: none; color: var(--accent, #c0965c); cursor: pointer;
    font-size: 0.72rem; padding: 2px 0; transition: opacity 0.15s; opacity: 0.75;
}
.clip-set-btn:hover { opacity: 1; text-decoration: underline; }

/* Duration display */
.clip-duration-display {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    min-width: 80px; padding-top: 18px;
}
.clip-duration-number {
    font-size: 2rem; font-weight: 800; line-height: 1;
    font-variant-numeric: tabular-nums; color: var(--accent, #c0965c);
    transition: color 0.2s;
}
.clip-duration-number.clip-duration-over { color: #e53e3e; }
.clip-duration-number.clip-duration-zero { color: var(--text-muted); }
.clip-duration-label { font-size: 0.7rem; color: var(--text-secondary); }
.clip-duration-bar-wrap {
    width: 100%; height: 3px; border-radius: 2px;
    background: rgba(255,255,255,0.08); margin-top: 4px; overflow: hidden;
}
.clip-duration-bar {
    height: 100%; border-radius: 2px; transition: width 0.1s;
    background: var(--accent, #c0965c);
}

/* Title input */
.clip-title-section { margin-bottom: 4px; }
.clip-title-section .form-input {
    width: 100%; box-sizing: border-box;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .clip-modal { max-width: 100%; border-radius: 14px; }
    .clip-time-controls { flex-direction: column; align-items: stretch; gap: 8px; }
    .clip-duration-display { flex-direction: row; gap: 8px; padding-top: 0; min-width: auto; }
    .clip-duration-number { font-size: 1.3rem; }
    .clip-time-field { flex-direction: column; }
    .clip-handle { width: 28px; height: 36px; }
    .clip-handle-grip { width: 16px; height: 28px; }
}

/* Chat Replay Sidebar ─────────────────────────────────────── */
.vod-player-row {
    display: flex; gap: 0; margin-bottom: 16px;
    border-radius: 20px; overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
    background: #000;
    box-shadow: var(--shadow-soft);
    max-height: 75vh; /* constrain so chat replay doesn't push off screen */
}
.vod-player-main { flex: 1; min-width: 0; position: relative; }
.chat-replay-sidebar {
    width: 340px; flex-shrink: 0;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    display: flex; flex-direction: column;
    min-height: 0; /* allow flex children to shrink */
    overflow: hidden;
}
.chat-replay-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px; border-bottom: 1px solid var(--border);
    font-size: 0.85rem; flex-shrink: 0;
}
.chat-replay-header h4 {
    margin: 0; font-size: 0.85rem; display: flex; align-items: center; gap: 6px;
    color: var(--text-secondary);
}
.chat-replay-messages {
    flex: 1; overflow-y: auto; padding: 8px 12px;
    font-size: 0.82rem; line-height: 1.45;
    min-height: 0;
}
.chat-replay-msg {
    padding: 3px 0; animation: fadeIn 0.3s ease;
}
.chat-replay-msg .cr-time {
    color: var(--text-muted); font-size: 0.72rem; margin-right: 6px;
    font-variant-numeric: tabular-nums;
}
.chat-replay-msg .cr-user {
    font-weight: 600; margin-right: 4px;
}
.chat-replay-msg .cr-text { color: var(--text-secondary); word-break: break-word; }
.chat-replay-msg.cr-highlight {
    background: rgba(var(--accent-rgb, 192, 150, 92), 0.08);
    border-radius: 4px; padding: 3px 6px; margin: 0 -6px;
}
.chat-replay-empty {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; height: 100%; color: var(--text-muted);
    text-align: center; gap: 8px; padding: 20px;
    font-size: 0.82rem;
}
.chat-replay-empty p { margin: 0; }
.chat-replay-sidebar.no-data .chat-replay-header h4::after {
    content: '(no chat data)'; margin-left: 6px;
    font-weight: 400; font-size: 0.75rem; color: var(--text-muted);
}

/* Comments Section ────────────────────────────────────────── */
.comments-section {
    margin-top: 0;
    padding: 20px;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 18px;
    background: rgba(22,22,26,0.72);
    box-shadow: var(--shadow-soft);
}
.comments-header h3 {
    margin: 0 0 16px; display: flex; align-items: center; gap: 8px;
}
.comments-count {
    font-size: 0.85rem; color: var(--text-muted); font-weight: 400;
}
.comment-form {
    margin-bottom: 20px;
}
.comment-form textarea {
    width: 100%; background: var(--bg-input, var(--bg-secondary));
    border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--text-primary); padding: 10px 12px; font-size: 0.9rem;
    resize: vertical; min-height: 60px; font-family: inherit;
}
.comment-form textarea:focus {
    outline: none; border-color: var(--accent);
}
.comment-form-actions {
    display: flex; justify-content: flex-end; margin-top: 8px; gap: 8px;
}
.comments-list { display: flex; flex-direction: column; gap: 0; }

.comment-item {
    display: flex; gap: 12px; padding: 12px 0;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
}
.comment-item:hover { background: rgba(255,255,255,0.02); }
.comment-item:last-child { border-bottom: none; }

.comment-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--accent); color: var(--bg-primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
}
.comment-body { flex: 1; min-width: 0; }
.comment-meta {
    display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
    font-size: 0.82rem;
}
.comment-author { font-weight: 600; color: var(--text-primary); }
.comment-date { color: var(--text-muted); font-size: 0.78rem; }
.comment-text {
    color: var(--text-secondary); font-size: 0.9rem;
    line-height: 1.45; white-space: pre-wrap; word-wrap: break-word;
}
.comment-actions {
    display: flex; gap: 12px; margin-top: 4px;
}
.comment-actions button {
    background: none; border: none; color: var(--text-muted);
    font-size: 0.78rem; cursor: pointer; padding: 2px 0;
}
.comment-actions button:hover { color: var(--text-primary); }
.comment-replies {
    margin-top: 8px; padding-left: 16px;
    border-left: 2px solid var(--border);
}
.comment-replies .comment-item { padding: 8px 0; }
.comment-replies .comment-avatar { width: 28px; height: 28px; font-size: 0.75rem; }

.reply-form {
    display: flex; gap: 8px; margin-top: 8px; align-items: flex-start;
    flex-wrap: wrap;
}
.reply-form input {
    flex: 1; background: var(--bg-input, var(--bg-secondary));
    border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--text-primary); padding: 6px 10px; font-size: 0.85rem;
}
.reply-form input:focus { outline: none; border-color: var(--accent); }
.comments-empty {
    text-align: center; padding: 24px; color: var(--text-muted);
}
.stream-card-date {
    margin-left: auto; font-size: 0.75rem;
    color: var(--text-muted); white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════
   THEME SYSTEM — Settings + Directory Styles
   ═══════════════════════════════════════════════════════════════ */

/* ── Theme Mode Toggle ──────────────────────────────────────── */
.theme-mode-toggle {
    display: flex; gap: 6px; margin-bottom: 16px;
}
.theme-mode-toggle .btn.active {
    background: var(--accent); color: var(--bg-primary);
}

/* ── Theme Grid (Settings) ──────────────────────────────────── */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}
.theme-card {
    position: relative;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.15s;
}
.theme-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.theme-card-active {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 2px var(--accent-dark);
}
.theme-card-preview {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.theme-card-accent {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 4px;
}
.theme-card-text {
    font-weight: bold;
    font-size: 1.4em;
    opacity: 0.9;
}
.theme-card-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    font-size: 0.78em;
    background: var(--bg-card);
}
.theme-card-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.theme-card-check {
    position: absolute;
    top: 4px; right: 4px;
    color: var(--accent);
    font-size: 1.1em;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

/* ── Theme Editor (Settings) ────────────────────────────────── */
.theme-editor-group {
    margin-bottom: 18px;
}
.theme-editor-group h4 {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: var(--text-secondary);
}
.theme-editor-vars {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
    gap: 8px;
}
.theme-editor-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.theme-editor-row label {
    font-size: 0.82em;
    color: var(--text-secondary);
    min-width: 100px;
    flex-shrink: 0;
}
.theme-editor-color {
    width: 32px; height: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    cursor: pointer;
    padding: 2px;
}
.theme-editor-hex {
    font-family: var(--font-mono);
    font-size: 0.78em;
    color: var(--text-muted);
}
.theme-editor-input {
    font-family: var(--font-mono);
    font-size: 0.78em;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
}

/* ── Theme Directory Page ───────────────────────────────────── */
.theme-dir-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
}
.theme-dir-filters {
    display: flex; gap: 4px;
}
.theme-dir-filters .btn.active {
    background: var(--accent); color: var(--bg-primary);
}
.theme-dir-search input {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text-primary);
    width: 220px;
}
.theme-dir-sort select {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text-primary);
}
.theme-dir-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 16px;
}
.theme-dir-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    transition: border-color 0.2s, transform 0.15s;
}
.theme-dir-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.theme-dir-preview {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}
.theme-dir-preview-bar {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 5px;
}
.theme-dir-preview-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.theme-dir-active-badge {
    position: absolute;
    top: 6px; right: 6px;
    background: var(--accent);
    color: var(--bg-primary);
    font-size: 0.7em;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
}
.theme-dir-info {
    padding: 10px 12px;
}
.theme-dir-name {
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.theme-dir-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.78em;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.theme-dir-desc {
    font-size: 0.82em;
    margin-bottom: 8px;
    line-clamp: 2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.theme-dir-actions {
    display: flex;
    gap: 6px;
}

/* ── Light Theme Body Overrides ─────────────────────────────── */
body.theme-light .navbar {
    border-bottom: 1px solid var(--border);
}
body.theme-light .stream-card {
    border-color: var(--border);
}
body.theme-light .modal {
    border: 1px solid var(--border);
}
body.theme-light .settings-card {
    border-color: var(--border);
}
body.theme-light .footer {
    border-top: 1px solid var(--border);
}
body.theme-light input,
body.theme-light select,
body.theme-light textarea {
    border-color: var(--border);
}
body.theme-light .btn-outline {
    border-color: var(--border);
    color: var(--text-primary);
}
body.theme-light .btn-outline:hover {
    background: var(--bg-hover);
}
body.theme-light .user-dropdown {
    border: 1px solid var(--border);
}

/* ── Page Header ────────────────────────────────────────────── */
.page-header {
    margin-bottom: 20px;
}
.page-header h2 {
    margin: 0 0 4px;
}
.page-header p {
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════
   HOBO COINS
   ═══════════════════════════════════════════════════════════════ */

/* Navbar coins display */
.nav-coins {
    display: flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 12px;
    background: linear-gradient(135deg, #1a0e2a, #0f0818);
    border: 1px solid #6c3fb5;
    color: #b388ff; font-size: 0.85rem; font-weight: 600;
    cursor: pointer;
}
.nav-coins:hover { border-color: #9c6eff; }

.coins-color { color: #b388ff !important; }

/* Coin mini button (next to chat) */
.btn-hobo-coins-mini {
    flex-shrink: 0;
    padding: 6px 8px; background: transparent;
    border: 1px solid #6c3fb5; border-radius: var(--radius);
    color: #b388ff; font-size: 0.85rem; cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    line-height: 1;
}
.btn-hobo-coins-mini:hover {
    background: #6c3fb5; color: #fff;
    border-color: #6c3fb5;
}

/* Rewards panel (below chat) */
.rewards-panel {
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border);
    max-height: 280px; overflow-y: auto;
}
.rewards-panel-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 12px;
    font-size: 0.85rem; font-weight: 600;
    color: #b388ff;
    border-bottom: 1px solid var(--border);
}
.rewards-coin-bal {
    font-size: 0.8rem; color: var(--text-muted);
}
.rewards-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 120px), 1fr));
    gap: 6px; padding: 8px;
}

/* Individual reward button */
.reward-btn {
    display: flex; flex-direction: column; align-items: center;
    gap: 4px; padding: 10px 6px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    cursor: pointer; transition: all 0.2s;
    font-size: 0.8rem; text-align: center;
}
.reward-btn:hover {
    border-color: var(--reward-color, #b388ff);
    background: rgba(108, 63, 181, 0.1);
    transform: translateY(-1px);
}
.reward-btn i {
    font-size: 1.2rem;
    color: var(--reward-color, #b388ff);
}
.reward-title {
    font-weight: 500; line-height: 1.2;
    max-width: 100%; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}
.reward-cost {
    font-size: 0.7rem; color: #b388ff;
    font-weight: 600;
}

/* Chat redemption message */
.chat-msg.redemption {
    padding: 6px 10px;
    background: rgba(108, 63, 181, 0.15);
    border-left: 3px solid #b388ff;
    margin: 2px 0;
}

/* ── Dashboard: Coin Rewards Grid ─────────────────────────── */
.dash-rewards-grid {
    display: flex; flex-direction: column; gap: 8px;
}
.dash-reward-card {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    border-left: 3px solid var(--reward-color, #b388ff);
}
.dash-reward-icon {
    font-size: 1.4rem;
    color: var(--reward-color, #b388ff);
    width: 36px; text-align: center;
}
.dash-reward-info {
    flex: 1; display: flex; flex-direction: column; gap: 2px;
}
.dash-reward-actions {
    display: flex; gap: 6px;
}

/* ── Dashboard: Redemption Queue ──────────────────────────── */
.redemption-item {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 6px;
}
.redemption-info {
    flex: 1; font-size: 0.9rem;
}
.redemption-actions {
    display: flex; gap: 6px;
}

/* ══════════════════════════════════════════════════════════════
   Group Call Panel (Discord-style voice/video)
   ══════════════════════════════════════════════════════════════ */
.call-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 18px;
    margin-top: 8px;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    background-image: linear-gradient(180deg, rgba(255,255,255,0.02), transparent 60%);
}
.call-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-tertiary, var(--bg-secondary));
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.9rem;
}
.call-panel-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.call-panel-header-left i {
    color: var(--accent, #8b5cf6);
}
.call-count-badge {
    background: var(--accent, #8b5cf6);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* Join Area */
.call-join-area {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.call-device-selects {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.call-device-selects select {
    flex: 1;
    font-size: 0.8rem;
}
.form-input-sm {
    padding: 6px 10px;
    font-size: 0.82rem;
    width: 100%;
    background: var(--bg-input, var(--bg-primary));
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.call-join-btn {
    width: 100%;
    font-size: 0.95rem;
    padding: 10px;
    gap: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Active Call Area */
.call-active-area {
    padding: 10px;
}

/* Participant Grid */
.call-participants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
    max-height: 320px;
    overflow-y: auto;
}
.call-participant-tile {
    position: relative;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 90px;
    background-image: linear-gradient(180deg, rgba(255,255,255,0.04), transparent 55%);
}
.call-participant-tile.is-streamer {
    border-color: var(--accent, #8b5cf6);
    box-shadow: 0 0 0 1px var(--accent, #8b5cf6);
}
.call-participant-tile.is-muted {
    opacity: 0.75;
}
.call-participant-tile.is-speaking {
    border-color: rgba(34,197,94,0.4);
    box-shadow: 0 0 0 1px rgba(34,197,94,0.3);
}

/* Avatar (no camera) */
.call-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent, #8b5cf6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    border: 3px solid transparent;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.call-avatar.speaking {
    border-color: #22c55e;
    box-shadow: 0 0 0 2px rgba(34,197,94,0.45), 0 0 12px rgba(34,197,94,0.3);
}
.call-participant-tile.is-speaking .call-avatar {
    border-color: #22c55e;
    box-shadow: 0 0 0 2px rgba(34,197,94,0.45), 0 0 12px rgba(34,197,94,0.3);
}

/* Video (camera on) */
.call-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius);
}

/* Name Label */
.call-participant-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4px 6px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
}
.call-name {
    overflow: hidden;
    text-overflow: ellipsis;
}
.call-name-clickable {
    cursor: pointer;
}
.call-name-clickable:hover {
    text-decoration: underline;
}
.call-streamer-icon {
    color: var(--accent, #8b5cf6);
    font-size: 0.65rem;
}
.call-muted-icon {
    color: #ef4444;
    font-size: 0.65rem;
}
.call-you-badge {
    color: rgba(255,255,255,0.6);
    font-size: 0.65rem;
}

/* Status Indicators (top-right of tile) */
.call-indicators {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    gap: 3px;
    z-index: 2;
}
.call-indicators i {
    font-size: 0.6rem;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.call-icon-muted { color: #f87171 !important; }
.call-icon-force-muted { color: #ef4444 !important; background: rgba(239,68,68,0.25) !important; }
.call-icon-force-cam { color: #ef4444 !important; background: rgba(239,68,68,0.25) !important; }
.call-icon-local-muted { color: #f59e0b !important; }
.call-icon-speaking { color: #22c55e !important; background: rgba(34,197,94,0.2) !important; }
.call-icon-low-vol { color: #f59e0b !important; }

/* Tile Menu Button (three-dot) */
.call-tile-menu-btn {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 3;
}
.call-participant-tile:hover .call-tile-menu-btn {
    opacity: 1;
}
.call-tile-menu-btn:hover {
    background: rgba(0,0,0,0.8);
}
.call-tile-popout-btn {
    position: absolute;
    top: 4px;
    left: 30px;
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 3;
}
.call-participant-tile:hover .call-tile-popout-btn {
    opacity: 1;
}
.call-tile-popout-btn:hover {
    background: rgba(0,0,0,0.8);
}

/* Local-muted tile dimming */
.call-participant-tile.is-local-muted {
    opacity: 0.6;
}

/* Peer Context Menu */
.call-peer-menu {
    position: absolute;
    top: 28px;
    left: 4px;
    background: var(--bg-secondary, #1e1e2e);
    border: 1px solid var(--border, #333);
    border-radius: var(--radius, 8px);
    padding: 4px 0;
    min-width: 200px;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    font-size: 0.82rem;
}
.call-peer-menu.call-peer-menu-floating {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 3000;
    max-width: min(240px, calc(100vw - 16px));
}
.call-peer-menu-header {
    padding: 8px 12px 6px;
    font-size: 0.82rem;
    color: var(--text-primary, #fff);
    border-bottom: 1px solid var(--border, #333);
    margin-bottom: 2px;
}
.call-peer-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 12px;
    background: none;
    border: none;
    color: var(--text-primary, #ccc);
    cursor: pointer;
    font-size: 0.8rem;
    text-align: left;
    transition: background 0.12s;
}
.call-peer-menu-item:hover {
    background: var(--bg-tertiary, rgba(255,255,255,0.05));
}
.call-peer-menu-item i {
    width: 16px;
    text-align: center;
    font-size: 0.75rem;
    flex-shrink: 0;
}
.call-peer-menu-divider {
    height: 1px;
    background: var(--border, #333);
    margin: 4px 0;
}
.call-peer-menu-section {
    padding: 4px 12px 2px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary, #888);
}
.call-peer-menu-mod i { color: var(--accent, #8b5cf6); }
.call-peer-menu-danger { color: #ef4444 !important; }
.call-peer-menu-danger:hover { background: rgba(239,68,68,0.1) !important; }

/* Volume slider in context menu */
.call-peer-vol-group {
    flex-wrap: wrap;
    gap: 6px;
}
.call-vol-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border, #333);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    margin-top: 2px;
}
.call-vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent, #8b5cf6);
    cursor: pointer;
}
.call-vol-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent, #8b5cf6);
    cursor: pointer;
    border: none;
}

/* Call Controls */
.call-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 0;
}
.call-ctrl-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary, #fff);
    transition: background 0.15s, color 0.15s;
    gap: 4px;
}
.call-ctrl-btn:hover {
    background: var(--border);
}
.call-ctrl-btn.active {
    background: #ef4444;
    color: #fff;
}
.call-ctrl-leave {
    background: #ef4444;
    color: #fff;
}
.call-ctrl-leave:hover {
    background: #dc2626;
}
.call-ctrl-end {
    background: #dc2626;
    color: #fff;
    width: auto;
    border-radius: var(--radius);
    padding: 0 14px;
    font-size: 0.85rem;
    font-weight: 600;
}
.call-ctrl-end:hover {
    background: #b91c1c;
}

/* Call Log */
.call-log {
    max-height: 80px;
    overflow-y: auto;
    padding: 4px 14px 8px;
    font-size: 0.75rem;
    color: var(--text-secondary, #888);
}
.call-log-msg {
    padding: 2px 0;
    border-bottom: 1px solid var(--border);
}
.call-log-msg:last-child {
    border-bottom: none;
}

/* Broadcast Call Toggle Active State */
.bc-ctrl-btn-active {
    background: var(--accent, #8b5cf6) !important;
    color: #fff !important;
}

/* ── Broadcaster Call Controls (shared across all stream methods) ── */
.bc-call-controls {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-top: 8px;
}

/* ── Broadcast Call Panel (streamer's participant view) ── */
.bc-call-panel {
    margin-top: 8px;
    padding: 10px;
    max-height: 400px;
    overflow-y: auto;
}
.bc-call-panel .call-participants-grid {
    max-height: 280px;
    overflow-y: auto;
}
.bc-call-panel .call-log {
    max-height: 80px;
}
.bc-call-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.bc-call-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}
.bc-call-header-left i {
    color: var(--accent, #8b5cf6);
    font-size: 1rem;
}
.bc-call-count {
    font-size: 0.8rem;
    color: var(--text-secondary, #888);
}
.bc-call-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.bc-call-actions select {
    flex: 1;
    min-width: 160px;
}
.bc-call-explainer {
    margin: 10px 0 0;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--text-secondary, #a0a0a0);
}
.bc-call-controls-method {
    margin-top: 12px;
}

/* ── Viewer Call Panel Enhancements ─────────────────── */
.call-panel-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.call-connected-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: #22c55e;
    display: flex;
    align-items: center;
    gap: 4px;
}
.call-connected-badge i {
    font-size: 0.5rem;
    animation: call-pulse 2s ease-in-out infinite;
}
@keyframes call-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.call-join-hint {
    font-size: 0.82rem;
    margin: 0 0 4px;
    line-height: 1.3;
}
.call-device-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 120px;
}
.call-device-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary, #888);
    display: flex;
    align-items: center;
    gap: 4px;
}
.call-device-label i {
    font-size: 0.7rem;
}
.call-device-switcher {
    margin-top: 8px;
    border-top: 1px solid var(--border);
    padding-top: 6px;
}
.call-input-settings {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.call-input-settings-compact {
    margin-top: 8px;
}
.call-threshold-slider {
    width: 100%;
}
.call-threshold-value {
    font-size: 0.75rem;
    color: var(--text-secondary, #888);
}
.call-ptt-status {
    margin-top: 8px;
    font-size: 0.76rem;
    color: var(--text-secondary, #aaa);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 8px;
}
.call-ptt-status strong {
    color: var(--text-primary, #fff);
}
.call-device-switcher summary {
    cursor: pointer;
    font-size: 0.78rem;
    color: var(--text-secondary, #888);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    user-select: none;
}
.call-device-switcher summary:hover {
    color: var(--text-primary);
}
.call-device-selects-compact {
    margin-top: 6px;
    gap: 6px;
}

/* ── Responsive (call panel) ──────────────────────────────── */
@media (max-width: 768px) {
    .call-participants-grid {
        grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
        max-height: 200px;
    }
    .call-device-selects {
        flex-direction: column;
    }
    .call-panel-header,
    .call-join-area,
    .call-active-area { padding-left: 12px; padding-right: 12px; }
}

/* ═══════════════════════════════════════════════════════════════
   HOME CHANGELOG
   ═══════════════════════════════════════════════════════════════ */
/* Collapsible wrapper */
.home-changelog-wrapper {
    position: relative;
    margin-bottom: 24px;
    border-radius: 12px;
    overflow: hidden;
    transition: max-height 0.35s ease;
}
.home-changelog-wrapper.collapsed {
    max-height: 220px;
}
.home-changelog-wrapper.expanded {
    max-height: 2000px;
}
/* Gradient fade overlay when collapsed */
.home-changelog-fade {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: linear-gradient(to bottom, transparent, var(--bg, #0e0e12) 90%);
    pointer-events: none;
    border-radius: 0 0 12px 12px;
}
.home-changelog-wrapper.collapsed .home-changelog-fade {
    display: block;
}

.home-changelog {
    background: var(--bg-secondary, rgba(255,255,255,0.03));
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   UPDATES / CHANGELOG
   ═══════════════════════════════════════════════════════════════ */
.updates-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.updates-day-header {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary, #aaa);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}
.updates-day-commits {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.update-entry {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.15s;
}
.update-entry:hover {
    background: var(--bg-tertiary, rgba(255,255,255,0.04));
}
.update-hash {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--accent);
    text-decoration: none;
    flex-shrink: 0;
}
.update-hash:hover {
    text-decoration: underline;
}
.update-subject {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary, #eee);
}
.update-meta {
    font-size: 0.75rem;
    color: var(--text-secondary, #888);
    flex-shrink: 0;
    white-space: nowrap;
}
@media (max-width: 600px) {
    .update-entry {
        flex-wrap: wrap;
        gap: 4px 8px;
    }
    .update-meta {
        width: 100%;
        padding-left: 0;
    }
}

/* ═══════════════════════════════════════════════════════════════
   PASTES & SCREENSHOTS
   ═══════════════════════════════════════════════════════════════ */

/* ── Toolbar ──────────────────────────────────────────────── */
.pastes-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.pastes-filters {
    display: flex;
    gap: 4px;
}
.pastes-filter-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.15s;
}
.pastes-filter-btn.active,
.pastes-filter-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.pastes-search {
    display: flex;
    gap: 4px;
}
.pastes-search input {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    width: 220px;
}
.pastes-search input:focus {
    border-color: var(--primary);
    outline: none;
}

/* ── Card Grid ────────────────────────────────────────────── */
.pastes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 16px;
}
.paste-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.paste-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* Thumbnail / code preview */
.paste-card-thumb {
    height: 160px;
    overflow: hidden;
    background: var(--bg-tertiary, #1a1a2e);
}
.paste-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.paste-card-code {
    height: 160px;
    overflow: hidden;
    padding: 12px;
    background: var(--bg-tertiary, #0d0d14);
    position: relative;
}
.paste-card-code::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, var(--bg-tertiary, #0d0d14));
    pointer-events: none;
}
.paste-card-code pre {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.4;
    color: var(--text-secondary);
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Card info */
.paste-card-info {
    padding: 12px 14px;
}
.paste-card-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}
.paste-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.paste-card-author {
    display: flex;
    align-items: center;
    gap: 6px;
}
.paste-card-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
}
.paste-card-avatar-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
}
.paste-card-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.paste-card-lang {
    background: var(--primary);
    color: #fff;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}
.paste-card-pin {
    color: var(--warning, #f59e0b);
    font-size: 0.75rem;
}
.paste-card-burn {
    color: var(--danger, #ef4444);
    font-size: 0.75rem;
}
.paste-card-views {
    opacity: 0.7;
}
.paste-card-likes {
    opacity: 0.7;
    color: var(--accent, #8b5cf6);
}
.paste-card-time {
    opacity: 0.7;
}

/* ── Pagination ───────────────────────────────────────────── */
.pastes-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}
.pastes-page-info {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ── Paste Viewer ─────────────────────────────────────────── */
.paste-viewer-nav {
    margin-bottom: 16px;
}
.paste-view-header {
    margin-bottom: 20px;
}
.paste-view-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.paste-view-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}
.paste-view-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}
.paste-view-meta i {
    margin-right: 4px;
    opacity: 0.6;
}
.paste-view-owner-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

/* ── Like button ──────────────────────────────────────────── */
.paste-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 4px);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
}
.paste-like-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--accent-dark, #7c3aed);
}
.paste-like-btn.liked {
    background: var(--accent-dark, #7c3aed);
    color: #fff;
    border-color: var(--accent-dark, #7c3aed);
}
.paste-like-btn.liked:hover {
    background: var(--accent, #8b5cf6);
    border-color: var(--accent, #8b5cf6);
}
.paste-like-btn i {
    margin-right: 0 !important;
    opacity: 1 !important;
}
.paste-unlisted-badge {
    background: var(--bg-tertiary, #2a2a3e);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}
.paste-forked-badge {
    background: var(--bg-tertiary, #2a2a3e);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: 6px;
}

/* ── Code Viewer ──────────────────────────────────────────── */
.paste-code-view {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-tertiary, #0d0d14);
}
.paste-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-secondary);
    gap: 12px;
    flex-wrap: wrap;
}
.paste-code-lang {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    text-transform: uppercase;
}
.paste-code-actions {
    display: flex;
    gap: 6px;
}
.paste-code-body {
    display: flex;
    overflow-x: auto;
    max-height: 70vh;
}
.paste-line-numbers {
    display: flex;
    flex-direction: column;
    padding: 14px 12px;
    text-align: right;
    user-select: none;
    color: var(--text-secondary);
    opacity: 0.35;
    font-size: 0.78rem;
    line-height: 1.55;
    font-family: 'Fira Code', 'Cascadia Code', monospace;
    border-right: 1px solid var(--border);
    min-width: 42px;
    background: var(--bg-secondary);
    position: sticky;
    left: 0;
}
.paste-code-pre {
    margin: 0;
    padding: 14px 16px;
    font-size: 0.82rem;
    line-height: 1.55;
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
    color: var(--text);
    flex: 1;
    overflow-x: auto;
    tab-size: 4;
    white-space: pre;
}

/* Syntax highlighting */
.paste-hl-kw { color: #c678dd; }
.paste-hl-str { color: #98c379; }
.paste-hl-cmt { color: #5c6370; font-style: italic; }
.paste-hl-num { color: #d19a66; }

/* ── Screenshot Viewer ────────────────────────────────────── */
.paste-screenshot-view {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.paste-screenshot-img {
    max-width: 100%;
    max-height: 75vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid var(--border);
    cursor: zoom-in;
    box-shadow: 0 4px 30px rgba(0,0,0,0.4);
}
.paste-screenshot-desc {
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    text-align: left;
}
.paste-screenshot-url {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.paste-screenshot-url a {
    color: var(--primary);
    text-decoration: none;
}
.paste-screenshot-url a:hover {
    text-decoration: underline;
}

/* ── Paste Burned ─────────────────────────────────────────── */
.paste-burned {
    text-align: center;
    padding: 64px 20px;
}
.paste-burned h2 {
    color: var(--text);
    margin-bottom: 8px;
}
.paste-burned p {
    color: var(--text-secondary);
}

/* ── Create/Screenshot Modals ─────────────────────────────── */
.paste-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.paste-modal {
    background: var(--bg-primary, #0e0e10);
    border: 1px solid var(--border);
    border-radius: 14px;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.paste-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.paste-modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text);
}
.paste-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.paste-modal-close:hover {
    color: var(--text);
}
.paste-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}
.paste-modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}
.paste-textarea {
    min-height: 240px;
    resize: vertical;
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    tab-size: 4;
    white-space: pre;
}
.form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    padding-bottom: 8px;
}

/* Screenshot upload modal (redesigned) */
.paste-modal-upload {
    max-width: 560px;
}
.screenshot-preview-area {
    margin-bottom: 16px;
}
.screenshot-preview-img {
    max-width: 100%;
    border-radius: 10px;
    border: 1px solid var(--border);
}
.screenshot-upload-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    text-align: center;
    color: var(--text-secondary);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    background: rgba(var(--primary-rgb, 99,102,241), 0.03);
}
.screenshot-upload-zone:hover,
.screenshot-upload-zone.drag-over {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb, 99,102,241), 0.08);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 99,102,241), 0.12);
}
.screenshot-upload-label {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 36px 24px;
}
.screenshot-upload-icon {
    font-size: 2.5rem;
    opacity: 0.45;
    transition: opacity 0.2s, transform 0.2s;
}
.screenshot-upload-zone:hover .screenshot-upload-icon {
    opacity: 0.75;
    transform: translateY(-2px);
}
.screenshot-upload-title {
    font-size: 0.95rem;
    font-weight: 500;
}
.screenshot-upload-hint {
    font-size: 0.8rem;
    opacity: 0.6;
}
.screenshot-upload-hint strong {
    color: var(--primary);
}
.screenshot-upload-formats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 4px;
}
.screenshot-format-tag {
    font-size: 0.7rem;
    background: var(--bg-secondary, rgba(255,255,255,0.06));
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    opacity: 0.7;
}

/* Details grid */
.screenshot-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.screenshot-detail-full {
    grid-column: 1 / -1;
}
.screenshot-details-grid .form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    margin-bottom: 4px;
}
.screenshot-details-grid .muted {
    opacity: 0.5;
    font-weight: 400;
}

@media (max-width: 480px) {
    .screenshot-details-grid {
        grid-template-columns: 1fr;
    }
    .screenshot-upload-label {
        padding: 24px 16px;
    }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .pastes-grid {
        grid-template-columns: 1fr;
    }
    .pastes-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .pastes-search input {
        width: 100%;
    }
    .paste-code-body {
        max-height: 50vh;
    }
    .paste-screenshot-img {
        max-height: 60vh;
    }
    .paste-modal {
        max-width: 100%;
    }
    .paste-view-title {
        font-size: 1.1rem;
    }
    .paste-view-title-row {
        flex-wrap: wrap;
        gap: 8px;
    }
    .paste-view-meta {
        flex-wrap: wrap;
        gap: 6px;
        font-size: 0.78rem;
    }
    .paste-view-owner-actions {
        flex-wrap: wrap;
        gap: 4px;
    }
    .paste-view-owner-actions .btn {
        font-size: 0.78rem;
        padding: 4px 8px;
    }
    .paste-code-header {
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px 12px;
    }
    .paste-code-actions .btn {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
    .paste-code-pre {
        font-size: 0.72rem;
    }
    .paste-viewer-nav .btn {
        font-size: 0.78rem;
        padding: 6px 10px;
    }
}

/* ══════════════════════════════════════════════════════════════
   Voice Channels — Chat Tab Sidebar
   ══════════════════════════════════════════════════════════════ */

/* ── Sidebar Container ─────────────────────────────────────── */
.vc-sidebar {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    overflow: hidden;
}

.vc-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--border);
}
.vc-sidebar-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.vc-sidebar-header h3 i {
    color: var(--accent);
    font-size: 1rem;
}

.vc-create-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.1s;
}
.vc-create-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.1);
}

/* ── Channel List ──────────────────────────────────────────── */
.vc-channel-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 8px;
}

.vc-channel-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.12s;
    margin-bottom: 2px;
}
.vc-channel-item:hover {
    background: var(--bg-tertiary);
}
.vc-channel-item.selected {
    background: var(--bg-tertiary);
    box-shadow: inset 3px 0 0 var(--accent);
}
.vc-channel-item.joined {
    background: rgba(var(--accent-rgb, 99, 102, 241), 0.1);
    box-shadow: inset 3px 0 0 var(--accent);
}

.vc-channel-icon {
    font-size: 1.1rem;
    color: var(--text-muted);
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}
.vc-channel-item.joined .vc-channel-icon {
    color: var(--accent);
}

.vc-channel-body {
    flex: 1;
    min-width: 0;
}

.vc-channel-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.vc-channel-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vc-channel-mode {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.vc-channel-count {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.vc-channel-count.full {
    color: var(--danger);
}

/* Mini avatar stack */
.vc-avatar-stack {
    display: flex;
    margin-top: 4px;
    padding-left: 2px;
}
.vc-avatar-mini {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--bg-secondary);
    margin-left: -6px;
    font-size: 0.55rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}
.vc-avatar-mini:first-child {
    margin-left: 0;
}
.vc-avatar-more {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-size: 0.55rem;
}

/* ── Setup Panel ───────────────────────────────────────────── */
.vc-setup-panel {
    border-top: 1px solid var(--border);
    padding: 16px;
    background: var(--bg-primary);
    flex-shrink: 0;
}

.vc-setup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.vc-setup-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
}
.vc-setup-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
}
.vc-setup-close:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.vc-setup-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.vc-setup-avatar {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.vc-setup-avatar video.vc-preview-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.vc-setup-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-muted);
    background-size: cover;
    background-position: center;
}

.vc-mic-level {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    transition: border-color 0.1s;
    pointer-events: none;
}
.vc-mic-level.active {
    border-color: var(--success, #22c55e);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

.vc-setup-meter {
    flex: 1;
    min-width: 0;
}
.vc-setup-meter {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}
.vc-meter-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--success, #22c55e), var(--accent));
    border-radius: 4px;
    transition: width 0.06s linear;
}

/* Device select groups */
.vc-setup-devices,
.vc-setup-input-mode {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}
.vc-device-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.vc-device-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.vc-device-group label i {
    font-size: 0.7rem;
}
.vc-device-group select,
.vc-device-group input[type="text"] {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 0.82rem;
}

.vc-threshold-slider {
    width: 100%;
    accent-color: var(--accent);
}
.vc-device-group span {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}

.vc-setup-actions {
    display: flex;
    gap: 8px;
}
.vc-test-btn {
    flex: 0 0 auto;
}
.vc-join-btn {
    flex: 1;
}

/* ── Connected Panel ───────────────────────────────────────── */
.vc-connected-panel {
    border-top: 1px solid var(--border);
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.vc-connected-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.vc-connected-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.vc-connected-badge {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--success, #22c55e);
    display: flex;
    align-items: center;
    gap: 6px;
}
.vc-connected-badge i {
    font-size: 0.5rem;
    animation: vc-pulse 2s infinite;
}
@keyframes vc-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.vc-connected-channel {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Participant grid */
.vc-participants-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    max-height: 280px;
    overflow-y: auto;
}
/* Reuse call-participant-tile styles — these tiles live in the vc grid too */
.vc-participants-grid .call-participant-tile {
    width: 80px;
    height: 80px;
    min-width: 80px;
    font-size: 0.65rem;
}
.vc-participants-grid .call-avatar {
    width: 52px;
    height: 52px;
    font-size: 1.1rem;
}
.vc-participants-grid .call-participant-label {
    font-size: 0.58rem;
    padding: 2px 4px;
}
.vc-participants-grid .call-video {
    width: 100%;
    height: 100%;
}
.vc-participants-grid .call-indicators {
    top: 1px;
    right: 1px;
    gap: 1px;
    font-size: 0.5rem;
}

/* Controls bar */
.vc-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-top: 1px solid var(--border);
}

.vc-ctrl-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s, transform 0.1s;
}
.vc-ctrl-btn:hover {
    background: var(--bg-hover, rgba(255,255,255,0.1));
    transform: scale(1.08);
}
.vc-ctrl-btn.active {
    background: var(--danger);
    color: #fff;
}
.vc-ctrl-settings {
    background: none;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.vc-ctrl-settings:hover {
    color: var(--text-primary);
}
.vc-ctrl-settings.active {
    color: var(--accent);
    background: none;
}
.vc-ctrl-leave {
    background: var(--danger);
    color: #fff;
}
.vc-ctrl-leave:hover {
    background: #dc2626;
    transform: scale(1.08);
}

/* In-call settings panel */
.vc-incall-settings {
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg-secondary);
}

.vc-ptt-status {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    padding: 6px 0 2px;
}
.vc-ptt-status strong {
    color: var(--accent);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.82rem;
}
.vc-ptt-status.ptt-active {
    color: #22c55e;
    font-weight: 600;
}
.vc-ptt-status.ptt-active strong {
    color: #fff;
    background: #22c55e;
}
/* PTT transmitting state on mute button */
.vc-ctrl-btn.ptt-transmitting,
.call-control-btn.ptt-transmitting {
    background: #22c55e !important;
    color: #fff !important;
    box-shadow: 0 0 8px rgba(34,197,94,0.5);
}

/* Camera-off toggle in setup panel */
.vc-cam-off-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    cursor: pointer;
    margin-top: 4px;
    user-select: none;
}
.vc-cam-off-toggle input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--accent);
}

/* ── Create Channel Modal ──────────────────────────────────── */
.vc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.modal-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    overflow: hidden;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
}
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
}
.modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}
.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.modal-body .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.modal-body .form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}
.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Error shake for form inputs */
.form-input.error {
    border-color: var(--danger) !important;
    animation: vc-shake 0.3s ease;
}
@keyframes vc-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .chat-voice-layout {
        flex-direction: column;
        padding: 8px;
    }
    .vc-sidebar {
        width: 100%;
        border-radius: var(--radius) var(--radius) 0 0;
        border-right: 1px solid var(--border);
        border-bottom: none;
        max-height: 45vh;
    }
    .global-chat-main {
        border-radius: 0 0 var(--radius) var(--radius);
        min-height: 300px;
    }
    .vc-participants-grid {
        max-height: 120px;
    }
}

/* ── Chat Mode Dropdown ───────────────────────────────────────── */
.chat-header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
.chat-mode-select {
    width: auto;
    min-width: 110px;
    font-size: 0.82rem;
    padding: 4px 8px;
    background: var(--bg-secondary, #1a1a2e);
    border: 1px solid var(--border, #333);
    color: var(--text, #e0e0e0);
    border-radius: var(--radius, 8px);
    cursor: pointer;
}
.chat-mode-select option:disabled {
    color: var(--text-muted, #888);
}
.chat-voice-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--accent, #6366f1);
    color: #fff;
    margin-right: 4px;
    vertical-align: middle;
    font-weight: 600;
}
.chat-game-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 1px 5px;
    border-radius: 4px;
    background: #22c55e;
    color: #fff;
    margin-right: 4px;
    vertical-align: middle;
    font-weight: 600;
}

/* ── Floating Chat Widget ─────────────────────────────────────── */
.floating-chat-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9998;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent, #6366f1);
    color: #fff;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, background 0.15s;
}
.floating-chat-fab:hover {
    transform: scale(1.08);
    background: var(--accent-hover, #4f46e5);
}
.fcw-unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.floating-chat-widget {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 9999;
    width: 360px;
    max-width: calc(100vw - 40px);
    height: 440px;
    max-height: calc(100vh - 120px);
    background: var(--bg-primary, #0f0f1a);
    border: 1px solid var(--border, #333);
    border-radius: var(--radius, 8px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.fcw-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-secondary, #1a1a2e);
    border-bottom: 1px solid var(--border, #333);
    cursor: move;
    user-select: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text, #e0e0e0);
}
.fcw-header i { margin-right: 6px; color: var(--accent, #6366f1); }
.fcw-header-btns { display: flex; gap: 4px; }
.fcw-header-btns button {
    background: none;
    border: none;
    color: var(--text-muted, #888);
    cursor: pointer;
    padding: 2px 6px;
    font-size: 0.85rem;
    border-radius: 4px;
}
.fcw-header-btns button:hover { background: var(--bg-tertiary, #252540); color: var(--text, #e0e0e0); }
.fcw-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.fcw-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    font-size: 0.85rem;
    line-height: 1.5;
}
.fcw-messages .chat-msg { padding: 2px 0; }
.fcw-input-area {
    display: flex;
    gap: 6px;
    padding: 8px;
    border-top: 1px solid var(--border, #333);
    background: var(--bg-secondary, #1a1a2e);
}
.fcw-input-area input {
    flex: 1;
    background: var(--bg-tertiary, #252540);
    border: 1px solid var(--border, #333);
    color: var(--text, #e0e0e0);
    padding: 6px 10px;
    border-radius: var(--radius, 8px);
    font-size: 0.85rem;
}
.fcw-input-area .chat-send-btn {
    padding: 6px 10px;
}

/* ── Mini Voice Channel Bar ───────────────────────────────────── */
.vc-mini-bar {
    position: fixed;
    bottom: 80px;
    left: 20px;
    z-index: 9997;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: var(--bg-secondary, #1a1a2e);
    border: 1px solid var(--border, #333);
    border-radius: var(--radius, 8px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    font-size: 0.82rem;
    color: var(--text, #e0e0e0);
}
.vc-mini-dot {
    font-size: 0.5rem;
    color: #22c55e;
    margin-right: 4px;
    animation: vc-mini-pulse 2s infinite;
}
@keyframes vc-mini-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.vc-mini-status { font-weight: 600; white-space: nowrap; }
.vc-mini-channel { color: var(--accent, #6366f1); font-weight: 500; white-space: nowrap; }
.vc-mini-controls { display: flex; gap: 4px; }
.vc-mini-btn {
    background: var(--bg-tertiary, #252540);
    border: 1px solid var(--border, #333);
    color: var(--text, #e0e0e0);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
}
.vc-mini-btn:hover { background: var(--bg-primary, #0f0f1a); }
.vc-mini-btn.vc-mini-leave { color: #ef4444; }
.vc-mini-btn.vc-mini-leave:hover { background: rgba(239,68,68,0.15); }

/* ═══════════════════════════════════════════════════════════
   Image Censor Overlay (Admin tool)
   ═══════════════════════════════════════════════════════════ */
.image-censor-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.image-censor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 16px;
    background: var(--bg-secondary, #1a1a2e);
    border-bottom: 1px solid var(--border, #333);
    flex-shrink: 0;
    gap: 12px;
    flex-wrap: wrap;
}
.image-censor-tools, .image-censor-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
.image-censor-tool {
    background: var(--bg-tertiary, #252540);
    border: 1px solid var(--border, #444);
    color: var(--text, #ccc);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82rem;
    transition: all 0.15s;
}
.image-censor-tool:hover {
    background: var(--bg-primary, #0e0e1a);
    border-color: var(--primary, #7c3aed);
}
.image-censor-tool.active {
    background: var(--primary, #7c3aed);
    color: #fff;
    border-color: var(--primary, #7c3aed);
}
.image-censor-canvas-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 16px;
}
#censor-canvas {
    cursor: crosshair;
    border: 1px solid var(--border, #555);
    border-radius: 4px;
    max-width: 100%;
    max-height: 100%;
}
/* Tiny btn variant for inline rename */
.btn-xs {
    padding: 2px 6px;
    font-size: 0.72rem;
    border-radius: 4px;
    opacity: 0.5;
    transition: opacity 0.15s;
}
.btn-xs:hover { opacity: 1; }
.paste-view-title-row { display: flex; align-items: center; gap: 8px; }
@media (max-width: 600px) {
    .image-censor-toolbar { flex-direction: column; align-items: stretch; }
    .image-censor-tools, .image-censor-actions { justify-content: center; }
}

/* ── Paste Comments ──────────────────────────────────────── */
.paste-comments-section {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius, 12px);
}
.paste-comments-header h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.paste-comments-header h3 i {
    color: var(--accent);
}
.paste-comment-form {
    margin-bottom: 16px;
}
.paste-comment-form-inner {
    display: flex;
    gap: 10px;
    align-items: center;
}
.paste-comment-form-inner input[type="text"] {
    flex: 1;
    background: var(--bg-input, var(--bg-primary));
    border: 1px solid var(--border);
    border-radius: var(--radius, 8px);
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 0.88rem;
}
.paste-comment-form-inner input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
}
.paste-comment-form-inner .comment-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}
.paste-comment-anon-form input#paste-comment-anon-name {
    flex: 0 0 auto;
    max-width: 140px;
}
@media (max-width: 600px) {
    .paste-comment-form-inner {
        flex-wrap: wrap;
    }
    .paste-comment-anon-form input#paste-comment-anon-name {
        max-width: 100%;
        flex: 1 1 100%;
    }
}

/* ═══════════════════════════════════════════════════════════════
   Touch Device & General Fluidity
   ═══════════════════════════════════════════════════════════════ */

/* Disable hover effects on touch devices to prevent sticky hovers */
@media (hover: none) {
    .stream-card:hover { transform: none; border-color: var(--border); box-shadow: none; }
    .paste-card:hover { transform: none; border-color: var(--border); box-shadow: none; }
    .chat-send-btn:hover { background: var(--accent-dark); color: var(--text-primary); }
    .btn:hover { filter: none; }
}

/* Fluid font sizes for headings across the board */
.page-header h1 { font-size: clamp(1.2rem, 4vw, 1.8rem); }
.section-header h2 { font-size: clamp(1rem, 3vw, 1.3rem); }

/* Ensure smooth scrolling on mobile for all scroll containers */
.chat-messages,
.chat-replay-messages,
.global-chat-messages,
.emote-picker-grid,
.pastes-grid,
.stream-grid {
    -webkit-overflow-scrolling: touch;
}

/* ═══════════════════════════════════════════════════════════════
   1180px: Tablet Stream Layout — Chat sidebar stacks below video
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1180px) {
    .stream-layout { flex-direction: column; height: auto; }
    #page-channel .stream-layout { height: auto; }
    .chat-sidebar {
        width: 100%; height: 400px;
        border-left: none; border-top: 1px solid var(--border);
    }
    .video-container { max-height: 50vh; }
}

/* ═══════════════════════════════════════════════════════════════
   Nav Link Tooltips (icon-only mode at 1024px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .nav-link[data-tooltip]::after {
        content: attr(data-tooltip);
        position: absolute;
        top: 100%; left: 50%; transform: translateX(-50%);
        margin-top: 6px;
        padding: 4px 10px; border-radius: 6px;
        background: var(--bg-tertiary); color: var(--text-primary);
        border: 1px solid var(--border);
        font-size: 0.75rem; font-weight: 500;
        white-space: nowrap;
        opacity: 0; pointer-events: none;
        transition: opacity 0.15s;
        z-index: 1002;
    }
    .nav-link[data-tooltip]:hover::after { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════
   Staff Console + Channel Moderation
   ═══════════════════════════════════════════════════════════════ */
.staff-panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.staff-panel-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}

.staff-panel-card h3,
.staff-panel-card h4,
.dash-mod-section h5 {
    margin-bottom: 12px;
}

.staff-panel-card-wide {
    grid-column: 1 / -1;
}

.staff-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.staff-chip {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.staff-chip.is-live {
    border-color: rgba(46, 204, 113, 0.35);
    background: rgba(46, 204, 113, 0.12);
    color: #8ef0b7;
}

.staff-note-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.staff-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.staff-note i {
    margin-top: 2px;
}

.staff-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
    align-items: center;
}

.staff-toolbar .form-input {
    flex: 1 1 180px;
}

.staff-toolbar-small {
    max-width: 180px;
}

.staff-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
}

.staff-link-btn {
    background: none;
    border: none;
    color: var(--accent);
    font: inherit;
    cursor: pointer;
    padding: 0;
    text-align: left;
}

.staff-link-btn:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

.staff-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.staff-form-wide {
    grid-column: 1 / -1;
}

.staff-inline-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.staff-canvas-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 16px 0;
}

.staff-scroll-card,
.dash-mod-log-list,
.dash-mod-search-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 360px;
    overflow-y: auto;
}

.staff-log-entry,
.dash-mod-log-entry,
.dash-mod-list-row {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
}

.staff-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.staff-mini-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
}

.staff-mini-card h4 {
    margin-bottom: 10px;
}

.staff-mini-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.86rem;
    color: var(--text-secondary);
}

.staff-mini-row:last-child {
    border-bottom: none;
}

.staff-settings-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.staff-settings-form label,
.dash-mod-settings label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.86rem;
}

.staff-settings-form .staff-inline-toggle,
.dash-mod-settings .staff-inline-toggle {
    flex-direction: row;
    align-items: center;
}

.staff-form-full {
    grid-column: 1 / -1;
}

.staff-button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.dash-mod-channel {
    border-top: 1px solid var(--border);
    padding-top: 18px;
    margin-top: 18px;
}

.dash-mod-channel:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.dash-mod-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.dash-mod-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.dash-mod-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 14px;
}
.dash-mod-section-wide {
    grid-column: 1 / -1;
}

/* IP Approval Queue */
.dash-ip-approval-group {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 10px;
    border-left: 3px solid var(--warning, #f39c12);
}
.dash-ip-approval-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.dash-ip-approval-actions {
    display: flex;
    gap: 6px;
}
.dash-ip-approval-messages {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 8px;
    border-left: 2px solid var(--border);
}

.dash-mod-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dash-mod-list-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.dash-mod-settings {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

/* Staff + moderation responsive */
@media (max-width: 1100px) {
    .staff-canvas-grid,
    .staff-mini-grid,
    .dash-mod-grid,
    .dash-mod-settings,
    .staff-settings-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .staff-form-grid {
        grid-template-columns: 1fr;
    }
    .staff-toolbar-small {
        max-width: none;
    }
    .dash-mod-list-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ═══════════════════════════════════════════════════════════════
   CHAT LINKS — Clickable URLs
   ═══════════════════════════════════════════════════════════════ */
.chat-link {
    color: var(--accent, #c0965c);
    text-decoration: underline;
    text-decoration-color: rgba(192, 150, 92, 0.4);
    text-underline-offset: 2px;
    cursor: pointer;
    transition: color 0.15s, text-decoration-color 0.15s;
    word-break: break-all;
}
.chat-link:hover {
    color: var(--accent-hover, #dbb077);
    text-decoration-color: var(--accent-hover, #dbb077);
}

/* ── Trust Domain Dialog ─────────────────────────────────────── */
.link-trust-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.7); z-index: 10000;
    align-items: center; justify-content: center;
    backdrop-filter: blur(2px);
}
.link-trust-overlay.show { display: flex; }

.link-trust-dialog {
    background: var(--bg-tertiary, #2a2a32);
    border: 1px solid var(--border, #3a3a44);
    border-radius: 16px;
    padding: 0;
    max-width: 440px; width: 92%;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
    animation: linkTrustIn 0.18s ease-out;
    overflow: hidden;
}
@keyframes linkTrustIn {
    from { opacity: 0; transform: scale(0.92) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.link-trust-header {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 20px;
    background: var(--bg-primary, #1e1e24);
    border-bottom: 1px solid var(--border, #3a3a44);
    font-size: 1.05rem; font-weight: 600;
    color: var(--warning, #f59e0b);
}
.link-trust-header i { font-size: 1.2rem; }

.link-trust-body { padding: 16px 20px; }

.link-trust-warning {
    color: var(--text-secondary, #aaa);
    font-size: 0.85rem; line-height: 1.5;
    margin: 0 0 14px;
}

.link-trust-domain {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px;
    background: var(--bg-primary, #1e1e24);
    border-radius: 8px;
    font-size: 0.95rem; font-weight: 600;
    color: var(--text-primary, #eee);
    margin-bottom: 10px;
}
.link-trust-domain i {
    color: var(--text-muted, #777);
    font-size: 0.85rem;
}

.link-trust-url-wrap {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 12px;
    background: var(--bg-primary, #1e1e24);
    border-radius: 8px;
    border: 1px solid var(--border, #3a3a44);
}
.link-trust-url {
    flex: 1; min-width: 0;
    font-size: 0.78rem;
    color: var(--accent, #c0965c);
    word-break: break-all;
    font-family: monospace;
    line-height: 1.4;
}
.link-trust-copy {
    flex-shrink: 0;
    background: none; border: none;
    color: var(--text-muted, #777);
    cursor: pointer; padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: color 0.15s, background 0.15s;
}
.link-trust-copy:hover {
    color: var(--text-primary, #eee);
    background: var(--bg-secondary, #2e2e38);
}

.link-trust-actions {
    display: flex; gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid var(--border, #3a3a44);
    justify-content: flex-end;
}
.link-trust-btn {
    padding: 8px 16px;
    border: 1px solid var(--border, #3a3a44);
    border-radius: 8px;
    font-size: 0.82rem; font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    background: var(--bg-secondary, #2e2e38);
    color: var(--text-primary, #eee);
}
.link-trust-btn:hover {
    background: var(--bg-primary, #1e1e24);
}
.link-trust-cancel {
    color: var(--text-muted, #777);
    border-color: transparent;
    background: transparent;
}
.link-trust-cancel:hover {
    background: var(--bg-secondary, #2e2e38);
    color: var(--text-primary);
}
.link-trust-once {
    background: var(--bg-secondary);
}
.link-trust-always {
    background: var(--accent, #c0965c);
    color: #1e1e24;
    border-color: var(--accent, #c0965c);
    font-weight: 600;
}
.link-trust-always:hover {
    background: var(--accent-hover, #dbb077);
    border-color: var(--accent-hover, #dbb077);
}
.link-trust-always i { margin-right: 4px; }

/* ── Link Right-Click Context Menu ───────────────────────────── */
.link-context-menu {
    position: fixed; z-index: 10001;
    min-width: 180px;
    background: var(--bg-secondary, #2e2e38);
    border: 1px solid var(--border, #3a3a44);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    overflow: hidden;
    padding: 4px;
    animation: ctxFadeIn 0.12s ease-out;
}

.link-ctx-btn {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    padding: 9px 14px;
    background: none; border: none;
    color: var(--text-primary, #eee);
    font-size: 0.82rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.12s;
    text-align: left;
}
.link-ctx-btn:hover {
    background: var(--accent, #c0965c);
    color: #1e1e24;
}
.link-ctx-btn i {
    width: 16px; text-align: center;
    color: var(--text-muted, #777);
    font-size: 0.8rem;
}
.link-ctx-btn:hover i { color: #1e1e24; }

.link-ctx-divider {
    height: 1px; margin: 3px 8px;
    background: var(--border, #3a3a44);
}

/* ── Link Preview Modal ──────────────────────────────────────── */
.link-preview-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.75); z-index: 10002;
    align-items: center; justify-content: center;
    backdrop-filter: blur(3px);
}
.link-preview-overlay.show { display: flex; }

.link-preview-modal {
    width: 90vw; max-width: 1100px;
    height: 80vh; max-height: 800px;
    background: var(--bg-tertiary, #2a2a32);
    border: 1px solid var(--border, #3a3a44);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    display: flex; flex-direction: column;
    overflow: hidden;
    animation: linkTrustIn 0.2s ease-out;
}

.link-preview-header {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    background: var(--bg-primary, #1e1e24);
    border-bottom: 1px solid var(--border, #3a3a44);
    flex-shrink: 0;
}
.link-preview-url-bar {
    flex: 1; min-width: 0;
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-secondary, #2e2e38);
    border: 1px solid var(--border, #3a3a44);
    border-radius: 8px;
    padding: 6px 12px;
}
.link-preview-url-bar i {
    color: var(--text-muted, #777);
    font-size: 0.8rem; flex-shrink: 0;
}
.link-preview-url-text {
    flex: 1; min-width: 0;
    font-size: 0.78rem;
    color: var(--text-secondary, #aaa);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-family: monospace;
}
.link-preview-copy {
    flex-shrink: 0;
    background: none; border: none;
    color: var(--text-muted, #777);
    cursor: pointer; padding: 2px 4px;
    font-size: 0.8rem;
    transition: color 0.15s;
}
.link-preview-copy:hover { color: var(--text-primary); }

.link-preview-toolbar {
    display: flex; gap: 6px;
    flex-shrink: 0;
}
.link-preview-btn {
    padding: 6px 12px;
    background: var(--bg-secondary, #2e2e38);
    border: 1px solid var(--border, #3a3a44);
    border-radius: 6px;
    color: var(--text-primary, #eee);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.12s;
    display: flex; align-items: center; gap: 5px;
}
.link-preview-btn:hover {
    background: var(--accent, #c0965c);
    color: #1e1e24;
    border-color: var(--accent);
}
.link-preview-close {
    background: transparent;
    border-color: transparent;
    font-size: 1rem; padding: 4px 8px;
}
.link-preview-close:hover {
    background: var(--danger, #e74c3c);
    color: #fff;
    border-color: var(--danger);
}

.link-preview-body {
    flex: 1; position: relative;
    overflow: hidden;
}
.link-preview-loading {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted, #777);
    font-size: 0.9rem; gap: 8px;
    z-index: 1;
}
.link-preview-frame {
    width: 100%; height: 100%;
    border: none;
    background: #fff;
}

/* ── Mobile adjustments for link dialogs ─────────────────────── */
@media (max-width: 600px) {
    .link-trust-dialog { width: 96%; border-radius: 12px; }
    .link-trust-actions { flex-direction: column; }
    .link-trust-btn { width: 100%; text-align: center; justify-content: center; }
    .link-preview-modal { width: 96vw; height: 85vh; border-radius: 10px; }
    .link-preview-header { flex-direction: column; gap: 6px; }
    .link-context-menu { min-width: 160px; }
}

/* ═══════════════════════════════════════════════════════════════
   ADMIN TOOLS MODAL
   ═══════════════════════════════════════════════════════════════ */
.admin-tools-modal {
    display: flex; flex-direction: column;
    max-height: 80vh; width: min(680px, 95vw);
}
.admin-tools-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.admin-tools-header h3 {
    margin: 0; font-size: 1rem; display: flex; align-items: center; gap: 8px;
    color: var(--text-primary);
}
.admin-tools-header h3 i { color: var(--accent); }
.admin-tools-body {
    overflow-y: auto; padding: 12px 20px 20px;
    flex: 1;
}
.admin-tools-loading, .admin-tools-error {
    padding: 32px 0; text-align: center; color: var(--text-muted);
    font-size: 0.9rem;
}
.admin-tools-error { color: var(--danger); }

/* Admin tools button in context menu */
.ctx-btn-admin-tools { color: var(--accent); }
.ctx-btn-admin-tools i { color: var(--accent); }
.ctx-btn-admin-tools:hover { background: rgba(52,152,219,0.12); }

/* ── Admin Tools sections ── */
.at-section {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.at-section:last-child { border-bottom: none; margin-bottom: 0; }
.at-section h4 {
    margin: 0 0 10px 0;
    font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--text-muted);
    display: flex; align-items: center; gap: 6px;
}
.at-section h4 i { font-size: 0.75rem; }

/* Info grid */
.at-info-grid {
    display: grid; grid-template-columns: auto 1fr;
    gap: 4px 12px;
    font-size: 0.85rem;
}
.at-label { color: var(--text-muted); font-weight: 500; }
.at-value { color: var(--text-primary); }
.at-role-admin { color: #e74c3c; font-weight: 600; }
.at-role-global_mod { color: #e67e22; font-weight: 600; }
.at-role-streamer { color: #9b59b6; }
.at-banned { color: #e74c3c; font-weight: 600; }
.at-active { color: #2ecc71; }

/* IP cards */
.at-ip-card {
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 10px 12px;
    margin-bottom: 6px;
}
.at-ip-current { border-color: var(--accent); border-width: 1.5px; }
.at-ip-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 4px;
}
.at-ip-address {
    font-family: 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.85rem; color: var(--text-primary);
    cursor: pointer; padding: 2px 4px;
    border-radius: 3px;
    transition: background 0.15s;
}
.at-ip-address:hover { background: var(--bg-hover); }
.at-ip-hits {
    font-size: 0.75rem; color: var(--text-muted);
    background: var(--bg-tertiary, var(--bg-secondary)); padding: 2px 6px;
    border-radius: 10px;
}
.at-live-badge {
    font-size: 0.7rem; color: #2ecc71; font-weight: 600;
    margin-left: 8px; animation: at-pulse 1.5s ease-in-out infinite;
}
@keyframes at-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.at-geo {
    font-size: 0.78rem; color: var(--text-muted);
    display: flex; align-items: center; gap: 4px;
    margin-top: 2px;
}
.at-geo i { font-size: 0.7rem; }
.at-ip-times {
    display: flex; gap: 12px; margin-top: 4px;
    font-size: 0.72rem; color: var(--text-muted);
}
.at-ip-list {
    max-height: 200px; overflow-y: auto;
    padding-right: 4px;
}

/* Alt detection */
.at-alts-list {
    max-height: 240px; overflow-y: auto;
    padding-right: 4px;
}
.at-alt-card {
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 8px 12px;
    margin-bottom: 4px;
    transition: border-color 0.15s;
}
.at-alt-card:hover { border-color: var(--accent); }
.at-alt-banned { border-left: 3px solid #e74c3c; }
.at-alt-row {
    display: flex; align-items: center; gap: 8px;
    flex-wrap: wrap;
}
.at-alt-name {
    font-weight: 600; color: var(--accent);
    cursor: pointer; font-size: 0.85rem;
}
.at-alt-name:hover { text-decoration: underline; }
.at-alt-role { font-size: 0.72rem; padding: 1px 5px; border-radius: 8px; background: var(--bg-tertiary, var(--bg-secondary)); }
.at-banned-badge {
    font-size: 0.65rem; font-weight: 700;
    color: #e74c3c; background: rgba(231,76,60,0.12);
    padding: 1px 5px; border-radius: 6px; letter-spacing: 0.02em;
}
.at-alt-detail {
    display: flex; gap: 12px;
    font-size: 0.72rem; color: var(--text-muted);
    margin-top: 2px;
}
.at-empty {
    padding: 12px; text-align: center;
    color: var(--text-muted); font-size: 0.85rem; font-style: italic;
}

/* Quick actions */
.at-actions { border-bottom: none; }
.at-action-grid {
    display: flex; gap: 8px; flex-wrap: wrap;
}
.at-action-btn {
    font-size: 0.8rem !important;
    display: inline-flex !important; align-items: center; gap: 6px;
}
.at-action-btn i { font-size: 0.75rem; }

/* ── Admin tools mobile ── */
@media (max-width: 600px) {
    .admin-tools-modal { width: 100vw; max-height: 90vh; }
    .at-info-grid { font-size: 0.8rem; }
    .at-ip-times { flex-direction: column; gap: 2px; }
    .at-action-grid { flex-direction: column; }
    .at-action-btn { width: 100%; justify-content: center; }
}

/* ── Broadcast Media PiP Player ── */
.bc-media-pip {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 8px;
    overflow: hidden;
}
.bc-media-pip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-tertiary, var(--bg-secondary));
}
.bc-media-pip-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 0;
}
.bc-media-pip-title span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bc-media-pip-actions { display: flex; gap: 4px; flex-shrink: 0; }
.bc-media-pip-player {
    position: relative;
    background: #000;
    min-height: 80px;
    aspect-ratio: 16/9;
    max-height: 320px;
}
.bc-media-pip-player iframe,
.bc-media-pip-player video,
.bc-media-pip-player audio {
    width: 100%;
    height: 100%;
    display: block;
    border: none;
}
.bc-media-pip-player audio { min-height: 60px; background: #111; }
.bc-media-pip-empty,
.bc-media-pip-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    z-index: 1;
}
.bc-media-pip-empty i { font-size: 1.6rem; opacity: .4; }
.bc-media-pip-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-top: 1px solid var(--border);
    gap: 8px;
}
.bc-media-pip-info {
    min-width: 0;
    flex: 1;
}
.bc-media-pip-track {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bc-media-pip-requester {
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.bc-media-pip-btns {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.bc-pip-btn {
    background: var(--bg-tertiary, var(--bg-input));
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.82rem;
    transition: background 0.15s;
}
.bc-pip-btn:hover { background: var(--accent, #8b5cf6); color: #fff; }
.bc-media-pip-queue {
    border-top: 1px solid var(--border);
    padding: 8px 12px;
    max-height: 180px;
    overflow-y: auto;
    font-size: 0.82rem;
}
.bc-media-pip-queue-empty {
    color: var(--text-secondary);
    text-align: center;
    padding: 6px 0;
}
.bc-pip-queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
    gap: 8px;
}
.bc-pip-queue-item:last-child { border-bottom: none; }
.bc-pip-queue-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}
.bc-pip-queue-user {
    color: var(--text-secondary);
    font-size: 0.78rem;
    flex-shrink: 0;
}
