#screen-hub {
  flex-direction: column;
  background-color: var(--background-body);
  position: relative;
}

.hub-header {
  height: 52px;
  background-color: var(--background);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
  padding: 0 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.35);
}

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

.room-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-bright);
  min-width: 0;
  white-space: nowrap;
}

.room-title-icon {
  color: var(--accent-primary);
}

.room-badge {
  background-color: var(--background-dark);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 60px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-subtle);
}

.room-badge-btn {
  cursor: pointer;
  color: var(--text-bright);
  transition: background-color var(--animation-duration) linear, color var(--animation-duration) linear, box-shadow var(--animation-duration) linear, transform var(--animation-duration) ease;
}

.room-badge-btn:hover {
  background-color: var(--button-hover);
  color: var(--links);
  box-shadow: var(--shadow-discord-hover);
}

.room-badge-btn:active {
  transform: translateY(2px);
}

.room-badge-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--focus);
}

.hub-content {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

/* Grid Mode */
.hub-content.grid-mode .participants-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  grid-template-rows: auto;
  gap: 16px;
  width: 100%;
  height: 100%;
  max-width: 1400px;
  min-height: 0;
  align-content: center;
  justify-content: center;
  justify-items: stretch;
  align-items: stretch;
}

.hub-content.grid-mode .participant-card {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: none;
  max-height: none;
  aspect-ratio: 16 / 9;
}

/* Focus Mode */
.hub-content.focus-mode {
  justify-content: space-between;
  align-items: stretch;
}

.hub-content.focus-mode .spotlight-container {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 0;
}

.hub-content.focus-mode .spotlight-container .participant-card {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
  flex-shrink: 0;
  cursor: pointer;
}

.hub-content.focus-mode .participants-grid {
  height: clamp(72px, 13vh, 104px) !important;
  width: 100% !important;
  max-width: none !important;
  grid-template-columns: none !important;
  grid-template-rows: none !important;
  display: flex;
  flex-direction: row;
  gap: 10px;
  justify-content: center;
  align-items: center;
  overflow-x: auto;
  flex-shrink: 0;
  padding: 2px 0;
}

.hub-content.focus-mode .participants-grid:empty {
  display: none;
  height: 0;
  margin: 0;
  padding: 0;
}

.hub-content.focus-mode .participants-grid .participant-card {
  height: 100%;
  width: auto;
  max-width: none;
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
}

.hub-content.focus-mode .participants-grid .avatar-circle {
  width: 36px;
  height: 36px;
  font-size: 14px;
}

/* Participant Cards */
.participant-card {
  background-color: var(--background);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  aspect-ratio: 16 / 9;
  cursor: pointer;
  transition: border-color var(--animation-duration) linear, box-shadow var(--animation-duration) linear;
}

.participant-card:hover {
  border-color: rgba(114, 137, 218, 0.55);
}

.participant-card:fullscreen,
.participant-card:-webkit-full-screen {
  width: 100% !important;
  height: 100% !important;
  border-radius: 0;
  border: none;
}

.participant-card video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: #000000;
  display: none;
}

.participant-card.sharing video {
  display: block;
}

.avatar-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.participant-card.sharing .avatar-view {
  display: none;
}

.avatar-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-bright);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.user-tag {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(35, 39, 42, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  padding: 5px 10px;
  border-radius: 60px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-bright);
  font-size: 12px;
  font-weight: 600;
  z-index: 10;
  max-width: 80%;
}

.user-tag-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-bright);
  flex-shrink: 0;
}

.stream-controls-group {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: none;
  align-items: center;
  gap: 8px;
  z-index: 15;
}

.participant-card.sharing .stream-controls-group {
  display: flex;
}

.btn-fullscreen,
.btn-audio-toggle {
  background: var(--background-dark);
  border: 1px solid var(--border-subtle);
  color: var(--text-bright);
  padding: 7px;
  border-radius: 60px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--animation-duration) linear, color var(--animation-duration) linear, opacity var(--animation-duration) linear, transform var(--animation-duration) ease;
}

.btn-fullscreen:hover,
.btn-audio-toggle:hover:not(:disabled) {
  background: var(--button-hover);
  color: var(--links);
}

.btn-fullscreen:active,
.btn-audio-toggle:active:not(:disabled) {
  transform: translateY(2px);
}

/* Volume Mixer */
.audio-mixer-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.audio-mixer-container::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 16px;
  background: transparent;
  display: none;
}

.audio-mixer-container:hover::after {
  display: block;
}

.audio-mixer-container.disabled .btn-audio-toggle {
  opacity: 0.45;
  cursor: not-allowed;
}

.volume-slider-wrapper {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  margin-bottom: 6px;
  background: rgba(35, 39, 42, 0.96);
  backdrop-filter: blur(12px);
  padding: 12px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  height: 124px;
  width: 36px;
  border: 1px solid var(--border-soft);
}

.audio-mixer-container:hover:not(.disabled) .volume-slider-wrapper,
.volume-slider-wrapper:hover,
.audio-mixer-container.dragging .volume-slider-wrapper {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.custom-slider-track {
  position: relative;
  width: 14px;
  height: 96px;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  touch-action: none;
}

.custom-slider-fill {
  width: 100%;
  background-color: var(--accent-primary);
  border-radius: 8px;
  height: 100%;
  pointer-events: none;
}

.custom-slider-thumb {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translate(-50%, 50%);
  width: 20px;
  height: 20px;
  background-color: var(--text-bright);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  transition: background-color var(--animation-duration) linear, transform var(--animation-duration) ease;
  border: 3px solid var(--background-dark);
}

.custom-slider-track:hover .custom-slider-thumb,
.audio-mixer-container.dragging .custom-slider-thumb {
  background-color: var(--accent-primary);
  border-color: var(--text-bright);
  transform: translate(-50%, 50%) scale(1.15);
}

/* Stream Paused Overlay */
.stream-paused-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 12;
  pointer-events: none;
}

.paused-badge {
  background-color: rgba(35, 39, 42, 0.92);
  color: var(--text-bright);
  padding: 8px 16px;
  border-radius: 60px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-soft);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Control Bar */
.control-bar {
  height: 80px;
  background-color: var(--background);
  border-top: 1px solid rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 24px;
  z-index: 20;
}

.control-btn {
  width: 52px;
  height: 52px;
  border-radius: 60px;
  border: 1px solid var(--border-subtle);
  background-color: var(--background-dark);
  color: var(--text-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color var(--animation-duration) linear, color var(--animation-duration) linear, box-shadow var(--animation-duration) linear, transform var(--animation-duration) ease;
  position: relative;
}

.control-btn:hover:not(.disabled-placeholder) {
  background-color: var(--button-hover);
  color: var(--links);
  box-shadow: var(--shadow-discord-hover);
}

.control-btn:active:not(.disabled-placeholder) {
  transform: translateY(2px);
}

.control-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--focus);
}

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

.control-btn.danger {
  background-color: var(--accent-danger);
  border-color: transparent;
  color: var(--text-bright);
}

.control-btn.danger:hover {
  background-color: var(--accent-danger-hover);
  color: var(--text-bright);
  box-shadow: var(--shadow-discord-hover);
}

/* Quality Modal */
.quality-modal-card {
  background-color: var(--background);
  width: 90%;
  max-width: 440px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  padding: 24px;
  color: var(--text-main);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

.quality-section {
  margin-top: 16px;
}

.quality-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
}

.radio-group {
  display: flex;
  background-color: var(--background-dark);
  border: 1px solid var(--border-subtle);
  border-radius: 60px;
  padding: 3px;
  gap: 2px;
}

.radio-option {
  flex: 1;
  text-align: center;
  padding: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 60px;
  color: var(--text-muted);
  transition: background-color var(--animation-duration) linear, color var(--animation-duration) linear;
}

.radio-option:hover:not(.selected) {
  color: var(--text-bright);
  background-color: var(--button-hover);
}

.radio-option.selected {
  background-color: var(--accent-primary);
  color: var(--text-bright);
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-main);
  cursor: pointer;
  line-height: 1.4;
}

.checkbox-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

/* Per-Participant Card Sync Badge */
.participant-sync-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(35, 39, 42, 0.92);
  backdrop-filter: blur(8px);
  color: var(--text-bright);
  padding: 5px 10px;
  border-radius: 60px;
  font-size: 11px;
  font-weight: 600;
  display: none;
  align-items: center;
  gap: 7px;
  z-index: 14;
  border: 1px solid var(--border-soft);
  pointer-events: none;
  max-width: calc(100% - 20px);
}

.participant-sync-badge.visible {
  display: inline-flex;
}

.participant-sync-badge .card-sync-spinner {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: var(--accent-primary);
  animation: spin 0.85s linear infinite;
  flex-shrink: 0;
}

.participant-sync-badge.is-warning {
  color: #ffd180;
  border-color: rgba(250, 166, 26, 0.4);
}

.participant-sync-badge.is-warning .card-sync-spinner {
  border-top-color: var(--accent-warning);
}

.participant-card.is-placeholder .avatar-circle {
  animation: pulse-placeholder 1.4s ease-in-out infinite;
}

@keyframes pulse-placeholder {
  0%, 100% { opacity: 0.6; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1); }
}

.hub-content.focus-mode .participants-grid .participant-sync-badge {
  top: 4px;
  left: 4px;
  padding: 2px 6px;
  font-size: 10px;
}

/* Network / TURN Modal Fields */
.network-field {
  margin-top: 12px;
}

.network-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.network-field input {
  width: 100%;
  padding: 10px 12px;
  background-color: var(--background-input);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--form-text);
  font-size: 13px;
  outline: none;
  user-select: text;
  transition: border-color var(--animation-duration) linear, box-shadow var(--animation-duration) linear;
}

.network-field input::placeholder {
  color: var(--form-placeholder);
}

.network-field input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 2px var(--focus);
}

.network-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

@media (max-width: 640px) {
  .room-title span {
    display: none;
  }
}
