:root {
    color-scheme: dark;
    --bg: #1e1e1e;
    --card: #252526;
    --border: #3e3e42;
    --text: #e5e5e5;
    --muted: #a0a0a0;
    --accent: #2563eb;
    --danger: #ef4444;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[hidden] { display: none !important; }

.lobby {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.card {
    width: min(440px, 100%);
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1.75rem;
    border-radius: 16px;
    background: var(--card);
    border: 1px solid var(--border);
    text-align: center;
}

.logo { font-weight: 800; letter-spacing: -0.02em; font-size: 1.1rem; }
h1 { margin: 0; font-size: 1.4rem; }
.lead { margin: 0; color: var(--muted); line-height: 1.5; font-size: 0.95rem; }
.small { margin: 0; color: var(--muted); font-size: 0.8rem; }
.error { margin: 0; color: var(--danger); font-size: 0.9rem; }

#preview {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    background: #000;
    object-fit: cover;
    transform: scaleX(-1);
}

button {
    font: inherit;
    border: none;
    cursor: pointer;
    border-radius: 10px;
    padding: 0.8rem 1rem;
    font-weight: 600;
}

.primary { background: var(--accent); color: #fff; }
.primary:disabled { opacity: 0.6; cursor: default; }
.secondary { background: #2d2d30; color: var(--text); border: 1px solid var(--border); }
.danger { background: var(--danger); color: #fff; }

.call {
    position: fixed;
    inset: 0;
    background: #000;
}

#remote {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#local {
    position: absolute;
    right: 1rem;
    top: 1rem;
    width: min(28vw, 220px);
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    object-fit: cover;
    transform: scaleX(-1);
    background: #111;
    border: 1px solid #333;
}

.status {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 0.6rem 1rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--text);
    text-align: center;
}

.transcribing {
    position: absolute;
    left: 50%;
    top: 1rem;
    transform: translateX(-50%);
    max-width: calc(100% - 2rem);
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    font-size: 0.85rem;
}

.controls {
    position: absolute;
    left: 50%;
    bottom: calc(1.5rem + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: flex;
    gap: 0.75rem;
}

.controls button {
    min-width: 56px;
    height: 56px;
    border-radius: 28px;
    background: rgba(45, 45, 48, 0.9);
    color: #fff;
    font-size: 1.2rem;
}

.controls button.off { background: #fff; color: #000; text-decoration: line-through; }
.controls .danger { background: var(--danger); padding: 0 1.4rem; font-size: 1rem; }

.caption {
    position: absolute;
    left: 50%;
    bottom: calc(6.5rem + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    max-width: min(90%, 760px);
    padding: 0.6rem 1rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 1.15rem;
    line-height: 1.45;
    text-align: center;
}

.language { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin: 0.6rem 0; font-size: 0.95rem; }
.language select { font-size: 1rem; padding: 0.35rem 0.5rem; border-radius: 8px; }
.controls .call-language { height: 56px; border-radius: 28px; border: 0; padding: 0 0.9rem; background: rgba(45, 45, 48, 0.9); color: #fff; font-size: 0.95rem; max-width: 9.5rem; }
.blocked { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); width: min(26rem, calc(100% - 2rem)); padding: 1rem 1.1rem; border-radius: 14px; background: rgba(20, 20, 22, 0.94); color: #fff; text-align: center; line-height: 1.45; }
.blocked p { margin: 0 0 0.6rem; }
