/* ============================================================
   Yap — Design System
   Based on odd.tech visual language
   Inter + JetBrains Mono · Dark minimal · Lucide icons
   ============================================================ */

/* --- Reset --- */

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

/* --- Design tokens --- */

:root {
    --bg: #0a0a0b;
    --surface: #111113;
    --surface-hover: #18181b;
    --border: #1e1e22;
    --border-hover: #2a2a2f;
    --text: #e8e8ed;
    --text-muted: #7a7a85;
    --text-faint: #55555e;
    --accent: #6e56cf;
    --accent-hover: #7c67d4;
    --accent-light: #9b8afb;
    --accent-glow: rgba(110, 86, 207, 0.15);
    --green: #34d399;
    --yellow: #fbbf24;
    --red: #ef4444;
    --red-hover: #dc2626;
    --red-glow: rgba(239, 68, 68, 0.12);
    --controls-height: 4.5rem;
    --topbar-height: 2.5rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}


/* --- Base --- */

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

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

/* Subtle grid background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
    background-size: 64px 64px;
    pointer-events: none;
    z-index: 0;
}

/* Gradient glow */
.glow {
    position: fixed;
    top: -40%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(110, 86, 207, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--accent-light);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--text);
}


/* --- Typography --- */

h1, h2, h3 {
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}


/* --- Form elements --- */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9375rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-faint);
}

label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.875rem;
    letter-spacing: 0.01em;
}

label input {
    margin-top: 0.375rem;
}


/* --- Buttons --- */

button,
[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--accent);
    color: #fff;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

button:hover,
[type="submit"]:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 20px var(--accent-glow);
}

button:active {
    transform: scale(0.98);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}


/* --- Container --- */

.container {
    width: 100%;
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}


/* ============================================================
   Views
   ============================================================ */

.view {
    position: relative;
    z-index: 1;
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

[hidden] {
    display: none !important;
}


/* ============================================================
   Download bar (top-right corner)
   ============================================================ */

.download-bar {
    position: fixed;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 50;
    display: flex;
    gap: 0.375rem;
}

.dl-link {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--text-faint);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.dl-link:hover {
    color: var(--text-muted);
    background: var(--surface);
}

/* Hide download bar in room view */
#room-view:not([hidden]) ~ .download-bar,
body:has(#room-view:not([hidden])) .download-bar {
    display: none;
}


/* ============================================================
   Landing / Join
   ============================================================ */

#landing-view {
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem 1.5rem;
}

.logo-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-light);
    margin-bottom: 2rem;
}

.logo-mark {
    width: 7px;
    height: 7px;
    background: var(--accent);
    border-radius: 1.5px;
    transform: rotate(45deg);
}

.landing-content {
    width: 100%;
    max-width: 18rem;
}

.name-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    font-family: var(--font-body);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    margin-bottom: 0.625rem;
    text-align: center;
    outline: none;
    transition: border-color 0.15s;
}

.name-input:focus {
    border-color: var(--accent);
}

.name-input::placeholder {
    color: var(--text-faint);
}

.code-input {
    text-transform: uppercase;
    font-family: var(--font-mono);
    font-size: 1.125rem;
    letter-spacing: 0.25em;
}

.go-btn {
    width: 100%;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius);
    min-height: 2.75rem;
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.go-btn-sm {
    width: auto;
    min-height: 2.25rem;
    padding: 0.5rem 1.25rem;
    font-size: 0.8125rem;
    flex-shrink: 0;
}

/* Join toggle area */
.join-toggle-area {
    margin-top: 0.75rem;
    text-align: center;
    width: 100%;
    max-width: 22rem;
}

.text-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-family: var(--font-mono);
    cursor: pointer;
    padding: 0.25rem 0;
    transition: color var(--speed) var(--ease);
}

.text-link:hover {
    color: var(--text);
}

.paste-join-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    width: 100%;
}

.paste-join-form .name-input {
    flex: 1;
    min-width: 0;
}

/* Error banner */
.error-banner {
    margin-top: 1.25rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    background: var(--red-glow);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    font-size: 0.8125rem;
    width: 100%;
    max-width: 22rem;
}

.error-banner p {
    margin: 0;
}


/* ============================================================
   Room View
   ============================================================ */

/* Top bar — minimal overlay, never shrinks */
.room-topbar {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: transparent;
    min-height: auto;
}

.room-topbar nav {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

#participant-count {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.02em;
}

.copy-invite-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.625rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    font-family: var(--font-mono);
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: uppercase;
}

.copy-invite-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    border-color: rgba(255, 255, 255, 0.18);
}

.copy-invite-btn.copied {
    color: var(--green);
    border-color: rgba(34, 197, 94, 0.3);
}

.copy-invite-btn svg {
    flex-shrink: 0;
}

/* Room main area — fills remaining space, never scrolls */
.room-main {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1rem;
    padding-bottom: calc(var(--controls-height) + 1rem);
    overflow: hidden;
}


/* ============================================================
   Connection Status
   ============================================================ */

.connection-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0;
    font-size: 0.6875rem;
    font-weight: 500;
    font-family: var(--font-mono);
    white-space: nowrap;
    background: transparent;
    border: none;
    flex-shrink: 0;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.35);
}

.connection-status.connected .status-text {
    display: none;
}

.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--yellow);
}

.connection-status.connected .status-dot {
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
}

.connection-status.connecting .status-dot {
    background: var(--yellow);
    animation: pulse-dot 1.4s ease-in-out infinite;
}

.connection-status.reconnecting .status-dot {
    background: var(--yellow);
    animation: pulse-dot 1s ease-in-out infinite;
}

.connection-status.error .status-dot {
    background: var(--red);
    box-shadow: 0 0 6px var(--red);
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.7); }
}


/* ============================================================
   Participant Grid (tile layout)
   ============================================================ */

.participant-grid {
    display: grid;
    gap: 0.5rem;
    width: 100%;
    max-width: 56rem;
    margin: 0 auto;
    padding: 0;
    list-style: none;
    align-content: center;
    justify-content: center;
    /* grid-template-columns set by JS based on count */
}

.participant-tile {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 10;
    min-height: 6rem;
    border: 1px solid rgba(255,255,255,0.06);
    transition: border-color 0.2s ease;
    cursor: default;
}

.participant-tile:hover {
    border-color: rgba(255,255,255,0.12);
}

/* Large initial letter */
.tile-initial {
    font-size: 2.5rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    user-select: none;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Name + mute badge overlay at bottom */
.tile-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 0.75rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(transparent, rgba(0,0,0,0.55));
}

.tile-info .participant-name {
    font-size: 0.75rem;
    font-weight: 500;
    font-family: var(--font-mono);
    color: rgba(255,255,255,0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.01em;
}

.mute-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: rgba(255,255,255,0.5);
}

.mute-indicator svg {
    width: 14px;
    height: 14px;
}

/* Volume slider — shown on hover */
.tile-volume {
    position: absolute;
    bottom: 2rem;
    left: 0.75rem;
    right: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.participant-tile:hover .tile-volume {
    opacity: 1;
    pointer-events: auto;
}

/* Name edit button */
.name-edit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    padding: 2px;
    cursor: pointer;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
    margin-left: 0.25rem;
    vertical-align: middle;
}

.name-edit-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

/* Inline name edit */
.name-edit-input {
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    color: #fff;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    padding: 0.125rem 0.375rem;
    outline: none;
    width: 8rem;
    max-width: 100%;
}

.name-edit-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

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

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

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


/* ============================================================
   Controls Bar
   ============================================================ */

.controls-bar {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.125rem;
    padding: 0.375rem 0.5rem;
    padding-bottom: calc(0.375rem + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    width: auto;
    right: auto;
}

.controls-group {
    display: flex;
    align-items: center;
    gap: 0.125rem;
}

.controls-separator {
    width: 1px;
    height: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 0.25rem;
    flex-shrink: 0;
}

.control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    width: 2.75rem;
    height: 2.75rem;
    min-width: 44px;
    min-height: 44px;
    border: none;
    border-radius: 0.625rem;
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: background 0.12s ease, transform 0.1s ease, color 0.12s ease;
    padding: 0;
    font-size: 1rem;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.control-btn:active {
    transform: scale(0.92);
}

.control-btn .btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.control-btn .btn-icon svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.75;
}

.btn-label {
    font-size: 0.5rem;
    font-weight: 600;
    font-family: var(--font-mono);
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Active state (muted / deafened) */
.control-btn.active {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.control-btn.active:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.control-btn.active .btn-label {
    color: #f87171;
}

/* Sharing state */
.control-btn.sharing {
    background: rgba(110, 86, 207, 0.2);
    color: var(--accent-light);
}

.control-btn.sharing:hover {
    background: rgba(110, 86, 207, 0.3);
}

.control-btn.sharing .btn-label {
    color: var(--accent-light);
}

/* PTT mode (hold ~ to talk) */
.control-btn.ptt-active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.control-btn.ptt-active .btn-label {
    color: rgba(255, 255, 255, 0.9);
}

/* Danger (leave) */
.control-btn.danger {
    color: #f87171;
}

.control-btn.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.control-btn.danger .btn-label {
    color: #f87171;
}


/* ============================================================
   Dialogs
   ============================================================ */

dialog {
    border: none;
    background: transparent;
    padding: 0;
    margin: auto;
    max-width: 22rem;
    width: calc(100% - 2rem);
    color: var(--text);
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

dialog article {
    margin: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

dialog article header {
    padding: 1.25rem 1.25rem 0.5rem;
}

dialog article header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

dialog article header h3 svg {
    width: 18px;
    height: 18px;
    color: var(--accent-light);
}

dialog article > p {
    padding: 0 1.25rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
}

dialog article footer {
    padding: 0.75rem 1.25rem 1.25rem;
}

dialog article footer button {
    width: 100%;
    font-weight: 500;
    min-height: 2.5rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
}


/* ============================================================
   Screen Share
   ============================================================ */

.screen-share-area {
    flex: 1;
    min-height: 0;
    padding: 0 0.5rem;
    padding-bottom: calc(var(--controls-height) + 0.5rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Grid always fills the area; rows/cols set by JS so cells divide space equally */
.screen-share-grid {
    display: grid;
    gap: 4px;
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.share-tile {
    position: relative;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    min-height: 0;
    min-width: 0;
    border: 1px solid var(--border);
    transition: border-color 0.15s ease;
}

.share-tile:hover {
    border-color: var(--border-hover);
}

.share-tile video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.share-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 10px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    display: flex;
    align-items: center;
}

.share-owner {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: #fff;
    opacity: 0.85;
}


/* ============================================================
   Fullscreen Overlay
   ============================================================ */

.fullscreen-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.fullscreen-overlay[hidden] {
    opacity: 0;
    pointer-events: none;
}

.fullscreen-overlay video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.fullscreen-close {
    position: absolute;
    top: env(safe-area-inset-top, 16px);
    right: 16px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-family: var(--font-mono);
    cursor: pointer;
    backdrop-filter: blur(8px);
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.fullscreen-close:hover {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.25);
}

.fullscreen-close svg {
    width: 14px;
    height: 14px;
}


/* Screen share grid: no responsive scroll — always one pane, equal cells */

/* Share count indicator — hidden when 0 or 1 to save space */
.screen-share-area::before {
    content: attr(data-share-count) ' screen share(s)';
    display: block;
    font-size: 0.6875rem;
    font-family: var(--font-mono);
    color: var(--text-faint);
    padding: 2px 0;
    text-align: right;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.screen-share-area:not([data-share-count])::before,
.screen-share-area[data-share-count="0"]::before,
.screen-share-area[data-share-count="1"]::before {
    display: none;
}


/* ============================================================
   Layout: Active Screen Share
   ============================================================ */

.room-with-share .room-main {
    flex: 0 0 auto;
    align-items: stretch;
    padding: 0.25rem 0.75rem;
    padding-bottom: 0;
    overflow: visible;
}

.room-with-share .participant-grid {
    display: flex;
    gap: 0.375rem;
    overflow-x: auto;
    flex-shrink: 0;
    max-height: 4.5rem;
    align-items: stretch;
    padding: 0 0.25rem;
}

.room-with-share .participant-tile {
    flex-shrink: 0;
    width: 5.5rem;
    min-height: unset;
    aspect-ratio: 16 / 10;
}

.room-with-share .tile-initial {
    font-size: 1.125rem;
}

.room-with-share .tile-info .participant-name {
    font-size: 0.5625rem;
}

.room-with-share .tile-volume {
    display: none;
}


/* ============================================================
   Handoff
   ============================================================ */

.handoff-code {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 500;
    letter-spacing: 0.35em;
    text-align: center;
    padding: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--accent-light);
    user-select: all;
    margin: 1rem 1.25rem;
}

.handoff-timer {
    text-align: center;
    font-size: 0.8125rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    padding: 0 1.25rem;
}

.handoff-timer.expiring {
    color: var(--red);
    font-weight: 500;
}

.handoff-instructions {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 0 1.25rem;
}


/* ============================================================
   Footer
   ============================================================ */

.site-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 1.5rem 1rem;
    font-size: 0.6875rem;
    font-family: var(--font-mono);
    color: var(--text-faint);
    border-top: 1px solid var(--border);
}

.site-footer a {
    color: var(--text-faint);
}

.site-footer a:hover {
    color: var(--text-muted);
}

.footer-meta {
    margin-top: 0.25rem;
    font-size: 0.625rem;
}

/* Hide footer in room view */
#room-view:not([hidden]) ~ .site-footer {
    display: none;
}


/* ============================================================
   Utilities
   ============================================================ */

/* Overscroll prevention */
html, body {
    overscroll-behavior: none;
}

/* Single pane: no scroll when in room */
body:has(#room-view:not([hidden])) {
    overflow: hidden;
    height: 100dvh;
}

/* Focus-visible outlines */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* No text selection on controls */
.controls-bar,
.mute-indicator {
    user-select: none;
    -webkit-user-select: none;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
