
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-elevated: #1a1a1a;
    --accent-primary: #c8a86e;
    --accent-secondary: #b8944d;
    --accent-glow: rgba(200, 168, 110, 0.15);
    --text-primary: #f0f0f0;
    --text-secondary: #777777;
    --text-muted: #555555;
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.12);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-bg-hover: rgba(255, 255, 255, 0.06);
    --success: #34d399;
    --danger: #ef4444;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-pill: 100px;
}

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

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Views ────────────────────────────────── */

.view {
    position: absolute;
    width: 100%;
    height: 100%;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.view.hidden {
    opacity: 0;
    pointer-events: none;
}

.view.active {
    opacity: 1;
    pointer-events: all;
}

/* ── Glass Panel ─────────────────────────── */

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

/* ── Background Gradients ────────────────── */

.bg-gradient-1 {
    position: fixed;
    top: -30%;
    left: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(200, 168, 110, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.bg-gradient-2 {
    position: fixed;
    bottom: -40%;
    right: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(200, 168, 110, 0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ═══════════════════════════════════════════
   LANDING PAGE
   ═══════════════════════════════════════════ */

#landing-view {
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.hero-container {
    text-align: center;
    max-width: 440px;
    width: 100%;
    padding: 0 1.5rem;
}

/* Hero Play Icon */
.hero-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.04);
}

.hero-play-icon {
    width: 28px;
    height: 28px;
    color: white;
    fill: white;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 2.75rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.2px;
}

.accent-word {
    color: var(--accent-primary);
}

/* Action Card */
.action-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ── Buttons ─────────────────────────────── */

.btn-premium {
    border: none;
    color: white;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-premium.primary {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
}

.btn-premium.primary:hover {
    background: var(--glass-bg-hover);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-premium.secondary {
    background: white;
    color: #0a0a0a;
    font-weight: 600;
    padding: 0.875rem 1.75rem;
}

.btn-premium.secondary:hover {
    background: #e5e5e5;
    transform: translateY(-1px);
}

.btn-premium.danger {
    background: #b42318;
}

.btn-premium.danger:hover {
    background: #912018;
}

.btn-premium.small {
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
}

/* ── Divider ─────────────────────────────── */

.divider {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.divider span {
    margin: 0 1rem;
}

/* ── Join Form ───────────────────────────── */

.join-form {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
}

input[type="text"] {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: white;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    flex: 1;
    font-family: var(--font-body);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
    letter-spacing: 1px;
    min-width: 0;
}

input[type="text"]:focus {
    border-color: rgba(255, 255, 255, 0.2);
}

input[type="text"]::placeholder {
    color: var(--text-muted);
    letter-spacing: 2px;
    font-size: 0.8rem;
}

/* ═══════════════════════════════════════════
   ROOM VIEW
   ═══════════════════════════════════════════ */

#room-view {
    display: flex;
    flex-direction: column;
}

/* ── Room Header ─────────────────────────── */

.room-header {
    height: 56px;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.25rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-logo-icon {
    width: 22px;
    height: 22px;
    color: white;
}

.logo-small {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    color: white;
    letter-spacing: -0.3px;
}

.header-divider-line {
    width: 1px;
    height: 24px;
    background: var(--border-light);
}

.room-info {
    display: flex;
    align-items: center;
}

.room-code-pill {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.room-label {
    color: var(--text-secondary);
    font-weight: 400;
}

.room-code-value {
    font-family: var(--font-heading);
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
}

.label {
    display: none;
    /* Hide the old label, using room-label now */
}

.code-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Header Actions ──────────────────────── */

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon-btn,
.icon-btn-mini {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0.45rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover,
.icon-btn-mini:hover {
    color: white;
    background: rgba(255, 255, 255, 0.06);
}

.icon-btn:disabled,
.icon-btn-mini:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.icon-btn svg,
.icon-btn-mini svg {
    width: 18px;
    height: 18px;
}

.room-action-btn {
    white-space: nowrap;
    line-height: 1;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: #0a0a0a;
    margin-left: 0.25rem;
}

/* ── Room Content ────────────────────────── */

.room-content {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 320px;
    height: calc(100vh - 56px);
    overflow: hidden;
}

/* ── Video Section ───────────────────────── */

.video-section {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    overflow: hidden;
    border-right: 1px solid var(--border);
}

.video-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 6, 14, 0.72);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 50;
}

.modal-overlay.hidden {
    display: none;
}

.modal-card {
    width: min(100%, 360px);
    padding: 1.5rem;
    position: relative;
    text-align: center;
    border: 1px solid var(--border-light);
}

.modal-close-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
}

.modal-eyebrow {
    margin: 0 0 0.35rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
}

.modal-card h3 {
    margin: 0;
    font-size: 1.4rem;
}

.modal-copy {
    margin: 0.75rem 0 1.25rem;
    color: var(--text-secondary);
}

.qr-code-container {
    width: 236px;
    min-height: 236px;
    margin: 0 auto 1rem;
    padding: 0.75rem;
    border-radius: 1.25rem;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-code-container canvas {
    display: block;
    width: 100%;
    height: auto;
}

.qr-room-link {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    word-break: break-word;
}

video {
    width: 100%;
    max-height: 100%;
    background: #000;
    display: block;
    object-fit: contain;
}

#main-video {
    position: relative;
    z-index: 1;
}

/* ── No Source State ──────────────────────── */

.no-source-state {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    z-index: 5;
    gap: 0.5rem;
}

.no-source-state.hidden {
    display: none !important;
}

.no-source-icon-wrap {
    margin-bottom: 0.75rem;
}

.no-source-icon-wrap svg,
.no-source-state>i {
    width: 56px;
    height: 56px;
    color: var(--text-muted);
    opacity: 0.6;
}

.no-source-state i {
    width: 56px;
    height: 56px;
    opacity: 0.6;
}

.no-source-state h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.no-source-state p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.8;
    margin-bottom: 1rem;
}

/* ── Host Controls ───────────────────────── */

.host-controls {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    max-width: 420px;
}

.host-controls.hidden {
    display: none;
}

.url-input-group {
    display: flex;
    align-items: center;
    gap: 0;
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 0.25rem 0.25rem 0.25rem 1rem;
    transition: border-color 0.2s;
}

.url-input-group:focus-within {
    border-color: rgba(255, 255, 255, 0.2);
}

.input-icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.url-input-group input[type="text"] {
    background: transparent;
    border: none;
    padding: 0.6rem 0.75rem;
    font-size: 0.83rem;
    letter-spacing: 0;
    flex: 1;
    min-width: 0;
}

.url-input-group input[type="text"]::placeholder {
    letter-spacing: 0;
    font-size: 0.83rem;
    color: var(--text-muted);
}

.url-input-group input[type="text"]:focus {
    border-color: transparent;
}

.btn-load {
    background: white;
    color: #0a0a0a;
    border: none;
    padding: 0.55rem 1.25rem;
    border-radius: var(--radius-pill);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.btn-load:hover {
    background: #e5e5e5;
}

.host-divider {
    width: 100%;
}

.btn-upload {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-upload:hover {
    background: var(--glass-bg-hover);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-upload svg {
    width: 16px;
    height: 16px;
}

/* ── Video Loading ───────────────────────── */

.video-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10;
}

.video-loading.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.video-loading p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ── Video Info Bar (top of video) ────────── */

.video-info-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 55;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.75) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.video-container:hover .video-info-bar,
.video-container.controls-visible .video-info-bar {
    opacity: 1;
    pointer-events: auto;
}

.video-info-bar.hidden {
    display: none !important;
}

.video-info-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.video-info-icon {
    width: 18px;
    height: 18px;
    color: rgba(255, 255, 255, 0.7);
}

.video-info-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.video-filename {
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
}

.video-added-by {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

.sync-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    border: 1px solid rgba(52, 211, 153, 0.25);
}

.sync-dot {
    width: 6px;
    height: 6px;
    background: #34d399;
    border-radius: 50%;
    display: inline-block;
}

/* ── Video Controls Overlay (empty, kept for JS) ── */

.video-controls-overlay {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: none;
    gap: 0.4rem;
    z-index: 60;
}

.video-ctrl-btn {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-ctrl-btn svg {
    width: 16px;
    height: 16px;
}

.video-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ── Video Controls (bottom bar) ─────────── */

.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    z-index: 50;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
    padding: 2rem 0.75rem 0.5rem;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.video-container:hover .video-controls,
.video-container.controls-visible .video-controls {
    opacity: 1;
    pointer-events: auto;
}

/* Hide cursor when controls are hidden */
.video-container.controls-hidden {
    cursor: none;
}

.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem 0;
}

.controls-left {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.controls-right {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.ctrl-btn {
    background: transparent;
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.ctrl-btn svg {
    width: 20px;
    height: 20px;
}

.progress-bar-container {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    transition: height 0.1s;
}

.progress-bar-container:hover {
    height: 5px;
}

.progress-bar {
    height: 100%;
    background: white;
    border-radius: 2px;
    transition: width 0.1s;
}

.time-display {
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    min-width: 90px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ── Volume Control ──────────────────────── */

.volume-control {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
    z-index: 55;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 70px;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    margin: 0 0.25rem;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    margin-top: -4.5px;
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.volume-slider::-webkit-slider-runnable-track {
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.volume-slider::-moz-range-track {
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

/* ═══════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════ */

.room-sidebar {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 0;
    border: none;
    border-left: 1px solid var(--border);
    background: var(--bg-primary);
    backdrop-filter: none;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
    font-weight: 500;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-family: var(--font-body);
}

.tab-btn svg {
    width: 16px;
    height: 16px;
}

.tab-btn:hover {
    color: var(--text-secondary);
}

.tab-btn.active {
    color: var(--text-primary);
}

.tab-btn.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: white;
}

.badge {
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-pill);
    font-size: 0.65rem;
    font-weight: 600;
    border: 1px solid var(--border);
}

.tab-content {
    display: none;
    flex: 1;
    overflow: hidden;
    flex-direction: column;
}

.tab-content.active {
    display: flex;
}

/* ── Chat Tab ────────────────────────────── */

#chat-tab {
    padding-bottom: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

/* Chat Messages — Bubble Style */
.message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    gap: 0.2rem;
}

.message-other {
    align-self: flex-start;
    align-items: flex-start;
}

.message-own {
    align-self: flex-end;
    align-items: flex-end;
}

.msg-username {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 0 0.25rem;
    letter-spacing: 0.2px;
}

.msg-bubble {
    display: block;
    font-size: 0.8rem;
    line-height: 1.5;
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-lg);
    word-break: break-word;
}

.message-other .msg-bubble {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-top-left-radius: 4px;
}

.message-own .msg-bubble {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    border-top-right-radius: 4px;
}

/* Backwards compat for old class names */
.message .user {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.65rem;
}

.message .text {
    color: var(--text-primary);
}

.system-message {
    color: var(--accent-primary);
    font-size: 0.65rem;
    text-align: center;
    margin: 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* ── Chat Input ──────────────────────────── */

.chat-input-area {
    padding: 0.75rem;
    display: flex;
    gap: 0.5rem;
    border-top: 1px solid var(--border);
}

.chat-input-area input {
    font-size: 0.83rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-pill);
    letter-spacing: 0;
}

.chat-input-area input::placeholder {
    letter-spacing: 0;
    font-size: 0.83rem;
}

#send-chat-btn {
    background: var(--text-primary);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #0a0a0a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

#send-chat-btn:hover {
    background: #d0d0d0;
    transform: scale(1.05);
}

#send-chat-btn svg {
    width: 16px;
    height: 16px;
}

/* ── Users Tab ───────────────────────────── */

#users-tab {
    padding: 0.75rem;
}

.user-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-list li {
    list-style: none;
    padding: 0.65rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border-radius: var(--radius-md);
    transition: background 0.15s;
}

.user-list li:hover {
    background: rgba(255, 255, 255, 0.03);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0a0a0a;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.user-sync-status {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
}

.sync-dot-small {
    width: 5px;
    height: 5px;
    background: var(--success);
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.host-badge {
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 600;
    margin-left: auto;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════ */

#toast-container {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    pointer-events: none;
}

.toast {
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    border: 1px solid var(--border);
    animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    white-space: normal;
    max-width: min(420px, calc(100vw - 2rem));
    text-align: left;
    line-height: 1.45;
}

.toast-upload {
    width: min(420px, calc(100vw - 2rem));
    border-radius: var(--radius-lg);
    padding: 0.9rem 1rem;
    background: rgba(20, 20, 20, 0.96);
    border-color: rgba(200, 168, 110, 0.35);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ═══════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════ */

.hidden {
    display: none !important;
}

.divider-vertical {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 0.5rem;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 900px) {
    .room-content {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 280px;
    }

    .video-section {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .room-sidebar {
        border-left: none;
        border-top: 1px solid var(--border);
    }
}

@media (max-width: 768px) {
    .logo-text {
        font-size: 2rem;
    }

    .room-header {
        padding: 0 0.75rem;
        min-height: 48px;
        height: auto;
        gap: 0.5rem;
        flex-wrap: wrap;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .header-left {
        gap: 0.5rem;
        min-width: 0;
    }

    .logo-small {
        display: none;
    }

    .header-divider-line {
        display: none;
    }

    .header-actions {
        gap: 0.25rem;
        margin-left: auto;
    }

    .host-controls {
        max-width: 100%;
        padding: 0 1rem;
    }

    .url-input-group {
        flex-wrap: nowrap;
    }

    .room-content {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 260px;
    }
}

@media (max-width: 560px) {
    .join-form {
        flex-direction: column;
    }

    .join-form .btn-premium.secondary {
        width: 100%;
        justify-content: center;
    }

    .room-info {
        min-width: 0;
    }

    .room-code-pill {
        width: 100%;
        justify-content: flex-start;
        padding-right: 0.5rem;
    }

    .room-code-value {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .modal-card {
        padding: 1.25rem;
    }

    .qr-code-container {
        width: min(100%, 220px);
        min-height: 220px;
    }
}

/* ═══════════════════════════════════════════
   FLOATING VOICE WIDGET (DISCORD-STYLE)
   ═══════════════════════════════════════════ */

.voice-float {
    position: fixed;
    bottom: 1.25rem;
    left: 1.25rem;
    z-index: 1000;
    width: 280px;
    border-radius: 12px;
    background: rgba(20, 20, 25, 0.92);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: vfSlideIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.voice-float.hidden { display: none; }

@keyframes vfSlideIn {
    from { opacity: 0; transform: translateY(16px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Minimized bar ──────────────────────── */

.vf-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    cursor: default;
}

.vf-bar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

.vf-live-dot {
    width: 7px;
    height: 7px;
    background: #34d399;
    border-radius: 50%;
    animation: livePulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

.vf-bar-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #34d399;
    line-height: 1.2;
}

.vf-bar-sub {
    font-size: 0.65rem;
    color: var(--text-muted);
    line-height: 1.2;
}

.vf-bar-actions {
    display: flex;
    gap: 0.3rem;
    flex-shrink: 0;
}

/* ── Control buttons (mic, leave) ────────── */

.vf-ctrl {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0;
}

.vf-ctrl svg { width: 15px; height: 15px; }

.vf-ctrl.active {
    background: rgba(52, 211, 153, 0.2);
    color: #34d399;
}
.vf-ctrl.active:hover { background: rgba(52, 211, 153, 0.35); }

.vf-ctrl.muted {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}
.vf-ctrl.muted:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
}

.vf-ctrl.leave {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
}
.vf-ctrl.leave:hover { background: rgba(248, 113, 113, 0.3); }

/* ── Expanded panel ─────────────────────── */

.vf-panel {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0.65rem 0.75rem;
    animation: vfPanelIn 0.2s ease;
}

.vf-panel.hidden { display: none; }

@keyframes vfPanelIn {
    from { opacity: 0; max-height: 0; }
    to   { opacity: 1; max-height: 400px; }
}

.vf-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.vf-panel-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #34d399;
}

.vf-count {
    background: rgba(52, 211, 153, 0.2);
    color: #34d399;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 9999px;
    min-width: 16px;
    text-align: center;
}

.vf-close {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    transition: all 0.15s;
    font-size: 0;
}
.vf-close svg { width: 14px; height: 14px; }
.vf-close:hover { background: rgba(255, 255, 255, 0.12); color: var(--text-primary); }

/* ── Participant grid ────────────────────── */

.vf-participants {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    max-height: 220px;
    overflow-y: auto;
    padding: 0.15rem 0;
}

.voice-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    cursor: default;
    position: relative;
}

.voice-avatar-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: #0a0a0a;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.2s;
}

.voice-avatar.is-self .voice-avatar-circle {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.voice-avatar-name {
    font-size: 0.62rem;
    color: var(--text-muted);
    max-width: 50px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.voice-avatar.speaking .voice-avatar-circle {
    box-shadow: 0 0 0 3px #34d399;
    animation: speakRing 1s ease-in-out infinite;
}

@keyframes speakRing {
    0%, 100% { box-shadow: 0 0 0 2px #34d399; }
    50%       { box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.45); }
}

.voice-avatar.peer-muted .voice-avatar-circle { opacity: 0.4; }
.voice-avatar.peer-muted .voice-avatar-name { text-decoration: line-through; opacity: 0.5; }

/* ── Avatar action buttons ───────────────── */

.va-actions {
    display: flex;
    gap: 0.15rem;
    margin-top: 0.1rem;
}

.va-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0;
    padding: 0;
}
.va-btn svg { width: 10px; height: 10px; }

.va-mute-btn {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}
.va-mute-btn:hover { background: rgba(255, 255, 255, 0.12); color: var(--text-primary); }
.va-mute-btn.muted { background: rgba(248, 113, 113, 0.15); color: #f87171; }

.va-kick-btn {
    background: rgba(248, 113, 113, 0.1);
    color: #f87171;
}
.va-kick-btn:hover { background: rgba(248, 113, 113, 0.25); }

/* ── Join Voice sidebar bar ──────────────── */

.voice-join-sidebar {
    position: fixed;
    bottom: 1.25rem;
    left: 1.25rem;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.75rem;
    width: 260px;
    border-radius: 12px;
    background: rgba(20, 20, 25, 0.88);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    gap: 0.5rem;
}

.voice-join-sidebar.hidden { display: none; }

.vjs-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.vjs-icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.vjs-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.vjs-sub {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.join-voice-btn {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.3);
    border-radius: 9999px;
    padding: 0.3rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-body);
    flex-shrink: 0;
    transition: all 0.2s;
}
.join-voice-btn:hover {
    background: rgba(52, 211, 153, 0.25);
    border-color: rgba(52, 211, 153, 0.5);
}
