.container {
  max-width: 1000px;
  margin: 32px auto;
  padding: 0 18px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: #111827;
}

body {
  margin: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(900px 520px at 15% 10%, rgba(59, 130, 246, 0.28), transparent 55%),
    radial-gradient(900px 520px at 85% 0%, rgba(168, 85, 247, 0.22), transparent 55%),
    radial-gradient(900px 520px at 70% 95%, rgba(34, 197, 94, 0.14), transparent 55%),
    #0b1220;
}

.header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.title {
  font-size: 22px;
  font-weight: 700;
  color: #f9fafb;
  letter-spacing: 0.2px;
}

.status {
  font-size: 14px;
  color: #cbd5e1;
}

.panel {
  border: 1px solid rgba(226, 232, 240, 0.2);
  border-radius: 16px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 18px 50px rgba(2, 6, 23, 0.45),
    0 1px 0 rgba(255, 255, 255, 0.65) inset;
  backdrop-filter: blur(10px);
}

#auth.panel {
  max-width: 520px;
  margin: 0 auto;
}

#lobby.panel {
  max-width: 760px;
  margin: 0 auto;
}

.authForm {
  display: grid;
  gap: 10px;
  max-width: 420px;
}

.authTitle {
  font-weight: 700;
  font-size: 16px;
}

.authSubtitle {
  margin-top: -4px;
  color: #475569;
  font-size: 13px;
}

.roleRow {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.roleChip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  cursor: pointer;
  user-select: none;
}

.roleChip input {
  margin: 0;
}

.errorText {
  color: #b91c1c;
  font-size: 13px;
}

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

.divider {
  margin: 12px 0;
  color: #6b7280;
  font-size: 13px;
}

.btn {
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #111827;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.1px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.btn:hover {
  background: #f3f4f6;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn.primary {
  border-color: #2563eb;
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  color: white;
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.25);
}

.btn.primary:hover {
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
}

.btn.danger {
  border-color: #ef4444;
  background: #fee2e2;
  color: #7f1d1d;
}

.btn.danger:hover {
  background: #fecaca;
}

.input {
  flex: 1;
  min-width: 220px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 14px;
  line-height: 1.15;
  background: rgba(255, 255, 255, 0.9);
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.input::placeholder {
  color: #64748b;
}

.input:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  background: rgba(241, 245, 249, 0.85);
}

.input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}

.meetingInfo {
  margin-top: 12px;
  font-size: 14px;
  color: #0f172a;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(248, 250, 252, 0.85);
}

.waitingCard {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(248, 250, 252, 0.92);
  display: grid;
  gap: 6px;
}

.waitingTitle {
  font-weight: 800;
  font-size: 14px;
  color: #0f172a;
}

.waitingBody {
  font-size: 14px;
  color: #0f172a;
}

.waitingMeta {
  font-size: 13px;
  color: #475569;
}

.dashboard {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.dashboardTitle {
  font-weight: 900;
  font-size: 16px;
  color: #0f172a;
}

.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tabBtn {
  border: 1px solid rgba(15, 23, 42, 0.18);
  background: rgba(255, 255, 255, 0.8);
  color: #0f172a;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.tabBtn.active {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(219, 234, 254, 0.95);
  color: #1e3a8a;
}

.dashList {
  display: grid;
  gap: 10px;
}

.dashItem {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(248, 250, 252, 0.92);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.dashLeft {
  display: grid;
  gap: 2px;
}

.dashPrimary {
  font-weight: 750;
  font-size: 14px;
  color: #0f172a;
}

.dashSecondary {
  font-size: 13px;
  color: #475569;
}

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

.pill {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  background: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: 750;
  color: #0f172a;
  white-space: nowrap;
}

.pill.good {
  border-color: rgba(34, 197, 94, 0.3);
  color: #14532d;
  background: rgba(220, 252, 231, 0.85);
}

.pill.warn {
  border-color: rgba(245, 158, 11, 0.35);
  color: #78350f;
  background: rgba(254, 243, 199, 0.85);
}

.pill.bad {
  border-color: rgba(239, 68, 68, 0.35);
  color: #7f1d1d;
  background: rgba(254, 226, 226, 0.85);
}

.hidden {
  display: none;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
}

.videoCard {
  border: 1px solid rgba(226, 232, 240, 0.14);
  border-radius: 16px;
  overflow: hidden;
  background: #111827;
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 160px;
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.55);
}

.videoCard.proctorFlagged {
  border-color: rgba(239, 68, 68, 0.8);
  box-shadow:
    0 0 0 2px rgba(248, 113, 113, 0.5),
    0 18px 50px rgba(127, 29, 29, 0.8);
}

.videoLabel {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(17, 24, 39, 0.6);
  color: #f9fafb;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  z-index: 2;
}

.proctorFlag {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.95);
  color: #111827;
  font-size: 11px;
  font-weight: 750;
  z-index: 3;
  box-shadow: 0 6px 18px rgba(127, 29, 29, 0.65);
}

video {
  width: 100%;
  height: 100%;
  display: block;
  background: #111827;
  object-fit: cover;
}

.remoteGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  grid-auto-rows: minmax(180px, 1fr);
  gap: 14px;
  align-content: stretch;
}

.meetingPanel {
  padding: 0;
  border-color: #111827;
  background: #0b1220;
  overflow: hidden;
}

.meetingPanel:not(.hidden) {
  display: flex;
  flex-direction: column;
}

.meetingStage {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

#remoteVideos.remoteGrid {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.localCard {
  border-color: #1f2937;
}

.videoOffOverlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #f9fafb;
  font-size: 16px;
  background: rgba(17, 24, 39, 0.7);
  z-index: 3;
}

.meetingBar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-top: 1px solid #1f2937;
  background: rgba(2, 6, 23, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  bottom: 0;
  z-index: 5;
}

body.inMeeting {
  overflow: hidden;
}

body.inMeeting .container {
  max-width: none;
  margin: 0;
  padding: 0;
}

body.inMeeting #meeting.panel {
  position: fixed;
  inset: 0;
  border-radius: 0;
}

#meeting.presenting .meetingStage {
  flex-direction: row;
}

.presenterStage {
  flex: 1;
  min-width: 0;
  min-height: 0;
}

#meeting.presenting .presenterStage {
  display: block;
}

#meeting.presenting .presenterStage .videoCard {
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
}

#meeting.presenting .presenterStage video {
  object-fit: contain;
  background: #0b1220;
}

#meeting.presenting #remoteVideos {
  width: 320px;
  flex: 0 0 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

#meeting.presenting #remoteVideos .videoCard {
  min-height: 110px;
  aspect-ratio: 16 / 9;
}

.meetingBarRight {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.codePill {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid #1f2937;
  background: #0b1220;
  color: #e5e7eb;
  font-size: 13px;
  white-space: nowrap;
}

.controlBtn {
  border: 1px solid #334155;
  background: #0b1220;
  color: #e5e7eb;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
}

.controlBtn:hover {
  background: #0f172a;
}

.controlBtn.off {
  border-color: #ef4444;
  color: #fecaca;
}

.controlBtn.danger {
  border-color: #ef4444;
  background: #7f1d1d;
  color: #fee2e2;
}

.controlBtn.danger:hover {
  background: #991b1b;
}

.proctorOverlay {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(6px);
}

.proctorPanel {
  width: min(560px, 100%);
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.18);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 60px rgba(2, 6, 23, 0.55);
  padding: 16px;
  display: grid;
  gap: 10px;
}

.proctorTitle {
  font-weight: 800;
  font-size: 16px;
  color: #0f172a;
}

.proctorBody {
  font-size: 14px;
  color: #334155;
  line-height: 1.35;
}

.proctorCount {
  font-size: 13px;
  color: #64748b;
}

.proctorActions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
