/* League screens (Phase 8, UI-SPEC "New Component Patterns"): the status chip, round rows, the
   readiness list, the points grid, the division builder and the unplaced panel. Existing tokens
   only, the 8-point spacing scale, 44px targets, the site-wide :focus-visible ring from app.css
   (never overridden here). Nothing is color alone: every state has a word or a glyph. The page is
   light, with no dark mode. 20-05 moved the font stacks and radii onto the tokens; the directory,
   organizer and player league pages link this sheet too, so page layout lives in each page's own sheet. */

/* League status chip: tint fill, ink text, 16px icon. Extends the base .chip from app.css. */
.chip-league {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--tint);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.chip-league svg {
  width: 16px;
  height: 16px;
  flex: none;
}

/* One row per round: the round number and its date range, both in Plex Mono. */
.round-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  min-height: 44px;
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.round-row .round-number {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
}

.round-row .round-dates {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--muted);
}

.round-row.is-skipped {
  color: var(--muted);
}

.round-row.is-skipped svg {
  width: 16px;
  height: 16px;
  flex: none;
}

@media (max-width: 480px) {
  .round-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }
}

/* Skipped-week checkboxes: each row is a 44px target. */
.skip-weeks {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  border: 0;
}

.skip-weeks label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 44px;
  cursor: pointer;
}

.skip-weeks input[type="checkbox"] {
  width: 24px;
  height: 24px;
  flex: none;
}

/* What the league still needs before it can be published. */
.readiness-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.readiness-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  min-height: 24px;
  color: var(--ink);
}

.readiness-list li svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 2px;
}

.readiness-list li.is-met svg {
  color: var(--accent);
}

.readiness-list li.is-unmet {
  color: var(--warn);
}

.readiness-list li.is-unmet svg {
  color: var(--warn);
}

/* The summary that opens the rules and points table on the setup screen: a 44px target. Its focus
   ring is the site-wide one from app.css, restated so nothing on this page can lose it. */
.rules-summary {
  min-height: 44px;
  padding: 10px 0;
  cursor: pointer;
}

.rules-summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-ctl);
}

/* Points table: a label and a 44px numeric input per row. */
.points-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-sm) var(--space-md);
  align-items: center;
  max-width: 480px;
}

.points-grid label {
  color: var(--ink);
}

.points-grid input {
  min-height: 44px;
  width: 100%;
  box-sizing: border-box;
  padding: 0 var(--space-sm);
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--control);
  border-radius: var(--r-ctl);
}

.defaults-helper {
  margin: var(--space-xs) 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* Division builder: unplaced teams beside the divisions, stacked on a phone. */
.builder-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 768px) {
  .builder-grid {
    grid-template-columns: 1fr 2fr;
  }
}

.builder-grid .team-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  min-height: 44px;
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--line);
}

.builder-grid .team-row select {
  min-height: 44px;
  padding: 0 var(--space-sm);
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--control);
  border-radius: var(--r-ctl);
}

/* Teams with no division yet: the existing .notice-warn shell. */
.unplaced-panel {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  background: var(--paper);
  border: 1px solid var(--warn);
  color: var(--warn);
  border-radius: var(--r-ctl);
  padding: var(--space-md);
}

.unplaced-panel svg {
  width: 18px;
  height: 18px;
  flex: none;
}

/* Wraps the existing bracket-device markup plus a Small date line. */
.league-status-flag {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-xs);
}

.league-status-flag .flag-date {
  font-size: 14px;
  color: var(--muted);
}

/* The Stripe balance line on the cancel and refund screens. */
.balance-line {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
}

.balance-line svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.balance-line.is-short {
  color: var(--warn);
}

/* Players paid outside the app, on the cancel screen (09 review M8): an icon and a sentence. */
.cancel-outside {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  color: var(--ink);
}

.cancel-outside svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .chip-league,
  .round-row,
  .skip-weeks label,
  .readiness-list li,
  .points-grid input,
  .builder-grid .team-row,
  .unplaced-panel,
  .balance-line {
    transition: none;
    animation: none;
  }
}
