/* Goalytics AI — tema oscuro "estadio de noche" */
:root {
  --bg: #080d17;
  --surface: #0f1626;
  --surface-2: #141d31;
  --surface-3: #1b263d;
  --line: rgba(148, 163, 184, .14);
  --text: #e6ebf5;
  --muted: #8b97ad;
  --accent: #3ddc84;
  --accent-ink: #062a15;
  --accent-soft: rgba(61, 220, 132, .12);
  --data: #4cc3ff;
  --warn: #f5b84c;
  --danger: #ff6b6b;
  --live: #ff4d5e;
  --radius: 14px;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--line);
  --bs-secondary-color: var(--muted);
}

html, body { background: var(--bg); color: var(--text); }
body {
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: radial-gradient(1200px 500px at 85% -10%, rgba(61, 220, 132, .07), transparent 60%),
                    radial-gradient(900px 400px at -10% 0%, rgba(76, 195, 255, .06), transparent 60%);
  background-attachment: fixed;
}
main { flex: 1; }
a { color: var(--data); }
.text-accent { color: var(--accent) !important; }
.text-muted, .text-secondary { color: var(--muted) !important; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------------- Navegación */
.app-nav { background: rgba(8, 13, 23, .85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: 1.1rem; }
.brand-text { font-weight: 800; letter-spacing: -.02em; font-size: 1.2rem; }
.brand-text .text-accent { margin-left: 2px; }
.app-nav .nav-link { color: var(--muted); font-weight: 600; border-radius: 10px; padding: .45rem .8rem !important; }
.app-nav .nav-link:hover { color: var(--text); }
.app-nav .nav-link.active { color: var(--text); background: var(--surface-2); }
.provider-pill { font-size: .8rem; padding: .35rem .7rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.provider-pill.ok i { color: var(--accent); }
.provider-pill.off i { color: var(--warn); }

/* ---------------- Superficies */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-pad { padding: 1.25rem; }
.panel-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: .75rem; }
.card { background: var(--surface); border-color: var(--line); border-radius: var(--radius); }
.table { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-border-color: var(--line); }
.table thead th { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.form-control, .form-select { background-color: var(--surface-2); border-color: var(--line); color: var(--text); }
.form-control:focus, .form-select:focus { background-color: var(--surface-2); color: var(--text); border-color: var(--accent); box-shadow: 0 0 0 .2rem var(--accent-soft); }
.btn-accent { background: var(--accent); color: var(--accent-ink); font-weight: 700; border: none; }
.btn-accent:hover, .btn-accent:focus { background: #5ae89a; color: var(--accent-ink); }
.btn-ghost { border: 1px solid var(--line); color: var(--text); background: transparent; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

/* ---------------- Buscador principal */
.hero { padding: 1.5rem 0 1rem; }
.hero h1 { font-weight: 800; letter-spacing: -.03em; font-size: clamp(1.6rem, 3vw, 2.4rem); }
.hero p { color: var(--muted); max-width: 640px; }
.search-box { position: relative; max-width: 820px; }
.search-box .bi-search { position: absolute; left: 1.1rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 1.1rem; }
.search-box input { height: 58px; border-radius: 16px; padding-left: 3rem; padding-right: 8.5rem; font-size: 1.05rem; background: var(--surface); border: 1px solid var(--line); }
.search-box button { position: absolute; right: 7px; top: 7px; height: 44px; border-radius: 12px; padding: 0 1.2rem; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .8rem; }
.chip { font-size: .8rem; padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: transparent; cursor: pointer; }
.chip:hover { color: var(--text); border-color: var(--accent); }

/* ---------------- Pestañas */
.tabs-bar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.tab-btn { border: 1px solid var(--line); background: transparent; color: var(--muted); padding: .45rem .9rem; border-radius: 10px; font-weight: 600; font-size: .9rem; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.tab-btn .live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--live); margin-right: 6px; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.update-note { font-size: .78rem; color: var(--muted); }

/* ---------------- Partidos */
.date-head { font-weight: 800; font-size: 1rem; margin: 1.4rem 0 .6rem; display: flex; align-items: center; gap: .6rem; }
.date-head::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.comp-head { display: flex; align-items: center; gap: .5rem; font-size: .8rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin: .9rem 0 .4rem; }
.comp-head img { width: 18px; height: 18px; object-fit: contain; }
.match-row {
  display: grid; grid-template-columns: 92px 1fr auto 1fr 120px; align-items: center; gap: .75rem;
  padding: .7rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: .4rem;
  transition: border-color .15s, background .15s;
}
.match-row:hover { border-color: rgba(61, 220, 132, .45); background: var(--surface-2); }
.match-time { font-family: var(--mono); font-size: .85rem; color: var(--muted); white-space: nowrap; }
.match-time.live { color: var(--live); font-weight: 700; }
.team { display: flex; align-items: center; gap: .55rem; min-width: 0; font-weight: 600; }
.team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team.home { justify-content: flex-end; text-align: right; }
.crest { width: 26px; height: 26px; object-fit: contain; flex-shrink: 0; }
.crest-ph { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-3); flex-shrink: 0; }
.score { font-family: var(--mono); font-weight: 700; font-size: 1.05rem; min-width: 64px; text-align: center; padding: .25rem .5rem; border-radius: 8px; background: var(--surface-3); }
.score.live { background: rgba(255, 77, 94, .15); color: #ffb3ba; }
.score.vs { background: transparent; color: var(--muted); font-size: .85rem; }
.match-cta { text-align: right; }
.status-chip { font-size: .7rem; font-weight: 700; padding: .15rem .45rem; border-radius: 6px; text-transform: uppercase; letter-spacing: .04em; }
.status-chip.LIVE { background: rgba(255, 77, 94, .15); color: var(--live); }
.status-chip.FINISHED { background: var(--surface-3); color: var(--muted); }
.status-chip.POSTPONED, .status-chip.CANCELLED, .status-chip.SUSPENDED { background: rgba(245, 184, 76, .15); color: var(--warn); }
@media (max-width: 767.98px) {
  /* Móvil: estado y botón arriba; equipos alineados a la izquierda (escudo + nombre); marcador a la derecha. */
  .match-row { grid-template-columns: 1fr auto; grid-template-areas: "time cta" "home score" "away score"; gap: .35rem .75rem; padding: .7rem .85rem; }
  .match-row .match-time, .match-row > .status-chip { grid-area: time; justify-self: start; }
  .match-row .team.home { grid-area: home; justify-content: flex-start; text-align: left; flex-direction: row-reverse; justify-content: flex-end; }
  .match-row .team.away { grid-area: away; }
  .match-row .team { font-size: .95rem; }
  .match-row .crest, .match-row .crest-ph { width: 22px; height: 22px; }
  .match-row .score { grid-area: score; grid-row: 2 / span 2; align-self: center; min-width: 58px; }
  .match-row .match-cta { grid-area: cta; text-align: right; }
  .match-row .match-cta .btn { padding: .15rem .6rem; font-size: .8rem; }
}

/* ---------------- Estados vacíos y carga */
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty i { font-size: 2rem; display: block; margin-bottom: .6rem; opacity: .6; }
.skeleton { height: 54px; border-radius: 12px; margin-bottom: .4rem; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------------- Análisis */
.match-hero { padding: 1.5rem; }
.match-hero .team-big { display: flex; flex-direction: column; align-items: center; gap: .5rem; text-align: center; font-weight: 800; font-size: 1.1rem; }
.match-hero .team-big img { width: 64px; height: 64px; object-fit: contain; }
.match-hero .big-score { font-family: var(--mono); font-size: 2.2rem; font-weight: 700; }
.kpi { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; height: 100%; }
.kpi .kpi-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.kpi .kpi-value { font-family: var(--mono); font-size: 1.5rem; font-weight: 700; }
.kpi .kpi-sub { font-size: .78rem; color: var(--muted); }
.prob-bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; min-width: 80px; }
.prob-bar > span { display: block; height: 100%; border-radius: 99px; background: var(--data); }
.prob-bar.hi > span { background: var(--accent); }
.prob-bar.lo > span { background: #64748b; }
.conf { font-size: .7rem; font-weight: 700; padding: .15rem .5rem; border-radius: 6px; }
.conf.Alta { background: var(--accent-soft); color: var(--accent); }
.conf.Media { background: rgba(76, 195, 255, .12); color: var(--data); }
.conf.Baja { background: rgba(148, 163, 184, .12); color: var(--muted); }
.badge-eligible { font-size: .7rem; color: var(--accent); }
.form-pill { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-size: .7rem; font-weight: 800; margin-right: 2px; font-family: var(--mono); }
.form-pill.G { background: var(--accent); color: var(--accent-ink); }
.form-pill.E { background: #64748b; color: #fff; }
.form-pill.P { background: var(--danger); color: #2b0606; }
.list-clean { list-style: none; padding: 0; margin: 0; }
.list-clean li { padding: .45rem 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.list-clean li:last-child { border-bottom: none; }
.abstain { border-left: 3px solid var(--warn); background: rgba(245, 184, 76, .08); padding: .9rem 1rem; border-radius: 0 10px 10px 0; }
.chart-box { position: relative; height: 240px; }
.stat-compare { display: grid; grid-template-columns: 1fr auto 1fr; gap: .5rem; align-items: center; padding: .35rem 0; font-size: .9rem; }
.stat-compare .lbl { color: var(--muted); font-size: .78rem; text-align: center; min-width: 140px; }
.stat-compare .v { font-family: var(--mono); font-weight: 700; }
.stat-compare .v.l { text-align: right; }

/* ---------------- Parlays */
.parlay-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: .8rem; }
.parlay-card .big-prob { font-family: var(--mono); font-size: 1.7rem; font-weight: 700; color: var(--accent); line-height: 1; }
.parlay-sel { display: grid; grid-template-columns: 1fr auto; gap: .5rem; padding: .55rem 0; border-top: 1px solid var(--line); align-items: center; }
.parlay-sel .mk { font-weight: 700; }
.parlay-sel .meta { font-size: .78rem; color: var(--muted); }
.progress { background: var(--surface-3); height: 10px; }
.progress-bar { background: var(--accent); }
.risk-option { border: 1px solid var(--line); border-radius: 12px; padding: .7rem .9rem; cursor: pointer; height: 100%; }
.risk-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.risk-option input { display: none; }
.risk-option .t { font-weight: 800; }
.risk-option .d { font-size: .78rem; color: var(--muted); }

/* ---------------- Historial */
.result-chip { font-size: .72rem; font-weight: 700; padding: .15rem .5rem; border-radius: 6px; text-transform: capitalize; }
.result-chip.acierto { background: var(--accent-soft); color: var(--accent); }
.result-chip.fallo { background: rgba(255, 107, 107, .14); color: var(--danger); }
.result-chip.pendiente { background: var(--surface-3); color: var(--muted); }
.result-chip.anulado { background: rgba(245, 184, 76, .14); color: var(--warn); }

.app-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; padding: 1rem 0; margin-top: 2rem; }
.disclaimer { font-size: .8rem; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; padding: .7rem .9rem; }
code { color: #ffd479; }

/* ---------------- Oportunidades */
.step-label { font-weight: 800; margin-bottom: .6rem; display: flex; align-items: center; gap: .5rem; }
.step-n { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: .8rem; }
.seg { display: flex; flex-wrap: wrap; gap: .4rem; }
.seg-btn { cursor: pointer; margin: 0; }
.seg-btn input[type=radio] { display: none; }
.seg-btn > span { display: inline-block; padding: .55rem 1rem; border: 1px solid var(--line); border-radius: 10px; font-weight: 700; color: var(--muted); }
.seg-btn input:checked + span { background: var(--text); color: var(--bg); border-color: var(--text); }
.seg-input { display: inline-flex; align-items: center; gap: .4rem; }
.seg-input input[type=number] { width: 90px; }
.mode-card { border: 1px solid var(--line); border-radius: 14px; padding: 1rem; cursor: pointer; background: var(--surface-2); transition: border-color .15s, background .15s; }
.mode-card:hover { border-color: rgba(61, 220, 132, .5); }
.mode-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.mode-card input { display: none; }
.mode-card .mode-icon { font-size: 1.5rem; color: var(--accent); margin-bottom: .3rem; }
.mode-card .t { font-weight: 800; font-size: 1.05rem; }
.mode-card .d { font-size: .82rem; color: var(--muted); }
.target-box { border: 1px dashed var(--accent); border-radius: 12px; padding: .9rem 1rem; }
.opp-single { display: flex; gap: .8rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.opp-single:last-child { border-bottom: none; }
.opp-single .rank { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-3); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.opp-sel { display: grid; grid-template-columns: 1fr auto; gap: .75rem; align-items: center; padding: .6rem 0; border-top: 1px solid var(--line); }
.opp-single .opp-sel { border-top: none; padding-top: 0; }
.opp-sel .mk { font-weight: 700; }
.opp-sel .meta, .opp-single .meta { font-size: .78rem; color: var(--muted); }
.min-w-0 { min-width: 0; }
.odds-cell { text-align: right; width: 110px; }
.odds-cell .my-odds { margin-top: .3rem; text-align: right; }
.odds-src { font-size: .62rem; font-weight: 700; text-transform: uppercase; padding: .1rem .35rem; border-radius: 5px; vertical-align: middle; font-family: 'Manrope', sans-serif; }
.odds-src.casa { background: var(--accent-soft); color: var(--accent); }
.odds-src.modelo { background: rgba(76, 195, 255, .12); color: var(--data); }
.opp-totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-top: .6rem; padding: .7rem .8rem; background: var(--surface-2); border-radius: 10px; }
.opp-totals .lbl { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.opp-totals .val { font-family: var(--mono); font-weight: 700; font-size: 1.05rem; }
@media (max-width: 575.98px) { .opp-totals { grid-template-columns: repeat(2, 1fr); } .odds-cell { width: 92px; } }
.hero-cta { margin-top: 1rem; }

/* ---------------- Arma tu combinada */
.builder-row { display: flex; gap: .75rem; align-items: flex-start; padding: .7rem .2rem; border-top: 1px solid var(--line); }
.builder-row:first-child { border-top: none; }
.builder-row .b-check { width: 1.4rem; height: 1.4rem; margin-top: .15rem; flex-shrink: 0; cursor: pointer; }
.builder-row.on { background: var(--accent-soft); border-radius: 10px; }
.builder-bar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem;
  margin-top: .6rem; padding: .7rem .9rem; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--line); z-index: 5; }

/* Selector de competiciones (Oportunidades) */
.comp-pick { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.comp-pick .chip { display: inline-flex; align-items: center; padding: .4rem .8rem; font-size: .85rem; }
.comp-pick .chip .form-check-input { margin-top: 0; }
.comp-pick .chip.on { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.comp-country { font-size: .7rem; color: var(--muted); margin-left: .35rem; }
.chip-locked { opacity: .45; cursor: not-allowed; border-style: dashed; }
.chip-locked:hover { color: var(--muted); border-color: var(--line); }

/* Punto "en vivo" fuera de las pestañas (botón En vivo de los boletos) */
.btn .live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--live); margin-right: 6px; animation: pulse 1.4s infinite; }

/* ---------- Simulador 2D en vivo ---------- */
.sim-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .5rem; margin-bottom: .4rem; font-size: .85rem; }
.sim-team { display: flex; align-items: center; gap: .4rem; font-weight: 700; min-width: 0; }
.sim-team .crest, .sim-team .crest-ph { width: 20px; height: 20px; }
.sim-score { font-size: 1.25rem; font-weight: 800; line-height: 1; }
.sim-live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--live); margin-right: 5px; animation: pulse 1.4s infinite; }
.sim-stage { position: relative; margin: 0 auto; border-radius: 12px; overflow: hidden; box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.sim-pitch { display: block; width: 100%; height: auto; }
.sim-trail { opacity: .9; animation: simFade 5s forwards; }
@keyframes simFade { to { opacity: 0; } }
.sim-mark { font-size: 3px; text-anchor: middle; }
.sim-ball { filter: drop-shadow(0 0 .6px rgba(0,0,0,.8)); }
.sim-banner { position: absolute; left: 50%; top: 10%; transform: translate(-50%, -10px); opacity: 0; transition: all .25s; pointer-events: none;
  background: rgba(10, 14, 24, .82); color: #fff; padding: .2rem .65rem; border-radius: 999px; font-weight: 700; font-size: .72rem; white-space: nowrap; }
.sim-banner.show { opacity: 1; transform: translate(-50%, 0); }
.sim-banner.goal { background: #f5c518; color: #111; font-size: .95rem; top: 40%; }
.sim-banner.shot { background: rgba(255, 140, 0, .92); }
.sim-banner.attack { background: rgba(220, 53, 69, .88); }
.sim-banner.card { background: rgba(250, 204, 21, .95); color: #111; }
.sim-attack-l, .sim-attack-r { position: absolute; top: 0; bottom: 0; width: 22%; opacity: 0; transition: opacity .4s; pointer-events: none; }
.sim-attack-r { right: 0; background: linear-gradient(to left, rgba(78,168,255,.35), transparent); }
.sim-attack-l { left: 0; background: linear-gradient(to right, rgba(255,107,107,.35), transparent); }
.sim-attack-l.on, .sim-attack-r.on { opacity: 1; }
.sim-dom { display: flex; align-items: center; gap: .4rem; margin-top: .4rem; font-size: .72rem; font-weight: 600; }
.sim-dom-bar { flex: 1; height: 8px; border-radius: 999px; overflow: hidden; }
.sim-dom-fill { height: 100%; transition: width .8s; }
.sim-feed { max-height: 210px; overflow-y: auto; }
.sim-ev { padding: .2rem 0; border-bottom: 1px solid var(--line); font-size: .78rem; }
.sim-stat { display: flex; align-items: center; gap: .4rem; margin-bottom: .2rem; font-size: .8rem; }
.sim-stat .mono { width: 2.2rem; text-align: center; font-weight: 700; }
.sim-stat-bar { display: flex; height: 6px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }

/* Simulador compacto: cancha de ~460 px; en pantallas anchas, estadísticas y minuto a minuto al lado */
.sim-main { max-width: 460px; margin: 0 auto; }
.sim-side { margin-top: .75rem; }
@media (min-width: 992px) {
  .sim { display: grid; grid-template-columns: 460px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
  .sim-main { margin: 0; }
  .sim-side { margin-top: 0; }
}

/* Inicio de sesión y cuentas */
.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-wrap { width: 100%; max-width: 420px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: .5rem; font-size: 1.5rem; margin-bottom: 1.25rem; }
.auth-card .seg-btn { text-decoration: none; }
.auth-card .seg-btn > span { display: block; }
.auth-card .seg-btn.on > span { background: var(--text); color: var(--bg); border-color: var(--text); }
.user-pill { white-space: nowrap; }

/* Seguras */
.chip.on { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
tr.safe-on > td { background: var(--accent-soft); }
.s-check { width: 1.25rem; height: 1.25rem; cursor: pointer; }

/* Seguras: un partido por renglón, desplegable */
.safe-list { display: flex; flex-direction: column; gap: .5rem; }
details.safe-match { border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.015); }
details.safe-match.has-pick { border-color: var(--accent); }
details.safe-match > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .6rem; padding: .7rem .8rem; }
details.safe-match > summary::-webkit-details-marker { display: none; }
details.safe-match > summary:hover { background: var(--accent-soft); border-radius: 12px; }
details.safe-match .safe-chev { transition: transform .15s; color: var(--muted); }
details.safe-match[open] .safe-chev { transform: rotate(90deg); color: var(--accent); }
details.safe-match[open] > summary { border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0; }
details.safe-match .table { margin: .2rem .4rem .4rem; width: calc(100% - .8rem); }
.min-w-0 { min-width: 0; }

/* Seguras: detalle de la combinada (cuotas que se van multiplicando) */
.builder-bar .b-line { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; padding: .3rem 0; border-top: 1px dashed var(--line); }
.builder-bar .b-pick { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: .05rem .25rem .05rem .55rem; white-space: nowrap; }
.builder-bar .b-x { background: none; border: 0; color: var(--muted); padding: 0 .3rem; line-height: 1; }
.builder-bar .b-x:hover { color: #f87171; }
.builder-bar details[open] { max-height: 40vh; overflow: auto; }

/* Mi combinada: botón flotante y panel en todas las páginas */
.slip-fab { position: fixed; right: 16px; bottom: 16px; z-index: 1050; display: flex; align-items: center; gap: .45rem;
  padding: .6rem .9rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.12); background: var(--accent, #22c55e); color: #04140a;
  font-weight: 800; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.slip-fab .bi { font-size: 1.15rem; }
.slip-fab .slip-count { background: #04140a; color: #fff; border-radius: 999px; min-width: 1.4rem; height: 1.4rem; font-size: .78rem;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 .35rem; }
.slip-panel { position: fixed; right: 16px; bottom: 76px; z-index: 1050; width: min(400px, calc(100vw - 32px)); max-height: min(70vh, 620px);
  display: flex; flex-direction: column; background: var(--surface-2, #111827); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0,0,0,.55); }
.slip-head { display: flex; justify-content: space-between; align-items: center; padding: .7rem .9rem; border-bottom: 1px solid var(--line); }
.slip-body { overflow: auto; padding: .4rem .9rem; flex: 1 1 auto; }
.slip-foot { padding: .7rem .9rem; border-top: 1px solid var(--line); }
.slip-match { padding: .55rem 0; border-bottom: 1px dashed var(--line); }
.slip-match:last-of-type { border-bottom: 0; }
.slip-sel { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .2rem 0 .2rem .6rem; border-left: 2px solid var(--accent, #22c55e); margin-top: .3rem; }
.slip-x { background: none; border: 0; color: var(--muted); padding: 0 .25rem; line-height: 1; }
.slip-x:hover { color: #f87171; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--live); margin-right: 4px; animation: pulse 1.4s infinite; }

/* ================= Teléfonos: diseño compacto y ordenado ================= */
@media (max-width: 767.98px) {
  body { font-size: .95rem; -webkit-text-size-adjust: 100%; }
  .container-xl { padding-left: .75rem; padding-right: .75rem; }
  h1.h3, .h3 { font-size: 1.3rem; }
  .panel-pad { padding: .9rem; }
  .panel-title { font-size: .95rem; }
  p.text-muted { font-size: .88rem; }
  .update-note { font-size: .76rem; }

  /* Menú superior */
  .app-nav .navbar-brand .brand-text { font-size: 1.15rem; }
  .app-nav .navbar-collapse { padding: .5rem 0 .75rem; }
  .app-nav .nav-link { padding: .6rem .8rem !important; }

  /* Inicio: buscador y atajos en una fila deslizable */
  .hero { padding: 1rem 0 .5rem; }
  .hero h1 { font-size: 1.45rem; }
  .hero p { font-size: .88rem; margin-bottom: .75rem !important; }
  .search-box .btn { padding-left: .9rem; padding-right: .9rem; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -.75rem; margin-right: -.75rem; padding: 0 .75rem .2rem; -webkit-overflow-scrolling: touch; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { white-space: nowrap; flex: none; }
  .hero-cta { margin-top: .75rem; flex: 1 1 100%; }

  /* Pestañas y botones segmentados: una sola fila deslizable */
  .tabs-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; padding-bottom: .15rem; }
  .tabs-bar::-webkit-scrollbar { display: none; }
  .tab-btn { white-space: nowrap; flex: none; padding: .4rem .75rem; font-size: .85rem; }
  .tabs-bar input[type=date] { flex: none; }
  #compFilter { min-width: 0 !important; width: 100%; }
  section > .d-flex > .d-flex:has(#compFilter) { width: 100%; }
  .seg { gap: .35rem; }
  .seg-btn > span { padding: .45rem .75rem; font-size: .88rem; }

  /* Tablas: letra más pequeña y celdas compactas; se deslizan de lado si no caben */
  .table { font-size: .82rem; }
  .table > :not(caption) > * > * { padding: .4rem .35rem; }
  .table th { white-space: nowrap; font-size: .72rem; }
  .table-responsive { margin-left: -.15rem; margin-right: -.15rem; }

  /* Indicadores */
  .kpi { padding: .7rem .75rem; }
  .kpi .kpi-value { font-size: 1.2rem; }
  .kpi .kpi-sub { font-size: .72rem; }

  /* Análisis de partido */
  .match-hero { padding: 1rem .75rem; }
  .match-hero .team-big { font-size: .92rem; gap: .35rem; }
  .match-hero .team-big img { width: 44px; height: 44px; }
  .match-hero .big-score { font-size: 1.6rem; }
  .chart-box { height: 180px !important; }

  /* Botones de acción en bloque */
  .btn-lg { padding: .55rem 1rem; font-size: 1rem; }
  .modal-dialog { margin: .5rem; }
}
@media (max-width: 380px) {
  .hero h1 { font-size: 1.3rem; }
  .match-row .team { font-size: .88rem; }
}
@media (max-width: 767.98px) {
  .seg-filters { display: grid !important; grid-template-columns: 1fr 1fr; gap: .5rem !important; width: 100%; }
  .seg-filters > label { display: flex; flex-direction: column; gap: .2rem; color: var(--muted); }
  .seg-filters > label:has(input[type=checkbox]) { flex-direction: row; align-items: center; grid-column: 1 / -1; color: var(--text); }
  .seg-filters select { width: 100% !important; }
  .seg-filters .btn { width: 100%; }
  .safe-list summary, .safe-list details > summary { font-size: .9rem; }
}
.prob-cell { min-width: 140px; }
@media (max-width: 767.98px) {
  .prob-cell { min-width: 0; }
  .table .prob-bar { min-width: 34px; height: 6px; }
  .table .conf { font-size: .65rem; padding: .1rem .3rem; }
  td[style*="min-width:140px"], td[style*="min-width: 140px"] { min-width: 0 !important; }
  /* Cabecera del partido: escudos, marcador en una línea y racha compacta */
  .match-hero .row > .col-5 { flex: 1 1 0; width: auto; }
  .match-hero .row > .col-2 { flex: 0 0 auto; width: auto; padding: 0 .25rem; }
  .match-hero .big-score { white-space: nowrap; font-size: 1.5rem; }
  .match-hero .status-chip { display: inline-block; margin-top: .25rem; }
  .match-hero .form-pill { width: 15px; height: 15px; font-size: .55rem; border-radius: 4px; margin-right: 1px; }
  .form-pill { width: 18px; height: 18px; font-size: .62rem; }
}
@media (max-width: 767.98px) {
  .table .prob-bar { display: none; }
  .prob-cell .mono { white-space: nowrap; }
  .table td.text-end.mono .small, .table td.text-end.mono small { font-size: .68rem; }
}
@media (max-width: 767.98px) {
  /* Tablas de 3 columnas tipo "dato · valor · explicación": en el teléfono la explicación pasa debajo */
  .stack-sm tr { display: grid; grid-template-columns: 1fr auto; gap: .2rem .6rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
  .stack-sm td { display: block; border: 0 !important; padding: 0 !important; white-space: normal !important; }
  .stack-sm td:nth-child(n+3) { grid-column: 1 / -1; color: var(--muted); }
}
@media (max-width: 767.98px) {
  /* Filas de días/fechas: una sola fila deslizable */
  .tab-row { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; padding-bottom: .15rem; }
  .tab-row::-webkit-scrollbar { display: none; }
  .tab-row .tab-btn { flex: none; }
  /* Selector de competiciones: rejilla de 2 columnas */
  .comp-pick { display: grid !important; grid-template-columns: 1fr 1fr; gap: .4rem; }
  .comp-pick .chip { width: 100%; font-size: .78rem; padding: .4rem .55rem; white-space: normal; text-align: left; }
  .comp-pick .chip:first-child { grid-column: 1 / -1; }
}
/* Barra inferior (solo teléfono) */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040; display: flex; justify-content: space-around;
  background: rgba(8, 13, 23, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: .3rem .25rem calc(.3rem + env(safe-area-inset-bottom)); }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .1rem; color: var(--muted); text-decoration: none; font-size: .66rem; font-weight: 700; padding: .25rem 0; border-radius: 10px; }
.bottom-nav a .bi { font-size: 1.2rem; line-height: 1; }
.bottom-nav a.on { color: var(--accent); }
.bottom-nav a:active { background: var(--surface-2); }
@media (max-width: 767.98px) {
  body.has-bnav { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  body.has-bnav .slip-fab { bottom: calc(74px + env(safe-area-inset-bottom)); right: 12px; }
  body.has-bnav .slip-panel { bottom: calc(132px + env(safe-area-inset-bottom)); right: 12px; width: calc(100vw - 24px); max-height: 60vh; }
  body.has-bnav .tg-install { bottom: calc(74px + env(safe-area-inset-bottom)); }
  .app-footer { font-size: .72rem; }
}
@media (max-width: 767.98px) {
  .comp-pick .chip { min-width: 0; box-sizing: border-box; display: grid !important; grid-template-columns: auto 1fr; align-items: center; column-gap: .4rem; overflow: hidden; line-height: 1.25; }
  .comp-pick .chip .form-check-input, .comp-pick .chip .bi { grid-row: 1 / span 2; margin: 0 !important; }
  .comp-pick .chip .comp-country { grid-column: 2; font-size: .68rem; }
  .comp-pick .chip.comp-all .comp-country { display: none; }
}
/* Ventana emergente (aviso de código, invitación a registrarse) */
.tg-pop { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 1rem; background: rgba(3, 6, 12, .72); backdrop-filter: blur(3px); animation: tgFade .2s ease; }
.tg-pop.d-none { display: none !important; }
.tg-pop-card { max-width: 380px; width: 100%; padding: 1.6rem 1.4rem; text-align: center; animation: tgUpPop .25s ease; }
.tg-pop-card .brand-mark { display: inline-grid; place-items: center; }
@keyframes tgFade { from { opacity: 0 } to { opacity: 1 } }
@keyframes tgUpPop { from { transform: translateY(20px); opacity: 0 } to { transform: none; opacity: 1 } }
/* Inicio para visitantes */
.guest-banner { display: flex; align-items: center; justify-content: space-between; gap: .9rem; padding: .85rem 1rem; border-radius: 14px;
  background: linear-gradient(135deg, rgba(61, 220, 132, .14), rgba(76, 195, 255, .08)); border: 1px solid rgba(61, 220, 132, .35); }
.flex-none { flex: none; }
.guest-actions .btn { white-space: nowrap; }
@media (max-width: 767.98px) {
  .guest-banner { flex-direction: column; align-items: stretch; text-align: left; }
  .guest-actions .btn { padding: .3rem .6rem; font-size: .8rem; }
}
@media (max-width: 400px) {
  .guest-actions .btn-ghost { display: none; }
  .app-nav .navbar-brand .brand-text { font-size: 1.05rem; }
}

/* ================= Inicio estilo Flashscore: días y ligas desplegables ================= */
.fs-board { margin-top: .5rem; }
.fs-days { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px 14px 0 0; padding: .35rem; position: sticky; top: 62px; z-index: 5; }
.fs-days::-webkit-scrollbar { display: none; }
.fs-day { flex: 1 0 auto; min-width: 56px; display: flex; flex-direction: column; align-items: center; gap: .05rem; border: 0; background: transparent;
  color: var(--muted); padding: .4rem .45rem; border-radius: 10px; font-size: .72rem; font-weight: 700; letter-spacing: .03em; cursor: pointer; position: relative; }
.fs-day b { font-family: var(--mono); font-size: .8rem; color: var(--text); }
.fs-day:hover { background: var(--surface-2); }
.fs-day.on { color: var(--live); }
.fs-day.on b { color: var(--live); }
.fs-day.on::after { content: ''; position: absolute; left: 22%; right: 22%; bottom: 0; height: 3px; border-radius: 3px; background: var(--live); }
.fs-day.fs-live { flex-direction: row; align-items: center; color: var(--text); }
.fs-day.fs-live b { color: inherit; font-family: inherit; font-size: .72rem; }
.fs-day.fs-live.on { background: rgba(255, 77, 94, .14); }
.fs-cal { justify-content: center; font-size: 1rem; overflow: hidden; }
.fs-cal input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
#matches > .skeleton:first-child { margin-top: .4rem; }
.fs-all { width: 100%; display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; background: var(--surface); border: 1px solid var(--line);
  border-top: 0; color: var(--text); font-weight: 700; font-size: 1rem; text-align: left; }
.fs-all > .bi-list-ul { font-size: 1.25rem; color: var(--muted); }
.fs-all > span:first-of-type { flex: 1; }
.fs-sec { background: var(--surface-3); color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: .5rem 1rem; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.fs-sec.fav { color: var(--warn); }
.fs-league { border: 1px solid var(--line); border-top: 0; background: var(--surface); }
.fs-league:last-child { border-radius: 0 0 14px 14px; }
.fs-lrow { width: 100%; display: flex; align-items: center; gap: .85rem; padding: .7rem 1rem; background: transparent; border: 0; color: var(--text); text-align: left; }
.fs-lrow:hover { background: var(--surface-2); }
.fs-flag { width: 30px; height: 20px; object-fit: cover; border-radius: 3px; flex: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08); }
.fs-flag.logo { object-fit: contain; background: #fff; padding: 1px; }
.fs-flag.ph { display: grid; place-items: center; background: var(--surface-3); color: var(--muted); font-size: .8rem; }
.fs-lname { flex: 1; min-width: 0; font-weight: 700; font-size: .98rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-lname small { display: block; color: var(--muted); font-size: .68rem; font-weight: 700; letter-spacing: .07em; }
.fs-badge { min-width: 1.6rem; height: 1.45rem; padding: 0 .4rem; border-radius: 7px; display: inline-grid; place-items: center; font-size: .78rem; font-weight: 800; }
.fs-badge.live { background: #d4143f; color: #fff; }
.fs-count { min-width: 1.6rem; text-align: right; font-family: var(--mono); font-weight: 700; color: var(--text); }
.fs-chev { color: var(--muted); font-size: .85rem; transition: transform .15s; }
.fs-league.open .fs-chev { transform: rotate(180deg); }
.fs-lmatches { display: none; padding: 0 .5rem .5rem; }
.fs-league.open .fs-lmatches { display: block; }
.fs-lmatches .match-row { background: var(--bg); margin-bottom: .3rem; }
@media (max-width: 767.98px) {
  .fs-days { top: 58px; margin: 0 -.75rem; border-radius: 0; border-left: 0; border-right: 0; }
  .fs-all, .fs-league, .fs-sec { margin: 0 -.75rem; border-left: 0; border-right: 0; }
  .fs-league:last-child { border-radius: 0; }
  .fs-lrow { padding: .65rem .85rem; gap: .7rem; }
  .fs-lmatches { padding: 0 .35rem .4rem; }
}
.fs-lhead { display: flex; align-items: stretch; }
.fs-lhead .fs-lrow { flex: 1; min-width: 0; }
.fs-go { display: grid; place-items: center; width: 44px; color: var(--muted); border-left: 1px solid var(--line); text-decoration: none; }
.fs-go:hover { color: var(--warn); background: var(--surface-2); }

/* ================= Página de liga ================= */
.lg-head { padding: .5rem 0 1rem; }
.lg-country { font-size: .75rem; font-weight: 800; letter-spacing: .08em; color: var(--muted); display: flex; align-items: center; gap: .45rem; margin-bottom: .6rem; }
.fs-flag.sm { width: 22px; height: 15px; }
.lg-logo { width: 64px; height: 64px; border-radius: 14px; background: #fff; display: grid; place-items: center; flex: none; font-size: 1.8rem; color: var(--bg); }
.lg-logo img { width: 52px; height: 52px; object-fit: contain; }
.lg-name { font-size: 1.6rem; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.lg-season { color: var(--muted); font-family: var(--mono); font-weight: 700; }
.lg-tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: .75rem; overflow-x: auto; scrollbar-width: none; }
.lg-tab { border: 0; background: transparent; color: var(--muted); font-weight: 800; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; padding: .7rem .9rem; position: relative; white-space: nowrap; }
.lg-tab.on { color: var(--live); }
.lg-tab.on::after { content: ''; position: absolute; left: .6rem; right: .6rem; bottom: -1px; height: 3px; border-radius: 3px; background: var(--live); }
.lg-pills { display: flex; gap: .4rem; margin-bottom: .75rem; overflow-x: auto; scrollbar-width: none; }
.lg-pill { border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); border-radius: 8px; padding: .35rem .8rem; font-weight: 800; font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.lg-pill.on { background: #d4143f; border-color: #d4143f; color: #fff; }
.lg-table .lg-pos { display: inline-grid; place-items: center; min-width: 1.75rem; height: 1.6rem; border-radius: 6px; font-weight: 800; font-family: var(--mono); font-size: .8rem; }
.lg-table .lg-team { display: flex; align-items: center; gap: .55rem; font-weight: 600; white-space: nowrap; }
.lg-table .lg-team span { overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.lg-table .lg-team .crest, .lg-table .lg-team .crest-ph { width: 22px; height: 22px; }
.lg-table .lg-group td { background: var(--surface-3); color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.lg-form .form-pill { width: 20px; height: 20px; font-size: .62rem; }
.lg-legend { margin-top: .9rem; display: grid; gap: .35rem; font-size: .8rem; color: var(--muted); }
.lg-legend span { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .5rem; vertical-align: -1px; }
@media (max-width: 767.98px) {
  .lg-name { font-size: 1.35rem; }
  .lg-logo { width: 54px; height: 54px; }
  .lg-logo img { width: 44px; height: 44px; }
  .lg-body { margin: 0 -.75rem; border-radius: 0; border-left: 0; border-right: 0; }
  .lg-table .lg-team span { max-width: 130px; }
}
