/* Blue Wave Baseball — Club management and the Scouting Center.
   Same panel language as career.css: navy cards, thin aqua lines, yellow
   accents, Playfair for names. Specialties and stars carry their own
   colours: balanced = gold, contact = blue, power = red; one star = blue,
   two = green, three = gold. */

.career-view[data-view="club"],
.career-view[data-view="academy"],
.ac-layer {
  --ac-contact: #43b1e6;
  --ac-contact-soft: rgba(127, 212, 255, 0.42);
  --ac-power: #e85f4b;
  --ac-power-soft: rgba(255, 138, 117, 0.42);
  --ac-green: #35c97f;
}

/* the dialogs live outside the career panel, so they need its tokens too */
.ac-layer {
  --cr-line: rgba(67, 177, 230, 0.42);
  --cr-panel: rgba(0, 41, 78, 0.72);
  --cr-inset: rgba(1, 29, 58, 0.66);
  --cr-text-dim: rgba(255, 255, 255, 0.66);
}

.career-view[data-view="club"],
.career-view[data-view="academy"] {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* Every card is at least as tall as what is in it. When a window is too
   short for the page, the page grows and the career panel scrolls; nothing
   is squeezed or cut off. Spare height goes to the big areas (portraits,
   club art). */
.club-grid .career-card,
.ac-youth {
  overflow: hidden;
  overflow: clip;
}

.career-view[data-view="club"] .career-footer,
.career-view[data-view="academy"] .career-footer { flex: none; margin-top: 0.6rem; padding-top: 0.5rem; }

.ac-kicker {
  display: block;
  color: #9fdcff;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* The yellow outline button (.cr-outline), the card header bar
   (.club-card-head) and the "Coming soon" tag (.ac-soon) live in career.css:
   the career hub uses them too. */

.ac-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: max-content;
  max-width: 100%;
  padding: 0.16rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 0.3rem;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ac-pill::before { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: currentColor; }
.ac-pill.busy { background: #1f6fe0; color: white; }
.ac-pill.busy::before { animation: ac-blink 1.4s ease-in-out infinite; }
.ac-pill.ready { background: var(--yellow); color: #082b45; }
.ac-pill.idle { border-color: rgba(53, 201, 127, 0.7); background: rgba(53, 201, 127, 0.12); color: #8ff0bd; }
.ac-pill.closed { border-color: rgba(255, 255, 255, 0.3); color: rgba(255, 255, 255, 0.7); }
@keyframes ac-blink { 50% { opacity: 0.25; } }

.ac-progress {
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
.ac-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d9a92b, var(--yellow), #ffe08a);
  transition: width 0.6s ease;
}

/* ------------------------------------------------------------------ *
 * Club management
 * ------------------------------------------------------------------ */

.club-heading { flex: none; align-items: center; margin-bottom: 0.6rem; }
.club-heading h3 { font-size: clamp(1.6rem, 2.7vw, 2.3rem); }
.club-heading p b { color: white; }
.club-heading .cash-chip { min-width: 9rem; padding: 0.5rem 1.1rem; font-size: 1.25rem; }

.club-grid {
  display: grid;
  flex: 1 0 auto;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  gap: 0.7rem;
}
.club-side { display: flex; flex-direction: column; gap: 0.7rem; min-width: 0; }
.club-side > .club-scouting { flex: 1.8 0 auto; }
.club-side > .club-stadium { flex: 1 0 auto; }

.club-grid .career-card { gap: 0; padding: 0; }

/* --- club design ---------------------------------------------------- */

.club-design-main {
  display: grid;
  flex: 1 0 auto;
  align-content: center;
  justify-items: center;
  gap: 0.35rem;
  padding: 0.7rem 0.8rem;
  background:
    radial-gradient(ellipse 60% 55% at 50% 35%, color-mix(in srgb, var(--team, #0f5fbf) 30%, transparent), transparent 70%),
    linear-gradient(180deg, rgba(3, 18, 38, 0.35), rgba(3, 18, 38, 0.8)),
    #06213f url("assets/hub-tile-bg.png") center / cover;
}

.club-design-art { display: flex; align-items: center; justify-content: center; gap: clamp(0.4rem, 2vw, 1.4rem); }
.club-design-badge {
  width: clamp(5rem, 17vh, 10rem);
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.5));
}
.club-design-jersey .jersey { width: clamp(5rem, 16vh, 9.5rem); max-width: none; }

.club-design-name {
  max-width: 100%;
  margin-top: 0.2rem;
  font-family: "Playfair Display", Georgia, serif;
  font-variant-numeric: lining-nums;
  overflow-wrap: anywhere;
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  line-height: 1.05;
  text-align: center;
}
.club-design-home {
  color: #7fd4ff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.club-colors { display: flex; gap: 2.2rem; margin-top: 0.3rem; }
.club-colors span { display: grid; justify-items: center; gap: 0.2rem; }
.club-colors i {
  width: clamp(2rem, 5vh, 2.8rem);
  aspect-ratio: 1;
  border: 3px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}
.club-colors b { color: var(--yellow); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; }

.club-design-parts {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.2rem 0 0;
  color: var(--cr-text-dim);
  font-size: 0.78rem;
}
.club-design-parts::before,
.club-design-parts::after { content: ""; width: 1.6rem; height: 1px; background: rgba(255, 255, 255, 0.35); }

.club-redesign {
  display: grid;
  flex: none;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  margin: 0.65rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--cr-line);
  border-radius: 0.45rem;
  background: var(--cr-inset);
}
.club-redesign-icon { width: 2.2rem; color: #7fd4ff; }
.club-redesign-icon svg { display: block; width: 100%; }
.club-redesign b { display: block; font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase; }
.club-redesign p { margin: 0.1rem 0 0; color: var(--cr-text-dim); font-size: 0.76rem; line-height: 1.35; }

/* --- scouting at a glance ------------------------------------------ */

.club-scout-body {
  position: relative;
  display: grid;
  flex: 1 0 auto;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  min-height: 11rem;
  background:
    linear-gradient(90deg, rgba(3, 18, 38, 0.1) 0%, rgba(3, 18, 38, 0.92) 48%),
    #06213f url("assets/hub-tile-bg.png") left center / cover;
}
.club-scout-body.loading { display: grid; grid-template-columns: 1fr; place-items: center; gap: 0.6rem; padding: 1rem; color: var(--cr-text-dim); text-align: center; }
.club-scout-body.loading p { margin: 0; }

.club-scout-face { position: relative; overflow: hidden; }
.club-scout-face img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
  -webkit-mask-image: linear-gradient(90deg, #000 62%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 62%, transparent 100%);
}

.club-scout-info {
  display: grid;
  align-content: center;
  gap: 0.18rem;
  min-width: 0;
  padding: 0.5rem 0.9rem 0.55rem 0.2rem;
}
.club-scout-name {
  margin-bottom: 0.15rem;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.1rem, 1.8vw, 1.45rem);
  line-height: 1.1;
}
.club-scout-info .ac-pill { margin-bottom: 0.25rem; }
.club-scout-big {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}
.club-scout-progress { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.5rem; margin-top: 0.3rem; }
.club-scout-progress em { color: rgba(255, 255, 255, 0.85); font-size: 0.78rem; font-style: normal; font-weight: 700; }
.club-scout-line { margin: 0 0 0.3rem; color: var(--cr-text-dim); font-size: 0.76rem; }
.club-scout-info .cr-outline { justify-self: start; }
.club-scout-mark {
  position: absolute;
  top: 0.7rem;
  right: 0.8rem;
  width: clamp(2rem, 4vw, 3.2rem);
  color: #43b1e6;
  opacity: 0.8;
}
.club-scout-mark svg { display: block; width: 100%; }


/* --- stadium (coming soon) ------------------------------------------ */

.club-stadium-body {
  display: grid;
  flex: 1 0 auto;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  min-height: 6.5rem;
}
.club-stadium-art { position: relative; overflow: hidden; }
.club-stadium-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.9);
}
.club-stadium-info {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.3rem;
  padding: 0.45rem 0.7rem;
  text-align: center;
}
.club-stadium-info .cr-outline { min-height: 2rem; padding-block: 0.25rem; font-size: 0.8rem; }
.club-stadium-info strong { font-family: "Playfair Display", Georgia, serif; font-size: clamp(1.15rem, 1.8vw, 1.45rem); line-height: 1.1; }
.club-stadium-art img { object-position: 50% 58%; }
.club-stadium-info p { margin: 0; color: var(--cr-text-dim); font-size: 0.74rem; line-height: 1.3; }

.club-footer p.club-footer-name {
  color: white;
  font-family: "Playfair Display", Georgia, serif;
  font-variant-numeric: lining-nums;
  font-size: 1.15rem;
}
.club-footer > small { color: var(--cr-text-dim); font-size: 0.72rem; text-align: right; }

/* ------------------------------------------------------------------ *
 * Scouting Center
 * ------------------------------------------------------------------ */

.ac-heading { flex: none; align-items: center; margin-bottom: 0.55rem; }
.ac-title { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 1rem; }
.ac-title h3 { font-size: clamp(1.6rem, 2.7vw, 2.3rem); }
.ac-title p {
  margin: 0;
  padding-left: 1rem;
  border-left: 1px solid rgba(255, 255, 255, 0.35);
  color: #9fdcff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.ac-heading .cash-chip { min-width: 9rem; padding: 0.5rem 1.1rem; font-size: 1.25rem; }

.ac-top {
  display: grid;
  flex: none;
  grid-template-columns: minmax(0, 1.72fr) minmax(0, 1fr);
  gap: 0.7rem;
}
.ac-top > .career-card { gap: 0.45rem; padding: 0.6rem 0.7rem; }

/* --- scouts --------------------------------------------------------- */

.ac-scout-row { display: grid; flex: 1 1 auto; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }

.ac-scout {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.4rem;
  border: 1px solid var(--cr-line);
  border-radius: 0.45rem;
  background: var(--cr-inset);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ac-scout:hover, .ac-scout:focus-visible { border-color: var(--yellow); }
.ac-scout.active {
  border-color: var(--yellow);
  box-shadow: inset 0 0 0 1px rgba(243, 199, 68, 0.55), 0 0 18px rgba(243, 199, 68, 0.16);
}
.ac-scout.waiting { opacity: 0.7; }
.ac-scout img {
  width: clamp(3rem, 8vh, 4.5rem);
  aspect-ratio: 1;
  border-radius: 0.35rem;
  object-fit: cover;
  object-position: 50% 20%;
}
.ac-scout.locked img { filter: grayscale(0.4) brightness(0.8); }

.ac-scout-copy { display: grid; justify-items: start; gap: 0.25rem; min-width: 0; padding-right: 1.2rem; }
.ac-scout-copy strong { font-size: 0.82rem; line-height: 1.12; }

.ac-spec {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ac-spec i { display: inline-block; width: 1.05rem; height: 1.05rem; }
.ac-spec svg { display: block; width: 100%; height: 100%; }
.ac-spec.sp-balanced { color: var(--yellow); }
.ac-spec.sp-contact { color: #7fd4ff; }
.ac-spec.sp-power { color: #ff6b5c; }

.ac-price {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.12rem 0.5rem;
  border: 1px solid var(--cr-line);
  border-radius: 0.3rem;
  font-size: 0.8rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.ac-price i, .ac-cost i {
  display: grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--yellow);
  color: #082b45;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 900;
}

.ac-state {
  color: var(--cr-text-dim);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.ac-state.on { padding: 0.12rem 0.5rem; border-radius: 999px; background: var(--yellow); color: #082b45; white-space: nowrap; }

.ac-scout-mark { position: absolute; top: 0.35rem; right: 0.35rem; }
.ac-scout-mark.tick {
  display: grid;
  place-items: center;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: var(--yellow);
  color: #082b45;
  font-size: 0.78rem;
  font-weight: 900;
}
.ac-scout-mark.lock { width: 1.05rem; color: rgba(255, 255, 255, 0.72); }
.ac-scout-mark.lock svg { display: block; width: 100%; }

/* --- the assignment panel -------------------------------------------- */

.ac-assign-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.ac-assign-head h4 {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ac-assign-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
}
.ac-clock { width: 2.3rem; color: #7fd4ff; }
.ac-clock svg { display: block; width: 100%; }
.ac-next { display: grid; gap: 0.12rem; min-width: 0; }
.ac-next small { color: #9fdcff; font-size: 0.6rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.ac-next b {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.3rem, 2.1vw, 1.75rem);
  line-height: 1.05;
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}
.ac-next em { color: var(--cr-text-dim); font-size: 0.72rem; font-style: normal; }

.ac-terms {
  display: grid;
  justify-items: start;
  gap: 0.25rem;
  padding-left: 0.8rem;
  border-left: 1px solid var(--cr-line);
}
.ac-terms small { color: #9fdcff; font-size: 0.58rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.ac-term {
  padding: 0.22rem 0.6rem;
  border: 1px solid rgba(123, 205, 244, 0.6);
  border-radius: 0.35rem;
  background: rgba(1, 29, 58, 0.6);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ac-cost { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--yellow); font-weight: 800; font-variant-numeric: tabular-nums; }

.ac-assign .ac-progress { margin: 0.1rem 0 0.05rem; }
.ac-assign-note { margin: 0; color: var(--cr-text-dim); font-size: 0.7rem; line-height: 1.35; }
.ac-assign-note.warn { color: #ffb3a6; }
.ac-go { width: 100%; min-height: 2.3rem; padding-block: 0.4rem; border-radius: 999px; }
.ac-go.armed { background: #ffd65a; box-shadow: 0 0 0 3px rgba(243, 199, 68, 0.35); }

/* --- the academy ----------------------------------------------------- */

.ac-academy-head {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.9rem;
  margin: 0.6rem 0 0.4rem;
}
.ac-academy-head h4 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.ac-academy-head p {
  margin: 0;
  padding-left: 0.9rem;
  border-left: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--cr-text-dim);
  font-size: 0.8rem;
}
.ac-slots {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ac-slots b { margin-right: 0.3rem; color: var(--ac-green); font-size: 1.15rem; letter-spacing: 0.04em; }

.ac-youth-grid {
  display: grid;
  flex: 1 0 auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.ac-youth {
  --tier: #43b1e6;
  display: flex;
  flex-direction: row;
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--tier) 55%, transparent);
  border-radius: 0.5rem;
  background: var(--cr-panel);
}
.ac-youth.s2 { --tier: var(--ac-green); }
.ac-youth.s3 { --tier: var(--yellow); box-shadow: 0 0 22px rgba(243, 199, 68, 0.12); }

.ac-youth-art {
  position: relative;
  flex: 0 0 38%;
  min-height: 11rem;
  overflow: hidden;
  background: #0b4a8c;
}
.ac-youth-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 24%;
}
.ac-youth-art::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 30%;
  background: linear-gradient(180deg, transparent, rgba(0, 32, 62, 0.9));
}
.ac-youth-art .ac-lean {
  position: absolute;
  z-index: 1;
  left: 0.45rem;
  bottom: 0.45rem;
  max-width: calc(100% - 0.9rem);
  overflow: hidden;
  background: rgba(1, 29, 58, 0.84);
  letter-spacing: 0.06em;
}

.ac-stars {
  display: inline-flex;
  align-items: center;
  gap: 0.05rem;
  line-height: 1;
  white-space: nowrap;
}
.ac-stars i { font-style: normal; }
.ac-stars i.off { color: rgba(255, 255, 255, 0.24); }
.ac-stars.s1 i.on { color: #7fd4ff; }
.ac-stars.s2 i.on { color: #5ee39f; }
.ac-stars.s3 i.on { color: var(--yellow); text-shadow: 0 0 8px rgba(243, 199, 68, 0.6); }

.ac-youth-art .ac-stars,
.ac-dialog-art .ac-stars {
  position: absolute;
  z-index: 1;
  top: 0.45rem;
  right: 0.45rem;
  padding: 0.2rem 0.4rem;
  border: 1px solid color-mix(in srgb, var(--tier, #43b1e6) 70%, transparent);
  border-radius: 0.35rem;
  background: rgba(1, 29, 58, 0.84);
  font-size: 0.82rem;
}
.ac-dialog-art .ac-stars.big { font-size: 1.25rem; }

.ac-youth-slot {
  position: absolute;
  z-index: 1;
  top: 2.1rem;
  right: 0.45rem;
  padding: 0.14rem 0.45rem;
  border-radius: 0.3rem;
  background: rgba(1, 29, 58, 0.84);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.ac-youth-slot.on { background: var(--yellow); color: #082b45; }

.ac-youth-body {
  display: grid;
  flex: 1 1 auto;
  align-content: center;
  gap: 0.3rem;
  min-width: 0;
  padding: 0.55rem 0.65rem;
}
.ac-youth-body h5 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-variant-numeric: lining-nums;
  font-size: clamp(1.02rem, 1.5vw, 1.28rem);
  line-height: 1.08;
}
.ac-youth-sub {
  margin: 0 0 0.15rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ac-youth-sub i { font-style: normal; margin: 0 0.2rem; }

.ac-bar {
  display: grid;
  grid-template-columns: 4.1rem minmax(0, 1fr) 2.6rem;
  align-items: center;
  gap: 0.5rem;
}
.ac-bar.compact { grid-template-columns: 3.6rem minmax(0, 1fr) 1.6rem; gap: 0.4rem; }
.ac-bar-label { font-size: 0.64rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.ac-bar.contact .ac-bar-label { color: #7fd4ff; }
.ac-bar.power .ac-bar-label { color: #ff8a75; }
.ac-bar-track {
  position: relative;
  height: 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.ac-bar-track i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; }
.ac-bar.contact .base { z-index: 1; background: linear-gradient(90deg, #2d8fd0, #6cc9f5); }
.ac-bar.contact .grown { background: var(--ac-contact-soft); }
.ac-bar.power .base { z-index: 1; background: linear-gradient(90deg, #d4402f, #ff7a63); }
.ac-bar.power .grown { background: var(--ac-power-soft); }
.ac-bar-value { font-size: 0.88rem; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.ac-bar-value small { margin-left: 0.2rem; color: #8ff0bd; font-size: 0.66rem; }

.ac-dev {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.15rem;
  padding: 0.32rem 0.5rem;
  border: 1px solid var(--cr-line);
  border-radius: 0.4rem;
  background: var(--cr-inset);
}
.ac-level { display: grid; justify-items: center; line-height: 1; }
.ac-level small { color: var(--cr-text-dim); font-size: 0.52rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.ac-level b { color: var(--yellow); font-size: 1.3rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.ac-level.big b { font-size: 2rem; }
/* the % sign rides smaller than the number it belongs to */
.ac-level b i { font-style: normal; font-size: 0.62em; margin-left: 0.04em; opacity: 0.85; }
.ac-dev-copy { display: grid; gap: 0.22rem; min-width: 0; }
.ac-dev-copy small { color: var(--cr-text-dim); font-size: 0.64rem; line-height: 1.3; }
.ac-dev-copy small b { color: #8ff0bd; }
.ac-xp { display: block; height: 0.42rem; border-radius: 999px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.ac-xp i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #d9a92b, var(--yellow), #ffe08a); }

.ac-youth-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.3rem 0.5rem;
  margin: 0.05rem 0 0.1rem;
  font-size: 0.68rem;
}
.ac-youth-meta > span:last-child { color: var(--cr-text-dim); }

.ac-lean {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.1rem 0.45rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ac-lean i { display: inline-block; flex: none; width: 0.85rem; height: 0.85rem; }
.ac-lean svg { display: block; width: 100%; height: 100%; }
.ac-lean.lean-contact { color: #7fd4ff; }
.ac-lean.lean-power { color: #ff8a75; }
.ac-lean.lean-balanced { color: var(--yellow); }

.ac-youth-body .cr-outline { min-height: 2rem; margin-top: 0.15rem; padding-block: 0.3rem; font-size: 0.8rem; }

/* the empty slot */
.ac-youth.empty {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem 0.8rem;
  border: 2px dashed rgba(123, 205, 244, 0.55);
  background:
    radial-gradient(ellipse 60% 50% at 50% 30%, rgba(67, 177, 230, 0.12), transparent 70%),
    rgba(1, 29, 58, 0.4);
  text-align: center;
}
.ac-empty-art { position: relative; flex: none; width: clamp(3.2rem, 9.5vh, 5.8rem); margin-bottom: 0.15rem; color: #7bcdf4; }
/* one opacity for the whole figure, so the cap and head don't show seams */
.ac-empty-art svg { display: block; width: 100%; opacity: 0.26; }
.ac-plus {
  position: absolute;
  left: 50%;
  bottom: 4%;
  width: 44%;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background: rgba(1, 29, 58, 0.88);
  color: white;
  transform: translateX(-50%);
}
.ac-plus::before,
.ac-plus::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: translate(-50%, -50%);
}
.ac-plus::after { transform: translate(-50%, -50%) rotate(90deg); }
.ac-youth.empty h5 {
  margin: 0.1rem 0 0;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ac-youth.empty p { margin: 0; color: var(--cr-text-dim); font-size: 0.78rem; line-height: 1.35; }
.ac-youth.empty p.ac-empty-hint { color: #9fdcff; }
.ac-youth.empty .cr-primary { min-height: 2.2rem; margin-top: 0.2rem; padding-block: 0.35rem; }

.ac-foot-note { color: var(--cr-text-dim); font-size: 0.72rem; text-align: right; }

/* ------------------------------------------------------------------ *
 * Dialogs
 * ------------------------------------------------------------------ */

body.ac-open { overflow: hidden; }

.ac-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  color: white;
  font-family: Inter, system-ui, sans-serif;
}
.ac-layer[hidden] { display: none; }

.ac-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 20, 40, 0.74);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.ac-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 16px;
  overflow-y: auto;
  pointer-events: none;
}
.ac-stage > * { pointer-events: auto; }

.ac-dialog {
  --tier: #43b1e6;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  align-items: start;
  gap: 1.1rem;
  width: min(100%, 47rem);
  padding: 1.1rem;
  border: 1px solid rgba(243, 199, 68, 0.7);
  border-radius: 0.6rem;
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--tier) 30%, transparent), transparent 55%),
    linear-gradient(180deg, #073a5b, #052a42);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  animation: ac-pop 0.2s ease-out;
}
.ac-dialog.s2 { --tier: var(--ac-green, #35c97f); }
.ac-dialog.s3 { --tier: var(--yellow); }
.ac-dialog.sp-balanced { --tier: var(--yellow); }
.ac-dialog.sp-power { --tier: #e85f4b; }
@keyframes ac-pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }

.ac-close {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(1, 29, 58, 0.7);
  color: white;
  font: inherit;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.ac-close:hover, .ac-close:focus-visible { border-color: var(--yellow); color: var(--yellow); }

.ac-dialog-art {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--tier) 60%, transparent);
  border-radius: 0.5rem;
  background: #0b4a8c;
}
.ac-dialog-art.scout { aspect-ratio: 1; }
.ac-dialog-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.ac-dialog-art .ac-youth-slot { top: auto; bottom: 0.5rem; }

.ac-dialog-body { display: grid; align-content: start; gap: 0.5rem; min-width: 0; padding-right: 1.4rem; }
.ac-dialog-body h3 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-variant-numeric: lining-nums;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.05;
}
.ac-sub { margin: 0; color: var(--cr-text-dim); font-size: 0.82rem; }
.ac-report-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; }
.ac-potential {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--cr-text-dim);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ac-potential .ac-stars { font-size: 1rem; }

.ac-dialog-bars {
  display: grid;
  gap: 0.45rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--cr-line);
  border-radius: 0.45rem;
  background: var(--cr-inset);
}

.ac-devbox {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.8rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--cr-line);
  border-radius: 0.45rem;
  background: var(--cr-inset);
}

.ac-hits {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0;
}
.ac-hits.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ac-hits div {
  padding: 0.32rem 0.45rem;
  border: 1px solid var(--cr-line);
  border-radius: 0.35rem;
  background: var(--cr-inset);
}
.ac-hits dt { color: var(--cr-text-dim); font-size: 0.55rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.ac-hits dd { margin: 0; font-size: 1rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ac-hits dd.bad { color: #ff8a75; }

.ac-note { margin: 0; color: var(--cr-text-dim); font-size: 0.74rem; line-height: 1.45; }
.ac-warn { margin: 0; color: #ffb3a6; font-size: 0.76rem; line-height: 1.4; }
.ac-confirm-hint { margin: 0; color: #ffb3a6; font-size: 0.7rem; text-align: right; }

.ac-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.55rem; margin-top: 0.3rem; }
.ac-btn {
  min-height: 2.6rem;
  padding: 0.5rem 1.15rem;
  border-radius: 0.45rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.ac-btn.ac-primary { border: 2px solid var(--yellow); background: var(--yellow); color: #082b45; box-shadow: 0 8px 22px rgba(243, 199, 68, 0.25); }
.ac-btn.ac-primary:hover:not(:disabled) { background: #ffd65a; }
.ac-btn.ghost { border: 2px solid rgba(123, 205, 244, 0.8); background: rgba(1, 29, 58, 0.6); color: white; }
.ac-btn.ghost:hover:not(:disabled) { border-color: var(--yellow); }
.ac-btn.ghost.armed { border-color: #ff8a75; background: rgba(232, 95, 75, 0.22); color: #ffd0c7; }
.ac-btn:disabled { opacity: 0.55; cursor: default; box-shadow: none; }
.ac-btn:focus-visible { outline: 2px solid white; outline-offset: 2px; }

/* ------------------------------------------------------------------ *
 * Youth players elsewhere (Team management)
 * ------------------------------------------------------------------ */

.ed-chip.ed-youth { background: #8ff0bd; }
.pick-card:has(.ed-youth) { border-color: rgba(53, 201, 127, 0.55); }
.youth-stars { margin-left: 0.45rem; color: var(--yellow); font-size: 0.9rem; letter-spacing: 0.04em; vertical-align: middle; }
.train-btn.youth { min-width: 8.2rem; }
.train-btn.youth b { font-size: 0.72rem; }
.cr-inline-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--yellow);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* ------------------------------------------------------------------ *
 * Smaller screens
 * ------------------------------------------------------------------ */

/* Portrait on top of the details: in tall windows (as on the mockup), and on
   narrower screens, where a side-by-side card gets too thin for its art. */
@media (min-width: 641px) and (min-height: 1040px), (min-width: 641px) and (max-width: 1100px) {
  .ac-youth:not(.empty) { flex-direction: column; }
  .ac-youth:not(.empty) .ac-youth-art { flex: 1 0 9rem; min-height: 9rem; }
  .ac-youth:not(.empty) .ac-youth-body { flex: none; padding-top: 0.2rem; }
  .ac-youth-art img { object-position: 50% 30%; }
  .ac-youth-slot { top: 0.45rem; left: 0.45rem; right: auto; }
}
@media (min-width: 641px) and (max-width: 1100px) {
  .ac-youth:not(.empty) .ac-youth-art { flex-basis: 11rem; min-height: 11rem; }
}

/* Laptop-height windows: tighter spacing and smaller club art, so both pages
   still fit on one screen. Shorter than this, the page scrolls. */
@media (min-width: 1101px) and (max-height: 900px) {
  .club-heading h3,
  .ac-title h3 { font-size: clamp(1.5rem, 2.3vw, 1.95rem); }
  .club-heading,
  .ac-heading { margin-bottom: 0.4rem; }
  .career-view[data-view="club"] .career-footer,
  .career-view[data-view="academy"] .career-footer { margin-top: 0.45rem; padding-top: 0.35rem; }
  .career-view[data-view="club"] .career-footer .cr-link,
  .career-view[data-view="academy"] .career-footer .cr-link,
  .career-view[data-view="academy"] .career-footer .cr-primary { min-height: 2.25rem; padding-block: 0.3rem; }

  .club-grid .club-card-head { padding-block: 0.4rem; }
  .club-design-main { gap: 0.25rem; padding: 0.5rem 0.8rem; }
  .club-design-badge { width: clamp(4.5rem, calc(90vh - 630px), 8.5rem); }
  .club-design-jersey .jersey { width: clamp(3.9rem, calc(78vh - 548px), 7.4rem); }
  .club-design-name { font-size: clamp(1.4rem, 2.2vw, 1.9rem); }
  .club-colors { margin-top: 0.15rem; }
  .club-colors i { width: 2rem; }
  .club-design-parts { display: none; }
  .club-redesign { margin: 0.5rem; padding: 0.5rem 0.75rem; }
  .club-scout-body { min-height: 10rem; }
  .club-scout-info { gap: 0.12rem; padding-block: 0.4rem; }
  .club-scout-big { font-size: clamp(1.4rem, 2.3vw, 1.85rem); }
  .club-scout-line { margin-bottom: 0.2rem; }
  .club-stadium-body { min-height: 5.5rem; }
  .club-stadium-info { gap: 0.2rem; padding-block: 0.35rem; }

  .ac-top > .career-card { gap: 0.35rem; padding: 0.5rem 0.65rem; }
  .ac-go { min-height: 2.1rem; padding-block: 0.3rem; }
  .ac-academy-head { margin: 0.45rem 0 0.3rem; }
  .ac-youth-art { min-height: 10rem; }
  .ac-youth-body { gap: 0.22rem; padding: 0.45rem 0.55rem; }
  .ac-youth-body h5 { font-size: clamp(0.98rem, 1.25vw, 1.1rem); }
  .ac-youth-body .cr-outline { min-height: 1.9rem; padding-block: 0.2rem; }
  .ac-dev { padding-block: 0.25rem; }
  .ac-youth.empty { padding-block: 0.4rem; }
  .ac-empty-art { width: clamp(3rem, 8.5vh, 5rem); }
}

@media (max-width: 1100px) {
  .ac-top { grid-template-columns: minmax(0, 1fr); }
  .ac-youth { min-height: 13.5rem; }
  .club-grid { grid-template-columns: minmax(0, 1fr); }
  .club-scout-body, .club-stadium-body { min-height: 12rem; }
}

@media (max-width: 920px) {
  .ac-youth-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ac-academy-head .ac-slots { margin-left: 0; }
  .ac-title p { padding-left: 0; border-left: 0; }
  .club-footer > small, .ac-foot-note { text-align: left; }
}

@media (max-width: 640px) {
  .ac-scout-row { grid-template-columns: minmax(0, 1fr); }
  .ac-youth-grid { grid-template-columns: minmax(0, 1fr); }
  .ac-youth:not(.empty) { flex-direction: column; }
  .ac-youth-art { flex: none; height: 12rem; }
  .ac-assign-body { grid-template-columns: auto minmax(0, 1fr); }
  .ac-terms { grid-column: 1 / -1; grid-template-columns: auto auto auto; align-items: center; padding: 0.4rem 0 0; border-left: 0; border-top: 1px solid var(--cr-line); }
  .club-redesign { grid-template-columns: auto minmax(0, 1fr); }
  .club-redesign .cr-outline { grid-column: 1 / -1; }
  .club-scout-body { grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); }
  .club-stadium-body { grid-template-columns: minmax(0, 1fr); }
  .club-stadium-art { height: 9rem; }
  .ac-dialog { grid-template-columns: minmax(0, 1fr); }
  .ac-dialog-art { width: min(12rem, 60%); justify-self: center; }
  .ac-dialog-body { padding-right: 0; }
  .ac-hits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .ac-dialog { animation: none; }
  .ac-pill.busy::before { animation: none; }
  .ac-progress i { transition: none; }
}
