﻿/* ===== Base ===== */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
    background: #0f1115;
    color: #f2f3f5;
    font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

.pagina {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    max-width: 1100px;
    margin: 0 auto;
}
.pagina-centro { align-items: center; justify-content: center; gap: 24px; }

/* ===== Inicio ===== */
.encabezado { text-align: center; margin: 8px 0 24px; }
.titulo { margin: 0; font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; letter-spacing: -0.02em; }
.subtitulo { margin: 6px 0 0; color: #9aa0aa; font-size: 1.05rem; }

.botonera {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.boton-stream {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 200px;
    border-radius: 20px;
    text-decoration: none;
    background: var(--color);
    background-image: linear-gradient(160deg, rgba(255,255,255,.14), rgba(0,0,0,.18));
    box-shadow: 0 10px 30px rgba(0,0,0,.35);
    transition: transform .12s ease, filter .12s ease;
    -webkit-tap-highlight-color: transparent;
}
.boton-stream:hover { filter: brightness(1.08); }
.boton-stream:active { transform: scale(.97); }
.boton-stream:focus-visible { outline: 4px solid #fff; outline-offset: 3px; }
.boton-icono svg { width: 64px; height: 64px; fill: #fff; }
.boton-texto {
    font-size: clamp(1.5rem, 3.5vw, 2.4rem);
    font-weight: 700;
    text-align: center;
    padding: 0 12px;
}

@media (max-width: 560px) {
    .botonera { grid-template-columns: 1fr; }
    .boton-stream { min-height: 140px; flex-direction: row; }
    .boton-icono svg { width: 44px; height: 44px; }
}

/* ===== Reproductor ===== */
.barra { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.btn-regresar {
    display: inline-flex; align-items: center;
    padding: 12px 20px;
    border-radius: 12px;
    background: #1d2129;
    border: 1px solid #2c313c;
    text-decoration: none;
    font-size: 1.1rem; font-weight: 600;
}
.btn-regresar:hover { background: #262b35; }
.titulo-reproductor { margin: 0; font-size: clamp(1.5rem, 3.5vw, 2.2rem); }

.contenedor-media {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 10px 30px rgba(0,0,0,.4);
    border-top: 6px solid var(--color);
}
.contenedor-media video { display: block; width: 100%; max-height: 75vh; background: #000; }

/* En audio el video solo muestra controles; arriba va una animación */
.es-audio { background: #171a21; padding: 40px 24px 24px; }
.es-audio video { height: 54px; background: transparent; }
.visual-audio { display: flex; justify-content: center; align-items: flex-end; gap: 10px; height: 140px; margin-bottom: 28px; }
.visual-audio span {
    width: 18px; height: 20%;
    border-radius: 9px;
    background: var(--color);
}
.sonando .visual-audio span { animation: barra 1s ease-in-out infinite; }
.visual-audio span:nth-child(2) { animation-delay: .15s; }
.visual-audio span:nth-child(3) { animation-delay: .3s; }
.visual-audio span:nth-child(4) { animation-delay: .45s; }
.visual-audio span:nth-child(5) { animation-delay: .6s; }
@keyframes barra { 0%, 100% { height: 20%; } 50% { height: 100%; } }

.btn-play {
    position: absolute; inset: 0; margin: auto;
    width: max-content; height: max-content;
    padding: 18px 36px;
    border: 0; border-radius: 16px;
    background: var(--color); color: #fff;
    font-size: 1.5rem; font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.btn-play[hidden], .estado[hidden] { display: none; }
.estado { text-align: center; color: #9aa0aa; margin: 12px 0 0; padding-bottom: 8px; }
.es-video .estado { position: absolute; left: 0; right: 0; top: 12px; color: #fff; text-shadow: 0 1px 4px #000; }
.nota { color: #7d838d; font-size: .95rem; text-align: center; margin-top: 20px; }

/* ===== Reproductor a pantalla completa ===== */
.pagina.reproductor {
    max-width: none;
    padding: 12px 16px;
}
.reproductor .barra { margin-bottom: 12px; }
.reproductor .nota { margin-top: 10px; }
/* El video ocupa todo el ancho y el alto disponible, sin deformarse */
.es-video video {
    width: 100%;
    height: calc(100vh - 130px);
    max-height: none;
    object-fit: contain;
}
/* En audio se mantiene centrado, pero más ancho */
.reproductor .es-audio { max-width: 900px; width: 100%; margin: 0 auto; }

/* ===== Reproductor: ocupa TODA la pantalla (v3) ===== */
.pagina.reproductor {
    max-width: none;
    padding: 0;
    margin: 0;
    height: 100vh;
    min-height: 0;
    position: relative;
    background: #000;
}
.reproductor .contenedor-media {
    position: absolute;
    inset: 0;
    border-radius: 0;
    border-top: 0;
    box-shadow: none;
}
.reproductor .es-video video {
    width: 100vw;
    height: 100vh;
    object-fit: contain;
}
/* Barra flotante encima del video; se desvanece y reaparece al mover el mouse o tocar */
.reproductor .barra {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 5;
    margin: 0;
    padding: 12px 16px;
    background: linear-gradient(rgba(0,0,0,.75), rgba(0,0,0,0));
    transition: opacity .4s ease;
}
.reproductor .titulo-reproductor { text-shadow: 0 1px 4px #000; }
.reproductor.inactivo .barra { opacity: 0; pointer-events: none; }
.reproductor.inactivo { cursor: none; }
.btn-completa {
    margin-left: auto;
    padding: 12px 20px;
    border-radius: 12px;
    background: #1d2129;
    border: 1px solid #2c313c;
    color: #fff;
    font-size: 1.1rem; font-weight: 600;
    cursor: pointer;
}
.btn-completa:hover { background: #262b35; }
.reproductor .nota { display: none; }

/* Etiqueta con la resolución real del video */
.resolucion {
    margin-left: auto;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(0,0,0,.55);
    border: 1px solid #2c313c;
    font-size: .95rem; font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.resolucion[hidden] { display: none; }

/* Botón "Activar sonido" de deportes: dentro de la barra superior, se oculta con ella */
.btn-sonido {
    padding: 12px 20px;
    border-radius: 12px;
    background: var(--color);
    border: 0;
    color: #fff;
    font-size: 1.1rem; font-weight: 600;
    cursor: pointer;
}
.btn-sonido[hidden] { display: none; }
.barra .resolucion + .btn-sonido, .barra .btn-sonido:only-of-type { margin-left: 0; }
.barra .resolucion[hidden] + .btn-sonido { margin-left: auto; }

/* ===== Fondo de la pantalla de inicio (logos Applebee's / IHOP) ===== */
.fondo-inicio {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
/* Capa oscura encima de la imagen para que los botones y el título se lean bien */
.fondo-inicio::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(10, 12, 16, .45);
}
.pagina-inicio .titulo, .pagina-inicio .subtitulo { text-shadow: 0 2px 8px rgba(0,0,0,.8); }
.pagina-inicio .subtitulo { color: #e6e8eb; }
.pagina-inicio .boton-stream { box-shadow: 0 12px 34px rgba(0,0,0,.55); }
