*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

/* ══════════════════════════════════════
   VARIABLES
══════════════════════════════════════ */
:root{
  --accent: #e50914; 
  --accent-rgb: 255, 140, 0;
  --amber:#FF8C00;
  --amber-dim:rgba(255,140,0,0.18);
  --amber-mid:rgba(255,140,0,0.35);
  --w:#FFF;
  --w80:rgba(255,255,255,0.80);
  --w55:rgba(255,255,255,0.55);
  --w30:rgba(255,255,255,0.30);
  --black:#0B0A09;
  --border:rgba(255,255,255,0.09);
  --border-a:rgba(255,140,0,0.28);
  --f-display:'Antonio',sans-serif;
  --f-body:'Inter',sans-serif;
  --sx:40px;
}

/* ══════════════════════════════════════
   CANVAS FIJO 1280×720
══════════════════════════════════════ */
html,body{
  width:1280px;
  height:720px;
  overflow:hidden;
  background:var(--black);
  color:var(--w);
  font-family:var(--f-body);
}

body{position:relative}

/* ══════════════════════════════════════
   VIDEO — capa base absoluta
   FIX: position:absolute + z-index:1 para
   que background:#000 tape el blanco del
   iframe de YT durante la inicialización
══════════════════════════════════════ */
#video {
  position: absolute;
  top: 0;
  left: 0;
  width: 1280px;
  height: 720px;
  background: #000;
  z-index: 1;
  /* Aceleración hardware para nitidez en Tanix */
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000;
  -webkit-font-smoothing: antialiased;
}

#logo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5; /* Frente al video, detrás de widgets (10) */
    background: #000000; /* Fondo negro para tapar la carga sucia del player */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease; /* Transición suave opcional */
}

#logo-overlay img {
    max-width: 1080px; /* O el tamaño de tu preferencia */
    height: auto;
}

/* ══════════════════════════════════════
   UNLOCK SCREEN — cubre todo hasta el
   primer click/touch del usuario
══════════════════════════════════════ */
#unlock-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 1280px;
  height: 720px;
  background: var(--black);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
}

/* ══════════════════════════════════════
   GRADIENTES
══════════════════════════════════════ */
#gradients {
  position: absolute;
  top: 0;
  left: 0;
  width: 1280px;
  height: 720px;
  z-index: 5;
  pointer-events: none;
  background:
    /* Suavizado de arriba: mayor distancia hasta llegar a transparente */
    linear-gradient(to bottom, rgba(11,10,9,0.35) 0%, rgba(11,10,9,0.2) 20%, transparent 60%),
    /* Suavizado de izquierda: transición lateral más profunda */
    linear-gradient(to right, rgba(11,10,9,0.35) 0%, rgba(11,10,9,0.2) 30%, transparent 70%);
}

/* ══════════════════════════════════════
   HEADER
══════════════════════════════════════ */
header{
  position: relative;
  top:0;left:0;right:0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  height:85px;
  padding:0 var(--sx);
  z-index:10;
  overflow: visible; /* Vital para que el brillo no se corte en Android */
}


/* 2. LA LÍNEA SÓLIDA (::after) - Va por encima y define el trazo */
header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 30px;
    width: calc(100% - 30px); 
    height: 4px; 
    border-radius: 2px;
    
    background: -webkit-linear-gradient(left, 
        var(--accent) 0%, 
        var(--accent) 40%,            
        rgba(var(--accent-rgb), 0.15) 60%, 
        rgba(var(--accent-rgb), 0) 90%   
    );
    background: linear-gradient(to right, 
        var(--accent) 0%, 
        var(--accent) 40%,            
        rgba(var(--accent-rgb), 0.15) 60%, 
        rgba(var(--accent-rgb), 0) 90%   
    );        

    box-shadow: 0 0px 4px rgba(var(--accent-rgb), 0.0);

    opacity: 0.9;
    z-index: 2;
    
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.logo-container{display:flex;align-items:center;gap:12px}

#header-logo{
  height:95px;
  width:auto;
  filter:drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

#business-name{
  padding:13px;
  font-family:var(--f-display);
  font-size:60px;
  font-weight:700;
  line-height:1;
  letter-spacing:1px;
  text-transform:uppercase;
}

#business-name .subtitle{
  display:block;
  margin-top:5px;
  color:var(--amber);
  font-family:var(--f-body);
  font-size:11px;
  font-weight:400;
  letter-spacing:5px;
  text-transform:uppercase;
}

#clock{text-align:right;line-height:1}

#clock-time{
  display:block;
  font-family:var(--f-display);
  font-size:40px;
  font-weight:700;
  letter-spacing:2px;
}

#clock-date{
  display:block;
  margin-top:7px;
  color:var(--w55);
  font-size:16px;
  letter-spacing:4px;
  text-transform:uppercase;
}

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
#sidebar{
  position:absolute;
  top:84px;left:0;bottom:56px;
  display:flex;
  flex-direction:column;
  width:460px;
  padding:24px var(--sx) 20px;
  z-index:10;
}

#widget-container{
  flex:1;
  display:flex;
  flex-direction:column;
  transition:opacity .38s ease, transform .38s ease;
}

/* ══════════════════════════════════════
   WIDGETS — base
══════════════════════════════════════ */
.widget {
    display: flex;
    flex: 1;
    flex-direction: column;
    animation: widgetIntro 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.widget > * {
    animation: widgetContentFade 0.3s ease both;
    animation-delay: 0.28s;
    opacity: 0;
    animation-fill-mode: both;
}

.widget.outro {
    animation: widgetOutro 0.28s ease-in both;
}

/* ══════════════════════════════════════
   TICKER
══════════════════════════════════════ */
footer{
  position:absolute;
  bottom:0;left:0;right:0;
  display:flex;
  align-items:stretch;
  height:56px;
  overflow:hidden;
  z-index:10;
  background:rgba(11,10,9,0.92);
  border-top:1px solid var(--border);
}

#ticker-tag {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 0 40px 0 20px;
    
    /* Forzamos el uso de la variable dinámica */
    background-color: var(--accent) !important; 
    
    color: var(--black);
    font-family: var(--f-display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 50%, calc(100% - 20px) 100%, 0 100%);
    will-change: background-color;
}

#ticker-wrap{
  display:flex;
  align-items:center;
  flex:1;
  overflow:hidden;
  padding-left:32px;
}

#ticker-track{
  display:flex;
  align-items:center;
  white-space:nowrap;
  will-change:transform;
  animation:tick 70s linear infinite;
}

.ticker-item{color:var(--w80);font-size:26px;font-weight:500}
.ticker-sep{margin:0 26px;color:var(--amber);font-size:16px;opacity:.6}

/* ── SEMÁFOROS DE ESTADO ── */
.heartbeat-active {
  background-color:var(--amber) !important;
  animation:poly-pulse 2s infinite ease-in-out;
}

.morse-running {
  animation:none !important;
  transition:none !important;
}

/* Elimina por completo los controles nativos del sistema en Android/Tanix */
video::-webkit-media-controls {
    display: none !important;
}
video::-webkit-media-controls-enclosure {
    display: none !important;
}
video::-webkit-media-controls-panel {
    display: none !important;
}
video::-webkit-media-controls-start-playback-button {
    display: none !important;
}

/* ══════════════════════════════════════
   ANIMACIONES
══════════════════════════════════════ */
@keyframes tick{
  to{transform:translateX(-50%)}
}

@keyframes blink{
  0%,100%{opacity:1}
  50%{opacity:.25}
}

@keyframes fadeIn{
  from{opacity:0;transform:scale(.9)}
  to{opacity:1;transform:scale(1)}
}

@keyframes pulse-live{
  0%  {transform:scale(.95);box-shadow:0 0 0 0    rgba(255,140,0,0.7)}
  70% {transform:scale(1);   box-shadow:0 0 0 10px rgba(255,140,0,0)}
  100%{transform:scale(.95);box-shadow:0 0 0 0    rgba(255,140,0,0)}
}

@keyframes poly-pulse {
  0%, 100%{filter:brightness(1)}
  50%     {filter:brightness(1.2)}
}

/* Animación de Entrada (Intro) */
@keyframes broadcastIntro {
    0% {
        transform: translateX(100px) scale(0.95);
        opacity: 0;
    }
    70% {
        transform: translateX(-5px) scale(1.01);
        opacity: 1;
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

/* ── Keyframes ─────────────────────────────────────────── */
@keyframes widgetIntro {
    0%   { clip-path: inset(0 0 100% 0); opacity: 1; }
    100% { clip-path: inset(0 0 0% 0);   opacity: 1; }
}

@keyframes widgetContentFade {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0);   }
}

@keyframes widgetOutro {
    from { clip-path: inset(0 0 0% 0);   opacity: 1; }
    to   { clip-path: inset(0 0 100% 0); opacity: 0; }
}