.player-wrapper.fullscreen #fullscreenToggle {
  opacity: 0;
  pointer-events: none;
}
:root {
  color-scheme: light dark;
  font-family: 'Segoe UI', Roboto, sans-serif;
  background-color: #0f1729;
  color: #f9fafb;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #1d2a4a, #0f1729);
  display: flex;
  justify-content: center;
}

body.modal-open {
  overflow: hidden;
}

body.theme-light {
  background: radial-gradient(circle at top, #f8fafc, #e2e8f0);
  color: #0f172a;
}

body.theme-dark {
  background: radial-gradient(circle at top, #1d2a4a, #0f1729);
  color: #f8fafc;
}

.container {
  width: min(1200px, 96vw);
  padding: 32px 0 64px;
}

.site-footer {
  margin-top: 32px;
  text-align: center;
  font-size: 13px;
  color: rgba(226, 232, 240, 0.75);
  white-space: pre-line;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  text-align: center;
}

.footer-copy {
  max-width: 640px;
  text-align: center;
}

.footer-stats {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-stat {
  display: grid;
  gap: 4px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.2);
  min-width: 140px;
}

.footer-stat__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.75);
}

.footer-stat__value {
  font-size: 20px;
  font-weight: 700;
  color: #38bdf8;
}

.footer-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-link {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.7);
  color: rgba(226, 232, 240, 0.92);
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease, border-color 0.2s ease;
}

.footer-link:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  border-color: rgba(94, 234, 212, 0.5);
}

.footer-link--empty {
  opacity: 0.65;
}

.footer-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(10px);
  z-index: 1200;
}

.footer-overlay__dialog {
  position: relative;
  width: min(640px, 100%);
  max-height: min(90vh, 720px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px 24px 24px;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 28px 64px rgba(15, 23, 42, 0.45);
  overflow: hidden;
}

.footer-overlay__title {
  margin: 0;
  font-size: 22px;
  text-align: center;
  color: #f8fafc;
}

.footer-overlay__content {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(226, 232, 240, 0.9);
}

.footer-overlay__content p {
  margin: 0 0 16px;
}

.footer-overlay__content p:last-child {
  margin-bottom: 0;
}

.footer-overlay__close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: rgba(15, 23, 42, 0.75);
  color: rgba(226, 232, 240, 0.85);
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.footer-overlay__close:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.footer-overlay__confirm {
  margin-top: 8px;
  align-self: center;
  min-width: 160px;
}

body.footer-overlay-open {
  overflow: hidden;
}

.app-header {
  text-align: center;
  margin-bottom: 32px;
}

.app-header h1 {
  margin: 0;
  font-size: 40px;
}

.app-header p {
  margin: 8px 0 0;
  color: rgba(249, 250, 251, 0.7);
}

.join-card,
.panel {
  background: rgba(15, 23, 41, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 18px;
  padding: 24px;
  backdrop-filter: blur(24px);
}

.join-card {
  max-width: 640px;
  margin: 0 auto 32px;
  text-align: center;
  display: grid;
  gap: 20px;
  justify-items: center;
}

.join-card__title {
  margin: 0;
  font-size: 24px;
}

.join-card__step {
  display: grid;
  gap: 16px;
  justify-items: center;
  width: 100%;
}

.join-card__step .field {
  width: min(420px, 100%);
  align-items: center;
  margin-bottom: 0;
}

.join-card__username-field {
  gap: 12px;
}

.join-card__username-field input {
  min-width: 240px;
}

.join-card__username-field .primary {
  width: 100%;
  min-width: 160px;
}

.join-card__step--rooms {
  text-align: center;
  justify-items: center;
  gap: 20px;
}

.join-card__step--rooms .field {
  align-items: center;
}

.join-card__step--rooms .field label {
  align-self: center;
}

.join-card__step--rooms .existing-rooms {
  text-align: left;
  width: 100%;
}

.join-card__step--rooms .section-header {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.join-card__step--rooms .section-header h3 {
  margin: 0;
  font-size: 20px;
}

.join-card__step--rooms .feedback {
  margin-top: 8px;
  margin-bottom: 12px;
  text-align: center;
}

.existing-rooms__search {
  margin: 0 0 16px;
  width: min(420px, 100%);
  align-items: center;
  display: grid;
  justify-items: center;
}

.existing-rooms__search input {
  text-align: center;
  width: 100%;
}

#existingRoomsSection .existing-rooms__search {
  margin-left: auto;
  margin-right: auto;
}

#existingRoomsSection .section-header {
  justify-content: center;
  margin-bottom: 14px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.field label {
  font-size: 14px;
  color: rgba(226, 232, 240, 0.8);
}

.field input,
.field select {
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.9);
  color: #f9fafb;
  padding: 0 12px;
  width: 100%;
  font-size: 16px;
  line-height: 1.4;
}

.join-card__step--rooms .field input {
  text-align: center;
}

.join-card__step--rooms .field button {
  width: min(220px, 100%);
}

#joinFeedback {
  text-align: center;
}

#newRoomId,
#roomId {
  min-height: 40px;
}

.field input:focus,
.field select:focus {
  outline: 2px solid rgba(94, 234, 212, 0.7);
  border-color: transparent;
}

.inline {
  display: flex;
  gap: 12px;
}

.inline input {
  flex: 1;
}

.primary,
.secondary {
  border-radius: 10px;
  border: none;
  height: 42px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.primary {
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #0f172a;
}

.secondary {
  background: rgba(148, 163, 184, 0.2);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.primary:hover,
.secondary:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.hidden {
  display: none !important;
}

.helper {
  margin: 4px 0 0;
  font-size: 13px;
  color: rgba(148, 163, 184, 0.8);
}

.card-group {
  display: grid;
  gap: 20px;
}

.feedback {
  min-height: 20px;
  margin: 4px 0 16px;
  font-size: 13px;
  color: #f87171;
}

.feedback.success {
  color: #4ade80;
}

.existing-rooms {
  margin-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  padding-top: 16px;
}

#roomsHint {
  text-align: center;
}

#existingRooms {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.existing-rooms li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.existing-rooms li strong {
  font-size: 15px;
  color: #f9fafb;
}

.existing-rooms li span {
  font-size: 13px;
  color: rgba(148, 163, 184, 0.8);
}

.room-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.room-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(148, 163, 184, 0.85);
  white-space: nowrap;
}

.room-line strong {
  color: rgba(226, 232, 240, 0.9);
  font-weight: 600;
}

.room-line span {
  overflow: hidden;
  text-overflow: ellipsis;
}

body.theme-light .app-header p {
  color: rgba(71, 85, 105, 0.8);
}

body.theme-light .site-footer {
  color: rgba(71, 85, 105, 0.75);
}

body.theme-light .footer-copy {
  color: rgba(71, 85, 105, 0.82);
}

body.theme-light .join-card,
body.theme-light .panel,
body.theme-light .card,
body.theme-light .stats-card,
body.theme-light .summary-card,
body.theme-light .stat-card,
body.theme-light .upload-card,
body.theme-light .voice-panel,
body.theme-light .existing-rooms li,
body.theme-light .chat,
body.theme-light .users,
body.theme-light .users li,
body.theme-light .room-content-item,
body.theme-light .admin-overlay__dialog,
body.theme-light .modal-dialog,
body.theme-light .footer-stat,
body.theme-light .footer-link {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.12);
  color: #0f172a;
}

body.theme-light .footer-link {
  color: #0f172a;
}

body.theme-light .footer-link:hover {
  filter: brightness(0.97);
}

body.theme-light .footer-stat__label,
body.theme-light .helper,
body.theme-light .room-line,
body.theme-light .existing-rooms li span,
body.theme-light .chat-meta span,
body.theme-light #roomsHint {
  color: rgba(71, 85, 105, 0.85);
}

body.theme-light .footer-stat__value {
  color: #0284c7;
}

body.theme-light .room-line strong,
body.theme-light .chat-meta strong,
body.theme-light .field label,
body.theme-light .users h3,
body.theme-light .chat h3,
body.theme-light .section-header h3 {
  color: #0f172a;
}

body.theme-light .existing-rooms li strong {
  color: #0f172a;
}

body.theme-light .voice-item {
  background: rgba(241, 245, 249, 0.9);
  border-color: rgba(148, 163, 184, 0.35);
}

body.theme-light .voice-item__name {
  color: #0f172a;
}

body.theme-light .voice-item__status {
  color: rgba(71, 85, 105, 0.75);
}

body.theme-light .voice-empty {
  color: rgba(71, 85, 105, 0.7);
}

body.theme-light .voice-item.voice-item--speaking {
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.45), 0 0 25px rgba(14, 165, 233, 0.35);
}

body.theme-light .voice-item.voice-item--muted .voice-item__status {
  color: rgba(248, 113, 113, 0.85);
}

body.theme-light .voice-indicator {
  background: rgba(148, 163, 184, 0.5);
  box-shadow: none;
}

body.theme-light .voice-item.voice-item--speaking .voice-indicator {
  background: #0ea5e9;
  box-shadow: 0 0 8px rgba(14, 165, 233, 0.6);
}

body.theme-light .voice-indicator.voice-indicator--muted {
  background: #f87171;
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.6);
}

body.theme-light .field input,
body.theme-light .field select,
body.theme-light .chat-input-wrapper input,
body.theme-light .admin-overlay__input {
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

body.theme-light .activity-panel {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(15, 23, 42, 0.12);
  color: #0f172a;
}

body.theme-light .activity-text {
  color: rgba(30, 41, 59, 0.78);
}

body.theme-light .activity-time {
  color: rgba(100, 116, 139, 0.75);
}

body.theme-light .activity-toggle {
  background: rgba(226, 232, 240, 0.85);
  border-color: rgba(148, 163, 184, 0.35);
  color: #0f172a;
}

body.theme-light .activity-toggle.has-unread::after {
  background: #2563eb;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
}

body.theme-light .chat-emoji-button {
  background: rgba(191, 219, 254, 0.75);
  border-color: rgba(96, 165, 250, 0.45);
  color: #1e3a8a;
}

body.theme-light .emoji-picker {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(148, 163, 184, 0.3);
}

body.theme-light .emoji-item {
  background: rgba(226, 232, 240, 0.92);
}

body.theme-light .chat-meta {
  color: rgba(71, 85, 105, 0.85);
}

body.theme-light .chat-message.self .chat-meta {
  color: rgba(22, 163, 74, 0.9);
}

body.theme-light .chat-bubble {
  background: rgba(248, 250, 252, 0.95);
  border-color: rgba(148, 163, 184, 0.35);
  color: #0f172a;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12);
}

body.theme-light .chat-message.self .chat-bubble {
  background: linear-gradient(135deg, #bbf7d0, #86efac);
  border-color: rgba(34, 197, 94, 0.4);
  color: #14532d;
  box-shadow: 0 12px 22px rgba(34, 197, 94, 0.18);
}

body.theme-light .chat-time {
  color: rgba(71, 85, 105, 0.6);
}

body.theme-light .chat-message.self .chat-time {
  color: rgba(22, 163, 74, 0.55);
}

body.theme-light .secondary {
  background: rgba(148, 163, 184, 0.25);
  color: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.45);
}

body.theme-light .secondary:hover {
  filter: brightness(0.98);
}

body.theme-light .kick-button {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.35);
  color: #b91c1c;
}

body.theme-light .kick-button:hover {
  filter: brightness(1.05);
  border-color: rgba(239, 68, 68, 0.55);
}

body.theme-light .kick-button:focus-visible {
  outline-color: rgba(248, 113, 113, 0.6);
}

body.theme-light .chat-message.other {
  background: rgba(226, 232, 240, 0.9);
  border-color: rgba(148, 163, 184, 0.35);
  color: #0f172a;
  box-shadow: 0 12px 24px rgba(148, 163, 184, 0.25);
}

body.theme-light .chat-message.other .chat-text {
  color: #0f172a;
}

body.theme-light .chat-message.system {
  background: rgba(203, 213, 225, 0.4);
  border-color: rgba(148, 163, 184, 0.4);
  color: #1f2937;
}

body.theme-light .chat-text {
  color: #1f2937;
}

body.theme-light .chat-meta strong {
  color: #0f172a;
}

body.theme-light .feedback {
  color: #dc2626;
}

body.theme-light .feedback.success {
  color: #16a34a;
}

body.theme-light .modal {
  background: rgba(148, 163, 184, 0.4);
}

body.theme-light .footer-overlay {
  background: rgba(15, 23, 42, 0.45);
}

body.theme-light .footer-overlay__dialog,
body.theme-light .footer-overlay__dialog .footer-overlay__content {
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

body.theme-light .footer-overlay__title {
  color: #0f172a;
}

body.theme-light .footer-overlay__close,
body.theme-light .modal-close,
body.theme-light .admin-overlay__close {
  color: rgba(71, 85, 105, 0.75);
}

body.theme-light .chat-message.other .chat-meta strong {
  color: #2563eb;
}

body.theme-light .chat-message.other .chat-meta span,
body.theme-light .chat-system-time {
  color: rgba(71, 85, 105, 0.7);
}

body.theme-light .kick-modal__message {
  color: #1f2937;
}

body.theme-light .user-meta {
  color: rgba(71, 85, 105, 0.75);
}

body.theme-light .admin-overlay {
  background: rgba(148, 163, 184, 0.4);
}
.link-button {
  background: none;
  border: none;
  color: #38bdf8;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 0;
}

.link-button:hover {
  text-decoration: underline;
}

.single-tab-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 9999;
}

.single-tab-overlay__card {
  width: min(420px, 90vw);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 20px;
  padding: 28px 32px;
  text-align: center;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.55);
}

.single-tab-overlay__card h3 {
  margin: 0 0 12px;
  font-size: 20px;
  color: #e2e8f0;
}

.single-tab-overlay__card p {
  margin: 8px 0;
  font-size: 15px;
  color: rgba(226, 232, 240, 0.85);
  line-height: 1.5;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.section-header h3 {
  margin: 0;
  font-size: 18px;
}

.room {
  display: grid;
  grid-template-columns: 2fr minmax(240px, 320px);
  gap: 24px;
  align-items: flex-start;
}

.video-select {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.library-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.library-search {
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.9);
  color: #f9fafb;
  padding: 0 12px;
}

.library-search:focus {
  outline: 2px solid rgba(94, 234, 212, 0.7);
  border-color: transparent;
}

.library-selects {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.field.compact {
  margin-bottom: 0;
  gap: 6px;
}

.field.compact label {
  font-size: 13px;
  color: rgba(226, 232, 240, 0.7);
}

.library-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.library-actions button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.library-actions button {
  min-width: 140px;
}

.room-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin: 12px 0 20px;
  flex-wrap: wrap;
}

.danger {
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
  height: 42px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.danger:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.player-wrapper {
  position: relative;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
  aspect-ratio: 16 / 9;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.player {
  width: 100%;
  height: 100%;
  transition: filter 0.2s ease;
}

.player.quality-medium {
  filter: contrast(0.95) saturate(0.9);
}

.player.quality-low {
  filter: blur(0.8px) contrast(0.85) saturate(0.85);
}

#youtubeHolder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: center;
  position: relative;
  transition: filter 0.2s ease;
}

#youtubePlayer {
  width: 100%;
  height: 100%;
}

#youtubeHolder iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

#youtubeHolder.quality-medium iframe {
  filter: contrast(0.95) saturate(0.9);
}

#youtubeHolder.quality-low iframe {
  filter: blur(0.8px) contrast(0.85) saturate(0.85);
}

.youtube-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(72px, 10vw, 92px);
  height: clamp(72px, 10vw, 92px);
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(28px, 4vw, 36px);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.4);
  z-index: 3;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.youtube-overlay:hover {
  transform: translate(-50%, -50%) scale(1.08);
  background: rgba(37, 99, 235, 0.88);
}

.youtube-overlay:active {
  transform: translate(-50%, -50%) scale(0.97);
}

.sidebar {
  display: grid;
  gap: 24px;
}

.chat,
.users {
  background: rgba(15, 23, 41, 0.75);
  border-radius: 18px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: clamp(340px, 48vh, 440px);
  position: relative;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat h3,
.users h3 {
  margin: 0;
  font-size: 18px;
}

.activity-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.6);
  color: rgba(226, 232, 240, 0.88);
  cursor: pointer;
  transition: filter 0.2s ease, border-color 0.2s ease;
}

.activity-toggle:hover {
  filter: brightness(1.05);
  border-color: rgba(96, 165, 250, 0.5);
}

.activity-toggle-icon {
  display: inline-block;
  transition: transform 0.2s ease;
}

.activity-toggle[aria-expanded='true'] .activity-toggle-icon {
  transform: rotate(-180deg);
}

.activity-toggle.has-unread::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38bdf8;
  margin-left: 6px;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

.activity-panel {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 68px;
  bottom: 96px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 14px;
  padding: 12px 16px;
  opacity: 1;
  pointer-events: auto;
  z-index: 25;
  box-shadow: 0 18px 36px rgba(8, 20, 35, 0.45);
  backdrop-filter: blur(16px);
  overflow: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.activity-panel.collapsed {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: translateY(-6px);
  padding: 0 16px;
  border-color: transparent;
  box-shadow: none;
}

.activity-panel.collapsed .activity-body {
  max-height: 0;
}

.activity-body {
  max-height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: rgba(226, 232, 240, 0.85);
  padding-right: 4px;
}

.activity-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.activity-time {
  font-size: 11px;
  color: rgba(148, 163, 184, 0.7);
  white-space: nowrap;
  margin-top: 2px;
  flex-shrink: 0;
}

.activity-text {
  flex: 1;
  line-height: 1.45;
  word-break: break-word;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 220px;
  max-height: none;
  overflow-y: auto;
  margin: 0;
  padding-right: 6px;
}

.chat-message {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 84%;
}

.chat-message.other {
  align-self: flex-start;
  align-items: flex-start;
}

.chat-message.self {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-message.chat-message--continued {
  margin-top: -6px;
}

.chat-message.chat-message--continued .chat-meta {
  display: none;
}

.chat-meta {
  font-size: 12px;
  font-weight: 600;
  color: rgba(148, 163, 184, 0.85);
  text-transform: none;
  letter-spacing: 0.01em;
}

.chat-message.self .chat-meta {
  color: rgba(94, 234, 212, 0.9);
}

.chat-author {
  color: inherit;
}

.chat-bubble {
  background: rgba(30, 41, 59, 0.9);
  border-radius: 16px 16px 16px 6px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 10px 12px 6px;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.2);
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #f8fafc;
  position: relative;
}

.chat-message.self .chat-bubble {
  background: linear-gradient(135deg, #22d3ee, #6366f1);
  border-radius: 16px 16px 6px 16px;
  border-color: rgba(14, 165, 233, 0.4);
  color: #0f172a;
  box-shadow: 0 12px 24px rgba(14, 116, 233, 0.2);
}

.chat-message.chat-message--continued .chat-bubble {
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

.chat-message.other.chat-message--continued .chat-bubble {
  border-top-left-radius: 8px;
}

.chat-message.self.chat-message--continued .chat-bubble {
  border-top-right-radius: 8px;
}

.chat-text {
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-message.self .chat-text {
  color: inherit;
  text-align: left;
}

.chat-time {
  align-self: flex-end;
  font-size: 11px;
  color: rgba(226, 232, 240, 0.65);
}

.chat-message.self .chat-time {
  color: rgba(15, 23, 42, 0.55);
}

.chat-form {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  position: relative;
}

.chat-emoji-button {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(96, 165, 250, 0.4);
  background: rgba(37, 99, 235, 0.12);
  color: rgba(226, 232, 240, 0.92);
  font-size: 16px;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.chat-emoji-button:hover {
  filter: brightness(1.1);
  border-color: rgba(96, 165, 250, 0.6);
}

.chat-input-wrapper {
  position: relative;
  width: 100%;
}

.chat-input-wrapper input {
  width: 100%;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.75);
  color: #f9fafb;
  padding: 0 14px;
  font-size: 16px;
}

.chat-input-wrapper input:focus {
  outline: 2px solid rgba(94, 234, 212, 0.65);
  border-color: transparent;
}

.chat-send-button {
  min-width: 92px;
}

.emoji-picker {
  position: absolute;
  left: 0;
  bottom: 52px;
  display: grid;
  grid-template-columns: repeat(5, 40px);
  gap: 6px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 14px;
  box-shadow: 0 18px 38px rgba(8, 16, 30, 0.45);
  z-index: 15;
}

.emoji-picker.hidden {
  display: none;
}

.emoji-item {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  background: rgba(30, 41, 59, 0.7);
  font-size: 22px;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.emoji-item:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.voice-panel {
  margin-top: 18px;
  background: rgba(15, 23, 41, 0.75);
  border-radius: 18px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  display: grid;
  gap: 14px;
}

.voice-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.voice-controls .secondary {
  min-width: 140px;
}

.voice-main-button {
  min-width: 200px;
}

.voice-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.voice-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.voice-item.voice-item--muted {
  opacity: 0.85;
}

.voice-item__name {
  font-weight: 600;
  color: #f8fafc;
}

.voice-item__status {
  font-size: 12px;
  color: rgba(148, 163, 184, 0.78);
  display: flex;
  align-items: center;
  gap: 6px;
}

.voice-item.voice-item--muted .voice-item__status {
  color: rgba(248, 113, 113, 0.85);
}

.voice-item.voice-item--speaking {
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.45), 0 0 25px rgba(56, 189, 248, 0.35);
}

.voice-item__status span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.voice-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.6);
  box-shadow: none;
}

.voice-item.voice-item--speaking .voice-indicator {
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

.voice-indicator.voice-indicator--muted {
  background: #f87171;
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.6);
}

.voice-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.voice-empty {
  text-align: center;
  font-size: 13px;
  color: rgba(148, 163, 184, 0.75);
}

.voice-audio {
  display: none;
}

#voiceStatus.voice-status--error {
  color: #f87171;
}

body.theme-light #voiceStatus.voice-status--error {
  color: #dc2626;
}

.users ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.users {
  max-height: 320px;
  overflow-y: auto;
}

.users li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

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

.kick-button {
  width: 32px;
  height: 32px;
  border-radius: 16px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.14);
  color: #fecaca;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease, border-color 0.2s ease;
}

.kick-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  border-color: rgba(248, 113, 113, 0.75);
}

.kick-button:focus-visible {
  outline: 2px solid rgba(248, 113, 113, 0.8);
  outline-offset: 2px;
}

.kick-button:active {
  transform: translateY(0);
}

.kick-button__icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.user-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-meta {
  font-size: 12px;
  color: rgba(148, 163, 184, 0.75);
}

.signal-bars {
  display: inline-flex;
  gap: 2px;
  align-items: flex-end;
}

.signal-bar {
  width: 4px;
  border-radius: 2px;
  background: rgba(148, 163, 184, 0.35);
}

.signal-bar:nth-child(1) {
  height: 6px;
}

.signal-bar:nth-child(2) {
  height: 10px;
}

.signal-bar:nth-child(3) {
  height: 14px;
}

.signal-bar:nth-child(4) {
  height: 18px;
}

.signal-bar.active {
  background: #34d399;
}

.users li {
  background: rgba(30, 41, 59, 0.8);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}

.modal-dialog {
  position: relative;
  width: min(420px, 92vw);
  background: rgba(15, 23, 42, 0.92);
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 28px 24px 24px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.45);
  display: grid;
  gap: 18px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: rgba(148, 163, 184, 0.9);
  font-size: 20px;
  cursor: pointer;
}

.modal-section {
  display: grid;
  gap: 16px;
}

.modal-section label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: rgba(226, 232, 240, 0.85);
}

.modal-section input {
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  padding: 0 12px;
}

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

.modal .feedback {
  margin: 0;
}

.modal-dialog--kick {
  width: min(360px, 90vw);
  text-align: center;
  gap: 20px;
}

.kick-modal__message {
  margin: 0;
  font-size: 15px;
  color: rgba(226, 232, 240, 0.9);
}

.theme-toggle {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  background: rgba(15, 23, 41, 0.85);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-right: none;
  border-radius: 12px 0 0 12px;
  padding: 14px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  z-index: 1400;
  box-shadow: 0 12px 24px rgba(2, 6, 23, 0.3);
  transition: transform 0.2s ease, filter 0.2s ease, background 0.2s ease, color 0.2s ease,
    border-color 0.2s ease;
}

.theme-toggle:hover {
  filter: brightness(1.1);
}

.theme-toggle:focus-visible {
  outline: 2px solid rgba(94, 234, 212, 0.8);
  outline-offset: 2px;
}

.theme-toggle__icon {
  font-size: 20px;
}

.theme-toggle__label {
  font-size: 11px;
}

body.theme-light .theme-toggle {
  background: rgba(203, 213, 225, 0.85);
  color: #0f172a;
  border-color: rgba(148, 163, 184, 0.45);
  box-shadow: 0 12px 24px rgba(148, 163, 184, 0.35);
}

body.theme-light .theme-toggle:hover {
  filter: brightness(1.05);
}

@media (max-width: 960px) {
  .room {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .users {
    max-height: none;
  }

  .chat {
    height: clamp(320px, 55vh, 460px);
  }

  .card-group {
    gap: 16px;
  }
}

@media (max-width: 600px) {
  .join-card {
    padding: 20px;
  }

  .join-card__step .field {
    width: 100%;
  }

  .inline {
    flex-direction: column;
    align-items: stretch;
  }

  .inline input {
    width: 100%;
  }

  .join-card__username-field input,
  .join-card__username-field .primary {
    min-width: 0;
  }

  .existing-rooms__search {
    width: 100%;
  }

  .existing-rooms li {
    grid-template-columns: 1fr;
  }

  .chat {
    height: clamp(300px, 60vh, 500px);
  }

  .chat-form {
    grid-template-columns: auto 1fr auto;
    gap: 10px;
  }

  .chat-emoji-button {
    width: 40px;
    height: 40px;
  }

  .chat-input-wrapper input {
    height: 40px;
  }

  .chat-send-button {
    min-width: 86px;
  }

  .activity-panel {
    left: 12px;
    right: 12px;
    bottom: 90px;
  }

  .activity-body {
    max-height: 100%;
  }

  .room-actions {
    justify-content: stretch;
  }

  .room-actions button {
    width: 100%;
  }

  .voice-controls {
    justify-content: stretch;
  }

  .voice-controls .secondary {
    flex: 1 1 auto;
    min-width: 0;
  }

  .theme-toggle {
    top: auto;
    right: 16px;
    bottom: 16px;
    transform: none;
    writing-mode: horizontal-tb;
    text-orientation: initial;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 10px 16px;
    gap: 8px;
  }

  .theme-toggle__label {
    font-size: 12px;
    letter-spacing: 0.05em;
  }
}

