/* ===================================================
   RESET Y VARIABLES BASE
   =================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Montserrat', sans-serif; }

body {
    background-color: var(--bg-deep);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        linear-gradient(rgba(5, 7, 10, 0.9), rgba(5, 7, 10, 0.95)),
        url('https://images.unsplash.com/photo-1518605368461-1e1e38ce8058?ixlib=rb-4.0.3&auto=format&fit=crop&w=2000&q=80');
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
}

/* ===================================================
   HERO SECTION & TIRANTES
   =================================================== */
.hero-section {
    width: 100vw; height: 50vh; min-height: 400px;
    background-image: url('https://images.unsplash.com/photo-1522778119026-d647f0596c20?ixlib=rb-4.0.3&auto=format&fit=crop&w=2000&q=80');
    background-size: cover; background-position: center;
    position: relative; display: flex; align-items: flex-end; padding: 50px 5%;
}
.hero-section::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
}
.hero-content {
    position: relative; z-index: 2; background: #ffffff; padding: 30px;
    max-width: 450px; border-left: 8px solid var(--client-secondary);
    clip-path: polygon(0 0, 100% 0, 100% 90%, 90% 100%, 0 100%);
}
.hero-brand { font-size: 12px; font-weight: 900; color: #000; letter-spacing: 2px; }
.hero-title { font-size: 32px; font-weight: 900; font-style: italic; color: #000; line-height: 1.1; margin-bottom: 15px; }
.hero-desc { font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600; color: #333; margin-bottom: 20px; }
.hero-btn { background: #000; color: #fff; padding: 12px 24px; font-weight: 900; cursor: pointer; border: none; clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%); }

.tirantes-container { display: flex; justify-content: center; gap: 20px; max-width: 900px; margin: -40px auto 0; position: relative; z-index: 5; }
.tirante {
    flex: 1; background: #11141a; border: 2px solid rgba(255,255,255,0.1); border-top: none;
    padding: 30px 15px 50px; text-align: center;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 25px), 50% 100%, 0 calc(100% - 25px));
}
.tirante:nth-child(1) { border-bottom-color: var(--client-primary); }
.tirante:nth-child(2) { border-bottom-color: var(--client-secondary); margin-top: 15px; }
.tirante:nth-child(3) { border-bottom-color: var(--client-tertiary); }
.tirante-icon { font-size: 30px; margin-bottom: 10px; }
.tirante-title { font-weight: 900; font-size: 11px; color: #fff; }

/* ===================================================
   CINTA SUPERIOR ENDEREZADA
   =================================================== */
.ribbon-wrapper {
    width: 100vw; height: 60px; margin: 40px 0; background: #000; display: flex; align-items: center; overflow: hidden;
    border-top: 1px solid rgba(255,255,255,0.1); border-bottom: 1px solid rgba(255,255,255,0.1);
}
.marquee { display: flex; width: 200vw; animation: marquee-scroll 20s linear infinite; }
.marquee-content { flex: 0 0 100vw; display: flex; justify-content: space-around; align-items: center; background: linear-gradient(90deg, #05070a 0%, #0a1118 50%, #05070a 100%); }
.ribbon-text-arg { color: #75b2dd; font-weight: 900; font-size: 16px; letter-spacing: 4px; white-space: nowrap; }
.ribbon-star { color: var(--client-primary); margin: 0 15px; font-size: 12px; }
@keyframes marquee-scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-100vw); } }

/* ===================================================
   TÍTULOS Y LAYOUT
   =================================================== */
.section-main-title { text-align: center; margin-bottom: 30px; padding-bottom: 10px; }
.section-main-title h2 { font-size: 28px; font-weight: 900; font-style: italic; color: #ffffff; text-shadow: 0 0 15px rgba(255, 255, 255, 0.4); letter-spacing: 1px; }

.app-wrapper {
    position: relative; z-index: 10; max-width: 1200px; margin: 0 auto; padding: 0 20px 100px;
    display: grid; grid-template-columns: 1fr 320px; gap: 40px; align-items: start;
}
.feed-header { background: rgba(255, 255, 255, 0.02); padding: 20px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); border-left: 4px solid var(--client-primary); margin-bottom: 30px; }
.feed-title { font-size: 16px; font-weight: 900; font-style: italic; }
.feed-desc { font-size: 12px; color: #888; margin-top: 5px; }

/* ===================================================
   PESTAÑAS DE TIEMPO
   =================================================== */
.time-tabs-container { display: flex; justify-content: center; gap: 15px; margin-bottom: 30px; }
.time-tab { 
    background: rgba(10, 15, 20, 0.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2); border-radius: 30px; 
    color: #fff; padding: 10px 20px; font-size: 12px; font-weight: 900; cursor: pointer; transition: 0.3s; 
}
.time-tab:hover { background: rgba(255,255,255,0.1); }
.active-tab { background: rgba(255, 69, 0, 0.2); border-color: #ff4500; color: #ff4500; box-shadow: 0 0 15px rgba(255,69,0,0.4); }

/* ===================================================
   TARJETA HUD: GLASSMORPHISM TOTAL
   =================================================== */
.hud-wrapper { display: flex; align-items: stretch; max-width: 600px; margin-bottom: 40px; }
.floating-glass .hud-main {
    flex: 1; position: relative;
    background: rgba(255, 255, 255, 0.02) !important;
    backdrop-filter: blur(30px) !important; -webkit-backdrop-filter: blur(30px) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    border-radius: 16px 16px 0 0 !important;
    padding: 20px;
    box-shadow: 0 30px 60px rgba(0, 212, 255, 0.15), 0 10px 20px rgba(0, 212, 255, 0.1), inset 0 0 20px rgba(255, 255, 255, 0.05) !important;
    transform: translateY(-5px); transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.floating-glass .hud-main:hover {
    transform: translateY(-10px);
    box-shadow: 0 40px 80px rgba(0, 212, 255, 0.25), inset 0 0 20px rgba(255, 255, 255, 0.1) !important;
}

/* Modo Fuego (Sobrescribe borde) */
.fire-mode .hud-main { border-color: rgba(255, 69, 0, 0.8) !important; box-shadow: 0 30px 60px rgba(255, 69, 0, 0.15), inset 0 0 30px rgba(255, 69, 0, 0.1) !important; }

/* Cabecera y Reloj */
.countdown-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 15px; margin-bottom: 20px; }
.kickoff-time { font-family: 'Inter', sans-serif; font-weight: 900; font-size: 13px; color: #fff; letter-spacing: 1px; }
.hud-pill { padding: 4px 12px; border-radius: 4px; font-size: 11px; font-weight: 900; letter-spacing: 1px; }
.pulse-red { background: rgba(255, 0, 85, 0.1); color: #ff0055; border: 1px solid rgba(255, 0, 85, 0.5); font-size: 13px; animation: pulse-glow 2s infinite; }
@keyframes pulse-glow { 0% { box-shadow: 0 0 0 0 rgba(255, 0, 85, 0.4); } 70% { box-shadow: 0 0 10px 10px rgba(255, 0, 85, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 0, 85, 0); } }

/* Arena y Banderas */
.hud-arena { display: flex; justify-content: space-between; align-items: center; padding: 10px 0 30px; }
.team-col { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 30%; }
.diamond-flag { width: 80px; height: 80px; transform: rotate(45deg); border: 3px solid rgba(255,255,255,0.2); border-radius: 12px; overflow: hidden; position: relative; background: #000; }
.diamond-flag img { width: 150%; height: 150%; object-fit: cover; transform: rotate(-45deg) scale(1.2); position: absolute; top: -25%; left: -25%; }
.arg .diamond-flag { border-color: rgba(0, 212, 255, 0.8); box-shadow: 0 0 20px rgba(0, 212, 255, 0.5); }
.bra .diamond-flag { border-color: rgba(0, 255, 136, 0.8); box-shadow: 0 0 20px rgba(0, 255, 136, 0.5); }
.team-name { font-size: 22px; font-weight: 900; text-shadow: 0 0 10px rgba(255,255,255,0.5); }

/* Controles de Goles y Dados */
.score-center-panel { display: flex; align-items: center; gap: 10px; }
.score-controls { display: flex; flex-direction: column; gap: 5px; align-items: center; }
.ctrl-btn { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.3); color: #fff; border-radius: 6px; width: 40px; height: 30px; cursor: pointer; font-size: 14px; transition: 0.2s; }
.ctrl-btn:hover { background: #fff; color: #000; transform: scale(1.1); box-shadow: 0 0 10px #fff; }
.ctrl-btn:active { transform: scale(0.9); }
.vs-col { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.vs-badge { font-size: 18px; font-weight: 900; font-style: italic; color: rgba(255,255,255,0.4); text-shadow: 0 0 15px rgba(0,212,255,0.6); }
.dice-btn { background: transparent; border: none; color: var(--client-secondary); font-size: 24px; cursor: pointer; transition: 0.3s; filter: drop-shadow(0 0 5px var(--client-secondary)); }
.dice-btn:hover { transform: rotate(180deg) scale(1.2); filter: drop-shadow(0 0 15px var(--client-secondary)); }

.score-input {
    width: 70px; height: 90px; font-size: 50px; text-align: center;
    background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 12px;
    color: #fff; font-family: 'Courier New', Courier, monospace; box-shadow: inset 0 10px 20px rgba(0,0,0,0.8);
}
.score-input::-webkit-outer-spin-button, .score-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.score-input[type=number] { -moz-appearance: textfield; }

/* ===================================================
   VALLA LED VERTICAL (BASE DE TARJETA)
   =================================================== */
.led-board-link { text-decoration: none; display: block; margin: 20px -20px -20px -20px; border-radius: 0 0 14px 14px; }
.led-board-link:hover { opacity: 0.9; }
.led-board {
    background: #020202; border-top: 2px solid rgba(255,255,255,0.1); height: 60px;
    overflow: hidden; display: flex; align-items: center; justify-content: center; position: relative; border-radius: 0 0 14px 14px;
}
.led-board::after { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-image: radial-gradient(rgba(0,0,0,0.4) 1px, transparent 1px); background-size: 3px 3px; pointer-events: none; z-index: 2; }
.led-text-vertical { display: flex; flex-direction: column; animation: roll-up 6s ease-in-out infinite; color: var(--client-primary); font-family: 'Courier New', Courier, monospace; font-size: 20px; font-weight: 900; text-shadow: 0 0 3px var(--client-primary); z-index: 1; position: absolute; top: 0; }
.led-text-vertical span { height: 60px; display: flex; align-items: center; justify-content: center; width: 100%; white-space: nowrap; }
@keyframes roll-up { 0%, 45% { transform: translateY(0); } 50%, 95% { transform: translateY(-60px); } 100% { transform: translateY(-120px); } }

/* ===================================================
   SIDEBAR ICONS
   =================================================== */
.hud-sidebar {
    width: 60px; background: rgba(10, 15, 20, 0.6); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.2); border-left: none; border-radius: 0 16px 16px 0;
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 25px; padding: 20px 0;
    margin-top: 20px; margin-bottom: 20px; box-shadow: inset -5px 0 15px rgba(0, 212, 255, 0.1);
}
.icon-pure { color: #ffffff; font-size: 24px; text-decoration: none; opacity: 0.8; transition: 0.3s; filter: drop-shadow(0 0 5px rgba(255,255,255,0.3)); }
.icon-pure:hover { opacity: 1; transform: scale(1.2); filter: drop-shadow(0 0 15px #ffffff); }

/* ===================================================
   VALLA PUBLICITARIA 100% ANCHO (SLIDER VERTICAL)
   =================================================== */
.stadium-billboard-wrapper {
    width: 100vw;
    margin: 40px 0 60px;
    background: #000;
    /* Fuerza el ancho total rompiendo márgenes del navegador */
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.stadium-billboard {
    width: 100%;
    height: 180px; /* Alto imponente */
    position: relative;
    overflow: hidden;
    border-top: 2px solid var(--client-primary);
    border-bottom: 2px solid var(--client-primary);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), inset 0 0 40px rgba(0,0,0,0.9);
}

.billboard-slider {
    display: flex;
    flex-direction: column;
    height: 300%; /* 3 imágenes al 100% cada una */
    /* Animación de 12 segundos con aceleración curva para frenar suave en cada foto */
    animation: vertical-slide 15s cubic-bezier(0.8, 0, 0.2, 1) infinite;
}

.billboard-slider img {
    width: 100%;
    height: 180px; /* Igual al alto del contenedor */
    object-fit: cover;
    filter: contrast(1.2) brightness(0.8); /* Look Dark Mode */
}

.billboard-led-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(rgba(0,0,0,0.4) 1px, transparent 1px);
    background-size: 3px 3px;
    pointer-events: none;
    box-shadow: inset 0 0 80px rgba(0,0,0,1);
}

@keyframes vertical-slide {
    0%, 25% { transform: translateY(0); } /* Pausa foto 1 */
    33%, 58% { transform: translateY(-180px); } /* Pausa foto 2 */
    66%, 91% { transform: translateY(-360px); } /* Pausa foto 3 */
    100% { transform: translateY(0); } /* Vuelve rápido a foto 1 */
}

/* ===================================================
   ZONA DEL BRACKET CENTRADA
   =================================================== */
.bracket-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 100px;
}

/* ===================================================
   BRACKET / LLAVES DE ELIMINACIÓN
   =================================================== */
.bracket-section { margin-top: 40px; }
.bracket-container { display: flex; align-items: center; padding: 30px 20px; gap: 15px; overflow-x: auto; background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 16px; backdrop-filter: blur(20px); }
.bracket-round { display: flex; flex-direction: column; gap: 30px; flex: 1; min-width: 200px; }
.b-match { background: rgba(0, 0, 0, 0.8); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 8px; overflow: hidden; box-shadow: inset 0 0 10px rgba(0,0,0,0.9); cursor: pointer; transition: 0.3s; }
.b-match:hover { border-color: var(--client-primary); box-shadow: 0 0 15px rgba(0,255,136,0.3); transform: scale(1.02); }
.b-team { padding: 10px 12px; display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 800; border-bottom: 1px solid rgba(255, 255, 255, 0.05); color: #888; transition: 0.3s; }
.b-team:last-child { border-bottom: none; }
.b-team img { width: 20px; border-radius: 2px; }
.b-team.winner { background: rgba(0, 255, 136, 0.1); color: #fff; border-left: 3px solid var(--client-primary); }
.b-team.empty { border-left: 3px dashed rgba(255,255,255,0.2); font-style: italic; }
.bracket-connector { display: flex; flex-direction: column; justify-content: center; height: 110px; width: 20px; position: relative; }
.line { width: 100%; border-right: 2px solid rgba(0, 212, 255, 0.4); box-shadow: 2px 0 5px rgba(0, 212, 255, 0.2); }
.top-line { height: 50%; border-top: 2px solid rgba(0, 212, 255, 0.4); border-top-right-radius: 4px; }
.bottom-line { height: 50%; border-bottom: 2px solid rgba(0, 212, 255, 0.4); border-bottom-right-radius: 4px; }

/* ===================================================
   RANKING
   =================================================== */
.ranking-panel { background: rgba(13, 15, 20, 0.9); border: 1px solid #222; border-radius: 12px; padding: 20px; position: sticky; top: 20px; }
.rank-header { font-size: 14px; font-weight: 900; color: var(--text-dim); border-bottom: 1px solid #222; padding-bottom: 15px; margin-bottom: 15px; }
.rank-row { display: flex; align-items: center; padding: 12px 0; border-bottom: 1px solid #1a1c23; }
.rank-row:last-child { border-bottom: none; }
.pos-num { font-weight: 900; width: 30px; color: #444; }
.rank-name { flex: 1; font-size: 13px; font-weight: 600; color: #ddd; }
.rank-pts { font-weight: 900; color: var(--client-primary); font-size: 13px; }
.rank-trend { margin: 0 10px; font-size: 14px; }
.trend-up { color: #00ff88; filter: drop-shadow(0 0 5px rgba(0,255,136,0.4)); }
.trend-down { color: #ff3366; filter: drop-shadow(0 0 5px rgba(255,51,102,0.4)); }

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 900px) {
    .app-wrapper { grid-template-columns: 1fr; }
    .hud-wrapper { flex-direction: column; }
    .hud-sidebar { width: 100%; height: auto; flex-direction: row; border-radius: 0 0 16px 16px; border: 2px solid rgba(255,255,255,0.2); border-top: none; margin: 0; padding: 15px 0; }
}
/* ===================================================
   INTERACCIÓN DRAG & DROP (BRACKET)
   =================================================== */
.draggable { cursor: grab; }
.draggable:active { cursor: grabbing; }

/* Efecto cuando levantás la bandera */
.dragging { 
    opacity: 0.5; 
    transform: scale(0.95); 
    border: 1px dashed var(--client-primary) !important; 
}

/* Efecto de la caja vacía */
.empty-text { 
    border-left: 3px dashed rgba(255,255,255,0.2); 
    font-style: italic; 
    padding-left: 10px; 
    width: 100%; 
    display: block; 
    color: #666; 
}

/* Cuando pasás la bandera por encima de una zona permitida */
.drop-zone { transition: 0.3s; position: relative; overflow: hidden; }
.drop-zone.drag-over { 
    background: rgba(0, 255, 136, 0.2); 
    border-left: 3px solid var(--client-primary); 
    box-shadow: inset 0 0 15px rgba(0, 255, 136, 0.4); 
}

/* Chispa Verde al soltar con éxito */
.drop-success { 
    animation: flash-green 0.5s ease-out; 
    border-left: 3px solid var(--client-primary) !important; 
    background: rgba(0, 255, 136, 0.1) !important; 
    color: #fff !important; 
}

@keyframes flash-green {
    0% { box-shadow: inset 0 0 0 rgba(0, 255, 136, 0); background: rgba(0,0,0,0.8); }
    50% { box-shadow: inset 0 0 30px rgba(0, 255, 136, 0.8); background: rgba(0, 255, 136, 0.4); }
    100% { box-shadow: inset 0 0 0 rgba(0, 255, 136, 0); background: rgba(0, 255, 136, 0.1); }
}
/* ===================================================
   DESHACER SELECCIÓN (CLICK PARA BORRAR)
   =================================================== */
.drop-zone.winner {
    cursor: pointer;
    position: relative;
    transition: 0.2s;
}

/* Efecto visual al pasar el mouse por un equipo ya soltado */
.drop-zone.winner:hover {
    border-left: 3px solid #ff3366 !important;
    background: rgba(255, 51, 102, 0.1) !important;
    color: #ccc !important;
}

/* Agrega una crucecita roja (X) a la derecha */
.drop-zone.winner:hover::after {
    content: '✖';
    position: absolute;
    right: 15px;
    color: #ff3366;
    font-weight: 900;
    font-size: 14px;
    animation: pop-in 0.2s ease-out;
}

@keyframes pop-in {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}