/* studium/views/avatarDialog.v1.css
   Externes Stylesheet für die Avatar-Dialogübung (avatarDialogView.v1.js).
   Sprachspezifisch ist NUR die Akzentfarbe (--avd-accent/-soft/-border, von
   der View inline pro Sprache gesetzt, s. resolveAvatarDialog.v1.js::theme)
   — der Avatar selbst (die Mundbild-Illustrationen) bleibt für jede Sprache
   identisch. */

.avd-root {
  --avd-bg:      #fffdf7;
  --avd-surface: #ffffff;
  --avd-text:    #2a2318;
  --avd-muted:   #7a7060;
  --avd-border:  rgba(42, 35, 24, .16);
  --avd-soft:    rgba(42, 35, 24, .05);
  --avd-accent:  #a13a24;
  --avd-accent-soft: rgba(161, 58, 36, .12);
  --avd-radius:  16px;
  color: var(--avd-text);
}
@media (prefers-color-scheme: dark) {
  .avd-root {
    --avd-bg:      #1c170f;
    --avd-surface: #241d14;
    --avd-text:    #eee6d6;
    --avd-muted:   #a99c86;
    --avd-border:  rgba(238, 230, 214, .2);
    --avd-soft:    rgba(238, 230, 214, .07);
  }
}

.avd-empty, .avd-disabled {
  padding: 18px; border-radius: var(--avd-radius);
  border: 1px dashed var(--avd-border); color: var(--avd-muted);
  text-align: center; font-size: .92rem;
}

.avd-layout {
  display: grid; grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 16px; align-items: start;
}
@media (max-width: 640px) { .avd-layout { grid-template-columns: 1fr; } }

.avd-picker {
  border: 1px solid var(--avd-border); border-radius: var(--avd-radius);
  background: var(--avd-surface); padding: 14px;
}
.avd-picker__title { font-size: .95rem; margin: 0 0 10px; color: var(--avd-muted); }
.avd-scenario-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.avd-scenario-btn {
  width: 100%; text-align: left; display: grid; gap: 2px;
  padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--avd-border); background: var(--avd-soft);
  color: inherit; font: inherit; cursor: pointer;
}
.avd-scenario-btn.is-active {
  border-color: var(--avd-accent); background: var(--avd-accent-soft);
}
.avd-scenario-emoji { font-size: 1.1rem; }
.avd-scenario-title { font-weight: 600; }
.avd-scenario-sub { font-size: .78rem; color: var(--avd-muted); }

.avd-stage {
  border: 1px solid var(--avd-border); border-radius: var(--avd-radius);
  background: var(--avd-surface); padding: 16px;
  display: grid; gap: 12px; justify-items: center;
}

/* Avatar-Bühne — identisches Seitenverhältnis (400:430) wie das
   Phonetik-Mundbild, s. ph-viseme-stage in phonetik.v1.css. Der zwei-Ebenen-
   Aufbau darin (.ph-viseme-layer) legt VisemeAnimator selbst an. */
.avd-avatar-wrap { width: 100%; display: flex; justify-content: center; }
.avd-avatar-stage {
  position: relative; width: 100%; max-width: 220px; aspect-ratio: 400 / 430;
  border-radius: 14px; overflow: hidden;
  background: var(--avd-soft);
  border: 3px solid var(--avd-accent);
}
.avd-avatar-stage .ph-viseme-layer {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  transition: opacity 220ms ease;
}
@media (prefers-reduced-motion: reduce) {
  .avd-avatar-stage .ph-viseme-layer { transition: none; }
}

.avd-role-badge {
  font-size: .72rem; color: var(--avd-muted); text-align: center;
  padding: 2px 10px; border-radius: 999px; border: 1px solid var(--avd-border);
}

.avd-status {
  font-size: .85rem; color: var(--avd-muted); min-height: 1.2em; text-align: center;
}
.avd-status.is-busy { color: var(--avd-accent); }

.avd-transcript {
  width: 100%; max-height: 260px; overflow-y: auto;
  display: grid; gap: 8px; padding: 4px 2px;
}
.avd-bubble {
  border-radius: 12px; padding: 8px 12px; max-width: 90%;
  border: 1px solid var(--avd-border); background: var(--avd-soft);
}
.avd-bubble--avatar, .avd-bubble--prompt { justify-self: start; }
.avd-bubble--user { justify-self: end; background: var(--avd-accent-soft); border-color: var(--avd-accent); }
.avd-bubble--system { justify-self: center; font-style: italic; }
.avd-bubble--note {
  justify-self: center; font-style: italic; font-size: .82rem;
  color: var(--avd-muted); background: transparent; border-style: dashed;
}
.avd-bubble--reveal { justify-self: start; border-style: dashed; border-color: var(--avd-accent); }
.avd-bubble--prompt { border-style: dashed; opacity: .85; }
.avd-bubble__meta { font-size: .72rem; color: var(--avd-muted); margin-bottom: 2px; }
.avd-bubble__text { font-size: .95rem; }
.avd-bubble__translation { font-size: .78rem; color: var(--avd-muted); margin-top: 2px; }

.avd-controls {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.avd-controls[data-mode="disabled"] { opacity: .55; }
.avd-controls .avd-textform { display: none; }
.avd-controls[data-mode="text"] .avd-textform { display: flex; gap: 8px; width: 100%; max-width: 360px; }
.avd-controls[data-mode="text"] .avd-btn--mic { display: none; }
.avd-controls[data-mode="disabled"] .avd-btn--mic,
.avd-controls[data-mode="disabled"] .avd-secondary { pointer-events: none; }

.avd-btn {
  font: inherit; font-size: .9rem; padding: .55rem 1rem;
  border-radius: 999px; border: 1px solid var(--avd-border);
  background: var(--avd-soft); color: inherit; cursor: pointer;
}
.avd-btn--mic {
  border-color: var(--avd-accent); background: var(--avd-accent-soft);
  font-size: 1rem; padding: .7rem 1.4rem;
}
.avd-btn--mic.is-listening { animation: avd-pulse 1.1s ease-in-out infinite; }
.avd-btn--ghost { background: transparent; font-size: .8rem; }
.avd-btn:disabled { opacity: .5; cursor: default; }

.avd-textinput {
  flex: 1; font: inherit; padding: .55rem .8rem;
  border-radius: 10px; border: 1px solid var(--avd-border);
  background: var(--avd-surface); color: inherit;
}

.avd-mic-live { font-size: .8rem; color: var(--avd-muted); min-height: 1.1em; }
.avd-secondary { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

@keyframes avd-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--avd-accent-soft); }
  50% { box-shadow: 0 0 0 8px transparent; }
}
