/* Sprachkanal (voice.ts): Status, Personen mit Sprech-Ring und Profil, Stumm-Knopf, Lautstärke, Einstellungen */

/* Status „Im Gespräch …“ mit Punkt; grün und pulsierend, wenn das Gespräch steht */
.voice-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -6px;
  font-size: 13px;
  color: var(--muted);
}
.voice-status::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn);
}
.voice-status[data-state='connected'] {
  color: var(--good);
}
.voice-status[data-state='connected']::before {
  background: var(--good);
  animation: voice-live 2s ease-in-out infinite;
}
.voice-status[data-state='warten']::before {
  background: var(--faint);
}
.voice-status[data-state='failed']::before,
.voice-status[data-state='fehler']::before {
  background: var(--bad);
}
@keyframes voice-live {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgb(52 211 153 / 0.45);
  }
  50% {
    box-shadow: 0 0 0 5px rgb(52 211 153 / 0);
  }
}

.voice-note {
  padding: 8px 10px;
  font-size: 12.5px;
  color: #fde68a;
  background: rgb(251 191 36 / 0.1);
  border: 1px solid rgb(251 191 36 / 0.25);
  border-radius: var(--radius-s);
}

/* ---- Personen ---- */
.voice-people {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.voice-person {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 12px;
  transition: background-color 0.15s;
}
.voice-person:hover {
  background: var(--panel-2);
}
.voice-avatar {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  font-weight: 700;
  color: #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  box-shadow:
    0 0 0 2px var(--panel),
    0 0 0 2px transparent;
  transition: box-shadow 0.15s;
}
.voice-person[data-who='peer'] .voice-avatar {
  background: linear-gradient(135deg, #0ea5e9, #22d3ee);
}
/* Wer spricht: grüner Leuchtring */
.voice-person[data-speaking='true'] .voice-avatar {
  box-shadow:
    0 0 0 2px var(--panel),
    0 0 0 4px var(--good),
    0 0 16px rgb(52 211 153 / 0.45);
}
/* Profilbild statt Anfangsbuchstabe */
.voice-picture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
/* Status-Punkt unten rechts: grün = verfügbar, gelb = abwesend, rot = nicht stören */
.voice-presence {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 13px;
  height: 13px;
  background: var(--good);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--panel);
}
.voice-person:hover .voice-presence {
  box-shadow: 0 0 0 3px var(--panel-2);
}
/* gilt auch für die Punkte im Profil-Fenster (.voice-dot) */
[data-status='abwesend'] :is(.voice-presence, .voice-dot) {
  background: var(--warn);
}
[data-status='nicht-stoeren'] :is(.voice-presence, .voice-dot) {
  background: var(--bad);
}
/* Name mit „du“, darunter Statustext / „Spielt gerade …“ */
.voice-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}
.voice-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.voice-sub {
  overflow: hidden;
  font-size: 12px;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.voice-name {
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Eigener Name: anklickbar, Stift zum Ändern erscheint beim Darüberfahren */
.voice-person[data-who='me'] .voice-name {
  cursor: text;
}
.voice-rename {
  flex: none;
  width: 26px;
  height: 26px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.15s;
}
.voice-person:hover .voice-rename,
.voice-rename:focus-visible {
  opacity: 1;
}
.voice-rename:hover {
  color: var(--text);
  background: var(--panel);
}
.voice-rename .icon {
  width: 14px;
  height: 14px;
}
.voice-name-input {
  flex: 1;
  min-width: 0;
  padding: 4px 8px;
  font-weight: 600;
}
.voice-muted {
  display: none;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 2px 8px 2px 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--bad);
  background: rgb(248 113 113 / 0.12);
  border-radius: 999px;
}
.voice-muted .icon {
  width: 13px;
  height: 13px;
}
.voice-person[data-muted='true'] .voice-muted {
  display: inline-flex;
}

/* ---- Profil: kleines Fenster unter dem eigenen Bild ---- */
.voice-person[data-who='me'] .voice-avatar {
  anchor-name: --voice-me;
}
.voice-profile {
  position-anchor: --voice-me;
  position-area: bottom span-right;
  position-try-fallbacks: flip-block;
  inset: auto;
  width: 260px;
  margin: 8px 0;
  padding: 14px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.voice-profile:popover-open {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.voice-profile h3 {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.voice-profile-picture {
  display: flex;
  align-items: center;
  gap: 12px;
}
.voice-profile-statuses {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.voice-profile-status {
  justify-content: flex-start;
  gap: 10px;
  padding: 7px 10px;
  font-weight: 500;
  color: var(--text);
  background: none;
}
.voice-profile-status:hover {
  background: var(--panel-2);
  filter: none;
}
.voice-profile-status[aria-pressed='true'] {
  background: var(--accent-soft);
}
.voice-dot {
  width: 10px;
  height: 10px;
  background: var(--good);
  border-radius: 50%;
}
.voice-profile-hint {
  font-size: 12px;
  color: var(--muted);
}

/* ---- Stumm-Knopf und Lautstärke ---- */
.voice-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.voice-toggle {
  width: 100%;
  padding: 10px 14px;
}
.voice-toggle.muted {
  background: #e5484d;
}
.voice-volume {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 6px 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.voice-volume input {
  grid-column: 1 / -1;
  width: 100%;
}

/* ---- Einstellungen (aufklappbar) ---- */
.voice-more {
  border-top: 1px solid var(--line-soft);
  padding-top: 10px;
}
.voice-more > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
  cursor: pointer;
  border-radius: 8px;
}
.voice-more > summary::-webkit-details-marker {
  display: none;
}
.voice-more > summary:hover {
  color: var(--text);
}
.voice-more > summary .icon:last-child {
  width: 16px;
  height: 16px;
  margin-left: auto;
  transition: transform 0.2s;
}
.voice-more[open] > summary .icon:last-child {
  transform: rotate(180deg);
}
.voice-more[open] > summary {
  margin-bottom: 10px;
}
.voice-more > :not(summary) + :not(summary) {
  margin-top: 12px;
}
.voice-more select {
  width: 100%;
  min-width: 0;
}
.voice-check {
  flex-direction: row;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: var(--text);
}
.voice-test {
  width: 100%;
}

/* Stumm-Taste */
.voice-key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.voice-key-name {
  flex: 1 1 120px;
  font-size: 13px;
  color: var(--muted);
}
.voice-key-set {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.voice-keycap {
  min-width: 52px;
  padding: 4px 10px;
  font: 600 12.5px/1.4 ui-monospace, 'Cascadia Code', Consolas, monospace;
  text-align: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-bottom-width: 3px;
  border-radius: 8px;
}
.voice-key button {
  padding: 6px 10px;
  font-size: 12.5px;
}
