/* Nitro by Castrol · theme 1.0.0
 *
 * Minimalista: fondo metálico de la marca, tarjetas blancas, rojo para entrar, verde para
 * actuar, y el evento en oscuro para que el video mande.
 */

/* ---------- Tipografías (autoalojadas) ---------- */

@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/dm-sans-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/dm-sans-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Fieldwork';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/Fieldwork10GeoRegular.ttf') format('truetype');
}

@font-face {
    font-family: 'Fieldwork';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/Fieldwork12ItalicRegular.ttf') format('truetype');
}

/* ---------- Tokens ---------- */

:root {
    --nitro-rojo: #F00023;
    --nitro-rojo-osc: #c8001d;
    --nitro-verde: #009343;
    --nitro-verde-osc: #007a38;
    --nitro-tinta: #24232c;
    --nitro-texto: #333338;
    --nitro-tenue: #6b6c74;
    --nitro-linea: #dcdde2;
    --nitro-fondo: #eceef1;
    --nitro-blanco: #fff;
    --nitro-panel: #1d1c23;
    --nitro-capa: #2a2931;
    --nitro-escena: #121116;
    --nitro-linea-osc: rgba(255, 255, 255, .12);

    --nitro-f-texto: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --nitro-f-marca: 'Fieldwork', 'DM Sans', system-ui, sans-serif;

    --nitro-radio: 6px;
    --nitro-radio-g: 12px;
    --nitro-sombra: 0 1px 2px rgba(20, 20, 30, .05), 0 12px 40px rgba(20, 20, 30, .08);
    --nitro-margen: clamp(16px, 4vw, 40px);
    --nitro-cabecera: 64px;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--nitro-fondo) url('../img/fondo.jpg') center top / cover no-repeat fixed;
    color: var(--nitro-texto);
    font-family: var(--nitro-f-texto);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img,
svg,
video,
iframe {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

a {
    color: var(--nitro-rojo);
    text-underline-offset: 3px;
}

a:hover {
    color: var(--nitro-rojo-osc);
}

h1, h2, h3 {
    margin: 0;
    line-height: 1.2;
}

p {
    margin: 0;
}

:focus-visible {
    outline: 2px solid var(--nitro-verde);
    outline-offset: 2px;
}

::selection {
    background: var(--nitro-rojo);
    color: #fff;
}

.visualmente-oculto {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.saltar {
    position: absolute;
    left: 16px;
    top: -100px;
    z-index: 1000;
    padding: 10px 16px;
    border-radius: var(--nitro-radio);
    background: var(--nitro-tinta);
    color: #fff;
}

.saltar:focus {
    top: 16px;
    color: #fff;
}

/* ---------- Botones ---------- */

.boton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 28px;
    border: 0;
    border-radius: var(--nitro-radio);
    font-family: var(--nitro-f-texto);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, transform .1s ease;
}

.boton:active {
    transform: scale(.98);
}

.boton--rojo {
    background: var(--nitro-rojo);
    color: #fff;
}

.boton--rojo:hover {
    background: var(--nitro-rojo-osc);
    color: #fff;
}

.boton--verde {
    background: var(--nitro-verde);
    color: #fff;
}

.boton--verde:hover {
    background: var(--nitro-verde-osc);
    color: #fff;
}

.boton--chico {
    min-height: 38px;
    padding: 0 16px;
    font-size: 12px;
}

/* ---------- Tarjeta ---------- */

.tarjeta {
    width: 100%;
    background: var(--nitro-blanco);
    border-radius: var(--nitro-radio-g);
    box-shadow: var(--nitro-sombra);
}

.sobretitulo {
    margin: 0 0 24px;
    color: var(--nitro-tenue);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

/* ---------- Cabecera y pie ---------- */

.cabecera {
    position: relative;
    z-index: 20;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, .06);
}

.cabecera__dentro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: calc(var(--nitro-cabecera) - 1px);
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 var(--nitro-margen);
}

.cabecera__logo img {
    width: auto;
    height: 40px;
}

.cabecera__nav {
    display: flex;
    align-items: center;
    gap: 22px;
}

.cabecera__enlace {
    color: var(--nitro-texto);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.cabecera__enlace:hover {
    color: var(--nitro-rojo);
}

.cabecera__enlace--tenue {
    color: var(--nitro-tenue);
    font-weight: 500;
}

.pie {
    flex: 0 0 auto;
    padding: 24px var(--nitro-margen);
    color: var(--nitro-tenue);
    font-size: 13px;
    text-align: center;
}

/* ---------- Contenedor general ---------- */

.principal {
    flex: 1 0 auto;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: clamp(32px, 6vw, 72px) var(--nitro-margen);
}

/* ---------- Portada ---------- */

.portada {
    flex: 1 0 auto;
    display: grid;
    place-items: center;
    padding: 48px var(--nitro-margen);
    text-align: center;
}

.portada__caja {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 560px;
}

.portada__logo {
    margin: 0 0 28px;
}

.portada__logo img {
    width: min(400px, 78vw);
    height: auto;
}

.portada__texto {
    margin: 0 0 32px;
    color: var(--nitro-texto);
    font-size: 16px;
}

.portada__texto p {
    margin: 0 0 6px;
}

.portada__texto p:first-child {
    color: var(--nitro-tinta);
    font-family: var(--nitro-f-marca);
    font-size: clamp(20px, 2.6vw, 24px);
    font-style: italic;
    line-height: 1.25;
}

.portada__texto p:not(:first-child) {
    max-width: 44ch;
    margin-inline: auto;
    color: var(--nitro-tenue);
}

/* ---------- Ingreso ---------- */

.ingreso {
    position: relative;
    flex: 1 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
    align-items: center;
    gap: clamp(24px, 5vw, 80px);
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 48px var(--nitro-margen);
}

/* La franja roja de la marca, detrás del técnico */
.ingreso::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    z-index: -1;
    height: 34%;
    transform: translateY(-50%);
    background: var(--nitro-rojo);
    -webkit-clip-path: polygon(0 0, 62% 0, 58% 100%, 0 100%);
    clip-path: polygon(0 0, 62% 0, 58% 100%, 0 100%);
}

.ingreso__foto {
    align-self: end;
    justify-self: center;
}

.ingreso__foto img {
    width: auto;
    max-height: min(78vh, 720px);
}

.ingreso__tarjeta {
    padding: clamp(28px, 4vw, 44px);
}

.ingreso__logo {
    display: block;
    width: fit-content;
    margin: 0 auto 28px;
}

.ingreso__logo img {
    width: auto;
    height: 64px;
}

.ingreso__titulo {
    margin: 0 0 20px;
    color: var(--nitro-tinta);
    font-size: 20px;
    font-weight: 700;
    text-align: center;
}

@media (max-width: 860px) {
    .ingreso {
        grid-template-columns: minmax(0, 440px);
        justify-content: center;
    }

    .ingreso::before,
    .ingreso__foto {
        display: none;
    }
}

/* Formulario (plugin Single Session Login) */

.ssl-login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ssl-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ssl-label {
    color: var(--nitro-texto);
    font-size: 13px;
    font-weight: 600;
}

.ssl-input {
    width: 100%;
    height: 50px;
    padding: 0 14px;
    border: 1px solid var(--nitro-linea);
    border-radius: var(--nitro-radio);
    background: #fff;
    color: var(--nitro-texto);
    font: inherit;
    font-size: 16px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.ssl-input:hover {
    border-color: #c4c5cc;
}

.ssl-input:focus {
    outline: none;
    border-color: var(--nitro-verde);
    box-shadow: 0 0 0 3px rgba(0, 147, 67, .15);
}

.ssl-remember-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--nitro-tenue);
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

.ssl-checkbox {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--nitro-verde);
}

.ssl-submit-btn {
    height: 52px;
    margin-top: 6px;
    border: 0;
    border-radius: var(--nitro-radio);
    background: var(--nitro-verde);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color .15s ease, transform .1s ease;
}

.ssl-submit-btn:hover {
    background: var(--nitro-verde-osc);
}

.ssl-submit-btn:active {
    transform: scale(.99);
}

.ssl-error {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: var(--nitro-radio);
    background: #fdeaec;
    color: #a3001a;
    font-size: 14px;
    border-left: 3px solid var(--nitro-rojo);
}

/* ---------- Mi cuenta (plugin User Profile Manager) ---------- */

.cuenta {
    display: grid;
    place-items: start center;
}

.cuenta__tarjeta {
    max-width: 480px;
    padding: clamp(28px, 4vw, 40px);
}

.upm-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0 0 28px;
}

.upm-avatar {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--nitro-tinta);
    color: #fff;
    font-family: var(--nitro-f-marca);
    font-size: 28px;
}

.upm-username {
    min-width: 0;
    color: var(--nitro-tinta);
    font-size: clamp(20px, 3vw, 24px);
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.upm-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 28px 0 0;
    padding: 24px 0 0;
    border-top: 1px solid var(--nitro-linea);
    list-style: none;
}

.upm-info-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--nitro-texto);
    font-size: 15px;
    overflow-wrap: anywhere;
}

.upm-icon {
    flex: 0 0 18px;
    margin-top: 3px;
    color: var(--nitro-tenue);
}

/* Cambiar contraseña: plegado, para que no compita con el botón del evento */
.upm-clave {
    margin: 24px 0 0;
    padding: 20px 0 0;
    border-top: 1px solid var(--nitro-linea);
}

.upm-clave-titulo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--nitro-texto);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.upm-clave-titulo::-webkit-details-marker {
    display: none;
}

.upm-clave-titulo::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .2s ease;
}

.upm-clave[open] .upm-clave-titulo::after {
    transform: rotate(-135deg);
}

.upm-clave-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 18px;
}

.upm-clave-campo {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--nitro-texto);
    font-size: 13px;
    font-weight: 600;
}

.upm-clave-campo small {
    color: var(--nitro-tenue);
    font-weight: 400;
}

.upm-clave-campo input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--nitro-linea);
    border-radius: var(--nitro-radio);
    font: inherit;
    font-size: 16px;
    font-weight: 400;
}

.upm-clave-campo input:focus {
    outline: none;
    border-color: var(--nitro-verde);
    box-shadow: 0 0 0 3px rgba(0, 147, 67, .15);
}

.upm-clave-boton {
    height: 48px;
    border: 0;
    border-radius: var(--nitro-radio);
    background: var(--nitro-tinta);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    cursor: pointer;
}

.upm-clave-boton:hover {
    background: #000;
}

.upm-clave-aviso {
    margin: 16px 0 0;
    padding: 12px 14px;
    border-radius: var(--nitro-radio);
    font-size: 14px;
}

.upm-clave-aviso.is-ok {
    background: #e6f5ec;
    color: #00612c;
    border-left: 3px solid var(--nitro-verde);
}

.upm-clave-aviso.is-error {
    background: #fdeaec;
    color: #a3001a;
    border-left: 3px solid var(--nitro-rojo);
}

.upm-logout-btn {
    display: inline-block;
    margin-top: 28px;
    color: var(--nitro-tenue);
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
}

.upm-logout-btn:hover {
    color: var(--nitro-rojo);
}

.upm-aviso,
.ssl-aviso {
    color: var(--nitro-tenue);
}

/* ---------- Evento en vivo ---------- */

.pagina-evento {
    background: var(--nitro-escena);
}

.pagina-evento .cabecera {
    background: #fff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.evento {
    flex: 1 0 auto;
    display: flex;
    background: var(--nitro-escena);
}

.evento__escena {
    position: relative;
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(340px, 28vw, 420px);
    min-height: calc(100dvh - var(--nitro-cabecera));
}

.evento__principal {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: clamp(12px, 2vw, 28px);
}

.evento__barra {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 28px;
    margin: 0 0 12px;
}

/* El título lo pinta el plugin con estilos en línea: aquí solo se ajusta */
.evento__barra .castrol-titulo-texto {
    color: #fff;
    font-family: var(--nitro-f-texto);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .02em;
    line-height: 1.3;
}

.evento__estado {
    display: none;
}

.evento__estado > span {
    display: none;
    align-items: center;
    gap: 6px;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.evento__estado-vivo {
    background: var(--nitro-rojo);
}

.evento__estado-vivo::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    animation: nitro-parpadeo 1.2s ease-in-out infinite;
}

.evento__estado-pausa {
    background: var(--nitro-capa);
}

[data-evento="active"] .evento__estado,
[data-evento="paused"] .evento__estado {
    display: inline-flex;
}

[data-evento="active"] .evento__estado-vivo,
[data-evento="paused"] .evento__estado-pausa {
    display: inline-flex;
}

.evento__principal .nitro-video {
    border-radius: var(--nitro-radio);
}

.evento__panel {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--nitro-linea-osc);
}

.evento__panel .chat-rt-container {
    flex: 1;
    min-height: 0;
}

/* Escritorio: el panel ocupa la altura de la pantalla y el chat hace scroll por dentro */
@media (min-width: 961px) {
    .evento__escena {
        height: calc(100dvh - var(--nitro-cabecera));
    }

    .evento__panel {
        height: 100%;
        overflow: hidden;
    }

    .evento__panel .chat-rt-container,
    .evento__panel .chat-rt-mensaje-estado {
        min-height: 0;
    }
}

/* Celular y tableta: video arriba y fijo, el juego debajo */
@media (max-width: 960px) {
    .evento__escena {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto 1fr;
    }

    .evento__principal {
        position: sticky;
        top: 0;
        z-index: 5;
        padding: 0;
        background: #000;
    }

    .evento__barra {
        margin: 0;
        padding: 8px 12px;
        background: var(--nitro-escena);
    }

    .evento__barra .castrol-titulo-texto {
        font-size: 13px;
    }

    .evento__principal .nitro-video {
        border-radius: 0;
    }

    .evento__panel {
        border-left: 0;
        border-top: 1px solid var(--nitro-linea-osc);
    }

    .evento__panel .chat-rt-chat {
        height: max(360px, calc(100dvh - var(--nitro-cabecera) - 56.25vw - 44px));
    }
}

/* Capa de espera: cubre video y juego mientras el evento no está en vivo */
.evento__espera {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: none;
    place-items: center;
    padding: 32px;
    background: var(--nitro-fondo) url('../img/fondo.jpg') center / cover no-repeat;
    text-align: center;
}

[data-evento="waiting"] .evento__espera,
[data-evento="ended"] .evento__espera {
    display: grid;
    animation: nitro-aparecer .4s ease both;
}

.evento__espera-caja {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.evento__espera-logo {
    width: auto;
    height: clamp(64px, 12vw, 120px);
}

.evento__espera-texto {
    max-width: 30ch;
    color: var(--nitro-tinta);
    font-family: var(--nitro-f-marca);
    font-size: clamp(20px, 3vw, 32px);
    font-style: italic;
    line-height: 1.25;
}

/* Con la gráfica del evento subida en el panel, en espera se ve solo la gráfica */
[data-evento="waiting"] .evento__espera.tiene-imagen {
    background-color: #000;
    background-size: cover;
}

[data-evento="waiting"] .evento__espera.tiene-imagen .evento__espera-caja {
    display: none;
}

/* Al terminar se vuelve siempre al fondo de la marca, con el mensaje de cierre */
[data-evento="ended"] .evento__espera {
    background-image: url('../img/fondo.jpg') !important;
}

@keyframes nitro-aparecer {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes nitro-parpadeo {
    50% { opacity: .3; }
}

/* ---------- Avisos (404) ---------- */

.aviso {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.aviso__numero {
    color: var(--nitro-rojo);
    font-family: var(--nitro-f-marca);
    font-size: clamp(88px, 16vw, 160px);
    font-style: italic;
    line-height: 1;
}

.aviso__titulo {
    margin: 12px 0 8px;
    color: var(--nitro-tinta);
    font-size: clamp(22px, 3vw, 28px);
}

.aviso__texto {
    margin: 0 0 28px;
    color: var(--nitro-tenue);
}

/* ---------- Texto corrido (páginas genéricas) ---------- */

.texto {
    max-width: 720px;
    margin: 0 auto;
    padding: clamp(28px, 5vw, 56px);
    background: var(--nitro-blanco);
    border-radius: var(--nitro-radio-g);
    box-shadow: var(--nitro-sombra);
}

.texto__titulo {
    margin: 0 0 24px;
    color: var(--nitro-tinta);
    font-size: clamp(26px, 4vw, 36px);
}

.texto__cuerpo > * + * {
    margin-top: 1em;
}

.texto__cuerpo h2 {
    margin-top: 1.6em;
    font-size: 22px;
}

.texto__cuerpo h3 {
    margin-top: 1.4em;
    font-size: 18px;
}

.texto__cuerpo ul,
.texto__cuerpo ol {
    padding-left: 1.3em;
}

.lista {
    margin: 0;
    padding: 0;
    list-style: none;
}

.lista li + li {
    border-top: 1px solid var(--nitro-linea);
}

.lista a {
    display: block;
    padding: 14px 0;
    color: var(--nitro-texto);
    font-weight: 600;
    text-decoration: none;
}

.lista a:hover {
    color: var(--nitro-rojo);
}

/* ---------- Movimiento ---------- */

.portada__caja,
.ingreso__tarjeta,
.cuenta__tarjeta,
.aviso,
.texto {
    animation: nitro-entrar .5s cubic-bezier(.2, .7, .2, 1) both;
}

.ingreso__foto {
    animation: nitro-entrar .6s .08s cubic-bezier(.2, .7, .2, 1) both;
}

@keyframes nitro-entrar {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

@media (max-width: 520px) {
    .cabecera__nav {
        gap: 14px;
    }

    .cabecera__logo img {
        height: 34px;
    }
}
