:root {
  --bg: #1f2a24;
  --fg: #fbf7ef;
  --muted: #c9c2b4;
  --accent: #3fae5a;
  --accent-dark: #2f8a46;
  --danger: #d9473b;
  --secondary: #4a5a51;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 28px;
  -webkit-tap-highlight-color: transparent;
}

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 24px;
  text-align: center;
}
.screen[hidden] { display: none; }

h1 { font-size: 48px; margin: 0; font-weight: 600; }

form { display: flex; flex-direction: column; gap: 20px; width: min(520px, 100%); }
label { font-size: 30px; text-align: left; }
input {
  font-size: 36px;
  padding: 18px 20px;
  border-radius: 16px;
  border: 3px solid var(--muted);
  background: #fff;
  color: #111;
}

button { font: inherit; cursor: pointer; border: 0; color: var(--fg); }
.big {
  min-height: 80px;
  padding: 16px 36px;
  border-radius: 20px;
  font-size: 32px;
  font-weight: 600;
  background: var(--accent);
}
.big:active { transform: scale(0.97); }
.secondary { background: var(--secondary); }
.danger { background: var(--danger); }
.error { color: #ffb4a8; min-height: 1.4em; margin: 0; font-size: 30px; }

.call-button {
  width: min(60vmin, 420px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 12px 0 var(--accent-dark), 0 0 0 16px rgba(63, 174, 90, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 52px;
  font-weight: 700;
}
.call-button .icon { font-size: 110px; line-height: 1; }
.call-button:active { transform: translateY(8px); box-shadow: 0 4px 0 var(--accent-dark); }

.status-text { font-size: 44px; line-height: 1.3; max-width: 900px; margin: 0; }
.pulse { font-size: 120px; animation: pulse 1.4s ease-in-out infinite; }
.pulse.off { animation: none; visibility: hidden; }
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.6; }
}

.call { padding: 0; background: #000; }
#remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
#self {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 22vw;
  max-width: 260px;
  border-radius: 14px;
  border: 3px solid rgba(255, 255, 255, 0.7);
  background: #222;
  transform: scaleX(-1);
}
.controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 16px;
  justify-content: center;
  padding: 16px 16px max(16px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
}
.controls .view { background: var(--secondary); }
.controls .view.active { background: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; }
}
