/* =========================================
   Base
   ========================================= */

:root {
    --bg: #09090b;
    --surface: #18181b;
    --surface-2: #27272a;
    --border: #27272a;
    --border-strong: #3f3f46;
    --text: #fafafa;
    --muted: #a1a1aa;
    --accent: #fafafa;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.is-hidden {
    display: none !important;
}

/* =========================================
   Editor
   ========================================= */

.editor {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
}

.editor__inner {
    width: 100%;
    max-width: 1000px;
}

.editor__header h1 {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.editor__header p {
    color: var(--muted);
    margin-top: 6px;
}

.editor__textarea {
    width: 100%;
    height: min(52vh, 520px);
    margin-top: 28px;
    padding: 24px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: 19px;
    line-height: 1.65;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.15s;
}

.editor__textarea:focus {
    border-color: var(--border-strong);
}

.editor__textarea::placeholder {
    color: #52525b;
}

.editor__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
}

.editor__meta .dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #52525b;
}

.editor__controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 28px;
    margin-top: 26px;
}

.field {
    display: flex;
    align-items: center;
    gap: 12px;
}

.field__label {
    color: var(--muted);
    font-size: 14px;
}

.field output {
    font-variant-numeric: tabular-nums;
    font-size: 14px;
    min-width: 44px;
}

.button-primary {
    margin-left: auto;
    padding: 15px 34px;
    background: var(--accent);
    color: #09090b;
    border: 0;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: 0.15s;
}

.button-primary:hover {
    background: #d4d4d8;
}

.editor__shortcuts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-top: 34px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
}

.editor__shortcuts strong {
    color: #71717a;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
}

kbd {
    display: inline-block;
    min-width: 22px;
    padding: 2px 6px;
    margin-right: 4px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-bottom-width: 2px;
    border-radius: 5px;
    font-family: inherit;
    font-size: 11px;
    text-align: center;
    color: #d4d4d8;
}

/* range */

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 150px;
    height: 4px;
    background: var(--surface-2);
    border-radius: 999px;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--text);
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--text);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

/* =========================================
   Prompter
   ========================================= */

.prompter {
    position: fixed;
    inset: 0;
    background: #000;
    overflow: hidden;
}

.prompter__scroll {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    padding: 0 10vw;
    scrollbar-width: none;
    cursor: pointer;
}

.prompter__scroll::-webkit-scrollbar {
    display: none;
}

.prompter__content {
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 45vh;
    padding-bottom: 80vh;
    text-align: center;
    font-size: 52px;
    font-weight: 500;
    line-height: 1.6;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

.prompter__content p {
    margin: 0;
    min-height: 1em;
}

.prompter__content.is-mirrored {
    transform: scaleX(-1);
}

/* guia de leitura */

.prompter__guide {
    pointer-events: none;
    position: absolute;
    left: 0;
    right: 0;
    top: var(--guide-top, 42%);
    transition: top 0.2s;
    height: 128px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.025);
}

/* marcadores laterais da faixa de leitura */

.prompter__guide::before,
.prompter__guide::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 0;
    height: 0;
    margin-top: -9px;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
}

.prompter__guide::before {
    left: 0;
    border-left: 12px solid rgba(255, 255, 255, 0.35);
}

.prompter__guide::after {
    right: 0;
    border-right: 12px solid rgba(255, 255, 255, 0.35);
}

/* fades */

.prompter__fade {
    pointer-events: none;
    position: absolute;
    left: 0;
    right: 0;
}

.prompter__fade--top {
    top: 0;
    height: 22vh;
    background: linear-gradient(to bottom, #000 8%, transparent);
}

/* com o preview no topo central, o texto atrás dele precisa apagar;
   no canto isso não é necessário */
.prompter:has(.camera:not(.is-hidden):not(.is-corner):not(.is-free)) .prompter__fade--top {
    height: 30vh;
    background: linear-gradient(to bottom, #000 34%, transparent);
}

/* =========================================
   Modo lente

   Encurta a distância entre a linha que você lê e a lente:
   a faixa-guia sobe para logo abaixo do círculo da webcam e a
   coluna fica estreita. Quanto menor esse ângulo, menos o
   olhar denuncia a leitura. É o que dá para fazer sem um
   teleprompter de espelho — não existe correção de olhar em
   software livre no navegador.

   O que importa aqui é o CONE que o olho precisa varrer. Ele tem
   dois lados, e os dois têm de ser pequenos:

   - vertical: a faixa-guia cabe UMA linha. Com duas, o olho já
     desce visivelmente entre uma e outra.
   - horizontal: a coluna é estreita. A 60cm de um monitor de 27",
     980px são uns 25° de varredura lateral — e desviar 25° para o
     lado denuncia tanto quanto olhar para baixo.
   ========================================= */

/* uma linha: a altura acompanha a fonte em vez de ser fixa em px,
   senão aumentar a fonte faz a segunda linha reaparecer na faixa.
   O `.is-high` junto não é redundância: leitura alta liga as duas
   classes, e sem ele a regra de is-high (mais abaixo, mesma
   especificidade) devolveria a faixa de duas linhas. */
.prompter.is-lens .prompter__guide,
.prompter.is-lens.is-high .prompter__guide {
    /* --font-size vem do JS. Não dá para usar `em` aqui: o `em` da
       faixa é o dela mesma (16px do body), não o do texto. */
    height: calc(var(--font-size, 52px) * 1.6 + 14px);
}

.prompter.is-lens .prompter__content {
    max-width: var(--lens-width, 620px);
    /* a fonte NÃO encolhe aqui: texto menor obriga a focar mais e
       piora justamente o que estamos tentando resolver */
    font-size: 1em;
}

/* com a coluna estreita, o preview no topo central sobra: encolhe
   para devolver altura ao texto, que é o pixel que mais importa */
.prompter.is-lens .camera:not(.is-corner):not(.is-free) {
    top: 8px;
    width: 112px;
    height: 112px;
    box-shadow: 0 0 0 12px rgba(0, 0, 0, 0.78), 0 16px 34px 18px rgba(0, 0, 0, 0.8);
}

.prompter.is-lens:has(.camera:not(.is-hidden):not(.is-corner):not(.is-free)) .prompter__fade--top {
    height: 22vh;
    background: linear-gradient(to bottom, #000 30%, transparent);
}

/* o texto começa na altura da faixa: com a webcam acima do monitor,
   a leitura precisa acontecer o mais perto possível do topo da tela */
.prompter__content {
    /* o max() não é enfeite: com a leitura em 0% o calc fica negativo,
       padding não aceita negativo e a declaração inteira seria
       descartada — o texto voltaria para os 45vh do meio da tela */
    padding-top: max(0px, calc(var(--guide-top, 42%) - 1.2em));
}

.prompter.is-lens .prompter__fade--bottom {
    height: 42vh;
}

/* com a faixa bem no alto sobra pouco espaço acima: o fade encolhe
   para não apagar a própria linha que você está lendo */
.prompter.is-high .prompter__fade--top {
    height: 12vh;
    background: linear-gradient(to bottom, #000 20%, transparent);
}

.prompter.is-high .prompter__guide {
    height: 88px;
}

.prompter__fade--bottom {
    bottom: 0;
    height: 26vh;
    background: linear-gradient(to top, #000 8%, transparent);
}

/* progresso */

.prompter__progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    z-index: 20;
}

.prompter__progress-bar {
    height: 100%;
    width: 0;
    background: var(--text);
    transition: width 0.1s linear;
}

/* =========================================
   Controles
   ========================================= */

.controls {
    position: absolute;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(24, 24, 27, 0.92);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 18px;
    z-index: 30;
    transition: opacity 0.35s, transform 0.35s;
}

.controls.is-faded {
    opacity: 0;
    transform: translateX(-50%) translateY(14px);
    pointer-events: none;
}

.control {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    color: var(--text);
    border: 0;
    border-radius: 11px;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
}

.control:hover {
    background: #3f3f46;
}

.control svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
}

.control--play svg {
    width: 20px;
    height: 20px;
}

/* alterna play / pause pelo estado do botão */

.control--play .icon-pause,
.control--play.is-playing .icon-play {
    display: none;
}

.control--play.is-playing .icon-pause {
    display: block;
}

.control.is-active {
    background: var(--text);
    color: #09090b;
}

.control--play {
    width: 52px;
    height: 52px;
    background: var(--text);
    color: #09090b;
    border-radius: 50%;
    font-size: 17px;
}

.control--play:hover {
    background: #d4d4d8;
}

.controls__divider {
    width: 1px;
    height: 26px;
    background: var(--border-strong);
}

.controls__speed {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 4px;
}

.controls__speed span {
    min-width: 26px;
    color: var(--muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.controls__speed input[type="range"] {
    width: 110px;
}

@media (max-width: 720px) {
    .controls__speed,
    .controls__divider {
        display: none;
    }

    .prompter__scroll {
        padding: 0 5vw;
    }
}

/* =========================================
   Karaokê — configuração no editor
   ========================================= */

.voice-setup {
    margin-top: 22px;
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.voice-setup__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
}

.voice-setup__hint {
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.voice-setup__hint:empty {
    display: none;
}

.voice-setup__hint.is-warning {
    color: #fbbf24;
}

.select {
    padding: 9px 12px;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    outline: none;
}

.select:focus {
    border-color: #71717a;
}

/* =========================================
   Karaokê — destaque das palavras
   ========================================= */

/* palavra ainda não falada: precisa continuar legível, é o que
   você vai ler daqui a alguns segundos */
.prompter__content .word {
    color: rgba(250, 250, 250, 0.58);
    transition: color 0.25s, opacity 0.25s;
}

/* já falada: sai do caminho */
.prompter__content .word.is-spoken {
    color: rgba(250, 250, 250, 0.2);
}

/* onde você está agora */
.prompter__content .word.is-current {
    color: #fff;
    text-shadow: 0 0 26px rgba(255, 255, 255, 0.35);
}

/* as próximas palavras, para o olho já ir preparando a frase */
.prompter__content .word.is-next {
    color: rgba(250, 250, 250, 0.97);
}

/* sem karaokê ligado, tudo em branco normal */
.prompter__content:not(.is-karaoke) .word {
    color: inherit;
    text-shadow: none;
}

/* =========================================
   Estado do microfone
   ========================================= */

.voice-status {
    position: absolute;
    top: 18px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 14px;
    background: rgba(24, 24, 27, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 13px;
    color: var(--muted);
    z-index: 25;
}

.voice-status__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #52525b;
    flex: none;
}

.voice-status.is-listening .voice-status__dot {
    background: #22c55e;
    animation: pulse 1.6s ease-in-out infinite;
}

.voice-status.is-loading .voice-status__dot {
    background: #fbbf24;
    animation: pulse 1s ease-in-out infinite;
}

.voice-status.is-lost .voice-status__dot {
    background: #fbbf24;
}

.voice-status.is-error {
    color: #fca5a5;
    max-width: min(560px, 70vw);
}

.voice-status.is-error .voice-status__dot {
    background: #ef4444;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

@media (prefers-reduced-motion: reduce) {
    .voice-status__dot {
        animation: none !important;
    }
}

/* =========================================
   Estrutura do roteiro
   ========================================= */

/* cabeçalho de slide: orienta, mas não é falado */
.prompter__content .cue {
    margin: 0.6em 0 0.3em;
    font-size: 0.42em;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(250, 250, 250, 0.3);
}

.prompter__content .cue::before {
    content: "";
    display: block;
    width: 44px;
    height: 2px;
    margin: 0 auto 0.7em;
    background: rgba(250, 250, 250, 0.22);
}

/* separador entre blocos */
.prompter__content .divider {
    width: 120px;
    height: 1px;
    margin: 1.1em auto;
    background: rgba(250, 250, 250, 0.16);
}

/* pausa marcada no roteiro */
.prompter__content .pause {
    margin: 0.5em 0;
    font-size: 0.34em;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(251, 191, 36, 0.65);
}

/* trecho enfatizado */
.prompter__content .word.is-emphasis {
    font-weight: 700;
}

.prompter__content.is-karaoke .word.is-emphasis {
    color: rgba(255, 255, 255, 0.75);
}

.prompter__content.is-karaoke .word.is-emphasis.is-spoken {
    color: rgba(250, 250, 250, 0.24);
}

.prompter__content.is-karaoke .word.is-emphasis.is-next,
.prompter__content.is-karaoke .word.is-emphasis.is-current {
    color: #fff;
}

/* =========================================
   Slide atual
   ========================================= */

.slide-badge {
    position: absolute;
    top: 18px;
    right: 20px;
    padding: 8px 14px;
    background: rgba(24, 24, 27, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 13px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    z-index: 25;
}

/* =========================================
   Webcam — logo abaixo da câmera física, para
   o olhar ficar perto da lente
   ========================================= */

/* Círculo em vez de retângulo: ocupa muito menos tela e deixa
   o texto subir mais perto da lente. O arquivo gravado continua
   16:9 — o recorte é só do preview. */
.camera {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 168px;
    height: 168px;
    border-radius: 50%;
    background: #000;
    z-index: 26;
    /* halo escuro: separa o preview do texto que passa atrás,
       em vez de recortá-lo com uma borda dura */
    box-shadow: 0 0 0 16px rgba(0, 0, 0, 0.78), 0 20px 46px 22px rgba(0, 0, 0, 0.8);
}

.camera video {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    /* espelhado como qualquer preview de webcam: é como você
       se vê no espelho, o arquivo gravado não sai invertido */
    transform: scaleX(-1);
}

/* No canto: o topo central fica livre para o texto subir até a borda
   da tela, que é onde a webcam física está. */
.camera.is-corner {
    top: 14px;
    left: auto;
    right: 18px;
    transform: none;
    width: 128px;
    height: 128px;
    box-shadow: 0 0 0 10px rgba(0, 0, 0, 0.7), 0 14px 30px 14px rgba(0, 0, 0, 0.7);
}

/* Arrastável: o preview é uma peça que você pega e leva para onde a
   sua webcam física estiver — nem todo monitor tem a lente no topo
   central, e num setup de dois monitores ela pode ficar em qualquer
   canto. Sem `touch-action: none` o navegador rouba o gesto para
   rolar a tela no meio do arrasto. */
.camera {
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.camera.is-dragging {
    cursor: grabbing;
    /* durante o arrasto o preview passa a frente de tudo e ganha um
       halo mais forte, para não sumir no texto claro */
    z-index: 60;
    box-shadow: 0 0 0 12px rgba(0, 0, 0, 0.85), 0 22px 50px 24px rgba(0, 0, 0, 0.85);
}

/* Posição livre. O JS escreve --cam-x/--cam-y como FRAÇÃO da tela, não
   px: assim a bolha continua no mesmo lugar relativo quando a janela
   muda de tamanho ou você entra em tela cheia. O ponto ancorado é o
   centro do círculo, que é como a mão pensa ao arrastar. */
.camera.is-free {
    top: calc(var(--cam-y, 0.1) * 100%);
    left: calc(var(--cam-x, 0.5) * 100%);
    right: auto;
    transform: translate(-50%, -50%);
}

/* Anel de contato visual: acende quando o olhar está na lente
   e esmaece quando você desce para o texto. */
.camera__ring {
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    border: 2px solid rgba(34, 197, 94, 0);
    transition: border-color 0.25s;
    pointer-events: none;
}

/* =========================================
   Estado da gravação
   ========================================= */

.record-status {
    position: absolute;
    bottom: 26px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(24, 24, 27, 0.92);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 999px;
    font-size: 13px;
    color: #fca5a5;
    font-variant-numeric: tabular-nums;
    z-index: 27;
}

.record-status__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ef4444;
    animation: pulse 1.4s ease-in-out infinite;
}

.record-status__meter {
    display: block;
    width: 56px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    overflow: hidden;
}

.record-status__meter i {
    display: block;
    width: 0;
    height: 100%;
    background: #22c55e;
    transition: width 0.08s linear;
}

.control.is-recording {
    background: #ef4444;
    color: #fff;
}

/* =========================================
   Arquivo gravado
   ========================================= */

.take {
    position: absolute;
    bottom: 96px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 22px;
    max-width: min(680px, 90vw);
    padding: 16px 20px;
    background: rgba(24, 24, 27, 0.96);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    z-index: 30;
}

.take__info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.take__info strong {
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.take__info span {
    font-size: 12px;
    color: var(--muted);
}

.take__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.take .button-primary {
    margin: 0;
    padding: 10px 22px;
    font-size: 14px;
    text-decoration: none;
}

.button-ghost {
    padding: 10px 16px;
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: 0.15s;
}

.button-ghost:hover {
    color: var(--text);
    border-color: #71717a;
}

/* =========================================
   Controles auxiliares do editor
   ========================================= */

.check {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 14px;
    cursor: pointer;
}

.check input {
    width: 16px;
    height: 16px;
    accent-color: #fafafa;
    cursor: pointer;
}

.link-button {
    padding: 0;
    background: none;
    border: 0;
    color: var(--muted);
    font-family: inherit;
    font-size: 13px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.link-button:hover {
    color: var(--text);
}

/* =========================================
   Preview da câmera no editor
   ========================================= */

.editor-camera {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 18px;
    padding: 16px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
}

.editor-camera video {
    width: 260px;
    flex: none;
    border-radius: 9px;
    background: #000;
    /* efeito espelho, como qualquer preview de webcam;
       o arquivo gravado não sai invertido */
    transform: scaleX(-1);
}

.editor-camera__side {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
}

.editor-camera__side strong {
    font-size: 14px;
    font-weight: 600;
}

.editor-camera__side p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.editor-camera__side .button-ghost {
    margin-top: 4px;
    padding: 8px 14px;
    font-size: 13px;
}

/* =========================================
   Transcrição ao vivo
   ========================================= */

.transcript {
    position: absolute;
    bottom: 96px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: baseline;
    gap: 12px;
    max-width: min(900px, 84vw);
    padding: 10px 18px;
    background: rgba(24, 24, 27, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 12px;
    z-index: 24;
}

.transcript__label {
    flex: none;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #52525b;
}

#transcriptText {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    color: var(--muted);
}

/* =========================================
   Marca-texto: o trilho que acompanha a fala
   ========================================= */

.prompter__content.is-karaoke .word {
    /* o espaço já está dentro do span (ver renderScript), então o fundo
       se encosta no da palavra seguinte e forma uma faixa contínua */
    padding: 0.06em 0.04em;
    border-radius: 0.1em;
    transition: color 0.25s, background-color 0.2s;
}

.prompter__content.is-karaoke .word.is-spoken {
    background: rgba(255, 255, 255, 0.05);
}

.prompter__content.is-karaoke .word.is-current {
    background: rgba(255, 255, 255, 0.92);
    color: #09090b;
    text-shadow: none;
}

.prompter__content.is-karaoke .word.is-emphasis.is-current {
    color: #09090b;
}

/* preview circular também no editor */
.editor-camera__frame {
    position: relative;
    width: 190px;
    height: 190px;
    flex: none;
    border-radius: 50%;
    overflow: hidden;
    background: #000;
}

.editor-camera__frame video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transform: scaleX(-1);
}

.editor-camera__side .field {
    gap: 10px;
}

.editor-camera__side .field input[type="range"] {
    width: 120px;
}

#cameraNote {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    max-width: 460px;
}

#cameraNote.is-warning {
    color: #fbbf24;
}

/* =========================================
   Teste de gravação
   ========================================= */

.check-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.meter {
    display: block;
    width: 120px;
    height: 6px;
    border-radius: 999px;
    background: var(--surface-2);
    overflow: hidden;
}

.meter i {
    display: block;
    width: 0;
    height: 100%;
    background: #22c55e;
    transition: width 0.08s linear;
}

.test-result {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}

.test-result.is-ok { color: #4ade80; }
.test-result.is-bad { color: #fca5a5; }

.test-playback {
    margin-top: 14px;
    padding: 14px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
}

.test-playback video,
.test-playback audio {
    display: block;
    width: 100%;
    max-width: 380px;
    border-radius: 8px;
}

.gaze-debug {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #7dd3fc;
    white-space: pre-line;
}

.gaze-debug.is-bad { color: #fbbf24; }

/* atalho para a montagem do curso: o passo depois de gravar */
.editor__header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 16px;
}

.editor__header h1 {
    width: 100%;
}

.editor__link {
    margin-left: auto;
    text-decoration: none;
    line-height: 1;
}
