* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

:root {
  --bg-primary: #0f0f0f;
  --bg-secondary: #1e1e1e;
  --bg-tertiary: #2a2a2a;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --success: #22c55e;
  --warning: #eab308;
  --error: #ef4444;
  --text-primary: #ffffff;
  --text-secondary: #9ca3af;
  --glass-bg: rgba(15, 15, 15, 0.85);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glow: rgba(99, 102, 241, 0.5);
  --scrollbar-track: rgba(15, 15, 15, 0.4);
  --scrollbar-thumb: rgba(99, 102, 241, 0.7);
  --scrollbar-thumb-hover: rgba(99, 102, 241, 0.9);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

#app {
  width: 100%;
  height: 100%;
  position: relative;
}

.video-container {
  width: 100%;
  height: 100%;
  padding-bottom: 100px;
}

.video-grid {
  display: grid;
  gap: 12px;
  padding: 12px;
  height: 100%;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  transition: all 0.3s ease;
  align-content: center;
  justify-content: center;
}

.video-grid.layout-sidebar {
  grid-template-columns: minmax(0, 1fr) minmax(200px, 0.35fr);
  gap: 16px;
}

.video-grid.layout-sidebar.layout-single {
  grid-template-columns: 1fr;
}

.video-grid.layout-sidebar .video-wrapper.is-primary {
  grid-column: 1;
  grid-row: 1 / -1;
}

.video-grid.layout-sidebar .video-wrapper:not(.is-primary) {
  grid-column: 2;
}

.video-grid.layout-sidebar.layout-single .video-wrapper {
  grid-column: auto;
  grid-row: auto;
}

.video-grid.layout-focus {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}

.video-grid.layout-focus .video-wrapper.is-primary {
  flex: 1 1 0;
  min-height: 0;
  aspect-ratio: auto;
}

.video-grid.layout-focus .video-wrapper.is-primary video {
  object-fit: contain;
}

.video-grid.layout-focus.has-filmstrip .focus-filmstrip {
  display: flex;
  flex-direction: row;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  height: 120px;
  overflow-x: auto;
  padding: 0 12px;
}

.video-grid.layout-focus.has-filmstrip .video-wrapper:not(.is-primary) {
  flex: 0 0 auto;
  width: auto;
  height: 100%;
  aspect-ratio: 16 / 9;
}

.video-grid.layout-focus.layout-single {
  justify-content: center;
}

.video-wrapper {
  position: relative;
  background: var(--bg-secondary);
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.video-wrapper.active-speaker {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--glow), 0 0 30px rgba(99, 102, 241, 0.3);
}

.video-wrapper:hover .video-controls {
  opacity: 1;
}

.video-controls {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.video-controls button {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: var(--glass-bg);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}

.video-controls button:hover {
  background: var(--bg-tertiary);
}

.audio-visualizer {
  position: absolute;
  bottom: 48px;
  left: 12px;
  display: flex;
  gap: 2px;
  height: 24px;
  align-items: flex-end;
  opacity: 0.8;
}

.audio-bar {
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
  animation: audioWave 0.5s ease-in-out infinite;
}

.audio-bar:nth-child(1) { animation-delay: 0s; }
.audio-bar:nth-child(2) { animation-delay: 0.1s; }
.audio-bar:nth-child(3) { animation-delay: 0.2s; }
.audio-bar:nth-child(4) { animation-delay: 0.3s; }
.audio-bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes audioWave {
  0%, 100% { height: 4px; }
  50% { height: 20px; }
}

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

.avatar {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 4rem;
  font-weight: bold;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.participant-label {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.7);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--text-primary);
  backdrop-filter: blur(8px);
}

.local-video-wrapper {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 200px;
  height: 150px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border: 2px solid var(--bg-tertiary);
  z-index: 100;
  background: var(--bg-secondary);
}

.local-video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.local-video-wrapper .avatar {
  width: 60px;
  height: 60px;
  font-size: 2rem;
}

.local-video-wrapper.in-grid {
  position: relative;
  bottom: auto;
  right: auto;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  border: 2px solid transparent;
  box-shadow: none;
  z-index: 1;
}

.local-video-wrapper.in-grid::after {
  content: "You";
  position: absolute;
  left: 12px;
  bottom: 12px;
  background: rgba(0, 0, 0, 0.7);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--text-primary);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.video-grid.layout-sidebar .local-video-wrapper.in-grid {
  grid-column: 2;
  align-self: start;
  height: auto;
}

.video-grid.layout-focus .local-video-wrapper.in-grid {
  height: auto;
}

.focus-filmstrip .video-wrapper,
.focus-filmstrip .local-video-wrapper.in-grid {
  flex: 0 0 auto;
  height: 100%;
  width: auto;
  aspect-ratio: 16 / 9;
}

.video-grid.layout-focus.single-remote .local-video-wrapper.in-grid {
  align-self: flex-end;
}

.control-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(26, 26, 26, 0.8);
  backdrop-filter: blur(12px);
  padding: 12px;
  border-radius: 16px;
  display: flex;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 100;
}

.control-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
}

.control-btn:hover {
  background: var(--bg-secondary);
  transform: scale(1.03);
}

.control-btn.active {
  background: var(--accent);
}

.control-btn.inactive {
  background: var(--error);
}

.control-btn svg {
  width: 20px;
  height: 20px;
}

.pending-panel {
  position: fixed;
  top: 80px;
  left: 20px;
  background: var(--bg-secondary);
  padding: 20px;
  border-radius: 12px;
  max-width: 300px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 100;
}

.pending-panel h3 {
  margin-bottom: 12px;
  font-size: 1rem;
  color: var(--text-primary);
}

.request-item {
  background: var(--bg-tertiary);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.request-item:last-child {
  margin-bottom: 0;
}

.request-info {
  font-size: 0.875rem;
  margin-bottom: 8px;
  word-break: break-all;
}

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

.btn-accept,
.btn-reject {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.2s;
}

.btn-accept {
  background: var(--success);
  color: white;
}

.btn-accept:hover {
  background: #059669;
}

.btn-reject {
  background: var(--error);
  color: white;
}

.btn-reject:hover {
  background: #dc2626;
}

.participant-count {
  position: fixed;
  top: 20px;
  left: 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.875rem;
  color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 100;
  border: 1px solid var(--glass-border);
}

.room-title-display {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 100;
  border: 1px solid var(--glass-border);
  max-width: 40vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant-count-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}

.connection-status {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  padding: 10px 16px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 100;
  border: 1px solid var(--glass-border);
}

.connection-status.collapsed {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
}

.connection-status.collapsed .bandwidth-indicator,
.connection-status.collapsed .security-indicator,
.connection-status.collapsed .quality-badge,
.connection-status.collapsed #btn-security-info {
  display: none;
}

.connection-status.collapsed .connection-quality {
  gap: 0;
}

.info-toggle {
  border: 1px solid var(--glass-border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  padding: 0;
}

.info-toggle:hover {
  background: var(--bg-secondary);
  transform: scale(1.05);
}

.connection-toggle svg {
  transition: transform 0.2s ease;
}

.connection-status.collapsed .connection-toggle svg {
  transform: rotate(180deg);
}

.connection-quality {
  display: flex;
  align-items: center;
  gap: 8px;
}

.connection-quality svg {
  color: var(--success);
  transition: color 0.3s ease;
}

.connection-quality.poor svg {
  color: var(--error);
  animation: pulse-red 1s infinite;
}

.connection-quality.fair svg {
  color: var(--warning);
}

@keyframes pulse-red {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.quality-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--success);
  color: var(--bg-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.quality-badge.poor {
  background: var(--error);
}

.quality-badge.fair {
  background: var(--warning);
}

.bandwidth-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

#bandwidth-value {
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.layout-controls {
  position: fixed;
  top: 80px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}

.debug-toggle {
  position: fixed;
  bottom: 20px;
  left: 20px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 120;
}

.debug-toggle:hover {
  background: var(--bg-tertiary);
}

.security-panel {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 380px;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  z-index: 120;
  overflow: auto;
}

.security-panel.hidden {
  display: none;
}

.security-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.security-section {
  background: var(--bg-secondary);
  padding: 12px;
  border-radius: 8px;
}

.security-section h4 {
  margin: 0 0 8px 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.security-hint {
  margin: 0 0 8px 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.security-warning {
  margin: 8px 0;
  padding: 8px 10px;
  font-size: 0.7rem;
  color: var(--warning);
  background: rgba(234, 179, 8, 0.1);
  border-left: 2px solid var(--warning);
  border-radius: 4px;
  line-height: 1.4;
}

.security-action {
  margin-top: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.security-action:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.security-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.8125rem;
}

.security-item label {
  color: var(--text-secondary);
  margin-right: 12px;
}

.security-item code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.75rem;
  background: var(--bg-tertiary);
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--text-primary);
}

.security-item span {
  color: var(--text-primary);
}

#security-participants {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.security-participant {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 8px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  font-size: 0.8125rem;
}

.security-participant-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.security-visual-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.security-visual-row .visual-label {
  font-weight: 500;
}

.security-code {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 22px;
}

.security-code.pending {
  color: var(--text-secondary);
  font-size: 0.7rem;
}

.group-verification-code {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: var(--bg-tertiary);
  border-radius: 8px;
}

.group-verification-code .security-code {
  justify-content: center;
}

.verification-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
  background: rgba(15, 15, 15, 0.4);
}

.verification-status.verified {
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.15);
}

.verification-status.warning {
  color: var(--error);
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.12);
}

.verification-status .status-icon {
  width: 14px;
  height: 14px;
}

.btn-verify {
  margin-top: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.btn-verify:hover {
  background: var(--bg-secondary);
}

.btn-verify:disabled {
  cursor: default;
  background: var(--bg-secondary);
  border-color: var(--glass-border);
  color: var(--text-secondary);
  opacity: 0.85;
}

.btn-verify.verified,
.btn-verify.verified:disabled {
  cursor: default;
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.5);
  color: var(--success);
  opacity: 1;
}

.verification-participants {
  width: 100%;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.verification-participant {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: rgba(15, 15, 15, 0.25);
  font-size: 0.75rem;
}

.verification-name {
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.verification-time {
  color: var(--text-secondary);
  font-size: 0.72rem;
  white-space: nowrap;
}

.verification-state,
.verification-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(15, 15, 15, 0.4);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.verification-state.verified,
.verification-chip.verified {
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.15);
}

.verification-state.unverified,
.verification-chip.unverified {
  color: var(--warning);
  border-color: rgba(234, 179, 8, 0.55);
  background: rgba(234, 179, 8, 0.12);
}

.verification-state.pending,
.verification-chip.pending {
  color: var(--text-secondary);
}

.participant-security .verification-chip {
  margin-left: auto;
}

.participant-connection {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.participant-connection-label {
  color: var(--text-secondary);
}

.connection-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(15, 15, 15, 0.4);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  margin-left: auto;
}

.connection-chip.direct {
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.15);
}

.connection-chip.relay {
  color: var(--warning);
  border-color: rgba(234, 179, 8, 0.55);
  background: rgba(234, 179, 8, 0.12);
}

.connection-chip.pending {
  color: var(--text-secondary);
}

.security-participant-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.security-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--icon-color, var(--glass-border));
  color: var(--icon-color, var(--text-secondary));
  background: rgba(15, 15, 15, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.security-icon svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.security-participant .name {
  color: var(--text-primary);
  font-weight: 500;
}

.security-participant .fingerprint {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.participant-security {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.participant-security-label {
  flex-shrink: 0;
}

.participant-security .security-icon {
  width: 18px;
  height: 18px;
  border-radius: 5px;
}

.participant-security .security-icon svg {
  width: 12px;
  height: 12px;
}

.security-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--success);
}

.security-status {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.debug-panel {
  position: fixed;
  bottom: 80px;
  left: 20px;
  width: 320px;
  max-height: 40vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  z-index: 120;
}

.debug-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.debug-close {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.debug-close:hover {
  color: var(--text-primary);
}

.debug-content {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
}

.layout-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.layout-btn:hover {
  background: var(--bg-tertiary);
  transform: scale(1.05);
}

.layout-btn.active {
  background: var(--accent);
  border-color: var(--accent);
}

#count-display {
  font-weight: bold;
  color: var(--accent);
}

#max-display {
  color: var(--text-secondary);
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: var(--bg-secondary);
  padding: 32px;
  border-radius: 16px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.modal-content h2 {
  margin-bottom: 12px;
  font-size: 1.5rem;
  color: var(--text-primary);
}

.modal-content p {
  margin-bottom: 24px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.qr-modal-content {
  background: var(--bg-secondary);
  padding: 32px;
  border-radius: 16px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.qr-modal-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.qr-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text-primary);
}

.qr-close {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  padding: 4px 8px;
  transition: color 0.2s ease;
}

.qr-close:hover {
  color: var(--text-primary);
}

#qr-code-container {
  background: white;
  padding: 20px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#qr-code-container canvas,
#qr-code-container img {
  max-width: 100%;
  height: auto;
}

.qr-instruction {
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-align: center;
  margin: 0;
}

.qr-link-display {
  color: var(--accent);
  font-size: 0.75rem;
  text-align: center;
  word-break: break-all;
  margin: 0;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  max-width: 100%;
}

.qr-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

#modal-actions {
  display: flex;
  gap: 12px;
  flex-direction: column;
}

.modal-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: background 0.2s;
  background: var(--accent);
  color: white;
}

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

.modal-btn.secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
}

.modal-btn.secondary:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.modal-btn:disabled,
.modal-btn.secondary:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.notification-container {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  max-width: 400px;
  width: 100%;
  pointer-events: none;
}

.notification {
  pointer-events: auto;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: slideInDown 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 12px;
}

.notification.success {
  border-left: 3px solid var(--success);
}

.notification.error {
  border-left: 3px solid var(--error);
}

.notification.info {
  border-left: 3px solid var(--accent);
}

.notification-content {
  flex: 1;
}

.notification-message {
  margin-bottom: 4px;
}

.notification-timer {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

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

.password-warning {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 40px);
  max-width: 760px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--bg-tertiary);
  border-left: 3px solid var(--warning);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 950;
}

.password-warning-text {
  flex: 1;
  color: var(--text-primary);
}

.password-warning-close {
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.1rem;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
}

.password-warning-close:hover,
.password-warning-close:focus-visible {
  background: var(--bg-secondary);
  color: var(--text-primary);
  outline: none;
}

.password-warning.open-room-warning {
  border-left-color: var(--error);
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.08) 0%, var(--bg-tertiary) 100%);
}

.notification-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s ease;
  background: var(--accent);
  color: white;
}

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

.notification-btn.secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.notification-btn.secondary:hover {
  background: var(--bg-secondary);
}

.notification-close {
  padding: 4px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  transition: color 0.2s ease;
}

.notification-close:hover {
  color: var(--text-primary);
}

@keyframes slideInDown {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideOutUp {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-20px);
    opacity: 0;
  }
}

@keyframes slideDown {
  from {
    transform: translateX(-50%) translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

.welcome-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
}

.welcome-content {
  background: var(--bg-secondary);
  padding: 40px;
  border-radius: 20px;
  max-width: 400px;
  width: 100%;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
}

.welcome-content h1 {
  margin-bottom: 32px;
  font-size: 2rem;
  color: var(--text-primary);
  text-align: center;
}

.room-ended-room-title {
  margin: -16px 0 16px;
  text-align: center;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
}

.room-ended-message {
  margin: 0 0 24px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
}

.room-ended-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.room-ended-note {
  margin-top: 20px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.4;
}

/* Brand Header */
.brand-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.brand-banner {
  display: block;
  width: min(290px, 78vw);
  height: auto;
}

/* Developer Credit */
.developer-credit {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.developer-credit a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s;
}

.developer-credit a:hover {
  opacity: 0.8;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--bg-tertiary);
  border-radius: 8px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.form-inline label {
  margin-bottom: 0;
  min-width: 88px;
}

.input-actions {
  position: relative;
}

.input-actions input {
  width: 100%;
  padding-right: 72px;
}

.input-action-btn {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--bg-tertiary);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s, border-color 0.2s, opacity 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
}

.input-action-trigger {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  z-index: 1;
}

.input-action-btn.is-visible {
  opacity: 0.6;
}

.input-action-btn.is-visible:hover,
.input-action-btn.is-visible:focus-visible {
  opacity: 0.8;
}

.input-action-btn svg {
  width: 18px;
  height: 18px;
}

.input-action-btn:hover,
.input-action-btn:focus-visible {
  background: var(--bg-secondary);
  border-color: var(--accent);
  outline: none;
}

.input-action-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--bg-tertiary);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  min-width: 180px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 2;
}

.menu-item {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.menu-item:hover,
.menu-item:focus-visible {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  outline: none;
}

@media (max-width: 480px) {
  .input-actions input {
    padding-right: 64px;
  }

  .input-action-btn {
    width: 40px;
    height: 40px;
  }

  .input-action-dropdown {
    min-width: 160px;
  }
}

.form-group input.input-error {
  border-color: var(--error);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.15);
}

.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--bg-tertiary);
  border-radius: 8px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
}

.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(93, 188, 210, 0.25);
}

.form-hint {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.form-hint-warning {
  color: var(--warning);
}

.form-error {
  margin-top: -12px;
  margin-bottom: 18px;
  color: var(--error);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group input[type="text"]::placeholder,
.form-group input[type="password"]::placeholder {
  color: var(--text-secondary);
}

.toggle-group {
  margin-bottom: 20px;
}

.toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-tertiary);
  transition: 0.3s;
  border-radius: 13px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: var(--text-secondary);
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
  background: var(--text-primary);
}

.btn-primary {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 12px;
}

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

.btn-secondary {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s;
}

.btn-secondary:hover {
  color: var(--text-primary);
}

.room-info {
  background: var(--bg-tertiary);
  padding: 16px;
  border-radius: 10px;
  margin-bottom: 24px;
  text-align: center;
}

.room-info p {
  margin: 0;
  color: var(--text-primary);
}

.room-info p.room-id-display {
  color: var(--accent);
  font-weight: 600;
  margin-top: 4px;
  font-size: 1.1rem;
}

.crypto-mode-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  margin-top: 12px;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(93, 188, 210, 0.15), rgba(14, 165, 233, 0.15));
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid rgba(93, 188, 210, 0.35);
}

.hidden {
  display: none !important;
}

.advanced-settings {
  margin-top: 8px;
  margin-bottom: 24px;
}

.advanced-settings-toggle {
  width: 100%;
  background: none;
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 12px 14px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.advanced-settings-toggle:hover {
  border-color: var(--accent);
  background: var(--bg-tertiary);
}

.dialog {
  position: fixed;
  inset: 0;
  z-index: 1100;
}

.dialog.hidden {
  display: none;
}

.dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.dialog-content {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-secondary);
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  padding: 20px;
  width: min(520px, 90vw);
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.dialog-header h3 {
  font-size: 1.1rem;
  color: var(--text-primary);
}

.dialog-close {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.4rem;
  cursor: pointer;
}

.dialog-body {
  overflow-y: auto;
}


.advanced-settings-toggle {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.advanced-settings-toggle:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--glass-border);
}

.advanced-settings-toggle svg {
  transition: transform 0.3s ease;
}

.advanced-settings-toggle.open svg {
  transform: rotate(180deg);
}

.advanced-settings-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.advanced-settings-content.open {
  max-height: 500px;
  opacity: 1;
  padding-top: 16px;
}

.advanced-settings-content .form-group:last-child {
  margin-bottom: 0;
}

.media-toggles-inline {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.media-toggle-group {
  display: flex;
  gap: 8px;
}

.media-toggle-btn {
  flex: 0 0 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: var(--bg-tertiary);
  border: 2px solid transparent;
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.media-toggle-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.media-toggle-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-primary);
}

.media-toggle-btn.active:hover {
  background: var(--accent-hover);
}

.media-toggle-btn svg {
  opacity: 0.8;
  width: 18px;
  height: 18px;
}

.media-toggles-inline .advanced-settings-toggle {
  margin-left: auto;
  width: 44px;
  padding: 10px;
  justify-content: center;
}

.media-toggles-inline .advanced-settings-toggle svg {
  width: 18px;
  height: 18px;
}

.input-actions input:focus + .input-action-btn,
.input-actions input:focus ~ .input-action-btn {
  opacity: 0.6;
}

.media-toggle-btn.active svg {
  opacity: 1;
}

.room-details {
  background: var(--bg-tertiary);
  padding: 16px;
  border-radius: 10px;
  text-align: center;
}

.room-details .crypto-mode-badge {
  margin-top: 0;
}

.room-details .crypto-mode-badge + .crypto-mode-badge {
  margin-top: 10px;
}

.status-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
}

#status-message {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 20px;
  text-align: center;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--bg-tertiary);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.video-wrapper.zoomed {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: calc(100vh - 120px);
  z-index: 200;
  border-radius: 0;
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.video-wrapper.dragging {
  opacity: 0.8;
  transform: scale(1.02);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 100;
}

.drag-placeholder {
  background: transparent;
  border: 2px dashed var(--accent);
  border-radius: 12px;
  box-sizing: border-box;
}

.focus-filmstrip .drag-placeholder {
  flex: 0 0 auto;
  aspect-ratio: 16 / 9;
}

.drag-handle {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 24px;
  height: 24px;
  background: var(--glass-bg);
  border-radius: 4px;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(8px);
}

.video-wrapper:hover .drag-handle {
  opacity: 1;
}

.drag-handle:active {
  cursor: grabbing;
}

.drag-handle svg {
  width: 12px;
  height: 12px;
  color: var(--text-secondary);
}

.participants-panel {
  position: fixed;
  top: 0;
  right: -340px;
  width: 300px;
  height: 100%;
  background: var(--bg-secondary);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.4);
  z-index: 150;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--glass-border);
}

.participants-panel.open {
  right: 0;
}

.panel-header {
  padding: 20px;
  border-bottom: 1px solid var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-tertiary);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.panel-title svg {
  color: var(--accent);
}

.participant-count-panel {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  background: var(--bg-primary);
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
}

.panel-close {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.panel-close:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.participants-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  gap: 8px;
  display: flex;
  flex-direction: column;
}

.participant-card {
  background: var(--bg-tertiary);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.participant-card.unverified {
  border-color: rgba(234, 179, 8, 0.6);
  box-shadow: 0 0 0 1px rgba(234, 179, 8, 0.2);
}

.participant-card:hover {
  border-color: var(--glass-border);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.participant-card.unverified:hover {
  border-color: rgba(234, 179, 8, 0.8);
}

.participant-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.participant-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: bold;
  color: var(--text-primary);
  flex-shrink: 0;
}

.participant-info {
  flex: 1;
  min-width: 0;
}

.participant-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-icon svg {
  width: 14px;
  height: 14px;
  color: var(--success);
}

.status-icon.muted svg {
  color: var(--error);
}

.status-icon svg line,
.status-icon.muted svg path {
  stroke: currentColor;
}

.participant-status {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}

.status-dot.weak {
  background: var(--warning);
}

.status-dot.poor {
  background: var(--error);
}

.status-dot.disconnected {
  background: var(--text-secondary);
}

.participant-media {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--bg-secondary);
}

.media-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: none;
}

.media-indicator svg {
  width: 16px;
  height: 16px;
}

.media-indicator.muted {
  color: var(--error);
}

.participant-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.participant-action-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.participant-action-btn svg {
  width: 16px;
  height: 16px;
}

.participant-action-btn:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  margin-bottom: 6px;
  z-index: 10;
  pointer-events: none;
  border: 1px solid var(--glass-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.btn-mute {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.btn-mute:hover {
  background: var(--bg-secondary);
}

.btn-mute.active {
  background: var(--warning);
  color: var(--bg-primary);
}

.btn-video {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.btn-video:hover {
  background: var(--bg-secondary);
}

.btn-video.active {
  background: var(--warning);
  color: var(--bg-primary);
}

.btn-kick {
  background: var(--error);
  color: white;
}

.btn-kick:hover {
  background: #dc2626;
}

.no-participants {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  flex: 1;
}

.no-participants svg {
  margin-bottom: 16px;
  opacity: 0.5;
}

.no-participants p {
  margin: 4px 0;
  font-size: 0.875rem;
}

.no-participants .hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
  opacity: 0.7;
}

.panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 149;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.panel-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 768px) {
  .participants-panel {
    width: 100%;
    right: -100%;
  }

  .participants-panel.open {
    right: 0;
  }

  .panel-header {
    padding: 16px;
  }

  .participant-card {
    padding: 12px;
  }

  .participant-avatar {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }

  .participant-name {
    font-size: 0.875rem;
  }

  .status-icon svg {
    width: 12px;
    height: 12px;
  }

  .participant-status {
    font-size: 0.7rem;
  }

  .participant-action-btn {
    width: 36px;
    height: 36px;
  }

  .video-grid.layout-sidebar {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .video-grid.layout-sidebar .video-wrapper.is-primary {
    grid-column: 1;
    grid-row: auto;
  }

  .video-grid.layout-sidebar .video-wrapper:not(.is-primary) {
    grid-column: 1;
  }

  .video-grid.layout-sidebar .local-video-wrapper.in-grid {
    grid-column: 1;
  }

  .video-grid.layout-focus {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
  }

  .video-grid.layout-focus.has-filmstrip {
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .video-grid.layout-focus.has-filmstrip .video-wrapper:not(.is-primary),
  .video-grid.layout-focus.has-filmstrip .local-video-wrapper.in-grid {
    width: clamp(110px, 40vw, 180px);
  }

  .connection-status {
    top: 10px;
    right: 10px;
    padding: 8px 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .bandwidth-indicator {
    font-size: 0.75rem;
  }

  .layout-controls {
    top: auto;
    bottom: 90px;
    right: 10px;
  }

  .layout-btn {
    width: 36px;
    height: 36px;
  }

  .notification-container {
    top: auto;
    bottom: 140px;
  }

  .notification {
    padding: 10px 12px;
    font-size: 0.8rem;
  }

  .audio-visualizer {
    bottom: 40px;
    left: 8px;
    height: 20px;
  }

  .video-wrapper.zoomed {
    height: calc(100vh - 100px);
  }

  .debug-panel {
    left: 10px;
    right: 10px;
    width: auto;
    bottom: 90px;
    max-height: 35vh;
  }

  .debug-toggle {
    left: 10px;
    bottom: 90px;
  }

  .participants-panel {
    width: 100%;
    right: -100%;
  }

  .participants-panel.open {
    right: 0;
  }

  .participant-actions {
    flex-direction: row;
    align-items: center;
    gap: 6px;
  }

  .participant-action-btn {
    width: 36px;
    justify-content: center;
  }

  .video-grid:not(.layout-sidebar):not(.layout-focus) {
    grid-template-columns: 1fr;
  }
  
  .local-video-wrapper {
    width: 120px;
    height: 90px;
    bottom: 80px;
    right: 10px;
  }
  
  .control-bar {
    width: 90%;
    justify-content: center;
    padding: 10px;
  }
  
  .control-btn {
    width: 44px;
    height: 44px;
  }
  
  .pending-panel {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
  
  .participant-count {
    top: 10px;
    left: 10px;
  }
  
  .room-title-display {
    top: 10px;
    max-width: 60vw;
    font-size: 0.875rem;
    padding: 10px 16px;
  }
  
  .modal-content {
    padding: 24px;
  }

  .qr-modal-content {
    padding: 24px;
    max-width: 320px;
  }

  #qr-code-container {
    padding: 16px;
  }

  .qr-modal-header h2 {
    font-size: 1.25rem;
  }
}

/* ===================== */
/* Floating Verification Badge */
/* ===================== */

.verification-badge {
  position: fixed;
  bottom: 70px;
  left: 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  padding: 8px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 2px solid var(--glass-border);
  z-index: 115;
  cursor: pointer;
  transition: all 0.2s ease;
}

.verification-badge:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.verification-badge.unverified {
  border-color: rgba(234, 179, 8, 0.6);
  animation: pulse-border 2s ease-in-out infinite;
}

.verification-badge.warning {
  border-color: rgba(239, 68, 68, 0.7);
  animation: pulse-border-error 1.6s ease-in-out infinite;
}

.verification-badge.verified {
  border-color: rgba(34, 197, 94, 0.6);
}

.verification-badge.pending {
  border-color: var(--glass-border);
}

@keyframes pulse-border {
  0%, 100% { border-color: rgba(234, 179, 8, 0.6); }
  50% { border-color: rgba(234, 179, 8, 0.3); }
}

@keyframes pulse-border-error {
  0%, 100% { border-color: rgba(239, 68, 68, 0.7); }
  50% { border-color: rgba(239, 68, 68, 0.35); }
}

.verification-badge-icons {
  display: flex;
  align-items: center;
  gap: 3px;
}

.verification-badge-icons .security-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
}

.verification-badge-icons .security-icon svg {
  width: 11px;
  height: 11px;
}

.verification-badge-status {
  display: flex;
  align-items: center;
}

.badge-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
}

.verification-badge.verified .badge-status-dot {
  background: var(--success);
}

.verification-badge.pending .badge-status-dot {
  background: var(--text-secondary);
  animation: pulse-opacity 1.5s ease-in-out infinite;
}

@keyframes pulse-opacity {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.verification-badge-icons.pending {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

/* ===================== */
/* Quick Verification Panel */
/* ===================== */

.quick-verification-panel {
  position: fixed;
  bottom: 120px;
  left: 20px;
  width: 280px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 125;
  overflow: hidden;
  animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quick-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.quick-panel-close {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.quick-panel-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.quick-panel-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.quick-panel-code {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  min-height: 44px;
  width: 100%;
}

.quick-panel-code .security-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.quick-panel-code .security-icon svg {
  width: 16px;
  height: 16px;
}

.quick-panel-code.pending {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.quick-panel-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
  background: rgba(15, 15, 15, 0.4);
}

.quick-panel-status.verified {
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.15);
}

.quick-panel-status.warning {
  color: var(--error);
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.12);
}

.quick-panel-status .status-icon {
  width: 14px;
  height: 14px;
}

.quick-panel-content .btn-verify {
  width: 100%;
  margin-top: 4px;
}

.quick-panel-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
}

.quick-panel-link {
  display: block;
  width: 100%;
  padding: 10px;
  border: none;
  border-top: 1px solid var(--glass-border);
  background: transparent;
  color: var(--accent);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.quick-panel-link:hover {
  background: var(--bg-tertiary);
}

/* ===================== */
/* Mobile Responsive - Verification Badge */
/* ===================== */

@media (max-width: 768px) {
  .verification-badge {
    bottom: 90px;
    left: 10px;
    padding: 6px 10px;
    border-radius: 16px;
  }

  .verification-badge-icons .security-icon {
    width: 16px;
    height: 16px;
    border-radius: 3px;
  }

  .verification-badge-icons .security-icon svg {
    width: 10px;
    height: 10px;
  }

  .quick-verification-panel {
    bottom: 140px;
    left: 10px;
    right: 10px;
    width: auto;
  }

  .quick-panel-code .security-icon {
    width: 24px;
    height: 24px;
  }

  .quick-panel-code .security-icon svg {
    width: 14px;
    height: 14px;
  }
}
