/* Load after readability.css. Keep the HUD fixed; allocate space inside each card. */
.hud-app :is(.selection-side, .profile-showcase) .football-card {
  --player-card-height: 306px;
  box-sizing: border-box;
  container-type: inline-size;
  display: grid;
  grid-template-rows: 20px minmax(0, 1fr) minmax(78px, auto) auto 44px;
  width: min(212px, 100%);
  height: var(--player-card-height);
  min-height: var(--player-card-height);
  max-height: var(--player-card-height);
  padding: 6px 10px 14px;
  margin: 0 auto 12px;
  flex: none;
  clip-path: none;
  border-radius: 20px 20px 28px 28px;
}

.hud-app :is(.selection-side, .profile-showcase) .football-card .card-topline {
  align-items: center;
  padding: 0 4px;
  font-size: 10px;
  line-height: 16px;
  letter-spacing: .6px;
}

.hud-app :is(.selection-side, .profile-showcase) .football-card .card-photo {
  height: 100%;
  min-height: 0;
  margin: 0;
}

.hud-app :is(.selection-side, .profile-showcase) .football-card .card-rating {
  top: 0;
  left: 0;
  min-width: 44px;
  min-height: 44px;
  padding: 3px 5px;
}

.hud-app :is(.selection-side, .profile-showcase) .football-card .card-rating strong {
  font-size: 28px;
  line-height: 1;
  letter-spacing: -1px;
}

.hud-app :is(.selection-side, .profile-showcase) .football-card .card-rating span {
  font: 700 10px/1.3 Arial, sans-serif;
  letter-spacing: 0;
}

.hud-app :is(.selection-side, .profile-showcase) .football-card .card-identity {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  height: auto;
  min-height: 0;
  margin: 0;
}

.hud-app :is(.selection-side, .profile-showcase) .football-card .card-identity h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -.4px;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
}

.hud-app :is(.selection-side, .profile-showcase) .football-card .card-identity > span {
  margin: 0;
  font: 500 12px/1.3 Arial, sans-serif;
  white-space: normal;
  overflow-wrap: anywhere;
  opacity: 1;
}

.hud-app :is(.selection-side, .profile-showcase) .football-card .card-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  align-items: center;
  min-height: 58px;
  margin: 0;
  padding: 5px 0 0;
}

.hud-app :is(.selection-side, .profile-showcase) .football-card .card-stats > button {
  min-width: 0;
  min-height: 44px;
  padding: 3px 0;
  font: 700 12px/1.25 Arial, sans-serif;
  letter-spacing: 0;
  white-space: normal;
}

.hud-app :is(.selection-side, .profile-showcase) .football-card .card-stats > button b {
  display: block;
  margin: 0 0 3px;
  font: 800 21px/1 Arial, sans-serif;
}

.hud-app :is(.selection-side, .profile-showcase) .football-card .card-open {
  display: flex;
  min-height: 44px;
  padding: 4px 0;
  gap: 10px;
  font: 800 12px/1.3 Arial, sans-serif;
  letter-spacing: .3px;
}

.hud-app :is(.selection-side, .profile-showcase) .football-card .card-open span {
  font-size: 18px;
  line-height: 1;
}

/* At narrow desktop widths, two rows keep PEDIDOS and VALORES intact. */
@container (max-width: 180px) {
  .hud-app :is(.selection-side, .profile-showcase) .football-card .card-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: 44px 44px;
    gap: 0 4px;
  }

  .hud-app :is(.selection-side, .profile-showcase) .football-card .card-stats > button:last-child {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .hud-app :is(.selection-side, .profile-showcase) .football-card .card-stats > button:last-child b {
    margin: 0;
  }

}

/* Bench cards are the visible player cards on mobile. One list scrolls. */
.hud-app .selection-side .bench-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(126px, 100%), 1fr));
  grid-auto-rows: 176px;
  gap: 12px 10px;
}

.hud-app .selection-side .bench-player {
  height: 176px;
  min-height: 176px;
}

.hud-app .selection-side .bench-portrait {
  height: 80px;
  min-height: 80px;
  flex: 0 0 80px;
}

.hud-app .selection-side .bench-player strong {
  display: block;
  height: 54px;
  min-height: 54px;
  max-height: 54px;
  margin: 5px 0 0;
  font-size: 14px;
  line-height: 18px;
  white-space: normal;
  overflow-wrap: anywhere;
  -webkit-line-clamp: unset;
}

.hud-app .selection-side .bench-player small {
  height: 32px;
  min-height: 32px;
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 16px;
  white-space: normal;
  text-overflow: clip;
}

/* The count and its coverage explanation must read together, without ellipses. */
.hud-app :is(.trump-page-facts, .person-fact-shortcut, .fact-profile) .fact-count {
  min-width: 0;
  max-width: 100%;
  gap: 12px;
}

.hud-app :is(.trump-page-facts, .person-fact-shortcut, .fact-profile) .fact-count > strong {
  flex: 0 0 auto;
  letter-spacing: -1px;
}

.hud-app :is(.trump-page-facts, .person-fact-shortcut, .fact-profile) .fact-count > div {
  min-width: 0;
  gap: 6px;
}

.hud-app :is(.trump-page-facts, .person-fact-shortcut, .fact-profile) .fact-count :is(b, span) {
  display: block;
  max-height: none;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  -webkit-line-clamp: unset;
}

.hud-app :is(.trump-page-facts, .person-fact-shortcut, .fact-profile) .fact-count b {
  font-size: 15px;
  line-height: 1.4;
}

.hud-app :is(.trump-page-facts, .person-fact-shortcut, .fact-profile) .fact-count span,
.hud-app :is(.trump-page-facts, .fact-profile) .fact-method {
  font-size: 13px;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (min-width: 1151px) and (max-height: 740px) {
  .hud-app .selection-side .football-card { --player-card-height: 280px; }
}

@media (min-width: 801px) and (max-height: 620px) {
  .hud-app .selection-side .football-card {
    --player-card-height: 220px;
    grid-template-rows: 0 minmax(44px, 1fr) 28px auto 44px;
    padding-top: 0;
    padding-bottom: 10px;
  }

  .hud-app .selection-side .football-card :is(.card-topline, .card-identity > span) { display: none; }
  .hud-app .selection-side .football-card .card-stats { align-self: center; }
  .hud-app .selection-side .football-card .card-photo > img { max-height: 100%; }
}

@media (max-width: 800px), (max-width: 950px) and (max-height: 520px) {
  /* Preserve the existing mobile tabs and compact HUD rather than adding a new panel. */
  .hud-app .selection-side .football-card { display: none; }
}
