/* Живой аватар Лины: тёплая тёмная сцена, субтитры и кнопка «зажми и говори». */
:root {
    /* переменные, на которые опирается общий экран входа (lib/page-lock.css) */
    --bg-color: #15100f;
    --widget-bg: rgba(38, 28, 26, 0.78);
    --border-color: rgba(214, 160, 120, 0.28);
    --text-color: #f3e6dc;
    --text-secondary: #b9a296;
    --accent-color: #e8935e;
    --accent-glow: rgba(232, 147, 94, 0.45);
    --red-color: #f0645a;
    --font-main: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: radial-gradient(120% 90% at 50% 20%, #3a2620 0%, #1c1412 55%, #110c0b 100%);
    color: var(--text-color);
    font-family: var(--font-main);
    -webkit-tap-highlight-color: transparent;
}

#scene {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

.lina-top {
    position: fixed;
    top: max(16px, env(safe-area-inset-top));
    left: 16px;
    right: 16px;
    display: flex;
    align-items: baseline;
    gap: 14px;
    pointer-events: none;
}

.lina-name {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 9px;
}

.lina-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #6c5a52;
    transition: background 0.3s, box-shadow 0.3s;
}
.lina-dot.on { background: #7fd08a; box-shadow: 0 0 10px rgba(127, 208, 138, 0.7); }
.lina-dot.busy { background: var(--accent-color); box-shadow: 0 0 10px var(--accent-glow); }

.lina-status { color: var(--text-secondary); font-size: 14px; }

/* Свободная камера (WASD) — кнопка вернуть взгляд к ней */
.lina-back {
    margin-left: auto;
    align-self: center;
    pointer-events: auto;
    font: inherit;
    font-size: 13px;
    color: var(--text-color);
    background: var(--widget-bg);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 6px 12px;
    cursor: pointer;
    backdrop-filter: blur(8px);
}
.lina-back[hidden] { display: none; }
.lina-back:hover { filter: brightness(1.05); }

.lina-subs {
    width: min(640px, 100%);
    max-height: 32vh;
    overflow-y: auto;
    text-align: center;
    pointer-events: none;
    margin-bottom: 4px;
}

.lina-you {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
    min-height: 1em;
}

.lina-her {
    display: inline-block;
    font-size: 17px;
    line-height: 1.45;
    padding: 0;
    border-radius: 14px;
    background: transparent;
    transition: opacity 0.4s;
}
.lina-her:not(:empty) {
    padding: 10px 16px;
    background: rgba(25, 18, 16, 0.62);
    backdrop-filter: blur(6px);
    border: 1px solid var(--border-color);
}

.lina-controls {
    pointer-events: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: max(18px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
}

.lina-type { pointer-events: auto; }

.lina-type {
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(520px, 100%);
}
.lina-type input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(25, 18, 16, 0.7);
    color: var(--text-color);
    font: inherit;
    font-size: 15px;
    outline: none;
}
.lina-type input:focus { border-color: var(--accent-color); }

.lina-mic-wrap { position: relative; flex: none; }

.lina-mic {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: radial-gradient(circle at 50% 35%, #f0a271, #c86a3d);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(200, 106, 61, 0.35);
    transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
    touch-action: none;
    user-select: none;
}
.lina-mic:active, .lina-mic.rec { transform: scale(1.08); }
.lina-mic.rec { box-shadow: 0 0 0 10px rgba(240, 100, 90, 0.18), 0 0 26px rgba(240, 100, 90, 0.55); filter: hue-rotate(-18deg); }
.lina-mic:disabled { filter: grayscale(0.7) brightness(0.7); cursor: default; }

/* Подсказка — только при наведении на микрофон */
.lina-hint {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(25, 18, 16, 0.92);
    color: var(--text-secondary);
    font-size: 12px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s, transform 0.15s;
    pointer-events: none;
}
.lina-mic-wrap:hover .lina-hint { opacity: 1; transform: none; }

@media (max-width: 520px) {
    .lina-her { font-size: 16px; }
}
