/* The scorecard result sheet. Layout particular to this sheet only; every control is a shared
   component from ff-components.css and every value is a token from ff-tokens.css.
   Load after ff-components.css. State is ARIA and data attributes, never a class. */

/* The sheet opens over the scorecard, so it shares the card's layer and follows it in the DOM. */
.ff-sheet-score { z-index: var(--ff-z-card); }
.ff-sheet-score-scrim { z-index: var(--ff-z-card); }

.ff-sheet-score-heading {
  display: grid;
  gap: var(--ff-space-4);
  min-width: 0;
}

.ff-sheet-score-status {
  margin: 0;
  overflow: hidden;
  color: var(--ff-text-2);
  font: var(--ff-weight-ui) var(--ff-size-14) / var(--ff-leading-tight) var(--ff-font-ui);
  font-variant-numeric: var(--ff-numeric);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The line that confirms the hole just recorded reads as fact, not as a caption. */
.ff-sheet-score-status[data-kind="saved"] {
  color: var(--ff-paper);
  font-weight: var(--ff-weight-strong);
}

.ff-sheet-score-stage { --ff-sheet-score-shift: var(--ff-space-24); }
.ff-sheet-score-stage[data-enter] { animation: ff-sheet-score-in var(--ff-dur-enter) var(--ff-ease-enter) both; }
.ff-sheet-score-stage[data-enter="previous"] { --ff-sheet-score-shift: calc(-1 * var(--ff-space-24)); }

@keyframes ff-sheet-score-in {
  from { opacity: 0; transform: translateX(var(--ff-sheet-score-shift)); }
  to { opacity: 1; transform: none; }
}

/* Result row: five chips at rest (par − 1 … par + 3) in a strip that slides to every other
   score. The strip runs to the sheet body's edges so a sliver of the neighbouring chip shows at
   each end; that sliver is the only "there is more" affordance and needs no extra control. */
.ff-sheet-score-results {
  grid-auto-columns: calc((100% - 4 * var(--ff-touch-gap)) / 5);
  margin: 0 calc(-1 * var(--ff-space-8));
  padding: var(--ff-space-8) var(--ff-space-16);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-padding: 0 var(--ff-space-16);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

/* Each chip snaps to the row's leading edge. */
.ff-sheet-score-chip { scroll-snap-align: start; }

.ff-sheet-score-pickup {
  display: flex;
  align-items: center;
  gap: var(--ff-space-12);
  margin-top: var(--ff-space-4);
}

.ff-sheet-score-hint {
  min-width: 0;
  color: var(--ff-text-2);
  font: var(--ff-weight-ui) var(--ff-size-14) / var(--ff-leading-tight) var(--ff-font-ui);
}

/* A held or estimated count is information the golfer acts on, so it reads at full strength. */
.ff-sheet-score-hint[data-state="estimated"] { color: var(--ff-paper); }
.ff-sheet-score-hint[data-state="pending"] { color: var(--ff-paper); }

.ff-sheet-score-putts-head {
  display: flex;
  align-items: baseline;
  gap: var(--ff-space-12);
  margin: var(--ff-space-16) 0 var(--ff-space-8);
}

.ff-sheet-score-foot {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: var(--ff-touch-gap);
}

/* The hole number between the steppers is a readout here, not a control. */
.ff-sheet-score-current { cursor: default; }

/* Screen-reader-only commit announcements. */
.ff-sheet-score-live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
