/* ================= RESET BÁSICO ================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow-x: hidden; /* solo bloqueo horizontal */
  font-family: Arial, Helvetica, sans-serif;
  background: #f2f2f2;
  font-size: 17px;
  color: #111;
}

/* ================= HEADER ================= */
.main-header {
  background: #c30000;
  color: #fff;
  padding: 18px 30px;
  position: relative;
}

.logo {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  height: 90px;
  width: auto;
}

.header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.header-center h1 {
  font-size: 30px;
  margin-bottom: 8px;
}

.header-center nav button {
  margin: 0 6px;
  padding: 10px 22px;
  font-size: 17px;
  cursor: pointer;
  border: none;
  background: #fff;
  color: #8b0000;
  border-radius: 4px;
}

.header-center nav button:hover {
  background: #eee;
}

/* ================= SECCIONES ================= */
.section {
  display: none;
  padding: 20px;
  /* quitamos height fija para permitir scroll natural */
}

.section.active {
  display: block;
}

/* ================= LAYOUT INICIO ================= */
.layout {
  display: flex;
  gap: 20px;
  flex-wrap: wrap; /* permite que las cajas bajen si no entran */
}

.box {
  background: #fff;
  padding: 20px;
  border-radius: 6px;
  flex: 1 1 300px; /* flexible, permite crecer y encoger */
}

/* ================= SOLO TABLA DE JUGADORES ================= */
#jugadores .table-wrapper {
  max-height: 400px;
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px;
}

#jugadores table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

#jugadores th, #jugadores td {
  border: 1px solid #999;
  padding: 8px;
  text-align: center;
  white-space: nowrap;
}

#jugadores th {
  background: #8b0000;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 2;
}

/* ================= FORMULARIOS ================= */
input, select {
  padding: 6px;
  font-size: 15px;
}

input[type="number"] {
  width: 60px;
}

hr {
  margin: 20px 0;
}

/* ================= MOBILE ================= */
@media (max-width: 768px) {
  
  .main-header {
    padding: 14px 12px;
  }

  .logo {
    left: 12px;
    top: 12px;
    transform: none;
    height: 60px;
  }

  .header-center {
    margin-left: 90px;
    align-items: flex-start;
    text-align: left;
  }

  .header-center h1 {
    font-size: 20px;
    line-height: 1.25;
  }

  .header-center nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
  }

  .header-center nav button {
    font-size: 14px;
    padding: 7px 14px;
  }

  .layout {
    flex-direction: column; /* cajas apiladas en móvil */
  }

  #jugadores table {
    min-width: 600px;
    font-size: 13px;
  }
}
