:root {
  --bg: #101410;
  --bg-2: #171d18;
  --card: #1c2420;
  --ink: #edf3ea;
  --muted: #a3b2a6;
  --line: #314038;
  --accent: #d6f25c;
  --accent-ink: #17200a;
  --danger: #ff6b5a;
  --warn: #f0c36a;
  --ok: #8ee0a8;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(214, 242, 92, 0.16), transparent 55%),
    var(--bg);
  color: var(--ink);
}

button, input { font: inherit; }

button {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
}

button:disabled {
  opacity: 0.45;
  cursor: default;
}

button:focus-visible, input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.card {
  width: min(100%, 480px);
  background: var(--card);
  padding: calc(28px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.home-card { justify-content: center; }

.eyebrow {
  margin: 0;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
}

.lead, .status, .hint, .person span, .form-error {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.form-error { color: var(--danger); min-height: 1.2em; }

form, .stack { display: flex; flex-direction: column; gap: 12px; }

label span {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

input {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink);
  padding: 12px 14px;
  font-size: 16px;
}

.primary {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.ghost, .admin-row button {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(255, 107, 90, 0.45);
}

.call-top { display: flex; flex-direction: column; gap: 8px; }

.stage {
  display: grid;
  gap: 10px;
}

.person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: var(--bg-2);
  border: 1px solid transparent;
}

.person.live { border-color: rgba(214, 242, 92, 0.45); }

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #2a382c;
  font-weight: 700;
  flex: none;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar.xl {
  width: 72px;
  height: 72px;
  font-size: 24px;
}

.photo-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.file-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  cursor: pointer;
  overflow: hidden;
}

.file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 16px;
}

body[data-role="visitor"] #selfCard,
body[data-role="visitor"] #linkBox,
body[data-role="visitor"] #shortBox,
body[data-role="visitor"] #adminRow,
body[data-role="visitor"] #roleLabel {
  display: none;
}

body[data-role="visitor"] .stage {
  justify-items: center;
  padding-top: 8px;
}

body[data-role="visitor"] #peerCard {
  flex-direction: column;
  text-align: center;
  background: transparent;
  border: 0;
  padding: 0;
  gap: 14px;
}

body[data-role="visitor"] #peerCard small { display: none; }

body[data-role="visitor"] #peerAvatar {
  width: min(220px, 62vw);
  height: min(220px, 62vw);
  font-size: 64px;
}

.person.live .avatar { background: #314818; color: var(--accent); }

.person strong { display: block; }

.person small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.hint.warn { color: var(--warn); }

.controls {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mute {
  min-height: 72px;
  border-radius: 20px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 18px;
  font-weight: 700;
}

.mute.off {
  background: #3a2824;
  color: #ffd0c8;
}

.admin-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.link-box input { font-size: 16px; }

.gate, .block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.block a {
  color: var(--accent);
  font-weight: 700;
}

.block h1 { font-size: 28px; }

.remote-audio {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.pip-source {
  position: fixed;
  width: 96px;
  height: 96px;
  right: 16px;
  bottom: calc(128px + env(safe-area-inset-bottom));
  border-radius: 20px;
  object-fit: cover;
  z-index: 4;
  background: #1c2420;
}

@media (min-width: 760px) {
  .screen {
    align-items: center;
    padding: 32px 16px;
  }

  .card {
    min-height: 680px;
    border-radius: 28px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 32px 24px;
  }

  .home-card { min-height: 0; }
}

@media (max-width: 360px) {
  h1 { font-size: 28px; }
  .admin-row { grid-template-columns: 1fr; }
}
