/* Fantasy Player — builds on the quiz's tokens in ../css/style.css */

.fp-tag {
  margin: 0; font: 700 14px/1 var(--display); letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent);
}
.fp-main { max-width: 760px; margin: 0 auto; padding: 20px 16px 40px; }
.fp-title {
  margin: 4px 0 6px; font: 800 clamp(30px, 6vw, 44px)/1.05 var(--display);
  text-transform: uppercase; text-wrap: balance;
}
.fp-sub { margin: 0 0 22px; color: var(--muted); max-width: 52ch; }
.fp-panel {
  padding: 20px; margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.fp-h2 {
  margin: 0 0 10px; font: 700 20px/1.1 var(--display); text-transform: uppercase;
  letter-spacing: 0.04em;
}
.fp-h2 + * { margin-top: 0; }
.fp-note { margin: 0 0 10px; color: var(--muted); font-size: 14px; }

/* league tabs + club select */
.fp-leagues { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.fp-league {
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
  font-size: 14px; font-weight: 600;
}
.fp-league.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.fp-select {
  width: 100%; min-height: 46px; padding: 10px 12px; margin-bottom: 22px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; font: 500 16px var(--body);
}

/* position picker: a pitch, attacking upwards */
.fp-pitch {
  position: relative; aspect-ratio: 10 / 14; max-width: 360px; margin: 0 auto 8px;
  background: linear-gradient(180deg, #123524 0%, #0e2a1d 100%);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.fp-pitch::before {
  content: ""; position: absolute; inset: 0; opacity: 0.35;
  background: repeating-linear-gradient(180deg,
    rgba(255,255,255,0.035) 0 7.14%, transparent 7.14% 14.28%);
}
.fp-pitch__lines {
  position: absolute; inset: 0; width: 100%; height: 100%;
  fill: none; stroke: rgba(255,255,255,0.28); stroke-width: 0.7;
}
.fp-pitch__spots { position: absolute; inset: 0; }
.fp-spot {
  position: absolute; transform: translate(-50%, -50%);
  min-width: 46px; min-height: 46px; padding: 0 6px; cursor: pointer;
  border-radius: 50%; border: 2px solid var(--accent);
  background: rgba(10, 23, 18, 0.85); color: var(--accent);
  font: 800 14px/1 var(--display); letter-spacing: 0.04em;
}
.fp-spot:hover:not(.is-shut) { background: var(--accent); color: var(--accent-ink); }
.fp-spot.is-on { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 5px rgba(198, 242, 78, 0.25); }
.fp-spot.is-shut {
  border-color: rgba(255,255,255,0.18); color: rgba(255,255,255,0.3);
  background: rgba(10,23,18,0.45); cursor: not-allowed;
}
.fp-pitch__gk {
  position: absolute; left: 50%; bottom: 3%; transform: translateX(-50%);
  font: 700 11px/1 var(--display); letter-spacing: 0.12em; color: rgba(255,255,255,0.3);
}
.fp-pitch__chosen { text-align: center; margin-bottom: 18px; }

/* who you are */
.fp-whoami {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.fp-whoami__name { font: 800 32px/1 var(--display); text-transform: uppercase; }
.fp-whoami__meta { color: var(--muted); font-size: 14px; }

/* the board: the player up top, his stats lined up either side */
.fp-figure {
  display: grid;
  grid-template-columns: 1fr minmax(120px, 172px) 1fr;
  grid-template-rows: auto auto;
  align-items: start; justify-items: center;
  gap: 14px 10px; padding: 18px 14px;
  max-width: 460px; margin: 0 auto 18px;
  background: var(--surface); border: 2px solid var(--text); border-radius: 6px;
}
.fp-figure__body {
  grid-row: 1; grid-column: 2; align-self: start;
  width: 100%; height: auto; max-height: 300px; object-fit: contain;
  image-rendering: pixelated;                 /* it is pixel art, keep it crisp */
}
.fp-figure__col {
  grid-row: 1; display: grid; gap: 10px; width: 100%; align-content: start;
}
.fp-figure__foot {
  grid-row: 2; grid-column: 1 / -1;
  display: flex; gap: 10px; align-items: stretch; justify-content: center; flex-wrap: wrap;
}
.fp-slot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; background: var(--surface); border: 2px solid var(--text);
  font-size: clamp(10px, 2.4vw, 13px); font-weight: 700; white-space: nowrap;
}
.fp-slot b {
  font: 800 clamp(14px, 3.4vw, 18px)/1 var(--display); color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.fp-slot.is-filled { border-color: var(--accent); }
.fp-slot.is-filled b { color: var(--accent); }
.fp-figure__foot .fp-slot { min-width: 150px; }
.fp-slot--overall { border-width: 3px; padding: 8px 14px; }
.fp-slot--overall b { font-size: clamp(17px, 4.4vw, 23px); }

/* rolling */
.fp-roll { text-align: center; }
.fp-progress { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.fp-rollbtn { min-width: 220px; }
.fp-card {
  margin-top: 16px; padding: 14px; text-align: left;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
}
.fp-card__who { margin: 0 0 2px; font-size: 17px; }
.fp-card__who span { color: var(--muted); font-size: 14px; }
.fp-card__hint { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.fp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; }
.fp-stat {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; cursor: pointer; text-align: left;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; font-weight: 600;
}
.fp-stat b { font: 800 20px/1 var(--display); color: var(--accent); }
.fp-stat:hover:not(.is-taken) { border-color: var(--accent); }
.fp-stat.is-taken { opacity: 0.4; cursor: not-allowed; }
.fp-stat.is-taken b { color: var(--muted); }
.fp-stat em { font-style: normal; font-size: 11px; color: var(--muted); }

.fp-done { display: grid; gap: 10px; justify-items: center; }
.fp-done__msg { margin: 0; font: 700 20px/1.2 var(--display); text-transform: uppercase; }

@media (max-width: 420px) {
  .fp-figure { grid-template-columns: 1fr minmax(96px, 120px) 1fr; padding: 14px 10px; gap: 10px 8px; }
  .fp-slot { padding: 6px 8px; gap: 5px; }
  .fp-figure__foot .fp-slot { min-width: 130px; }
}

/* ---------- career ---------- */
.fp-career-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 14px;
}
.fp-career-who { margin: 0; font: 800 30px/1 var(--display); text-transform: uppercase; }
.fp-career-meta { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.fp-ovr {
  display: grid; place-items: center; padding: 8px 16px; text-align: center;
  background: var(--surface); border: 2px solid var(--accent); border-radius: 12px;
}
.fp-ovr span { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.fp-ovr b { font: 800 30px/1 var(--display); color: var(--accent); }
.fp-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

.fp-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 12px; }
.fp-tab {
  flex: none; padding: 7px 12px; border-radius: 999px; cursor: pointer; font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
}
.fp-tab.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.fp-h3 { margin: 20px 0 8px; font: 700 18px/1.1 var(--display); text-transform: uppercase; }
.fp-season-head .fp-h3 { margin-top: 0; }
.fp-season-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px; margin: 12px 0;
}
.fp-stat-box {
  padding: 10px; text-align: center; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.fp-stat-box span { display: block; font-size: 11px; color: var(--muted); }
.fp-stat-box b { font: 800 22px/1.2 var(--display); color: var(--accent); }

.fp-honours { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.fp-chip {
  padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
}
.fp-chip.is-trophy { border-color: var(--accent); color: var(--accent); }
.fp-chip.is-award { border-color: var(--good); color: var(--good); }
.fp-chip.is-hurt { border-color: var(--bad); color: var(--bad); }

.fp-matches { max-height: 420px; overflow-y: auto; display: grid; gap: 3px; }
.fp-match {
  display: grid; grid-template-columns: 62px 1fr 62px 1fr 38px; gap: 8px; align-items: center;
  padding: 7px 10px; border-radius: 8px; font-size: 13px;
  background: var(--surface-2); border-left: 3px solid var(--line);
}
.fp-match.is-win { border-left-color: var(--good); }
.fp-match.is-loss { border-left-color: var(--bad); }
.fp-match.is-out { opacity: 0.55; }
.fp-match__comp { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.fp-match__opp { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-match__score { font-weight: 700; font-variant-numeric: tabular-nums; }
.fp-match__line { color: var(--accent); font-size: 12px; }
.fp-match__rating { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

.fp-tablewrap { overflow-x: auto; }
.fp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fp-table th, .fp-table td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--line); }
.fp-table th { font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.fp-table td { font-variant-numeric: tabular-nums; }
.fp-table tr.is-me { background: var(--surface-2); }
.fp-table tr.is-me td { color: var(--accent); font-weight: 600; }

@media (max-width: 560px) {
  .fp-match { grid-template-columns: 1fr 52px 34px; grid-template-areas: "opp score rating" "line line line"; }
  .fp-match__comp { display: none; }
  .fp-match__opp { grid-area: opp; }
  .fp-match__score { grid-area: score; }
  .fp-match__rating { grid-area: rating; }
  .fp-match__line { grid-area: line; }
}

/* ---------- transfers and internationals ---------- */
.fp-offers { border-color: var(--accent); }
.fp-offer-list {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px; margin-bottom: 12px;
}
.fp-offer {
  display: flex; flex-direction: column; gap: 3px; align-items: flex-start;
  padding: 12px 14px; cursor: pointer; text-align: left;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text);
}
.fp-offer:hover { border-color: var(--accent); background: var(--bg); }
.fp-offer b { font: 700 16px/1.2 var(--display); }
.fp-offer span { font-size: 12px; color: var(--muted); }
.fp-chip.is-cap { border-color: var(--accent); color: var(--text); }

/* start over sits apart from the two things you do every season */
.fp-actions__end { margin-left: auto; }
.fp-danger { border-color: var(--bad); }
.fp-danger .fp-h3 { margin-top: 0; color: var(--bad); }
.fp-danger .fp-actions { margin: 0; }

/* ---------- cards, brackets, growth, the saved card ---------- */
.fp-card-chip {
  display: block; width: 15px; height: 21px; margin: 0 auto 4px; border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.45);
}
.fp-card-chip--yellow { background: #f5d20c; }
.fp-card-chip--red { background: #d7263d; }

.fp-chip.is-up { border-color: var(--good); color: var(--good); }
.fp-chip.is-down { border-color: var(--bad); color: var(--bad); }

.fp-offer__fee { font: 800 17px/1.2 var(--display); color: var(--accent); }

.fp-tabs--comp { margin-top: 4px; }
.fp-bracket { display: grid; gap: 6px; margin: 10px 0; }
.fp-tie {
  display: grid; grid-template-columns: 116px 1fr auto; gap: 10px; align-items: center;
  padding: 9px 12px; border-radius: 8px; font-size: 13px;
  background: var(--surface-2); border-left: 3px solid var(--line);
}
.fp-tie.is-win { border-left-color: var(--good); }
.fp-tie.is-out { border-left-color: var(--bad); opacity: 0.8; }
.fp-tie__stage { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.fp-tie__opp { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-tie__score { font-weight: 700; font-variant-numeric: tabular-nums; }

.fp-cardout { margin-top: 16px; text-align: center; }
.fp-cardout img {
  max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line);
}
.fp-cardout a { color: var(--accent); }

@media (max-width: 560px) {
  .fp-tie { grid-template-columns: 1fr auto; grid-template-areas: "stage stage" "opp score"; }
  .fp-tie__stage { grid-area: stage; }
  .fp-tie__opp { grid-area: opp; }
  .fp-tie__score { grid-area: score; }
}

/* relegation: the offers panel turns into a departure lounge */
.fp-offers.fp-forced { border-color: var(--bad); }
.fp-offers.fp-forced .fp-h3 { color: var(--bad); }
.fp-down { color: var(--bad); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- the roll ---------- */
.fp-card.is-spinning .fp-stat {
  pointer-events: none; opacity: 0.85; border-color: var(--line);
}
.fp-card.is-spinning .fp-stat b { color: var(--muted); }
.fp-card.is-spinning .fp-card__who { opacity: 0.8; }
.fp-card.is-spinning .fp-stat em { visibility: hidden; }
.fp-card.is-landed { animation: fp-land 0.5s ease; }
@keyframes fp-land {
  0%   { box-shadow: 0 0 0 0 rgba(198, 242, 78, 0.55); }
  100% { box-shadow: 0 0 0 14px rgba(198, 242, 78, 0); }
}

/* a stat dropping into its slot on the board */
.fp-slot.is-landed { animation: fp-pop 0.42s cubic-bezier(0.2, 1.5, 0.4, 1); }
@keyframes fp-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.09); }
  100% { transform: scale(1); }
}
.fp-slot b { transition: color 0.25s ease; }

/* ---------- ads ---------- */
/* the grid supplies the side gutter now, so the column shouldn't add another */
.layout > .fp-main { padding-left: 0; padding-right: 0; }
/* keep units clear of the buttons either side of them */
.fp-ad { margin-top: 28px; }
.fp-ad.ad--rect { margin-bottom: 8px; }
