/* ================== Vars base ================== */
:root {
  --badge-w: 140px;
  --badge-py: 6px;
  --badge-px: 12px;
  --font-sz: 12px;
  --font-fm: "Inter", sans-serif;
}

/* ================== Contenedor / tipografías ================== */
.sn-ins {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-fm);
}

/* ================== Badges base y variantes ================== */
.sn-ins-badge,
.sn-open-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: var(--badge-w);
  padding: var(--badge-py) var(--badge-px);
  border-radius: 8px !important;
  font: 600 var(--font-sz) / 1.15 var(--font-fm);
  color: #fff;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  transition: filter 0.15s ease-in-out;
  background: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  opacity: 1 !important;
  position: relative;
  z-index: 2;
}
.sn-ins-badge.espera,
.sn-ins-badge.locked {
  background: linear-gradient(135deg, #22314a 0%, #162032 100%) !important;
  color: #e0e6ef !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}
.sn-open-badge,
.sn-ins-badge.open {
  background: linear-gradient(135deg, #23422d 0%, #1a2c1d 100%) !important;
  color: #e6ffe6 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}
.sn-open-badge:hover {
  filter: brightness(1.08) !important;
}
.sn-open-badge.edit {
  background: linear-gradient(135deg, #1e3a46 0%, #18303a 100%) !important;
  color: #e0f7fa !important;
  border-radius: 8px !important;
}
.sn-open-badge.new {
  color: #e6ffe6 !important;
  border-radius: 8px !important;
}
.sn-ins-badge.full,
.sn-ins-badge.closed {
  background: linear-gradient(135deg, #444950 0%, #23272b 100%) !important;
  color: #ccc !important;
  cursor: not-allowed;
}
.estado-iniciando,
.sn-ins-badge.estado-iniciando,
.sn-ins-badge.sala_asignada,
.sn-ins-badge.estado-curso {
  background: linear-gradient(135deg, #7a5c1c 0%, #b08d2c 100%) !important;
  color: #fff !important;
}
.sn-ins-badge.en_curso {
  background: linear-gradient(135deg, #3d2c4d 0%, #241a2e 100%) !important;
  color: #e6e0ff !important;
}
.sn-ins-badge.cancelled {
  background: linear-gradient(135deg, #7a2323 0%, #3a1616 100%) !important;
  color: #ffeaea !important;
}
.sn-ins-badge.error {
  background: linear-gradient(135deg, #a33c1a 0%, #4a1a13 100%) !important;
  color: #ffeaea !important;
}
.sn-ins-badge.limit,
.sn-ins-badge.competition_limit {
  background: linear-gradient(135deg, #7a5c1c 0%, #4d3a13 100%) !important;
  color: #ffe6b3 !important;
}
.sn-ins-badge.unknown {
  background: linear-gradient(135deg, #23272b 0%, #181a1c 100%) !important;
  color: #eee !important;
}

/* Estados bloqueados + progreso */
.sn-ins-badge.blocked,
.sn-ins-badge.blocked-profile,
.sn-ins-badge.blocked-accounts,
.sn-ins-badge.blocked-license {
  background: linear-gradient(135deg, #6d4c1b 0%, #2e2110 100%) !important;
  color: #ffe6b3 !important;
  cursor: pointer;
  position: relative;
}
.sn-ins-badge.blocked-config {
  background: linear-gradient(135deg, #3a3a3a 0%, #23272b 100%) !important;
  color: #ccc !important;
  cursor: not-allowed;
  position: relative;
}
.sn-ins-badge.blocked-profile,
.sn-ins-badge.blocked-accounts,
.sn-ins-badge.blocked-license {
  animation: sn-pulse 2s ease-in-out infinite;
}
.sn-ins-badge.blocked-profile:hover,
.sn-ins-badge.blocked-accounts:hover,
.sn-ins-badge.blocked-license:hover {
  filter: brightness(1.2) !important;
  transform: scale(1.02);
  transition: all 0.2s ease;
}
.sn-ins-badge.blocked::after,
.sn-ins-badge.blocked-profile::after,
.sn-ins-badge.blocked-accounts::after,
.sn-ins-badge.blocked-license::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 0 0 8px 8px;
  z-index: 1;
}
.sn-ins-badge.blocked-profile::after {
  width: 25%;
}
.sn-ins-badge.blocked-accounts::after {
  width: 50%;
}
.sn-ins-badge.blocked-license::after {
  width: 75%;
}

@keyframes sn-pulse {
  0% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.15);
  }
  100% {
    filter: brightness(1);
  }
}

/* Icono / contador pequeño en open-badge */
.sn-open-badge i {
  margin-right: 4px;
  font-size: 14px;
}
.sn-open-badge small {
  font-size: 10px;
  font-weight: 400;
  margin-left: 4px;
  opacity: 0.8;
}

/* Contador de tiempo */
.sn-ct {
  font-weight: 700;
  font-size: var(--font-sz);
  margin-top: 4px;
  font-family: monospace;
}
.sn-blink {
  animation: sn-blink 1s ease-in-out infinite;
}
@keyframes sn-blink {
  0% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.35);
  }
  100% {
    filter: brightness(1);
  }
}

/* Loading */
.sn-loading {
  padding: 8px 16px;
  background: #2b2b2b;
  border-radius: 4px;
  font-size: 12px;
  color: #6c757d;
}

/* Forzar texto blanco dentro del badge */
.sn-ins-badge,
.sn-ins-badge * {
  color: #fff !important;
}

/* ================== Layout de botones de inscripción ================== */
.sn-ins-container.sn-layout {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.sn-ins-container.sn-layout .sn-main-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 6px 10px;
  min-height: 48px;
  max-width: 200px;
  line-height: 1.1;
  word-break: break-word;
  white-space: normal;
  font-size: 0.95rem;
}
.sn-ins-container.sn-layout .sn-main-top {
  max-width: 180px;
  word-break: break-word;
  white-space: normal;
  font-size: 0.95rem;
  line-height: 1.15;
}
.sn-ins-container.sn-layout .sn-main-bottom {
  margin-top: 4px;
  font-size: 0.85rem;
  opacity: 0.85;
  text-align: center;
}
.sn-ins-container.sn-layout .sn-side-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 56px;
  min-width: 48px;
  max-width: 64px;
  padding: 4px 0;
  font-size: 0.8rem;
  background: #222;
  border-radius: 8px !important;
  border: none;
  height: auto;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  transition: filter 0.15s;
}
.sn-ins-container.sn-layout .sn-side-btn i {
  font-size: 18px;
  line-height: 1;
  margin-bottom: 2px;
  color: #ffd700 !important;
}
.sn-ins-container.sn-layout .sn-side-count {
  margin-top: 2px;
  font-weight: 600;
  font-size: 0.85rem;
  color: #fff !important;
  letter-spacing: 0.5px;
}
.sn-ins-container.sn-layout .sn-side-btn:hover {
  filter: brightness(1.12);
  background: #333;
}
.sn-ins-container.sn-layout .sn-main-btn,
.sn-ins-container.sn-layout .sn-side-btn {
  min-height: 48px;
  height: 100%;
  box-sizing: border-box;
}

/* ================== Modal (tema oscuro unificado) ================== */
.sn-ins-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 16px;
  backdrop-filter: blur(2px);
  box-sizing: border-box;
}
.sn-ins-modal .box {
  color: #e6e6e6 !important;
  padding: 1rem !important;
  border-radius: 10px !important;
  width: 80% !important;
  max-width: 820px !important;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 28px 100px rgba(0, 0, 0, 0.78) !important;
  border: 1px solid rgba(255, 255, 255, 0.03) !important;
}
.sn-ins-modal .sn-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;

  padding: 8px 12px;
  border-radius: 8px;
}
.sn-ins-modal .sn-modal-header h3 {
  margin: 0;
  flex: 1 1 auto;
  font-size: 0.98rem;
  color: #e6e6e6;
  font-weight: 600;
}
.sn-ins-modal .sn-modal-close {
  background: transparent;
  border: none;
  color: #cfcfcf;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 8px;
  line-height: 1;
  opacity: 0.9;
}
.sn-modal-body {
  padding: 12px 0;
  color: #dcdcdc;
  font-size: 0.95rem;
  line-height: 1.4;
}

/* Confirm pequeños */
@media (max-width: 480px) {
  .sn-ins-modal.sn-confirm-modal .box {
    max-width: 92vw;
    padding: 1rem;
  }
  .sn-ins-modal.sn-confirm-modal h3 {
    font-size: 1rem;
    margin-bottom: 0.8rem;
  }
  .sn-ins-modal.sn-confirm-modal .sn-btn {
    width: 100%;
    margin: 0.3rem 0;
  }
}

/* ================== Tabs (visibles, con bordes y esquinas) ================== */
.splits-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 0 6px 0;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
}
.split-tab {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  font-weight: 700;
  border-radius: 12px 12px 0 0;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease,
    border-color 0.12s ease;
  font-size: 0.95rem;
  color: #e6eef6;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 3;
  margin-bottom: -1px;
}
.split-tab:hover,
.split-tab:focus {
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-4px);
  outline: none;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}
.split-tab.active {
  background: linear-gradient(180deg, #0b63d6, #0756b8);
  color: #fff;
  border-color: rgba(10, 85, 200, 1);
  box-shadow: 0 22px 60px rgba(7, 86, 184, 0.18);
  z-index: 4;
}
.split-content {
  display: none;
  padding: 14px;
  margin-top: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0 12px 12px 12px;
  background: rgba(255, 255, 255, 0.01);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}
.split-content.active {
  display: block;
}

/* ================== Split-info (más compacto) ================== */
.split-info {
  background: #0c1112;
  padding: 4px 6px;
  border-radius: 6px;
  margin-bottom: 6px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: #e6eef6;
  font-size: 0.84rem;
  line-height: 1.1;
}

/* ================== Inscritos: header compacto ================== */
.inscritos-header .event-stats {
  background: #0b0d0f;
  padding: 6px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
  line-height: 1.2;
}
.inscritos-header .event-stats p {
  margin: 0 0 6px 0;
  font-size: 0.85rem;
  color: #cfd8dc;
}

/* ================== Tabla de pilotos / avatares / ELO-SR ================== */
.piloto-avatar img,
.marca-logo img {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: inline-block;
  vertical-align: middle;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
}
.piloto-nombre {
  font-weight: 700 !important;
  color: #fff !important;
  line-height: 1.1;
}
.auto-nombre {
  color: #fff !important;
  font-size: 0.92rem;
  font-weight: 600 !important;
}
.pilotos-table th,
.pilotos-table td {
  vertical-align: middle !important;
  padding: 6px 8px !important;
  line-height: 1.05 !important;
  white-space: nowrap;
  font-size: 0.9rem;
}
.pilotos-table tbody tr {
  min-height: 40px;
}
.pilotos-table td .elo,
.pilotos-table td .sr,
.pilotos-table td.elo,
.pilotos-table td.sr {
  font-weight: 700 !important;
  font-size: 0.88rem !important;
  padding: 0 !important;
}
.elo {
  color: #4fb3ff !important;
}
.sr {
  color: #6ce08b !important;
}

/* ================== Badges de licencia ================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 14px;
  color: #fff;
}
.badge-principiante {
  background: #6c757d;
  border: 2px solid #5a6268;
}
.badge-cobre {
  background: #b87333;
  border: 2px solid #8c6239;
}
.badge-bronce {
  background: #cd7f32;
  border: 2px solid #a86e32;
}
.badge-plata {
  background: #c0c0c0;
  border: 2px solid #a0a0a0;
  color: #333;
}
.badge-oro {
  background: #ffd700;
  border: 2px solid #d4af37;
  color: #333;
}
.badge-platino {
  background: #e5e4e2;
  border: 2px solid #c0c0c0;
  color: #333;
}
.badge-diamante {
  background: #b9f2ff;
  border: 2px solid #89c5cc;
  color: #333;
}
.badge-elite {
  background: #4b0082;
  border: 2px solid #2e004d;
}

/* ================== Responsividad ================== */
@media (max-width: 1400px) {
  .sn-ins-modal .box {
    max-width: 96% !important;
  }
}
@media (max-width: 900px) {
  .split-tab {
    padding: 6px 10px;
    font-size: 0.88rem;
  }
  .split-content {
    padding: 10px;
  }
}
@media (max-width: 768px) {
  .splits-tabs {
    flex-wrap: wrap;
  }
  .split-tab {
    flex: 1;
    text-align: center;
    min-width: 100px;
    font-size: 0.8rem;
    padding: 6px 12px;
  }
  .pilotos-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .pilotos-table table {
    min-width: 600px;
  }
  .pilotos-table th,
  .pilotos-table td {
    padding: 5px 6px !important;
    font-size: 0.86rem !important;
  }
  .piloto-avatar img,
  .marca-logo img {
    width: 28px !important;
    height: 28px !important;
  }
  .pilotos-table tbody tr {
    min-height: 36px;
  }
}
@media (max-width: 480px) {
  .inscritos-header .event-stats {
    font-size: 0.8rem;
    padding: 8px;
  }
  .split-tab {
    font-size: 0.75rem;
    padding: 4px 8px;
  }
  .pilotos-table table {
    font-size: 0.8rem;
  }
  .pilotos-table th {
    font-size: 0.75rem;
  }
  .piloto-avatar img,
  .marca-logo img {
    width: 24px !important;
    height: 24px !important;
  }
  .licencia-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
  }
  .pilotos-table th,
  .pilotos-table td {
    padding: 4px 6px !important;
    font-size: 0.84rem !important;
  }
  .pilotos-table tbody tr {
    min-height: 32px;
  }
}

/* ================== Botón deshabilitado ================== */
.sn-ins-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: none !important;
}
