/* ============================================
   SnuggleStream — Global Styles
   ============================================ */
:root {
    --bg:        #1a1118;
    --bg-card:   #241a22;
    --bg-input:  #1e1319;
    --surface:   #2e2129;
    --border:    #3d2a38;
    --text:      #f5eaf0;
    --text-dim:  #b89aad;
    --primary:   #f2a0bf;
    --primary-h: #f7b8d0;
    --accent:    #e87faa;
    --green:     #8edfa8;
    --red:       #f06f7e;
    --radius:    14px;
    --radius-sm: 10px;
    --font:      'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --shadow:    0 4px 28px rgba(60,20,40,.4);
    --body-bg:   linear-gradient(160deg, #1a1118 0%, #1f1520 40%, #221425 100%);
    --hero-glow: rgba(242,160,191,.2);
    --hero-glow2: rgba(232,127,170,.08);
    --login-glow: rgba(242,160,191,.15);
    --login-glow2: rgba(232,127,170,.06);
}

/* ============================================
   Dark Theme Override
   ============================================ */
[data-theme="dark"] {
    --bg:        #111114;
    --bg-card:   #1a1a1f;
    --bg-input:  #141417;
    --surface:   #222228;
    --border:    #2e2e36;
    --text:      #e8e8ed;
    --text-dim:  #8c8c9a;
    --primary:   #8b9cf7;
    --primary-h: #a3b1fa;
    --accent:    #7b8be6;
    --green:     #6fd89a;
    --red:       #f06f7e;
    --shadow:    0 4px 28px rgba(0,0,0,.5);
    --body-bg:   linear-gradient(160deg, #111114 0%, #131318 40%, #15151b 100%);
    --hero-glow: rgba(139,156,247,.15);
    --hero-glow2: rgba(123,139,230,.06);
    --login-glow: rgba(139,156,247,.12);
    --login-glow2: rgba(123,139,230,.05);
}
[data-theme="dark"] .logo h1 {
    background: linear-gradient(135deg, #a3b1fa, #7b8be6, #6474d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, #8b9cf7, #7b8be6, #6474d4);
}
[data-theme="dark"] .step-number {
    background: linear-gradient(135deg, #8b9cf7, #7b8be6);
}
[data-theme="dark"] .vote-card h2,
[data-theme="dark"] .countdown-card h2 {
    background: linear-gradient(135deg, #a3b1fa, #7b8be6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .vote-btn.voted {
    background: linear-gradient(135deg, #8b9cf7, #6474d4);
}
[data-theme="dark"] .host-badge.is-you {
    background: linear-gradient(135deg, rgba(139,156,247,.2), rgba(123,139,230,.15));
    border-color: var(--accent);
    color: var(--accent);
}
[data-theme="dark"] .card:hover,
[data-theme="dark"] .feature-card:hover {
    box-shadow: 0 4px 24px rgba(139,156,247,.1);
}
[data-theme="dark"] .auth-overlay {
    background: rgba(17, 17, 20, .7);
}
[data-theme="dark"] .overlay {
    background: rgba(17, 17, 20, .88);
}
[data-theme="dark"] .vote-overlay {
    background: rgba(17, 17, 20, .9);
}
[data-theme="dark"] .countdown-overlay {
    background: rgba(17, 17, 20, .85);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--body-bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

a { color: var(--primary-h); text-decoration: none; }
a:hover { text-decoration: underline; }

.app { position: relative; z-index: 1; }

/* ============================================
   Hero
   ============================================ */
.hero {
    position: relative;
    padding: 4rem 0 2.5rem;
    text-align: center;
    overflow: hidden;
}
.hero-bg {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 50% 0%, var(--hero-glow) 0%, var(--hero-glow2) 40%, transparent 70%);
    pointer-events: none;
}
.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
}
.logo-icon {
    width: 36px; height: 36px;
    color: var(--primary);
}
.logo-kitty {
    width: 48px; height: 48px;
    image-rendering: pixelated;
}
.logo-kitty-sm {
    width: 26px; height: 26px;
    image-rendering: pixelated;
}
.logo h1 {
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f7b8d0, #e87faa, #d4689e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.tagline {
    margin-top: .5rem;
    color: var(--text-dim);
    font-size: 1.1rem;
}

/* ============================================
   Cards Grid
   ============================================ */
.main-content {
    padding-bottom: 4rem;
}
.cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}
@media (max-width: 768px) {
    .cards-grid { grid-template-columns: 1fr; }
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: border-color .2s;
}
.card {
    transition: border-color .2s, box-shadow .2s;
}
.card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 24px rgba(242,160,191,.1);
}
.card-header {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .5rem;
}
.card-icon { width: 28px; height: 28px; color: var(--primary); }
.card-header h2 { font-size: 1.35rem; font-weight: 600; }
.card-desc { color: var(--text-dim); margin-bottom: 1.5rem; font-size: .92rem; }

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: 1.2rem;
}
.form-group label {
    display: block;
    font-size: .82rem;
    font-weight: 500;
    color: var(--text-dim);
    margin-bottom: .35rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.form-group label.toggle-label {
    display: inline-flex;
    text-transform: none;
    letter-spacing: normal;
    font-size: inherit;
    color: inherit;
    margin-bottom: 0;
}
input[type="text"],
input[type="url"],
input[type="number"],
select {
    width: 100%;
    padding: .7rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: .95rem;
    outline: none;
    transition: border-color .2s;
}
input:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(242,160,191,.2);
}
.hint {
    display: block;
    font-size: .78rem;
    color: var(--text-dim);
    margin-top: .3rem;
}

/* Toggle switch */
.toggle-group { margin-bottom: 1.2rem; margin-top: .2rem; }
.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    cursor: pointer;
    user-select: none;
}
.toggle-label input { display: none; }
.toggle-switch {
    position: relative;
    width: 40px;
    height: 22px;
    background: rgba(184, 154, 173, .35);
    border: 1px solid rgba(184, 154, 173, .45);
    border-radius: 999px;
    transition: background .25s, border-color .25s;
    flex-shrink: 0;
}
.toggle-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: var(--text-dim);
    border-radius: 50%;
    transition: transform .25s, background .25s;
}
.toggle-label input:checked + .toggle-switch {
    background: var(--primary);
}
.toggle-label input:checked + .toggle-switch::after {
    transform: translateX(18px);
    background: var(--bg);
}
.toggle-text {
    font-size: .92rem;
    font-weight: 500;
    color: var(--text);
}
.toggle-group .hint {
    margin-left: calc(40px + .6rem);
}

/* Help tooltip */
.help-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: .3rem;
    width: 16px;
    min-width: 16px;
    height: 16px;
    border: 1.5px solid var(--primary);
    border-radius: 4px;
    background: transparent;
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    line-height: 1;
    cursor: help;
    flex-shrink: 0;
    transition: background .2s;
    position: relative;
    top: -1px;
    text-align: center;
    padding: 0;
    vertical-align: middle;
}
.help-icon:hover {
    background: rgba(242,160,191,.15);
}
.help-icon {
    position: relative;
}
.help-tip {
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%) scale(.95);
    background: rgba(36, 26, 34, 0.70);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text);
    font-size: .78rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1.4;
    padding: .5rem .7rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
.help-icon:hover .help-tip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) scale(1);
}
@media (max-width: 768px) {
    .help-tip {
        left: 0;
        top: calc(100% + 6px);
        transform: translateY(0) scale(.95);
        white-space: normal;
        min-width: 180px;
    }
    .help-icon:hover .help-tip {
        transform: translateY(0) scale(1);
    }
}

/* Source tabs */
.source-tabs, .source-tabs-room {
    display: flex;
    gap: .4rem;
}
.tab {
    flex: 1;
    padding: .55rem .8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-dim);
    font-family: var(--font);
    font-size: .85rem;
    cursor: pointer;
    transition: all .2s;
}
.tab:hover { border-color: var(--primary); color: var(--text); }
.tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* File drop */
.file-drop {
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}
.file-drop:hover, .file-drop.dragover {
    border-color: var(--primary);
    background: rgba(242,160,191,.06);
}
.file-drop svg { width: 36px; height: 36px; color: var(--text-dim); margin-bottom: .5rem; }
.file-drop .link { color: var(--primary-h); cursor: pointer; }
.file-info {
    padding: .6rem; background: var(--surface); border-radius: var(--radius-sm);
    font-size: .85rem; margin-top: .5rem;
}

/* Screen share info (home page) */
.screen-share-info {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: .88rem;
    line-height: 1.5;
}
.screen-share-info svg {
    color: var(--primary);
    flex-shrink: 0;
}

/* Screen share buttons (room page) */
.screen-share-panel {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.btn-screen {
    background: var(--primary);
    color: #fff;
}
.btn-screen:hover {
    filter: brightness(1.15);
}
.btn-stop-screen {
    background: var(--red);
    color: #fff;
}
.btn-stop-screen:hover {
    filter: brightness(1.15);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary {
    width: 100%;
    justify-content: center;
    background: linear-gradient(135deg, #f2a0bf, #e87faa, #d4689e);
    color: #fff;
}
.btn-primary:hover { filter: brightness(1.15); transform: translateY(-1px); }
.btn-secondary {
    width: 100%;
    justify-content: center;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--primary); background: rgba(242,160,191,.1); }
.btn-sm {
    padding: .5rem 1rem;
    font-size: .85rem;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    flex-shrink: 0;
}
.btn-sm:hover { filter: brightness(1.15); }

/* ============================================
   Active Rooms List
   ============================================ */
.active-rooms {
    margin-top: 2rem;
    border-top: 1px solid var(--border);
    padding-top: 1.2rem;
}
.active-rooms h3 { font-size: .95rem; color: var(--text-dim); margin-bottom: .8rem; }
.active-rooms ul { list-style: none; }
.active-rooms li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .65rem .8rem;
    background: var(--surface);
    border-radius: var(--radius-sm);
    margin-bottom: .5rem;
    cursor: pointer;
    transition: background .2s;
}
.active-rooms li:hover { background: rgba(242,160,191,.1); }
.room-li-name { font-weight: 500; }
.room-li-meta {
    display: flex; align-items: center; gap: .5rem;
    font-size: .82rem; color: var(--text-dim);
}
.room-li-viewers { color: var(--green); }

/* ============================================
   Footer
   ============================================ */
.footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-dim);
    font-size: .85rem;
    border-top: 1px solid var(--border);
}
.footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.footer-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: .8rem;
    opacity: .7;
    transition: opacity .2s;
}
.footer-link:hover { opacity: 1; }
.footer-row nav {
    display: flex;
    gap: .8rem;
}

/* TOS page */
.hero-sm { padding: 1.2rem 0; }
.hero-sm h1 { font-size: 1.3rem; }
.tos-content { max-width: 740px; padding: 2rem 1.5rem 3rem; }
.tos-content h2 { font-size: 1.6rem; margin-bottom: .3rem; color: var(--text); }
.tos-content h3 { font-size: 1.1rem; margin: 1.8rem 0 .5rem; color: var(--primary); }
.tos-content p { color: var(--text-dim); line-height: 1.7; margin-bottom: .8rem; }
.tos-content ul { color: var(--text-dim); line-height: 1.7; margin: .5rem 0 1rem 1.5rem; }
.tos-content li { margin-bottom: .5rem; }
.tos-updated { font-size: .82rem; opacity: .6; margin-bottom: 1.5rem; }
.tos-back { margin-top: 2.5rem; }
.tos-back a { color: var(--primary); text-decoration: none; }
.tos-back a:hover { text-decoration: underline; }

/* Article pages */
.article-content { max-width: 740px; padding: 2rem 1.5rem 3rem; }
.article-content h2 { font-size: 1.8rem; margin-bottom: .5rem; color: var(--text); line-height: 1.3; }
.article-content .article-meta { font-size: .82rem; color: var(--text-dim); margin-bottom: .5rem; }
.article-content h3 { font-size: 1.15rem; margin: 2rem 0 .6rem; color: var(--primary); }
.article-content p { color: var(--text-dim); line-height: 1.8; margin-bottom: 1rem; }
.article-content ul, .article-content ol { color: var(--text-dim); line-height: 1.8; margin: .5rem 0 1.5rem 1.5rem; }
.article-content li { margin-bottom: .5rem; }
.article-content strong { color: var(--text); }
.article-content a { color: var(--primary-h); }
.article-content .article-cta {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    margin: 2.5rem 0;
    text-align: center;
}
.article-content .article-cta h3 { margin-top: 0; color: var(--text); }
.article-content .article-cta p { color: var(--text-dim); margin-bottom: .5rem; }

/* Enhanced Footer */
.footer-enhanced {
    border-top: 1px solid var(--border);
    padding: 3rem 0 1.5rem;
    color: var(--text-dim);
    font-size: .85rem;
    text-align: left;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}
.footer-col h4 {
    font-size: .78rem;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .8rem;
}
.footer-col p {
    font-size: .82rem;
    color: var(--text-dim);
    line-height: 1.6;
}
.footer-col nav {
    display: flex;
    flex-direction: column;
    gap: .45rem;
}
.footer-col nav a {
    color: var(--text-dim);
    font-size: .82rem;
    text-decoration: none;
    transition: color .2s;
}
.footer-col nav a:hover {
    color: var(--primary);
    text-decoration: none;
}
.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 1.2rem;
    text-align: center;
    font-size: .78rem;
    color: var(--text-dim);
}
@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* ============================================
   Overlay / Spinner
   ============================================ */
.overlay {
    position: fixed; inset: 0;
    background: rgba(26,17,24,.88);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    z-index: 1000;
}
.spinner {
    width: 44px; height: 44px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.overlay p { margin-top: 1rem; color: var(--text-dim); }

/* Video loading spinner (in-player) */
.video-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    z-index: 5;
}
.video-loading p {
    margin-top: .75rem;
    color: var(--text-dim);
    font-size: .9rem;
}

/* ============================================
   Room Layout
   ============================================ */
.room-body { overflow: hidden; }
.room-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    z-index: 1;
}

/* Room header */
.room-header {
    display: flex;
    align-items: center;
    padding: .6rem 1.2rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    gap: 1rem;
    flex-shrink: 0;
}
.room-logo {
    display: flex; align-items: center; gap: .4rem;
    font-weight: 700; font-size: 1rem;
    color: var(--text); text-decoration: none;
}
.room-logo .logo-icon { width: 22px; height: 22px; color: var(--primary); }
.room-info { flex: 1; display: flex; align-items: center; gap: .6rem; }
.room-name { font-weight: 600; font-size: .95rem; }
.room-code-badge {
    padding: .2rem .6rem;
    background: var(--primary);
    color: #fff;
    border-radius: 4px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .12em;
    cursor: pointer;
    transition: filter .2s;
}
.room-code-badge:hover { filter: brightness(1.2); }
.room-viewers {
    display: flex; align-items: center; gap: .3rem;
    color: var(--green); font-weight: 600; font-size: .9rem;
}
.room-viewers svg { width: 18px; height: 18px; }

/* Room Main */
.room-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}
.video-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Video Container */
.video-container {
    position: relative;
    background: #000;
    aspect-ratio: 16/9;
    max-height: 70vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.video-empty {
    text-align: center; color: var(--text-dim);
    display: flex; flex-direction: column;
    align-items: center; gap: .6rem;
}
.video-empty svg { width: 52px; height: 52px; opacity: .4; }
.video-empty h3 { font-size: 1.1rem; color: var(--text); }

/* Video Controls */
.video-controls {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: .4rem 1rem .6rem;
}
.progress-bar {
    position: relative;
    height: 6px;
    background: var(--surface);
    border-radius: 3px;
    cursor: pointer;
    margin-bottom: .5rem;
}
.progress-bar:hover { height: 10px; margin-bottom: .3rem; }
.progress-buffered {
    position: absolute; top: 0; left: 0; height: 100%;
    background: rgba(255,255,255,.08);
    border-radius: 3px;
    pointer-events: none;
}
.progress-filled {
    position: absolute; top: 0; left: 0; height: 100%;
    background: var(--primary);
    border-radius: 3px;
    pointer-events: none;
    width: 0%;
}
.progress-thumb {
    position: absolute; top: 50%;
    width: 14px; height: 14px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
    left: 0%;
}
.progress-bar:hover .progress-thumb { opacity: 1; }
.controls-row {
    display: flex; align-items: center; justify-content: space-between;
}
.controls-left, .controls-right {
    display: flex; align-items: center; gap: .5rem;
}
.ctrl-btn {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    border: none;
    color: var(--text);
    cursor: pointer;
    border-radius: 6px;
    transition: background .15s;
}
.ctrl-btn:hover { background: var(--surface); }
.ctrl-btn svg { width: 20px; height: 20px; }
.volume-group {
    display: flex; align-items: center;
}
.volume-slider {
    width: 80px; accent-color: var(--primary);
}
.time-display {
    font-size: .82rem;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
    min-width: 100px;
}
.rate-select {
    width: auto; padding: .3rem .5rem;
    font-size: .82rem; background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}

/* Quality selector */
.quality-selector {
    position: relative;
    display: inline-block;
}
.quality-btn {
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .03em;
    min-width: 48px;
}
.quality-btn span {
    pointer-events: none;
}
.quality-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    min-width: 90px;
    z-index: 50;
    box-shadow: var(--shadow);
}
.quality-item {
    display: block;
    width: 100%;
    padding: .45rem .8rem;
    font-size: .82rem;
    color: var(--text);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: var(--font);
}
.quality-item:hover {
    background: var(--surface);
}
.quality-item.active {
    color: var(--primary);
    font-weight: 600;
}

/* Stream settings (cogwheel) */
.stream-settings {
    position: relative;
    display: inline-block;
}
.stream-settings-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 6px;
    background: rgba(36, 26, 34, .92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-width: 170px;
    z-index: 55;
    box-shadow: var(--shadow);
    padding: .35rem 0;
}
.settings-section {
    padding: .25rem 0;
}
.settings-section + .settings-section {
    border-top: 1px solid var(--border);
}
.settings-label {
    padding: .3rem .8rem;
    font-size: .7rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.settings-item {
    display: block;
    width: 100%;
    padding: .4rem .8rem;
    font-size: .82rem;
    color: var(--text);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: var(--font);
}
.settings-item:hover {
    background: var(--surface);
}
.settings-item.active {
    color: var(--primary);
    font-weight: 600;
}

/* Source panel in room */
.source-panel-room {
    padding: .8rem 1rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
}
.source-tabs-room { margin-bottom: .6rem; }
.source-input {
    display: flex; gap: .5rem; align-items: center;
}
.source-input input[type="url"] {
    flex: 1;
}
.file-drop-sm {
    flex: 1;
    padding: .6rem 1rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: .85rem;
    color: var(--text-dim);
    cursor: pointer;
    transition: border-color .2s;
}
.file-drop-sm:hover { border-color: var(--primary); }
.file-drop-sm .link { color: var(--primary-h); cursor: pointer; }
.upload-progress {
    display: flex; align-items: center; gap: .5rem; margin-top: .5rem;
}
.upload-bar {
    flex: 1; height: 6px; background: var(--surface); border-radius: 3px; overflow: hidden;
}
.upload-bar-fill {
    height: 100%; width: 0%; background: var(--primary); transition: width .3s;
}

/* ============================================
   Chat Sidebar
   ============================================ */
.chat-sidebar {
    width: 320px;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
}
.chat-header {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
}
.chat-header h3 { font-size: .95rem; font-weight: 600; }
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: .75rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.chat-system {
    text-align: center;
    font-size: .8rem;
    color: var(--text-dim);
    padding: .4rem;
    background: var(--surface);
    border-radius: var(--radius-sm);
}
.chat-msg {
    display: flex; flex-direction: column;
}
.chat-msg-name {
    font-size: .75rem;
    font-weight: 600;
    color: var(--primary-h);
    margin-bottom: .1rem;
}
.chat-msg-text {
    font-size: .88rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.chat-msg-event {
    text-align: center;
    font-size: .78rem;
    color: var(--text-dim);
    font-style: italic;
}
.chat-form {
    padding: .6rem .75rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.chat-nickname {
    padding: .4rem .6rem !important;
    font-size: .82rem !important;
}
.chat-input-row {
    display: flex; gap: .4rem;
}
.chat-input-row input {
    flex: 1;
    padding: .55rem .8rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: .88rem;
    outline: none;
}
.chat-input-row input:focus { border-color: var(--primary); }
.btn-send {
    padding: .55rem .7rem;
    background: var(--primary);
}
.btn-send svg { width: 16px; height: 16px; }
.btn-gif {
    padding: .4rem .55rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .02em;
    border-radius: var(--radius-sm);
    cursor: pointer;
    line-height: 1;
    transition: border-color .15s, color .15s;
}
.btn-gif:hover, .btn-gif.active {
    border-color: var(--primary);
    color: var(--primary);
}

/* GIF Picker */
.gif-picker {
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    max-height: 320px;
}
.gif-picker-header {
    display: flex;
    gap: .4rem;
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--border);
}
.gif-picker-header input {
    flex: 1;
    padding: .4rem .6rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: .82rem;
    outline: none;
}
.gif-picker-header input:focus { border-color: var(--primary); }
.gif-picker-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 .3rem;
    line-height: 1;
}
.gif-picker-close:hover { color: var(--text); }
.gif-picker-grid {
    flex: 1;
    overflow-y: auto;
    padding: .5rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .4rem;
    min-height: 100px;
}
.gif-picker-hint {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-dim);
    font-size: .82rem;
    padding: 1.5rem 0;
}
.gif-picker-grid img {
    width: 100%;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform .1s;
    display: block;
}
.gif-picker-grid img:hover {
    transform: scale(1.04);
}
.gif-picker-footer {
    padding: .3rem .75rem;
    font-size: .68rem;
    color: var(--text-dim);
    text-align: right;
    border-top: 1px solid var(--border);
}

/* Chat GIF messages */
.chat-msg-gif {
    max-width: 200px;
    border-radius: var(--radius-sm);
    margin-top: .2rem;
    display: block;
}

/* ============================================
   Toast
   ============================================ */
.toast-container {
    position: fixed;
    top: 1rem; right: 1rem;
    display: flex; flex-direction: column; gap: .5rem;
    z-index: 2000;
}
.toast {
    padding: .7rem 1.2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .88rem;
    box-shadow: var(--shadow);
    animation: fadeIn .2s ease-out;
    max-width: 340px;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--primary); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-8px); } }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
    .room-main { flex-direction: column; }
    .chat-sidebar { width: 100%; min-width: 0; max-height: 300px; border-left: none; border-top: 1px solid var(--border); }
    .video-container { max-height: 50vh; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ============================================
   Login Page
   ============================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 30%, var(--login-glow) 0%, var(--login-glow2) 50%, transparent 70%);
}
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow);
    max-width: 420px;
    width: 100%;
}
.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .7rem;
    width: 100%;
    padding: .85rem 1.5rem;
    background: #fff;
    color: #333;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: box-shadow .2s, transform .15s;
}
.google-btn:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,.3);
    transform: translateY(-1px);
    text-decoration: none;
}
.login-note {
    text-align: center;
    color: var(--text-dim);
    font-size: .8rem;
    margin-top: 1.5rem;
    line-height: 1.6;
}

/* ============================================
   Auth Overlay (sign-in gate)
   ============================================ */
.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(26, 17, 24, .7);
    animation: fadeIn .3s ease-out;
}
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3rem 2.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
    max-width: 420px;
    width: 90%;
}
.app.blurred {
    filter: blur(6px);
    pointer-events: none;
    user-select: none;
}

/* ============================================
   User Bar (Home)
   ============================================ */
.user-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .8rem;
    margin-bottom: 1rem;
}
.user-info {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 2px solid var(--primary);
}
.user-name {
    font-size: .88rem;
    font-weight: 500;
    color: var(--text);
}
.btn-logout {
    padding: .35rem .8rem;
    font-size: .8rem;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    text-decoration: none;
    transition: all .2s;
}
.btn-logout:hover {
    border-color: var(--red);
    color: var(--red);
    text-decoration: none;
}
.btn-signin {
    padding: .45rem 1.2rem;
    font-size: .85rem;
    font-weight: 600;
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    color: var(--primary);
    text-decoration: none;
    transition: all .2s;
}
.btn-signin:hover {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}

/* ============================================
   Content Sections (How It Works, Features, FAQ)
   ============================================ */
.content-section {
    padding: 3rem 1.5rem 1rem;
}
.section-title {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: .4rem;
    color: var(--text);
}
.section-subtitle {
    text-align: center;
    color: var(--text-dim);
    font-size: .95rem;
    margin-bottom: 2rem;
}

/* Steps Grid (How It Works) */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}
@media (max-width: 900px) {
    .steps-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
    .steps-grid { grid-template-columns: 1fr; }
}
.step {
    text-align: center;
    padding: 1.5rem 1rem;
}
.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f2a0bf, #e87faa);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: .75rem;
}
.step h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: .4rem;
    color: var(--text);
}
.step p {
    font-size: .88rem;
    color: var(--text-dim);
    line-height: 1.6;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
@media (max-width: 900px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
    .features-grid { grid-template-columns: 1fr; }
}
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: border-color .2s, box-shadow .2s;
}
.feature-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 24px rgba(242,160,191,.1);
}
.feature-icon {
    width: 32px;
    height: 32px;
    color: var(--primary);
    margin-bottom: .75rem;
}
.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: .4rem;
    color: var(--text);
}
.feature-card p {
    font-size: .86rem;
    color: var(--text-dim);
    line-height: 1.6;
}

/* FAQ */
.faq-list {
    max-width: 740px;
    margin: 0 auto;
}
.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: .6rem;
    transition: border-color .2s;
}
.faq-item[open] {
    border-color: var(--primary);
}
.faq-item summary {
    padding: 1rem 1.2rem;
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+";
    font-size: 1.2rem;
    color: var(--primary);
    transition: transform .2s;
}
.faq-item[open] summary::after {
    content: "−";
}
.faq-item p {
    padding: 0 1.2rem 1rem;
    font-size: .88rem;
    color: var(--text-dim);
    line-height: 1.7;
}

/* User in room header */
.room-user {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-left: .5rem;
}
.user-avatar-sm {
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 2px solid var(--primary);
}
.btn-logout-sm {
    font-size: .75rem;
    color: var(--text-dim);
    text-decoration: none;
    padding: .2rem .5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all .2s;
}
.btn-logout-sm:hover {
    border-color: var(--red);
    color: var(--red);
    text-decoration: none;
}

/* ============================================
   Host Badge
   ============================================ */
.host-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .15rem .6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: .75rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-right: .5rem;
}
.host-badge svg { width: 14px; height: 14px; }
.host-badge.is-you {
    background: linear-gradient(135deg, rgba(242,160,191,.2), rgba(232,127,170,.15));
    border-color: var(--accent);
    color: var(--accent);
}

/* Host-disabled controls */
.ctrl-btn.host-disabled,
.progress-bar.host-disabled {
    opacity: .45;
    cursor: not-allowed;
}
.rate-select:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* ============================================
   Vote Overlay
   ============================================ */
.vote-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 17, 24, .9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    animation: fadeIn .3s ease-out;
}
.vote-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
    max-width: 420px;
    width: 90%;
    text-align: center;
}
.vote-card h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: .5rem;
    background: linear-gradient(135deg, #f7b8d0, #e87faa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.vote-subtitle {
    color: var(--text-dim);
    font-size: .88rem;
    margin-bottom: 1.5rem;
}
.vote-candidates {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-bottom: 1rem;
}
.vote-btn {
    width: 100%;
    padding: .75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: .95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
}
.vote-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background: rgba(242, 160, 191, .12);
}
.vote-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}
.vote-btn.voted {
    background: linear-gradient(135deg, #f2a0bf, #d4689e);
    border-color: var(--primary);
    color: #fff;
    opacity: 1;
}
.vote-hint {
    font-size: .78rem;
    color: var(--text-dim);
    font-style: italic;
}

/* YouTube player sizing */
#youtubePlayer {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
}
#youtubePlayer iframe {
    width: 100%;
    height: 100%;
}

/* ============================================
   Sidebar Tabs
   ============================================ */
.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.sidebar-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: .65rem .5rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-dim);
    font-family: var(--font);
    font-size: .82rem;
    font-weight: 500;
    cursor: pointer;
    transition: color .15s, border-color .15s;
}
.sidebar-tab:hover { color: var(--text); }
.sidebar-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.sidebar-tab svg { flex-shrink: 0; }
.people-count {
    background: var(--primary);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    padding: .1rem .4rem;
    border-radius: 999px;
    min-width: 18px;
    text-align: center;
    line-height: 1.3;
}

.sidebar-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}
.sidebar-panel:not(.active) { display: none; }

/* Chat panel inherits existing styles */
#chatPanel .chat-messages {
    flex: 1;
    overflow-y: auto;
}

/* ============================================
   People Panel — Media Permissions Banner
   ============================================ */
.media-permissions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .55rem .75rem;
    background: rgba(242,160,191,.08);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.media-perm-text {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .78rem;
    color: var(--text-dim);
}
.media-perm-text svg {
    flex-shrink: 0;
    color: var(--primary);
}
.btn-perm {
    white-space: nowrap;
    font-size: .72rem;
    padding: .3rem .7rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: opacity .15s;
}
.btn-perm:hover { opacity: .85; }
.media-permissions.granted {
    background: rgba(110,210,140,.1);
}
.media-permissions.granted .media-perm-text svg {
    color: #6ed28c;
}
.media-permissions.granted .media-perm-text {
    color: #6ed28c;
}
.media-permissions.denied {
    background: rgba(240,111,126,.1);
}
.media-permissions.denied .media-perm-text svg {
    color: var(--red);
}
.media-permissions.denied .media-perm-text {
    color: var(--red);
}

/* ============================================
   People Panel — Media Controls
   ============================================ */
.media-controls {
    display: flex;
    gap: .4rem;
    padding: .6rem .75rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.media-ctrl-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    padding: .5rem .3rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-family: var(--font);
    font-size: .68rem;
    cursor: pointer;
    transition: all .15s;
}
.media-ctrl-btn svg { width: 20px; height: 20px; }
.media-ctrl-btn:hover {
    border-color: var(--primary);
    color: var(--text);
}
.media-ctrl-btn.active {
    background: rgba(242,160,191,.15);
    border-color: var(--primary);
    color: var(--primary);
}

/* ============================================
   Webcam Overlay (top-left of video)
   ============================================ */
.webcam-overlay {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    padding: .4rem;
    pointer-events: none;
    max-width: 50%;
    max-height: 50%;
    overflow: hidden;
}
.webcam-overlay:empty { display: none; }
.webcam-tile {
    position: relative;
    background: #000;
    border-radius: var(--radius-sm);
    overflow: hidden;
    width: 120px;
    aspect-ratio: 4/3;
    pointer-events: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,.5);
    border: 1px solid rgba(255,255,255,.15);
}
.webcam-tile video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.webcam-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: .2rem .4rem;
    background: rgba(0,0,0,.6);
    color: #fff;
    font-size: .68rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   User List
   ============================================ */
.user-list {
    flex: 1;
    overflow-y: auto;
    padding: .5rem .75rem;
}
.user-list-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .5rem;
    border-radius: var(--radius-sm);
    transition: background .15s;
}
.user-list-item:hover {
    background: var(--surface);
}
.user-list-item.is-me {
    background: rgba(242,160,191,.06);
}
.user-list-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border);
    flex-shrink: 0;
    object-fit: cover;
}
.user-list-item.is-me .user-list-avatar {
    border-color: var(--primary);
}
.user-list-name {
    flex: 1;
    font-size: .85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-list-badges {
    display: flex;
    align-items: center;
    gap: .3rem;
    flex-shrink: 0;
}
.user-list-host-badge {
    color: var(--accent);
    display: flex;
    align-items: center;
}
.user-list-mute-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-dim);
    cursor: pointer;
    transition: all .15s;
}
.user-list-mute-btn:hover {
    border-color: var(--primary);
    color: var(--text);
}
.user-list-mute-btn.muted {
    background: rgba(240,111,126,.15);
    border-color: var(--red);
    color: var(--red);
}
.user-list-vol-badge {
    font-size: .65rem;
    color: var(--text-dim);
    background: var(--surface);
    padding: .1rem .35rem;
    border-radius: 3px;
    border: 1px solid var(--border);
}

/* ============================================
   User Volume Context Menu
   ============================================ */
.user-ctx-menu {
    position: fixed;
    z-index: 5000;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,.45);
    padding: .5rem;
    min-width: 200px;
    animation: fadeIn .12s ease-out;
}
.user-ctx-header {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text);
    padding: .25rem .4rem .45rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: .4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-ctx-row {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .3rem .4rem;
}
.user-ctx-row svg {
    flex-shrink: 0;
    color: var(--text-dim);
}
.user-vol-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}
.user-vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
}
.user-vol-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
}
#userVolLabel {
    font-size: .72rem;
    color: var(--text-dim);
    min-width: 32px;
    text-align: right;
}
.user-ctx-mute-btn {
    display: block;
    width: 100%;
    padding: .4rem;
    margin-top: .3rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: .78rem;
    cursor: pointer;
    text-align: center;
    transition: all .15s;
}
.user-ctx-mute-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.user-ctx-mute-btn.muted {
    background: rgba(240,111,126,.12);
    border-color: var(--red);
    color: var(--red);
}

/* ============================================
   Countdown Overlay
   ============================================ */
.countdown-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 17, 24, .85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2500;
    animation: fadeIn .3s ease-out;
}
.countdown-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3rem 2.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
    max-width: 420px;
    width: 90%;
    text-align: center;
}
.countdown-card h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #f7b8d0, #e87faa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.countdown-time {
    font-size: 3.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    letter-spacing: .05em;
    margin-bottom: .75rem;
}
.countdown-subtitle {
    color: var(--text-dim);
    font-size: .88rem;
    margin-bottom: 1.5rem;
}
.btn-cancel-countdown {
    background: var(--red);
    color: #fff;
}
.btn-cancel-countdown:hover { filter: brightness(1.15); }

/* Countdown panel in source tabs */
.countdown-panel {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.countdown-panel input[type="number"] {
    width: 100px;
    padding: .5rem .6rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: .88rem;
}

/* ============================================
   Responsive — People panel
   ============================================ */
@media (max-width: 900px) {
    .webcam-tile {
        width: 90px;
    }
}

/* ============================================
   Theme Toggle Button
   ============================================ */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    cursor: pointer;
    transition: border-color .2s, color .2s, background .2s;
    flex-shrink: 0;
    padding: 0;
}
.theme-toggle:hover {
    border-color: var(--primary);
    color: var(--text);
}
.theme-toggle svg {
    width: 18px;
    height: 18px;
}
/* Show moon by default (switch to dark), show sun in dark mode (switch to light) */
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ============================================
   Ambient Mood Glow (Video)
   ============================================ */
.video-mood-glow {
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: var(--radius);
    pointer-events: none;
    filter: blur(50px) saturate(1.8) brightness(1.2);
    opacity: 0;
    transition: opacity .8s ease;
    background: #000;
    transform: scale(1.15);
}
.video-mood-glow.active {
    opacity: .5;
}
.video-mood-glow canvas {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: inherit;
   Mini-game (Drinking Game Bot)
   ============================================ */

/* Banner above video */
.minigame-banner {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .8rem;
    background: linear-gradient(135deg, #3d1a35, #2e2129);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    margin-top: .4rem;
    animation: fadeIn .3s ease-out;
}
.minigame-banner-icon { font-size: 1.2rem; }
.minigame-banner-text {
    flex: 1;
    font-size: .85rem;
    font-weight: 600;
    color: var(--primary-h);
}
.btn-stop-game {
    background: transparent;
    border: 1px solid var(--red);
    color: var(--red);
    cursor: pointer;
    border-radius: 6px;
    padding: .15rem .5rem;
    font-size: .8rem;
    transition: background .2s;
}
.btn-stop-game:hover { background: rgba(240,111,126,.15); }

/* Dice button in chat input */
.btn-game {
    font-size: 1rem;
    padding: .4rem .5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    transition: border-color .2s, background .2s;
}
.btn-game:hover {
    border-color: var(--accent);
    background: var(--surface);
}

/* Vote cards in chat */
.chat-minigame-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .6rem .8rem;
    margin: .5rem 0;
    animation: fadeIn .25s ease-out;
}
.minigame-card-header {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-bottom: .4rem;
}
.minigame-card-icon { font-size: 1.1rem; }
.minigame-card-title {
    flex: 1;
    font-weight: 700;
    font-size: .88rem;
    color: var(--primary-h);
}
.minigame-card-timer {
    font-size: .75rem;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}
.minigame-card-desc {
    font-size: .82rem;
    color: var(--text-dim);
    margin-bottom: .5rem;
}
.minigame-card-actions {
    display: flex;
    gap: .4rem;
}

/* Opt-in yes/no buttons */
.minigame-vote-btn {
    flex: 1;
    padding: .5rem .6rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text);
    font-size: .85rem;
    font-family: var(--font);
    cursor: pointer;
    transition: border-color .2s, background .2s;
}
.minigame-vote-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background: var(--bg-card);
}
.minigame-vote-btn.yes:hover:not(:disabled) { border-color: var(--green); }
.minigame-vote-btn.no:hover:not(:disabled) { border-color: var(--red); }
.minigame-vote-btn:disabled {
    opacity: .5;
    cursor: default;
}

/* Topic vote buttons */
.minigame-topic-list {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.minigame-topic-btn {
    width: 100%;
    padding: .5rem .7rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text);
    font-size: .82rem;
    font-family: var(--font);
    text-align: left;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}
.minigame-topic-btn:hover:not(:disabled) {
    border-color: var(--accent);
    background: var(--bg-card);
}
.minigame-topic-btn.voted {
    border-color: var(--primary);
    background: rgba(242, 160, 191, .12);
}
.minigame-topic-btn:disabled {
    opacity: .5;
    cursor: default;
}

/* ============================================
   Background Particles (hearts & flowers)
   ============================================ */
.bg-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.bg-particle {
    position: absolute;
    font-size: 1.2rem;
    opacity: 0;
    will-change: transform, opacity;
}
