:root {
  --bg: #0b0e14;
  --panel: rgba(20, 25, 35, 0.86);
  --border: rgba(255, 255, 255, 0.12);
  --text: #f3f6fc;
  --muted: #9aa7bd;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
  --warn: #d97706;
  --ok: #16a34a;
  --gold: #ca8a04;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

/* Lobby */
.lobby-screen {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: radial-gradient(circle at top, #172033 0%, #0b0e14 65%);
}

.lobby-card {
  width: 100%;
  max-width: 420px;
  background: rgba(18, 23, 33, 0.94);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.brand-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #60a5fa;
  background: rgba(37, 99, 235, 0.16);
  border: 1px solid rgba(96, 165, 250, 0.28);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.lobby-card h1 {
  font-size: 22px;
  margin-bottom: 6px;
}

.subtitle {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--muted);
}

.field input {
  width: 100%;
  background: #0f141e;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 12px;
  font-size: 15px;
  outline: none;
}

.field input:focus {
  border-color: #60a5fa;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin: 10px 0 16px;
  cursor: pointer;
}

.error-banner {
  background: rgba(220, 38, 38, 0.16);
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #fecaca;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
}

.btn-primary {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

/* Stage */
.stage-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#remoteVideo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  transition: transform 0.2s ease;
}

.waiting-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(8, 10, 15, 0.72);
  pointer-events: none;
  z-index: 2;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.top-hud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  z-index: 10;
}

.hud-left, .hud-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pill {
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.pill-dark {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
}

.pill-ok {
  background: rgba(22, 163, 74, 0.85);
  color: #fff;
}

.pill-warn {
  background: rgba(217, 119, 6, 0.88);
  color: #fff;
}

.pill-err {
  background: rgba(220, 38, 38, 0.88);
  color: #fff;
}

.icon-btn {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}

.remote-panel {
  position: absolute;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%);
  width: min(960px, calc(100% - 24px));
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}

.panel-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.mini-label {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.ctrl-select, .ctrl-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.ctrl-select option {
  background: #141923;
  color: #fff;
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.ctrl-accent {
  background: rgba(37, 99, 235, 0.35);
  border-color: rgba(96, 165, 250, 0.45);
}

.ctrl-gold {
  background: rgba(202, 138, 4, 0.35);
  border-color: rgba(250, 204, 21, 0.45);
  text-decoration: none;
}

.slider {
  width: 110px;
  accent-color: #60a5fa;
}

.bottom-bar {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: min(960px, calc(100% - 24px));
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  backdrop-filter: blur(10px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 10;
}

.mic-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.btn-circle {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-circle.active {
  background: rgba(22, 163, 74, 0.32);
  border-color: rgba(74, 222, 128, 0.45);
}

.btn-circle.muted {
  background: rgba(220, 38, 38, 0.32);
  border-color: rgba(248, 113, 113, 0.45);
}

.btn-danger {
  background: var(--danger);
  border: none;
  color: #fff;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.toast-banner {
  font-size: 12px;
  color: #fde68a;
  background: rgba(202, 138, 4, 0.22);
  border: 1px solid rgba(250, 204, 21, 0.35);
  border-radius: 8px;
  padding: 5px 10px;
}

/* Snapshot Modal */
.photo-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(5, 7, 10, 0.96);
  display: flex;
  flex-direction: column;
}

.photo-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.photo-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.photo-viewport {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#snapshotImg {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

#snapshotImg.zoomed {
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}
