/* Epic 0059 §7 — the unified match edit modal (matches/_edit_modal).
   Builds on the calendar modal chrome (schedule_calendar.css) and the
   Playoff page's table / kebab / badge vocabulary (playoff_editor.css). */

/* The editor's own frame sits BELOW the shared "modal" frame (z-index 200,
   schedule.css): Score details, the Advancer confirm and the delete dialog
   render there and must layer above an open editor. Without this the two
   backdrops tie at 200 and DOM order (match_editor is the later sibling)
   would paint the editor over them (release review 2026-09-09). */
turbo-frame#match_editor:not(:empty) {
  position: fixed;
  inset: 0;
  z-index: 190;
  display: block;
}

/* Width has to beat two other rules this element matches: .schedule-calendar-modal
   (max-width: 640px, schedule_calendar.css) and .ruleset-modal--wide
   (width: min(1100px, 96vw), ruleset_modal.css). Both tie or lose only on load
   order, and the 640px cap was squeezing the games table into a horizontal
   scroll. Three classes settles it: wide enough for TIME + a full
   "Facility - Court" location + both score columns without scrolling. */
.ruleset-modal.ruleset-modal--wide.match-editor { max-width: min(1240px, 96vw); width: min(1240px, 96vw); }
.match-editor .ruleset-modal__body { display: flex; flex-direction: column; gap: var(--sp-4); }
.match-editor__chip { margin-left: 0.5rem; vertical-align: middle; }
.match-editor .score-review__section-title .pv-badge { margin-left: 0.5rem; vertical-align: middle; font-weight: 600; text-transform: none; letter-spacing: 0; }
.match-editor .pv-badge.badge--acc { background: var(--accent-light); color: var(--accent); }
.match-editor .pv-badge.badge--none { background: var(--bg-2); color: var(--ink-3); }

.match-editor__row { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: flex-end; }
.match-editor__row .bulk-form-group { min-width: 120px; }
.match-editor__row .bulk-form-group--wide { flex: 1; min-width: 200px; }
.match-editor__row--readonly .bulk-form-group { min-width: 0; }
.match-editor__ro { display: inline-block; padding: 0.35rem 0.5rem; border: 1px dashed var(--line); border-radius: var(--r-sm); color: var(--ink-3); background: var(--bg-2); font-size: var(--text-sm); min-width: 84px; }
.match-editor__count { width: 72px; }

.match-editor__preview { margin-top: var(--sp-2); padding: 0.5rem 0.65rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); font-size: var(--text-sm); line-height: 1.5; }
.match-editor__preview s { color: var(--ink-3); }
.match-editor__preview b { color: var(--accent); }
.match-editor__mode { display: inline-block; font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); background: var(--accent-light); padding: 0 5px; border-radius: 3px; margin-right: 0.3rem; }

.match-editor__info { margin-top: var(--sp-2); padding: 0.45rem 0.65rem; background: var(--warning-soft); border-left: 3px solid var(--warning); border-radius: 0 var(--r-sm) var(--r-sm) 0; font-size: var(--text-sm); }
.match-editor__info b { display: block; color: var(--warning); }
.match-editor__hint { display: block; font-size: var(--text-xs); color: var(--ink-3); margin-top: 2px; }

.match-editor__games .pv-modal-games th { text-align: left; white-space: nowrap; }
.match-editor__games .match-cell--score .game-cell__input { width: 52px; }
.match-editor__game--dead td { color: var(--ink-3); background: var(--surface-2); }
.match-editor .pv-pencil { margin-left: 2px; }
.match-editor .pe-sched-modal { z-index: 70; }

/* ── Epic 0059 §8 — the Matches list, the grouped Games list, the D20 dialog ── */
.match-summary { display: inline-flex; flex-direction: column; gap: 2px; line-height: 1.35; }
.match-summary__line { white-space: nowrap; }
.match-summary__line b { font-weight: 700; color: var(--ink-3); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.04em; margin-right: 2px; }
.match-summary__chips { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.match-summary__chips:empty { display: none; }
.match-cell--summary .match-cell__display { display: block; }
.schedule-table--matches .col-actions { width: 44px; }

.schedule-row--match-header td { background: var(--bg-2); border-left: 3px solid var(--accent); padding: 0.4rem 0.75rem; }
.schedule-row--in-match td:first-child { border-left: 3px solid var(--accent-light); }
.match-header { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; font-size: var(--text-sm); }
.match-header__teams { display: inline-flex; align-items: center; gap: 0.4rem; }
.match-header__score { font-weight: 800; font-size: 1rem; padding: 0 0.3rem; }
.match-header__meta { color: var(--ink-3); }
.match-header__summary { margin-left: auto; }
.match-header__actions { display: inline-flex; }

.confirm-modal__option { display: flex; align-items: center; gap: 0.5rem; margin: var(--sp-3) 0; font-weight: 600; }
.confirm-modal__note { font-size: var(--text-sm); color: var(--ink-3); }

.match-card__when-label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); font-weight: 700; }
.match-card__when--played { color: var(--ink-3); }
.match-card__game-time { display: block; font-size: var(--text-xs); color: var(--ink-3); font-weight: 400; }
