html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #050608;
    color: #fff;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

#liveavatar-stage {
    position: fixed;
    inset: 0;
    overflow: hidden;
    isolation: isolate;
    background-color: #f3d1ae;
}

#liveavatar-stage::before {
    position: absolute;
    inset: -2rem;
    z-index: 0;
    content: "";
    background: url("../images/liveavatar-stage-background.png") center / cover no-repeat;
    filter: blur(24px) saturate(0.88);
    transform: scale(1.04);
}

#liveavatar-stage::after {
    position: absolute;
    right: 1.25rem;
    bottom: 0.45rem;
    z-index: 3;
    color: rgba(255, 255, 255, 0.84);
    content: "Generado por IA";
    font-size: clamp(0.65rem, 0.85vw, 0.82rem);
    line-height: 1.2;
    text-shadow: 0 1px 4px #000b;
    pointer-events: none;
}

.stage-avatar-still {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.stage-avatar-still {
    z-index: 1;
    object-fit: contain;
}

#stage-avatar-video {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
}

.stage-avatar-still[hidden],
#stage-avatar-video[hidden] {
    display: none !important;
}

.stage-placeholder {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 1rem;
    padding: 2rem;
    background: #05060840;
    color: #d6d9df;
    text-align: center;
    font-size: clamp(1rem, 2vw, 1.8rem);
}

.stage-placeholder[hidden] {
    display: none;
}

.stage-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid #ffffff30;
    border-top-color: #fff;
    border-radius: 50%;
    animation: stage-spin 0.9s linear infinite;
}

@keyframes stage-spin {
    to { transform: rotate(360deg); }
}

.stage-status-chip,
.stage-shortcut,
.stage-avatar-name {
    position: absolute;
    z-index: 3;
    padding: 0.65rem 1rem;
    border: 1px solid #ffffff24;
    border-radius: 999px;
    background: #050608a8;
    color: #f5f6f8;
    font-size: clamp(0.75rem, 1vw, 1rem);
    letter-spacing: 0.04em;
    backdrop-filter: blur(8px);
}

.stage-status-chip {
    top: 1.25rem;
    left: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-transform: uppercase;
}

.stage-indicator {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: #e5b942;
    box-shadow: 0 0 0.8rem #e5b94288;
}

.stage-indicator.is-listening {
    background: #41d28a;
    box-shadow: 0 0 0.8rem #41d28a88;
}

.stage-indicator.is-paused {
    background: #ed9b46;
    box-shadow: 0 0 0.8rem #ed9b4688;
}

.stage-indicator.is-error {
    background: #ed5b5b;
    box-shadow: 0 0 0.8rem #ed5b5b88;
}

.stage-shortcut {
    right: 1.25rem;
    bottom: 2rem;
    color: #d9dde4;
    opacity: 0.76;
}

.stage-shortcut:first-letter {
    font-weight: 700;
}

.stage-avatar-name {
    bottom: 1.25rem;
    left: 1.25rem;
    opacity: 0.6;
}

.stage-error {
    position: absolute;
    z-index: 4;
    top: 5.5rem;
    left: 50%;
    width: min(46rem, calc(100% - 2rem));
    transform: translateX(-50%);
    padding: 1rem 1.25rem;
    border: 1px solid #ff878755;
    border-radius: 0.8rem;
    background: #380d12e8;
    color: #fff;
    text-align: center;
    font-size: clamp(0.95rem, 1.4vw, 1.2rem);
}

@media (max-width: 600px) {
    .stage-status-chip { top: 0.75rem; left: 0.75rem; }
    #liveavatar-stage::after { right: 0.75rem; bottom: 0.35rem; }
    .stage-shortcut { right: 0.75rem; bottom: 1.9rem; }
    .stage-avatar-name { bottom: 0.75rem; left: 0.75rem; }
}
