/* Estilos base generales */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 24px;
  font-family: var(--font-family-base);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-regular);
  line-height: 1.5;
  background: #f3f4f6;
  color: #111827;
}

.page-header h1 {
  margin: 0 0 4px;
}

.subtitle {
  margin: 0 0 24px;
  color: #6b7280;
  font-size: var(--font-size-body-sm);
  font-weight: var(--font-weight-regular);
}

/* Oculta los textos informativos del header sin eliminar los nodos */
.page-header .page-subtitle,
.page-header .subtitle {
  display: none;
}

/* Ocultar los pseudo-botones de modo bajo el menú principal */
.mode-badge--public,
.mode-badge--judge,
.mode-badge--info {
  display: none;
}

.layout {
  display: grid;
  gap: 18px;
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  grid-template-columns: 1fr;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 4px 6px;
  font-size: var(--font-size-body-sm);
  font-weight: var(--font-weight-regular);
}

.table th {
  font-weight: var(--font-weight-semibold);
}

.cell-max-piece {
  background-color: #dff7e3;
  color: #064e3b;
  font-weight: var(--font-weight-semibold);
}

#info-captures-by-manga-table th:nth-child(2),
#info-captures-by-manga-table td:nth-child(2) {
  text-align: center;
}

/* Tarjetas */

.card {
  background: #ffffff;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  border: 1px solid #e5e7eb;
}

.card h2 {
  margin-top: 0;
}

/* Estado */

.status {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.95rem;
  margin: 0 0 4px;
}

.status--ok {
  background: #ecfdf3;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.status--error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.system-status-card {
  border: 1px solid rgba(29, 127, 166, 0.35);
  background: #f3f4f6;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  position: relative;
  overflow: hidden;
}

.system-status-card::before {
  content: '🪸'; /* Icono marino */
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 1.4rem;
  opacity: 0.85;
}

.system-status-card h2 {
  margin-top: 0;
  margin-bottom: 8px;
  font-weight: 750;
}

/* Estado del sistema: mostrar solo selector de campeonato */
.system-status-card h2,
.system-status-card #status-msg,
.system-status-card .hint {
  display: none;
}

.system-status-card > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0;
  margin: 0;
}

.system-status-card > div span:first-child {
  display: block;
  font-size: 1rem;
  font-weight: 650;
  color: #0f172a;
  letter-spacing: 0.01em;
}

.system-status-card #public-tournament-select {
  width: 100%;
  max-width: 360px;
  font-size: 1rem;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background-color: #ffffff;
  color: #111827;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  margin: 0;
  margin-left: 0 !important;
  box-sizing: border-box;
}

.hint {
  margin: 0;
  font-size: 0.85rem;
  color: #6b7280;
}

/* Formulario Crear campeonato */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px 18px;
  margin-top: 10px;
}

.field {
  display: flex;
  flex-direction: column;
}

.field--full {
  grid-column: 1 / -1;
}

label {
  font-size: var(--font-size-body-sm);
  font-weight: var(--font-weight-semibold);
  color: #4b5563;
  margin-bottom: 6px;
}

input[type="text"],
input[type="number"],
input[type="password"] {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  font: inherit;
}

input:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 1px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 1px;
}

.btn-primary {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: #2563eb;
  color: #ffffff;
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-semibold);
}

.btn-primary:hover {
  background: #1d4ed8;
}

.mode-toggle-btn {
  margin-left: auto;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  border: 1px solid #d1d5db;
  background: #f3f4ff;
  cursor: pointer;
}

.btn-secondary {
  display: inline-block;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  cursor: pointer;
  background: #ffffff;
  color: #374151;
  font-size: var(--font-size-body-sm);
  font-weight: var(--font-weight-semibold);
}

.btn-secondary:hover {
  background: #f3f4f6;
}

.btn-link {
  background: none;
  border: none;
  color: #2563eb;
  cursor: pointer;
  font-weight: 600;
  padding: 4px 8px;
}

.btn-link:hover {
  text-decoration: underline;
}

.setup-preview {
  margin-top: 10px;
  font-size: 0.95rem;
  color: #111827;
}
.table-ranking {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
}

.table-ranking th,
.table-ranking td {
  padding: 8px 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.table-ranking thead th {
  background: #f3f4f6;
  font-weight: 600;
}

.table-ranking tbody tr:nth-child(even) {
  background: #f9fafb;
}

.table-ranking tbody tr:hover {
  background: #eff6ff;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 14px;
}

.table th,
.table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.table thead th {
  background: #f8fafc;
  font-weight: 600;
}

.table tbody tr:nth-child(even) {
  background: #f9fafb;
}

.table tbody tr:hover {
  background: #eff6ff;
}

/* Modo publico: ocultar secciones de juez */
body.mode-public .card--judge,
body.mode-public .card--setup,
body.mode-public .card--capture,
body.mode-public .card--captures-list,
body.mode-public .panel--captures-list {
  display: none;
}

.main-tabs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.tab-button {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  cursor: pointer;
  font-weight: 600;
}

.tab-button.is-active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.is-hidden {
  display: none;
}

.help-text {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 6px;
}

.feedback-message {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #155724;
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  padding: 4px 6px;
  border-radius: 3px;
}

.highlight-new {
  animation: highlightFade 1s ease-out;
}

@keyframes highlightFade {
  0% { background-color: #fff3cd; }
  100% { background-color: transparent; }
}

.public-header {
  margin-bottom: 10px;
}

.public-header h2 {
  font-size: 1.2rem;
  margin: 0 0 4px;
}

.public-header p {
  margin: 0;
  font-size: 0.9rem;
  color: #555;
}

.judge-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.panel,
.info-panel {
  padding: 10px;
  margin-bottom: 10px;
}

.form-row {
  display: flex;
  gap: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  box-sizing: border-box;
}

.btn {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 0.95rem;
}

@media (max-width: 768px) {
  .judge-toolbar .btn,
  .main-tabs button,
  .main-tabs a {
    flex: 1 1 100%;
  }

  .form-row {
    flex-direction: column;
  }

  .table th,
  .table td {
    font-size: 0.85rem;
  }
}

/* ===========================
   SELECCIÓN DE TEXTO
   =========================== */

::selection {
  background-color: rgba(29, 127, 166, 0.25);
  color: #ffffff;
}

::-moz-selection {
  background-color: rgba(29, 127, 166, 0.25);
  color: #ffffff;
}

/* ===========================
   SCROLLBAR (NAVEGADORES WEBKIT)
   =========================== */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.6);
}

/* ===========================
   FOCUS ACCESIBLE EN BOTONES / ENLACES
   =========================== */

a:focus-visible,
.btn:focus-visible,
.btn-primary:focus-visible,
.tab-button:focus-visible,
button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}

a:focus,
.btn:focus,
.btn-primary:focus,
.tab-button:focus,
button:focus {
  outline: none;
}

@media print {
  /* Tipografía y márgenes generales en papel */
  body {
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 11pt;
    line-height: 1.3;
  }

  h1 {
    font-size: 18pt;
    margin-bottom: 6pt;
  }

  h2 {
    font-size: 14pt;
    margin-top: 10pt;
    margin-bottom: 4pt;
  }

  h3 {
    font-size: 12pt;
    margin-top: 8pt;
    margin-bottom: 3pt;
  }

  p {
    font-size: 10pt;
    margin: 0 0 3pt;
  }

  /* Paneles sin fondo ni sombras, sólo borde fino */
  .panel,
  .info-panel {
    background: #ffffff !important;
    border-radius: 0;
    box-shadow: none !important;
    border: 1px solid #999999;
    margin-bottom: 8pt;
    padding: 6pt 8pt;
  }

  /* Tablas en modo acta: bordes finos, sin colores fuertes */
  .table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9pt;
  }

  .table th,
  .table td {
    border: 1px solid #cccccc;
    padding: 3pt 4pt;
    white-space: nowrap;
  }

  .table thead {
    background: #f2f2f2 !important;
  }

  .table tbody tr:nth-child(even) {
    background: #ffffff !important;
  }

  /* Encabezado de secciones finales (Incidencias, Firmas) */
  .info-section-title {
    font-size: 12pt;
    margin-top: 10pt;
    margin-bottom: 4pt;
    font-weight: 600;
  }
}

@media (max-width: 480px) {
  .table th,
  .table td {
    font-size: 0.8rem;
  }

  .public-header h2 {
    font-size: 1.3rem;
  }

  .btn {
    font-size: 1rem;
  }
}

/* ===========================
   LAYOUT CENTRADO
   =========================== */

/* Centrar las vistas principales usando .layout como contenedor */
.layout {
  /* Ajuste de layout para aprovechar mejor el ancho en escritorio */
  max-width: 1360px;
  margin: 0 auto;
}

@media (min-width: 1100px) {
  .layout {
    /* En escritorio, dos columnas fluidas cuando hay espacio */
    grid-template-columns: repeat(auto-fit, minmax(520px, 1fr));
  }

  /* Paneles de tablas largas se mantienen a ancho completo */
  .layout > .panel--ranking,
  .layout > .panel--captures-list,
  .layout > #panel-capturas,
  .layout > #panel-participants,
  .layout > #panel-sector-ranking,
  .layout > #judge-editor-card {
    grid-column: 1 / -1;
  }
}

/* En pantallas pequeñas, usar casi todo el ancho */
@media (max-width: 768px) {
  .layout {
    max-width: 100%;
    margin: 0 auto;
    padding: 10px 12px;
  }
}

/* ===========================
   TÍTULO PRINCIPAL / HEADER
   =========================== */

/* Título principal de la app (por si existe .app-title) */
.app-title {
  font-size: 1.6rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 8px 0 6px;
  color: #f9fcff;
}

.page-title {
  /* Jerarquía reforzada para el título principal */
  font-size: clamp(2.2rem, 2.8vw, 2.7rem);
  font-weight: 820;
  letter-spacing: 0.015em;
  margin: 4px 0 12px;
  color: #f9fcff;
}

.icon-wave,
.icon-fish,
.icon-buoy {
  /* Iconografía sutil de pesca/mar */
  display: inline-block;
  margin-right: 8px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.icon-wave::before {
  content: "🌊";
}

.icon-fish::before {
  content: "🐟";
}

.icon-buoy::before {
  content: "⛵";
}

.page-subtitle {
  font-size: 1.05rem;
  font-weight: 620;
  color: rgba(233, 243, 255, 0.9);
  margin: 0 0 14px;
}

/* Estilo general de h1 (por ejemplo "Campeonato de Pesca – MVP") */
h1 {
  font-family: var(--font-family-base);
  font-size: var(--font-size-h1);
  font-weight: var(--font-weight-black);
  letter-spacing: 0.01em;
  color: #f9fcff;
  margin: 8px 0 6px;
}

/* Subtítulo o texto bajo el título, si lo hubiera */
header p,
.app-subtitle {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: rgba(233, 243, 255, 0.8);
}

/* Pequeño separador visual debajo del header */
header {
  margin-bottom: 10px;
}

/* ===========================
   ESTADO DEL SISTEMA / ALERTAS
   =========================== */

/* Contenedor de estado del sistema, si existe */
.system-status,
#system-status {
  margin-bottom: 10px;
}

/* Estilo genérico de alertas */
.alert {
  border-radius: var(--radius-md);
  padding: 8px 10px;
  font-size: 0.9rem;
  margin-bottom: 8px;
  border: 1px solid transparent;
}

/* Mensaje de éxito (por ejemplo, "Se ha recuperado un campeonato guardado") */
.alert-success {
  background-color: #e3f6e8;
  border-color: #b6e1c2;
  color: #146c43;
}

/* Mensaje informativo */
.alert-info {
  background-color: #e3f0ff;
  border-color: #c3d5ff;
  color: #234f8a;
}

/* Mensaje de error */
.alert-danger,
.alert-error {
  background-color: #fde2e1;
  border-color: #f4b7b3;
  color: #b42318;
}

/* Icono o texto fuerte dentro de la alerta */
.alert strong {
  font-weight: 600;
}

/* Versión más suave para móvil (mismos colores, menos margen) */
@media (max-width: 768px) {
  .alert {
    font-size: 0.85rem;
    padding: 7px 8px;
  }
}

/* ===========================
   FORMULARIOS GENERALES
   =========================== */

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  box-sizing: border-box;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  padding: 10px 12px;
  font-size: 0.95rem;
  background-color: #ffffff;
  color: var(--color-text-main);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(29, 127, 166, 0.18);
  background-color: #fdfefe;
}

/* Fila de formulario con dos columnas posibles */
.form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.form-row .form-group {
  flex: 1 1 0;
}

/* En móvil, una sola columna */
@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
  }
}

/* Textareas un poco más cómodas */
textarea {
  resize: vertical;
  min-height: 70px;
}

/* ===========================
   PANEL FIRMAS DE JUECES
   =========================== */

#judge-signatures-panel {
  border-left: 4px solid var(--color-primary);
  background: linear-gradient(135deg, #f7fafc, #ffffff);
}

#judge-signatures-panel h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1rem;
  margin-bottom: 6px;
}

#judge-signatures-panel h3::before {
  content: "✍";
  font-size: 1rem;
}

/* Lista de firmas */
#judge-signatures-list {
  list-style: none;
  padding-left: 0;
  margin: 6px 0 0;
}

#judge-signatures-list li {
  padding: 4px 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background-color: var(--color-surface-alt);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

/* Animación ya usada para la última firma, suavizada */
.highlight-new {
  animation: highlightFade 1s ease-out;
}

@keyframes highlightFade {
  0% {
    background-color: #fff3cd;
  }
  100% {
    background-color: var(--color-surface-alt);
  }
}

/* ===========================
   PANEL INCIDENCIAS
   =========================== */

#judge-incidents-panel {
  border-left: 4px solid var(--color-accent);
  background: linear-gradient(135deg, #fffaf1, #ffffff);
}

#judge-incidents-panel h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1rem;
  margin-bottom: 4px;
}

#judge-incidents-panel h3::before {
  content: "⚠";
  font-size: 1rem;
}

/* Feedback de incidencias ya existente, ajustado al diseño */
#judge-incidents-feedback,
.feedback-message {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #146c43;
  background-color: #e3f6e8;
  border: 1px solid #b6e1c2;
  padding: 4px 6px;
  border-radius: var(--radius-md);
}

/* Pequeños textos de ayuda */
.help-text {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ===========================
   AJUSTES PARA MÓVIL
   =========================== */

@media (max-width: 768px) {
  #judge-signatures-panel,
  #judge-incidents-panel {
    padding: 10px;
  }

  #judge-signatures-list li {
    font-size: 0.85rem;
  }
}
/* ===========================
   NAV DE PESTAÑAS PRINCIPALES
   =========================== */

.main-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding: 6px 0;
}

/* Botones de pestaña genéricos */
.main-tabs button,
.main-tabs a,
.tab-button {
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  background-color: rgba(255, 255, 255, 0.06);
  color: #e9f3ff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.1s ease;
}

/* Estado activo de pestaña */
.main-tabs .is-active,
.tab-button.is-active {
  background: linear-gradient(135deg, var(--color-primary), #27a6d5);
  color: #ffffff;
  box-shadow: var(--shadow-soft);
}

/* Hover */
.main-tabs button:hover,
.main-tabs a:hover,
.tab-button:hover {
  background-color: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

/* Refuerzo visual de tabs: contraste, hover y activo más marcado */
.main-tabs button,
.main-tabs a,
.tab-button {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 9px 16px;
  background-color: rgba(255, 255, 255, 0.1);
  color: #e9f3ff;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.1s ease, color 0.15s ease;
}

.main-tabs .is-active,
.tab-button.is-active {
  background: linear-gradient(135deg, var(--color-primary), #27a6d5);
  color: #ffffff;
  border-color: rgba(39, 166, 213, 0.7);
  box-shadow: var(--shadow-soft), inset 0 -3px 0 0 var(--color-accent);
}

.main-tabs button:hover,
.main-tabs a:hover,
.tab-button:hover {
  background-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

/* Badge de modo actual unificado (barra con línea de acento) */
.mode-badge {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.88rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(135deg, rgba(15, 31, 45, 0.92), rgba(12, 26, 39, 0.85));
  color: #f9fcff;
  border: 1px solid rgba(245, 194, 107, 0.55);
  box-shadow:
    inset 0 2px 0 rgba(245, 194, 107, 0.6),
    0 10px 24px rgba(0, 0, 0, 0.22);
  margin: 0 0 10px;
}

.mode-badge--public {
  background: linear-gradient(135deg, rgba(39, 166, 213, 0.18), rgba(12, 26, 39, 0.85));
  border-color: rgba(39, 166, 213, 0.45);
}

.mode-badge--judge {
  background: linear-gradient(135deg, rgba(245, 194, 107, 0.18), rgba(12, 26, 39, 0.85));
}

.mode-badge--create {
  background: linear-gradient(135deg, rgba(29, 127, 166, 0.18), rgba(12, 26, 39, 0.85));
  border-color: rgba(29, 127, 166, 0.45);
}

.mode-badge--info {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(12, 26, 39, 0.85));
  border-color: rgba(255, 255, 255, 0.35);
}

/* Oculta los pseudo-botones de modo bajo el menú principal (mantiene nodos) */
.mode-badge--public,
.mode-badge--judge,
.mode-badge--info {
  display: none;
}

#view-create .create-form-card {
  /* Layout simplificado: solo el formulario bajo la barra de modo */
  padding: 18px 20px;
}

/* ===========================
   BOTONES GENERALES
   =========================== */

.btn {
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.1s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Variantes */
.btn-primary {
  /* Botón CTA principal unificado */
  background-color: #1d7fa6;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(29, 127, 166, 0.28);
  font-size: 1rem;
  font-weight: 700;
  padding: 13px 20px;
  min-height: 48px;
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.08);
  color: #e9f3ff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: var(--font-size-body-sm);
  font-weight: var(--font-weight-semibold);
}

.btn-danger {
  background-color: #d9534f;
  color: #ffffff;
}

/* Hover y active */
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-primary:hover {
  background-color: #17688a;
  box-shadow: 0 10px 22px rgba(29, 127, 166, 0.32);
}

.btn-primary:active {
  background-color: #145a77;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.18);
}

/* Botones pequeños opcionales */
.btn-small {
  padding: 6px 10px;
  font-size: 0.8rem;
}

/* Botones de acción en tablas */
.action-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.1);
  color: #0f1f2d;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.1s ease, color 0.1s ease;
}

.action-button span {
  font-weight: 600;
}

.action-edit {
  background: rgba(39, 166, 213, 0.16);
  color: #0f1f2d;
  border-color: rgba(39, 166, 213, 0.4);
}

.action-delete {
  background: rgba(239, 68, 68, 0.14);
  color: #7f1d1d;
  border-color: rgba(239, 68, 68, 0.35);
}

.action-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.action-edit:hover {
  background: rgba(39, 166, 213, 0.24);
}

.action-delete:hover {
  background: rgba(239, 68, 68, 0.22);
}

/* ===========================
   BARRA DE HERRAMIENTAS JUEZ
   =========================== */

.judge-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

/* En móvil, botones de la barra ocupan todo el ancho */
@media (max-width: 768px) {
  .judge-toolbar .btn,
  .main-tabs button,
  .main-tabs a,
  .tab-button {
    flex: 1 1 100%;
  }
}

/* Barra de herramientas juez: estilo reforzado */
.judge-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.judge-toolbar .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background-color: rgba(15, 23, 42, 0.9);
  color: #ffffff;
  font-size: var(--font-size-body-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.judge-toolbar .btn:hover {
  background-color: rgba(37, 46, 70, 0.95);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.judge-toolbar .btn:active {
  transform: translateY(1px);
}

.judge-toolbar .btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .judge-toolbar {
    justify-content: flex-start;
  }

  .judge-toolbar .btn {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }
}
:root {
  /* Paleta mar / pesca */
  --color-bg: #0b1721;
  --color-surface: #f7fafc;
  --color-surface-alt: #eef4f8;
  --color-primary: #1d7fa6;
  --color-primary-soft: #e1f2f7;
  --color-accent: #f5c26b;
  --color-border: #d0d8e0;
  --color-text-main: #1a2733;
  --color-text-muted: #5b6b7c;

  /* Tipografía global */
  --font-family-base: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-size-h1: 2rem;    /* 32px */
  --font-size-h2: 1.5rem;  /* 24px */
  --font-size-h3: 1.25rem; /* 20px */
  --font-size-body: 1rem;        /* 16px */
  --font-size-body-sm: 0.95rem;  /* 15px */
  --font-size-small: 0.85rem;    /* 14px */
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-black: 800;

  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.08);
  --font-main: var(--font-family-base);
}

/* Fondo general y tipografía base */
html, body {
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-regular);
  line-height: 1.5;
  /* Fondo global aclarado con degradado marino y ruido sutil para evitar efecto túnel */
  background-color: #0f1f2d;
  background-image:
    radial-gradient(circle at 20% 15%, rgba(37, 127, 166, 0.12), rgba(15, 31, 45, 0)),
    radial-gradient(circle at 80% 0%, rgba(245, 194, 107, 0.08), rgba(15, 31, 45, 0)),
    linear-gradient(160deg, #142636 0%, #0c1a27 52%, #07111b 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  background-blend-mode: screen, screen, normal, normal;
  background-attachment: fixed;
  color: var(--color-text-main);
}

/* Contenedores generales */
.layout {
  padding: 16px 20px;
}

/* Paneles / tarjetas */
.panel,
.info-panel {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

/* Tablas genéricas */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th,
.table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  white-space: nowrap;
}

.table thead {
  background-color: var(--color-primary-soft);
}

.table tbody tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.02);
}

.table tbody tr:hover {
  background-color: rgba(37, 127, 166, 0.06);
}

.table th:nth-child(1),
.table td:nth-child(1) {
  text-align: center;
}

.table th:nth-child(3),
.table td:nth-child(3),
.table th:nth-child(4),
.table td:nth-child(4),
.table th:nth-child(5),
.table td:nth-child(5),
.table th:nth-child(6),
.table td:nth-child(6),
.table th:nth-child(7),
.table td:nth-child(7) {
  text-align: center;
}

.table th:nth-child(2),
.table td:nth-child(2) {
  min-width: 160px;
  font-weight: 600;
}

.table th.sortable {
  cursor: pointer;
  position: relative;
}

.table th.sortable::after {
  content: '↕';
  font-size: 0.75rem;
  opacity: 0.6;
  margin-left: 6px;
}

.table th {
  font-weight: 700;
  color: var(--color-text-main);
  letter-spacing: 0.01em;
  border-bottom: 2px solid rgba(0, 0, 0, 0.08);
  background-color: rgba(255, 255, 255, 0.6);
}

/* Vista pública: títulos y textos */
#view-public h2 {
  font-size: 1.2rem;
  margin-bottom: 6px;
}

#view-public h3 {
  font-size: 1rem;
  margin: 8px 0 4px;
}

#view-public p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* Cabecera del campeonato en modo público */
#public-tournament-header {
  text-align: center;
  margin-top: 8px;
}

#public-tournament-name {
  display: block;
  font-size: 1.25rem;
  font-weight: 720;
  letter-spacing: 0.01em;
  color: #f9fcff;
  margin: 0 0 4px;
}

#public-tournament-meta {
  font-size: 1.00rem;
  font-weight: 500;
  color: #ffffff;
  text-align: center;
  margin: 4px 0 0;
}

/* Mensajes de ayuda */
.help-text,
.small {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Ajuste móvil básico */
@media (max-width: 768px) {
  .layout {
    padding: 8px;
  }

  .table th,
  .table td {
    font-size: 0.8rem;
  }
}

/* ===========================
   VISTA PÚBLICA – CONTENEDOR
   =========================== */

#view-public {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Paneles dentro de la vista pública */
#view-public .panel,
#view-public .info-panel {
  background: linear-gradient(135deg, #f8fbff, #ffffff);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(0, 0, 0, 0.03);
  padding: 12px 14px;
}

/* Pequeño espacio entre título del panel y contenido */
#view-public .panel h2,
#view-public .panel h3 {
  margin-top: 0;
  margin-bottom: 6px;
}

/* ===========================
  VISTA PÚBLICA – CABECERAS
   =========================== */

#view-public h2 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

#view-public h3 {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background-color: var(--color-primary-soft);
  color: var(--color-text-main);
  font-size: 0.95rem;
  font-weight: 500;
}

/* Texto descriptivo bajo los títulos */
#view-public p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* ===========================
   VISTA PÚBLICA – TABLAS
   =========================== */

/* Tablas dentro de la vista pública: un poco más compactas */
#view-public .table th,
#view-public .table td {
  padding: 5px 7px;
  font-size: 0.85rem;
}

/* Cabecera ligeramente destacada */
#view-public .table thead {
  background-color: var(--color-primary-soft);
}

/* Fila con hover suave para leer mejor en móvil/escritorio */
#view-public .table tbody tr:hover {
  background-color: #eef5ff;
}

/* Primer fila un poco más marcada (suele ser el líder) */
#view-public .table tbody tr:first-child {
  font-weight: 600;
}

/* ===========================
   VISTA PÚBLICA – ESPACIADO
   =========================== */

@media (max-width: 768px) {
  #view-public {
    gap: 10px;
  }

  #view-public .panel,
  #view-public .info-panel {
    padding: 10px;
    margin-left: 0;
    margin-right: 0;
  }

  #view-public .table th,
  #view-public .table td {
    font-size: 0.8rem;
  }
}

/* ===========================
   PESTAÑA INFORMACIÓN (#view-info)
   =========================== */

#view-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Paneles dentro de info */
#view-info .panel,
#view-info .info-panel {
  background: linear-gradient(135deg, #f5f8fc, #ffffff);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(0, 0, 0, 0.03);
  padding: 12px 14px;
}

/* Títulos y subtítulos */
#view-info h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 6px;
}

#view-info h3 {
  font-size: 1rem;
  font-weight: 550;
  margin: 8px 0 4px;
}

/* Texto de ayuda dentro de info */
#view-info .help-text {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

/* ===========================
   BLOQUE DATOS BÁSICOS
   =========================== */

#view-info .tournament-basic,
#info-basic-panel {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#view-info .tournament-basic p,
#info-basic-panel p {
  margin: 0;
  font-size: 0.9rem;
}

/* Etiquetas "Nombre", "Lugar", etc. */
#view-info .tournament-basic strong,
#info-basic-panel strong {
  color: var(--color-text-main);
}

/* Badge pequeño para el nombre del campeonato si se usa span.badge */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  background-color: var(--color-primary-soft);
  color: var(--color-text-main);
}

/* ===========================
   TABLA DE PARTICIPANTES
   =========================== */

#view-info .participants-table,
#view-info #info-participants-table {
  width: 100%;
}

#view-info .participants-table th,
#view-info .participants-table td,
#view-info #info-participants-table th,
#view-info #info-participants-table td {
  padding: 5px 7px;
  font-size: 0.85rem;
}

#view-info .participants-table tbody tr:nth-child(even),
#view-info #info-participants-table tbody tr:nth-child(even) {
  background-color: var(--color-surface-alt);
}

/* ===========================
   ESTADÍSTICAS (CAPTURAS / TOPS)
   =========================== */

#view-info .stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 900px) {
  #view-info .stats-grid {
    grid-template-columns: 1fr;
  }
}

#view-info .stat-card {
  background-color: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  padding: 10px 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

#view-info .stat-card h4 {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 600;
}

#view-info .table th,
#view-info .table td {
  padding: 4px 6px;
  font-size: 0.8rem;
}

#view-info .table tbody tr:hover {
  background-color: #eef5ff;
}

/* ===========================
   AJUSTES MÓVIL PARA INFO
   =========================== */

@media (max-width: 768px) {
  #view-info .panel,
  #view-info .info-panel {
    padding: 10px;
  }

  #view-info h2 {
    font-size: 1.05rem;
  }

  #view-info h3 {
    font-size: 0.95rem;
  }
}

/* ===========================
   ESPACIOS PARA PUBLICIDAD
   =========================== */

.ad-slot {
  margin: 10px 0;
  min-height: 60px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.16);
}

.ad-slot-top {
  margin-bottom: 16px;
}

.ad-slot-bottom {
  margin-top: 16px;
}

@media (max-width: 768px) {
  .ad-slot {
    min-height: 50px;
    margin: 8px 0;
  }
}

/* ===========================
   ESTILOS BASICOS DE IMPRESION
   =========================== */

@media print {
  html, body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .layout {
    max-width: 100%;
    margin: 0;
    padding: 0;
  }

  .main-tabs,
  .judge-toolbar,
  .ad-slot,
  .btn,
  button {
    display: none !important;
  }

  .panel,
  .info-panel {
    box-shadow: none !important;
    border-radius: 0;
    background: #ffffff !important;
    border: 1px solid #999999;
  }

  .table {
    font-size: 11px;
  }

  .table th,
  .table td {
    padding: 4px 6px;
  }

  .panel,
  .info-panel,
  table {
    page-break-inside: avoid;
  }
}

/* ===========================
   VISTA DE JUECES (#view-judge)
   =========================== */

#view-judge {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Paneles dentro de la vista de juez */
#view-judge .panel,
#view-judge .info-panel {
  background: linear-gradient(135deg, #f6fbff, #ffffff);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(0, 0, 0, 0.03);
  padding: 12px 14px;
}

/* Títulos dentro de la vista de juez */
#view-judge h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 6px;
}

#view-judge h3 {
  font-size: 1rem;
  font-weight: 550;
  margin: 8px 0 4px;
}

/* Texto de ayuda / descripciones cortas */
#view-judge .help-text {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

/* ===========================
   TABLAS EN VISTA JUEZ
   =========================== */

#view-judge .table-wrapper {
  width: 100%;
  overflow-x: auto;
}

#view-judge .table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

#view-judge .table th,
#view-judge .table td {
  padding: 5px 7px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

#view-judge .table thead {
  background-color: var(--color-primary-soft);
}

#view-judge .table tbody tr:nth-child(even) {
  background-color: var(--color-surface-alt);
}

#view-judge .table tbody tr:hover {
  background-color: #eef5ff;
}

/* ===========================
   CABECERA DEL CAMPEONATO EN VISTA JUEZ
   =========================== */

#judge-current-tournament-name,
#judge-current-tournament-header {
  font-size: 1rem;
  font-weight: 600;
  color: #f9fcff;
  background: linear-gradient(135deg, var(--color-primary), #27a6d5);
  padding: 8px 12px;
  border-radius: var(--radius-lg);
  margin-bottom: 10px;
  box-shadow: var(--shadow-soft);
}

#judge-current-tournament-header small {
  font-size: 0.8rem;
  color: rgba(233, 243, 255, 0.85);
}

/* ===========================
   AJUSTES MÓVIL PARA VISTA JUEZ
   =========================== */

@media (max-width: 768px) {
  #view-judge {
    gap: 10px;
  }

  #view-judge .panel,
  #view-judge .info-panel {
    padding: 10px;
  }

  #view-judge .table th,
  #view-judge .table td {
    font-size: 0.8rem;
  }
}

/* ===========================
   ESTADOS VACÍOS / PLACEHOLDERS
   =========================== */

/* Mensajes de "sin datos" genéricos */
.empty-state,
.empty-message {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background-color: rgba(255, 255, 255, 0.6);
  border: 1px dashed var(--color-border);
  text-align: left;
  position: relative;
  padding-left: 38px;
}

/* Cuando se usan <li> para mensajes vacíos (ej: listas de firmas) */
#judge-signatures-list li.small,
#judge-signatures-list li.empty-state {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  border-style: dashed;
  background-color: rgba(255, 255, 255, 0.8);
}

.empty-state::before {
  /* Icono pez sutil para estados vacíos */
  content: "🐠";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  opacity: 0.7;
}

/* Tablas con un único <tr> de estado vacío */
.table tbody tr td[colspan] {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ===========================
   ENLACES
   =========================== */

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
}

a:hover {
  color: #27a6d5;
  text-decoration: underline;
}

a:active {
  opacity: 0.8;
}

/* En cabeceras oscuras (si hay enlaces), que no griten tanto */
header a {
  color: #e9f3ff;
}

header a:hover {
  color: #ffffff;
}

/* ===========================
   MICRO-ANIMACIONES SUAVES
   =========================== */

/* Entradas suaves para paneles cuando se montan */
.panel,
.info-panel {
  transition: box-shadow 0.15s ease, transform 0.1s ease;
}

.panel:hover,
.info-panel:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

/* Tablas: animación de hover ya definida, aseguramos transición suave */
.table tbody tr {
  transition: background-color 0.12s ease;
}

/* Botones ya tienen transición, no tocamos más para no exagerar */

/* ===========================
   PIE DE PÁGINA (OPCIONAL)
   =========================== */

.app-footer {
  margin-top: 16px;
  padding: 8px 0;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.app-footer span {
  display: block;
}

/* ===========================
   TIPOGRAFÍA GLOBAL – JERARQUÍA
   (ajuste de tamaños/pesos/márgenes)
   =========================== */

body {
  font-size: 15px;
  line-height: 1.55;
}

/* Contenedor principal de la app */
.app-shell {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px 18px;
}

@media (max-width: 640px) {
  .app-shell {
    max-width: 480px;
    padding: 12px 14px;
  }
}

@media (max-width: 480px) {
  .app-shell,
  .page-header {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
  }

  .app-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .main-tabs {
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }

  .main-tabs button,
  .main-tabs a,
  .tab-button {
    display: flex;
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
    padding: 12px 16px;
    font-size: 0.95rem;
    text-align: center;
    justify-content: center;
    white-space: normal;
  }
}

/* ===========================
   CONTENEDORES: AJUSTE GLOBAL MÓVIL
   =========================== */
@media (max-width: 480px) {
  html,
  body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  /* Contenedor principal de la app y layout general */
  .app-shell,
  .layout,
  main,
  #view-public,
  #view-judge,
  #view-create,
  #view-info {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
  }

  /* Cabecera principal: logo + título + subtítulo */
  .page-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .page-title {
    font-size: 1.6rem;
    line-height: 1.2;
    margin: 8px 0 10px;
    white-space: normal;
    word-break: break-word;
  }

  .page-subtitle {
    font-size: 1rem;
    text-align: center;
  }
}

/* Modo público: clasificación final */
.panel--ranking {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  box-sizing: border-box;
  overflow-x: auto;
}

.panel--ranking #table-final {
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
}

#table-final .icon-fish {
  display: none;
}

#table-final th,
#table-final td {
  text-align: center;
}

#public-top-species-panel .table-wrapper {
  width: 100%;
  max-width: 100%;
  margin: 0;
  overflow-x: hidden;
  box-sizing: border-box;
}

#public-top-species-table {
  width: 100%;
  max-width: 100%;
  margin: 0;
  table-layout: fixed;
  min-width: 0;
  box-sizing: border-box;
}

#public-top-species-table th,
#public-top-species-table td {
  padding: 6px 6px;
  text-align: center;
  white-space: normal;
}

#public-top-species-table th:nth-child(1),
#public-top-species-table td:nth-child(1) {
  width: 14%;
}

#public-top-species-table th:nth-child(2),
#public-top-species-table td:nth-child(2) {
  width: 44%;
}

#public-top-species-table th:nth-child(3),
#public-top-species-table td:nth-child(3) {
  width: 42%;
}

#info-top-species-table th:nth-child(2),
#info-top-species-table td:nth-child(2) {
  text-align: center;
}

#info-top-anglers-table th:nth-child(2),
#info-top-anglers-table td:nth-child(2) {
  text-align: center;
}

/* ===========================
   TABLAS: RESPONSIVE EN MÓVIL
   =========================== */
@media (max-width: 480px) {
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    display: block;
  }

  /* Tablas de clasificación (manga, sector, final, top especies) */
  #table-manga,
  #table-sector,
  #table-final {
    min-width: 520px;
  }
}

/* ===========================
   FORMULARIOS: LAYOUT MÓVIL
   =========================== */
@media (max-width: 480px) {
  /* Contenedores principales de formularios */
  .form-grid,
  .form-row,
  .form-group,
  form {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 16px;
  }

  /* Grids/filas a una columna en móvil */
  .form-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .form-row {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
  }

  /* Inputs ocupan todo el ancho */
  .field,
  .form-group,
  .form-row .form-group,
  .form-row .field {
    width: 100%;
    max-width: 100%;
  }

  label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.95rem;
  }

  input,
  select,
  textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 40px;
  }
}

/* ===========================
   TIPOGRAFÍA AJUSTADA EN MÓVIL
   =========================== */
@media (max-width: 480px) {
  /* Título principal de la app */
  .page-title,
  h1 {
    font-size: 1.6rem;
    line-height: 1.2;
  }

  /* Títulos de bloque / sección */
  h2,
  .section-header h2 {
    font-size: 1.2rem;
    line-height: 1.3;
  }

  /* Subtítulos y textos secundarios sobre tarjetas */
  .page-subtitle,
  .subtitle,
  .section-subtitle {
    font-size: 0.95rem;
    line-height: 1.4;
  }
}

/* Escala de encabezados */
h1 {
  font-family: var(--font-family-base);
  font-size: var(--font-size-h1);
  font-weight: var(--font-weight-black);
  line-height: 1.2;
  margin: 4px 0 12px;
}

h2 {
  font-family: var(--font-family-base);
  font-size: var(--font-size-h2);
  font-weight: var(--font-weight-bold);
  line-height: 1.3;
  margin: 0 0 10px;
}

h3 {
  font-family: var(--font-family-base);
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-semibold);
  line-height: 1.3;
  margin: 0 0 8px;
}

.page-title {
  font-family: var(--font-family-base);
  font-size: var(--font-size-h1);
  font-weight: var(--font-weight-black);
}

.text-body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-body-sm);
  font-weight: var(--font-weight-regular);
}

.text-small {
  font-family: var(--font-family-base);
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-regular);
}

h4 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 6px;
}

/* Párrafos y texto base */
p {
  margin: 0 0 8px;
  font-size: var(--font-size-body);
  line-height: 1.55;
}

/* Texto pequeño / notas */
.small,
.help-text {
  font-size: 0.82rem;
  line-height: 1.45;
}

.field-hint {
  margin-top: 4px;
  font-size: 0.82rem;
  color: #6b7280;
}

/* ===========================
   Secciones dentro de cards largas (modo jueces)
   =========================== */
.section-block {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), #ffffff);
  border: 1px solid #e8edf2;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.section-block--muted {
  background: linear-gradient(180deg, #f8fafc, #ffffff);
}

.section-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.section-subtitle {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin: 4px 0 0;
}

.section-toolbar {
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
}

/* ===========================
   ESPACIADO VERTICAL
   =========================== */

/* Barra de acciones en "Registrar captura" (modo juez) */
#judge-editor-card .section-toolbar {
  position: relative;
  opacity: 1;
  filter: none;
  z-index: 2;
  display: flex;
  justify-content: center !important;
  width: 100%;
}

#judge-editor-card .section-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  min-height: 44px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 650;
  color: #111827;
  background-color: #f7f9fc;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: none;
  opacity: 1;
  filter: none;
  mix-blend-mode: normal;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

#judge-editor-card .section-toolbar button:hover {
  background-color: #eef2f7;
  border-color: rgba(15, 23, 42, 0.18);
}

#judge-editor-card .section-toolbar button:active {
  transform: translateY(1px);
}

#judge-editor-card .section-toolbar button:focus-visible {
  outline: 2px solid #1d7fa6;
  outline-offset: 2px;
}

#judge-editor-card .section-toolbar button:disabled {
  opacity: 0.9;
  color: #4b5563;
  cursor: not-allowed;
}

/* Primario: Descargar informe (PDF) */
#judge-editor-card .section-toolbar #judge-export-report-btn {
  background-color: #1d7fa6;
  color: #ffffff;
  border-color: #1d7fa6;
  box-shadow: 0 8px 18px rgba(29, 127, 166, 0.18);
}

#judge-editor-card .section-toolbar #judge-export-report-btn:hover {
  background-color: #186b8c;
  border-color: #186b8c;
  box-shadow: 0 10px 20px rgba(24, 107, 140, 0.2);
}

/* Secundarios neutros: Firmas e Incidencias */
#judge-editor-card .section-toolbar #judge-signatures-btn,
#judge-editor-card .section-toolbar #judge-incidents-btn {
  background-color: #f7f9fc;
  border-color: rgba(15, 23, 42, 0.12);
  color: #111827;
}

/* Alerta: Cerrar campeonato */
#judge-editor-card .section-toolbar #btn-judge-close-tournament {
  background-color: #fff8f7;
  border-color: rgba(239, 68, 68, 0.35);
  color: #b91c1c;
}

#judge-editor-card .section-toolbar #btn-judge-close-tournament:hover {
  background-color: #fee2e2;
  border-color: rgba(239, 68, 68, 0.5);
}


/* Margen entre paneles principales */
.panel,
.info-panel {
  margin-bottom: 12px;
}

/* Margen claro entre secciones de vistas */
#view-public > .panel,
#view-info > .panel,
#view-judge > .panel {
  margin-bottom: 12px;
}

/* Pequeño margen entre tablas y títulos */
.table {
  margin-top: 4px;
}

/* ===========================
   TABLAS – LEGIBILIDAD
   =========================== */

.table th {
  text-transform: none;
  letter-spacing: 0.01em;
}

.table td {
  vertical-align: middle;
}

/* Numeración de columnas centrada si se usan celdas solo de índice (#) */
.table th:first-child,
.table td:first-child {
  text-align: center;
}

/* ===========================
   AJUSTE TIPOGRAFÍA MÓVIL
   =========================== */

@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  h1 {
    font-size: 1.45rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  h3 {
    font-size: 1.05rem;
  }

  p {
    font-size: 0.92rem;
  }

  .table th,
  .table td {
    font-size: 0.82rem;
  }
}

/* ===========================
   SEPARACIÓN UNIFORME DE TARJETAS
   =========================== */
.app-card,
.card,
.panel,
.info-panel {
  margin-top: 20px;
  margin-bottom: 20px;
}

.section-header,
.section-title {
  margin-bottom: 12px;
}

/* Ancho y centrado comunes para todas las tarjetas */
.app-card,
.card,
.panel,
.info-panel {
  width: 100%;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .app-card,
  .card,
  .panel,
  .info-panel {
    max-width: 1100px;
  }
}

/* Padding uniforme en tarjetas */
.app-card,
.card,
.panel,
.info-panel {
  padding: 20px 16px;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .app-card,
  .card,
  .panel,
  .info-panel {
    padding: 24px 24px;
  }
}

.app-card .card-title,
.app-card .section-title,
.card .card-title,
.card .section-title,
.panel .card-title,
.panel .section-title,
.info-panel .card-title,
.info-panel .section-title {
  margin-bottom: 12px;
}

/* ===========================
   TABLAS: LEGIBILIDAD EN MÓVIL
   =========================== */
@media (max-width: 480px) {
  /* Tamaño de fuente y altura de filas */
  #table-manga,
  #table-sector,
  #table-final,
  #public-top-species-table {
    font-size: 0.9rem;
    line-height: 1.3;
  }

  #table-manga th,
  #table-manga td,
  #table-sector th,
  #table-sector td,
  #table-final th,
  #table-final td,
  #public-top-species-table th,
  #public-top-species-table td {
    padding: 6px 8px;
    white-space: nowrap;
  }

  /* Cabecera más diferenciada */
  #table-manga thead tr,
  #table-sector thead tr,
  #table-final thead tr,
  #public-top-species-table thead tr {
    font-weight: 600;
  }

  /* Columnas clave con min-width para no aplastar texto */
  #table-manga th:nth-child(1),
  #table-manga td:nth-child(1),
  #table-sector th:nth-child(1),
  #table-sector td:nth-child(1),
  #table-final th:nth-child(1),
  #table-final td:nth-child(1),
  #public-top-species-table th:nth-child(1),
  #public-top-species-table td:nth-child(1) {
    min-width: 60px;
  }

  #table-manga th:nth-child(2),
  #table-manga td:nth-child(2),
  #table-sector th:nth-child(2),
  #table-sector td:nth-child(2),
  #table-final th:nth-child(2),
  #table-final td:nth-child(2),
  #public-top-species-table th:nth-child(2),
  #public-top-species-table td:nth-child(2) {
    min-width: 90px;
  }
}

/* ===========================
   TEXTO SECUNDARIO / AYUDA
   =========================== */
.helper-text,
.secondary-text,
.info-note,
.hint,
.help-text,
.small {
  font-size: 0.9rem;
  line-height: 1.4;
  opacity: 0.9;
  margin-top: 8px;
  margin-bottom: 8px;
}

.app-card .helper-text,
.app-card .secondary-text,
.app-card .info-note,
.app-card .hint,
.app-card .help-text,
.app-card .small,
.card .helper-text,
.card .secondary-text,
.card .info-note,
.card .hint,
.card .help-text,
.card .small,
.panel .helper-text,
.panel .secondary-text,
.panel .info-note,
.panel .hint,
.panel .help-text,
.panel .small,
.info-panel .helper-text,
.info-panel .secondary-text,
.info-panel .info-note,
.info-panel .hint,
.info-panel .help-text,
.info-panel .small {
  margin-top: 12px;
  margin-bottom: 8px;
}

.helper-text + .app-card,
.secondary-text + .app-card,
.info-note + .app-card,
.hint + .app-card,
.help-text + .app-card,
.small + .app-card {
  margin-top: 12px;
}

@media (max-width: 480px) {
  .helper-text,
  .secondary-text,
  .info-note,
  .hint,
  .help-text,
.small {
  font-size: 0.9rem;
  line-height: 1.5;
  }
}

/* ===========================
   BOTONES PRINCIPALES UNIFICADOS
   =========================== */
.btn,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  min-height: 44px;
  border-radius: 999px;
  border: none;
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-semibold);
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  transition: filter 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn-primary:hover,
.btn:hover {
  filter: brightness(1.05);
}

.btn-primary:active,
.btn:active {
  transform: translateY(1px);
  filter: brightness(0.97);
}

.btn-primary:focus-visible,
.btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .btn,
  .btn-primary {
    width: 100%;
    max-width: 100%;
  }
}

/* ===========================
   RITMO VERTICAL DE SECCIONES
   =========================== */
.app-section,
.mode-section,
.ranking-section,
.info-section,
.public-section {
  margin-top: 28px;
  margin-bottom: 28px;
}

@media (max-width: 480px) {
  .app-section,
  .mode-section,
  .ranking-section,
  .info-section,
  .public-section {
    margin-top: 24px;
    margin-bottom: 24px;
  }
}

.section-title {
  margin-top: 0;
  margin-bottom: 12px;
}

.section-title + .app-card,
.section-title + .card,
.section-title + .panel,
.section-title + .info-panel {
  margin-top: 0;
}

.app-section > .app-card:first-child,
.app-section > .card:first-child,
.app-section > .panel:first-child,
.app-section > .info-panel:first-child,
.mode-section > .app-card:first-child,
.mode-section > .card:first-child,
.mode-section > .panel:first-child,
.mode-section > .info-panel:first-child,
.ranking-section > .app-card:first-child,
.ranking-section > .card:first-child,
.ranking-section > .panel:first-child,
.ranking-section > .info-panel:first-child,
.info-section > .app-card:first-child,
.info-section > .card:first-child,
.info-section > .panel:first-child,
.info-section > .info-panel:first-child,
.public-section > .app-card:first-child,
.public-section > .card:first-child,
.public-section > .panel:first-child,
.public-section > .info-panel:first-child {
  margin-top: 0;
}

.app-section > .app-card:last-child,
.app-section > .card:last-child,
.app-section > .panel:last-child,
.app-section > .info-panel:last-child,
.mode-section > .app-card:last-child,
.mode-section > .card:last-child,
.mode-section > .panel:last-child,
.mode-section > .info-panel:last-child,
.ranking-section > .app-card:last-child,
.ranking-section > .card:last-child,
.ranking-section > .panel:last-child,
.ranking-section > .info-panel:last-child,
.info-section > .app-card:last-child,
.info-section > .card:last-child,
.info-section > .panel:last-child,
.info-section > .info-panel:last-child,
.public-section > .app-card:last-child,
.public-section > .card:last-child,
  .public-section > .panel:last-child,
  .public-section > .info-panel:last-child {
  margin-bottom: 0;
}

/* ===========================
   MODO JUEZ: JERARQUÍA Y ACCESO
   =========================== */
#judge-login-card {
  padding-top: 20px;
  padding-bottom: 20px;
}

#judge-login-card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}

#judge-login-card .hint {
  font-size: 0.95rem;
  line-height: 1.4;
  margin-bottom: 16px;
}

#judge-login-card .btn-primary {
  width: 100%;
  max-width: 100%;
  margin-top: 8px;
}

#judge-editor-card .section-header h2,
#judge-editor-card h2 {
  font-family: var(--font-family-base);
  font-size: var(--font-size-h2);
  font-weight: var(--font-weight-bold);
  line-height: 1.3;
  margin-bottom: 8px;
}

#judge-editor-card .section-subtitle {
  font-size: 0.95rem;
  opacity: 0.85;
  margin-bottom: 16px;
}

/* ===========================
   COMPONENTES BASE REUTILIZABLES
   =========================== */
/* Tarjetas / contenedores base */
.app-card,
.card,
.panel,
.info-panel {
  /* estilos comunes ya presentes: ancho, padding, margen y box-sizing */
}

/* Títulos de sección / bloque */
.section-title,
.card-title,
.section-header h2 {
  font-family: var(--font-family-base);
  font-size: var(--font-size-h2);
  font-weight: var(--font-weight-bold);
  line-height: 1.3;
  margin: 0 0 12px;
}

/* Tablas de datos */
.data-table,
.table,
.table-ranking {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.table th,
.table-ranking th {
  font-weight: 600;
}

.data-table td,
.table td,
.table-ranking td {
  vertical-align: middle;
}

/* Footer base */
.app-footer {
  margin-top: 32px;
  padding: 12px 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.95);
}

.app-footer__inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.85);
}

.app-footer__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.app-footer__link {
  color: rgba(148, 163, 184, 0.95);
  text-decoration: none;
}

.app-footer__link:hover {
  text-decoration: underline;
  color: #e5e7eb;
}

.app-footer__separator {
  opacity: 0.6;
}

/* Secciones legales */
.legal-section {
  max-width: 960px;
  margin: 32px auto 0;
  padding: 16px 20px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  color: #e5e7eb;
  font-size: 0.9rem;
  line-height: 1.5;
  box-sizing: border-box;
}

.legal-section + .legal-section {
  margin-top: 16px;
}

.legal-section h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.legal-section p {
  margin: 6px 0;
}

.legal-section em {
  font-style: italic;
}
