/* CONTENEDOR GENERAL */

.bbtb-wrapper {
    border-radius: 10px;
    background: #111;
    color: #f5f5f5;
    font-size: 14px;
    max-width: 100%;
    padding: 1rem 1rem 0.75rem;
    box-sizing: border-box;
    overflow-x: visible;           /* en PC, sin barra horizontal */
    box-shadow: 0 8px 20px rgba(0,0,0,0.35);
}

/* SELECTOR + BOTÓN PDF */

.bbtb-controls {
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.bbtb-label {
    font-weight: 600;
    font-size: 0.95rem;
}

.bbtb-select {
    min-width: 220px;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    border: 1px solid #444;
    background: #222;
    color: #f5f5f5;
}

.bbtb-print-btn {
    margin-left: auto;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    border: 1px solid #555;
    background: #333;
    color: #f5f5f5;
    font-size: 0.85rem;
    cursor: pointer;
}

.bbtb-print-btn:hover {
    background: #444;
}

/* TÍTULO DEL EQUIPO */

.bbtb-wrapper .bbtb-team-name {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.3rem;
    font-weight: 700;
}

/* TABLA BASE JUGADORES */

.bbtb-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.75rem;
    table-layout: fixed;
    min-width: 0;                 /* NO forzamos ancho mínimo en PC */
}

.bbtb-table th,
.bbtb-table td {
    border: 1px solid #333;
    padding: 0.3rem 0.35rem;
    text-align: center;
}

.bbtb-table th {
    background: #212121;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    position: sticky;
    top: 0;
    z-index: 2;
}

.bbtb-player-row:nth-child(even) {
    background: #1b1b1b;
}

.bbtb-player-row:nth-child(odd) {
    background: #141414;
}

.bbtb-player-row:hover {
    background: #262626;
}

/* Posición y habilidades más compactas */

.bbtb-pos {
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: normal;          /* permite salto de línea */
    word-break: break-word;
}

.bbtb-skills {
    text-align: left;
    max-width: 260px;
    font-size: 0.8rem;
    line-height: 1.2;
    white-space: normal;
    word-break: break-word;
}

/* NUMÉRICOS */

.bbtb-stat {
    width: 40px;
    font-size: 0.8rem;
}

/* BOTONES Y CANTIDADES (jugadores y extras) */

.bbtb-qty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.bbtb-btn {
    border: none;
    padding: 0.2rem 0.5rem;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.95rem;
    line-height: 1;
    min-width: 28px;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.05s ease, box-shadow 0.05s ease;
}

.bbtb-btn-minus {
    background: #602020;
    color: #fff;
}

.bbtb-btn-plus {
    background: #206020;
    color: #fff;
}

.bbtb-btn:active {
    transform: scale(0.96);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.1) inset;
}

.bbtb-qty-input {
    width: 2.7rem;
    text-align: center;
    padding: 0.15rem 0.1rem;
    border-radius: 4px;
    border: 1px solid #555;
    background: #111;
    color: #f5f5f5;
    font-size: 0.85rem;
}

/* COSTE JUGADORES */

.bbtb-cost {
    font-weight: 600;
    font-size: 0.85rem;
}

/* BLOQUE DE EXTRAS (RR, FF, STAFF) */

.bbtb-extras {
    margin: 0.5rem 0 0.75rem;
}

.bbtb-extras-title {
    margin: 0 0 0.25rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.bbtb-extras-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.25rem;
    table-layout: fixed;
    min-width: 0;                /* sin ancho mínimo en PC */
}

.bbtb-extras-table th,
.bbtb-extras-table td {
    border: 1px solid #333;
    padding: 0.25rem 0.35rem;
    text-align: center;
    font-size: 0.8rem;
}

.bbtb-extras-table th {
    background: #1f1f1f;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.bbtb-extras-row:nth-child(even) {
    background: #1a1a1a;
}

.bbtb-extras-row:nth-child(odd) {
    background: #131313;
}

.bbtb-extras-name {
    text-align: left;
    white-space: normal;
    word-break: break-word;
}

.bbtb-extras-limit {
    width: 70px;
}

.bbtb-extras-unit,
.bbtb-extras-total {
    white-space: nowrap;
    font-weight: 600;
}

/* RESUMEN */

.bbtb-summary {
    border-top: 1px solid #333;
    padding-top: 0.5rem;
    margin-top: 0.25rem;
    font-size: 0.9rem;
}

.bbtb-summary-title {
    margin: 0 0 0.25rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.bbtb-summary-line {
    margin: 0.1rem 0;
}

.bbtb-summary-total {
    margin-top: 0.25rem;
    font-weight: 700;
}

/* ========================
   AJUSTES RESPONSIVE
   ======================== */

@media (max-width: 980px) {
    .bbtb-wrapper {
        padding: 0.75rem 0.5rem 0.5rem;
        font-size: 13px;
        overflow-x: auto;               /* en móvil sí hay scroll horizontal */
        -webkit-overflow-scrolling: touch;
    }

    .bbtb-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .bbtb-select {
        width: 100%;
    }

    .bbtb-print-btn {
        margin-left: 0;
        align-self: flex-end;
    }
}

@media (max-width: 767px) {
    .bbtb-table {
        font-size: 12px;
        min-width: 650px;           /* solo forzamos ancho mínimo en pantallas pequeñas */
    }

    .bbtb-extras-table {
        font-size: 12px;
        min-width: 420px;
    }

    /* Ocultar Primarias y Secundarias en móvil para ganar ancho */
    .bbtb-table th:nth-child(8),
    .bbtb-table td:nth-child(8),
    .bbtb-table th:nth-child(9),
    .bbtb-table td:nth-child(9) {
        display: none;
    }
}

/* ========================
   MODO IMPRESIÓN (PDF)
   ======================== */

@media print {

    body {
        background: #fff !important;
        color: #000 !important;
    }

    .bbtb-wrapper {
        background: #fff;
        color: #000;
        box-shadow: none;
        overflow: visible !important;
    }

    /* Ocultar controles y botón de exportar en el PDF */
    .bbtb-controls,
    .bbtb-print-btn {
        display: none !important;
    }

    /* Mostrar todas las columnas (por si en móvil estaban ocultas) */
    .bbtb-table th,
    .bbtb-table td {
        display: table-cell !important;
        font-size: 10pt;
    }

    .bbtb-table {
        min-width: 0 !important;
    }

    .bbtb-extras-table {
        min-width: 0 !important;
    }

    /* Quitar botones de + / - y dejar solo los números */
    .bbtb-btn,
    .bbtb-btn-minus,
    .bbtb-btn-plus {
        display: none !important;
    }

    .bbtb-qty-input {
        border: none;
        background: transparent;
        color: #000;
        width: auto;
        padding: 0;
    }
}
