* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #800020 0%, #4a0012 100%);
    min-height: 100vh;
    padding: 20px;
}

.container { max-width: 1400px; margin: 0 auto; }

/* Header con logo */
header {
    text-align: center;
    color: white;
    margin-bottom: 20px;
    position: relative;
}
.logo-area {
    position: absolute;
    left: 20px;
    top: 10px;
}
.logo {
    max-height: 60px;
    width: auto;
}
header h1 { font-size: 2rem; margin-bottom: 5px; text-shadow: 2px 2px 4px rgba(0,0,0,0.3); }
header p { font-size: 1rem; opacity: 0.9; }

/* Pestañas */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.tablink {
    background: #f8f9fa;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: 0.3s;
    color: #800020;
}
.tablink:hover { background: #e9ecef; }
.tablink.active {
    background: white;
    color: #800020;
    border-bottom: 3px solid #800020;
}
.tabcontent {
    display: none;
    animation: fadeEffect 0.3s;
}
@keyframes fadeEffect { from { opacity: 0; } to { opacity: 1; } }

/* Tarjetas */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    overflow: hidden;
}
.card-header {
    background: #f8f9fa;
    color: #800020;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    border-bottom: 2px solid #800020;
}
.card-header h2 { font-size: 1.3rem; display: flex; align-items: center; gap: 10px; }

/* Botones */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-primary { background: #6c757d; color: white; }
.btn-primary:hover { background: #5a6268; transform: translateY(-1px); }
.btn-secondary { background: #800020; color: white; }
.btn-secondary:hover { background: #6a001a; }
.btn-warning { background: #495057; color: white; }
.btn-small { padding: 4px 10px; font-size: 0.8rem; }

/* Tablas */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px; text-align: left; border-bottom: 1px solid #dee2e6; }
.table th { background: #f1f3f5; color: #800020; font-weight: 600; }

/* Badges */
.badge { padding: 3px 8px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; }
.badge.active { background: #28a745; color: white; }
.badge.inactive { background: #6c757d; color: white; }
.badge.success { background: #28a745; color: white; }
.badge.info { background: #17a2b8; color: white; }

/* Encuentros */
.encuentros-container { padding: 15px; display: flex; flex-direction: column; gap: 12px; }
.encuentro-card { border: 1px solid #dee2e6; border-radius: 10px; padding: 12px; background: #f8f9fa; }
.jugadores { display: flex; justify-content: space-between; align-items: center; text-align: center; margin: 10px 0; }
.jugador { flex: 1; padding: 8px; background: white; border-radius: 8px; }
.jugador.ganador { background: #d4edda; border: 1px solid #28a745; }
.vs { font-weight: bold; margin: 0 10px; color: #800020; }
.resultado-info { margin-top: 8px; text-align: center; padding: 6px; background: #e9ecef; border-radius: 6px; font-size: 0.9rem; }

/* Historial */
.historial-ronda { margin-bottom: 25px; border-left: 4px solid #800020; padding-left: 15px; }
.historial-ronda h3 { color: #800020; margin-bottom: 10px; }

/* Configuración */
.config-form { padding: 20px; }
.config-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 15px; margin-bottom: 20px; }
.config-item label { display: block; font-weight: 600; color: #495057; margin-bottom: 5px; }
.config-item input { width: 100%; padding: 8px; border: 1px solid #ced4da; border-radius: 6px; }
.config-note { padding: 0 20px 20px; color: #6c757d; font-size: 0.85rem; }

/* Modales (igual que antes, solo ajuste de color) */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); }
.modal-content { background: white; margin: 5% auto; padding: 20px; border-radius: 12px; width: 90%; max-width: 500px; position: relative; }
.modal-large { max-width: 800px; }
.close { position: absolute; right: 15px; top: 10px; font-size: 28px; cursor: pointer; }
.close:hover { color: #800020; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; }
.form-group input, .form-group select { width: 100%; padding: 8px; border: 1px solid #ced4da; border-radius: 6px; }
.radio-group { display: flex; gap: 15px; margin-top: 10px; }
.radio-label { display: flex; align-items: center; gap: 6px; }
.piezas-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }
.piezas-jugador { background: #f8f9fa; padding: 10px; border-radius: 8px; }
.pieza-item { display: flex; justify-content: space-between; margin-bottom: 8px; }
.pieza-item input { width: 70px; padding: 4px; }
.alert { padding: 12px; border-radius: 6px; margin-bottom: 20px; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.empty-state { text-align: center; padding: 40px; color: #6c757d; }
.champion-box { text-align: center; padding: 20px; background: linear-gradient(135deg, #ffd700, #ffed4e); margin: 15px; border-radius: 12px; animation: pulse 1s; }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.03); } 100% { transform: scale(1); } }
.round-info { background: #e9ecef; padding: 10px; text-align: center; margin: 15px; border-radius: 8px; color: #800020; }

/* Responsive */
@media (max-width: 768px) {
    .tabs { justify-content: center; }
    .tablink { padding: 8px 16px; font-size: 0.9rem; }
    .config-grid { grid-template-columns: 1fr; }
    .piezas-grid { grid-template-columns: 1fr; }
    .logo-area { position: static; text-align: center; margin-bottom: 10px; }
    header h1 { font-size: 1.5rem; }
}