/* the player card and the member view: the same drawing as the «بطاقة اللاعب» app (apps/player-cards/src/styles.css) */
/* the player card, after the academy's own mockups: a gold frame around a royal blue panel,
   drawn the same in light and dark */
.pc-card {
  --pc-gold: #f7dc8c;
  --pc-ink: #ffffff;
  --pc-inner: polygon(10% 10.7%, 20.7% 10.7%, 39.3% 5.3%, 50% 2.8%, 60.7% 5.3%, 79.3% 10.7%, 90% 10.7%, 93.7% 13%, 93.7% 75.3%, 90% 79.8%, 55.3% 92.8%, 50% 96.3%, 44.7% 92.8%, 10% 79.8%, 6.3% 75.3%, 6.3% 13%);
  position: relative;
  container-type: inline-size;
  width: min(100%, 320px);
  aspect-ratio: 300 / 430;
  margin: 0;
  color: var(--pc-ink);
  font-family: Cairo, "Noto Kufi Arabic", system-ui, sans-serif;
  filter: drop-shadow(0 14px 26px rgb(4 14 46 / 0.45));
}

.pc-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.pc-photo-clip {
  position: absolute;
  inset: 0;
  clip-path: var(--pc-inner);
}

.pc-photo {
  position: absolute;
  inset-block-start: 4%;
  left: 31%;
  width: 63%;
  height: 58%;
  object-fit: cover;
  object-position: top;
  mask-image:
    linear-gradient(to bottom, #000 0, #000 70%, transparent 100%),
    linear-gradient(to right, transparent 0, #000 18%, #000 100%);
  mask-composite: intersect;
}

.pc-head {
  position: absolute;
  top: 12.5%;
  left: 9%;
  width: 28%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4cqw;
  line-height: 1;
}

.pc-overall {
  font-size: 20cqw;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--pc-gold);
  text-shadow: 0 2px 6px rgb(0 0 0 / 0.35);
}

.pc-position {
  font-size: 8.4cqw;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 4px rgb(0 0 0 / 0.35);
}

.pc-rule {
  width: 15cqw;
  height: 1px;
  margin-block: 2cqw;
  background: linear-gradient(90deg, transparent, var(--pc-gold), transparent);
}

.pc-logo {
  width: 21cqw;
  height: auto;
  filter: brightness(0) invert(1);
}

.pc-brand {
  font-size: 3.6cqw;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.pc-names {
  position: absolute;
  top: 60%;
  left: 8%;
  right: 8%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  line-height: 1.1;
}

.pc-name {
  font-size: 10.4cqw;
  font-weight: 800;
  color: var(--pc-gold);
  text-shadow: 0 2px 6px rgb(0 0 0 / 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.pc-name-en {
  margin-block-start: 0.6cqw;
  font-size: 5.4cqw;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.pc-stats {
  position: absolute;
  top: 74%;
  left: 11%;
  right: 11%;
  display: flex;
  justify-content: center;
  margin: 0;
}

.pc-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.05;
}

.pc-stat + .pc-stat {
  border-left: 1px solid rgb(247 220 140 / 0.45);
}

.pc-stat dt {
  font-size: 4.6cqw;
  font-weight: 700;
}

.pc-stat dd {
  margin: 0;
  font-size: 8.4cqw;
  font-weight: 800;
  color: var(--pc-gold);
}

.pc-stats-dense .pc-stat dt {
  font-size: 3.8cqw;
}

.pc-stats-dense .pc-stat dd {
  font-size: 7cqw;
}

.pc-tip {
  position: absolute;
  top: 86.5%;
  left: 50%;
  width: 13cqw;
  height: auto;
  transform: translateX(-50%);
  color: var(--pc-ink);
}

/* the member's page: the card between its skill bars and its performance hexagons */
.pcs {
  --pcs-gold: #f7dc8c;
  --pcs-cyan: #5fe3ff;
  position: relative;
  container-type: inline-size;
  overflow: hidden;
  padding: 24px 28px 28px;
  color: #ffffff;
  font-family: Cairo, "Noto Kufi Arabic", system-ui, sans-serif;
  background: linear-gradient(180deg, #071a4a 0%, #0b3486 52%, #0a5cc0 100%);
}

.pcs-football {
  background: linear-gradient(180deg, #040d26 0%, #0b2150 52%, #0c3a24 100%);
}

.pcs-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.pcs::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 55% at 50% 50%, transparent 40%, rgb(3 10 34 / 0.55) 100%);
  pointer-events: none;
}

.pcs > :not(.pcs-scene) {
  position: relative;
  z-index: 1;
}

.pcs-stands {
  fill: rgb(255 255 255 / 0.04);
}

.pcs-rope {
  stroke: rgb(255 255 255 / 0.55);
  stroke-width: 2;
}

.pcs-flag-a {
  fill: rgb(232 241 255 / 0.85);
}

.pcs-flag-b {
  fill: #2d6be0;
}

.pcs-water {
  fill: rgb(20 120 220 / 0.45);
}

.pcs-lane {
  stroke: rgb(255 255 255 / 0.35);
  stroke-width: 4;
  stroke-dasharray: 18 12;
}

.pcs-ripple {
  fill: none;
  stroke: rgb(255 255 255 / 0.18);
  stroke-width: 3;
}

.pcs-pitch {
  fill: #1c6e36;
}

.pcs-stripe {
  fill: rgb(255 255 255 / 0.05);
}

.pcs-line {
  fill: none;
  stroke: rgb(255 255 255 / 0.55);
  stroke-width: 3;
}

.pcs-brandbar {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.pcs-logo {
  width: 180px;
  height: auto;
  filter: brightness(0) invert(1);
}

.pcs-logo-text {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.pcs-brand-sub {
  font-size: 13px;
  letter-spacing: 0.12em;
  opacity: 0.85;
}

.pcs-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px) minmax(0, 1fr);
  align-items: center;
  gap: 28px;
  margin-block-start: 8px;
}

.pcs-center {
  display: flex;
  justify-content: center;
}

.pcs-title {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.3;
}

.pcs-level {
  margin: 4px 0 0;
  font-size: 21px;
  font-weight: 700;
  color: #f2c96b;
}

.pcs-subtitle {
  margin: 10px 0 12px;
  font-size: 19px;
  font-weight: 700;
}

.pcs-hexes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 104px));
  gap: 10px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  filter: drop-shadow(0 0 8px rgb(95 227 255 / 0.55));
}

.pcs-hexes-three {
  grid-template-columns: repeat(3, minmax(0, 96px));
}

.pcs-hex {
  --pcs-hex: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1.12;
  clip-path: var(--pcs-hex);
  background: linear-gradient(160deg, #a5f5ff, var(--pcs-cyan) 40%, #1b8fe0);
  line-height: 1.1;
}

.pcs-hex::before {
  content: "";
  position: absolute;
  inset: 3px;
  clip-path: var(--pcs-hex);
  background: linear-gradient(180deg, rgb(10 40 110 / 0.95), rgb(6 22 70 / 0.95));
}

.pcs-hex > * {
  position: relative;
}

.pcs-hex-label {
  font-size: 14px;
  font-weight: 700;
}

.pcs-hex-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--pcs-gold);
}

.pcs-profile-title {
  margin-block-start: 18px;
  padding-block-end: 6px;
  border-bottom: 1px solid rgb(255 255 255 / 0.35);
}

.pcs-profile {
  display: grid;
  gap: 6px;
  margin: 0;
  font-size: 17px;
}

.pcs-profile > div {
  display: flex;
  gap: 8px;
}

.pcs-profile dd {
  margin: 0;
  font-weight: 700;
}

.pcs-skills-title {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  text-align: center;
}

.pcs-skills-sub {
  margin: 2px 0 0;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  opacity: 0.85;
}

.pcs-bars {
  display: grid;
  gap: 14px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.pcs-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.pcs-bar-icon {
  width: 46px;
  height: auto;
  color: #ffffff;
  align-self: center;
}

.pcs-bar-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  grid-column: 2;
}

.pcs-bar-label {
  display: flex;
  flex-direction: column;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.pcs-bar-other {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.8;
}

.pcs-bar-track {
  position: relative;
  display: block;
  height: 9px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.2);
  overflow: hidden;
}

.pcs-bar-fill {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--value);
  border-radius: 999px;
  background: linear-gradient(90deg, #1b8fe0, var(--pcs-cyan));
}

.pcs-bar-value {
  grid-column: 3;
  min-width: 2ch;
  font-size: 21px;
  font-weight: 800;
  line-height: 1;
}

.pcs-tagline {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  margin: 22px auto 0;
  padding: 10px 30px;
  border: 2px solid #fff3c4;
  border-radius: 999px;
  font-size: 19px;
  font-weight: 800;
  color: #0a1d57;
  background: linear-gradient(180deg, #fff1c4 0%, #e9c25f 55%, #c4942f 100%);
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.3);
}

.pcs-tagline-icon {
  width: 40px;
  height: auto;
  color: #0a1d57;
}

@container (max-width: 860px) {

  .pcs-brandbar {
    align-items: center;
  }

  .pcs-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .pcs-center {
    order: -1;
  }

  .pcs-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .pcs-title {
    font-size: 22px;
  }

  .pcs-tagline {
    font-size: 16px;
    padding: 8px 20px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .pcs-bar-fill {
    transition: width 0.3s ease-out;
  }
}

/* the /cards page around the member's card */
.cards-page {
  padding-block: 1.5rem 0;
}

.cards-page__state {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  max-width: 32rem;
  margin: 4rem auto;
  text-align: center;
}

.cards-page__state h1 {
  font-size: 1.5rem;
}

.cards-page__state p {
  margin: 0 0 0.5rem;
  color: var(--muted);
}

.cards-spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--line);
  border-block-start-color: var(--brand);
  border-radius: 50%;
}

@media (prefers-reduced-motion: no-preference) {
  .cards-spinner {
    animation: cards-spin 0.8s linear infinite;
  }
}

@keyframes cards-spin {
  to {
    transform: rotate(360deg);
  }
}

.cards-switch {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-block-end: 1rem;
}

.cards-switch__tab {
  min-height: 2.75rem;
  padding: 0.4rem 1.5rem;
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.cards-switch__tab[aria-selected="true"] {
  background: var(--brand);
  color: var(--background);
}

[data-cards-view] .pcs {
  border-radius: 20px;
}

[data-only][hidden] {
  display: none;
}

/* the card built from an image set (art.ts): layers fill the 1024 x 1536 image; text sits inside the frame's opening,
   given as --o-top, --o-left, --o-right (from the right edge) and --o-taper (where the sides close to the point) */
.pa-card {
  --pa-gold: #f7dc8c;
  position: relative;
  container-type: inline-size;
  width: min(100%, 340px);
  aspect-ratio: 1024 / 1536;
  margin: 0;
  color: #ffffff;
  font-family: Cairo, "Noto Kufi Arabic", system-ui, sans-serif;
  filter: drop-shadow(0 16px 28px rgb(4 14 46 / 0.45));
}

.pa-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.pa-panel,
.pa-photo-clip {
  mask-image: var(--pa-mask);
  mask-size: 100% 100%;
  mask-repeat: no-repeat;
}

.pa-photo {
  position: absolute;
  top: var(--o-top);
  left: calc(var(--o-left) + 18%);
  right: var(--o-right);
  height: 50%;
  width: auto;
  object-fit: cover;
  object-position: top;
  mask-image:
    linear-gradient(to bottom, #000 0, #000 68%, transparent 100%),
    linear-gradient(to right, transparent 0, #000 20%, #000 100%);
  mask-composite: intersect;
}

.pa-head {
  position: absolute;
  top: calc(var(--o-top) + 5%);
  left: calc(var(--o-left) + 2%);
  width: 21%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4cqw;
  line-height: 1;
  text-shadow: 0 2px 8px rgb(0 0 0 / 0.55);
}

.pa-overall {
  font-size: 15cqw;
  font-weight: 800;
  color: var(--pa-gold);
}

.pa-position {
  font-size: 6.4cqw;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.pa-rule {
  width: 11cqw;
  height: 1px;
  margin-block: 1.6cqw;
  background: linear-gradient(90deg, transparent, var(--pa-gold), transparent);
}

.pa-logo {
  width: 15cqw;
  height: auto;
  filter: brightness(0) invert(1) drop-shadow(0 1px 3px rgb(0 0 0 / 0.5));
}

.pa-brand {
  font-size: 2.8cqw;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.pa-names {
  position: absolute;
  top: 56.5%;
  left: var(--o-left);
  right: var(--o-right);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  line-height: 1.1;
  text-shadow: 0 2px 8px rgb(0 0 0 / 0.6);
}

.pa-name {
  max-width: 100%;
  overflow: hidden;
  font-size: 8cqw;
  font-weight: 800;
  color: var(--pa-gold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pa-name-en {
  max-width: 100%;
  overflow: hidden;
  margin-block-start: 0.5cqw;
  font-size: 4.2cqw;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.pa-stats {
  position: absolute;
  top: 66.5%;
  left: calc(var(--o-left) + 2%);
  right: calc(var(--o-right) + 2%);
  display: flex;
  justify-content: center;
  margin: 0;
  text-shadow: 0 2px 6px rgb(0 0 0 / 0.55);
}

.pa-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.05;
}

.pa-stat + .pa-stat {
  border-left: 1px solid rgb(247 220 140 / 0.45);
}

.pa-stat dt {
  font-size: 3.4cqw;
  font-weight: 700;
}

.pa-stat dd {
  margin: 0;
  font-size: 6.2cqw;
  font-weight: 800;
  color: var(--pa-gold);
}

.pa-tip {
  position: absolute;
  top: calc(var(--o-taper) + 1.5%);
  left: 50%;
  width: 9cqw;
  height: auto;
  transform: translateX(-50%);
  color: #ffffff;
  filter: drop-shadow(0 1px 3px rgb(0 0 0 / 0.5));
}

/* the member view with an image set: the photographed pool or stadium, the art hexagons and the gold ribbon */
.pcs-art-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pcs-art .pcs-hex {
  clip-path: none;
  background: var(--pcs-hex-img) center / contain no-repeat;
}

.pcs-art .pcs-hex::before {
  display: none;
}

.pcs-art .pcs-hexes {
  filter: none;
}

.pcs-art .pcs-tagline {
  border: 0;
  padding: 14px 44px;
  background: var(--pcs-ribbon-img) center / 100% 100% no-repeat;
  box-shadow: none;
}

.pcs-art::after {
  background:
    radial-gradient(55% 60% at 50% 50%, rgb(3 10 34 / 0.35) 0%, transparent 70%),
    linear-gradient(180deg, rgb(3 10 34 / 0.35), rgb(3 10 34 / 0.2) 40%, rgb(3 10 34 / 0.55));
}


/* the card inside the account page */
.cards-page--embedded {
  margin-block: 1.75rem;
  padding-block: 0;
}

.cards-page__heading {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
  font-weight: 700;
}
