:root {
            --bg-color: #0b0b10;
            --card-bg: #161620;
            --text-main: #ffffff;
            --text-muted: #9ba1a6;
            --accent: #f83350;
            --accent-hover: #ff526b;
            --border: #2c2d3e;
            --line-color: #4a4b62;
            --input-bg: #212130;
            --input-border: #383a50;
            --gold: #f1c40f;
            --brand: #a87ffb;
        }

        html, body {
            overflow-x: hidden;
        }

        body {
            margin: 0;
            padding: 0;
            background-color: var(--bg-color);
            color: var(--text-main);
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
        }

        /* Etiqueta clickeable de Consultora Luz */
        /* Etiqueta clickeable de Consultora Luz */
        .sponsor-badge {
            background: rgba(168, 127, 251, 0.1);
            border: 1px solid rgba(168, 127, 251, 0.3);
            color: var(--brand);
            padding: 8px 14px;
            border-radius: 20px;
            font-size: 0.8rem;
            font-weight: 700;
            letter-spacing: 0.5px;
            text-decoration: none;
            transition: all 0.2s ease-in-out;
            box-shadow: 0 4px 10px rgba(168, 127, 251, 0.1);
        }

        .sponsor-badge:hover {
            background: rgba(168, 127, 251, 0.2);
            transform: scale(1.05) translateY(-2px);
            box-shadow: 0 6px 15px rgba(168, 127, 251, 0.2);
            color: #bfa1fc;
        }

        header {
            position: relative;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px 40px;
            background: linear-gradient(180deg, #13131c 0%, var(--bg-color) 100%);
            border-bottom: 1px solid var(--border);
            gap: 20px;
        }

        .header-left {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .header-right {
            display: flex;
            align-items: center;
            gap: 25px;
        }

        h1 {
            margin: 0;
            font-size: 1.6rem;
            letter-spacing: 1px;
            text-transform: uppercase;
            font-weight: 900;
        }

        .subtitle {
            color: var(--text-muted);
            font-size: 0.95rem;
            margin-top: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-wrap: wrap;
            gap: 10px;
        }

        /* Estilo del selector de zona horaria */
        .tz-selector {
            background-color: rgba(255, 255, 255, 0.08);
            color: var(--gold);
            border: 1px solid var(--gold);
            border-radius: 6px;
            padding: 6px 10px;
            font-size: 0.95rem;
            font-weight: bold;
            font-family: inherit;
            cursor: pointer;
            outline: none;
            transition: background 0.2s;
        }

        .tz-selector:hover {
            background-color: rgba(255, 255, 255, 0.15);
        }

        .tz-selector:focus {
            box-shadow: 0 0 0 2px rgba(241, 196, 15, 0.3);
        }

        .mobile-hint {
            display: none;
            margin-top: 15px;
            padding: 8px 16px;
            background: rgba(255,255,255,0.05);
            border-radius: 20px;
            font-size: 0.85rem;
            color: var(--text-main);
        }

        .controls {
            margin-top: 0;
            display: flex;
            justify-content: center;
            gap: 15px;
        }

        button.btn-clear {
            background-color: var(--accent);
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 600;
            font-size: 0.95rem;
            transition: all 0.2s;
            box-shadow: 0 4px 12px rgba(248, 51, 80, 0.25);
        }

        button.btn-clear:hover {
            background-color: var(--accent-hover);
            transform: translateY(-2px);
        }

        button.btn-clear.confirming {
            background-color: #e67e22;
            box-shadow: 0 4px 12px rgba(230, 126, 34, 0.25);
        }

        .btn-toggle-view {
            display: none;
            background-color: #3b3c54;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 600;
            font-size: 0.95rem;
            transition: all 0.2s;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
        }

        .btn-toggle-view:hover {
            background-color: #4a4b62;
            transform: translateY(-2px);
        }

        .board-wrapper {
            width: 100%;
            overflow-x: auto;
            overflow-y: hidden;
            -webkit-overflow-scrolling: touch;
            padding: 40px 20px;
            box-sizing: border-box;
            cursor: grab;
            display: flex;
            justify-content: center;
            align-items: flex-start;
        }

        .board-wrapper:active {
            cursor: grabbing;
        }

        .bracket-container {
            position: relative;
            display: flex;
            justify-content: space-between;
            align-items: stretch;
            width: max-content;
            min-width: 1850px;
            gap: 60px;
            margin: 0 auto;
            transform-origin: top center;
        }

        #lines-svg {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 1;
        }

        .column {
            display: flex;
            flex-direction: column;
            justify-content: space-around;
            width: 255px;
            position: relative;
            z-index: 2;
        }

        .column.center {
            width: 280px;
            align-items: center;
            justify-content: center;
        }

        .match-card {
            background-color: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 14px;
            margin: 10px 0;
            box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
            position: relative;
            transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, border-color 0.3s ease;
        }

        .match-card:hover {
            transform: translateY(-4px) scale(1.02);
            box-shadow: 0 15px 30px rgba(168, 127, 251, 0.15), 0 0 15px rgba(168, 127, 251, 0.05);
            border-color: rgba(168, 127, 251, 0.3);
            z-index: 10;
        }

        .match-card.final {
            border: 2px solid var(--gold);
            background: linear-gradient(135deg, #2a2510 0%, var(--card-bg) 100%);
            box-shadow: 0 0 25px rgba(241, 196, 15, 0.15);
        }

        .match-header {
            font-size: 0.72rem;
            color: var(--text-muted);
            margin-bottom: 12px;
            text-align: center;
            border-bottom: 1px solid var(--border);
            padding-bottom: 8px;
            line-height: 1.4;
            position: relative;
        }

        .reset-match-btn {
            position: absolute;
            right: -5px;
            top: -5px;
            background: transparent;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            font-size: 1.1rem;
            opacity: 0.5;
            transition: all 0.2s;
            padding: 5px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .reset-match-btn:hover {
            color: var(--accent);
            opacity: 1;
            transform: rotate(-45deg);
        }
        
        .match-date {
            font-weight: 700;
            color: #d1d4d6;
            display: block;
            margin-bottom: 2px;
        }

        .team-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin: 10px 0;
            gap: 8px;
        }

        @media (max-width: 480px) {
            .mobile-tabs {
                gap: 8px;
            }
            .tab-item {
                padding: 6px 12px;
                font-size: 0.8rem;
            }
        }
        
        .team-selector {
            flex: 1;
            min-width: 0;
        }

        .team-display {
            padding: 8px;
            font-size: 0.95rem;
            font-weight: bold;
            background-color: rgba(255, 255, 255, 0.05);
            border-radius: 6px;
            display: flex;
            align-items: center;
            gap: 8px;
            width: 100%;
            box-sizing: border-box;
            color: var(--text-main);
            border: 1px solid var(--input-border);
        }

        img.emoji {
            height: 1.2em;
            width: 1.2em;
            margin: 0 .05em 0 .1em;
            vertical-align: -0.1em;
        }

        select {
            background-color: var(--input-bg);
            color: var(--text-main);
            border: 1px solid var(--input-border);
            border-radius: 6px;
            padding: 8px;
            font-size: 0.9rem;
            font-family: inherit;
            cursor: pointer;
            outline: none;
            appearance: none;
            -webkit-appearance: none;
            background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ba1a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
            background-repeat: no-repeat;
            background-position: right 8px center;
            background-size: 14px;
        }

        select option {
            background-color: var(--bg-color);
            color: var(--text-main);
        }

        select.team-select {
            width: 100%;
            padding-right: 28px;
            text-overflow: ellipsis;
            white-space: nowrap;
            overflow: hidden;
            font-weight: 500;
        }

        select.team-select:disabled {
            background-color: transparent;
            opacity: 0.7;
        }

        select.goal-select {
            width: 50px;
            text-align: center;
            font-weight: bold;
            padding: 8px 4px;
            background-image: none;
            text-align-last: center;
        }

        .penalty-btn {
            background: transparent;
            border: 1px solid var(--text-muted);
            color: var(--text-muted);
            width: 22px;
            height: 22px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 0.65rem;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
            display: none;
            font-weight: bold;
        }

        .penalty-btn.active {
            background-color: var(--accent);
            color: white;
            border-color: var(--accent);
        }

        .trophy-container {
            text-align: center;
            margin: 40px 0;
        }
        
        .trophy {
            font-size: 6rem;
            text-shadow: 0 0 30px rgba(241, 196, 15, 0.6);
            animation: float 3s ease-in-out infinite;
        }

        @keyframes float {
            0% { transform: translateY(0px); }
            50% { transform: translateY(-15px); }
            100% { transform: translateY(0px); }
        }

        /* --- Animaciones Premium --- */
        .column {
            opacity: 0;
            animation: fadeInUp 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
        }
        
        .col-delay-0 { animation-delay: 0.1s; }
        .col-delay-1 { animation-delay: 0.2s; }
        .col-delay-2 { animation-delay: 0.3s; }
        .col-delay-3 { animation-delay: 0.4s; }
        .col-delay-4 { animation-delay: 0.5s; }

        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .animate-pop {
            animation: pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        @keyframes pop {
            0% { transform: scale(1); }
            50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(248, 51, 80, 0.4); border-color: var(--accent); }
            100% { transform: scale(1); }
        }

        .animate-glow {
            animation: glow 1s ease-out;
        }

        @keyframes glow {
            0% { box-shadow: 0 0 0 rgba(241, 196, 15, 0); }
            50% { box-shadow: 0 0 20px rgba(241, 196, 15, 0.6); background-color: rgba(241, 196, 15, 0.1); border-color: var(--gold); }
            100% { box-shadow: 0 0 0 rgba(241, 196, 15, 0); }
        }

        .svg-line {
            transition: stroke 0.3s, stroke-width 0.3s;
        }

        .svg-line.highlight-path {
            stroke: var(--brand) !important;
            stroke-width: 3px !important;
            filter: drop-shadow(0 0 5px rgba(168, 127, 251, 0.6));
        }

        ::-webkit-scrollbar { height: 10px; width: 10px; }
        ::-webkit-scrollbar-track { background: var(--bg-color); }
        ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
        ::-webkit-scrollbar-thumb:hover { background: var(--line-color); }

        .mobile-tabs {
            display: none;
        }

        @media (max-width: 1024px) {
            .mobile-hint { display: none; }
            .btn-toggle-view { display: block; }
            
            header {
                flex-direction: column;
                padding: 20px 15px 15px;
                gap: 15px;
                text-align: center;
            }

            .header-left {
                flex-direction: column;
                align-items: center;
                gap: 12px;
                width: 100%;
            }

            .header-right {
                flex-direction: column;
                align-items: center;
                gap: 15px;
                width: 100%;
            }

            .sponsor-badge {
                position: static;
                transform: none;
                order: -1;
            }

            h1 {
                font-size: 1.5rem;
            }

            .subtitle {
                flex-direction: column;
                gap: 5px;
            }

            .mobile-tabs {
                display: flex;
                background: var(--bg-color);
                border-bottom: 1px solid var(--border);
                position: sticky;
                top: 0;
                z-index: 20;
                padding: 8px 10px;
                gap: 5px;
                justify-content: space-between;
                box-shadow: 0 4px 10px rgba(0,0,0,0.2);
            }

            .tab-item {
                flex: 1;
                background: transparent;
                color: var(--text-muted);
                border: none;
                padding: 10px 5px;
                font-weight: bold;
                font-size: 0.9rem;
                cursor: pointer;
                border-radius: 6px;
                transition: all 0.2s;
                text-align: center;
            }
            .tab-item.active {
                background: rgba(168, 127, 251, 0.15);
                color: var(--brand);
            }
            .board-wrapper { 
                justify-content: flex-start;
                padding: 15px 0;
            }
            .bracket-container { margin: 0; min-width: max-content; }
            .column {
                width: 100vw;
                padding: 0 15px;
                box-sizing: border-box;
                justify-content: flex-start;
            }
            .column.center {
                width: 100vw;
                justify-content: flex-start;
                align-items: stretch;
            }
            .match-card {
                margin: 5px 0;
            }
        }

        @media (max-width: 768px) {
            h1 { font-size: 1.3rem; }
            .board-wrapper { padding: 20px 10px; }
            header { padding-top: 45px; }
            .subtitle { flex-direction: column; gap: 5px; }
        }

        /* Tonalidad sutil para identificar llaves */
        .match-card.pair-tint {
            border-left: 3px solid rgba(168, 127, 251, 0.4);
            background: linear-gradient(90deg, rgba(168, 127, 251, 0.05) 0%, var(--card-bg) 100%);
        }

        /* Overrides para Vista Completa Forzada en Celular */
        body.force-desktop .mobile-tabs {
            display: none !important;
        }
        body.force-desktop .board-wrapper {
            justify-content: flex-start !important;
            scroll-snap-type: none !important;
            padding: 40px 20px !important;
            overflow-x: auto !important;
        }
        body.force-desktop .bracket-container {
            margin: 0 auto !important;
            min-width: 1850px !important;
        }
        body.force-desktop .column {
            width: 255px !important;
            padding: 0 !important;
            scroll-snap-align: none !important;
            justify-content: space-around !important;
        }
        body.force-desktop .column.center {
            width: 280px !important;
            justify-content: center !important;
            align-items: center !important;
        }
        body.force-desktop .match-card {
            margin: 10px 0 !important;
        }

        /* --- Splash Screen --- */
        #splash-screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background-color: #000000;
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 9999;
            transition: opacity 0.8s ease-out;
            overflow: hidden;
        }

        .splash-logo {
            max-width: 220px;
            width: 70vw;
            height: auto;
            object-fit: contain;
            animation: pulse 2s infinite ease-in-out;
            z-index: 2;
        }

        @keyframes pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.05); }
            100% { transform: scale(1); }
        }

        #confetti-container {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
            pointer-events: none;
            z-index: 1;
        }

        .confetti {
            position: absolute;
            top: -10px;
            width: 10px;
            height: 20px;
            background-color: #fff;
            animation: fall linear forwards;
        }

        .confetti.blue {
            background-color: #75aadb; /* Celeste Argentina */
        }

        @keyframes fall {
            0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
            100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
        }
