/* style.css - VERSIÓN FINAL (OPTIMIZADA PARA SAFARI/IPHONE) */

/* --- Variables y Estilos Base --- */
:root {
    --color-fondo: #f4f4f9;
    --color-primario: #007bff;
    --color-secundario: #4CAF50; 
    --color-resaltado: #FFB347; 
    --color-texto: #333;
    --color-tabla-encabezado: #2c3e50;
    --color-wsp: #25D366; 
}

body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--color-fondo);
    color: var(--color-texto);
    font-size: 16px;
    -webkit-text-size-adjust: 100%; /* Evita que Safari infle el texto */
}

.contenedor {
    max-width: 1000px; 
    margin: 10px auto; 
    padding: 15px; 
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* --- Header y Títulos --- */
.header {
    text-align: center;
    margin-bottom: 20px;
}
.header img {
    width: 80px; 
    height: 80px;
    border-radius: 50%;
    border: 4px solid var(--color-resaltado);
    margin-bottom: 10px;
    object-fit: cover;
}
h1 {
    font-size: 1.5em; 
    color: var(--color-tabla-encabezado);
    border-bottom: 3px solid var(--color-resaltado);
    padding-bottom: 8px;
}
h2 {
    font-size: 1.3em;
    color: var(--color-primario);
    margin-top: 20px;
}

/* --- ENLACE DE ADMINISTRACIÓN (DISCRETO) --- */
.info-link-admin {
    display: flex; 
    justify-content: flex-end; 
    align-items: center;
    font-size: 0.9em;
    padding-bottom: 10px;
    width: 100%;
}

.info-link-admin p {
    display: none; 
}

.admin-link {
    font-size: 0.9em;
    color: #cccccc; 
    text-decoration: none;
    transition: color 0.2s;
    font-weight: bold;
    white-space: nowrap; 
    position: relative;
    top: -5px; 
    right: 5px;
}

.admin-link:hover {
    color: var(--color-primario); 
    text-decoration: underline;
}

/* ------------------------------------------------------------------- */
/* --- RANKING BASADO EN TARJETAS --- */
/* ------------------------------------------------------------------- */

.table-responsive {
    overflow: visible; 
}

#tabla-ranking thead {
    display: none; 
}

#tabla-ranking {
    width: 100%; 
    border-collapse: separate;
    border-spacing: 0 10px; 
}

#tabla-ranking tbody td {
    border: none !important; 
    padding: 0 !important; 
    display: flex; 
    align-items: stretch;
    width: 100%; 
}

#tabla-ranking tbody tr.ranking-card {
    display: flex; 
    align-items: stretch; 
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background-color: white;
    overflow: hidden; 
    width: 100%; 
}

#tabla-ranking tbody tr:first-child { 
    border: 2px solid var(--color-resaltado); 
}

.card-ranking-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px; 
    min-width: 70px;
    padding: 10px 0; 
    font-size: 1.6em; 
    font-weight: bold;
    color: white; 
    background-color: var(--color-primario); 
    border-right: 1px solid #eee;
}

#tabla-ranking tbody tr:first-child .card-ranking-number {
    background-color: var(--color-resaltado);
    color: var(--color-tabla-encabezado);
}

.card-data-container {
    display: flex; 
    flex-direction: column; 
    flex-grow: 1; 
    padding: 10px 25px 10px 25px; 
    line-height: 1.3;
}

.card-pareja-nombre {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--color-tabla-encabezado);
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
    padding-left: 0; 
}

.card-resultados-row {
    display: grid;
    grid-template-columns: repeat(4, auto) 1fr; 
    gap: 15px; 
    font-size: 0.9em;
    text-align: center;
    align-items: center;
    padding-left: 0; 
}

.card-resultados-row > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    min-width: 40px; 
}

.card-resultados-row > div:not(:last-child)::before {
    content: attr(data-label);
    font-weight: normal;
    color: #777;
    font-size: 0.8em; 
    margin-bottom: 2px;
}
.card-resultados-row > div:nth-child(1) { 
    font-weight: bold;
    color: var(--color-primario); 
}

.wsp-btn, #tabla-ranking button {
    background-color: var(--color-wsp);
    color: white !important;
    padding: 6px 8px;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    font-size: 0.8em; 
    cursor: pointer;
    transition: background-color 0.2s;
    display: block; 
    width: 100%;
    margin: 0;
}

@media (min-width: 768px) {
    .card-resultados-row {
        gap: 30px; 
        grid-template-columns: 1fr 1fr 1fr 1fr 150px; 
        text-align: left;
    }
    .card-resultados-row > div {
        align-items: flex-start;
    }
    .card-resultados-row > div:last-child {
        text-align: right;
        align-items: flex-end;
    }
    .wsp-btn, #tabla-ranking button {
        width: auto; 
    }
}

@media (max-width: 650px) {
    .card-ranking-number {
        width: 60px; 
        min-width: 60px; 
        font-size: 1.4em;
    }
    .card-data-container {
        padding: 10px; 
    }
    .card-resultados-row {
        grid-template-columns: repeat(4, 1fr);
        gap: 5px;
        margin-top: 5px;
        padding-bottom: 5px;
        border-bottom: 1px solid #eee;
    }
    .card-resultados-row > div:last-child {
        grid-column: 1 / -1; 
        padding-top: 10px;
    }
}

/* --- ESTILOS DE MODAL --- */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.8); 
}
.modal-content {
    background-color: #fefefe;
    margin: 10% auto; 
    padding: 20px;
    width: 95%; 
    max-width: 650px;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}
.close {
    color: #aaa;
    float: right;
    font-size: 30px;
    font-weight: bold;
}

/* --- ESTILOS LOGIN Y ADMIN --- */
.login-box {
    max-width: 400px;
    margin: 50px auto; 
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
}
.login-box img {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
}
.login-box h1 {
    font-size: 1.4em;
    color: var(--color-tabla-encabezado);
    border-bottom: 2px solid var(--color-primario);
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.login-box input[type="text"],
.login-box input[type="password"] {
    width: 90%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box; 
    font-size: 1em;
}
.login-box button {
    width: 98%;
    padding: 12px;
    background-color: var(--color-primario);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.2s;
}
.login-box button:hover {
    background-color: #0056b3;
}
.admin-footer {
    margin-top: 20px;
    font-size: 0.9em;
    text-align: center;
}
.admin-footer a {
    color: var(--color-primario);
    text-decoration: none;
}
.admin-footer a:hover {
    text-decoration: underline;
}

.admin-content .logo, 
.admin-content header img {
    width: 120px;       
    height: auto;       
    max-width: 100%;    
    display: block;   
    margin: 0 auto 20px auto; 
}

.admin-registro-form {
    padding: 0; 
    background: none; 
    box-shadow: none;
}

.form-row-admin {
    display: flex;
    flex-wrap: wrap; 
    gap: 15px; 
    justify-content: space-between;
    align-items: flex-end; 
    padding: 20px;
    background-color: #ecf0f1; 
    border-radius: 8px;
    margin-top: 15px;
}

.form-group-admin {
    display: flex;
    flex-direction: column;
    flex-grow: 1; 
    min-width: 150px; 
}

.form-group-admin label {
    font-weight: bold;
    color: var(--color-texto);
    margin-bottom: 5px;
    font-size: 0.9em;
}

.form-group-admin select,
.form-group-admin input[type="date"],
.form-group-admin input[type="time"],
.form-group-admin input[type="text"] {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
    width: 100%;
    box-sizing: border-box; 
}

.registro-btn {
    flex-grow: 1;
    min-width: 150px;
    background-color: var(--color-secundario); 
    color: white;
    padding: 12px;
    font-size: 1em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    align-self: flex-end; 
}
.registro-btn:hover {
    background-color: #388e3c;
}

@media (max-width: 650px) {
    .form-group-admin, .registro-btn {
        flex-basis: 100%; 
    }
}

.wsp-btn-compact {
    background-color: #25D366; 
    color: white;
    border: none;
    border-radius: 5px;
    padding: 3px 8px; 
    font-size: 0.75em; 
    display: inline-flex; 
    align-items: center;
    justify-content: center;
    text-decoration: none; 
    white-space: nowrap; 
    transition: background-color 0.2s ease-in-out, transform 0.1s ease;
}

.wsp-btn-compact:hover {
    background-color: #128C7E; 
    transform: translateY(-1px); 
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* --- ESTILOS AGENDA DE PARTIDOS --- */
.public-nav-link {
    font-size: 1em;
    color: var(--color-primario);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}
.public-nav-link:hover {
    color: var(--color-secundario);
    text-decoration: underline;
}

.date-group {
    margin-top: 20px; 
    text-align: center; 
}

.date-header {
    display: inline-block; 
    background-color: #e9ecef; 
    color: var(--color-texto);
    padding: 8px 15px;
    border-radius: 20px; 
    font-size: 1em;
    font-weight: bold;
    border: none; 
}

.match-schedule-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px; 
    padding: 15px; 
    margin-top: 15px;
    display: flex;
    flex-direction: column; 
    gap: 12px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    align-items: center; 
}

.match-info {
    display: flex;
    flex-direction: row; 
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1em; 
    color: var(--color-texto);
    width: 100%;
}

.pareja-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1; 
    text-align: center;
}

.pareja-name {
    font-weight: normal; 
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap; 
}

.rank-badge {
    background-color: #FFD700;
    color: #333;
    font-size: 0.7em; 
    font-weight: bold;
    padding: 2px 4px; 
    border-radius: 4px; 
    border: 1px solid #e0c200;
    vertical-align: middle;
}

.vs-text {
    color: #888; 
    font-size: 0.9em;
    font-weight: normal; 
    margin: 0;
}

.time-location-info {
    display: flex;
    flex-direction: row; 
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 0.9em; 
    color: #666;
    width: 100%;
}

.card-actions {
    display: flex;
    flex-direction: row;
    gap: 10px;
    width: 100%;
    justify-content: center;
    padding-top: 0; 
    border-top: none; 
}

.btn-modern {
    flex: 1; 
    max-width: 120px; 
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 10px; 
    border: none;
    border-radius: 8px; 
    font-size: 0.85em; 
    font-weight: 600;
    color: white;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.1s, box-shadow 0.1s;
    text-decoration: none;
}

.btn-modern:active {
    transform: scale(0.98);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.btn-invite { background: linear-gradient(135deg, #4CAF50 0%, #43A047 100%); }
.btn-edit { background: linear-gradient(135deg, #FFB347 0%, #FF9800 100%); }

@media (max-width: 400px) {
    .match-info {
        flex-direction: column; 
        gap: 5px;
    }
    .vs-text { margin: 2px 0; }
    .time-location-info {
        flex-direction: column; 
        gap: 5px;
    }
}

@media (min-width: 768px) {
    .match-schedule-card {
        flex-direction: row;
        align-items: center; 
        justify-content: space-between; 
        padding: 15px 25px; 
        gap: 20px;
    }
    .match-info {
        flex-direction: row;
        gap: 20px;
        margin-bottom: 0;
        flex-grow: 1; 
        justify-content: flex-start; 
    }
    .vs-text { margin: 0 10px; }
    .time-location-info {
        flex-direction: row;
        gap: 15px;
        margin-top: 0;
        margin-right: 20px; 
        background-color: transparent; 
        padding: 0;
    }
    .card-actions {
        width: auto;       
        margin-top: 0;     
        padding-top: 0;    
        border-top: none;  
        flex-direction: row;
        gap: 10px;
        flex-shrink: 0;    
    }
    .btn-modern {
        flex: none;        
        width: auto;       
        min-width: 110px;  
        padding: 8px 15px; 
        font-size: 0.9em;
    }
}

/* --- ESTILOS ADMIN_PARTIDOS --- */
.admin-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 20px;
    margin-top: 20px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.admin-table thead th {
    background-color: var(--color-tabla-encabezado);
    color: white;
    padding: 15px;
    text-align: center; 
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
}

.admin-table tbody td {
    padding: 15px 10px;
    border-bottom: 1px solid #eee;
    vertical-align: middle; 
    text-align: center;     
    color: #555;
}

.admin-table tbody tr:hover { background-color: #f9f9f9; }

.match-teams {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-weight: 500;
    color: var(--color-texto);
}

.vs-badge {
    background-color: #eee;
    color: #777;
    font-size: 0.7em;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 10px;
    margin: 4px 0;
}

.date-badge, .place-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.9em;
    background-color: #f4f4f9;
    font-weight: 500;
}

.time-badge {
    background-color: #e8f0fe !important; 
    color: #1967d2 !important;            
    font-weight: bold;
}

.acciones-cell { white-space: nowrap; }

.action-btn {
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: bold;
    color: white;
    margin: 0 2px;
    transition: transform 0.1s, box-shadow 0.1s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.edit-btn { background-color: #ff9800; }
.edit-btn:hover { background-color: #f57c00; }
.delete-btn { background-color: #f44336; }
.delete-btn:hover { background-color: #d32f2f; }

.share-wsp-btn {
    background-color: #25D366;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 8px 15px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px; 
    transition: background-color 0.2s;
    text-decoration: none;
}

.share-wsp-btn:hover { background-color: #128C7E; }

/* --- MENÚ CENTRALIZADO --- */
#admin-menu-container {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 25px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    border-bottom: 3px solid var(--color-primario);
}

.menu-btn {
    text-decoration: none;
    background-color: #f8f9fa;
    color: #555;
    padding: 10px 15px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9em;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.menu-btn:hover {
    background-color: #e2e6ea;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    color: #333;
}

.menu-btn.active {
    background-color: var(--color-primario);
    color: white;
    border-color: var(--color-primario);
}

.menu-btn.logout-btn {
    background-color: #ffebee;
    color: #d32f2f;
    border-color: #ffcdd2;
    margin-left: 10px; 
}

.menu-btn.logout-btn:hover {
    background-color: #d32f2f;
    color: white;
}

@media (max-width: 600px) {
    #admin-menu-container { gap: 5px; padding: 10px; }
    .menu-btn {
        flex-grow: 1; 
        justify-content: center;
        font-size: 0.85em;
        padding: 8px;
    }
    .menu-btn.logout-btn { margin-left: 0; width: 100%; }
}

/* ------------------------------------------------ */
/* --- ESTILOS CONTROLADOR MARCADOR (GENERAL)   --- */
/* ------------------------------------------------ */

.top-bar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.match-title-control {
    font-weight: 900;
    color: var(--color-tabla-encabezado);
    text-transform: uppercase;
}

.preview-box {
    margin-bottom: 20px;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 5px;
    background: #222; 
}

/* Grid Base (Desktop) */
.control-panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.team-column {
    background: #fdfdfd;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.team-1-col { border-top: 5px solid var(--color-primario); }
.team-2-col { border-top: 5px solid var(--color-resaltado); }

.team-name-display {
    text-align: center;
    font-size: clamp(0.75rem, 2.5vw, 1.1rem); 
    margin: 0 0 10px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: auto;
    font-weight: 800;
    text-transform: uppercase;
    color: #333;
}

.btn-serve {
    width: 100%;
    padding: 8px;
    border-radius: 20px;
    border: 2px solid #ccc;
    background: white;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-serve.active {
    background: #ccff00; 
    border-color: #99cc00;
    color: black;
    box-shadow: 0 0 10px rgba(204, 255, 0, 0.5);
}

.points-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.btn-point-plus {
    width: 100%;
    padding: clamp(10px, 3vw, 20px); 
    font-size: clamp(1rem, 4vw, 1.4rem); 
    font-weight: 900;
    background: var(--color-primario); 
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 0 #0056b3; 
    letter-spacing: 1px;
}

.btn-point-plus:active {
    transform: translateY(4px);
    box-shadow: none;
}

.btn-point-minus {
    width: 100%;
    padding: 8px;
    font-size: 0.9em;
    background: #ddd;
    color: #555;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.games-sets-row {
    display: flex;
    justify-content: space-between;
    gap: 5px;
}

.control-box {
    flex: 1;
    background: #eee;
    padding: 5px;
    border-radius: 6px;
    text-align: center;
}

.control-box span {
    font-size: 0.65em; 
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-pair { display: flex; gap: 2px; }

.btn-pair button {
    flex: 1;
    padding: clamp(5px, 2vw, 8px) 0;
    font-size: clamp(0.8rem, 3vw, 1rem);
    border: none;
    cursor: pointer;
    font-weight: bold;
}
.btn-pair button:first-child { background: #bbb; border-radius: 4px 0 0 4px; }
.btn-pair button:last-child { background: #ddd; border-radius: 0 4px 4px 0; }

.final-actions {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    border-top: 1px dashed #ccc;
    padding-top: 10px;
}

.btn-finalize, .btn-wo, .btn-reset-team, .btn-global-reset {
    border: none;
    padding: 8px;
    border-radius: 5px;
    font-size: 0.85em;
    font-weight: bold;
    cursor: pointer;
    color: white;
}

.btn-wo { grid-column: span 2; background-color: #6f42c1; }
.btn-finalize { background-color: #28a745; font-size: 0.75em; padding: 6px; }
.btn-reset-team { background-color: #6c757d; font-size: 0.75em; padding: 6px; }
.btn-global-reset { background-color: #dc3545; }

.active-set-control {
    margin-top: 20px;
    background: #f0f0f0;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

.set-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 5px;
}

.set-selector button {
    padding: 8px 15px;
    border: 1px solid #ccc;
    background: white;
    cursor: pointer;
    border-radius: 20px;
}

.set-selector button.active {
    background: #333;
    color: white;
    border-color: #000;
}

/* ========================================================================= */
/* --- CORRECCIONES CRÍTICAS PARA SAFARI / IPHONE / MÓVIL (FUERZA BRUTA) --- */
/* ========================================================================= */

@media (max-width: 768px) {
    /* 1. Ajuste general del contenedor */
    #score-controller {
        max-width: 100%;
        overflow-x: hidden;
    }

    /* 2. Forzar Grid de 2 columnas (NO APILAR) */
    .control-panel-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 5px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 3. TRUCO SAFARI: min-width: 0 permite que la columna se encoja */
    .team-column {
        min-width: 0 !important; 
        width: 100% !important;
        padding: 8px 4px !important; 
        overflow: hidden !important; 
    }

    /* 4. Asegurar que el nombre se corte y no empuje la columna */
    .team-name-display {
        font-size: 0.8rem !important; 
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        width: 100% !important;
        display: block !important;
        margin-bottom: 8px;
        line-height: 1.2;
    }

    /* 5. Ajustar botones para que no rompan el ancho */
    .btn-point-plus {
        padding: 12px 2px !important;
        font-size: 1rem !important;
        width: 100% !important;
    }

    .btn-serve {
        padding: 5px;
        font-size: 0.8em;
    }

    .btn-point-minus {
        padding: 5px;
        font-size: 0.75em;
    }

    .games-sets-row {
        flex-wrap: nowrap !important; 
    }
    
    .control-box {
        min-width: 0 !important; 
    }
    
    .control-box span {
        font-size: 0.6rem !important; 
    }
    
    .btn-pair button {
        padding: 6px 0 !important;
        font-size: 0.8rem !important;
    }

    /* 6. Botones finales en grid de 2x2 para ahorrar espacio */
    .final-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 4px !important;
    }
    
    .btn-wo { 
        grid-column: span 2 !important; 
        font-size: 0.7rem !important;
        padding: 5px 2px !important;
    }
    
    .btn-finalize, .btn-reset-team {
        font-size: 0.65rem !important;
        padding: 6px 2px !important;
        white-space: nowrap !important;
        width: 100% !important;
    }
    
    /* 7. Ajustar el preview del marcador */
    .preview-box {
        transform: scale(0.95);
        margin-bottom: 10px;
    }
}