:root {
    --bg: #0a0a0f;




    --text: #b8b8c4;
    --text-bright: #ffffff;
    --accent: #6c8cff;
    --error: #ff6b6b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.app-shell {
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Stage principal ===== */
.stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at 50% 40%, rgba(74, 125, 255, 0.08), transparent 60%),
        var(--bg);
    overflow: hidden;
}

/* ===== Ojos eliminados (rediseño CompanionFace) ===== */

/* ===== Nombre y estado ===== */
.status-area {
    text-align: center;
    position: relative;
    z-index: 2;
}

.assistant-name {
    font-size: clamp(20px, 4vw, 30px);
    font-weight: 700;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--text-bright);
    text-shadow: 0 0 30px rgba(74, 125, 255, 0.3);
}

.assistant-status {
    margin-top: 10px;
    font-size: clamp(13px, 3vw, 16px);
    color: var(--text);
    min-height: 22px;
    opacity: 0.85;
}

.stage[data-state="listening"] .assistant-status {
    color: var(--accent);
    animation: statusPulse 1.2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ===== Transcripción ===== */
.transcript {
    position: absolute;
    bottom: 12vh;
    left: 50%;
    transform: translateX(-50%);
    width: min(520px, 88vw);
    background: rgba(20, 20, 32, 0.75);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 14px 18px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    z-index: 5;
    opacity: 1;
    transition: opacity 0.8s ease;
}

.transcript.hidden-fade {
    opacity: 0;
}

.transcript .label {
    color: var(--accent);
    font-weight: 600;
    margin-right: 4px;
}

.transcript-user {
    margin-bottom: 6px;
}

.transcript-assistant {
    color: var(--text-bright);
}

/* ===== Zona táctil ===== */
.touch-zone {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    cursor: pointer;
}

.touch-zone.recording {
    background: radial-gradient(ellipse at 50% 60%, rgba(74, 125, 255, 0.07), transparent 50%);
}

/* ===== Botón configuración ===== */
.settings-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    color: var(--text);
    font-size: 18px;
    width: 42px;
    height: 42px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: rotate(20deg);
}

/* ===== Overlay de configuración ===== */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 10, 0.8);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.overlay[hidden] {
    display: none;
}

.overlay-content {
    width: min(520px, 92vw);
    max-height: 85vh;
    overflow-y: auto;
    background: #14141f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 26px;
}

.overlay-content h2 {
    color: var(--text-bright);
    margin-bottom: 18px;
    font-size: 20px;
}

.overlay-content section {
    margin-bottom: 20px;
}

.overlay-content h3 {
    color: var(--accent);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 6px;
}

.overlay-content label {
    display: block;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text);
}

.overlay-content input[type="text"],
.overlay-content input[type="password"],
.overlay-content select {
    width: 100%;
    margin-top: 6px;
    background: #0d0d16;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-bright);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.overlay-content input:focus,
.overlay-content select:focus {
    border-color: var(--accent);
}

.overlay-content .checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}

.overlay-content .checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.overlay-actions {
    display: flex;
    gap: 12px;
    margin-top: 22px;
}

.btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.btn:hover {
    opacity: 0.9;
}

/* ===== Panel de voz Piper ===== */
.piper-voice-info {
    background: rgba(108, 140, 255, 0.08);
    border: 1px solid rgba(108, 140, 255, 0.2);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 12px;
}

.tts-test-status {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--accent);
    min-height: 16px;
}

#piperVozInfo .btn {
    flex: none;
    padding: 10px 18px;
}
