:root {
    --bg-dark: #0f172a;
    --gold: #D4AF37;
    --gold-dim: #b5952f;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --red-live: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-dark);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background setup */
.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: url('bg.png') no-repeat center center/cover;
    z-index: -2;
}

.bg-overlay::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, transparent 0%, var(--bg-dark) 100%), 
                rgba(15, 23, 42, 0.85);
    z-index: -1;
}

/* Glassmorphism panel utility */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

h1, h2, h3, h4 {
    font-family: 'Cinzel', serif;
}

.gold-text {
    color: var(--gold);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

/* Header */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background: linear-gradient(to bottom, rgba(15,23,42,0.95), transparent);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.school-logo {
    height: 60px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 5px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.school-name {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

nav a {
    color: var(--text-main);
    text-decoration: none;
    margin-left: 2rem;
    font-weight: 300;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 2px;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--gold);
}

/* Main Layout */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 5%;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    margin-bottom: 4rem;
    animation: fadeIn 1s ease-out;
}

.glow-text {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    color: var(--gold);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5), 0 0 40px rgba(212, 175, 55, 0.2);
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

/* Countdown */
.countdown-container h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    letter-spacing: 2px;
}

.countdown {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

.time-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    min-width: 100px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    transition: transform 0.3s;
}

.time-box:hover {
    transform: translateY(-5px);
    border-color: var(--gold);
}

.time-box span {
    font-family: 'Outfit', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
}

.time-box.highlight {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--gold-dim);
}

.time-box.highlight span {
    color: var(--gold);
}

.time-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.colon {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-muted);
    animation: blink 1.5s infinite;
}

/* Live Section */
.live-section {
    margin-bottom: 4rem;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

@media (max-width: 820px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.live-dot {
    width: 15px;
    height: 15px;
    background-color: var(--red-live);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--red-live);
    animation: pulse 1.5s infinite;
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tab-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 1rem 2rem;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
    background: var(--gold);
    color: var(--bg-dark);
    border-color: var(--gold);
    font-weight: 700;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

.tab-content {
    display: none;
    padding: 2rem;
    animation: fadeIn 0.5s ease-out;
}

.tab-content.active {
    display: block;
}

.tab-content h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.video-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--glass-border);
}

.border-gold {
    border: 2px solid var(--gold);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.2);
}

.placeholder-video {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(45deg, #0f172a, #1e293b);
}

.placeholder-content {
    text-align: center;
}

.video-logo {
    width: 80px;
    opacity: 0.5;
    margin-bottom: 1rem;
}

.placeholder-content p {
    font-size: 1.2rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.placeholder-content span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Brackets Section */
.brackets-section {
    padding: 3rem;
    margin-bottom: 4rem;
}

.brackets-section h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2rem;
    color: var(--gold);
}

.bracket-container {
    display: flex;
    justify-content: space-around;
    align-items: stretch;
}

.bracket-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    width: 30%;
}

.bracket-column h4 {
    text-align: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

.matchup {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.8rem 0.4rem;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    text-align: center;
    gap: 0.2rem;
    transition: transform 0.2s, border-color 0.2s;
}

.matchup:hover {
    transform: scale(1.15);
    border-color: var(--gold);
    z-index: 50;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 175, 55, 0.3);
}

.gold-match {
    border: 1px solid var(--gold);
    background: rgba(212, 175, 55, 0.1);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}

.mt-large {
    margin: 3rem 0;
}

.mt-xl {
    margin: 7rem 0;
}

.p1, .p2 {
    font-weight: 600;
}

.player {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 45%;
}

.player-img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 6px;
    border: 2px solid var(--gold-dim);
    background-color: var(--glass-border);
    transition: transform 0.3s ease;
}

.player-img:hover {
    transform: scale(1.1);
}

.face-left {
    transform: scaleX(-1);
}

.face-left:hover {
    transform: scaleX(-1) scale(1.1);
}

.name {
    font-size: 0.8rem;
    line-height: 1.2;
    color: var(--text-main);
}

.eliminated {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.eliminated .player-img {
    filter: grayscale(1) brightness(0.5) contrast(1.2);
    opacity: 0.6;
    border-color: #ff0000;
}

.eliminated::after, .eliminated::before {
    content: '';
    position: absolute;
    top: 22px; /* Centro de la imagen de 45px */
    left: 50%;
    width: 55px;
    height: 5px;
    background-color: #ff3333;
    z-index: 20;
    pointer-events: none;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.eliminated::after {
    transform: translate(-50%, -50%) rotate(45deg);
}

.eliminated::before {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.eliminated .name {
    opacity: 0.5;
    text-decoration: line-through;
}

.vs {
    font-size: 0.8rem;
    color: var(--gold);
    font-family: 'Cinzel', serif;
    font-style: italic;
}

/* Educational Section */
.edu-section {
    margin-bottom: 4rem;
}

.edu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.edu-card {
    padding: 2.5rem;
    text-align: center;
    transition: transform 0.3s;
}

.edu-card:hover {
    transform: translateY(-10px);
}

.edu-card .icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.edu-card h3 {
    margin-bottom: 1rem;
    color: var(--gold);
}

.edu-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
    background: rgba(0,0,0,0.5);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.live-card-highlight {
    border: 2px solid var(--gold) !important;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3) !important;
    position: relative;
    overflow: hidden;
}

.live-card-highlight::before {
    content: 'HOY';
    position: absolute;
    top: 10px;
    right: -30px;
    background: var(--gold);
    color: var(--bg-dark);
    padding: 5px 40px;
    transform: rotate(45deg);
    font-size: 0.7rem;
    font-weight: 800;
    z-index: 10;
}

/* Street Fighter VS and Lightning Styles */
.sf-vs {
    text-shadow: 
        0 0 2px #fff,
        0 0 10px #ffeb3b,
        0 0 20px #ff9800,
        0 0 30px #f44336;
    animation: vs-pulse 0.5s infinite alternate;
}

@keyframes vs-pulse {
    0% { transform: scale(1); text-shadow: 0 0 2px #fff, 0 0 10px #ffeb3b, 0 0 20px #ff9800; }
    100% { transform: scale(1.3); text-shadow: 0 0 5px #fff, 0 0 15px #ffeb3b, 0 0 30px #ff9800, 0 0 40px #f44336; }
}

.lightning-fx {
    position: relative;
    overflow: visible;
}

.lightning-fx::before {
    content: '';
    position: absolute;
    top: -3px; left: -3px; right: -3px; bottom: -3px;
    border-radius: 12px;
    background: transparent;
    z-index: -1;
    pointer-events: none;
    animation: sf-lightning-box 3s infinite;
}

@keyframes sf-lightning-box {
    0%, 94%, 100% { box-shadow: 0 0 0 transparent; border: 1px solid transparent; }
    95% { box-shadow: 0 0 15px #fff, 0 0 30px #0ff, inset 0 0 15px #0ff; border: 1px solid #fff; background: rgba(0, 255, 255, 0.1); }
    96% { box-shadow: 0 0 0 transparent; border: 1px solid transparent; background: transparent; }
    97% { box-shadow: 0 0 15px #fff, 0 0 30px #0ff, inset 0 0 15px #0ff; border: 1px solid #fff; background: rgba(0, 255, 255, 0.2); }
    98% { box-shadow: 0 0 0 transparent; border: 1px solid transparent; background: transparent; }
}

.lightning-fx::after {
    content: '⚡';
    position: absolute;
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 0 0 15px #0ff, 0 0 30px #0ff;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    pointer-events: none;
    animation: zap-strike 3s infinite;
    z-index: 10;
}

@keyframes zap-strike {
    0%, 93%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(0) rotate(0deg); }
    95% { opacity: 1; transform: translate(-50%, -50%) scale(1.5) rotate(15deg); }
    96% { opacity: 0; transform: translate(-50%, -50%) scale(0) rotate(0deg); }
    97% { opacity: 1; transform: translate(-50%, -50%) scale(2) rotate(-15deg); }
    98% { opacity: 0; transform: translate(-50%, -50%) scale(0) rotate(0deg); }
}

/* Music Control Styles */
.music-control {
    margin-left: 1.5rem;
}

.music-btn {
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid var(--gold);
    color: var(--gold);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.music-btn:hover {
    background: var(--gold);
    color: var(--bg-dark);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

.music-btn.playing {
    animation: pulse-music 2s infinite;
}

@keyframes pulse-music {
    0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(212, 175, 55, 0); }
    100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

/* ==========================================================================
   DISEÑO ADAPTATIVO (RESPONSIVE) - CORRECCIÓN TOTAL
   ========================================================================== */

/* TABLETS Y SCREENS HASTA 1024px */
@media (max-width: 1024px) {
    .bracket-column { width: 33%; gap: 1.5rem; }
    .hero { padding: 3rem 1.5rem; }
    .countdown { gap: 1rem; }
}

/* MÓVILES Y TABLETS PEQUEÑAS (Breakpoint Crítico) */
@media (max-width: 820px) {
    .navbar {
        flex-direction: column;
        padding: 1rem 5%;
        gap: 15px;
    }

    .school-name { font-size: 1.1rem; }
    
    nav {
        display: flex;
        justify-content: center;
        width: 100%;
        flex-wrap: wrap;
        gap: 10px;
    }

    nav a {
        margin: 0;
        font-size: 0.8rem;
        letter-spacing: 1px;
    }

    .music-control { margin-left: 0; position: absolute; top: 1rem; right: 1rem; }

    /* Brackets Vertical Stacking */
    .bracket-container {
        flex-direction: column;
        align-items: center;
        gap: 3.5rem;
    }

    .bracket-column {
        width: 100%;
        max-width: 450px;
        gap: 1.5rem;
    }

    .bracket-column h4 {
        margin-bottom: 1.5rem;
        font-size: 1.4rem;
        color: var(--gold);
        border-bottom: 2px solid var(--gold-dim);
    }

    .mt-large, .mt-xl { margin: 0; }
    
    .matchup {
        padding: 1rem 0.5rem;
    }

    .player-img {
        width: 40px;
        height: 40px;
    }

    .name { font-size: 0.75rem; }

    /* Forms wrap */
    .countdown {
        flex-wrap: wrap;
        gap: 0.8rem;
    }

    .time-box {
        min-width: 80px;
        padding: 1rem 0.5rem;
    }

    .time-box span { font-size: 2rem; }

    /* Tabs scroll */
    .tabs {
        overflow-x: auto;
        justify-content: flex-start;
        padding: 10px 0;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-btn {
        flex-shrink: 0;
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* SMARTPHONES PEQUEÑOS */
@media (max-width: 480px) {
    .school-logo { height: 45px; }
    .school-name { font-size: 0.95rem; }
    .glow-text { font-size: 2.2rem; }
    
    .navbar { padding: 1rem 2%; }
    
    .brackets-section { padding: 1.5rem 1rem; }

    .matchup {
        gap: 0.2rem;
    }
    
    .vs { font-size: 0.7rem; }
    
    .matchup:hover {
        transform: scale(1.05); /* Zoom reducido en móvil para evitar tapado */
    }

    .edu-grid { grid-template-columns: 1fr; }
}

/* Evitar scroll horizontal global */
body {
    width: 100%;
    overflow-x: hidden;
}

main {
    overflow-x: hidden;
}
