/*
 * eFootball card typography
 *
 * Every card that writes its rating, position, or player name in HTML uses
 * these same coordinates. The artwork stays untouched; only the dynamic
 * text is placed over it.
 */
@font-face {
  font-family: "eFootball Card Rating";
  src: url("/assets/fonts/Card%20Rate.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "eFootball Card Name";
  src: url("/assets/fonts/Card%20Name%20and%20pos.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

.ef-card {
  position: relative;
  display: block;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 7 / 10;
  container-type: inline-size;
}

.ef-card__image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.ef-card__rating,
.ef-card__position,
.ef-card__name {
  position: absolute;
  z-index: 3;
  box-sizing: border-box;
  margin: 0;
  color: #fff;
  pointer-events: none;
  text-shadow: 0.07em 0.09em 0.13em rgba(0, 0, 0, 0.9);
}

.ef-card__rating {
  top: 6%;
  left: 6.5%;
  max-width: 44%;
  font-family: "eFootball Card Rating", sans-serif;
  font-size: clamp(0.95rem, 16.6cqi, 2.65rem);
  font-weight: 400;
  line-height: 0.82;
  letter-spacing: -0.06em;
  white-space: nowrap;
}

.ef-card__position {
  top: 17%;
  left: 7%;
  max-width: 42%;
  font-family: "eFootball Card Name", sans-serif;
  font-size: clamp(0.58rem, 11.1cqi, 1.3rem);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ef-card__name {
  top: 70.5%;
  right: 7%;
  left: 7%;
  max-height: 1.15em;
  overflow: hidden;
  font-family: "eFootball Card Name", sans-serif;
  font-size: clamp(0.62rem, 10cqi, 1.3rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.04em;
  text-align: center;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

/* Compact formation cards retain the same map, scaled by their own width. */
.ef-card--pitch .ef-card__rating {
  font-size: 18cqi;
}

.ef-card--pitch .ef-card__position {
  font-size: 10cqi;
}

.ef-card--pitch .ef-card__name {
  font-size: 9cqi;
}

/* The comparison card has a fixed visual area, so it cannot grow past its row. */
.compare-card-visual.ef-card {
  width: min(100%, 161px);
  max-width: 100%;
  align-self: start;
}

.compare-card-visual.ef-card .ef-card__image {
  max-height: none;
  object-fit: cover;
}

/* Keep the Draft role label clear of the shared rating coordinate. */
.seo-draft-card.ef-card .seo-draft-card__slot {
  position: absolute;
  z-index: 4;
  top: 6%;
  right: 6%;
  left: auto;
  max-width: 38%;
  overflow: hidden;
  padding: 0.32em 0.48em;
  border-radius: 0;
  font-size: clamp(0.45rem, 6.4cqi, 0.8rem);
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .compare-card-visual.ef-card {
    width: min(100%, 136px);
  }
}
