/* style.css - Fharoo Kiosko de Ajedrez */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

.container {
    max-width: 900px;
    width: 100%;
}

header {
    text-align: center;
    padding: 20px 0 30px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: -0.5px;
}

header h1 span {
    color: #e94560;
}

.subtitle {
    color: #555;
    font-size: 1.1rem;
    margin-top: 5px;
}

/* --- Sección de entrada --- */
.input-section {
    background: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.input-section label {
    font-weight: 600;
    display: block;
    margin-bottom: 10px;
    font-size: 1rem;
}

.input-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.input-group input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #ddd;
    border-radius: 12px;
    font-size: 1rem;
    min-width: 200px;
    transition: border 0.2s;
}

.input-group input:focus {
    border-color: #1a1a2e;
    outline: none;
}

.input-group button {
    padding: 14px 32px;
    background: #1a1a2e;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
}

.input-group button:hover {
    background: #16213e;
}

.input-group button:active {
    transform: scale(0.97);
}

.status {
    margin-top: 14px;
    font-size: 0.95rem;
    color: #555;
    min-height: 24px;
}

.status.error {
    color: #e94560;
}

.status.success {
    color: #2d6a4f;
}

/* --- Sección de pareos --- */
#pairingsSection {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 20px 20px 10px;
    overflow: hidden;
}

.round-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #eee;
}

.round-info h2 {
    font-size: 1.5rem;
}

.controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-secondary, .btn-danger {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary {
    background: #e9ecef;
    color: #1a1a2e;
}

.btn-secondary:hover {
    background: #dee2e6;
}

.btn-danger {
    background: #e94560;
    color: white;
}

.btn-danger:hover {
    background: #d63851;
}

/* --- Tabla de pareos (versión móvil/cards) --- */
#pairingsTableContainer {
    overflow-x: auto;
}

.pairings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.pairings-table th {
    text-align: left;
    padding: 12px 8px;
    background: #f8f9fa;
    font-weight: 600;
    color: #444;
    border-bottom: 2px solid #eee;
}

.pairings-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.pairings-table tr:last-child td {
    border-bottom: none;
}

.pairings-table .mesa {
    font-weight: 600;
    color: #555;
    width: 60px;
}

.pairings-table .jugador {
    font-weight: 500;
}

.pairings-table .resultado-cell {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.result-btn {
    padding: 6px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    min-width: 44px;
    min-height: 44px; /* Área táctil cómoda */
}

.result-btn:active {
    transform: scale(0.93);
}

.result-btn.blancas {
    border-color: #2d6a4f;
    color: #2d6a4f;
}

.result-btn.blancas:hover, .result-btn.blancas.active {
    background: #2d6a4f;
    color: white;
}

.result-btn.negras {
    border-color: #1a1a2e;
    color: #1a1a2e;
}

.result-btn.negras:hover, .result-btn.negras.active {
    background: #1a1a2e;
    color: white;
}

.result-btn.tablas {
    border-color: #6c757d;
    color: #6c757d;
}

.result-btn.tablas:hover, .result-btn.tablas.active {
    background: #6c757d;
    color: white;
}

.result-btn.plus {
    border-color: #e94560;
    color: #e94560;
}

.result-btn.plus:hover, .result-btn.plus.active {
    background: #e94560;
    color: white;
}

.result-btn.selected {
    border-width: 3px;
    transform: scale(1.02);
}

.nota-cell {
    font-size: 0.8rem;
    color: #555;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 6px;
    margin-top: 4px;
    display: inline-block;
}

.nota-input {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.8rem;
    margin-top: 4px;
    background: #fafafa;
}

/* --- Responsive (móviles) --- */
@media (max-width: 700px) {
    .input-group {
        flex-direction: column;
    }
    .input-group button {
        width: 100%;
        justify-content: center;
    }
    .round-info {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .pairings-table {
        font-size: 0.85rem;
    }
    .pairings-table td, .pairings-table th {
        padding: 8px 4px;
    }
    .pairings-table .mesa {
        width: 40px;
        font-size: 0.8rem;
    }
    .result-btn {
        padding: 4px 8px;
        font-size: 0.75rem;
        min-width: 36px;
        min-height: 36px;
    }
    .pairings-table .jugador {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    body { padding: 10px; }
    header h1 { font-size: 2rem; }
    .input-section { padding: 16px; }
    .pairings-table .resultado-cell {
        gap: 4px;
    }
    .result-btn {
        padding: 3px 6px;
        font-size: 0.7rem;
        min-width: 32px;
        min-height: 32px;
    }
}