/* Streams Drawer - Glassmorphism Complete */
.stream-drawer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    height: min(62dvh, 600px);
    transform: translateY(calc(100% + 24px));
    transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.26s ease;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    background: var(--surface-color, #fff);
    border: 1px solid color-mix(in srgb, var(--text-primary, #111) 10%, transparent);
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -18px 48px rgba(15, 23, 42, 0.12);
    overflow: hidden;
    backdrop-filter: blur(22px) saturate(1.08);
    -webkit-backdrop-filter: blur(22px) saturate(1.08);
    opacity: 1;
    touch-action: pan-y;
    /* Open, it takes touches; the hidden state below turns this off. Stated
       here so the two live together and neither can be changed alone. */
    pointer-events: auto;
}
.stream-drawer-hidden {
    transform: translateY(calc(100% + 24px));
    opacity: 0;
    box-shadow: none;
    /* A closed drawer must not catch taps.

       This hid the sheet by moving it and fading it, and nothing else -- so
       when either of those failed to land it went on swallowing every touch in
       the bottom half of the screen while being invisible. Both did fail: the
       light theme carries `#stream-drawer { opacity: 1 !important }`, which
       cancelled the fade, and the transform transition was observed stuck in a
       running state holding the sheet at identity. The result was a closed
       drawer sitting fully open at z-index 10001 over the moments timeline,
       eating clicks on any card under it -- which is why tapping a native video
       did nothing while tapping a photo higher up the page still worked.

       Position and opacity are presentation; this is the one that decides
       whether the thing is there at all, and it does not depend on an
       animation finishing. */
    pointer-events: none;
}

/* Closed bottom sheets must not paint their upward shadows behind the nav. */
#community-drawer.community-drawer-hidden,
#ai-topup-sheet.ai-topup-sheet-hidden {
    box-shadow: none !important;
}
.stream-search-container { padding: calc(env(safe-area-inset-top) + 8px) 16px 8px; background: var(--panel-bg); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border-color); }
.stream-search-wrapper { position: relative; display: flex; align-items: center; gap: 8px; }
.stream-search-icon { position: absolute; left: 14px; color: var(--text-secondary); font-size: 14px; pointer-events: none; }
.stream-search-input { flex: 1; padding: 12px 14px 12px 40px; border-radius: 14px; border: 1px solid var(--border-color); background: var(--input-bg); color: var(--text-color); font-size: 14px; transition: all 0.2s ease; }
.stream-search-input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1); }
.stream-filter-btn { padding: 12px; border-radius: 14px; border: 1px solid var(--border-color); background: var(--panel-bg); color: var(--text-color); cursor: pointer; transition: all 0.2s ease; }
.stream-filter-btn:hover { background: var(--hover-bg); border-color: var(--primary-color); }
.stream-drawer-header {
    position: relative;
    padding: 16px 14px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: none;
}
.stream-drawer-header::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 50%;
    width: 38px;
    height: 4px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-secondary) 28%, transparent);
    transform: translateX(-50%);
}
.stream-header-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border-color); background: var(--panel-bg); color: var(--text-color); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s ease; }
.stream-header-btn:hover { background: var(--hover-bg); border-color: var(--primary-color); }
.stream-header-title { flex: 1; text-align: center; padding: 0 6px; min-width: 0; }
.stream-header-title-text { font-size: 17px; font-weight: 700; color: var(--text-color); margin-bottom: 0; }
.stream-header-subtitle { font-size: 12px; color: var(--text-secondary); }
.stream-drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px calc(18px + env(safe-area-inset-bottom));
}
.stream-permission-badge { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 16px; border-radius: 16px; background: var(--panel-bg); backdrop-filter: blur(20px); border: 1px solid var(--border-color); }
.stream-permission-icon { width: 40px; height: 40px; border-radius: 12px; background: rgba(var(--primary-rgb), 0.1); display: flex; align-items: center; justify-content: center; color: var(--primary-color); }
.stream-permission-info { flex: 1; }
.stream-permission-label { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; }
.stream-permission-value { font-size: 14px; font-weight: 600; color: var(--text-color); }
.stream-permission-change-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--panel-bg); color: var(--text-color); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s ease; }
.stream-stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
.stream-stat-card { padding: 16px; border-radius: 16px; background: var(--panel-bg); backdrop-filter: blur(20px); border: 1px solid var(--border-color); display: flex; align-items: center; gap: 12px; }
.stream-stat-icon { width: 44px; height: 44px; border-radius: 12px; background: rgba(var(--primary-rgb), 0.1); display: flex; align-items: center; justify-content: center; color: var(--primary-color); font-size: 18px; }
.stream-stat-icon-live { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.stream-stat-value { font-size: 24px; font-weight: 700; color: var(--text-color); line-height: 1; }
.stream-stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.stream-grid-container { margin-bottom: 14px; }
.stream-grid-header { display: none; }
.stream-grid-title { font-size: 16px; font-weight: 700; color: var(--text-color); display: flex; align-items: center; gap: 8px; margin: 0; }
.stream-grid-title i { color: var(--primary-color); }
.stream-add-btn { padding: 10px 16px; border-radius: 12px; border: 1px solid var(--border-color); background: var(--primary-color); color: #ffffff; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; cursor: pointer; transition: all 0.2s ease; }
.stream-add-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3); }
.stream-grid { display: grid; gap: 10px; }
.stream-drawer-mini-card {
    position: relative;
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    align-items: stretch;
    min-height: 118px;
    border-radius: 18px;
    background: color-mix(in srgb, var(--surface-color, #fff) 96%, var(--text-primary, #111) 4%);
    border: 1px solid color-mix(in srgb, var(--text-primary, #111) 10%, transparent);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}
.stream-drawer-mini-card:active { transform: scale(0.992); }
.stream-drawer-mini-media {
    position: relative;
    min-width: 0;
    min-height: 118px;
    background: color-mix(in srgb, var(--panel-bg) 72%, #000 28%);
    overflow: hidden;
}
.stream-drawer-mini-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.stream-drawer-mini-media-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background: color-mix(in srgb, var(--panel-bg) 82%, #000 18%);
}
.stream-drawer-mini-overlay {
    position: absolute;
    inset: auto 10px 10px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.stream-drawer-mini-overlay > div {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(15, 23, 42, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111;
    -webkit-text-fill-color: #111;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16);
}
.stream-drawer-mini-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
}
.stream-drawer-mini-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}
.stream-drawer-mini-avatar {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    overflow: hidden;
    flex: 0 0 auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.stream-drawer-mini-copy {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.stream-drawer-mini-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 760;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stream-drawer-platform-chip {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    max-width: 96px;
    padding: 3px 7px;
    border: 1px solid color-mix(in srgb, var(--text-primary, #111) 10%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-primary, #111) 4%, transparent);
    color: var(--text-secondary);
    -webkit-text-fill-color: var(--text-secondary);
    font-size: 10px;
    font-weight: 820;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stream-drawer-mini-title {
    font-weight: 860;
    font-size: 18px;
    color: var(--text-primary);
    line-height: 1.12;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.stream-drawer-mini-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.stream-drawer-mini-play,
.stream-drawer-mini-delete {
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--text-primary, #111) 11%, transparent);
    background: color-mix(in srgb, var(--text-primary, #111) 5%, var(--surface-color, #fff) 95%);
    color: var(--text-primary);
    -webkit-text-fill-color: var(--text-primary);
    font-size: 13px;
    font-weight: 860;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}
.stream-drawer-mini-play {
    flex: 1 1 auto;
    min-height: 40px;
    padding: 0 16px;
}
.stream-drawer-mini-delete {
    width: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    color: var(--text-secondary);
    -webkit-text-fill-color: var(--text-secondary);
    background: var(--surface-color, #fff);
}
.stream-empty-state { text-align: center; padding: 42px 18px 20px; }
.stream-empty-icon { width: 80px; height: 80px; margin: 0 auto 20px; border-radius: 20px; background: var(--panel-bg); backdrop-filter: blur(20px); border: 1px solid var(--border-color); display: flex; align-items: center; justify-content: center; font-size: 32px; color: var(--text-secondary); }
.stream-empty-title { font-size: 18px; font-weight: 700; color: var(--text-color); margin-bottom: 8px; }
.stream-empty-text { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; }
.stream-empty-btn { padding: 14px 24px; border-radius: 14px; border: none; background: var(--primary-color); color: #ffffff; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; transition: all 0.2s ease; }
.stream-empty-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.3); }
.stream-access-section { margin-top: 20px; }
.stream-access-card { padding: 20px; border-radius: 18px; background: var(--panel-bg); backdrop-filter: blur(20px); border: 1px solid var(--border-color); }
.stream-access-header { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.stream-access-icon { width: 48px; height: 48px; border-radius: 14px; background: rgba(239, 68, 68, 0.1); display: flex; align-items: center; justify-content: center; color: #ef4444; font-size: 20px; }
.stream-access-title { font-size: 16px; font-weight: 700; color: var(--text-color); margin-bottom: 2px; }
.stream-access-subtitle { font-size: 13px; color: var(--text-secondary); }
.stream-access-input-group { display: flex; gap: 10px; }
.stream-access-input { flex: 1; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border-color); background: var(--input-bg); color: var(--text-color); font-size: 14px; transition: all 0.2s ease; }
.stream-access-input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1); }
.stream-access-submit-btn { width: 48px; height: 48px; border-radius: 12px; border: none; background: var(--primary-color); color: #ffffff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s ease; }
.stream-access-submit-btn:hover { transform: scale(1.05); box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3); }
.stream-settings-section { margin-bottom: 24px; }
.stream-settings-section-title { font-size: 14px; font-weight: 700; color: var(--text-color); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.stream-settings-section-title i { color: var(--primary-color); }
.stream-permission-options { display: flex; flex-direction: column; gap: 12px; }
.stream-permission-option { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; border: 2px solid var(--border-color); background: var(--panel-bg); cursor: pointer; transition: all 0.2s ease; position: relative; }
.stream-permission-option:hover { border-color: var(--primary-color); background: var(--hover-bg); }
.stream-permission-option input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.stream-permission-option input[type="radio"]:checked ~ .stream-permission-option-check { opacity: 1; color: var(--primary-color); }
.stream-permission-option input[type="radio"]:checked + .stream-permission-option-content { opacity: 1; }
.stream-permission-option-content { flex: 1; display: flex; align-items: center; gap: 14px; opacity: 0.7; transition: opacity 0.2s ease; }
.stream-permission-option-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.stream-permission-icon-everyone { background: rgba(34, 197, 94, 0.1); color: #22c55e; }
.stream-permission-icon-request { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.stream-permission-icon-owner { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.stream-permission-option-title { font-size: 15px; font-weight: 600; color: var(--text-color); margin-bottom: 2px; }
.stream-permission-option-desc { font-size: 12px; color: var(--text-secondary); }
.stream-permission-option-check { font-size: 20px; opacity: 0.2; transition: all 0.2s ease; }
.stream-access-code-section { margin-top: 20px; padding-top: 20px; border-top: 1px dashed var(--border-color); }
.stream-access-code-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.stream-access-code-input-group { display: flex; gap: 10px; }
.stream-access-code-input { flex: 1; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border-color); background: var(--input-bg); color: var(--text-color); font-size: 14px; transition: all 0.2s ease; }
.stream-access-code-input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1); }
.stream-access-code-save-btn { padding: 14px 20px; border-radius: 12px; border: none; background: var(--primary-color); color: #ffffff; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; cursor: pointer; transition: all 0.2s ease; }
.stream-access-code-save-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3); }
.stream-modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px); z-index: 10020; display: none; align-items: center; justify-content: center; padding: 24px; }
.stream-modal-container { width: 100%; max-width: 520px; max-height: 90vh; border-radius: 24px; background: var(--panel-bg); backdrop-filter: blur(40px); border: 1px solid var(--border-color); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); overflow: hidden; display: flex; flex-direction: column; }
.stream-modal-header { padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-color); }
.stream-modal-title { font-size: 18px; font-weight: 700; color: var(--text-color); display: flex; align-items: center; gap: 10px; }
.stream-modal-title i { color: var(--primary-color); }
.stream-modal-close-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border-color); background: var(--panel-bg); color: var(--text-color); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s ease; }
.stream-modal-close-btn:hover { background: var(--hover-bg); border-color: var(--primary-color); }
.stream-modal-content { flex: 1; overflow-y: auto; padding: 24px; }
.mobile-stream-moderation-list,
.mobile-stream-moderation-audit {
    display: grid;
    gap: 8px;
}
.mobile-stream-moderation-row,
.mobile-stream-audit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--panel-bg);
}
.mobile-stream-moderation-name {
    color: var(--text-color);
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 2px;
}
.mobile-stream-moderation-meta,
.mobile-stream-audit-row small {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
}
.mobile-stream-moderation-unmute {
    min-height: 34px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--hover-bg);
    color: var(--text-color);
    padding: 0 12px;
    font-size: 12px;
    font-weight: 850;
}
.mobile-stream-audit-title {
    margin: 16px 0 8px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.mobile-stream-audit-row span {
    color: var(--text-color);
    font-size: 12px;
    font-weight: 800;
}
[data-theme="dark"] .stream-drawer, [data-theme="dark-neo"] .stream-drawer, [data-theme="dark-accent"] .stream-drawer {
    --panel-bg: rgba(0, 0, 0, 0.8); --input-bg: rgba(255, 255, 255, 0.05); --hover-bg: rgba(255, 255, 255, 0.1); --border-color: rgba(255, 255, 255, 0.1);
    background: #050505;
}
[data-theme="light"] .stream-drawer, [data-theme="light-neo"] .stream-drawer, [data-theme="light-accent"] .stream-drawer {
    --panel-bg: rgba(255, 255, 255, 0.8); --input-bg: rgba(0, 0, 0, 0.03); --hover-bg: rgba(0, 0, 0, 0.05); --border-color: rgba(0, 0, 0, 0.1);
    background: #ffffff;
}

/* Enhanced Stream Card Styles for Grid View */
.stream-card {
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    overflow: hidden;
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    cursor: pointer;
}
.stream-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2); border-color: var(--primary-color); }
.stream-card:active { transform: translateY(-2px); }
.stream-card-thumbnail { position: relative; width: 100%; padding-top: 56.25%; background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.2), rgba(var(--primary-rgb), 0.05)); overflow: hidden; }
.stream-card-thumbnail img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.stream-card-live-badge { position: absolute; top: 12px; left: 12px; padding: 6px 12px; border-radius: 8px; background: rgba(239, 68, 68, 0.95); backdrop-filter: blur(8px); color: #ffffff; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; display: flex; align-items: center; gap: 6px; animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.stream-card-live-dot { width: 6px; height: 6px; border-radius: 50%; background: #ffffff; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.stream-card-platform-badge { position: absolute; top: 12px; right: 12px; padding: 6px 12px; border-radius: 8px; background: var(--panel-bg); backdrop-filter: blur(12px); border: 1px solid var(--border-color); font-size: 10px; font-weight: 600; text-transform: uppercase; color: var(--text-color); }
.stream-card-duration { position: absolute; bottom: 8px; right: 8px; padding: 4px 8px; border-radius: 6px; background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(8px); color: #ffffff; font-size: 11px; font-weight: 600; }
.stream-card-content { padding: 12px; }
.stream-card-header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.stream-card-avatar { width: 40px; height: 40px; border-radius: 10px; background: rgba(var(--primary-rgb), 0.1); display: flex; align-items: center; justify-content: center; color: var(--primary-color); font-weight: 700; font-size: 14px; flex-shrink: 0; }
.stream-card-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.stream-card-info { flex: 1; min-width: 0; }
.stream-card-title { font-size: 15px; font-weight: 600; color: var(--text-color); margin: 0 0 4px 0; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.stream-card-creator { font-size: 12px; color: var(--text-secondary); margin: 0; }
.stream-card-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stream-card-meta-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.stream-card-meta-item i { font-size: 10px; }
.stream-card-actions { display: flex; align-items: center; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--border-color); }
.stream-card-action-btn { flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--border-color); background: var(--panel-bg); color: var(--text-color); font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; transition: all 0.2s ease; }
.stream-card-action-btn:hover { background: var(--hover-bg); border-color: var(--primary-color); }
.stream-card-action-btn-primary { background: var(--primary-color); color: #ffffff; border-color: var(--primary-color); }
.stream-card-action-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3); }
.stream-drawer-card-playing {
    border-color: color-mix(in srgb, var(--text-primary, #111) 22%, var(--border-color)) !important;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.1) !important;
}
.stream-drawer-card-playing [data-stream-play-button] {
    background: var(--text-primary) !important;
    color: var(--background-color) !important;
    -webkit-text-fill-color: var(--background-color) !important;
}
/* Grid layouts */
.stream-grid-single { display: grid; grid-template-columns: 1fr; gap: 10px; }
.stream-grid-double { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 480px) {
    .stream-grid-double { grid-template-columns: 1fr; gap: 10px; }
    .stream-drawer {
        left: 0;
        right: 0;
        bottom: 0;
        height: min(58dvh, 560px);
        border-radius: 28px 28px 0 0;
    }
    .stream-header-title-text {
        font-size: 18px;
        font-weight: 840;
    }
    .stream-drawer-content {
        padding: 10px 12px calc(16px + env(safe-area-inset-bottom));
    }
    .stream-drawer-mini-card {
        grid-template-columns: 116px minmax(0, 1fr);
        min-height: 118px;
    }
}

/* Full-Screen Stream Feed - Clean & Simple with Safe Areas */
.stream-feed-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    background: var(--background-color);
}
.stream-feed-card {
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    flex-direction: column;
    background: var(--background-color);
    padding-top: calc(var(--mobile-app-header-height, 120px) + 4px);
    padding-bottom: calc(env(safe-area-inset-bottom) + 92px);
    box-sizing: border-box;
}
.stream-feed-player {
    position: relative;
    width: 100%;
    height: clamp(250px, 44dvh, 420px);
    flex: 0 0 auto;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
body.stream-active .stream-feed-card {
    height: 100dvh;
    min-height: 100dvh;
    padding-top: calc(var(--mobile-app-header-height, 78px) + 4px);
    padding-bottom: calc(env(safe-area-inset-bottom) + 78px);
}
body.stream-active .stream-feed-player {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 360px;
    max-height: none !important;
}
body.stream-active .stream-feed-metadata {
    flex: 0 0 auto;
}
.stream-feed-player iframe {
    width: 100%;
    height: 100%;
    border: none;
}
.mobile-stream-facebook-wrap {
    width: 100%;
    align-self: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #000;
}
.stream-feed-player iframe.mobile-stream-facebook-embed {
    width: 100% !important;
    height: min(52vh, 360px) !important;
    min-height: 260px !important;
    max-height: calc(100vh - var(--mobile-app-header-height, 150px) - 180px) !important;
    align-self: center !important;
    border: none !important;
    border-radius: 0 !important;
    display: block !important;
    background: #000 !important;
}
.mobile-stream-facebook-open {
    align-self: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(24,119,242,0.16);
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 850;
}
.mobile-stream-facebook-note {
    align-self: center;
    max-width: 300px;
    margin-top: -4px;
    color: rgba(255,255,255,0.58);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
}
.mobile-live-recording-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mobile-live-recording-player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    opacity: 1;
    transition: opacity 80ms linear;
}
.mobile-live-recording-player.is-live-hidden {
    opacity: 0;
    pointer-events: none;
}
.mobile-live-recording-player.is-live-visible {
    opacity: 1;
}
.mobile-live-frame-hold {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms ease;
}
.mobile-live-frame-hold.is-visible {
    opacity: 1;
}
.mobile-live-sound-btn {
    position: absolute;
    right: 10px;
    bottom: 10px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.28);
    background: rgba(0,0,0,0.82);
    color: #fff;
    -webkit-text-fill-color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 850;
    cursor: pointer;
    z-index: 6;
    box-shadow: 0 8px 20px rgba(0,0,0,0.26);
    -webkit-tap-highlight-color: transparent;
}
.mobile-live-sound-btn.is-enabled {
    background: rgba(34,197,94,0.92);
    border-color: rgba(255,255,255,0.38);
}
.mobile-live-sound-icon {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.16);
}
.mobile-live-viewer-count {
    position: absolute;
    right: 10px;
    top: 10px;
    z-index: 4;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(0,0,0,0.66);
    color: #fff;
    -webkit-text-fill-color: #fff;
    display: none;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.02em;
}
.mobile-live-viewer-count.is-visible {
    display: inline-flex;
}
.mobile-live-viewer-count span {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}
.mobile-live-recording-status {
    position: absolute;
    left: 10px;
    top: 10px;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(0,0,0,0.66);
    border: 1px solid rgba(255,255,255,0.16);
    color: #fff;
    -webkit-text-fill-color: #fff;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.02em;
}
.mobile-live-recording-status,
.mobile-live-recording-status * {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}
.mobile-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ff4b2b;
    box-shadow: 0 0 0 4px rgba(255,75,43,0.2);
}
.mobile-stop-live-btn {
    width: fit-content;
    margin-top: 14px;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(255,75,43,0.38);
    background: rgba(255,75,43,0.1);
    color: #d9331f;
    -webkit-text-fill-color: #d9331f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-size: 13px;
    font-weight: 850;
    cursor: pointer;
}
.mobile-stop-live-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #ff4b2b;
    box-shadow: 0 0 0 4px rgba(255,75,43,0.16);
}
.stream-feed-metadata {
    padding: 16px 20px 20px;
    background: var(--background-color);
    flex-shrink: 0;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}
.stream-feed-meta-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.stream-feed-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    overflow: hidden;
    flex: 0 0 auto;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12);
}
.stream-feed-identity {
    flex: 1;
    min-width: 0;
}
.stream-feed-creator {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 820;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stream-feed-platform {
    display: inline-flex;
    align-items: center;
    max-width: 112px;
    padding: 4px 8px;
    border: 1px solid color-mix(in srgb, var(--text-primary, #111) 10%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-primary, #111) 4%, transparent);
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 820;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stream-feed-platform span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-secondary);
    -webkit-text-fill-color: var(--text-secondary);
}
.stream-feed-avatar img,
.stream-feed-avatar-fallback {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
}
.stream-feed-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    -webkit-text-fill-color: var(--text-primary);
    background: color-mix(in srgb, var(--text-primary) 6%, var(--surface-color, #fff) 94%);
    font-size: 14px;
    font-weight: 800;
}
.stream-feed-title {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 840;
    line-height: 1.22;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

/* Stream chat styles moved to /static/css/mobile-stream-chat.css */


/* Theme-aware styling for stream metadata - similar to engagement row */
[data-theme="dark-accent"] .stream-feed-metadata {
    background: linear-gradient(135deg, #0a0a0a, #000000);
    border-top: 1px solid rgba(255,255,255,0.1);
    box-shadow: none;
}

[data-theme="dark"][data-theme-variant="neo"] .stream-feed-metadata {
    background: var(--background-color);
    border-top: 1px solid rgba(255,255,255,0.1);
    box-shadow: none;
}

[data-theme="light"] .stream-feed-metadata {
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light-accent"] .stream-feed-metadata,
[data-theme="light"][data-theme-variant="accent"] .stream-feed-metadata {
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: none;
}

[data-theme="light"][data-theme-variant="neo"] .stream-feed-metadata {
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: none;
}

/* Hide scrollbar but keep functionality */
.stream-feed-container::-webkit-scrollbar {
    display: none;
}
.stream-feed-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
/* Loading state */
.stream-feed-loading {
    position: absolute;
    inset: 0;
    transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    text-align: center;
    pointer-events: none;
}
/* Empty state for feed */
.stream-feed-empty {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}
.stream-feed-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: rgba(var(--primary-rgb), 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--primary-color);
    margin-bottom: 24px;
}
.stream-feed-empty-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}
.stream-feed-empty-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}
