/* Ficha del partido (BeSoccer): posesion + timeline de goles, tarjetas, penaltis y postes.
   La pintan static/js/fichapartido.js en una ventana (QLive, QuinielaActual) o dentro de la pagina (Enfrentamiento). */

/* ---------- Ventana: capa propia como #enfModal de QuinielaGuest (oscurece y deja ver la pagina detras) ---------- */
.ficha-modal { display: none; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 10500;
               background: rgba(0,0,0,.55); align-items: center; justify-content: center; }
.ficha-modal.open { display: flex; }
.ficha-modal .ficha-box { position: relative; width: 94%; max-width: 520px; max-height: 88vh; display: flex; flex-direction: column;
                          background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.ficha-modal .ficha-box > .ficha-vista { display: flex; flex-direction: column; min-height: 0; }
.ficha-modal .ficha-cuerpo { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ficha-close { position: absolute; top: 8px; right: 8px; z-index: 2; width: 32px; height: 32px; border: 2px solid #fff;
               border-radius: 50%; background: #b4444a; color: #fff; font-size: 22px; font-weight: 700; line-height: 1;
               cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; padding: 0; }
.ficha-close:hover { background: #8e2f34; }
.ficha-close:focus-visible { outline: 2px solid #005fcc; outline-offset: 2px; }

/* ---------- Vista (comun a ventana y pagina) ---------- */
.ficha-vista { font-size: 14px; color: #222; text-align: left; }
.ficha-vista .ficha-cab { flex-shrink: 0; padding: 16px 44px 12px; background: #fff; border-bottom: 3px solid #b4444a; text-align: center; }
.ficha-vista .ficha-equipos { display: flex; align-items: center; justify-content: center; gap: 10px; }
.ficha-vista .ficha-eq { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.ficha-vista .ficha-eq img { width: 52px; height: 52px; object-fit: contain; }
.ficha-vista .ficha-eq .nom { margin-top: 4px; font-weight: 600; font-size: 13px; color: #333; text-transform: uppercase;
                              line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ficha-vista .ficha-marcador { flex-shrink: 0; font-size: 30px; font-weight: 700; color: #222; letter-spacing: 2px; min-width: 80px; }
.ficha-vista .ficha-estado { display: inline-block; margin-top: 8px; padding: 2px 10px; border-radius: 10px; font-size: 12px;
                             font-weight: 600; background: #6c757d; color: #fff; }
.ficha-vista .ficha-estado.directo { background: #ff9800; }
.ficha-vista .ficha-estado.fin { background: #28a745; }
.ficha-vista .ficha-cuerpo { padding: 4px 16px 14px; }

.ficha-vista h3.ficha-seccion { font-weight: 600; margin: 12px 0 6px; color: #b4444a; text-transform: uppercase; font-size: 12px; letter-spacing: .5px; }
.ficha-vista .posesion { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: #eee; }
.ficha-vista .pos-local { background: #b4444a; }
.ficha-vista .pos-visitante { background: #5a6270; }
.ficha-vista .posesion-equipos,
.ficha-vista .posesion-valores { display: flex; justify-content: space-between; margin-top: 2px; }
.ficha-vista .posesion-valores { font-weight: bold; }
.ficha-vista .posesion-equipos { font-size: 11px; color: #666; text-transform: uppercase; margin: 0 0 2px; }

.ficha-vista .timeline { list-style: none; padding: 0; margin: 0; }
.ficha-vista .timeline .ev { display: flex; align-items: center; gap: .5em; padding: .35em 0; border-bottom: 1px solid rgba(0,0,0,.08); }
.ficha-vista .timeline .ev.visitante { flex-direction: row-reverse; text-align: right; }
.ficha-vista .timeline .vacio { color: #6c757d; padding: .35em 0; }
.ficha-vista .timeline .min { min-width: 3.2em; font-weight: bold; color: #444; }
.ficha-vista .timeline .ev.visitante .min { text-align: right; }
.ficha-vista .timeline .ico { min-width: 1.4em; text-align: center; }
.ficha-vista .timeline .txt { flex: 1; }
.ficha-vista .timeline .marcador { font-weight: bold; margin: 0 .3em; }
.ficha-vista .carta { display: inline-block; width: .7em; height: 1em; border-radius: 2px; vertical-align: middle; }
.ficha-vista .carta.amarilla { background: #f4c20d; }
.ficha-vista .carta.roja { background: #d00; }
.ficha-vista .carta + .carta { margin-left: -.25em; }
.ficha-vista .timeline .ev.secundario .txt { color: #555; font-style: italic; }
/* Gol anulado por el VAR: balon con una raya diagonal (Font Awesome 5 no tiene balon tachado) */
.ficha-vista .balon-tachado { position: relative; display: inline-block; color: #dc3545; line-height: 1; }
.ficha-vista .balon-tachado::after { content: ""; position: absolute; left: -2px; right: -2px; top: 50%; height: 2px; margin-top: -1px;
                                     background: #dc3545; box-shadow: 0 0 0 1px #fff; transform: rotate(-45deg); border-radius: 1px; }

.ficha-vista .ficha-stats { width: 100%; border-collapse: collapse; margin: 10px 0 4px; }
.ficha-vista .ficha-stats th { font-weight: normal; color: #444; text-align: center; padding: .2em 0; }
.ficha-vista .ficha-stats td { width: 3em; font-weight: bold; padding: .2em 0; }
.ficha-vista .ficha-stats td.l { text-align: left; }
.ficha-vista .ficha-stats td.v { text-align: right; }

/* ---------- Boton "+" junto al partido (QuinielaActual) ---------- */
.ficha-mas { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-left: 6px; padding: 0;
             border-radius: 50%; background: #fff0f0; border: 1px solid #e5a0a0; color: #b4444a; font-size: 11px; line-height: 1;
             vertical-align: middle; cursor: pointer; flex-shrink: 0; position: relative; }
.ficha-mas::after { content: ""; position: absolute; top: -8px; right: -8px; bottom: -8px; left: -8px; }  /* zona de toque mayor en movil */
.ficha-mas:hover, .ficha-mas:active { background: #b4444a; border-color: #b4444a; color: #fff; }
.ficha-mas:focus { outline: none; }
.ficha-mas:focus-visible { outline: 2px solid #005fcc; outline-offset: 2px; }
.ficha-mas .fas { font-size: 11px !important; }

/* ---------- Dentro de la pagina (Enfrentamiento) ---------- */
.ficha-card { border-top: 3px solid #b4444a; }
.ficha-card .card-title .fas { color: #b4444a; }
.ficha-inline .ficha-vista .ficha-cuerpo { padding: 0; }
.ficha-inline .ficha-vista h3.ficha-seccion:first-child { margin-top: 8px; }

/* Texto solo para lectores de pantalla */
.ficha-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
