/* The Seeds page (D-25) and the Bracket page (DAY-07). Page layout only: panels, buttons, banners
   and the bracket device come from app.css, console.css and components.css, and every color here
   is an existing token. Print rules live in print.css under "the bracket sheet". */

/* ---- the Seeds page ---- */

.seeds-page {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}

.seeds-division {
  color: var(--muted);
  margin: 0 0 var(--space-lg);
}

.seeds-banner-slot:empty {
  display: none;
}

.seeds-banner-slot,
.seeds-page .error-message {
  margin-bottom: var(--space-lg);
}

.seeds-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.seeds-note {
  color: var(--muted);
  margin: 0;
}

.seeds-body > a {
  align-self: flex-start;
}

.seed-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.seed-row {
  display: grid;
  grid-template-columns: 3ch 1fr auto auto;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--line);
}

.seed-number,
.seed-rating {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

.seed-number {
  font-weight: 600;
  text-align: right;
}

.seed-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.seed-rating {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 500;
  color: var(--muted);
}

.seed-unrated {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}

.seed-arrows {
  display: flex;
  gap: var(--space-xs);
  min-width: calc(88px + var(--space-xs));
  justify-content: flex-end;
}

.seed-move {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: 1px solid var(--control);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
}

.seed-move:hover {
  background: var(--tint);
}

.seed-move:disabled {
  cursor: default;
  color: var(--subtle);
}

.seed-move svg {
  width: 20px;
  height: 20px;
}

.seeds-left-out h2 {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
  margin: 0;
}

.seeds-left-out ul {
  list-style: none;
  margin: var(--space-sm) 0 0;
  padding: 0;
}

.seeds-left-out li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--line);
}

.seeds-left-out .left-out-reason {
  color: var(--warn);
}

.seeds-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-md);
}

/* ---- the Bracket page ---- */

.bracket-view-page {
  max-width: 1280px;
  min-width: 0;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}

.bracket-heading {
  margin-bottom: var(--space-lg);
}

.bracket-label {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.bracket-banner-slot:empty {
  display: none;
}

.bracket-banner-slot {
  margin-bottom: var(--space-lg);
}

.bracket-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-md);
  min-width: 0;
}

.bracket-note {
  color: var(--muted);
  margin: 0;
}

/* ---- the bracket itself (bracket-render.js), light mode, also used on the event page ---- */

.bracket-view {
  width: 100%;
  min-width: 0;
}

.bracket-champion {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 600;
  margin: 0 0 var(--space-md);
}

.bracket-champion svg {
  width: 20px;
  height: 20px;
}

/* Wide brackets scroll sideways here, and only here: the page itself never scrolls sideways. */
.bracket-scroll {
  width: 100%;
  overflow-x: auto;
  padding-bottom: var(--space-md);
}

.bracket-rounds {
  display: flex;
  align-items: stretch;
  gap: var(--space-lg);
  width: max-content;
}

/* On screen the printed-page groups flow as one row of columns. */
.bracket-page,
.bracket-page-rounds {
  display: contents;
}

.bracket-page-title {
  display: none;
}

.bracket-round {
  display: flex;
  flex-direction: column;
  width: 280px;
}

.bracket-round-label {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--space-sm);
}

/* Each round's matches spread down the column, so a later match sits between the two it follows. */
.bracket-matches {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: var(--space-md);
  flex: 1;
}

.bracket-bronze {
  margin-top: var(--space-xl);
}

.bracket-bronze .bracket-matches {
  flex: none;
}

.bracket-match {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.bm-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.bm-team {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  min-height: 40px;
  padding: var(--space-xs) var(--space-sm);
}

.bm-team + .bm-team {
  border-top: 1px solid var(--line);
}

.bm-name {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  overflow-wrap: anywhere;
}

/* A winner: heavier type and a check, never color alone. */
.bm-winner .bm-name {
  font-weight: 700;
}

.bm-name svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.bm-tbd .bm-name,
.bm-bye .bm-name {
  color: var(--muted);
}

.bm-score {
  display: inline-flex;
  gap: var(--space-sm);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.bm-marks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-md);
  padding: var(--space-xs) var(--space-sm);
  border-top: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.45;
}

.bm-disputed,
.bm-corrected {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.bm-disputed,
.bm-forfeit {
  color: var(--error);
}

.bm-corrected,
.bm-court {
  color: var(--muted);
}

.bm-disputed svg,
.bm-corrected svg {
  width: 14px;
  height: 14px;
  flex: none;
}

/* Inside the scrolling bracket the match menu takes its own room instead of floating, so the
   region never clips it. */
.bracket-match .match-action-menu {
  position: static;
  min-width: 0;
  box-shadow: none;
}

/* A blank bracket (names only): no results on screen either. */
.bracket-blank .bm-score,
.bracket-blank .bm-marks {
  display: none;
}
