/* ==========================================================================
   COMBINE-FC — pitch-sandbox.css
   BUILD A PLAYER: the manual editor. Two columns — every control on the left,
   a sticky live card on the right — collapsing to one column with the card
   pulled above the controls on narrow screens.

   Structural pattern ported from combine/css/combine-sandbox.css (two-column
   body, sticky preview, shared slider row shared by measurables and
   attributes, category sub-panels tinted by the category's own hue) in FC's
   own token language. None of COMBINE's hex values appear here.

   Sport shape: the position picker is grouped into the four LINES of a team
   sheet and auto-fits fifteen positions, where COMBINE's is a hard
   five-column grid; and there is no archetype block, because COMBINE-FC has
   no archetypes — its slot is taken by IDENTITY and PLAYSTYLE BADGES.
   ========================================================================== */

#screen-sandbox .container {
  padding-top: var(--s-4);
  padding-bottom: var(--s-8);
}

.fc-build {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}

/* ------ A) hero ------ */
.fc-build__hero {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.fc-build__title {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--c-text);
}
.fc-build__blurb {
  max-width: 62ch;
  font-size: var(--fs-body);
  color: var(--c-text-2);
}

/* ------ B) two-column body ------ */
.fc-build__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-5);
  align-items: start;
}
.fc-build__editor {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  min-width: 0;
}
.fc-build__preview-inner {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  max-width: 440px;
  margin-inline: auto;
}

@media (min-width: 1040px) {
  .fc-build__body {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  }
  .fc-build__preview {
    position: sticky;
    top: var(--s-5);
  }
  .fc-build__preview-inner {
    margin-inline: 0;
  }
}

/* On one column the card leads — it is the thing being built, and burying it
   under six category panels means scrolling past every control to see the
   effect of any of them. */
@media (max-width: 1039px) {
  .fc-build__preview {
    order: -1;
  }
}

/* ------ C) toolbar ------ */
.fc-build__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

/* ------ D) shared section shell ------ */
.fc-build__section {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-4);
}
.fc-build__section-label {
  font-family: var(--font-display);
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--c-text-3);
}

/* ------ E) position picker — one row per line of the team sheet ------ */
.fc-build__poslines {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.fc-posline {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding-top: var(--s-3);
  border-top: var(--bw) solid var(--c-line);
}
.fc-posline:first-child {
  padding-top: 0;
  border-top: 0;
}
.fc-posline__label {
  font-family: var(--font-display);
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  color: var(--fc-line-hue, var(--c-text-3));
}
.fc-posline__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: var(--s-2);
}
.fc-posbtn {
  padding: var(--s-2) var(--s-1);
  border: var(--bw) solid var(--c-line-2);
  border-radius: var(--r-sm);
  background: var(--c-panel-2);
  color: var(--c-text-2);
  font-family: var(--font-display);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    background-color var(--dur-fast) var(--ease);
}
.fc-posbtn:hover {
  color: var(--c-text);
  border-color: var(--fc-line-hue, var(--c-line-strong));
}
.fc-posbtn.is-active {
  color: var(--c-text-inv);
  background: var(--fc-line-hue, var(--c-chalk));
  border-color: var(--fc-line-hue, var(--c-chalk));
}
.fc-posbtn:focus-visible {
  outline: 2px solid var(--c-lime);
  outline-offset: 2px;
}
.fc-build__poshint {
  font-size: var(--fs-small);
  color: var(--c-text-2);
}

/* ------ F) slider grid + rows (shared by measurables and attributes) ------ */
.fc-slider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--s-4) var(--s-5);
}
.fc-slider {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}
.fc-slider__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-2);
}
.fc-slider__label {
  font-family: var(--font-display);
  font-size: var(--fs-small);
  letter-spacing: 0.05em;
  color: var(--c-text-2);
}
.fc-slider--attr .fc-slider__label {
  font-family: var(--font-body);
  font-size: var(--fs-small);
  letter-spacing: 0;
}
.fc-slider__value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--fs-label);
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* The thumb takes the enclosing category panel's --fc-cat-hue when there is
   one (attribute rows) and falls back to matchball green for the measurables
   grid, which sets no such variable. */
.fc-slider__input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--c-bar-track);
  outline: none;
  cursor: pointer;
}
.fc-slider__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--fc-cat-hue, var(--c-lime));
  border: 2px solid var(--c-bg);
  box-shadow: 0 0 0 1px var(--fc-cat-hue, var(--c-lime));
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease);
}
.fc-slider__input::-webkit-slider-thumb:hover,
.fc-slider__input:focus-visible::-webkit-slider-thumb {
  transform: scale(1.15);
}
.fc-slider__input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--fc-cat-hue, var(--c-lime));
  border: 2px solid var(--c-bg);
  box-shadow: 0 0 0 1px var(--fc-cat-hue, var(--c-lime));
  cursor: pointer;
}
.fc-slider__input::-moz-range-progress {
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--fc-cat-hue, var(--c-lime));
}
.fc-slider__input:focus-visible {
  outline: 2px solid var(--fc-cat-hue, var(--c-lime));
  outline-offset: 3px;
}

/* ------ G) identity fields ------ */
.fc-build__idrow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--s-3) var(--s-4);
}
.fc-field {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  min-width: 0;
}
.fc-field__label {
  font-family: var(--font-display);
  font-size: var(--fs-label);
  letter-spacing: 0.1em;
  color: var(--c-text-3);
}
.fc-select,
.fc-field__input {
  width: 100%;
  padding: var(--s-2) var(--s-3);
  border: var(--bw) solid var(--c-line-2);
  border-radius: var(--r-xs);
  background: var(--c-panel-2);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: var(--fs-small);
  cursor: pointer;
}
.fc-field__input {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  cursor: text;
}
.fc-select:focus-visible,
.fc-field__input:focus-visible {
  outline: 2px solid var(--c-lime);
  outline-offset: 2px;
}

/* ------ H) playstyle badges + near misses ------ */
.fc-build__badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  min-height: 22px;
}
.fc-build__badges-none {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.1em;
  color: var(--c-text-3);
}
.fc-build__nearmiss {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  padding-top: var(--s-2);
  border-top: var(--bw) solid var(--c-line);
}
.fc-build__nearmiss-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
}
.fc-build__nearmiss-label {
  font-family: var(--font-display);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  color: var(--c-text-3);
}
.fc-build__nearmiss-need {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  color: var(--c-flood-bright);
  font-variant-numeric: tabular-nums;
}

/* ------ I) attribute category sub-panels ------ */
.fc-build__cats {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}
.fc-scat {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding-top: var(--s-4);
  border-top: var(--bw) solid var(--c-line);
}
.fc-scat:first-child {
  padding-top: 0;
  border-top: 0;
}
.fc-scat__head {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
}
.fc-scat__label {
  font-family: var(--font-display);
  font-size: var(--fs-small);
  letter-spacing: 0.1em;
  color: var(--fc-cat-hue);
}
.fc-scat__weight {
  flex: 1;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.06em;
  color: var(--c-text-3);
}
.fc-scat__rating {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--fs-stat-num-sm);
  color: var(--fc-cat-hue);
  font-variant-numeric: tabular-nums;
}
.fc-build__unrated {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.06em;
  color: var(--c-text-3);
}

/* ------ J) save bar ------ */
.fc-build__savebar {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  align-items: stretch;
}
.fc-build__save-note {
  min-height: 1.2em;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.06em;
  color: var(--c-ok);
  text-align: center;
}
