/* ============================================
   HOSTENNIS - estilos custom (sobre tema verde)
   ============================================ */

body { font-family: 'Open Sans', sans-serif; }

/* Header */
.support-info { color: #fff; }
.box-login a { color: #fff; }

/* Banner del torneo */
.tournament-banner {
    background: linear-gradient(135deg, #8cc63f 0%, #5fa01a 100%);
    color: #fff;
    padding: 32px 20px;
    text-align: center;
    margin: 20px 0 30px;
    border-radius: 4px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}
.tournament-banner h1 {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    margin: 0;
    font-size: 36px;
    letter-spacing: 2px;
}
.tournament-banner p { margin: 6px 0 0; font-size: 16px; opacity: .92; }

/* Live cards (canchas) */
.canchas-live {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.cancha-card {
    background: #fff;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    transition: all .3s ease;
}
.cancha-card.live {
    border-color: #8cc63f;
    box-shadow: 0 4px 18px rgba(140, 198, 63, 0.35);
}
.cancha-header {
    background: #2c2c2c;
    color: #fff;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cancha-card.live .cancha-header { background: #8cc63f; }
.cancha-num { font-family: 'Oswald'; font-size: 22px; font-weight: 700; }
.cancha-state { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.cancha-state.live::before {
    content: '●';
    color: #ff3a3a;
    margin-right: 6px;
    animation: blink 1.2s infinite;
}
@keyframes blink { 50% { opacity: .25; } }

.cancha-body { padding: 16px; }
.cancha-equipo {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}
.cancha-hora {
    float: right;
    font-size: 13px;
    color: #777;
    font-weight: 600;
}
.cancha-pareja {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}
.cancha-pareja:last-child { border: 0; }
.cancha-pareja-nombre { font-size: 14px; font-weight: 600; flex: 1; }
.cancha-pareja-nombre .winner-mark { color: #8cc63f; margin-left: 6px; }
.cancha-pareja-puntos {
    font-family: 'Oswald';
    font-size: 32px;
    font-weight: 700;
    min-width: 50px;
    text-align: center;
    padding: 0 12px;
    background: #f7f7f7;
    border-radius: 4px;
    color: #333;
}
.cancha-pareja.gana .cancha-pareja-puntos {
    background: #8cc63f;
    color: #fff;
}
.cancha-vacia { text-align: center; color: #999; padding: 40px 20px; }
.cancha-vacia i { font-size: 36px; opacity: .3; }

/* Destacado bracket en index */
.bracket-live {
    margin-bottom: 30px;
}
.bracket-live-card {
    background: linear-gradient(135deg, #fff9e6 0%, #fff 60%, #fff5d6 100%);
    border: 3px solid #ffc83d;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: 0 6px 22px rgba(255, 200, 61, 0.25);
    position: relative;
    overflow: hidden;
}
.bracket-live-card.es-final {
    background: linear-gradient(135deg, #fff3d6 0%, #fff 50%, #ffe9a8 100%);
    border-color: #ff8c00;
    box-shadow: 0 6px 26px rgba(255, 140, 0, 0.35);
}
.bracket-live-card.live-now {
    animation: bracketPulse 2s infinite;
}
@keyframes bracketPulse {
    0%, 100% { box-shadow: 0 6px 22px rgba(255, 200, 61, 0.25); }
    50% { box-shadow: 0 6px 30px rgba(255, 58, 58, 0.55); }
}
.bracket-live-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px dashed #ffc83d;
}
.bracket-live-title {
    font-family: 'Oswald', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #2c2c2c;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
}
.bracket-live-card.es-final .bracket-live-title { color: #d97500; }
.bracket-live-meta { font-size: 13px; color: #777; }
.bracket-live-meta .badge-cancha {
    background: #2c2c2c;
    color: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: 700;
    margin-right: 8px;
}
.bracket-live-pareja {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,200,61,0.3);
}
.bracket-live-pareja:last-child { border: 0; }
.bracket-live-pareja-info { flex: 1; }
.bracket-live-pareja-eq {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    margin-right: 10px;
    vertical-align: middle;
}
.bracket-live-pareja-nom {
    font-family: 'Oswald', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #2c2c2c;
    vertical-align: middle;
}
.bracket-live-pareja.gana .bracket-live-pareja-nom { color: #5fa01a; }
.bracket-live-pareja.gana .bracket-live-pareja-nom::after { content: ' 🏆'; }
.bracket-live-pareja.esperando .bracket-live-pareja-nom {
    font-style: italic;
    color: #999;
    font-size: 16px;
}
.bracket-live-puntos {
    font-family: 'Oswald', sans-serif;
    font-size: 64px;
    font-weight: 700;
    line-height: 1;
    min-width: 90px;
    text-align: center;
    color: #2c2c2c;
    background: rgba(255,255,255,0.7);
    border-radius: 8px;
    padding: 4px 18px;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.1);
}
.bracket-live-pareja.gana .bracket-live-puntos {
    background: #8cc63f;
    color: #fff;
}
.bracket-live-campeon {
    text-align: center;
    margin-top: 18px;
    padding: 14px;
    background: linear-gradient(135deg, #ffc83d 0%, #ff8c00 100%);
    color: #fff;
    border-radius: 6px;
    font-family: 'Oswald', sans-serif;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

@media (max-width: 600px) {
    .bracket-live-card {
        padding: 14px 14px;
        margin-bottom: 14px;
    }
    .bracket-live-header {
        flex-wrap: wrap;
        gap: 6px 10px;
        margin-bottom: 10px;
        padding-bottom: 10px;
    }
    .bracket-live-title { font-size: 18px; letter-spacing: 1px; }
    .bracket-live-meta { font-size: 12px; }
    .bracket-live-meta .badge-cancha { padding: 2px 8px; }
    .bracket-live-pareja {
        flex-wrap: nowrap;
        padding: 10px 0;
        gap: 10px;
    }
    .bracket-live-pareja-info {
        min-width: 0;
        flex: 1;
    }
    .bracket-live-pareja-eq {
        display: inline-block;
        margin: 0 0 6px 0;
        font-size: 10px;
        padding: 2px 8px;
    }
    .bracket-live-pareja-nom {
        font-size: 18px;
        display: block;
        line-height: 1.15;
        word-break: break-word;
    }
    .bracket-live-pareja.gana .bracket-live-pareja-nom::after { content: ' 🏆'; }
    .bracket-live-puntos {
        font-size: 40px;
        min-width: 56px;
        padding: 4px 10px;
        flex-shrink: 0;
    }
    .bracket-live-campeon {
        font-size: 17px;
        padding: 10px;
        margin-top: 12px;
        letter-spacing: 0.5px;
    }
    .cancha-etapa { font-size: 10px; }
}

/* Próximos partidos */
.proximos {
    background: #fafafa;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 30px;
}
.proximos h3 {
    font-family: 'Oswald';
    margin-top: 0;
    color: #2c2c2c;
    border-bottom: 2px solid #8cc63f;
    padding-bottom: 8px;
}
.proximo-row {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}
.proximo-row:last-child { border: 0; }
.proximo-hora {
    font-family: 'Oswald';
    font-size: 18px;
    font-weight: 700;
    color: #8cc63f;
    min-width: 70px;
}
.proximo-cancha {
    background: #2c2c2c;
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    margin-right: 12px;
}
.proximo-equipo {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    margin-right: 10px;
}

/* Tablas de equipos */
.equipo-section { margin-bottom: 40px; }
.equipo-title {
    font-family: 'Oswald';
    color: #fff;
    padding: 12px 18px;
    font-size: 22px;
    border-radius: 4px 4px 0 0;
    letter-spacing: 1px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.equipo-title .ganador-pill {
    background: rgba(255,255,255,.95);
    color: #2c2c2c;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
}
.tabla-standings {
    width: 100%;
    background: #fff;
    border-collapse: collapse;
    border: 1px solid #e0e0e0;
    border-top: 0;
}
.tabla-standings th {
    background: #f5f5f5;
    padding: 10px;
    text-align: center;
    font-size: 12px;
    text-transform: uppercase;
    color: #555;
    border-bottom: 2px solid #ddd;
}
.tabla-standings td {
    padding: 12px 10px;
    text-align: center;
    border-bottom: 1px solid #eee;
}
.tabla-standings td.pareja { text-align: left; font-weight: 600; }
.tabla-standings tr.lider td { background: rgba(140, 198, 63, 0.12); font-weight: 700; }
.tabla-standings tr.lider td.pareja::before { content: '🏆 '; }

/* Partidos del equipo */
.partidos-equipo {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: 0;
    margin-bottom: 0;
}
.partido-row {
    display: grid;
    grid-template-columns: 70px 50px 1fr 80px 1fr 80px;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}
.partido-row:last-child { border: 0; }
.partido-row .hora { font-family: 'Oswald'; font-weight: 700; color: #8cc63f; }
.partido-row .cancha-tag {
    background: #2c2c2c;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    width: 40px;
}
.partido-row .pareja-nombre { font-weight: 600; }
.partido-row .pareja-nombre.gana { color: #5fa01a; }
.partido-row .pareja-nombre.gana::after { content: ' ✓'; }
.partido-row .marcador {
    font-family: 'Oswald';
    font-size: 22px;
    font-weight: 700;
    text-align: center;
}
.partido-row .estado-pill {
    text-align: center;
    font-size: 10px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 700;
}
.estado-pill.pendiente { background: #eee; color: #777; }
.estado-pill.en_vivo { background: #ff3a3a; color: #fff; animation: blink 1.2s infinite; }
.estado-pill.finalizado { background: #8cc63f; color: #fff; }

/* Bracket */
.bracket-wrap { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 30px; margin-top: 20px; }
.bracket-col h4 {
    font-family: 'Oswald';
    text-align: center;
    color: #2c2c2c;
    border-bottom: 3px solid #8cc63f;
    padding-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.bracket-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,.05);
}
.bracket-card.final { border-color: #ffc83d; background: linear-gradient(135deg, #fff9e6 0%, #fff 100%); }
.bracket-card .bc-pareja {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
}
.bracket-card .bc-pareja:last-child { border: 0; }
.bracket-card .bc-pareja.gana { color: #5fa01a; }
.bracket-card .bc-pareja.gana::after { content: ' 🏆'; }
.bracket-empty { color: #aaa; text-align: center; padding: 30px; font-style: italic; }

/* Admin */
.admin-login-box {
    max-width: 380px;
    margin: 80px auto;
    background: #fff;
    padding: 30px;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
}
.admin-login-box h3 {
    font-family: 'Oswald';
    text-align: center;
    margin-top: 0;
    color: #2c2c2c;
}
.admin-login-box .form-control { margin-bottom: 12px; }
.admin-login-box .btn {
    width: 100%;
    background: #8cc63f;
    color: #fff;
    border: 0;
    padding: 12px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
    cursor: pointer;
}
.admin-login-box .btn:hover { background: #5fa01a; }

.session-bar {
    background: #2c2c2c;
    color: #fff;
    padding: 8px 16px;
    margin-bottom: 20px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}
.session-bar .session-time { color: #ffc83d; font-weight: 700; }

.admin-table {
    width: 100%;
    background: #fff;
    border: 1px solid #ddd;
    margin-bottom: 30px;
}
.admin-table th, .admin-table td {
    padding: 8px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    vertical-align: middle;
}
.admin-table th {
    background: #f5f5f5;
    text-align: center;
    text-transform: uppercase;
    font-size: 11px;
}
.admin-table input.form-control,
.admin-table select.form-control {
    padding: 4px 6px;
    height: auto;
    font-size: 13px;
}
.admin-table .input-marcador { width: 50px; text-align: center; }

/* Marcador estructurado (set / muerte / super muerte) */
.marcador-bloque { display: flex; flex-direction: column; gap: 4px; min-width: 175px; }
.marcador-fila { display: flex; align-items: center; gap: 6px; }
.marcador-fila .lbl { font-size: 10px; color: #555; min-width: 60px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }
.marcador-fila input {
    width: 42px; text-align: center; padding: 3px 4px;
    font-size: 13px; border: 1px solid #ccc; border-radius: 3px;
}
.marcador-fila.muerte .lbl { color: #d92121; }
.marcador-fila.super  .lbl { color: #ff6f00; }
.marcador-fila.disabled { opacity: 0.35; pointer-events: none; }
.marcador-fila.disabled input { background: #f3f3f3; }

/* Marcador en vista live */
.cancha-etapa {
    font-size: 11px;
    color: #d92121;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    text-align: center;
    margin: 4px 0 -2px;
}
.cancha-etapa.super { color: #ff6f00; }

/* Caja de empates en panel admin */
.desempate-box {
    background: #fff8e1;
    border: 2px solid #ffb300;
    border-radius: 6px;
    padding: 14px 16px;
    margin: 10px 0 24px;
}
.desempate-box h4 {
    margin: 0 0 8px; color: #c47a00;
    font-family: Oswald, sans-serif;
    font-size: 16px;
    text-transform: uppercase;
}
.desempate-box .desempate-grupo { padding: 6px 0; }
.desempate-box .desempate-grupo + .desempate-grupo { border-top: 1px dashed #e0c382; margin-top: 6px; }
.desempate-box p { margin: 4px 0; font-size: 14px; }
.desempate-box .btn-crear-desempate {
    display: inline-block;
    background: #ff6f00; color: #fff; border: 0;
    padding: 6px 12px; border-radius: 3px;
    font-size: 12px; font-weight: 700;
    margin: 4px 6px 4px 0;
    cursor: pointer;
}
.desempate-box .btn-crear-desempate:hover { background: #c44b00; }

/* Indicador visual de empate pendiente en tabla pública */
.tabla-standings tr.empate-pendiente { background: #fff8e1; }
.tabla-standings tr.empate-pendiente td.pareja::after {
    content: ' ⏳';
    font-size: 12px;
}
.admin-table .btn-guardar {
    background: #8cc63f;
    color: #fff;
    border: 0;
    padding: 5px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}
.admin-table .btn-guardar:hover { background: #5fa01a; }
.admin-table .btn-guardar.saved { background: #2c2c2c; }

.admin-actions {
    background: #fff;
    border: 1px solid #ddd;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 4px;
}
.admin-actions .btn-fase {
    background: #ffc83d;
    color: #2c2c2c;
    border: 0;
    padding: 10px 20px;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
}
.admin-actions .btn-fase:hover { background: #f5b800; }
.admin-actions .btn-fase[disabled] { opacity: .4; cursor: not-allowed; }

.alert-msg {
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 13px;
}
.alert-msg.error { background: #ffe5e5; color: #c33; border: 1px solid #f5b5b5; }
.alert-msg.success { background: #e7f5d8; color: #5fa01a; border: 1px solid #c3e09a; }

/* Crédito en footer */
.credit-line {
    margin-top: 6px;
    font-size: 12px;
    color: #aaa;
    letter-spacing: 0.3px;
}
.credit-line strong { color: #8cc63f; font-weight: 700; }
.credit-line a {
    color: #5dc1ff;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px dashed rgba(93, 193, 255, 0.5);
    transition: all .2s;
}
.credit-line a:hover { color: #fff; border-bottom-color: #fff; }

/* Responsive */
@media (max-width: 768px) {
    .partido-row {
        grid-template-columns: 60px 1fr 60px;
        grid-template-rows: auto auto;
        gap: 4px;
    }
    .partido-row .cancha-tag { display: none; }
    .partido-row .pareja-nombre { font-size: 13px; }
    .bracket-wrap { grid-template-columns: 1fr; }
    .tournament-banner h1 { font-size: 26px; }
}
