:root {
    color-scheme: light;
    --background: #f6f7f8;
    --surface: #ffffff;
    --surface-strong: #eef2f1;
    --text: #17211f;
    --muted: #5c6865;
    --line: #d7ddda;
    --accent: #0f766e;
    --accent-dark: #115e59;
    --danger: #b42318;
    --shadow: 0 8px 24px rgba(23, 33, 31, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
    min-height: 2.5rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-weight: 650;
    padding: 0 0.9rem;
}

button:hover {
    border-color: var(--accent);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

button.primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

button.primary:hover {
    background: var(--accent-dark);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem clamp(1rem, 3vw, 2rem);
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.topbar h1,
.panel h2 {
    margin: 0;
    letter-spacing: 0;
}

.topbar h1 {
    font-size: 1.35rem;
    line-height: 1.2;
}

.room-label {
    min-height: 1.25rem;
    margin: 0.25rem 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.6rem;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
    padding: 1rem clamp(1rem, 3vw, 2rem) 4rem;
}

.panel {
    min-width: 0;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.panel h2 {
    font-size: 1rem;
}

.counter {
    display: inline-grid;
    min-width: 2rem;
    height: 2rem;
    place-items: center;
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.share-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.8rem;
    min-height: 13rem;
    align-content: start;
}

.share-grid.empty {
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.58);
}

.share-tile {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.video-frame {
    aspect-ratio: 16 / 10;
    background: #101817;
}

.video-frame video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tile-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 3rem;
    padding: 0.55rem 0.65rem;
}

.tile-title {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stop-button {
    min-height: 2rem;
    color: var(--danger);
    padding: 0 0.7rem;
}

.statusbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem clamp(1rem, 3vw, 2rem);
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.95);
    color: var(--muted);
    font-size: 0.9rem;
    backdrop-filter: blur(12px);
}

@media (max-width: 820px) {
    .topbar,
    .workspace {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: stretch;
        flex-direction: column;
    }

    .actions {
        justify-content: stretch;
    }

    .actions button {
        flex: 1 1 9rem;
    }
}
