.hidden {
  display: none !important;
}

body {
  background: #111;
  color: #eee;
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
}

/* Logo y título */
#logo {
  text-align: center;
  margin-top: 20px;
}

#logo img {
  max-width: 180px;
  border-radius: 8px;
}

#title {
  text-align: center;
  font-size: 28px;
  margin: 10px 0;
  color: #1f6feb;
}

/* Sesión y botón salir */
#sessionBlock {
  text-align: center;
  margin-bottom: 20px;
}

#sessionInfo {
  margin-bottom: 10px;
}

#sessionBlock #logoutBtn {
  display: inline-block;
  margin-top: 8px;
}

#logoutBtn {
  display: none;
  margin: 20px auto;
  padding: 8px 16px;
  background: #1f6feb;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  text-align: center;
}

#logoutBtn:hover {
  background: #1259c3;
}

/* Ocultar secciones sensibles por defecto */
#playerSection,
#changePasswordSection,
#adminPanel,
#logoutBtn {
  display: none;
}

/* Paneles */
.panel {
  background: #1a1a1a;
  border-left: 4px solid #1f6feb;
  border-right: 4px solid #1f6feb;
  border-radius: 8px;
  padding: 20px;
  margin: 20px auto;
  width: 100%;
  max-width: 1000px;
  box-shadow: 0 0 12px #1f6feb55;
}

.panel h3 {
  margin-top: 0;
  color: #1f6feb;
}

/* Filas de inputs y botones */
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.row input,
.row select,
td input {
  flex: 1 1 300px;
  background: #222;
  color: #eee;
  padding: 8px;
  border-radius: 6px;
  border: none;
  font-size: 14px;
  width: 100%;
}

/* Botones generales */
.row button,
td button {
  background: #1f6feb;
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
}

.row button:hover,
td button:hover {
  background: #1259c3;
}

/* Botones dentro de tabla */
td button {
  padding: 6px 10px;
  margin-right: 6px;
  font-size: 13px;
  border-radius: 4px;
}

/* Botón eliminar */
td button.delete {
  background: #ff4444;
  color: #fff;
}

td button.delete:hover {
  background: #dd2222;
}

/* Tabla */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

th, td {
  padding: 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #1a1a1a;
  color: #1f6feb;
}

tr:hover {
  background: #222;
}

/* Texto pequeño */
.small {
  font-size: 12px;
  color: #aaa;
}

.footer {
  margin-top: 30px;
  padding: 10px;
  font-size: 13px;
  color: #888;
  text-align: center;
}

/* ===== PAGINACIÓN ===== */
#pagination {
  margin-top: 15px;
  text-align: center;
  width: 100%;
}

#pagination button {
  background: #1f6feb;
  color: white;
  border: none;
  padding: 8px 16px;
  margin: 0 6px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s ease;
}

#pagination button:hover {
  background: #1259c3;
}

#pagination span {
  font-weight: bold;
  margin: 0 8px;
  font-size: 14px;
  color: #eee;
}

/* ===========================================
   RESPONSIVE DESIGN — MOBILE FIRST
   =========================================== */

/* ====== Para pantallas de 900px o menos ====== */
@media (max-width: 900px) {

  /* Paneles más compactos */
  .panel {
    padding: 15px;
    margin: 15px;
  }

  #title {
    font-size: 24px;
  }

  table th,
  table td {
    padding: 8px;
    font-size: 14px;
  }

  /* Botones dentro de tabla */
  td button {
    margin-bottom: 6px;
    padding: 6px 8px;
  }

  /* Inputs más cómodos */
  .row input,
  .row select {
    flex: 1 1 100%;
  }
}


/* ====== Para pantallas de 600px o menos ====== */
@media (max-width: 600px) {

  body {
    font-size: 14px;
  }

  #logo img {
    max-width: 140px;
  }

  #title {
    font-size: 22px;
  }

  /* Inputs y botones en columna */
  .row {
    flex-direction: column;
    gap: 8px;
  }

  .row input,
  .row select,
  .row button {
    width: 100%;
    font-size: 15px;
    padding: 10px;
  }

  /* Tabla scrolleable horizontal para evitar romper el diseño */
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-spacing: 0;
  }

  table thead {
    font-size: 14px;
  }

  table tbody {
    font-size: 14px;
  }

  /* Botones de acción dentro de la tabla */
  td button {
    font-size: 12px;
    padding: 5px 8px;
    width: 100%;
    margin-bottom: 6px;
  }

  .actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  /* Paginación más grande, centrada y táctil */
  #pagination button {
    width: 100%;
    margin: 8px 0;
    padding: 12px;
    font-size: 16px;
    border-radius: 8px;
  }

  #pagination span {
    display: block;
    margin: 10px 0;
    font-size: 16px;
  }
}

/* ====== Ultrapequeñas (menos de 400px) ====== */
@media (max-width: 400px) {

  #title {
    font-size: 20px;
  }

  .panel {
    padding: 12px;
    margin: 10px;
  }

  table th,
  table td {
    padding: 6px;
  }

  td button {
    font-size: 11px;
    padding: 4px 6px;
  }
}

/* ===== SECCIÓN CAMBIAR CONTRASEÑA ===== */
#changePasswordSection {
  max-width: 1000px; /* Mismo ancho que otros paneles */
}

#changePasswordSection h3 {
  text-align: center;
}

#changePasswordSection .row {
  justify-content: center;
  max-width: 500px; /* Limitar ancho de inputs */
  margin-left: auto;
  margin-right: auto;
}

#changePasswordSection input {
  max-width: 100%;
}

#changePasswordSection button {
  width: 100%;
  max-width: 300px;
}

#changePasswordSection #changePassMsg {
  text-align: center;
  margin-top: 10px;
}