:root {
  --bg: #0b0d12;
  --card: #141824;
  --card-2: #1b2131;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f3f5f9;
  --muted: #98a2b3;
  --accent: #ff4d6d;
  --accent-2: #7c5cff;
  --ok: #22c55e;
  --warn: #f59e0b;
  --radius: 14px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.4;
}

.app-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 10px 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.version-pill {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.2);
  color: #c4b5fd;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--card-2);
}

.status-pill.online { color: var(--ok); background: rgba(34, 197, 94, 0.14); }
.status-pill.connecting { color: var(--warn); background: rgba(245, 158, 11, 0.14); }
.status-pill.offline { color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.room-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.room-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

input[type="text"],
input[type="url"],
input[type="password"] {
  width: 100%;
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}

input:focus {
  border-color: var(--accent-2);
}

.room-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  background: var(--card-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.btn.secondary {
  background: #242c40;
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
}

.btn.small {
  padding: 7px 10px;
  font-size: 13px;
}

.icon-btn {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
  color: var(--text);
  cursor: pointer;
  font-size: 15px;
}

.hint-text {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.stage {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

#moviePlayer {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

.empty-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 13, 18, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  gap: 10px;
}

.empty-overlay.hidden {
  display: none;
}

.sub-note {
  font-size: 12px;
  color: var(--muted);
  max-width: 280px;
}

.controls-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.volume-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 110px;
}

.volume-wrap input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.mini-pill {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--card-2);
  color: var(--muted);
}

.call-strip {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.call-videos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cam-box {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #090b10;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.cam-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cam-label {
  position: absolute;
  left: 6px;
  bottom: 6px;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.65);
}

.call-controls {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 14px;
}

.quick-reactions {
  display: flex;
  gap: 4px;
}

.react-btn {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 7px;
  cursor: pointer;
  font-size: 14px;
}

.chat-messages {
  height: 170px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  background: #0e111a;
  border-radius: 10px;
}

.chat-sys {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 4px;
}

.chat-msg {
  max-width: 82%;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 13px;
  word-break: break-word;
}

.chat-msg.me {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.chat-msg.them {
  align-self: flex-start;
  background: var(--card-2);
}

.chat-meta {
  display: block;
  font-size: 10px;
  opacity: 0.75;
  margin-bottom: 2px;
}

.chat-form {
  display: flex;
  gap: 8px;
}

.chat-form input {
  flex: 1;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-head h2 {
  margin: 0;
  font-size: 17px;
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
