:root {
  --bg: #0f1115;
  --surface: #1a1d24;
  --text: #f0f1f3;
  --muted: #9aa0ab;
  --accent: #4c8bf5;
  --danger: #e5484d;
  color-scheme: dark;
}

* { box-sizing: border-box; }

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

.app {
  width: 100%;
  max-width: 420px;
  padding: 24px;
}

.screen {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  text-align: center;
}

.screen.hidden { display: none; }

h1 { font-size: 28px; margin: 0 0 4px; }
h2 { font-size: 20px; margin: 0 0 4px; }

.subtitle, .hint {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 8px;
}

.btn {
  padding: 14px 20px;
  border-radius: 12px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary { background: var(--accent); color: white; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid #2a2e37; }
.btn-link { background: transparent; color: var(--muted); font-weight: 400; }
.btn-danger { background: var(--danger); color: white; }

.divider {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0;
}

.code-input {
  font-size: 32px;
  letter-spacing: 8px;
  text-align: center;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #2a2e37;
  background: var(--surface);
  color: var(--text);
}

.scanner-video {
  width: 100%;
  border-radius: 12px;
  background: black;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.qr-box {
  align-self: center;
  border-radius: 12px;
  background: white;
  padding: 12px;
  display: inline-block;
  line-height: 0;
}

.room-code-chip {
  background: var(--surface);
  border-radius: 10px;
  padding: 10px;
  font-size: 15px;
}

.participants {
  color: var(--muted);
  font-size: 14px;
}

.link-status {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 20px;
  display: inline-block;
  align-self: center;
  background: var(--surface);
}

.link-status.local { color: #4ade80; }
.link-status.direct-internet { color: #facc15; }
.link-status.relayed { color: #fb923c; }

.call-controls {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 8px;
}

.btn-round {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid #2a2e37;
  font-size: 15px;
}

.btn-round.active { background: var(--accent); color: white; }

.spinner {
  width: 40px;
  height: 40px;
  margin: 20px auto;
  border: 4px solid var(--surface);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }
