:root {
    --primary: #00ff88;
    --primary-dark: #00cc6a;
    --bg-dark: #0a0a0a;
    --bg-card: #111118;
    --bg-card-hover: #1a1a25;
    --border: rgba(255, 255, 255, 0.08);
    --text: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.5);
    --danger: #ff4757;
    --warning: #ffa502;
    --success: #2ed573;
    --font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* Header Publico */
.header-public {
    background: rgba(17, 17, 24, 0.95);
    border-bottom: 1px solid var(--border);
    padding: 15px 30px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header-logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

.torneo-titulo {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    text-align: center;
}

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

.select-torneo, .select-inline {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    min-width: 200px;
}

.select-torneo option, .select-inline option {
    background: var(--bg-card);
    color: var(--text);
}

.btn-admin {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-admin:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Stats Bar */
.stats-bar {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 30px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.stat-val {
    display: block;
    font-size: 36px;
    font-weight: 800;
    color: var(--primary);
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.stat-label {
    display: block;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Bracket Section */
.bracket-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px 40px;
}

.bracket-container {
    display: flex;
    gap: 0;
    overflow-x: auto;
    padding: 20px 0;
}

.loading-msg {
    color: var(--text-muted);
    text-align: center;
    padding: 60px;
    font-size: 16px;
}

/* Ronda */
.ronda-column {
    min-width: 220px;
    flex-shrink: 0;
}

.ronda-header {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.ronda-header h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ronda-matches {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    height: 100%;
    gap: 20px;
}

/* Partido Card */
.partido-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.partido-card:hover {
    border-color: rgba(0, 255, 136, 0.3);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.partido-card.ganador {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
}

.equipo-row {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    gap: 12px;
    transition: background 0.2s ease;
}

.equipo-row:first-child {
    border-bottom: 1px solid var(--border);
}

.equipo-row.ganador-equipo {
    background: rgba(0, 255, 136, 0.1);
}

.equipo-color {
    width: 4px;
    height: 30px;
    border-radius: 2px;
    flex-shrink: 0;
}

.equipo-info {
    flex: 1;
    min-width: 0;
}

.equipo-nombre {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.equipo-escuela {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.equipo-goles {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    min-width: 30px;
    text-align: center;
}

.equipo-goles.ganador-goles {
    color: var(--primary);
}

.partido-estado {
    text-align: center;
    padding: 6px;
    font-size: 10px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.partido-estado.finalizado {
    color: var(--success);
}

.partido-estado.bye {
    color: var(--warning);
}

/* TBD placeholder */
.tbd-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    color: var(--text-muted);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
}

/* Campeon */
.campeon-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px 40px;
    text-align: center;
}

.campeon-card {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), rgba(0, 255, 136, 0.05));
    border: 2px solid var(--primary);
    border-radius: 20px;
    padding: 50px;
    display: inline-block;
    animation: championGlow 2s infinite;
}

@keyframes championGlow {
    0%, 100% { box-shadow: 0 0 40px rgba(0, 255, 136, 0.3); }
    50% { box-shadow: 0 0 80px rgba(0, 255, 136, 0.5); }
}

.campeon-trophy {
    font-size: 80px;
    margin-bottom: 10px;
}

.campeon-card h2 {
    color: var(--primary);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 3px;
    margin-bottom: 15px;
}

.campeon-nombre {
    font-size: 36px;
    font-weight: 800;
    color: var(--text);
}

/* Tabla Section */
.tabla-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px 40px;
}

.tabla-section h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--text);
}

.tabla-estadisticas {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.tabla-estadisticas th {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px 20px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.tabla-estadisticas td {
    padding: 14px 20px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

.tabla-estadisticas tr:last-child td {
    border-bottom: none;
}

.tabla-estadisticas tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.tabla-equipo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tabla-color {
    width: 4px;
    height: 24px;
    border-radius: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-bar { grid-template-columns: repeat(2, 1fr); }
    .header-content { flex-wrap: wrap; }
    .torneo-titulo { order: 3; width: 100%; text-align: left; }
}
