/* ============================================================
   PorraBrutals — Estilos modernos de navegación
   Complementa Bootstrap 4, no lo reemplaza.
   ============================================================ */

:root {
    --pb-navy:        #0f172a;
    --pb-navy-light:  #1e293b;
    --pb-navy-border: #2d4a6e;
    --pb-gold:        #f59e0b;
    --pb-gold-light:  #fbbf24;
    --pb-red:         #ef4444;
    --pb-text-muted:  rgba(255, 255, 255, 0.7);
    --pb-transition:  0.2s ease;
}

/* ---- Header ------------------------------------------------ */
.pb-header {
    background: linear-gradient(135deg, var(--pb-navy) 0%, #1b3a5c 100%);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 1021;
}

/* Contenedor blanco redondeado para el logo del mundial (texto oscuro) */
.pb-header-logo-wrap {
    background: #fff;
    border-radius: 10px;
    padding: 6px 14px;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.pb-header-logo-wrap img {
    height: 54px;
    width: auto;
    object-fit: contain;
    display: block;
}

/* Texto de marca "Porra de Brutals" */
.pb-brand-text {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
    text-decoration: none !important;
    flex-wrap: wrap;
}

.pb-brand-main {
    color: #fff;
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pb-brand-de {
    color: var(--pb-gold);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.pb-brand-secondary {
    color: var(--pb-gold);
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

@media (max-width: 576px) {
    .pb-header { gap: 16px; padding: 10px 16px; }
    .pb-header-logo-wrap img { height: 42px; }
    .pb-brand-main { font-size: 1.4rem; }
    .pb-brand-de { font-size: 0.85rem; }
    .pb-brand-secondary { font-size: 1.4rem; }
}

/* ---- Navbar ------------------------------------------------ */
.pb-navbar {
    background-color: var(--pb-navy-light) !important;
    border-bottom: 2px solid var(--pb-gold);
    padding-top: 0;
    padding-bottom: 0;
}

/* Links de navegación */
.pb-navbar .nav-link {
    color: var(--pb-text-muted) !important;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 14px 16px !important;
    border-bottom: 3px solid transparent;
    transition: color var(--pb-transition), border-color var(--pb-transition);
}

.pb-navbar .nav-link:hover,
.pb-navbar .nav-link:focus {
    color: var(--pb-gold) !important;
    border-bottom-color: var(--pb-gold);
}

.pb-navbar .nav-item.active .nav-link {
    color: var(--pb-gold) !important;
    border-bottom-color: var(--pb-gold);
}

/* Área de usuario (derecha) */
.pb-nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    flex-wrap: wrap;
}

.pb-user-name {
    color: var(--pb-gold);
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Botón Salir */
.pb-btn-salir {
    display: inline-block;
    background: transparent;
    border: 1.5px solid var(--pb-red);
    color: var(--pb-red);
    border-radius: 20px;
    padding: 4px 16px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--pb-transition), color var(--pb-transition);
    white-space: nowrap;
    text-decoration: none !important;
}

.pb-btn-salir:hover {
    background: var(--pb-red);
    color: #fff;
}

/* Botón Ayuda */
.pb-btn-ayuda {
    background: var(--pb-gold);
    border: none;
    color: var(--pb-navy);
    border-radius: 20px;
    padding: 4px 16px;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none !important;
    transition: background var(--pb-transition);
    white-space: nowrap;
}

.pb-btn-ayuda:hover {
    background: var(--pb-gold-light);
    color: var(--pb-navy);
}

/* Hamburger personalizado */
.pb-toggler {
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    padding: 6px 10px;
    background: transparent;
    cursor: pointer;
    margin-left: auto;
}

.pb-toggler .bar {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    margin: 4px 0;
    border-radius: 2px;
    transition: all var(--pb-transition);
}

/* ---- Tarjeta de pregunta (Extra Ball, Quiz Brutal, Final Fantasy) -- */
.pb-question-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: 3px solid var(--pb-gold);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    margin: 8px 4px;
    overflow: hidden;
    text-align: left;
}

.pb-question-card .card-header {
    background: var(--pb-navy-light);
    color: rgba(255, 255, 255, 0.92);
    font-weight: 600;
    font-size: 0.88rem;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pb-question-card .list-group-item {
    border-color: #f1f5f9;
    padding: 6px 14px;
    font-size: 0.88rem;
}

.pb-question-card .card-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 8px 14px;
}

/* ---- Subcabecera de sección (PORTERO, DEFENSAS…) ----------- */
.pb-subsection-header {
    background: var(--pb-navy-light);
    border-left: 3px solid var(--pb-gold);
    border-radius: 6px;
    padding: 7px 16px;
    margin: 16px 0 10px;
    text-align: center;
}

.pb-subsection-header h5 {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 0;
    font-size: 0.82rem;
}

/* ---- Tarjeta de jugador (Pichichis) ------------------------ */
.pb-player-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: 3px solid var(--pb-gold);
    border-radius: 8px;
    padding: 16px 8px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    margin: 8px 4px;
}

.pb-player-card img {
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    object-fit: cover;
}

.pb-player-card select {
    width: 100%;
    max-width: 220px;
    margin-bottom: 12px;
    font-size: 0.82rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 4px;
    padding: 4px 6px;
}

/* ---- Texto "Última actualización" en Clasificación --------- */
.pb-last-update {
    font-size: 0.78rem;
    color: #64748b;
    padding: 4px 8px;
    border-bottom: 2px solid var(--pb-gold);
    text-align: right;
}

/* ---- Tabs de secciones (Liguilla / Fase Final) ------------- */
.pb-result-tabs {
    border-bottom: 2px solid var(--pb-gold);
    margin-top: 16px;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.pb-result-tabs::-webkit-scrollbar { display: none; }

/* En móvil, ocultar tabs y mostrar select */
@media (max-width: 767px) {
    .pb-result-tabs {
        display: none;
    }
}

.pb-tab-select {
    margin-top: 12px;
    background: var(--pb-navy-light);
    color: var(--pb-gold);
    border: 2px solid var(--pb-gold);
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 8px 12px;
}
.pb-tab-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(245,158,11,0.4);
    border-color: var(--pb-gold-light);
}

.pb-result-tabs .nav-link {
    color: rgba(255, 255, 255, 0.65);
    background: var(--pb-navy-light);
    border: none;
    border-bottom: 3px solid transparent;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.85rem;
    padding: 10px 28px;
    margin-right: 4px;
    border-radius: 6px 6px 0 0;
    transition: color var(--pb-transition), border-color var(--pb-transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.pb-result-tabs .nav-link:hover:not(.active) {
    color: var(--pb-gold-light) !important;
    border-bottom-color: var(--pb-gold-light);
    background: var(--pb-navy);
}

.pb-result-tabs .nav-link.active {
    color: var(--pb-gold) !important;
    background: var(--pb-navy);
    border-bottom-color: var(--pb-gold);
}

/* ---- Cabecera de sección (Liguilla / Fase Final) ----------- */
.pb-section-header {
    background: linear-gradient(135deg, var(--pb-navy) 0%, #1b3a5c 100%);
    border-left: 4px solid var(--pb-gold);
    border-radius: 8px;
    padding: 12px 20px;
    margin: 16px 0 20px;
    text-align: center;
    color: var(--pb-gold);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 1rem;
}

.pb-section-header h5 {
    color: var(--pb-gold);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0;
    font-size: 1rem;
}

/* ---- Tabla de clasificación de grupo ----------------------- */
.pb-group-table {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.15);
    margin-bottom: 0 !important;
}

.pb-group-table thead th {
    background: var(--pb-navy) !important;
    color: var(--pb-gold) !important;
    font-weight: 700;
    letter-spacing: 0.04em;
    font-size: 0.78rem;
    text-transform: uppercase;
    border: none;
    padding: 8px 10px;
}

.pb-group-table tbody tr {
    border-bottom: 1px solid #e9ecef;
}

.pb-group-table tbody tr:hover {
    background-color: rgba(245, 158, 11, 0.07) !important;
}

.pb-group-table td,
.pb-group-table th[scope="row"] {
    vertical-align: middle;
    padding: 6px 10px;
    font-size: 0.85rem;
}

.pb-group-table img {
    height: 16px;
    width: auto;
    margin: 0 4px;
    vertical-align: middle;
}

/* ---- Cabecera de columnas de partidos ---------------------- */
.pb-match-col-header {
    background: var(--pb-navy-light);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 8px 12px;
    border-top: 2px solid var(--pb-gold);
    border-radius: 4px 4px 0 0;
    margin-top: 16px;
}

/* ---- Filas de partidos ------------------------------------- */
.pb-match-row,
.pb-match-row-alt {
    border-bottom: 1px solid #e9ecef;
    padding: 6px 0;
    font-size: 0.88rem;
}

.pb-match-row     { background: #ffffff; }
.pb-match-row-alt { background: #f8fafc; }

.pb-match-row:hover,
.pb-match-row-alt:hover {
    background: rgba(245, 158, 11, 0.06);
}

/* ---- Badge de número de partido (link) --------------------- */
.pb-match-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    color: #fff;
    background: var(--pb-navy);
    transition: opacity var(--pb-transition);
}

.pb-match-badge:hover { opacity: 0.8; color: #fff; }

/* ---- Badge de puntos obtenidos (dinámico por PHP) ---------- */
.pb-points-badge {
    cursor: pointer;
    border: 1px solid #94a3b8;
    border-radius: 4px;
    width: 50px;
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 2px 0;
    color: #000;
    display: inline-block;
}

/* ---- Botón Guardar ---------------------------------------- */
.pb-btn-guardar {
    background: var(--pb-gold);
    border: none;
    color: var(--pb-navy);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.04em;
    padding: 10px 36px;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--pb-transition);
}

.pb-btn-guardar:hover {
    background: var(--pb-gold-light);
    color: var(--pb-navy);
}

/* ---- Botón Volver ----------------------------------------- */
.pb-btn-volver {
    display: inline-block;
    background: transparent;
    color: var(--pb-navy);
    border: 2px solid var(--pb-navy);
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.88rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 8px 28px;
    text-align: center;
    text-decoration: none !important;
    transition: background var(--pb-transition), color var(--pb-transition);
}

.pb-btn-volver:hover {
    background: var(--pb-navy);
    color: var(--pb-gold) !important;
    text-decoration: none;
}

/* ---- Inputs de marcador (disabled) ------------------------- */
.pb-score-input {
    text-align: center;
    width: 34px;
    border: 1.5px solid #cbd5e1;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--pb-navy);
    background: #f8fafc;
    padding: 2px 4px;
}

.pb-score-input:disabled {
    background: #f1f5f9;
    color: #475569;
    opacity: 1;
    border-color: #e2e8f0;
}

/* ---- Cabecera de fase (Octavos, Cuartos…) ------------------ */
.pb-phase-header {
    background: linear-gradient(135deg, var(--pb-navy) 0%, #1b3a5c 100%);
    border-left: 4px solid var(--pb-gold);
    border-radius: 8px;
    padding: 10px 16px;
    margin: 24px 0 0;
    text-align: center;
}

.pb-phase-header h4 {
    color: var(--pb-gold);
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    margin: 0;
    font-size: 1rem;
}

/* Banner de "estás viendo la porra de…" */
.pb-viewing-banner {
    background: linear-gradient(90deg, #92400e, var(--pb-gold));
    color: #fff;
    border-radius: 8px;
    padding: 8px 16px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 12px auto;
    max-width: 480px;
    position: sticky;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.pb-viewing-banner a {
    color: var(--pb-navy);
    font-weight: 700;
    text-decoration: underline;
}

/* ================================================================
   HELP — Accordion navy/gold
   ================================================================ */
.pb-help .accordion .card {
    border: 1px solid rgba(15,23,42,0.15);
    border-radius: 8px !important;
    margin-bottom: 8px;
    overflow: hidden;
}

.pb-help .accordion .card-header {
    background: var(--pb-navy-light);
    border-bottom: none;
    padding: 0;
}

.pb-help .accordion .card-header .btn-link {
    color: var(--pb-gold);
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: 100%;
    text-align: left;
    padding: 14px 20px;
    text-decoration: none;
}

.pb-help .accordion .card-header .btn-link:hover {
    color: var(--pb-gold-light);
    text-decoration: none;
}

.pb-help .accordion .card-body {
    background: #f8fafc;
    color: #1e293b;
    font-size: 0.92rem;
    line-height: 1.65;
    padding: 20px 24px;
}

/* ================================================================
   LOGIN / REGISTER / FORGOT — navy/gold skin
   ================================================================ */
.pb-auth-page {
    background: var(--pb-navy);
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 40px;
}

.pb-auth-box {
    background: #fff;
    border-radius: 12px;
    padding: 32px 28px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.pb-auth-box .form-control {
    border: 2px solid #cbd5e1;
    border-radius: 6px;
}

.pb-auth-box .form-control:focus {
    border-color: var(--pb-gold);
    box-shadow: 0 0 0 2px rgba(245,158,11,0.25);
}

.pb-auth-btn {
    background: var(--pb-navy);
    color: var(--pb-gold) !important;
    border: 2px solid var(--pb-gold);
    border-radius: 6px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 10px 24px;
    width: 100%;
    transition: background var(--pb-transition), color var(--pb-transition);
}

.pb-auth-btn:hover {
    background: var(--pb-gold);
    color: var(--pb-navy) !important;
}

.pb-auth-link {
    color: var(--pb-gold);
    font-weight: 600;
    text-decoration: underline;
}

.pb-auth-btn-outline {
    background: transparent;
    color: var(--pb-navy) !important;
    border: 2px solid var(--pb-navy);
    border-radius: 6px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 8px 24px;
    width: 100%;
    display: block;
    text-align: center;
    margin-top: 16px;
    transition: background var(--pb-transition), color var(--pb-transition);
}

.pb-auth-btn-outline:hover {
    background: var(--pb-navy);
    color: var(--pb-gold) !important;
    text-decoration: none;
}

/* ================================================================
   CLASSIFICATION TABLE — sticky first 2 columns
   ================================================================ */
.pb-sticky-table {
    border-collapse: separate !important;
    border-spacing: 0;
}

/* Restore borders lost from border-collapse:separate */
.pb-sticky-table td,
.pb-sticky-table th {
    border-right: 1px solid #000;
    border-bottom: 1px solid #000;
}
.pb-sticky-table tr td:first-child,
.pb-sticky-table tr th:first-child {
    border-left: 1px solid #000;
}
.pb-sticky-table tr:first-child td,
.pb-sticky-table tr:first-child th {
    border-top: 1px solid #000;
}

/* Sticky cells get a shadow on the right to show separation */
.pb-sticky-col {
    position: sticky !important;
    z-index: 2;
    box-shadow: 2px 0 4px rgba(0,0,0,0.15);
}

/* Ocultar botón Guardar cuando se está viendo la porra de otro */
.pb-viewing-other .pb-btn-guardar {
    display: none !important;
}

/* ================================================================
   BRACKET VIEW — Fase Final / Vista de llaves
   ================================================================ */

/* Toggle buttons (Lista / Brackets) */
.pb-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
}
.pb-section-header h5 { flex: 1; text-align: center; margin: 0; }

.bkt-toggle-wrap {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.bkt-toggle-btn {
    background: transparent;
    border: 1.5px solid var(--pb-gold);
    color: var(--pb-gold);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: background var(--pb-transition), color var(--pb-transition);
    white-space: nowrap;
}
.bkt-toggle-btn:hover,
.bkt-toggle-btn.bkt-active {
    background: var(--pb-gold);
    color: var(--pb-navy);
}

/* Outer wrapper: horizontal scroll */
.bkt-wrapper {
    overflow-x: auto;
    padding: 16px 0 24px;
    -webkit-overflow-scrolling: touch;
}

/* Main bracket row: left + center + right */
.bkt-bracket {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-width: 1600px;
    min-height: 700px;
}

/* Each side (left/right) is a row of round columns */
.bkt-side {
    display: flex;
    flex-direction: row;
    flex: 1;
    align-items: stretch;
}

/* Left side: R32 → R16 → QF → SF (left to right, inward) */
.bkt-left { flex-direction: row; }
/* Right side: SF → QF → R16 → R32 (left to right, outward) */
.bkt-right { flex-direction: row; }

/* A round column */
.bkt-round {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    flex: 1;
    min-width: 210px;
    max-width: 260px;
    padding: 0 4px;
}

/* Round label above each column */
.bkt-round-header {
    text-align: center;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--pb-gold);
    background: var(--pb-navy-light);
    border-radius: 4px;
    padding: 2px 6px;
    margin-bottom: 6px;
}

/* Pair = two matches that connect to the next round */
.bkt-pair {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    flex: 1;
    position: relative;
}

/* Bracket brace on right edge (left side) */
.bkt-left .bkt-pair:not(.bkt-pair-single)::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 25%;
    bottom: 25%;
    width: 8px;
    border-top: 2px solid var(--pb-gold);
    border-right: 2px solid var(--pb-gold);
    border-bottom: 2px solid var(--pb-gold);
    border-radius: 0 4px 4px 0;
    pointer-events: none;
    opacity: 0.7;
}

/* Bracket brace on left edge (right side) */
.bkt-right .bkt-pair:not(.bkt-pair-single)::after {
    content: '';
    position: absolute;
    left: -4px;
    top: 25%;
    bottom: 25%;
    width: 8px;
    border-top: 2px solid var(--pb-gold);
    border-left: 2px solid var(--pb-gold);
    border-bottom: 2px solid var(--pb-gold);
    border-radius: 4px 0 0 4px;
    pointer-events: none;
    opacity: 0.7;
}

/* Horizontal connector line into the next-round match (left side) */
.bkt-left .bkt-pair::before {
    content: '';
    position: absolute;
    right: -16px;
    top: 50%;
    width: 16px;
    border-top: 2px solid var(--pb-gold);
    opacity: 0.5;
}
/* Horizontal connector line into the next-round match (right side) */
.bkt-right .bkt-pair::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 50%;
    width: 16px;
    border-top: 2px solid var(--pb-gold);
    opacity: 0.5;
}

/* Match card */
.bkt-match {
    background: #fff;
    border: 1px solid #d1d9e6;
    border-radius: 8px;
    overflow: hidden;
    margin: 3px 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    position: relative;
}

.bkt-match-num {
    font-size: 0.7rem;
    color: #888;
    text-align: right;
    padding: 2px 8px 0;
    line-height: 1.2;
}
.bkt-match-num a {
    color: #888;
    text-decoration: none;
}
.bkt-match-num a:hover { color: var(--pb-navy); text-decoration: underline; }

/* Team row inside a match card */
.bkt-team {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-top: 1px solid #f0f2f5;
    font-size: 0.88rem;
    line-height: 1.2;
    min-height: 34px;
}
.bkt-team:first-of-type { border-top: none; }

.bkt-team.bkt-winner {
    background: #edfcf0;
    font-weight: 700;
}
.bkt-team.bkt-loser {
    background: #fef5f5;
    color: #999;
}

.bkt-flag {
    width: 26px;
    height: 18px;
    object-fit: cover;
    border-radius: 2px;
    border: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.bkt-tname {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bkt-tscore {
    font-weight: 800;
    font-size: 1rem;
    color: var(--pb-navy);
    min-width: 16px;
    text-align: right;
    flex-shrink: 0;
}

.bkt-extra {
    font-size: 0.68rem;
    color: #777;
    text-align: center;
    padding: 2px 8px 3px;
    line-height: 1.2;
    border-top: 1px dashed #e8e8e8;
    letter-spacing: 0.02em;
}

/* Center column: Final + 3rd/4th */
.bkt-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 240px;
    max-width: 280px;
    padding: 0 8px;
    gap: 16px;
}

.bkt-center-label {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--pb-gold);
    text-align: center;
    margin-bottom: 4px;
}

.bkt-center .bkt-match {
    width: 100%;
    border-color: var(--pb-gold);
    border-width: 2px;
    box-shadow: 0 2px 10px rgba(245,158,11,0.2);
}

/* Final match — slightly bigger text */
.bkt-final-match .bkt-team {
    font-size: 0.95rem;
    padding: 7px 12px;
    min-height: 38px;
}
.bkt-final-match .bkt-tname { max-width: 100px; }

/* Connector lines from SF into center (left) */
.bkt-left .bkt-pair-single::before {
    right: -16px;
    width: 16px;
}
/* Connector lines from SF into center (right) */
.bkt-right .bkt-pair-single::before {
    left: -16px;
    width: 16px;
}


/* ============================================================
   BRACKET – RESPONSIVE
   ============================================================ */

/* Tablet (< 992px): reducir tamaños de tarjeta */
@media (max-width: 991px) {
    .bkt-bracket {
        min-width: 900px;
    }
    .bkt-round {
        min-width: 120px;
        max-width: 150px;
        padding: 0 2px;
    }
    .bkt-center {
        min-width: 140px;
        max-width: 160px;
        padding: 0 4px;
    }
    .bkt-team {
        font-size: 0.70rem;
        padding: 3px 6px;
        min-height: 26px;
        gap: 3px;
    }
    .bkt-tname  { max-width: 68px; }
    .bkt-flag   { width: 18px; height: 13px; }
    .bkt-tscore { font-size: 0.8rem; }
    .bkt-match-num { font-size: 0.55rem; }
    .bkt-round-header { font-size: 0.58rem; }
    .bkt-final-match .bkt-team { font-size: 0.74rem; padding: 4px 8px; min-height: 28px; }
}

/* Móvil (< 768px): compact mode */
@media (max-width: 767px) {
    .bkt-wrapper {
        padding: 12px 10px 20px;
        cursor: grab;
    }
    .bkt-bracket {
        min-width: 800px;
    }
    .bkt-round {
        min-width: 105px;
        max-width: 130px;
        padding: 0 1px;
    }
    .bkt-center {
        min-width: 120px;
        max-width: 140px;
        padding: 0 3px;
        gap: 10px;
    }
    .bkt-team {
        font-size: 0.64rem;
        padding: 2px 5px;
        min-height: 23px;
        gap: 2px;
    }
    .bkt-tname  { max-width: 55px; }
    .bkt-flag   { width: 16px; height: 11px; }
    .bkt-tscore { font-size: 0.75rem; min-width: 10px; }
    .bkt-match-num { font-size: 0.50rem; padding: 1px 4px 0; }
    .bkt-round-header { font-size: 0.52rem; padding: 2px 3px; }
    .bkt-match { border-radius: 5px; margin: 2px 0; }
    .bkt-final-match .bkt-team { font-size: 0.68rem; padding: 3px 6px; min-height: 25px; }
}

/* En landscape móvil, dar más espacio */
@media (max-width: 767px) and (orientation: landscape) {
    .bkt-bracket { min-width: 720px; }
}

/* ============================================================
   MATCHBETS DETAIL — Apuestas por partido
   ============================================================ */
.pb-matchbets .pb-match-col-header,
.pb-matchbets .pb-match-row,
.pb-matchbets .pb-match-row-alt {
    overflow: hidden;
}

.pb-bets-team {
    flex: 1 1 0;
    min-width: 0;
    font-size: 0.88rem;
}

.pb-bets-result {
    white-space: nowrap;
    font-size: 0.88rem;
}

.pb-bets-brutals {
    font-size: 0.82rem;
    color: #555;
    border-top: 1px dashed #e0e0e0;
    padding-top: 4px;
}

.pb-bets-label {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    color: var(--pb-navy-light);
}

/* ============================================================
   LIGUILLA – RESPONSIVE MÓVIL
   ============================================================ */
@media (max-width: 575px) {
    /* Reducir font-size general de las filas */
    .pb-match-row,
    .pb-match-row-alt {
        font-size: 0.88rem;
    }

    /* Columna nombre equipo 1 (col-2): ampliar a 25% */
    .pb-match-row .row > div:nth-child(4),
    .pb-match-row-alt .row > div:nth-child(4) {
        flex: 0 0 25%;
        max-width: 25%;
    }

    /* Columna bandera+input equipo 1 (col-4): reducir a 25% */
    .pb-match-row .row > div:nth-child(5),
    .pb-match-row-alt .row > div:nth-child(5) {
        flex: 0 0 25%;
        max-width: 25%;
    }

    /* Input de resultado: más pequeño */
    .pb-score-input {
        width: 26px;
        font-size: 0.78rem;
        padding: 1px 2px;
    }
}
