:root {
  color-scheme: dark;
  --bg: #121417;
  --panel: #1a1d22;
  --panel-strong: #242932;
  --text: #f4f6f8;
  --muted: #aeb7c2;
  --line: #343b46;
  --accent: #22c1a7;
  --accent-strong: #18a58f;
  --danger: #e85d75;
  --danger-strong: #c9475f;
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: 100vw;
  height: 100vh;
  min-height: 520px;
}

.video-stage {
  position: relative;
  display: grid;
  min-height: 0;
  background: #08090b;
  overflow: hidden;
}

.remote-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background:
    radial-gradient(circle at 20% 20%, rgba(34, 193, 167, 0.18), transparent 28%),
    linear-gradient(135deg, #12151a, #050607);
}

.local-video {
  position: absolute;
  right: 18px;
  bottom: 82px;
  width: min(28vw, 320px);
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: #171a20;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}

.status-strip {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 36px;
}

.status-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(18, 20, 23, 0.78);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.control-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 74px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.primary-button,
.danger-button,
.icon-button,
.relay-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  height: 42px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.primary-button {
  background: var(--accent);
  color: #07100e;
  font-weight: 700;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.danger-button {
  background: var(--danger);
  color: #21070d;
  font-weight: 700;
}

.danger-button:hover {
  background: var(--danger-strong);
}

.icon-button,
.relay-toggle {
  background: var(--panel-strong);
  border-color: var(--line);
}

.icon-button:hover,
.relay-toggle:hover {
  border-color: var(--accent);
}

.relay-toggle {
  gap: 9px;
}

.relay-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

@media (max-width: 720px) {
  .app-shell {
    min-height: 100svh;
  }

  .local-video {
    right: 12px;
    bottom: 92px;
    width: min(44vw, 210px);
  }

  .status-strip {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .control-bar {
    justify-content: stretch;
  }

  .primary-button,
  .danger-button,
  .icon-button,
  .relay-toggle {
    flex: 1 1 120px;
    min-width: 0;
  }
}
