/* Player chips and avatars. --chip comes from the server-validated palette. */
.player-avatar { --chip: #7a8794; --size: 28px; position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; width: var(--size); height: var(--size); border-radius: 50%; background: var(--chip); color: #fff; font-size: calc(var(--size) * .4); font-weight: 750; line-height: 1; overflow: hidden; vertical-align: middle; }
.player-avatar.has-icon::before { content: ""; width: 68%; height: 68%; background: #fff; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.player-avatar[data-marker="dot"]::after { content: ""; position: absolute; right: 8%; bottom: 8%; width: 28%; height: 28%; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.45); }
.player-avatar[data-marker="stripe"]::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, rgba(255,255,255,.34) 0 3px, transparent 3px 7px); }
.player-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 2px 10px 2px 2px; border: 2px solid var(--chip, #7a8794); border-radius: 999px; font-weight: 650; line-height: 1.2; }
.player-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swatch-row, .avatar-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.avatar-grid { max-height: 170px; overflow-y: auto; padding: 2px; }
button.swatch { width: 36px; height: 36px; min-height: 36px; padding: 0; border: 3px solid transparent; border-radius: 50%; background: var(--chip); }
button.swatch.selected { border-color: var(--ink, #000); box-shadow: inset 0 0 0 2px #fff; }
button.swatch.in-use { opacity: .45; }
button.avatar-choice { position: relative; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 2px solid transparent; border-radius: 50%; background: rgba(128,128,128,.22); color: var(--ink, #000); font-size: 13px; letter-spacing: 0; }
button.avatar-choice:not(.initials)::before { content: ""; position: absolute; inset: 20%; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
button.avatar-choice.selected { border-color: var(--ink, #000); }
.speaker-badge { display: flex; justify-content: center; min-height: 40px; margin: 10px 0; }
.speaker-badge .player-chip { background: rgba(0,0,0,.55); color: #fff; }
.subtitle-tools { display: grid; justify-items: center; gap: 8px; margin: 10px 0; }
.subtitle-tools[hidden], .subtitle-line[hidden] { display: none; }
.subtitle-line { margin: 0; padding: 6px 12px; max-width: min(720px, 100%); border-radius: 6px; background: rgba(0,0,0,.72); color: #fff; font-size: 18px; text-align: center; overflow-wrap: anywhere; }
button.subtitle-toggle { min-height: 40px; padding: 4px 14px; font-size: 13px; }
button.subtitle-toggle[aria-pressed="true"] { border-color: currentColor; box-shadow: inset 0 0 0 1px currentColor; }
