@import url('https://fonts.googleapis.com/css2?family=Enriqueta:wght@400;500;600;700&display=swap');

body{
  font-family:'Enriqueta', serif;
  background:#f8fafc;
  padding:24px;
  margin:0;
  min-height:100vh;
  box-sizing:border-box
}

* {
  box-sizing:border-box
}

.lc-card{
  max-width:560px;
  margin:24px auto;
  padding:20px;
  border:1px solid #e5e7eb;
  border-radius:16px;
  box-shadow:0 10px 20px rgba(0,0,0,.05);
  background:#fff
}

.lc-title{
  font-size:22px;
  font-weight:700;
  margin:0 0 12px
}

.lc-field{
  display:flex;
  gap:8px;
  margin:12px 0;
  align-items:center;
  flex-wrap:wrap
}

.lc-field input,
.lc-field select,
.lc-field textarea{
  flex:1;
  padding:10px 12px;
  border:1px solid #d1d5db;
  border-radius:12px;
  background:#fff;
  color:#111827
}

/* Campos numéricos con ancho fijo */
.lc-field input[type="number"]{
  flex:0 0 auto;
  width:80px;
  text-align:center
}

/* Campos de texto normales mantienen flex:1 */
.lc-field input[type="text"],
.lc-field input[type="email"]{
  flex:1
}

.lc-btn{
  padding:10px 14px;
  border-radius:12px;
  border:0;
  cursor:pointer;
  line-height:1
}

.lc-btn.primary{
  background:#1d73be;
  color:#fff
}

.lc-btn.ghost{
  background:transparent;
  border:1px solid #d1d5db;
  color: #63666b;
}

.lc-alert{
  color:#b91c1c;
  margin-top:8px
}

.lc-meta{
  font-size:12px;
  color:#6b7280;
  margin-top:8px
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablets y pantallas medianas */
@media (max-width: 768px) {
  body {
    padding: 16px;
  }
  
  .lc-card {
    margin: 16px auto;
    padding: 16px;
    max-width: 100%;
  }
  
  .lc-title {
    font-size: 20px;
  }
  
  .lc-field {
    align-items: stretch;
    gap: 6px;
  }
  
  .lc-field label {
    margin-bottom: 4px;
    font-weight: 500;
  }
  
  .lc-field input,
  .lc-field select,
  .lc-field textarea {
    width: 100%;
    margin: 0;
  }
  
  /* Campos numéricos en móvil */
  .lc-field input[type="number"] {
    width: 100%;
    max-width: 120px;
    align-self: center;
  }
  
  /* Botones en móvil */
  .lc-btn {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
  }
  
  /* Tablas responsive */
  table {
    font-size: 14px;
  }
  
  table th,
  table td {
    padding: 8px 4px;
    word-break: break-word;
  }
}

/* Móviles pequeños */
@media (max-width: 480px) {
  body {
    padding: 12px;
  }
  
  .lc-card {
    margin: 12px auto;
    padding: 12px;
    border-radius: 12px;
  }
  
  .lc-title {
    font-size: 18px;
    margin-bottom: 16px;
  }
  
  .lc-field {
    margin: 16px 0;
  }
  
  .lc-field input,
  .lc-field select,
  .lc-field textarea {
    padding: 12px;
    font-size: 16px; /* Evita zoom en iOS */
    border-radius: 8px;
  }
  
  .lc-btn {
    padding: 14px 16px;
    font-size: 16px;
    border-radius: 8px;
  }
  
  /* Participantes dinámicos en móvil */
  .lc-field[style*="border:1px solid #e5e7eb"] {
    padding: 12px;
    margin: 8px 0;
    border-radius: 8px;
  }
  
  .lc-field[style*="border:1px solid #e5e7eb"] .lc-field {
    margin: 4px 0;
  }
  
  /* Tablas en móvil */
  table {
    font-size: 12px;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  
  table th,
  table td {
    padding: 6px 4px;
    min-width: 60px;
  }
  
  /* Mensajes y alertas */
  .lc-meta {
    font-size: 11px;
    line-height: 1.4;
  }
  
  .lc-alert {
    font-size: 14px;
    margin-top: 12px;
  }
}

/* Móviles muy pequeños */
@media (max-width: 360px) {
  body {
    padding: 8px;
  }
  
  .lc-card {
    margin: 8px auto;
    padding: 10px;
  }
  
  .lc-title {
    font-size: 16px;
  }
  
  .lc-field input,
  .lc-field select,
  .lc-field textarea {
    padding: 10px;
    font-size: 14px;
  }
  
  .lc-btn {
    padding: 12px 14px;
    font-size: 14px;
  }
}

/* Landscape en móviles */
@media (max-width: 768px) and (orientation: landscape) {
  body {
    padding: 8px;
  }
  
  .lc-card {
    margin: 8px auto;
    padding: 12px;
  }
  
  .lc-field {
    flex-direction: row;
    align-items: center;
  }
  
  .lc-field label {
    min-width: 80px;
    margin-bottom: 0;
  }
}

/* Mejoras para accesibilidad */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Modo oscuro (si el usuario lo prefiere) */
@media (prefers-color-scheme: dark) {
  body {
    background: #1f2937;
    color: #f9fafb;
  }
  
  .lc-card {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
  }
  
  .lc-field input,
  .lc-field select,
  .lc-field textarea {
    background: #4b5563;
    border-color: #6b7280;
    color: #f9fafb;
  }
  
  .lc-field input::placeholder,
  .lc-field textarea::placeholder {
    color: #9ca3af;
  }
}

/* ===== ESTILOS ESPECÍFICOS PARA PARTICIPANTES ===== */

/* Contenedor de participantes */
#dep-participantes-list,
#bib-participantes-list {
  margin: 8px 0;
}

/* Participante individual */
.lc-field[style*="border:1px solid #e5e7eb"] {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Botón de eliminar participante */
.bib-remove-participante,
.dep-remove-participante {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 600;
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bib-remove-participante:hover,
.dep-remove-participante:hover {
  background: #fecaca;
  color: #991b1b;
}

/* Botón de añadir participante */
#dep-add-participante,
#bib-add-participante {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  margin-left: 8px;
}

#dep-add-participante:hover,
#bib-add-participante:hover {
  background: #e0f2fe;
  color: #0c4a6e;
}

/* Responsive para participantes */
@media (max-width: 768px) {
  .lc-field[style*="border:1px solid #e5e7eb"] {
    align-items: stretch;
    gap: 8px;
    padding: 16px;
  }
  
  .lc-field[style*="border:1px solid #e5e7eb"] .lc-field {
    margin: 4px 0;
    flex-direction: row;
    align-items: center;
  }
  
  .bib-remove-participante,
  .dep-remove-participante {
    align-self: flex-end;
    margin-top: 8px;
  }
  
  #dep-add-participante,
  #bib-add-participante {
    width: 100%;
    margin: 8px 0 0 0;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .lc-field[style*="border:1px solid #e5e7eb"] {
    padding: 12px;
    margin: 6px 0;
  }
  
  .bib-remove-participante,
  .dep-remove-participante {
    padding: 8px 12px;
    font-size: 16px;
    min-width: 40px;
    height: 40px;
  }
  
  #dep-add-participante,
  #bib-add-participante {
    padding: 12px 16px;
    font-size: 16px;
  }
}

/* ===== MEJORAS DE UX ===== */

/* Focus states mejorados */
.lc-field input:focus,
.lc-field select:focus,
.lc-field textarea:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  border-color: #3b82f6;
}

/* Estados de loading */
.lc-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Animaciones suaves */
.lc-field[style*="border:1px solid #e5e7eb"] {
  transition: all 0.2s ease;
}

.lc-field[style*="border:1px solid #e5e7eb"]:hover {
  border-color: #d1d5db;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Scroll suave en móviles */
@media (max-width: 768px) {
  html {
    scroll-behavior: smooth;
  }
  
  body {
    -webkit-overflow-scrolling: touch;
  }
}

/* ===== ESTILOS PARA GOMETS DEL SEMÁFORO ===== */

/* Contenedor de gomets */
.lc-field:has(#sf-verdes) {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lc-field:has(#sf-verdes) > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Labels de gomets con emojis */
label[for="sf-verdes"],
label[for="sf-amarillos"],
label[for="sf-rojos"] {
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 6px;
  width: 210px;
  min-width: 210px;
  flex: 0 0 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
}

label[for="sf-verdes"] {
  color: #059669 !important;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

label[for="sf-amarillos"] {
  color: #d97706 !important;
  background: #fffbeb;
  border: 1px solid #fed7aa;
}

label[for="sf-rojos"] {
  color: #dc2626 !important;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

/* Inputs de gomets */
#sf-verdes, #sf-amarillos, #sf-rojos {
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s ease;
  width: 100px;
  flex: 0 0 100px;
  box-sizing: border-box;
}

#sf-verdes:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

#sf-amarillos:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

#sf-rojos:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Responsive para gomets */
@media (max-width: 768px) {
  .lc-field:has(#sf-verdes) {
    padding: 16px;
  }
  
  label[for="sf-verdes"],
  label[for="sf-amarillos"],
  label[for="sf-rojos"] {
    width: 190px;
    min-width: 190px;
    flex: 0 0 190px;
  }
  
  #sf-verdes, #sf-amarillos, #sf-rojos {
    width: 80px;
    flex: 0 0 80px;
  }
}

@media (max-width: 480px) {
  label[for="sf-verdes"],
  label[for="sf-amarillos"],
  label[for="sf-rojos"] {
    font-size: 14px;
    padding: 8px 10px;
    width: 160px;
    min-width: 160px;
    flex: 0 0 160px;
  }
  
  #sf-verdes, #sf-amarillos, #sf-rojos {
    font-size: 16px;
    padding: 8px 10px;
    width: 70px;
    flex: 0 0 70px;
  }
}

/* ===== ESTILOS PARA PESTAÑAS DE DEPORTES ===== */

.lc-deportes-tabs {
  margin-top: 20px;
}

.lc-tab-buttons {
  display: flex;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 20px;
}

.lc-tab-btn {
  background: none;
  border: none;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
  position: relative;
}

.lc-tab-btn:hover {
  color: #374151;
  background-color: #f9fafb;
}

.lc-tab-btn.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
  background-color: #f0f9ff;
}

.lc-deportes-tab-content {
  display: none;
}

.lc-deportes-tab-content.active {
  display: block;
}

/* Selector de semana para calendario */
.lc-calendario-selector {
  margin-bottom: 20px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.lc-calendario-controls {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.lc-calendario-control {
  flex: 1;
  min-width: 200px;
}

.lc-calendario-label,
.lc-semana-label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  font-size: 14px;
}

.lc-calendario-deporte-select,
.lc-semana-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  font-size: 14px;
  color: #374151;
}

.lc-calendario-deporte-select:focus,
.lc-semana-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.lc-semana-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.lc-semana-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.lc-semana-select:hover {
  border-color: #9ca3af;
}

/* Estilos para el calendario */
.lc-calendario-container {
  background: #f8fafc;
  border-radius: 8px;
  padding: 20px;
  margin-top: 16px;
}

.lc-calendario-header {
  margin-bottom: 20px;
  text-align: center;
}

.lc-calendario-header h4 {
  color: #1f2937;
  margin: 0 0 8px 0;
  font-size: 20px;
}

.lc-calendario-header p {
  color: #6b7280;
  margin: 0;
  font-size: 14px;
}

.lc-jornada {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
  color: #000000;
}

.lc-jornada-header {
  background: #f3f4f6;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
  color: #374151;
}

.lc-partidos-list {
  padding: 0;
}

.lc-partido {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  transition: background-color 0.2s ease;
}

.lc-partido:last-child {
  border-bottom: none;
}

.lc-partido:hover {
  background-color: #f9fafb;
}

.lc-partido-equipos {
  display: flex !important;
  align-items: center !important;
  justify-content: space-evenly !important;
  flex: 1 !important;
}

.lc-equipo {
  font-weight: 500;
  color: #000000 !important;
}

.lc-resultado {
  background: #3b82f6;
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 14px;
  margin: 0 12px;
}

.lc-resultado.empate {
  background: #6b7280;
}

.lc-resultado.derrota {
  background: #dc2626;
}

.lc-resultado.victoria {
  background: #10b981;
}

.lc-partido-fecha {
  color: #6b7280;
  font-size: 12px;
  margin-left: 16px;
}

/* Responsive para pestañas */
@media (max-width: 768px) {
  .lc-tab-buttons {
    flex-direction: column;
  }
  
  .lc-tab-btn {
    width: 100%;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
    border-right: none;
  }
  
  .lc-tab-btn.active {
    border-bottom-color: #3b82f6;
    border-right: none;
  }
  
  .lc-partido {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .lc-partido-equipos {
    width: 100%;
    display: flex !important;
    align-items: center !important;
    justify-content: space-evenly !important;
  }
  
  .lc-partido-fecha {
    margin-left: 0;
    margin-top: 4px;
  }
}

/* ===== ESTILOS PARA PARTIDOS HORIZONTALES ===== */

/* Contenedor horizontal de partidos */
.lc-partidos-horizontal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  padding: 20px;
  background: #f8fafc;
  color: #000000;
}

/* Tarjeta individual de partido */
.lc-partido-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  min-width: 280px;
  max-width: 320px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex !important;
  justify-content: space-around !important;
  align-items: center !important;
  flex-direction: row !important;
}

.lc-partido-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Equipos dentro de la tarjeta */
.lc-partido-card .lc-partido-equipos {
  display: flex !important;
  align-items: center !important;
  justify-content: space-evenly !important;
  flex: 1 !important;
}

.lc-partido-card .lc-equipo {
  font-weight: 600;
  color: #000000 !important;
  font-size: 14px;
  flex: 1;
  text-align: center;
}

.lc-partido-card .lc-resultado {
  background: #3b82f6;
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 16px;
  margin: 0 12px;
  min-width: 60px;
  text-align: center;
  flex-shrink: 0;
}

.lc-partido-card .lc-resultado.empate {
  background: #6b7280;
}

.lc-partido-card .lc-resultado.derrota {
  background: #dc2626;
}

.lc-partido-card .lc-resultado.victoria {
  background: #10b981;
}

.lc-partido-card .lc-partido-fecha {
  color: #6b7280;
  font-size: 12px;
  text-align: center;
  font-style: italic;
  flex-shrink: 0;
  margin-left: 12px;
}

/* Forzar estilos para partido-card */
.lc-partidos-horizontal .lc-partido-card {
  display: flex !important;
  justify-content: space-around !important;
  align-items: center !important;
  flex-direction: row !important;
}

/* Forzar que lc-partido-equipos sea flex horizontal */
.lc-partidos-horizontal .lc-partido-card .lc-partido-equipos {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-evenly !important;
  flex: 1 !important;
}

/* Asegurar que el texto de los equipos sea negro */
.lc-partidos-horizontal .lc-partido-card .lc-equipo {
  color: #000000 !important;
}

.lc-partidos-horizontal .lc-partido-card .lc-partido-equipos .lc-equipo {
  color: #000000 !important;
}

/* Forzar estilos específicos para lc-partido-equipos */
.lc-partido-equipos {
  display: flex !important;
  align-items: center !important;
  justify-content: space-evenly !important;
  flex: 1 !important;
}

/* Regla con máxima especificidad para asegurar que se aplique */
div.lc-partido-equipos {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-evenly !important;
  flex: 1 !important;
}

/* Regla ultra específica para sobrescribir cualquier conflicto */
.lc-partidos-horizontal div.lc-partido-card div.lc-partido-equipos {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-evenly !important;
  flex: 1 !important;
}

.lc-partidos-horizontal .lc-partido-card .lc-partido-equipos {
  display: flex !important;
  align-items: center !important;
  justify-content: space-evenly !important;
  flex: 1 !important;
}

/* Responsive para partidos horizontales */
@media (max-width: 768px) {
  .lc-partidos-horizontal {
    flex-direction: column;
    align-items: center;
    padding: 16px;
  }
  
  .lc-partido-card {
    min-width: 100%;
    max-width: 100%;
  }
  
  /* Controles del calendario en móvil */
  .lc-calendario-controls {
    flex-direction: column;
    gap: 16px;
  }
  
  .lc-calendario-control {
    min-width: 100%;
  }
}