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

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #22263a;
  --border: #2e3350;
  --accent: #6c63ff;
  --accent-hover: #5a52e0;
  --text: #e8eaf6;
  --text-muted: #8b90b0;
  --you-bg: #1e2d4a;
  --them-bg: #1e3a2a;
  --you-border: #2a5298;
  --them-border: #2a7a45;
  --danger: #e05555;
  --success: #4caf50;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  /* Respect notch / home indicator on iOS */
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* ── PWA install banner ── */
#pwa-banner {
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1rem;
  padding-top: calc(0.6rem + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

#pwa-banner span { flex: 1; }

#pwa-banner button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
  flex-shrink: 0;
}

/* ── Landing page ── */
.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  gap: 2.5rem;
}

.landing-logo {
  text-align: center;
}

.landing-logo h1 {
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #6c63ff 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-logo p {
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-size: 1.05rem;
}

.landing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.landing-card h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.join-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.join-form input { min-width: 0; }
.join-form .btn { flex-shrink: 0; }

input[type="text"], input[type="url"] {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.7rem 1rem;
  font-size: 16px;
  flex: 1;
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus, input[type="url"]:focus {
  border-color: var(--accent);
}

input::placeholder { color: var(--text-muted); }

.error-msg { color: #e05555; font-size: 0.85rem; }

.call-page-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.call-page-body { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.25rem; }

.recent-calls-card { padding-top: 1.25rem; }
.recent-calls-card h2 { margin-bottom: 0.75rem; }
.recent-calls-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.recent-call-item { display: flex; align-items: center; gap: 0.75rem; }
.recent-call-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.recent-call-url { font-size: 0.85rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-call-time { font-size: 0.75rem; color: var(--text-muted); }
.recent-call-btn { padding: 0.3rem 0.75rem; font-size: 0.8rem; flex-shrink: 0; }

.call-link-label { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.call-link-row { display: flex; gap: 0.5rem; }
.call-link-row input { min-width: 0; flex: 1; background: var(--surface2); color: var(--text-muted); cursor: default; }
.call-link-copy { flex-shrink: 0; padding: 0.35rem 0.75rem; font-size: 0.85rem; }
.call-link-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.5rem; }

.btn {
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #c44040; }

.btn-icon {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  padding: 0;
  transition: background 0.2s;
}
.btn-icon:hover { background: var(--border); }
.btn-icon.active {
  background: var(--accent);
  border-color: var(--accent);
}
.btn-icon.muted {
  background: var(--danger);
  border-color: var(--danger);
}

/* ── Room / call page ── */
.call-page {
  display: grid;
  grid-template-rows: 1fr auto auto auto;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  position: relative;
}

/* ── Lobby overlay ── */
.lobby-overlay {
  position: absolute;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem;
  padding-top: calc(1.25rem + env(safe-area-inset-top, 0px));
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
}

.lobby-card {
  width: 100%;
  max-width: 380px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lobby-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.lobby-preview-wrap {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 140px;
  background: var(--surface2);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.lobby-preview-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  display: block;
}

.lobby-no-cam {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 2.5rem;
}
.lobby-no-cam span:last-child { font-size: 0.85rem; }

.lobby-mic-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
}

.lobby-mic-bar {
  flex: 1;
  height: 6px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.lobby-mic-fill {
  height: 100%;
  width: 0%;
  background: var(--success);
  border-radius: 3px;
  transition: width 0.05s linear;
}

.lobby-no-mic-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.lobby-fields {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.lobby-field {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--border);
}
.lobby-field:last-child { border-bottom: none; }

.lobby-field label {
  width: 90px;
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.lobby-field select {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text);
}

.lobby-join-btn {
  width: 100%;
  padding: 0.85rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
}

.lobby-back-btn {
  position: absolute;
  top: calc(1rem + env(safe-area-inset-top, 0px));
  left: calc(1rem + env(safe-area-inset-left, 0px));
  z-index: 10;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  transition: background 0.2s, color 0.2s;
}
.lobby-back-btn:hover {
  background: var(--surface2);
  color: var(--text);
}

/* ── End-of-call screen ── */
.end-screen {
  position: absolute;
  inset: 0;
  z-index: 210;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.end-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  max-width: 320px;
  width: 100%;
}

.end-icon {
  font-size: 3rem;
  filter: grayscale(1) opacity(0.5);
  transform: rotate(135deg);
}

.end-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.end-duration {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.end-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
  width: 100%;
}

.end-actions .btn {
  flex: 1;
  text-align: center;
  text-decoration: none;
}

/* Video area */
.video-area {
  position: relative;
  background: #000;
  overflow: hidden;
}

#remote-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#local-video {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  width: 160px;
  height: 120px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--surface2);
  z-index: 10;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
}

#local-video:hover { opacity: 0.85; transform: scale(1.03); }

/* Swapped: local becomes fullscreen, remote becomes PIP */
.video-area.swapped #remote-video {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  width: 160px;
  height: 120px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--surface2);
  z-index: 10;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}

.video-area.swapped #remote-video:hover { opacity: 0.85; transform: scale(1.03); }

.video-area.swapped #local-video {
  position: static;
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: none;
  cursor: default;
  pointer-events: none;
  transform: none;
  opacity: 1;
}

/* Remote peer state overlays */
.remote-state-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 15;
  font-size: 1.3rem;
  background: rgba(0,0,0,0.6);
  border-radius: 8px;
  padding: 4px 8px;
  pointer-events: none;
}

.remote-lang-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 15;
  font-size: 0.75rem;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  color: #fff;
  border-radius: 1rem;
  padding: 3px 8px;
  pointer-events: none;
  letter-spacing: 0.02em;
}
.remote-lang-badge.hidden { display: none; }

.remote-no-video {
  position: absolute;
  inset: 0;
  z-index: 12;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--text-muted);
  pointer-events: none;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--text-muted);
  background: var(--surface);
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  border: 2px solid var(--border);
}

.status-badge {
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.status-badge.connecting { color: #ffa726; border-color: #ffa726; }
.status-badge.connected { color: var(--success); border-color: var(--success); }
.status-badge.waiting { color: var(--text-muted); }
.status-badge.disconnected { color: var(--danger); border-color: var(--danger); }

/* Captions */
.captions-area {
  background: var(--surface);
  border-top: 1px solid var(--border);
  height: 140px;
  overflow-y: auto;
  padding: 0.6rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  scroll-behavior: smooth;
  flex-shrink: 0;
}

.captions-area:empty::before {
  content: "Captions will appear here once the call starts...";
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

.caption {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-width: 85%;
  animation: fadeIn 0.2s ease;
}

.caption.you { align-self: flex-end; align-items: flex-end; }
.caption.them { align-self: flex-start; align-items: flex-start; }

.caption-bubble {
  padding: 0.4rem 0.75rem;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.caption.you .caption-original {
  background: var(--you-bg);
  border: 1px solid var(--you-border);
  border-radius: 12px 12px 2px 12px;
}

.caption.them .caption-original {
  background: var(--them-bg);
  border: 1px solid var(--them-border);
  border-radius: 12px 12px 12px 2px;
}

.caption-translated {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 0 0.5rem;
}

.caption-lang {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  font-style: normal;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 0.3rem;
  margin-right: 0.35rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  vertical-align: middle;
}

#remote-video, #local-video {
  transition: box-shadow 0.15s ease;
}

.speaking {
  box-shadow: 0 0 0 3px var(--success) !important;
}

/* Quality indicator */
.quality-indicator {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  z-index: 15;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 5px 7px;
  background: rgba(0,0,0,0.55);
  border-radius: 6px;
  cursor: default;
}

.quality-indicator.hidden { display: none; }

.qbar {
  width: 4px;
  border-radius: 1px;
  background: rgba(255,255,255,0.2);
  transition: background 0.4s;
}
.qbar:nth-child(1) { height: 5px; }
.qbar:nth-child(2) { height: 8px; }
.qbar:nth-child(3) { height: 11px; }
.qbar:nth-child(4) { height: 14px; }

.quality-indicator.q1 .qbar:nth-child(1) { background: var(--danger); }
.quality-indicator.q2 .qbar:nth-child(1),
.quality-indicator.q2 .qbar:nth-child(2) { background: #ffa726; }
.quality-indicator.q3 .qbar:nth-child(1),
.quality-indicator.q3 .qbar:nth-child(2),
.quality-indicator.q3 .qbar:nth-child(3) { background: #ffc107; }
.quality-indicator.q4 .qbar { background: var(--success); }

/* Captions collapsed */
.captions-hidden {
  height: 0 !important;
  padding: 0 !important;
  border: none !important;
  overflow: hidden !important;
}

/* Drag handle between video and captions */
.resize-handle {
  height: 18px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: ns-resize;
  touch-action: none;
  user-select: none;
  flex-shrink: 0;
  z-index: 5;
}

.resize-handle-grip {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  transition: background 0.15s;
}

.resize-handle:hover .resize-handle-grip,
.resize-handle.dragging .resize-handle-grip {
  background: var(--accent);
}

/* Lobby permission warning */
.lobby-perm-warning {
  background: rgba(224, 85, 85, 0.12);
  border: 1px solid var(--danger);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  font-size: 0.82rem;
  color: #f08080;
  line-height: 1.5;
}

/* Typing indicator */
.typing-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.55rem 0.85rem !important;
}

.typing-bubble span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingDot 1.2s infinite ease-in-out;
}
.typing-bubble span:nth-child(2) { animation-delay: 0.2s; }
.typing-bubble span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Caption scroll-to-bottom button */
.captions-scroll-btn {
  display: block;
  width: 100%;
  padding: 0.25rem;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 0.78rem;
  cursor: pointer;
  text-align: center;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.captions-scroll-btn:hover { background: var(--accent-hover); }
.captions-scroll-btn.hidden { display: none; }

/* Debug log panel */
.debug-log {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  max-height: 300px;
  overflow-y: scroll;
  overscroll-behavior: contain;
  background: rgba(0, 0, 0, 0.92);
  color: #0f0;
  font-family: monospace;
  font-size: 14px;
  line-height: 1.6;
  padding: 10px 14px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  z-index: 9999;
  border-bottom: 2px solid #0f0;
}

/* Controls bar — three-column layout */
.controls {
  position: relative;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0.6rem 1rem;
  padding-bottom: calc(0.6rem + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.controls-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: flex-start;
  min-width: 0;
}

.lang-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  cursor: default;
}

.controls-left select {
  flex: 1;
  min-width: 0;
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  outline: none;
  cursor: pointer;
  /* Truncate long language names gracefully */
  text-overflow: ellipsis;
  overflow: hidden;
}

.controls-center {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  justify-content: center;
}

.controls-right {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}

/* Overflow menu — floats above the right side of the toolbar */
.overflow-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.4rem;
  min-width: 160px;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.overflow-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.overflow-item:hover { background: var(--border); }
.overflow-item.active { background: var(--accent); }

select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.45rem 0.75rem;
  font-size: 16px;
  outline: none;
  cursor: pointer;
}

select:focus { border-color: var(--accent); }

/* Share bar overlay */
#share-bar-wrap {
  position: absolute;
  top: calc(1rem + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2rem);
  max-width: 520px;
  z-index: 20;
}

/* Share link */
.share-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.share-bar span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-bar .btn { padding: 0.35rem 0.75rem; font-size: 0.8rem; }

/* Utils */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hidden { display: none !important; }

/* Mobile landscape — compact controls, maximise video */
@media (max-height: 500px) and (orientation: landscape) {
  .call-page {
    grid-template-rows: 1fr auto;
  }

  .captions-area {
    display: none;
  }

  .resize-handle {
    display: none;
  }

  .captions-scroll-btn {
    display: none !important;
  }

  .controls {
    padding: 0.3rem 0.75rem;
    padding-bottom: calc(0.3rem + env(safe-area-inset-bottom, 0px));
    gap: 0.4rem;
  }

  .controls-left { display: none; }

  .controls-center {
    gap: 0.5rem;
  }

  .btn-icon {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }

  .btn.btn-danger {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
  }

  #local-video {
    width: 80px;
    height: 60px;
    bottom: 0.4rem;
    right: 0.4rem;
  }

  .lobby-overlay {
    flex-direction: row;
    align-items: stretch;
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .lobby-card {
    flex-direction: row;
    flex-wrap: wrap;
    max-width: 100%;
    gap: 0.5rem;
    align-items: flex-start;
  }

  .lobby-preview-wrap {
    width: 180px;
    aspect-ratio: auto;
    height: 100%;
    flex-shrink: 0;
  }

  .lobby-title { display: none; }
}

/* Responsive */
@media (max-width: 700px) {
  input, select, textarea { font-size: 16px; }

  /* Home page */
  .landing { padding: 1.5rem; gap: 1.5rem; }
  .landing-logo h1 { font-size: 2rem; }
  .landing-card { padding: 1.5rem; }
  .join-form { flex-direction: column; }
  .join-form .btn { width: 100%; }

  /* Lobby */
  .lobby-card { max-width: 100%; gap: 0.55rem; }
  .lobby-join-btn { padding: 0.7rem; }
  .lobby-title { display: none; }

  /* Room page */
  #local-video { width: 90px; height: 68px; bottom: 0.5rem; right: 0.5rem; }
  .video-area.swapped #remote-video { width: 90px; height: 68px; bottom: 0.5rem; right: 0.5rem; }
  .captions-area { height: 110px; padding: 0.5rem 0.75rem; }
  .controls { padding: 0.5rem 0.75rem; padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px)); }
  .controls-center { gap: 0.5rem; }
  .controls-left select { max-width: 100px; }
}
