:root {
  color-scheme: dark light;
  --bg: #14171c;
  --panel: #1f242c;
  --text: #eef1f5;
  --muted: #97a1ad;
  --accent: #4f8cff;
  --danger: #e5484d;
}

* {
  box-sizing: border-box;
}

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

body.centered {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 24rem;
  padding: 2rem;
  background: var(--panel);
  border-radius: 0.75rem;
}

.card h1 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}

.card label {
  font-size: 0.875rem;
  color: var(--muted);
}

.card input {
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #333a45;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

.card button {
  margin-top: 0.5rem;
  padding: 0.75rem;
  border: none;
  border-radius: 0.5rem;
  background: var(--accent);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.error-text {
  margin: 0;
  font-size: 0.8rem;
  color: var(--danger);
}

.card form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card button.secondary {
  background: transparent;
  border: 1px solid #333a45;
  color: var(--text);
}

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

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #333a45;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg);
  z-index: 10;
}

/* The browser's default [hidden] { display: none } rule has the same
   specificity as .overlay's own display: flex, and author CSS beats the
   UA stylesheet at equal specificity -- so without this, setting
   element.hidden = true in JS never actually hides an .overlay element,
   even though the hidden attribute itself is set correctly. */
.overlay[hidden] {
  display: none;
}

#status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--panel);
  font-size: 0.875rem;
  color: var(--muted);
}

#video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.5rem;
  padding: 0.5rem;
}

.video-tile {
  position: relative;
}

.video-tile video {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 0.5rem;
  background: #000;
  object-fit: cover;
  display: block;
}

.video-label {
  position: absolute;
  left: 0.5rem;
  bottom: 0.5rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  font-size: 0.75rem;
}

#controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
}

#controls button {
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
}

#leave-call {
  background: var(--danger);
  color: white;
}

#foreground-notice {
  margin: 0;
  padding: 0.5rem 1rem 5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}
