/*
 * Reproductor de tutoriales y maquetas de escena, con la paleta Cauxe:
 *   profundo #0B1F3B · cauxe #2563EB · acero #8EA8C7
 *   arena #F6F4EF · neutro #D9D6CF · carbón #1A1A1A · verde #71867A
 */

.tut-reproductor {
    background: #0B1F3B;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    color: #fff;
    outline: none;
}
.tut-reproductor:focus-visible { box-shadow: 0 0 0 3px rgba(37, 99, 235, .5); }

/* ---- Lienzo: relación 16:9 fija para que no salte al cambiar de escena ---- */
.tut-lienzo {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #F6F4EF;
    overflow: hidden;
}
@supports not (aspect-ratio: 16 / 9) {
    .tut-lienzo { height: 0; padding-bottom: 56.25%; }
}

.tut-escena {
    position: absolute;
    inset: 0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: tut-entra .45s ease both;
}
.tut-escena[hidden] { display: none; }

/* Ken Burns: un acercamiento lento que da sensación de cámara. */
.tut-reproductor.reproduciendo .tut-escena.activa .tut-marco {
    animation: tut-kenburns 9s ease-out both;
}
@keyframes tut-kenburns {
    from { transform: scale(1); }
    to   { transform: scale(1.045); }
}
@keyframes tut-entra {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

/* ---- Maqueta de pantalla dentro de la escena ---- */
.tut-marco {
    background: #fff;
    border: 1px solid #D9D6CF;
    border-radius: 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: center;
}
.tut-barra-app {
    background: #0B1F3B;
    color: #fff;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tut-barra-app::before {
    content: '';
    width: 10px; height: 10px;
    border-radius: 2px;
    background: #2563EB;
}
.tut-cuerpo { padding: 14px; flex: 1; font-size: 13px; color: #1A1A1A; }

.tut-titulo-escena {
    font-weight: 700;
    color: #0B1F3B;
    font-size: 15px;
    margin: 0 0 10px;
}

.tut-campo {
    border: 1px solid #D9D6CF;
    border-radius: 6px;
    padding: 7px 10px;
    background: #fff;
    margin-bottom: 8px;
    min-height: 32px;
    color: #1A1A1A;
}
.tut-campo .tut-etiqueta {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #8A8A8A;
    margin-bottom: 2px;
}
.tut-boton {
    display: inline-block;
    background: #2563EB;
    color: #fff;
    border-radius: 6px;
    padding: 7px 14px;
    font-weight: 600;
    font-size: 12px;
}
.tut-boton.gris { background: #fff; color: #0B1F3B; border: 1px solid #8EA8C7; }

.tut-fila {
    display: flex;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid #E8E5DE;
}
.tut-fila > * { flex: 1; }
.tut-fila.cabecera { font-weight: 600; color: #0B1F3B; border-bottom-color: #D9D6CF; }

.tut-chip {
    display: inline-block;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 600;
}
.tut-chip.ok { background: rgba(113, 134, 122, .18); color: #47564C; }
.tut-chip.espera { background: rgba(168, 137, 79, .18); color: #6E5729; }

/* ---- Resaltado y cursor ---- */
.tut-foco {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .55);
    border-radius: 6px;
    transition: box-shadow .25s ease;
}
.tut-pulsado { filter: brightness(.94); }

.tut-cursor {
    position: absolute;
    top: 0; left: 0;
    width: 20px; height: 20px;
    margin: -3px 0 0 -3px;
    pointer-events: none;
    opacity: 0;
    transition: transform .55s cubic-bezier(.4, 0, .2, 1), opacity .2s;
    z-index: 5;
    background: no-repeat center/contain
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 2l14 9-6 1 3 7-3 1-3-7-5 4z' fill='%230B1F3B' stroke='%23fff' stroke-width='1.4'/%3E%3C/svg%3E");
}
.tut-cursor.visible { opacity: 1; }
.tut-cursor.pulsando::after {
    content: '';
    position: absolute;
    left: -10px; top: -10px;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 2px solid #2563EB;
    animation: tut-clic .4s ease-out;
}
@keyframes tut-clic {
    from { transform: scale(.4); opacity: .9; }
    to   { transform: scale(1.15); opacity: 0; }
}

.tut-tecleando::after {
    content: '';
    display: inline-block;
    width: 1px; height: 1em;
    background: #1A1A1A;
    margin-left: 1px;
    vertical-align: text-bottom;
    animation: tut-cursor-texto .7s steps(1) infinite;
}
@keyframes tut-cursor-texto { 50% { opacity: 0; } }

/* ---- Subtítulos ---- */
.tut-subtitulo {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    max-width: 84%;
    background: rgba(11, 31, 59, .88);
    color: #fff;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    z-index: 6;
}
.tut-subtitulo[hidden] { display: none; }

/* ---- Controles ---- */
.tut-controles {
    background: #0B1F3B;
    padding: 8px 12px 10px;
}
.tut-progreso {
    position: relative;
    height: 6px;
    background: rgba(255, 255, 255, .22);
    border-radius: 3px;
    cursor: pointer;
    margin-bottom: 8px;
}
.tut-progreso-relleno {
    height: 100%;
    width: 0;
    background: #2563EB;
    border-radius: 3px;
}
.tut-marcas { position: absolute; inset: 0; pointer-events: none; }
.tut-marca {
    position: absolute;
    top: -3px;
    width: 3px; height: 12px;
    margin-left: -1px;
    padding: 0;
    border: 0;
    border-radius: 1px;
    background: #F6F4EF;
    pointer-events: auto;
    cursor: pointer;
}
.tut-marca:hover { background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }

.tut-botonera { display: flex; align-items: center; gap: 10px; }
.tut-botonera button {
    background: transparent;
    border: 0;
    color: #fff;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1;
}
.tut-botonera button:hover { background: rgba(255, 255, 255, .12); }
.tut-cc { border: 1px solid rgba(255, 255, 255, .4) !important; font-weight: 700; }
.tut-cc.activo { background: #2563EB !important; border-color: #2563EB !important; }
.tut-voz { border: 1px solid rgba(255, 255, 255, .4) !important; font-weight: 700; }
.tut-voz.activo { background: #2563EB !important; border-color: #2563EB !important; }
.tut-tiempo { margin-left: auto; font-size: 12px; color: #8EA8C7; font-variant-numeric: tabular-nums; }

.tut-icono-play, .tut-icono-pausa { display: inline-block; width: 12px; height: 14px; }
.tut-icono-play {
    border-left: 12px solid #fff;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    width: 0;
}
.tut-icono-pausa {
    border-left: 4px solid #fff;
    border-right: 4px solid #fff;
    width: 12px;
    box-sizing: border-box;
}

/* ---- Capítulos ---- */
.tut-capitulos { list-style: none; margin: 0; padding: 0; }
.tut-capitulos li { border-bottom: 1px solid #E8E5DE; }
.tut-capitulos button {
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    padding: 9px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #1A1A1A;
}
.tut-capitulos button:hover { background: #F6F4EF; }
.tut-capitulos button.activo { background: rgba(37, 99, 235, .1); color: #0B1F3B; font-weight: 600; }

/* Quien pide menos movimiento no debería marearse con el Ken Burns. */
@media (prefers-reduced-motion: reduce) {
    .tut-reproductor.reproduciendo .tut-escena.activa .tut-marco { animation: none; }
    .tut-escena { animation: none; }
    .tut-cursor { transition: none; }
}
