/* =============================
   SUREBETSLIVE (CLEAN - FINAL) + HOMOGÉNEO
   - Desktop + Mobile
   - Filtros (modal) unificado
   - ✅ Homogeneidad multi-pantalla:
     * max-width + centrado (desktop)
     * dvh (móvil moderno)
     * media query robusta para móviles (Honor)
   ============================= */

/* ===== NORMALIZACIÓN (homogeneidad) ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ===== VARIABLES (BASE / DESKTOP) ===== */
:root {
  /* Layout general */
  --gap: 6px;
  --bar-h: 46px;

  /* ✅ Look fijo (para que en 24"/43"/14" se vea igual) */
  --page-max: 1600px;
  /* ajusta 1400-1700 según tu gusto */
  --page-pad: clamp(8px, 1vw, 16px);

  /* 40/40/20 (3 columnas) */
  --col-left: 2.4fr;
  --col-center: 2.4fr;
  --col-right: 1.6fr;

  /* mínimos para evitar solapes */
  --min-left: 340px;
  --min-center: 360px;
  --min-right: 300px;

  /* Logos casas */
  --house-logo-w: 96px;
  --house-logo-h: 32px;

  /* Score: shift global */
  --score-shift-x: 35px;

  /* CONTROL 5 ELEMENTOS */
  --score-w: 210px;
  --house-w: 140px;
  --team-w: 160px;
  --odds-col-w: 170px;

  --score-x: 10px;
  --score-y: 0px;
  --house-x: 0px;
  --house-y: 0px;
  --team-x: -5px;
  --team-y: 0px;
  --odds-x: 0px;
  --odds-y: 0px;

  --odd-w: 5ch;
  --odd-x: 25px;
  --odd-y: 23px;

  --orig-w: 100px;
  --orig-x: 10px;
  --orig-y: 0px;

  --chip-h: 60px;
  --chip-radius: 10px;
  --odds-gap: 10px;

  /* BADGE TIEMPO */
  --time-x: 30px;
  --time-y: 75%;
  --time-rot: -90deg;
  --time-gap: 8px;
  --time-pad-y: 6px;
  --time-pad-x: 10px;
  --time-font: 18px;
  --time-icon: 18px;

  /* Anti-zoom baseline (lo usa tu JS si aplica) */
  --ui-zoom-base: 0.60;

  /* Paleta HOME (skin filtros) */
  --accent1: #33CC66;
  --accent2: #0066CC;

  /* Skin panel filtros */
  --fpanel-bg1: rgba(51, 204, 102, .10);
  --fpanel-bg2: rgba(0, 102, 204, .10);
  --fpanel-line: rgba(255, 255, 255, .12);
}

/* ===== BASE ===== */
html,
body {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background: #000;
  color: #fff;

  /* ✅ antes: calc(var(--bar-h) + var(--gap))
     ahora: bar + gap arriba + gap padding layout */
  padding-top: calc(var(--bar-h) + (var(--gap) * 2));

  overflow: hidden;
}

/* Fondo logo tenue */
.logo-background {
  position: fixed;
  inset: 0;
  background: url('/assets/imagenes/imagotipo.png') no-repeat center center;
  background-size: 10%;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
  filter: drop-shadow(0 0 5px gold);
}

/* ===== TOP BAR (centrado + ancho fijo desktop) ===== */
.top-bar {
  position: fixed;
  top: var(--gap);

  /* ✅ centrado real con ancho fijo */
  left: 50%;
  transform: translateX(-50%);
  right: auto;
  width: min(var(--page-max), calc(100% - (var(--gap) * 2)));

  height: var(--bar-h);
  z-index: 9999;

  background: #131313;
  border-radius: 14px;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, .55),
    0 0 18px rgba(51, 204, 102, .30);

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
  flex-wrap: nowrap;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-logo {
  height: 30px;
  max-height: 30px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  display: block;
  background: transparent;
  border: none;
  box-shadow: none;
  filter: drop-shadow(0 0 10px rgba(0, 102, 204, .25)) drop-shadow(0 0 10px rgba(51, 204, 102, .18));
}

.live-logo {
  font-size: 12px;
  font-weight: bold;
  background-color: #000;
  color: #33CC66;
  padding: 3px 6px;
  border-radius: 10px;
  border: 2px solid #03882f;
  animation: blink 1s infinite;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  height: 20px;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.25;
  }
}

.start-button,
#start-button {
  background: rgba(0, 0, 0, .45);
  height: 30px;
  border-radius: 9px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .22);
}

.logout-button,
#logout-button {
  background: linear-gradient(90deg, rgba(51, 204, 102, .55), rgba(0, 102, 204, .35)), rgba(0, 0, 0, .35);
  color: #fff;
  height: 30px;
  border-radius: 14px;
  border: 1px solid rgba(0, 102, 204, .45);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35), 0 0 14px rgba(51, 204, 102, .12);
}

.start-button:hover,
#start-button:hover {
  background: rgba(255, 255, 255, .06);
}

.logout-button:hover,
#logout-button:hover {
  filter: brightness(1.05);
}

/* ===== LAYOUT 3 COLUMNAS (centrado + ancho fijo desktop) ===== */
.main-container {
  position: relative;
  z-index: 1;

  /* fallback + dvh */
  height: calc(100vh - (var(--bar-h) + (var(--gap) * 2)));
  height: calc(100dvh - (var(--bar-h) + (var(--gap) * 2)));

  /* ✅ ancho fijo y centrado */
  width: min(var(--page-max), 100%);
  margin: 0 auto;

  display: grid;
  grid-template-columns:
    minmax(var(--min-left), var(--col-left)) minmax(var(--min-center), var(--col-center)) minmax(var(--min-right), var(--col-right));
  grid-template-areas: 'left center right';

  gap: var(--gap);

  /* ✅ padding lateral controlado */
  padding: var(--gap) var(--page-pad);

  align-items: stretch;
  min-height: 0;
}

#surebets-container {
  grid-area: left;
}

#surebets-container-2 {
  grid-area: center;
}

#fixed-surebets-container {
  grid-area: right;
}

/* ===== COLUMNAS ===== */
#surebets-container,
#surebets-container-2,
#fixed-surebets-container {
  width: auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  padding: 10px;
  background: rgba(10, 10, 10, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: 1px 1px 10px rgba(3, 136, 47, 0.5);
  backdrop-filter: blur(3px);
}

/* scrollbar oculto */
#surebets-container::-webkit-scrollbar,
#surebets-container-2::-webkit-scrollbar,
#fixed-surebets-container::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* Botón filtro sticky dentro de cada columna */
#surebets-container .filters-button,
#surebets-container-2 .filters-button {
  position: sticky;
  top: 2px;
  z-index: 50;
  margin-bottom: 5px;
}

#surebets-container,
#surebets-container-2 {
  position: relative;
}

#filters-button,
#filters-button-2 {
  position: absolute !important;
  top: 12px !important;
  left: -4px !important;
  transform: none !important;
  z-index: 60 !important;
}

/* =============================
   TARJETAS
   ============================= */
.surebet-card {
  border: 1px solid #333;
  border-radius: 16px;
  background-color: #1a1a1a;
  position: relative;
  overflow: visible;
  left: 10px;
  padding: 10px;
  margin: 10px 10px 20px;
  color: #fff;
  --ribbon-color: 39 174 96;
  --ribbon-alpha: 0.75;
}

.surebet-card[data-state='tiempo-muerto'] {
  --ribbon-color: 0 140 255;
}

.surebet-card[data-state='cazar-sure'] {
  --ribbon-color: 255 193 7;
}

/* ===== HEADER ===== */
.surebet-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 10px;
  background-color: #111;
  border-bottom: 1px solid #333;
  border-radius: 10px;
  position: relative;
  z-index: 3;
}

.surebet-header>* {
  margin: 0;
  line-height: 1.2;
  min-width: 0;
}

/* % por estado */
.surebet-percentage.en-juego,
.surebet-percentage.tiempo-muerto,
.surebet-percentage.cazar-sure {
  color: #fff;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 1.05em;
  font-weight: bold;
  text-transform: uppercase;
  border: 2px solid rgba(255, 255, 255, 0.85);
}

.surebet-percentage.en-juego {
  background: linear-gradient(45deg, #27ae60, #2ecc71);
  box-shadow: 0 0 10px rgba(39, 174, 96, 0.45);
}

.surebet-percentage.tiempo-muerto {
  background: linear-gradient(45deg, #008cff, #0070e0);
  box-shadow: 0 0 10px rgba(0, 115, 230, 0.45);
}

.surebet-percentage.cazar-sure {
  background: linear-gradient(45deg, #ffd700, #ffc107);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.45);
}

/* Sport / champ / market */
.surebet-header .surebet-sport,
.surebet-header .surebet-championship {
  background: linear-gradient(45deg, #000, #333);
  color: #fff;
  border-radius: 10px;
  font-size: 1em;
  font-weight: bold;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.12);
}

.surebet-header .surebet-sport {
  padding: 8px 15px;
  text-transform: uppercase;
}

.surebet-header .surebet-championship {
  padding: 6px 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 0 300px;
  max-width: 320px;
}

.surebet-header .surebet-market {
  --market-alpha: .75;
  margin-left: auto;
  background: linear-gradient(45deg,
      rgb(0 0 0 / var(--market-alpha)),
      rgb(65 65 65 / var(--market-alpha)));
  color: #fff;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 1.05em;
  font-weight: bold;
  box-shadow: 0 0 5px rgb(247 247 247 / .45);
  text-transform: uppercase;
  border: 1px solid rgb(255 255 255 / .85);
}

/* ===== BODY ===== */
.surebet-body {
  padding: 10px;
  background-color: #1a1a1a;
  border-radius: 10px;
  border: 1px solid #333;
  margin-top: 8px;
  position: relative;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.55);
  overflow: visible;
}

.surebet-card .surebet-body::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgb(var(--ribbon-color) / var(--ribbon-alpha));
  -webkit-mask: url('/assets/imagenes/cinta.png') no-repeat left center / 100% 100%;
  mask: url('/assets/imagenes/cinta.png') no-repeat left center / 100% 100%;
  pointer-events: none;
  z-index: 1;
  border-radius: 10px;
}

.surebet-card .surebet-body>* {
  position: relative;
  z-index: 2;
}

/* ===== Row tipo tabla ===== */
.surebet-row {
  display: table;
  width: 100%;
  table-layout: fixed;
  border-spacing: 3px;
  padding: 6px 0;
  font-size: 0.85em;
  text-align: center;
}

.surebet-score-container,
.surebet-house,
.surebet-team,
.surebet-odds {
  display: table-cell;
  vertical-align: middle;
}

.surebet-house {
  font-weight: bold;
  text-align: center;
  width: var(--house-w);
  max-width: var(--house-w);
  transform: translate(var(--house-x), var(--house-y));
}

.surebet-team {
  border: 1px solid #333;
  padding: 4px 12px;
  border-radius: var(--chip-radius);
  font-weight: bold;
  text-align: center;
  width: var(--team-w);
  max-width: var(--team-w);
  transform: translate(var(--team-x), var(--team-y));
  height: var(--chip-h);
  min-height: var(--chip-h);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: normal;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.1;
}

.surebet-score-container {
  width: var(--score-w);
  max-width: var(--score-w);
  transform: translate(var(--score-x), var(--score-y));
  overflow: hidden;
  position: relative;
}

.surebet-odds {
  width: var(--odds-col-w);
  max-width: var(--odds-col-w);
  transform: translate(var(--odds-x), var(--odds-y));
  text-align: center;
  white-space: nowrap;
}

.odd-value {
  display: inline-flex;
  width: var(--odd-w);
  align-items: center;
  justify-content: center;
  transform: translate(var(--odd-x), var(--odd-y));
  font-size: 1em;
  color: #fff;
  font-weight: 700;
}

.surebet-original-inline {
  width: var(--orig-w);
  max-width: var(--orig-w);
  margin-left: var(--odds-gap);
  padding-top: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: auto;
  min-height: var(--chip-h);
  border: 1px solid #333;
  border-radius: var(--chip-radius);
  padding: 2px 6px;
  font-weight: 500;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.1;
  overflow: visible;
  transform: translate(var(--orig-x), var(--orig-y));
}

/* Score minimal */
.scoreboard-minimal {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.score-row {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}

.score-cell {
  min-width: 20px;
  text-align: center;
  border: 1px solid #444;
  padding: 4px;
}

.surebet-score-container .scoreboard-minimal {
  align-items: flex-start;
  transform: translateX(var(--score-shift-x));
}

/* ===== Acciones ===== */
.surebet-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.btn-delete {
  position: absolute;
  right: -30px;
  top: -90px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 20;
}

.delete-icon {
  width: 40px;
  height: 40px;
}

/* ===== BADGE TIEMPO (vertical) ===== */
.surebet-time-badge {
  position: absolute;
  left: var(--time-x);
  top: var(--time-y);
  transform: translateY(-50%) rotate(var(--time-rot));
  transform-origin: left center;
  display: inline-flex;
  align-items: center;
  gap: var(--time-gap);
  padding: var(--time-pad-y) var(--time-pad-x);
  font-size: var(--time-font);
  font-weight: 800;
  color: #fff;
  z-index: 5;
  pointer-events: none;
}

/* ===== BADGE TIEMPO (icono SIN mask) ===== */
.surebet-time-badge::before {
  content: '';
  width: var(--time-icon);
  height: var(--time-icon);
  flex: 0 0 auto;
  display: inline-block;
  background: url('/assets/imagenes/despertador.png') no-repeat center / contain;
}

/* ===== LOGOS CASAS ===== */
.img-surebet {
  width: var(--house-logo-w);
  height: var(--house-logo-h);
  object-fit: contain;
  object-position: center;
  display: block;
  margin: 0 auto;
}

/* =============================
   PINNED / FIJADAS
   ============================= */
.pinned-card {
  border: 1px solid #333;
  border-radius: 10px;
  margin-bottom: 16px;
  background-color: #1a1a1a;
  max-width: 100%;
  overflow: hidden;
}

.pinned-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background-color: #111;
  border-bottom: 1px solid #333;
  border-radius: 10px 10px 0 0;
}

.pinned-body {
  padding: 16px;
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 0 0 10px 10px;
  max-width: 100%;
  overflow: hidden;
}

.pinned-body table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-family: Arial, sans-serif;
  table-layout: fixed;
}

.pinned-body table thead tr {
  background-color: #111;
  color: #fff;
  font-size: 1em;
  text-align: center;
  border-bottom: 2px solid #555;
}

.pinned-body table th {
  padding: 12px 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: bold;
  border-bottom: 2px solid #555;
  font-size: clamp(10px, 0.9vw, 13px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pinned-body table td {
  padding: 10px;
  border: 1px solid #333;
  text-align: center;
  color: #eee;
  background: #1a1a1a;
  font-size: clamp(10px, 0.85vw, 13px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.pinned-body td .img-surebet {
  height: 28px;
  max-width: 100%;
  object-fit: contain;
}

.pinned-body table .odds-input,
.pinned-body table .stake-input {
  width: 100%;
  max-width: 100%;
  padding: 6px;
  border: 1px solid #444;
  border-radius: 6px;
  text-align: center;
  outline: none;
  background: #222;
  color: #fff;
  box-sizing: border-box;
  font-size: clamp(10px, 0.9vw, 13px);
}

.pinned-body table .odds-input:focus,
.pinned-body table .stake-input:focus {
  border-color: #007bff;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

@media (max-width: 532px) {
  .pinned-body table thead {
    display: none;
  }

  .pinned-body table,
  .pinned-body table tbody,
  .pinned-body table tr {
    display: block;
    width: 100%;
  }

  .pinned-body table tr {
    border: 1px solid #333;
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 10px;
    background: #141414;
  }

  .pinned-body table td {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 8px;
    text-align: left;
    border: none;
    padding: 6px 0;
    white-space: normal;
  }

  .pinned-body table td:nth-child(1)::before {
    content: 'Casa';
    color: #bbb;
  }

  .pinned-body table td:nth-child(2)::before {
    content: 'Equipo';
    color: #bbb;
  }

  .pinned-body table td:nth-child(3)::before {
    content: 'Apuesta';
    color: #bbb;
  }

  .pinned-body table td:nth-child(4)::before {
    content: 'Cuota';
    color: #bbb;
  }

  .pinned-body table td:nth-child(5)::before {
    content: 'Stake';
    color: #bbb;
  }
}

/* =============================
   COPIAR + TOAST
   ============================= */
.copy-icon {
  display: inline-block;
  margin-left: 5px;
  cursor: pointer;
  font-size: 14px;
  color: #007bff;
}

.copy-icon:hover {
  color: #5aa7ff;
}

.copy-alert {
  position: fixed;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  z-index: 20000;
  animation: fade-in-out 2s forwards;
}

@keyframes fade-in-out {
  0% {
    opacity: 0;
    transform: translate(-50%, -10px);
  }

  10% {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  90% {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 9999;
  background: rgba(0, 0, 0, .92);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .55);
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14px;
  max-width: min(560px, calc(100% - 24px));
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* ============================= */
/*            FILTROS            */
/* ============================= */

/* Botón filtros */
.filters-button {
  width: 38px;
  height: 38px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .25);
}

.filters-button img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.filters-button:hover {
  opacity: .85;
}

/* Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 520px at 25% 15%, rgba(51, 204, 102, .14), transparent 60%),
    radial-gradient(900px 520px at 85% 25%, rgba(0, 102, 204, .14), transparent 60%),
    rgba(0, 0, 0, .70);
  backdrop-filter: blur(2px);
  z-index: 15000;
  display: none;
}

.modal-overlay.visible {
  display: block;
}

/* Panel base */
.filters-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(1180px, 96vw);
  height: min(600px, 75vh);
  max-height: 90vh;
  z-index: 15001;
  display: none;
  flex-direction: column;
  background:
    radial-gradient(900px 520px at 20% 0%, var(--fpanel-bg1), transparent 60%),
    radial-gradient(900px 520px at 100% 18%, var(--fpanel-bg2), transparent 60%),
    linear-gradient(180deg, rgba(10, 10, 10, .96), rgba(14, 14, 14, .96));
  border: 1px solid var(--fpanel-line);
  border-radius: 14px;
  box-shadow:
    0 0 28px rgba(0, 0, 0, .60),
    0 0 22px rgba(51, 204, 102, .14),
    0 0 22px rgba(0, 102, 204, .14);
  padding: 18px;
  overflow: hidden;
}

.filters-panel.visible {
  display: flex;
}

/* Títulos del modal (skin) */
#filters-panel h4,
#filters-panel-2 h4,
#filters-panel h5,
#filters-panel-2 h5,
#filters-panel h3,
#filters-panel-2 h3 {
  color: rgba(255, 255, 255, .92);
  text-shadow: 0 0 10px rgba(51, 204, 102, .10), 0 0 10px rgba(0, 102, 204, .10);
}

/* Asegura z-index alto */
#filters-panel,
#filters-panel-2 {
  position: fixed;
  z-index: 999999;
}

/* Botón cerrar */
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .18);
  background:
    linear-gradient(135deg, rgba(51, 204, 102, .12), rgba(0, 102, 204, .10)),
    rgba(0, 0, 0, .55);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 38px;
  text-align: center;
  z-index: 1000000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, .35),
    0 0 14px rgba(0, 102, 204, .12),
    0 0 14px rgba(51, 204, 102, .10);
}

.modal-close:hover {
  background: rgba(255, 255, 255, .08);
}

/* Footer (Guardar/Reset) arriba junto a la X */
.filters-footer {
  position: absolute;
  top: 12px;
  right: 60px;
  z-index: 1000000;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  height: 38px;
}

.save-filters-button,
.reset-filters-button {
  height: 38px;
  min-height: 38px;
  line-height: 38px;
  padding: 0 12px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.save-filters-button {
  background: linear-gradient(135deg, rgba(51, 204, 102, .55), rgba(0, 102, 204, .35));
  border: 1px solid rgba(0, 102, 204, .35);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
}

.save-filters-button:hover {
  filter: brightness(1.05);
}

.reset-filters-button {
  background: rgba(0, 0, 0, .35);
  border: 1px solid rgba(255, 255, 255, .22);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .30);
}

.reset-filters-button:hover {
  background: rgba(255, 255, 255, .06);
}

/* Evita que el título quede debajo de los botones */
#filters-panel h4,
#filters-panel-2 h4 {
  padding-right: 230px;
  margin: 0 0 6px;
}

/* Grupos */
.filters-group {
  margin-bottom: 14px;
}

.filters-group h5 {
  margin: 0 0 8px;
  font-size: 1em;
  color: #ccc;
}

/* Estado inline */
.filters-status-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 0;
  margin-bottom: 14px;
}

.filter-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(0, 0, 0, .35);
  color: #fff;
  cursor: pointer;
  user-select: none;
  font-weight: 800;
}

.filter-state input {
  margin: 0;
}

.filter-state.en-juego {
  background: linear-gradient(45deg, rgba(39, 174, 96, .55), rgba(46, 204, 113, .25));
  border-color: rgba(39, 174, 96, .55);
}

.filter-state.tiempo-muerto {
  background: linear-gradient(45deg, rgba(0, 140, 255, .55), rgba(0, 112, 224, .25));
  border-color: rgba(0, 140, 255, .55);
}

.filter-state.cazar-sure {
  background: linear-gradient(45deg, rgba(255, 215, 0, .55), rgba(255, 193, 7, .25));
  border-color: rgba(255, 193, 7, .55);
}

/* Min/Max (desktop) */
.filters-percentage {
  display: grid;
  grid-template-columns: max-content 120px max-content 120px;
  column-gap: 18px;
  row-gap: 10px;
  align-items: center;
}

.filters-percentage label {
  font-size: .95em;
  color: #ddd;
}

.filters-percentage input {
  width: 90px;
  padding: 8px;
  background:
    linear-gradient(135deg, rgba(51, 204, 102, .10), rgba(0, 102, 204, .08)),
    rgba(0, 0, 0, .28);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  text-align: center;
  color: #fff;
  font-size: 15px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25), 0 0 14px rgba(0, 102, 204, .08);
}

.filters-percentage input:focus {
  border-color: rgba(0, 102, 204, .55);
  box-shadow: 0 0 0 2px rgba(0, 102, 204, .18), 0 0 18px rgba(0, 102, 204, .16);
  outline: none;
}

/* Columnas (desktop) */
.filters-columns.filters-columns-3 {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns:
    minmax(360px, 1.35fr) minmax(240px, 0.9fr) minmax(240px, 0.9fr);
  gap: 16px;
  align-items: stretch;
}

/* Cada columna */
.filters-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

/* Header columna */
.filters-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.filters-actions-mini {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Select all */
.btn-selectall {
  background:
    linear-gradient(135deg, rgba(51, 204, 102, .18), rgba(0, 102, 204, .14)),
    rgba(0, 0, 0, .35);
  border: 1px solid rgba(0, 102, 204, .28);
  color: #fff;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 800;
  font-size: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .25);
}

.btn-selectall:hover {
  filter: brightness(1.06);
  border-color: rgba(0, 102, 204, .55);
}

/* Buscador */
.filters-search {
  width: 100%;
  height: 36px;
  padding: 8px 10px;
  margin: 8px 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .14);
  background:
    linear-gradient(135deg, rgba(51, 204, 102, .10), rgba(0, 102, 204, .08)),
    rgba(0, 0, 0, .28);
  color: #fff;
  outline: none;
  font-size: 14px;
  box-sizing: border-box;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25), 0 0 14px rgba(0, 102, 204, .08);
}

.filters-search::placeholder {
  color: rgba(255, 255, 255, .55);
}

.filters-search:focus {
  border-color: rgba(0, 102, 204, .55);
  box-shadow: 0 0 0 2px rgba(0, 102, 204, .18), 0 0 18px rgba(0, 102, 204, .16);
}

/* Listas (scroll interno) */
.filters-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .01));
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 12px;
  padding: 8px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25);
}

.filters-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* Item */
.filter-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
}

.filter-item:hover {
  background: linear-gradient(135deg, rgba(51, 204, 102, .08), rgba(0, 102, 204, .06));
}

.filter-item input {
  transform: scale(1.15);
}

/* Logo + texto */
.filter-bk-icon {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 12px;
}

.filter-item span {
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-item input[type="checkbox"]:checked {
  accent-color: var(--accent1);
}

.filter-item input[type="checkbox"]:checked~span {
  color: rgba(255, 255, 255, .96);
  text-shadow: 0 0 10px rgba(51, 204, 102, .18), 0 0 10px rgba(0, 102, 204, .14);
}

.filter-item input[type="checkbox"]:checked~.filter-bk-icon {
  filter: drop-shadow(0 0 10px rgba(51, 204, 102, .18)) drop-shadow(0 0 10px rgba(0, 102, 204, .14));
}

/* ===== Deportes agrupados (colapsables) ===== */
.filters-group-block {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, .10);
}

.filters-group-title {
  cursor: pointer;
  font-weight: 800;
  letter-spacing: .2px;
  opacity: .95;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .06);
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.filters-group-title::after {
  content: "▾";
  margin-left: auto;
  opacity: .75;
}

.filters-group-block.collapsed .filters-group-title::after {
  content: "▸";
}

.filters-group-block.collapsed .filters-group-list {
  display: none;
}

.filters-group-list {
  margin-top: 8px;
}

/* =============================
   RESPONSIVE (LAYOUT)
   - MOBILE/TABLET: 1 columna
   - ✅ usa pointer coarse para Honor u otros
   ============================= */
@media (max-width: 532px),
(hover: none) and (pointer: coarse) {
  :root {
    --bar-h: 52px;
    --gap: 8px;
    --ui-zoom-base: 0.67;

    --score-w: 42px;
    --score-shift-x: 0px;
    --score-x: 0px;
    --team-w: 100px;
  }

  .top-bar {
    top: 0;
    left: 0;
    right: 0;

    /* ✅ mata el centrado desktop */
    transform: none !important;
    width: 100% !important;

    border-radius: 0;
    height: var(--bar-h);
    min-height: var(--bar-h);
    padding: 6px 8px;
    gap: 6px;
  }

  body {
    padding-top: var(--bar-h);
  }

  .main-container {
    /* fallback + dvh */
    height: calc(100vh - var(--bar-h));
    height: calc(100dvh - var(--bar-h));

    width: 100%;
    margin: 0;
    padding: var(--gap);

    /* ✅ 1 columna real */
    grid-template-columns: 1fr;
    grid-template-areas: 'left';
  }

  .logo-container {
    flex: 1 1 auto;
    min-width: 0;
    gap: 6px;
  }

  .brand-logo {
    height: 26px;
    max-height: 26px;
    max-width: 85px;
  }

  .start-button {
    width: 45px;
    height: 30px;
    padding: 0;
    font-size: 11px;
    border-radius: 9px;
  }

  .live-logo {
    height: 26px;
    padding: 0 5px;
    font-size: 11px;
    border-radius: 9px;
  }

  .logout-button {
    max-width: 98px;
    height: 30px;
    padding: 0 10px;
    font-size: 11px;
    border-radius: 9px;
    white-space: nowrap;
  }

  .viewSelect {
    height: 30px;
    font-size: 12px;
    border-radius: 9px;

    /* CLAVE en flex: permite encoger */
    min-width: 0 !important;

    /* CLAVE: fija el tamaño del item dentro del flex */
    flex: 0 0 70px !important;
    /* prueba 52/56/60 */
    width: 70px !important;
    max-width: 70px !important;

    /* espacio interno (texto + flecha) */
    padding: 0 18px 0 8px;
  }

  .surebet-score-container .scoreboard-minimal .score-row .score-cell:not(:first-child) {
    display: none;
  }

  .surebet-score-container {
    width: var(--score-w);
    max-width: var(--score-w);
    overflow: hidden;
  }

  .surebet-score-container .scoreboard-minimal {
    transform: translateX(10px);
    align-items: center;
  }

  .surebet-score-container .scoreboard-minimal .score-cell {
    width: 18px;
    min-width: 18px;
    height: 18px;
    padding: 0;
    font-size: 10px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .surebet-team {
    width: var(--team-w);
    max-width: var(--team-w);
    min-width: 0;
    box-sizing: border-box;
  }

  .filters-button {
    width: 30px;
    height: 30px;
    box-shadow: none;
  }

  .filters-button img {
    width: 22px;
    height: 22px;
  }

  /* ===== MODAL (FIX real) ===== */
  #filters-panel.filters-panel,
  #filters-panel-2.filters-panel {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    max-width: 90vw;

    height: 88svh;
    max-height: 88svh;

    overflow-y: auto;
    overflow-x: hidden;

    padding: 56px 12px calc(28px + env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  /* Columnas -> 1 columna SIN grid (evita encime) */
  #filters-panel .filters-columns.filters-columns-3,
  #filters-panel-2 .filters-columns.filters-columns-3 {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  /* =========================================================
     FIX SOLAPES (CLAVE)
   ========================================================= */
  #filters-panel .filters-columns.filters-columns-3>*,
  #filters-panel-2 .filters-columns.filters-columns-3>* {
    position: static !important;
    inset: auto !important;
    float: none !important;

    width: 100% !important;
    max-width: 100% !important;

    flex: 0 0 auto !important;
    min-height: 0;

    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  #filters-panel :is(.filters-col-houses, .filters-col-sports, .filters-col-markets),
  #filters-panel-2 :is(.filters-col-houses, .filters-col-sports, .filters-col-markets) {
    position: static !important;
  }

  #filters-panel :is(.filters-header, .filters-head, .filter-header, .col-header),
  #filters-panel-2 :is(.filters-header, .filters-head, .filter-header, .col-header) {
    position: static !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
  }

  #filters-panel :is(.filters-search, .filters-list),
  #filters-panel-2 :is(.filters-search, .filters-list) {
    position: static !important;
  }

  #filters-panel :is(h2, h3, h4, .filters-title),
  #filters-panel-2 :is(h2, h3, h4, .filters-title) {
    margin: 0;
    line-height: 1.15;
  }

  #filters-panel .filters-percentage,
  #filters-panel-2 .filters-percentage {
    grid-template-columns: auto 1fr;
    column-gap: 10px;
    row-gap: 8px;
  }

  #filters-panel .filters-percentage input,
  #filters-panel-2 .filters-percentage input {
    width: 100%;
    max-width: 140px;
    height: 34px;
    font-size: 14px;
    padding: 6px 8px;
  }

  #filters-panel .filters-footer,
  #filters-panel-2 .filters-footer {
    position: fixed;
    top: 10px;
    right: 56px;
    z-index: 15005;
    gap: 8px;
    background: transparent;
  }

  .modal-close {
    top: 10px;
    right: 10px;
    z-index: 15006;
  }

  .save-filters-button,
  .reset-filters-button {
    height: 34px;
    line-height: 34px;
    padding: 0 12px;
    font-size: 13px;
    border-radius: 10px;
  }

  #filters-panel .filter-item,
  #filters-panel-2 .filter-item {
    padding: 8px 10px;
    border-radius: 12px;
    gap: 10px;
  }

  #filters-panel .filter-item span,
  #filters-panel-2 .filter-item span {
    font-size: 14px;
    font-weight: 800;
  }

  #filters-panel .filter-bk-icon,
  #filters-panel-2 .filter-bk-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  #filters-panel .filters-list,
  #filters-panel-2 .filters-list {
    flex: 0 0 auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  #filters-panel .filters-col-houses .filters-list,
  #filters-panel-2 .filters-col-houses .filters-list {
    height: clamp(160px, 50svh, 320px);
    max-height: none;
  }

  #filters-panel .filters-col-sports .filters-list,
  #filters-panel-2 .filters-col-sports .filters-list {
    height: clamp(120px, 25svh, 240px);
    max-height: none;
  }

  #filters-panel .filters-col-markets .filters-list,
  #filters-panel-2 .filters-col-markets .filters-list {
    height: clamp(160px, 26svh, 320px);
    max-height: none;
    margin-bottom: 14px;
  }
}

/* ===========================================
   MOBILE FIX PACK (safe-area + vh + no solapes)
   Pegar al FINAL de styles2.css
   =========================================== */

:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --vh: 1vh;
  /* lo setea el JS (script2) */
}

/* Desktop: respeta safe-top si existe */
body {
  padding-top: calc(var(--bar-h) + var(--safe-top) + (var(--gap) * 2));
}

.top-bar {
  top: calc(var(--gap) + var(--safe-top));
}

.main-container {
  height: calc(100vh - (var(--bar-h) + var(--safe-top) + (var(--gap) * 2)));
  height: calc(100dvh - (var(--bar-h) + var(--safe-top) + (var(--gap) * 2)));
  height: calc((var(--vh, 1vh) * 100) - (var(--bar-h) + var(--safe-top) + (var(--gap) * 2)));
}

/* Móvil (incluye teléfonos “raros”/grandes por touch) */
@media (max-width: 532px),
(hover: none) and (pointer: coarse) {
  body {
    padding-top: calc(var(--bar-h) + var(--safe-top));
  }

  .top-bar {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    width: 100% !important;

    height: calc(var(--bar-h) + var(--safe-top)) !important;
    min-height: calc(var(--bar-h) + var(--safe-top)) !important;

    padding-top: calc(6px + var(--safe-top)) !important;
    padding-right: calc(8px + env(safe-area-inset-right, 0px)) !important;
    padding-left: calc(8px + env(safe-area-inset-left, 0px)) !important;

    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }


  .top-bar::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  .main-container {
    height: calc(100vh - (var(--bar-h) + var(--safe-top))) !important;
    height: calc(100dvh - (var(--bar-h) + var(--safe-top))) !important;
    height: calc((var(--vh, 1vh) * 100) - (var(--bar-h) + var(--safe-top))) !important;
  }

  /* Evita “flash” inicial con 2-3 contenedores y solapes */
  #surebets-container-2,
  #fixed-surebets-container {
    display: none;
  }

  /* Si el JS pone view-visible, respétalo */
  #surebets-container.view-visible,
  #surebets-container-2.view-visible,
  #fixed-surebets-container.view-visible {
    display: block !important;
  }

  /* Que el botón de filtro no se corte */
  #surebets-container,
  #surebets-container-2,
  #fixed-surebets-container {
    overflow-x: visible;
  }

  #filters-button,
  #filters-button-2 {
    left: 6px !important;
    top: 10px !important;
  }

  /* Tarjetas: quita corrimiento lateral en móvil */
  .surebet-card {
    left: 0 !important;
    margin: 10px 0 18px !important;
  }
}