/* Best Friend Fix — prototype styles.
   Deliberately large touch targets and high contrast: the target users
   include elderly people who need help, so nothing tiny or clever. */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #16202e;
  --muted: #5b6675;
  --border: #dbe1ea;
  --primary: #2563eb;
  --primary-press: #1d4ed8;
  --danger: #dc2626;
  --ok: #16a34a;
  --warn: #b45309;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(20, 32, 46, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f151e;
    --surface: #182230;
    --text: #eef2f8;
    --muted: #9aa7b8;
    --border: #2a3648;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { font-size: 26px; }
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.tag {
  font-size: 12px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px;
}

#main {
  max-width: 560px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.view { animation: fade 0.2s ease; }
.hidden { display: none !important; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.headline {
  font-size: 26px;
  line-height: 1.25;
  margin: 8px 0 6px;
  letter-spacing: -0.02em;
}
.sub { color: var(--muted); font-size: 16px; margin: 0 0 22px; }

.choice { display: grid; gap: 14px; }

.big-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 22px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.06s ease, background 0.15s ease;
}
.big-btn:active { transform: scale(0.985); }
.big-btn.primary { background: var(--primary); color: #fff; border-color: transparent; }
.big-btn.primary:active { background: var(--primary-press); }
.big-btn-emoji { font-size: 30px; }
.big-btn-text { font-size: 20px; font-weight: 650; }
.big-btn-hint { font-size: 14px; opacity: 0.85; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.link-row { display: flex; gap: 8px; margin-bottom: 14px; }
.link-input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}
.mini-btn {
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}
.share-btn { padding: 16px; }

.passcode-card { text-align: center; }
.passcode {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 0.18em;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
}

.passcode-input {
  width: 100%;
  text-align: center;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 0.2em;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  color: var(--text);
  margin-bottom: 14px;
}
.passcode-input:focus { outline: none; border-color: var(--primary); }

.status { font-size: 15px; margin: 14px 0; text-align: center; }
.status.waiting { color: var(--warn); }
.status.error { color: var(--danger); font-weight: 600; }
.status.ok { color: var(--ok); }

.text-btn {
  display: block;
  margin: 8px auto 0;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 15px;
  text-decoration: underline;
  cursor: pointer;
}

/* ---- Live session ---- */
#view-session { display: flex; flex-direction: column; gap: 14px; }
.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
#remote-video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.stage-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; color: #cbd5e1;
}
.spinner {
  width: 42px; height: 42px;
  border: 4px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.controls { display: flex; gap: 10px; flex-wrap: wrap; }
.ctrl-btn {
  flex: 1;
  min-width: 120px;
  padding: 16px;
  font-size: 16px;
  font-weight: 650;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.ctrl-btn.danger { background: var(--danger); color: #fff; border-color: transparent; }
.ctrl-btn.muted { background: var(--warn); color: #fff; border-color: transparent; }
