/* The ultimate team: the pitch drawn by ultimate-pitch.js (landing page and /ultimate-team) and the /ultimate-team page. */
:root { --xi-grass: #0c1a0e; --xi-stripe: rgba(198, 255, 61, 0.055); --xi-chalk: rgba(255, 255, 255, 0.82); --xi-cup: #ff9f1c; }

/* ---------- the pitch ---------- */
.xi-pitch { position: relative; width: 100%; aspect-ratio: 74 / 111; container-type: inline-size; rotate: -1deg; }
.xi-pitch__svg { display: block; width: 100%; height: 100%; border: 3px solid var(--ink, #060606); border-radius: 10px; box-shadow: 8px 8px 0 var(--lime, #c6ff3d); }
.xi-pitch__grass { fill: var(--xi-grass); }
.xi-pitch__stripe { fill: var(--xi-stripe); }
.xi-pitch__lines { fill: none; stroke: var(--xi-chalk); stroke-width: 0.38; stroke-linejoin: round; }
.xi-pitch__lines .is-dot { fill: var(--xi-chalk); stroke: none; }
.xi-pitch__lines .is-goal { stroke-width: 0.5; fill: rgba(255, 255, 255, 0.08); }

/* ---------- a spot: a disc (the player's initial, or the spot's code), the name on a paper label, a small line under ---------- */
.xi-slot {
  --disc: clamp(28px, 10.5cqw, 46px);
  position: absolute; left: var(--x); top: var(--y); z-index: 1; translate: -50% calc(var(--disc) / -2);
  display: grid; justify-items: center; gap: 4px; padding: 0; border: 0; background: none; color: inherit;
  font: inherit; text-decoration: none; cursor: pointer; rotate: 1deg;
  transition: scale 180ms var(--pop, ease), rotate 180ms var(--pop, ease);
}
.xi-slot:hover { scale: 1.08; rotate: 0deg; z-index: 2; }
.xi-slot:active { scale: 0.95; }
.xi-slot:focus-visible { outline: 2px dashed var(--lime, #c6ff3d); outline-offset: 5px; border-radius: 6px; }
.xi-slot__disc {
  display: grid; place-items: center; width: var(--disc); height: var(--disc); border-radius: 50%;
  font: 800 calc(var(--disc) * 0.44) / 1 "Unbounded", "Arial Black", sans-serif; letter-spacing: -0.04em;
  color: var(--ink, #060606); background: var(--lime, #c6ff3d); border: 3px solid var(--ink, #060606); box-shadow: 3px 3px 0 var(--pink, #ff2d95);
}
.xi-slot__disc { overflow: hidden; }
.xi-slot__disc img { display: block; width: 100%; height: 100%; object-fit: cover; }
.xi-slot--def .xi-slot__disc { background: var(--cyan, #2ee6ff); }
.xi-slot--mid .xi-slot__disc { background: var(--paper, #fff); }
.xi-slot--wing .xi-slot__disc { background: var(--xi-cup); }
.xi-slot--st .xi-slot__disc { background: var(--pink, #ff2d95); box-shadow: 3px 3px 0 var(--lime, #c6ff3d); }
.xi-slot.is-empty .xi-slot__disc {
  font-family: ui-monospace, Menlo, monospace; font-size: calc(var(--disc) * 0.3); letter-spacing: 0.04em;
  color: var(--paper, #fff); background: rgba(6, 6, 6, 0.5); border: 2px dashed rgba(255, 255, 255, 0.7); box-shadow: none;
  animation: xi-wait 2.4s ease-in-out infinite;
}
.xi-slot.is-selected .xi-slot__disc { outline: 3px solid var(--paper, #fff); outline-offset: 3px; animation: none; }
.xi-slot.is-selected.is-empty .xi-slot__disc { border-color: var(--lime, #c6ff3d); color: var(--lime, #c6ff3d); }
.xi-slot__name {
  max-width: 30cqw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 6px 3px; rotate: -2deg;
  font: 800 clamp(9px, 3cqw, 12px) / 1.15 "Unbounded", "Arial Black", sans-serif; letter-spacing: -0.03em;
  color: var(--ink, #060606); background: var(--paper, #fff); box-shadow: 2px 2px 0 var(--pink, #ff2d95);
}
.xi-slot__role { font: 800 clamp(8px, 2.3cqw, 10px) / 1 ui-monospace, Menlo, monospace; letter-spacing: 0.12em; text-transform: uppercase; color: var(--lime, #c6ff3d); text-shadow: 0 1px 3px #000; }
.xi-slot.is-empty .xi-slot__role { display: none; }   /* the disc already says which spot */
@keyframes xi-wait { 50% { scale: 1.06; border-color: var(--lime, #c6ff3d); } }

/* ---------- /ultimate-team ---------- */
.xi-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; width: min(100% - 32px, 1120px); margin: 24px auto 64px; }
.xi-page__head h1 { margin: 6px 0 10px; font: 800 clamp(34px, 7vw, 72px) / 0.95 "Unbounded", "Arial Black", sans-serif; letter-spacing: -0.05em; text-transform: uppercase; color: var(--paper, #fff); text-shadow: 3px 3px 0 var(--pink, #ff2d95), -2px -2px 0 var(--cyan, #2ee6ff); }
.xi-page__head p { margin: 0; max-width: 58ch; color: rgba(255, 255, 255, 0.78); line-height: 1.5; }
.xi-page__tag { display: inline-block; padding: 5px 9px; rotate: -2deg; font: 800 11px / 1 ui-monospace, Menlo, monospace; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink, #060606); background: var(--lime, #c6ff3d); }
.xi-switch { display: flex; flex-wrap: wrap; gap: 10px; }
.xi-switch button {
  min-height: 44px; padding: 0 16px; font: 800 13px / 1 "Unbounded", "Arial Black", sans-serif; letter-spacing: -0.02em; cursor: pointer;
  color: var(--paper, #fff); background: none; border: 2px solid rgba(255, 255, 255, 0.35); border-radius: 4px;
  transition: translate 160ms var(--pop, ease), box-shadow 160ms var(--pop, ease);
}
.xi-switch button:hover { translate: -1px -2px; }
.xi-switch button:focus-visible { outline: 2px dashed var(--lime, #c6ff3d); outline-offset: 3px; }
.xi-switch button[aria-pressed="true"] { color: var(--ink, #060606); background: var(--lime, #c6ff3d); border-color: var(--ink, #060606); box-shadow: 4px 4px 0 var(--pink, #ff2d95); rotate: -1deg; }
/* the builder: whose-team switch, then the pitch beside the panel */
.xi-builder, [data-xi-builder] { display: grid; gap: 22px; }
.xi-build { display: grid; gap: 32px; align-items: start; }
@media (min-width: 860px) { .xi-build { grid-template-columns: minmax(280px, 440px) minmax(0, 1fr); } }
.xi-build__pitch { width: min(100%, 440px); justify-self: center; }

.xi-pick { display: grid; gap: 12px; align-content: start; }
.xi-pick__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.xi-pick__head :is(h2, h3) { margin: 0; font: 800 clamp(26px, 4vw, 40px) / 1 "Unbounded", "Arial Black", sans-serif; letter-spacing: -0.04em; text-transform: uppercase; color: var(--paper, #fff); }
.xi-pick__note { margin: 0; font: 700 12px / 1.4 ui-monospace, Menlo, monospace; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.62); }
.xi-search { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 14px; background: var(--paper, #fff); border: 3px solid var(--ink, #060606); border-radius: 6px; box-shadow: 6px 6px 0 var(--cyan, #2ee6ff); }
.xi-search svg { flex: none; color: var(--ink, #060606); }
.xi-search input { flex: 1; min-width: 0; height: 48px; border: 0; outline: 0; background: none; font: 800 16px / 1 "Unbounded", "Arial Black", sans-serif; letter-spacing: -0.02em; color: var(--ink, #060606); }
.xi-search input::placeholder { color: rgba(6, 6, 6, 0.45); }
.xi-search:focus-within { box-shadow: 6px 6px 0 var(--lime, #c6ff3d); }
.xi-pick__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.xi-pick__row {
  position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%;
  padding: 11px 14px; overflow: hidden; text-align: left; font: inherit; color: var(--ink, #060606); cursor: pointer;
  background: var(--paper, #fff); border: 3px solid var(--ink, #060606); border-radius: 4px; box-shadow: 4px 4px 0 rgba(255, 255, 255, 0.12);
  transition: translate 160ms var(--pop, ease), box-shadow 160ms var(--pop, ease);
}
.xi-pick__row:hover:not(:disabled) { translate: -2px -2px; box-shadow: 6px 6px 0 var(--pink, #ff2d95); }
.xi-pick__row:active:not(:disabled) { translate: 2px 2px; box-shadow: 0 0 0 var(--pink, #ff2d95); }
.xi-pick__row:focus-visible { outline: 3px dashed var(--lime, #c6ff3d); outline-offset: 3px; }
.xi-pick__row:disabled { cursor: default; opacity: 0.55; }
.xi-pick__row.is-current { box-shadow: 4px 4px 0 var(--lime, #c6ff3d); }
/* the small photo in a search row */
.xi-pick__row .xi-slot__disc { --disc: 36px; border-width: 2px; box-shadow: none; font-size: 15px; background: var(--lime, #c6ff3d); }
.xi-pick__name { font: 800 clamp(15px, 1.6vw, 18px) / 1.15 "Unbounded", "Arial Black", sans-serif; letter-spacing: -0.03em; }
.xi-pick__tag { font: 800 11px / 1 ui-monospace, Menlo, monospace; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; color: rgba(6, 6, 6, 0.6); }
.xi-pick__row.is-current .xi-pick__tag { padding: 3px 6px; color: var(--ink, #060606); background: var(--lime, #c6ff3d); border: 2px solid var(--ink, #060606); }
.xi-pick__none { margin: 0; padding: 14px; color: rgba(255, 255, 255, 0.7); border: 2px dashed rgba(255, 255, 255, 0.2); border-radius: 4px; }
.xi-lock { display: grid; gap: 8px; margin-top: 8px; }
.xi-lock .btn { justify-self: start; }
.xi-lock .btn:disabled { opacity: 0.45; cursor: not-allowed; }
/* the current ultimate pick: each position's race beside the pitch */
.xi-board { list-style: none; margin: 0; padding: 0; display: grid; }
.xi-race { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 2px dashed rgba(255, 255, 255, 0.12); }
.xi-board__code { font: 800 11px / 1 ui-monospace, Menlo, monospace; letter-spacing: 0.1em; color: var(--lime, #c6ff3d); }
.xi-board__name.is-empty { font: 700 13px / 1.2 ui-monospace, Menlo, monospace; letter-spacing: 0.06em; color: rgba(255, 255, 255, 0.45); }
.xi-race__picks { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.xi-race__pick { display: inline-flex; align-items: center; gap: 7px; color: rgba(255, 255, 255, 0.5); }
.xi-race__pick .xi-slot__disc { --disc: 26px; border-width: 2px; box-shadow: none; font-size: 11px; opacity: 0.6; }
.xi-race__name { font: 800 14px / 1.2 "Unbounded", "Arial Black", sans-serif; letter-spacing: -0.03em; }
.xi-race__share { font: 700 12px / 1 ui-monospace, Menlo, monospace; }
.xi-race__pick.is-in { color: var(--paper, #fff); }
.xi-race__pick.is-in .xi-slot__disc { opacity: 1; }
.xi-race__pick.is-in .xi-race__share { color: var(--lime, #c6ff3d); }

@media (prefers-reduced-motion: reduce) {
  .xi-slot, .xi-pick__row, .xi-switch button { transition: none; }
  .xi-slot.is-empty .xi-slot__disc { animation: none; }
}

/* photo credits, folded away under the page */
.xi-credits { margin-top: 8px; padding-top: 16px; border-top: 2px dashed rgba(255, 255, 255, 0.12); color: rgba(255, 255, 255, 0.7); }
.xi-credits summary { cursor: pointer; font: 800 12px / 1.4 ui-monospace, Menlo, monospace; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255, 255, 255, 0.8); }
.xi-credits summary:focus-visible { outline: 2px dashed var(--lime, #c6ff3d); outline-offset: 3px; }
.xi-credits .xi-pick__note { margin: 10px 0; }
.xi-credits__list { margin: 0; padding: 0; list-style: none; columns: 2 280px; column-gap: 32px; font-size: 13px; line-height: 1.6; }
.xi-credits__list li { break-inside: avoid; }
.xi-credits__list a { color: var(--paper, #fff); text-underline-offset: 3px; }
