/* TICOPA professional UI layer: semantic actions, mobile-first panels and export-safe layouts. */

:root {
  --success: #20e89b;
  --success-glow: rgba(32, 232, 155, .28);
  --danger: #ff2d55;
  --danger-glow: rgba(255, 45, 85, .28);
  --warning: #f5c542;
  --warning-glow: rgba(245, 197, 66, .28);
  --info: #00d4ff;
  --info-glow: rgba(0, 212, 255, .24);
  --surface-1: rgba(12, 15, 24, .96);
  --surface-2: rgba(20, 24, 35, .94);
  --surface-3: rgba(255, 255, 255, .045);
  --radius-sm: 6px;
  --radius-md: 8px;
  --control-h: 42px;
}

/* Fixture móvil: toda la información permanece dentro de la tarjeta. */
@media (max-width: 760px) {
  #contenedor-partidos .fixture-match-card {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "score"
      "local"
      "visita"
      "actions" !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 13px 11px !important;
    overflow: hidden !important;
  }

  #contenedor-partidos .fixture-match-card .match-score { grid-area: score; width:100% !important; order:0; }
  #contenedor-partidos .fixture-match-card .match-team.local,
  #contenedor-partidos .fixture-match-card .match-team.visita {
    display: grid !important;
    width: 100% !important;
    min-width: 0 !important;
    text-align: left !important;
    direction: ltr !important;
  }
  #contenedor-partidos .fixture-match-card .match-team.local { grid-area: local; grid-template-columns:minmax(0,1fr) 42px !important; }
  #contenedor-partidos .fixture-match-card .match-team.visita { grid-area: visita; grid-template-columns:42px minmax(0,1fr) !important; }
  #contenedor-partidos .fixture-match-card .club-badge-logo { width:42px !important; height:42px !important; min-width:42px !important; }
  #contenedor-partidos .fixture-match-card .fixture-team-label { align-items:center; min-width:0; }
  #contenedor-partidos .fixture-match-card .fixture-team-name { display:block !important; width:100% !important; max-width:100% !important; font-size:.74rem !important; overflow-wrap:anywhere; }

  #contenedor-partidos .fixture-match-actions,
  #contenedor-partidos .fixture-match-actions.solo-editar {
    grid-area: actions !important;
    grid-column: auto !important;
    grid-row: auto !important;
    grid-template-columns:minmax(0,1fr) 88px !important;
    width:100% !important;
    max-width:100% !important;
    margin:2px 0 0 !important;
  }
  #contenedor-partidos .fixture-match-actions.solo-editar { grid-template-columns:1fr !important; width:min(132px,100%) !important; justify-self:center; }
  #contenedor-partidos .fixture-match-actions .hero-btn { min-height:38px !important; padding:5px 6px !important; font-size:.56rem !important; }
  #contenedor-partidos .fixture-match-actions .btn-danger { grid-column:1 / -1; margin:0 !important; font-size:.55rem !important; }
  #contenedor-partidos .fixture-match-card .match-status { font-size:.56rem !important; }
}

button,
.hero-btn,
.btn-primary,
.btn-secondary,
.btn-danger,
.admin-row-action-btn,
a.hero-btn,
a.btn-secondary {
  min-height: var(--control-h);
  border-radius: var(--radius-sm) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.05;
  letter-spacing: 0;
  text-align: center;
  white-space: normal;
  text-decoration: none;
  touch-action: manipulation;
}

.hero-btn,
.btn-primary {
  background: var(--success) !important;
  border: 1px solid var(--success) !important;
  color: #06130d !important;
  box-shadow: 0 0 18px var(--success-glow) !important;
}

.btn-secondary {
  background: rgba(255,255,255,.04) !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  color: var(--text-main) !important;
}

.btn-danger,
.ticopa-action-danger {
  background: rgba(255,45,85,.11) !important;
  border: 1px solid var(--danger) !important;
  color: #ff5f7e !important;
  box-shadow: 0 0 16px var(--danger-glow) !important;
}

.ticopa-action-success,
.semantic-accept,
.semantic-save,
.semantic-add,
.semantic-generate,
.semantic-verify,
.semantic-login,
.semantic-import {
  background: var(--success) !important;
  border-color: var(--success) !important;
  color: #06130d !important;
  box-shadow: 0 0 18px var(--success-glow) !important;
}

.semantic-delete,
.semantic-remove,
.semantic-reject,
.semantic-cancel,
.semantic-logout,
.semantic-low {
  background: rgba(255,45,85,.11) !important;
  border-color: var(--danger) !important;
  color: #ff5f7e !important;
}

.semantic-edit,
.semantic-pending,
.semantic-export,
.semantic-calendar,
.semantic-warning {
  background: rgba(245,197,66,.12) !important;
  border-color: var(--warning) !important;
  color: var(--warning) !important;
  box-shadow: 0 0 16px var(--warning-glow) !important;
}

.semantic-view,
.semantic-search,
.semantic-filter,
.semantic-refresh,
.semantic-info {
  background: rgba(0,212,255,.10) !important;
  border-color: var(--info) !important;
  color: var(--info) !important;
}

.ticopa-status,
.badge,
[class*="estado-"],
[class*="status-"] {
  border-radius: 999px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--font-tech);
  letter-spacing: 0;
  line-height: 1;
}

.status-success,
.estado-aprobado,
.estado-validado,
.estado-alta {
  background: rgba(32,232,155,.14) !important;
  border: 1px solid rgba(32,232,155,.52) !important;
  color: var(--success) !important;
}

.status-danger,
.estado-rechazado,
.estado-baja,
.estado-error {
  background: rgba(255,45,85,.12) !important;
  border: 1px solid rgba(255,45,85,.55) !important;
  color: #ff5f7e !important;
}

.status-warning,
.estado-pendiente,
.estado-revision {
  background: rgba(245,197,66,.13) !important;
  border: 1px solid rgba(245,197,66,.54) !important;
  color: var(--warning) !important;
}

.modal,
.ticopa-modal-overlay {
  padding: 16px;
  align-items: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-content,
.ticopa-modal-box {
  width: min(96vw, 760px) !important;
  max-height: min(90vh, 820px);
  overflow: auto;
  border-radius: var(--radius-md) !important;
  border: 1px solid rgba(0,212,255,.22) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012)),
    var(--surface-1) !important;
}

.close-modal {
  width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: rgba(255,45,85,.12) !important;
  border: 1px solid rgba(255,45,85,.55) !important;
  color: #fff !important;
}

.ticopa-toast {
  max-width: min(520px, calc(100vw - 24px));
  border-radius: var(--radius-md) !important;
  background: var(--surface-2) !important;
  color: var(--text-main) !important;
  box-shadow: 0 18px 42px rgba(0,0,0,.5) !important;
}

.ticopa-empty-state,
.ticopa-loading-state,
.ticopa-error-state {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 22px;
  text-align: center;
  color: var(--text-muted);
}

.ticopa-error-state {
  border-color: rgba(255,45,85,.55);
  color: #ff91a6;
}

.ticopa-loading-state::before {
  content: "";
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255,255,255,.12);
  border-top-color: var(--info);
  border-radius: 50%;
  display: block;
  margin: 0 auto 12px;
  animation: ticopaSpin .8s linear infinite;
}

@keyframes ticopaSpin { to { transform: rotate(360deg); } }

.table-responsive {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.pro-table {
  border-radius: var(--radius-md) !important;
}

.pro-table th {
  letter-spacing: 0;
  color: var(--info) !important;
}

.pro-table td {
  vertical-align: middle;
}

.admin-inbox-content,
.admin-console-shell,
.finance-console-shell,
.scouting-panel,
.totw-container,
.player-profile,
.club-profile-shell {
  min-width: 0;
}

.admin-row-actions,
.bulk-actions,
.finance-actions,
.fixture-actions,
.totw-toolbar,
.scouting-actions {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-row-actions > *,
.bulk-actions > *,
.finance-actions > *,
.fixture-actions > *,
.totw-toolbar > *,
.scouting-actions > * {
  flex: 0 1 auto;
}

.admin-audit-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.admin-audit-card {
  background: var(--surface-2);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--radius-md);
  padding: 12px;
  min-width: 0;
}

.admin-audit-card small {
  display: block;
  color: var(--text-muted);
  font-family: var(--font-tech);
}

.admin-audit-card strong {
  display: block;
  color: var(--text-main);
  font-size: 1.15rem;
  overflow-wrap: anywhere;
}

.finance-flow,
.payment-flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(92px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.finance-flow-step,
.payment-flow-step {
  min-height: 58px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.035);
  display: grid;
  place-items: center;
  padding: 8px;
  text-align: center;
  font-family: var(--font-tech);
  font-size: .72rem;
  color: var(--text-muted);
}

.finance-flow-step.is-done,
.payment-flow-step.is-done {
  border-color: rgba(32,232,155,.55);
  color: var(--success);
}

.finance-flow-step.is-pending,
.payment-flow-step.is-pending {
  border-color: rgba(245,197,66,.55);
  color: var(--warning);
}

.export-safe,
.flyer-canvas,
.scouting-export-card,
.totw-export-card {
  overflow: hidden;
  contain: layout paint;
}

.export-safe *,
.flyer-canvas *,
.scouting-export-card *,
.totw-export-card * {
  min-width: 0;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

@media (max-width: 900px) {
  .admin-audit-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-flow,
  .payment-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  :root { --control-h: 44px; }

  body {
    overflow-x: hidden;
  }

  .main-container {
    width: 100%;
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .glass-panel,
  .card,
  .admin-inbox-content {
    border-radius: var(--radius-md) !important;
  }

  .nav-tabs,
  .tab-buttons,
  .totw-toolbar,
  .scouting-nav,
  .admin-stats-toolbar {
    display: flex !important;
    overflow-x: auto;
    flex-wrap: nowrap !important;
    gap: 8px;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .nav-tabs > *,
  .tab-buttons > *,
  .totw-toolbar > *,
  .scouting-nav > *,
  .admin-stats-toolbar > * {
    flex: 0 0 auto;
  }

  .hero-btn,
  .btn-primary,
  .btn-secondary,
  .btn-danger,
  a.hero-btn,
  a.btn-secondary {
    width: 100%;
    max-width: 100%;
    padding: 11px 12px !important;
    font-size: clamp(.72rem, 3.35vw, .9rem) !important;
  }

  .standings-table-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    margin-bottom: 14px !important;
  }

  .standings-table-actions-single {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .standings-table-actions .filter-table-btn,
  .standings-table-actions .hero-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    padding: 8px 7px !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    text-align: center !important;
    line-height: 1.08 !important;
    font-size: clamp(.58rem, 2.9vw, .74rem) !important;
    letter-spacing: 0 !important;
  }

  .admin-row-actions,
  .bulk-actions,
  .finance-actions,
  .fixture-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0 !important;
    width: 100%;
  }

  .admin-row-actions > *,
  .bulk-actions > *,
  .finance-actions > *,
  .fixture-actions > * {
    width: 100%;
  }

  .modal,
  .ticopa-modal-overlay {
    align-items: flex-start;
    padding: 10px;
  }

  .modal-content,
  .ticopa-modal-box {
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100vh - 20px);
    padding: 18px !important;
  }

  .table-responsive.mobile-card-table,
  .table-responsive:has(.pro-table) {
    overflow: visible;
  }

  .table-responsive.standings-responsive,
  .table-responsive:has(.standings-table) {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    margin-left: -4px;
    margin-right: -4px;
    padding: 0 4px 8px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--radius-md);
    background: rgba(5,8,14,.72);
  }

  .standings-table,
  .standings-table.ticopa-mobile-cards {
    display: table !important;
    width: max-content !important;
    min-width: 620px !important;
    border: 0 !important;
    border-radius: var(--radius-md) !important;
    background: var(--panel-bg) !important;
  }

  .standings-table thead,
  .standings-table.ticopa-mobile-cards thead {
    display: table-header-group !important;
  }

  .standings-table tbody,
  .standings-table.ticopa-mobile-cards tbody {
    display: table-row-group !important;
  }

  .standings-table tr,
  .standings-table.ticopa-mobile-cards tr {
    display: table-row !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  .standings-table th,
  .standings-table td,
  .standings-table.ticopa-mobile-cards th,
  .standings-table.ticopa-mobile-cards td {
    display: table-cell !important;
    width: auto !important;
    white-space: nowrap !important;
    text-align: center !important;
    padding: 9px 8px !important;
    font-size: .76rem !important;
    border-bottom: 1px solid rgba(255,255,255,.05) !important;
  }

  .standings-table td::before,
  .standings-table.ticopa-mobile-cards td::before {
    content: none !important;
    display: none !important;
  }

  .standings-table th:first-child,
  .standings-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    min-width: 42px;
    width: 42px;
    text-align: center !important;
    background: rgba(8,9,12,.98);
    box-shadow: 6px 0 12px rgba(0,0,0,.22);
  }

  .standings-table th:nth-child(2),
  .standings-table td:nth-child(2) {
    position: sticky;
    left: 42px;
    z-index: 2;
    max-width: 190px;
    min-width: 170px;
    text-align: left !important;
    background: linear-gradient(90deg, rgba(8,9,12,.98), rgba(8,9,12,.9));
    box-shadow: 8px 0 14px rgba(0,0,0,.28);
  }

  .standings-table thead th:first-child,
  .standings-table thead th:nth-child(2) {
    z-index: 4;
  }

  .standings-table .col-club-mobile > div {
    flex-wrap: nowrap !important;
    gap: 8px !important;
  }

  .standings-table .logo-container-mobile {
    flex-basis: 34px !important;
    width: 34px !important;
    height: 34px !important;
  }

  .standings-table .club-name-mobile {
    max-width: 118px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: .82rem !important;
  }

  .standings-table .col-pts {
    color: #fff !important;
    font-size: .9rem !important;
  }

  .pro-table.ticopa-mobile-cards:not(.standings-table) {
    min-width: 0 !important;
    width: 100% !important;
    border: 0 !important;
    background: transparent !important;
  }

  .pro-table.ticopa-mobile-cards:not(.standings-table) thead {
    display: none;
  }

  .pro-table.ticopa-mobile-cards:not(.standings-table) tbody,
  .pro-table.ticopa-mobile-cards:not(.standings-table) tr,
  .pro-table.ticopa-mobile-cards:not(.standings-table) td {
    display: block;
    width: 100%;
  }

  .pro-table.ticopa-mobile-cards:not(.standings-table) tr {
    margin: 0 0 10px;
    padding: 10px;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: var(--radius-md);
    background: var(--surface-2);
  }

  .pro-table.ticopa-mobile-cards:not(.standings-table) td {
    display: grid;
    grid-template-columns: minmax(94px, 38%) minmax(0, 1fr);
    gap: 8px;
    text-align: right !important;
    padding: 8px 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.06) !important;
    font-size: .88rem !important;
  }

  .pro-table.ticopa-mobile-cards:not(.standings-table) td:last-child {
    border-bottom: 0 !important;
  }

  .pro-table.ticopa-mobile-cards:not(.standings-table) td::before {
    content: attr(data-label);
    text-align: left;
    color: var(--info);
    font-family: var(--font-tech);
    font-size: .68rem;
    text-transform: uppercase;
    overflow-wrap: anywhere;
  }

  .admin-audit-strip,
  .finance-flow,
  .payment-flow {
    grid-template-columns: 1fr;
  }

  .scouting-layout,
  .scouting-grid,
  .club-stats-grid,
  .player-stats-grid,
  .finance-grid,
  .admin-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 420px) {
  .standings-table-actions {
    grid-template-columns: 1fr !important;
  }

  .standings-table-actions .filter-table-btn,
  .standings-table-actions .hero-btn {
    min-height: 38px !important;
    font-size: .66rem !important;
  }

  .admin-row-actions,
  .bulk-actions,
  .finance-actions,
  .fixture-actions {
    grid-template-columns: 1fr;
  }

  .pro-table.ticopa-mobile-cards:not(.standings-table) td {
    grid-template-columns: 1fr;
    text-align: left !important;
  }
}

/* Fixture: composición estable para escudos y nombres largos. */
#contenedor-partidos .calendar-container {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 16px !important;
  overflow: visible !important;
}

#contenedor-partidos .fixture-match-card {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(118px, 142px) minmax(0, 1fr) !important;
  align-items: center !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

#contenedor-partidos .fixture-match-card .match-team {
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: visible !important;
}

#contenedor-partidos .fixture-match-card .match-team.local {
  grid-template-columns: minmax(0, 1fr) 52px !important;
}

#contenedor-partidos .fixture-match-card .match-team.visita {
  grid-template-columns: 52px minmax(0, 1fr) !important;
}

#contenedor-partidos .fixture-match-card .club-badge-logo {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  margin: 0 !important;
  object-fit: contain !important;
}

#contenedor-partidos .fixture-match-card .fixture-team-name {
  display: block !important;
  min-width: 0 !important;
  min-height: 0 !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: #fff !important;
  background: transparent !important;
  box-shadow: none !important;
  font-family: var(--font-tech) !important;
  font-size: clamp(.72rem, 1vw, .96rem) !important;
  font-weight: 900 !important;
  line-height: 1.2 !important;
  overflow-wrap: anywhere;
  text-transform: uppercase;
  cursor: pointer;
}

#contenedor-partidos .fixture-match-card .club-link {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  overflow: visible !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
  text-overflow: clip !important;
}

#contenedor-partidos .fixture-match-card .match-score {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 142px !important;
}

@media (max-width: 1180px) {
  #contenedor-partidos .calendar-container { grid-template-columns: 1fr !important; }
}

@media (max-width: 760px) {
  #contenedor-partidos .fixture-match-card {
    grid-template-columns: 1fr !important;
    grid-template-areas: "local" "score" "visita" !important;
    gap: 10px !important;
    padding: 16px !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  #contenedor-partidos .fixture-match-card .match-team.local,
  #contenedor-partidos .fixture-match-card .match-team.visita {
    display: flex !important;
    width: 100% !important;
    min-height: 54px !important;
    text-align: left !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    direction: ltr !important;
  }

  #contenedor-partidos .fixture-match-card .match-team.local {
    grid-area: local;
    flex-direction: row-reverse !important;
    text-align: right !important;
  }

  #contenedor-partidos .fixture-match-card .match-team.visita {
    grid-area: visita;
    flex-direction: row !important;
    text-align: left !important;
  }

  #contenedor-partidos .fixture-match-card .club-badge-logo {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
  }

  #contenedor-partidos .fixture-match-card .match-score {
    grid-area: score;
    max-width: none !important;
    padding: 10px 0 !important;
    border-top: 1px solid rgba(255,255,255,.1) !important;
    border-bottom: 1px solid rgba(255,255,255,.1) !important;
  }

  #contenedor-partidos .fixture-match-card .fixture-team-name {
    flex: 1 1 auto !important;
    width: auto !important;
    max-width: calc(100% - 60px) !important;
    font-size: .9rem !important;
    line-height: 1.25 !important;
    text-align: inherit !important;
  }

  #btn-float-add-match {
    left: auto !important;
    right: 12px !important;
    bottom: 14px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: calc(100vw - 92px) !important;
    min-height: 40px !important;
    padding: 10px 13px !important;
    border-radius: 8px !important;
    font-size: .68rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }
}

/* =========================================================
   TICOPA FIX MOBILE FINAL V4 - HISTORIAL EN LIGAS / FIXTURE
   Objetivo:
   - El contenedor no se sale del ancho del móvil.
   - Cada tarjeta crece en alto según su contenido.
   - Se muestran TODOS los botones internos.
   - Se evitan cortes por overflow, height o max-height.
   Pegar al FINAL del CSS.
   ========================================================= */

@media (max-width: 768px) {
  html,
  body {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }

  *,
  *::before,
  *::after {
    box-sizing: border-box !important;
  }

  #app,
  #root,
  main,
  .app,
  .page,
  .view,
  .view-container,
  .main-container,
  .content,
  .content-wrapper,
  .screen,
  .layout,
  .section,
  .card,
  .glass-panel,
  .tab-content,
  .liga-view,
  .league-view,
  .ligas-view,
  .historial-ligas,
  .historial-ligas-container,
  .league-history,
  .league-history-container,
  #tabla-contenedor,
  #contenedor-partidos,
  .calendar-container,
  .club-match-list,
  .matches-container,
  .fixtures-container,
  .partidos-container,
  .match-list,
  .fixture-list,
  .history-list,
  .league-history-list {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .main-container,
  .content,
  .content-wrapper,
  .view-container,
  .liga-view,
  .league-view,
  .ligas-view,
  .historial-ligas,
  .historial-ligas-container,
  .league-history,
  .league-history-container {
    padding-left: 8px !important;
    padding-right: 8px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
  }

  .glass-panel,
  .card,
  .tab-content {
    padding-left: 10px !important;
    padding-right: 10px !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
  }

  #contenedor-partidos,
  #contenedor-partidos .calendar-container,
  .calendar-container,
  .club-match-list,
  .matches-container,
  .fixtures-container,
  .partidos-container,
  .match-list,
  .fixture-list,
  .history-list,
  .league-history-list {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
  }

  /* Tarjeta: debe crecer en alto y nunca recortar botones/contenido. */
  #contenedor-partidos .fixture-match-card,
  .fixture-match-card,
  .match-card,
  .fixture-card,
  .partido-card,
  .partido-item,
  .club-profile-match-card,
  .club-match-card,
  .history-match-card,
  .league-history-match-card,
  .calendar-container > .fixture-match-card,
  .calendar-container > .match-card,
  .calendar-container > .fixture-card,
  .calendar-container > .partido-card,
  .calendar-container > .partido-item,
  .calendar-container > .club-match-card,
  .calendar-container > .history-match-card,
  .club-match-list > *,
  .matches-container > *,
  .fixtures-container > *,
  .partidos-container > *,
  .match-list > *,
  .fixture-list > *,
  .history-list > *,
  .league-history-list > * {
    position: relative !important;
    inset: auto !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    transform: none !important;
    float: none !important;

    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;

    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 8px !important;

    padding: 12px 10px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;

    overflow-x: hidden !important;
    overflow-y: visible !important;
    contain: none !important;
    clip-path: none !important;
  }

  /* Todo hijo directo de la tarjeta debe entrar y conservar su altura real. */
  #contenedor-partidos .fixture-match-card > *,
  .fixture-match-card > *,
  .match-card > *,
  .fixture-card > *,
  .partido-card > *,
  .partido-item > *,
  .club-profile-match-card > *,
  .club-match-card > *,
  .history-match-card > *,
  .league-history-match-card > *,
  .calendar-container > .fixture-match-card > *,
  .calendar-container > .match-card > *,
  .calendar-container > .fixture-card > *,
  .calendar-container > .partido-card > *,
  .calendar-container > .partido-item > *,
  .calendar-container > .club-match-card > *,
  .calendar-container > .history-match-card > * {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    flex: 0 0 auto !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    contain: none !important;
    clip-path: none !important;
  }

  /* Orden recomendado: Local / Centro / Visitante / Botones. */
  #contenedor-partidos .fixture-match-card .match-team.local,
  .fixture-match-card .match-team.local,
  .match-card .match-team.local,
  .fixture-card .match-team.local,
  .partido-card .match-team.local,
  .match-team.local,
  .local-team,
  .home-team,
  .club-match-team.local,
  .fixture-team.local,
  .partido-team.local,
  .match-team:first-child,
  .club-match-team:first-child,
  .fixture-team:first-child,
  .partido-team:first-child,
  .team-side:first-child,
  .equipo-partido:first-child {
    order: 1 !important;
  }

  #contenedor-partidos .fixture-match-card .match-score,
  .fixture-match-card .match-score,
  .match-card .match-score,
  .fixture-card .match-score,
  .partido-card .match-score,
  .club-profile-match-card .match-score,
  .club-match-card .match-score,
  .history-match-card .match-score,
  .match-score,
  .score-box,
  .fixture-score,
  .partido-score,
  .match-center,
  .fixture-center {
    order: 2 !important;
  }

  #contenedor-partidos .fixture-match-card .match-team.visita,
  .fixture-match-card .match-team.visita,
  .match-card .match-team.visita,
  .fixture-card .match-team.visita,
  .partido-card .match-team.visita,
  .match-team.visita,
  .away-team,
  .visitante-team,
  .club-match-team.visita,
  .fixture-team.visita,
  .partido-team.visita,
  .match-team:last-child,
  .club-match-team:last-child,
  .fixture-team:last-child,
  .partido-team:last-child,
  .team-side:last-child,
  .equipo-partido:last-child {
    order: 3 !important;
  }

  #contenedor-partidos .fixture-actions,
  #contenedor-partidos .match-actions,
  #contenedor-partidos .partido-actions,
  #contenedor-partidos .card-actions,
  #contenedor-partidos .admin-row-actions,
  #contenedor-partidos .action-buttons,
  .fixture-match-card .fixture-actions,
  .fixture-match-card .match-actions,
  .fixture-match-card .partido-actions,
  .fixture-match-card .card-actions,
  .fixture-match-card .admin-row-actions,
  .fixture-match-card .action-buttons,
  .match-card .fixture-actions,
  .match-card .match-actions,
  .match-card .partido-actions,
  .match-card .card-actions,
  .match-card .admin-row-actions,
  .match-card .action-buttons,
  .fixture-card .fixture-actions,
  .fixture-card .match-actions,
  .fixture-card .partido-actions,
  .fixture-card .card-actions,
  .fixture-card .admin-row-actions,
  .fixture-card .action-buttons,
  .partido-card .fixture-actions,
  .partido-card .match-actions,
  .partido-card .partido-actions,
  .partido-card .card-actions,
  .partido-card .admin-row-actions,
  .partido-card .action-buttons,
  .club-match-card .fixture-actions,
  .club-match-card .match-actions,
  .club-match-card .partido-actions,
  .club-match-card .card-actions,
  .club-match-card .admin-row-actions,
  .club-match-card .action-buttons,
  .history-match-card .fixture-actions,
  .history-match-card .match-actions,
  .history-match-card .partido-actions,
  .history-match-card .card-actions,
  .history-match-card .admin-row-actions,
  .history-match-card .action-buttons {
    order: 4 !important;
  }

  /* Equipos: logo + nombre dentro del ancho, sin quedarse a medias. */
  #contenedor-partidos .fixture-match-card .match-team,
  .fixture-match-card .match-team,
  .match-card .match-team,
  .fixture-card .match-team,
  .partido-card .match-team,
  .club-profile-match-card .match-team,
  .club-match-card .match-team,
  .history-match-card .match-team,
  .match-team,
  .club-match-team,
  .fixture-team,
  .partido-team,
  .team-side,
  .equipo-partido,
  .local-team,
  .away-team,
  .home-team,
  .visitante-team {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    float: none !important;

    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 34px !important;
    max-height: none !important;

    display: grid !important;
    grid-template-columns: 32px minmax(0, 1fr) !important;
    align-items: center !important;
    justify-content: initial !important;
    gap: 8px !important;

    padding: 0 !important;
    margin: 0 !important;
    text-align: left !important;
    direction: ltr !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
  }

  #contenedor-partidos .fixture-match-card .match-team.visita,
  .fixture-match-card .match-team.visita,
  .match-card .match-team.visita,
  .fixture-card .match-team.visita,
  .partido-card .match-team.visita,
  .match-team.visita,
  .away-team,
  .visitante-team,
  .club-match-team.visita,
  .fixture-team.visita,
  .partido-team.visita,
  .match-team:last-child,
  .club-match-team:last-child,
  .fixture-team:last-child,
  .partido-team:last-child,
  .team-side:last-child,
  .equipo-partido:last-child {
    grid-template-columns: minmax(0, 1fr) 32px !important;
    text-align: right !important;
  }

  /* Logos compactos y siempre dentro del card. */
  #contenedor-partidos .fixture-match-card .club-badge-logo,
  .fixture-match-card .club-badge-logo,
  .match-card .club-badge-logo,
  .fixture-card .club-badge-logo,
  .partido-card .club-badge-logo,
  .match-team img,
  .club-match-team img,
  .fixture-team img,
  .partido-team img,
  .team-side img,
  .equipo-partido img,
  .club-badge-logo,
  .team-logo,
  .club-logo,
  .match-logo {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    display: block !important;

    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    object-fit: contain !important;
    border-radius: 50% !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: none !important;
  }

  .match-team.local img,
  .local-team img,
  .home-team img,
  .club-match-team:first-child img,
  .fixture-team:first-child img,
  .partido-team:first-child img,
  .team-side:first-child img,
  .equipo-partido:first-child img {
    grid-column: 1 !important;
    justify-self: start !important;
  }

  .match-team.visita img,
  .away-team img,
  .visitante-team img,
  .club-match-team:last-child img,
  .fixture-team:last-child img,
  .partido-team:last-child img,
  .team-side:last-child img,
  .equipo-partido:last-child img {
    grid-column: 2 !important;
    justify-self: end !important;
  }

  /* Nombres de equipos visibles, máximo 2 líneas. */
  #contenedor-partidos .fixture-match-card .fixture-team-name,
  #contenedor-partidos .fixture-match-card .club-link,
  .fixture-match-card .fixture-team-name,
  .fixture-match-card .club-link,
  .match-card .fixture-team-name,
  .match-card .club-link,
  .fixture-card .fixture-team-name,
  .fixture-card .club-link,
  .partido-card .fixture-team-name,
  .partido-card .club-link,
  .club-profile-match-card .fixture-team-name,
  .club-profile-match-card .club-link,
  .club-match-card .fixture-team-name,
  .club-match-card .club-link,
  .history-match-card .fixture-team-name,
  .history-match-card .club-link,
  .club-link,
  .club-match-name,
  .team-name,
  .match-team-name,
  .fixture-team-name,
  .partido-team-name {
    position: relative !important;
    inset: auto !important;
    transform: none !important;

    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;

    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: none !important;

    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;

    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #fff !important;
    font-family: var(--font-tech) !important;
    font-weight: 900 !important;
    font-size: clamp(.58rem, 2.8vw, .76rem) !important;
    line-height: 1.08 !important;
    letter-spacing: 0 !important;
    text-transform: uppercase !important;
  }

  .match-team.local .club-link,
  .match-team.local .fixture-team-name,
  .local-team .club-link,
  .local-team .team-name,
  .home-team .club-link,
  .home-team .team-name,
  .club-match-team:first-child .club-link,
  .club-match-team:first-child .team-name,
  .fixture-team:first-child .club-link,
  .fixture-team:first-child .team-name,
  .partido-team:first-child .club-link,
  .partido-team:first-child .team-name,
  .team-side:first-child .club-link,
  .team-side:first-child .team-name,
  .equipo-partido:first-child .club-link,
  .equipo-partido:first-child .team-name {
    grid-column: 2 !important;
    text-align: left !important;
    justify-self: stretch !important;
  }

  .match-team.visita .club-link,
  .match-team.visita .fixture-team-name,
  .away-team .club-link,
  .away-team .team-name,
  .visitante-team .club-link,
  .visitante-team .team-name,
  .club-match-team:last-child .club-link,
  .club-match-team:last-child .team-name,
  .fixture-team:last-child .club-link,
  .fixture-team:last-child .team-name,
  .partido-team:last-child .club-link,
  .partido-team:last-child .team-name,
  .team-side:last-child .club-link,
  .team-side:last-child .team-name,
  .equipo-partido:last-child .club-link,
  .equipo-partido:last-child .team-name {
    grid-column: 1 !important;
    text-align: right !important;
    justify-self: stretch !important;
  }

  /* Centro: jornada, marcador, estado y fecha. */
  #contenedor-partidos .fixture-match-card .match-score,
  .fixture-match-card .match-score,
  .match-card .match-score,
  .fixture-card .match-score,
  .partido-card .match-score,
  .club-profile-match-card .match-score,
  .club-match-card .match-score,
  .history-match-card .match-score,
  .match-score,
  .score-box,
  .fixture-score,
  .partido-score,
  .match-center,
  .fixture-center {
    position: relative !important;
    inset: auto !important;
    transform: none !important;

    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: none !important;

    padding: 7px 0 !important;
    margin: 0 !important;
    text-align: center !important;
    border-top: 1px solid rgba(255,255,255,.10) !important;
    border-bottom: 1px solid rgba(255,255,255,.10) !important;

    overflow-x: hidden !important;
    overflow-y: visible !important;
  }

  .score-numbers,
  .score,
  .resultado,
  .match-result,
  .fixture-result,
  .fixture-score-value {
    display: block !important;
    font-size: clamp(1.1rem, 5.2vw, 1.5rem) !important;
    line-height: .95 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    overflow: visible !important;
  }

  .match-status,
  .status-badge,
  .fixture-status,
  .club-match-round,
  .match-round,
  .jornada-badge,
  .fixture-round {
    max-width: 100% !important;
    font-size: .48rem !important;
    line-height: 1.05 !important;
    padding: 2px 6px !important;
    margin: 2px auto !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .fixture-date,
  .match-date,
  .partido-date,
  .match-time,
  .fixture-time,
  .fixture-datetime {
    font-size: .48rem !important;
    line-height: 1.12 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  /* Botoneras dentro de cada partido: que se vean todas y no queden recortadas. */
  #contenedor-partidos .fixture-actions,
  #contenedor-partidos .match-actions,
  #contenedor-partidos .partido-actions,
  #contenedor-partidos .card-actions,
  #contenedor-partidos .admin-row-actions,
  #contenedor-partidos .action-buttons,
  .fixture-match-card .fixture-actions,
  .fixture-match-card .match-actions,
  .fixture-match-card .partido-actions,
  .fixture-match-card .card-actions,
  .fixture-match-card .admin-row-actions,
  .fixture-match-card .action-buttons,
  .match-card .fixture-actions,
  .match-card .match-actions,
  .match-card .partido-actions,
  .match-card .card-actions,
  .match-card .admin-row-actions,
  .match-card .action-buttons,
  .fixture-card .fixture-actions,
  .fixture-card .match-actions,
  .fixture-card .partido-actions,
  .fixture-card .card-actions,
  .fixture-card .admin-row-actions,
  .fixture-card .action-buttons,
  .partido-card .fixture-actions,
  .partido-card .match-actions,
  .partido-card .partido-actions,
  .partido-card .card-actions,
  .partido-card .admin-row-actions,
  .partido-card .action-buttons,
  .club-match-card .fixture-actions,
  .club-match-card .match-actions,
  .club-match-card .partido-actions,
  .club-match-card .card-actions,
  .club-match-card .admin-row-actions,
  .club-match-card .action-buttons,
  .history-match-card .fixture-actions,
  .history-match-card .match-actions,
  .history-match-card .partido-actions,
  .history-match-card .card-actions,
  .history-match-card .admin-row-actions,
  .history-match-card .action-buttons {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: none !important;

    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 6px !important;
    padding: 0 !important;
    margin: 0 !important;

    overflow-x: hidden !important;
    overflow-y: visible !important;
  }

  #contenedor-partidos .fixture-actions > *,
  #contenedor-partidos .match-actions > *,
  #contenedor-partidos .partido-actions > *,
  #contenedor-partidos .card-actions > *,
  #contenedor-partidos .admin-row-actions > *,
  #contenedor-partidos .action-buttons > *,
  .fixture-match-card .fixture-actions > *,
  .fixture-match-card .match-actions > *,
  .fixture-match-card .partido-actions > *,
  .fixture-match-card .card-actions > *,
  .fixture-match-card .admin-row-actions > *,
  .fixture-match-card .action-buttons > *,
  .match-card .fixture-actions > *,
  .match-card .match-actions > *,
  .match-card .partido-actions > *,
  .match-card .card-actions > *,
  .match-card .admin-row-actions > *,
  .match-card .action-buttons > *,
  .fixture-card .fixture-actions > *,
  .fixture-card .match-actions > *,
  .fixture-card .partido-actions > *,
  .fixture-card .card-actions > *,
  .fixture-card .admin-row-actions > *,
  .fixture-card .action-buttons > *,
  .partido-card .fixture-actions > *,
  .partido-card .match-actions > *,
  .partido-card .partido-actions > *,
  .partido-card .card-actions > *,
  .partido-card .admin-row-actions > *,
  .partido-card .action-buttons > * {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 32px !important;
    height: auto !important;
    max-height: none !important;
    padding: 8px 10px !important;
    font-size: .52rem !important;
    line-height: 1.05 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    overflow: visible !important;
  }

  /* Botones generales de filtros/calendario dentro del panel. */
  .filtro-btn,
  .tab-btn,
  .btn-primary,
  .btn-secondary,
  .btn-danger,
  .admin-row-action-btn,
  .hero-btn {
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    white-space: normal !important;
  }

  /* Botones flotantes: no ensanchan ni tapan demasiado. */
  #btn-float-add-match,
  .add-match-btn,
  .agregar-partido,
  [class*="agregar" i],
  [id*="agregar" i] {
    left: auto !important;
    right: 8px !important;
    bottom: 10px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: min(42vw, 148px) !important;
    min-height: 38px !important;
    padding: 8px 10px !important;
    border-radius: 8px !important;
    font-size: .54rem !important;
    line-height: 1.05 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    z-index: 60 !important;
  }

  [class*="comandante" i],
  [id*="comandante" i],
  [class*="floating" i],
  [class*="float" i],
  [class*="fab" i] {
    left: auto !important;
    right: 8px !important;
    max-width: min(43vw, 155px) !important;
    min-width: 0 !important;
    padding: 8px 10px !important;
    border-radius: 999px !important;
    font-size: .54rem !important;
    line-height: 1.05 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    z-index: 55 !important;
  }
}

@media (max-width: 420px) {
  #contenedor-partidos .fixture-match-card,
  .fixture-match-card,
  .match-card,
  .fixture-card,
  .partido-card,
  .partido-item,
  .club-profile-match-card,
  .club-match-card,
  .history-match-card,
  .league-history-match-card,
  .calendar-container > .fixture-match-card,
  .calendar-container > .match-card,
  .calendar-container > .fixture-card,
  .calendar-container > .partido-card,
  .calendar-container > .partido-item,
  .calendar-container > .club-match-card,
  .calendar-container > .history-match-card,
  .club-match-list > *,
  .matches-container > *,
  .fixtures-container > *,
  .partidos-container > *,
  .match-list > *,
  .fixture-list > *,
  .history-list > *,
  .league-history-list > * {
    padding: 10px 9px !important;
    gap: 7px !important;
  }

  .match-team,
  .club-match-team,
  .fixture-team,
  .partido-team,
  .team-side,
  .equipo-partido,
  .local-team,
  .home-team {
    grid-template-columns: 28px minmax(0, 1fr) !important;
    gap: 7px !important;
  }

  .match-team.visita,
  .away-team,
  .visitante-team,
  .club-match-team:last-child,
  .fixture-team:last-child,
  .partido-team:last-child,
  .team-side:last-child,
  .equipo-partido:last-child {
    grid-template-columns: minmax(0, 1fr) 28px !important;
  }

  .match-team img,
  .club-match-team img,
  .fixture-team img,
  .partido-team img,
  .team-side img,
  .equipo-partido img,
  .club-badge-logo,
  .team-logo,
  .club-logo,
  .match-logo {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
  }

  .club-link,
  .club-match-name,
  .team-name,
  .match-team-name,
  .fixture-team-name,
  .partido-team-name {
    font-size: clamp(.54rem, 2.75vw, .70rem) !important;
    line-height: 1.06 !important;
  }
}

/* Prioridad final: el fixture no puede ocultar contenido en móvil. */
@media (max-width: 760px) {
  #contenedor-partidos .fixture-match-card {
    grid-template-columns: 1fr !important;
    grid-template-areas: "score" "local" "visita" "actions" !important;
    gap: 10px !important;
    padding: 13px 11px !important;
    overflow: hidden !important;
  }
  #contenedor-partidos .fixture-match-card .match-score { grid-area:score !important; width:100% !important; }
  #contenedor-partidos .fixture-match-card .match-team.local { grid-area:local !important; grid-template-columns:minmax(0,1fr) 42px !important; }
  #contenedor-partidos .fixture-match-card .match-team.visita { grid-area:visita !important; grid-template-columns:42px minmax(0,1fr) !important; }
  #contenedor-partidos .fixture-match-card .match-team.local,
  #contenedor-partidos .fixture-match-card .match-team.visita { display:grid !important; width:100% !important; min-width:0 !important; direction:ltr !important; text-align:left !important; }
  #contenedor-partidos .fixture-match-card .club-badge-logo { width:42px !important; height:42px !important; min-width:42px !important; }
  #contenedor-partidos .fixture-match-card .match-team.local .fixture-team-label { grid-column:1 !important; grid-row:1 !important; }
  #contenedor-partidos .fixture-match-card .match-team.local .club-badge-logo { grid-column:2 !important; grid-row:1 !important; }
  #contenedor-partidos .fixture-match-card .match-team.visita .club-badge-logo { grid-column:1 !important; grid-row:1 !important; }
  #contenedor-partidos .fixture-match-card .match-team.visita .fixture-team-label { grid-column:2 !important; grid-row:1 !important; }
  #contenedor-partidos .fixture-match-card .fixture-team-name[data-team-name]::after { white-space:nowrap !important; overflow:hidden !important; text-overflow:ellipsis !important; }
  #contenedor-partidos .fixture-match-actions,
  #contenedor-partidos .fixture-match-actions.solo-editar { grid-area:actions !important; grid-column:auto !important; grid-row:auto !important; grid-template-columns:minmax(0,1fr) 88px !important; width:100% !important; max-width:100% !important; margin:2px 0 0 !important; }
  #contenedor-partidos .fixture-match-actions.solo-editar { grid-template-columns:1fr !important; width:min(132px,100%) !important; justify-self:center; }
  #contenedor-partidos .fixture-match-actions .hero-btn { min-height:38px !important; padding:5px 6px !important; font-size:.56rem !important; }
  #contenedor-partidos .fixture-match-actions .btn-danger { grid-column:1 / -1; margin:0 !important; font-size:.55rem !important; }
  #contenedor-partidos .fixture-match-card .match-status { white-space:nowrap !important; font-size:.56rem !important; }
  /* Solo móvil: local = logo | nombre | casa. */
  #contenedor-partidos .fixture-match-card .match-team.local { grid-template-columns:42px minmax(0,1fr) !important; }
  #contenedor-partidos .fixture-match-card .match-team.local .club-badge-logo { grid-column:1 !important; grid-row:1 !important; }
  #contenedor-partidos .fixture-match-card .match-team.local .fixture-team-label { grid-column:2 !important; grid-row:1 !important; flex-direction:row-reverse; justify-content:flex-end; }

  .club-match-list {
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:10px !important;
    overflow:visible !important;
    width:100% !important;
    max-width:100% !important;
  }
}

/* Perfil de club: matches usa el mismo patron visual del fixture de liga. */
.club-match-list.calendar-container,
.lista-partidos-filtro.club-match-list {
  display:grid !important;
  grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
  gap:16px !important;
  width:100% !important;
  max-width:100% !important;
  overflow:visible !important;
}
.club-match-list .fixture-match-card {
  display:grid !important;
  grid-template-columns:minmax(0,1fr) minmax(118px,142px) minmax(0,1fr) !important;
  align-items:center !important;
  gap:12px !important;
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  overflow:hidden !important;
}
.club-match-list .fixture-match-card .match-team {
  min-width:0 !important;
  max-width:100% !important;
}
.club-match-list .fixture-match-card .match-team.local {
  display:grid !important;
  grid-template-columns:minmax(0,1fr) 52px !important;
  align-items:center !important;
  gap:10px !important;
  text-align:right !important;
}
.club-match-list .fixture-match-card .match-team.visita {
  display:grid !important;
  grid-template-columns:52px minmax(0,1fr) !important;
  align-items:center !important;
  gap:10px !important;
  text-align:left !important;
}
.club-match-list .fixture-match-card .club-badge-logo {
  width:52px !important;
  height:52px !important;
  min-width:52px !important;
  margin:0 !important;
  object-fit:contain !important;
}
.club-match-list .fixture-match-card .match-score {
  width:100% !important;
  min-width:0 !important;
  max-width:142px !important;
}
.club-match-list .fixture-match-card .fixture-team-label {
  display:flex !important;
  align-items:center !important;
  gap:5px !important;
  min-width:0 !important;
  max-width:100% !important;
}
.club-match-list .fixture-match-card .match-team.local .fixture-team-label {
  justify-content:flex-end !important;
}
.club-match-list .fixture-match-card .fixture-team-name,
.club-match-list .fixture-match-card .club-match-name {
  min-width:0 !important;
  max-width:100% !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
}
.club-match-list .fixture-match-card .fixture-team-name::before,
.club-match-list .fixture-match-card .fixture-team-name::after,
.club-match-list .fixture-match-card .club-match-name::before,
.club-match-list .fixture-match-card .club-match-name::after,
.club-match-list .fixture-match-card .club-link::before,
.club-match-list .fixture-match-card .club-link::after,
.club-match-list .fixture-match-card .fixture-team-label::before,
.club-match-list .fixture-match-card .fixture-team-label::after {
  content:none !important;
  display:none !important;
}

@media (max-width: 760px) {
  .club-match-list.calendar-container,
  .lista-partidos-filtro.club-match-list {
    grid-template-columns:1fr !important;
    gap:10px !important;
  }
  .club-match-list .fixture-match-card {
    grid-template-columns:1fr !important;
    grid-template-areas:"local" "score" "visita" "actions" !important;
    gap:10px !important;
    padding:16px !important;
    height:auto !important;
    min-height:0 !important;
    overflow:visible !important;
  }
  .club-match-list .fixture-match-card .match-score {
    grid-area:score !important;
    width:100% !important;
    max-width:100% !important;
  }
  .club-match-list .fixture-match-card .match-team.local,
  .club-match-list .fixture-match-card .match-team.visita {
    display:grid !important;
    width:100% !important;
    min-width:0 !important;
    direction:ltr !important;
    text-align:left !important;
  }
  .club-match-list .fixture-match-card .match-team.local {
    grid-area:local !important;
    grid-template-columns:42px minmax(0,1fr) !important;
  }
  .club-match-list .fixture-match-card .match-team.visita {
    grid-area:visita !important;
    grid-template-columns:42px minmax(0,1fr) !important;
  }
  .club-match-list .fixture-match-card .club-badge-logo {
    width:42px !important;
    height:42px !important;
    min-width:42px !important;
  }
  .club-match-list .fixture-match-card .match-team.local .club-badge-logo,
  .club-match-list .fixture-match-card .match-team.visita .club-badge-logo {
    grid-column:1 !important;
    grid-row:1 !important;
  }
  .club-match-list .fixture-match-card .match-team.local .fixture-team-label,
  .club-match-list .fixture-match-card .match-team.visita .fixture-team-label {
    grid-column:2 !important;
    grid-row:1 !important;
    justify-content:flex-start !important;
  }
  .club-match-list .fixture-match-card .match-team.local .fixture-team-label {
    flex-direction:row-reverse !important;
  }
  .club-match-list .fixture-match-card .fixture-team-name,
  .club-match-list .fixture-match-card .club-match-name {
    width:100% !important;
    font-size:clamp(.58rem,2.15vw,.76rem) !important;
  }
  .club-match-list .fixture-match-actions,
  .club-match-list .fixture-match-actions.solo-editar {
    grid-area:actions !important;
    grid-column:auto !important;
    grid-row:auto !important;
    width:100% !important;
    max-width:100% !important;
    margin:2px 0 0 !important;
  }
  .club-match-list .fixture-match-actions .hero-btn,
  .club-match-list .fixture-match-actions .btn-secondary {
    min-height:38px !important;
    padding:5px 6px !important;
    font-size:.56rem !important;
    margin:0 !important;
  }
  .club-match-list .fixture-match-card .match-status {
    white-space:nowrap !important;
    font-size:.56rem !important;
  }
}

/* Campo de partido vertical en móvil: porterías arriba/abajo y líneas ordenadas. */
@media (max-width: 768px) {
  .match-3d-section { margin:0 !important; padding:0 !important; overflow:visible !important; }
  .match-3d-pitch {
    min-width:0 !important;
    width:100% !important;
    min-height:720px !important;
    height:min(190vw,840px) !important;
    padding:0 !important;
    transform:none !important;
    background:linear-gradient(180deg, rgba(0,184,255,.38), rgba(0,255,135,.14) 48%, rgba(255,45,85,.30)) !important;
  }
  .match-3d-half.local { width:100% !important; height:50% !important; top:0 !important; left:0 !important; background:linear-gradient(180deg, rgba(0,184,255,.2), transparent) !important; }
  .match-3d-half.visita { width:100% !important; height:50% !important; top:50% !important; left:0 !important; background:linear-gradient(0deg, rgba(255,45,85,.22), transparent) !important; }
  .match-3d-line.mid { top:50% !important; bottom:auto !important; left:0 !important; width:100% !important; height:2px !important; }
  .match-3d-box { left:27% !important; width:46% !important; height:13% !important; }
  .match-3d-box.left { top:0 !important; bottom:auto !important; left:27% !important; border-left:2px solid rgba(255,255,255,.55) !important; border-top:0 !important; }
  .match-3d-box.right { top:auto !important; bottom:0 !important; right:auto !important; left:27% !important; border-right:2px solid rgba(255,255,255,.55) !important; border-bottom:0 !important; }
  .match-3d-player,
  .match-3d-player:hover {
    width:max-content !important;
    min-width:70px !important;
    min-height:52px !important;
    left:var(--match-y) !important;
    top:calc(100% - var(--match-x)) !important;
    transform:translate(-50%,-50%) !important;
    grid-template-columns:minmax(0,1fr) !important;
    grid-template-rows:25px auto !important;
    gap:2px !important;
    padding:2px !important;
  }
  .match-3d-avatar { width:23px !important; height:23px !important; }
  .match-3d-pos { display:none !important; }
  .match-3d-player strong,
  .match-3d-player small { height:13px !important; padding:2px 5px !important; overflow:visible !important; }
  .match-3d-player strong { font-size:var(--match-name-size-mobile,.42rem) !important; }
  .match-3d-player small { font-size:var(--match-detail-size-mobile,.34rem) !important; }
  .match-3d-player.is-wide-mid { top:calc(100% - var(--match-x)) !important; }

  .perfil-acceso-actions { padding:10px !important; margin-bottom:16px !important; }
  .perfil-acceso-actions .hero-btn { min-height:34px !important; padding:6px 9px !important; margin:4px !important; font-size:.56rem !important; }
}

/* Prioridad final: en matches de club movil el local va antes del resultado. */
@media (max-width: 760px) {
  .club-match-list .club-profile-fixture-match {
    display:grid !important;
    grid-template-columns:1fr !important;
    grid-template-areas:"local" "score" "visita" "actions" !important;
  }
  .club-match-list .club-profile-fixture-match .match-team.local {
    grid-area:local !important;
    order:1 !important;
  }
  .club-match-list .club-profile-fixture-match .match-score {
    grid-area:score !important;
    order:2 !important;
  }
  .club-match-list .club-profile-fixture-match .match-team.visita {
    grid-area:visita !important;
    order:3 !important;
  }
  .club-match-list .club-profile-fixture-match .fixture-match-actions {
    grid-area:actions !important;
    order:4 !important;
  }
}

/* Estabilidad visual global:
   evita capas animadas permanentes y composición 3D que provocan destellos
   en navegadores Chromium, Safari y Firefox, tanto en PC como en móvil. */
html {
  scrollbar-gutter: stable;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.navbar,
.main-container,
.match-3d-section {
  isolation: isolate;
}

.nav-ticker-wrapper,
.registered-teams-carousel,
.home-transfer-marquee {
  overflow-x: auto !important;
  overflow-y: hidden !important;
  mask-image: none !important;
  -webkit-mask-image: none !important;
  overscroll-behavior-inline: contain;
  touch-action: pan-x;
  scrollbar-width: none;
}

.nav-ticker-wrapper::-webkit-scrollbar,
.registered-teams-carousel::-webkit-scrollbar,
.home-transfer-marquee::-webkit-scrollbar {
  display: none;
}

#nav-ticker-track,
.ticker-track,
.registered-teams-track,
.home-transfer-track {
  animation: none !important;
  transform: none !important;
  width: max-content;
}

.ticker-item-modern,
.registered-team-pill,
.home-transfer-item {
  scroll-snap-align: start;
}

.match-3d-pitch {
  transform: none !important;
  transform-style: flat !important;
  -webkit-backface-visibility: visible !important;
  backface-visibility: visible !important;
}

.match-3d-player,
.match-3d-player:hover {
  transform: translate(-50%, -50%) !important;
  -webkit-backface-visibility: visible !important;
  backface-visibility: visible !important;
}

#ticopa-global-refresh {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* IDs de jugadores en el detalle de partido:
   una sola línea y una columna común basada en el ID más largo del equipo. */
.match-squad-player-identity {
  min-width: 0;
  flex-wrap: nowrap !important;
}

.match-squad-player-id.club-link {
  display: inline-block !important;
  flex: 0 0 auto !important;
  width: max-content !important;
  min-width: var(--match-squad-id-width, 10ch) !important;
  max-width: none !important;
  white-space: nowrap !important;
  overflow: visible !important;
  overflow-wrap: normal !important;
  word-break: keep-all !important;
  text-overflow: clip !important;
  line-height: 1.1;
}

@media (max-width: 600px) {
  .match-squad-player-identity {
    gap: 7px !important;
  }

  .match-squad-player-id.club-link {
    min-width: min(var(--match-squad-id-width, 10ch), calc(100vw - 155px)) !important;
    font-size: clamp(.68rem, 3.1vw, .92rem) !important;
    letter-spacing: -.02em;
  }
}

/* Fixture de liga compacto y sin superposiciones. */
#contenedor-partidos .calendar-container {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 620px), 1fr)) !important;
  gap: 14px !important;
}

#contenedor-partidos .fixture-match-card {
  grid-template-columns: minmax(0, 1fr) minmax(105px, 118px) minmax(0, 1fr) !important;
  gap: 8px !important;
  padding: 12px 10px !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

#contenedor-partidos .fixture-match-card .match-team {
  min-width: 0 !important;
  width: 100% !important;
  overflow: hidden !important;
}

#contenedor-partidos .fixture-match-card .match-team.local {
  grid-template-columns: minmax(0, 1fr) 44px !important;
}

#contenedor-partidos .fixture-match-card .match-team.visita {
  grid-template-columns: 44px minmax(0, 1fr) !important;
}

#contenedor-partidos .fixture-match-card .club-badge-logo {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
}

#contenedor-partidos .fixture-match-card .fixture-team-label {
  width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
  gap: 4px !important;
}

#contenedor-partidos .fixture-match-card .fixture-team-name {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  font-size: clamp(.62rem, .78vw, .78rem) !important;
  line-height: 1.12 !important;
}

#contenedor-partidos .fixture-match-card .fixture-team-name[data-team-name]::after {
  display: -webkit-box !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font-size: clamp(.62rem, .78vw, .78rem) !important;
  line-height: 1.12 !important;
}

#contenedor-partidos .fixture-match-card .match-score {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 118px !important;
  padding: 0 !important;
}

#contenedor-partidos .fixture-match-card .score-numbers {
  font-size: clamp(1.05rem, 1.35vw, 1.35rem) !important;
}

#contenedor-partidos .fixture-match-card .match-status {
  font-size: .52rem !important;
}

#contenedor-partidos .fixture-match-actions,
#contenedor-partidos .fixture-match-actions.solo-editar {
  grid-column: 2 !important;
  grid-row: 2 !important;
  justify-self: center !important;
  grid-template-columns: 1fr !important;
  width: 118px !important;
  max-width: 100% !important;
  gap: 5px !important;
}

#contenedor-partidos .fixture-match-actions .hero-btn,
#contenedor-partidos .fixture-match-actions .btn-danger {
  width: 100% !important;
  min-height: 38px !important;
  margin: 0 !important;
  padding: 5px 6px !important;
  font-size: .54rem !important;
  line-height: 1.12 !important;
}

@media (max-width: 760px) {
  #contenedor-partidos .fixture-match-card {
    grid-template-columns: 1fr !important;
    grid-template-areas: "score" "local" "visita" "actions" !important;
    gap: 9px !important;
    padding: 11px 9px !important;
  }

  #contenedor-partidos .fixture-match-card .match-team.local,
  #contenedor-partidos .fixture-match-card .match-team.visita {
    grid-template-columns: 38px minmax(0, 1fr) !important;
    min-height: 46px !important;
  }

  #contenedor-partidos .fixture-match-card .club-badge-logo {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
  }

  #contenedor-partidos .fixture-match-card .match-score {
    max-width: none !important;
  }

  #contenedor-partidos .fixture-match-actions,
  #contenedor-partidos .fixture-match-actions.solo-editar {
    grid-area: actions !important;
    grid-column: auto !important;
    grid-row: auto !important;
    width: min(132px, 100%) !important;
  }

  #contenedor-partidos .fixture-match-card .fixture-team-name,
  #contenedor-partidos .fixture-match-card .fixture-team-name[data-team-name]::after {
    font-size: .68rem !important;
  }
}
/* Viewport estable y areas seguras para iOS/Android instalados como PWA. */
html,
body {
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar-menu {
  height: 100vh;
  height: 100dvh;
  padding-top: max(30px, env(safe-area-inset-top));
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}

.portal-bienvenida {
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
