
.scoreboard {
  background: #214d37;
  padding: 22px 30px;
}

.scoreboard>p {
  font-size: var(--text-small);
  color: #aebf98;
}

/* The visible match clock: big enough to read at arm's length on the
   touchline, yellow edge while it runs, orange time in added time. */
.match-clock {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-4);
  margin-bottom: var(--space-3);
  padding: 14px var(--space-4);
  background: var(--surface-3);
  border-left: 4px solid transparent;
  border-radius: var(--radius);
}

.match-clock.is-running {
  border-left-color: var(--yellow);
}

.match-clock-face {
  display: flex;
  flex-direction: column;
}

.match-clock-half {
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.match-clock-time {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 52px;
  line-height: 1;
  color: var(--navy-deep);
  font-variant-numeric: tabular-nums;
}

.match-clock.is-added-time .match-clock-time {
  color: var(--orange);
}

.match-clock-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.timeline {
  padding: 5px 22px;
}

.timeline-event>div {
  flex: 1;
}

.lineup {
  padding-bottom: 10px;
}

.finalized h3 {
  font-size: 22px;
  margin: 20px;
}

.finalized svg {
  margin: auto;
}

.ball {
  position: absolute;
  left: 56%;
  top: 24%;
  font-size: 24px;
  color: var(--on-navy);
}

.scoreboard {
  color: #fff;
  background: var(--blue-deep);
  border-radius: var(--radius);
  border-bottom: 4px solid var(--yellow);
}

.scoreboard>p {
  text-align: center;
  color: #b4c8ff;
}

.timeline-event {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 18px 0;
  border-bottom: 1px solid var(--ok-bg);
  border-color: var(--line);
}

.minute {
  font-size: var(--text-small);
  width: 28px;
  color: var(--blue);
  font-weight: 750;
}

.event-symbol {
  font-size: 19px;
  color: var(--blue);
}

.timeline-event strong {
  display: block;
  font-size: var(--text-small);
  color: var(--navy-3);
  font-weight: 650;
}

.timeline-event small {
  display: block;
  font-size: var(--text-small);
  line-height: 1.5;
  margin-top: 6px;
  color: var(--muted);
}

.finish-area {
  padding: 23px;
  border-top: 1px solid var(--line);
  border-color: var(--line);
}

.finalized {
  text-align: center;
  padding: 25px;
  color: var(--blue);
}

.finalized p {
  font-size: var(--text-small);
  line-height: 1.8;
  margin-bottom: 25px;
  color: var(--muted);
}

.lineup form {
  margin: 0;
}

.lineup .small {
  line-height: 1.7;
  margin-top: 7px;
}

@media (max-width: 700px) {

  .scoreboard {
    padding: 19px 15px;
  }

  .scoreboard>p {
    font-size: var(--text-small);
  }

}

/* Imported games' review page (fixture_imports/show, boards C-Importar-D
   and -P): on a computer the tabs and a table of editable rows, a card with
   the import's buttons under it; on a phone a list of the rows, which opens
   one in the sheet, a hint and the buttons. A row's state is a small grey
   pill: the red dot for a problem, the amber dot for an update (as this
   board draws it), none when nothing changes; a new game is plain grey text. */
.imp .page-head { margin-bottom: 0; }
.imp .head-back { margin-bottom: 12px; font-size: var(--text-label); }
.imp .page-head .eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: var(--text-small); font-weight: 400; letter-spacing: 0; }
.imp .page-head h1 { font-size: 1.875rem; letter-spacing: -.02em; }
.imp .page-head > :first-child > p:not(.print-only) { display: none; }
.imp-tabs { gap: 28px; margin: 20px 0 0; }
.imp-tabs button { min-height: 44px; font-size: var(--text-body); }

.imp-sheet { margin-top: 20px; overflow-x: auto; }
.imp-table { width: 100%; border-collapse: collapse; }
.imp-table th { padding: 10px 8px; }
.imp-table td { padding: 8px 8px; border-bottom: 1px solid var(--surface-3); font-size: var(--text-label); vertical-align: middle; }
.imp-table tr:last-child td { border-bottom: 0; }
.imp-table input[type=checkbox] { width: 13px; height: 13px; margin: 0 0 0 4px; }
.imp-table :is(input[type=text], select) { display: block; height: auto; min-height: 0; padding: 7px 10px; border: 0; border-radius: 8px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font-size: var(--text-label); line-height: 1.35; appearance: none; }
.imp-table :is(input[type=text], select).imp-bad { box-shadow: inset 0 0 0 2px var(--problem-dot); }
.imp-table [data-cell=date] input { width: 104px; }
.imp-table [data-cell=time] input { width: 64px; }
.imp-table [data-cell=side] select { width: 86px; }
.imp-table [data-cell=opponent] input { width: 124px; }
.imp-table [data-cell=venue] input { width: 150px; }
.imp-table [data-cell=competition] input { width: 180px; }
.imp-table [data-cell=duration] input { width: 64px; }
.imp-table [data-cell=code] input { width: 110px; }
.imp-round { color: var(--ink); font-weight: 700; white-space: nowrap; }
.imp-status { min-width: 170px; white-space: normal; }
.imp-note { display: block; margin-top: 2px; color: var(--muted); font-size: var(--text-small); }

.imp-state { display: inline-flex; flex: none; align-items: center; padding: 3px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: .75rem; font-weight: 600; line-height: 1.35; white-space: nowrap; }
.imp-state.new { padding-inline: 0; background: none; }
.imp-state:is(.problem, .update)::before { content: ""; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--problem-dot); }
/* An update waits on the user's check: the clock (waiting_mark), never amber. */
.imp-state.update::before { width: 9px; height: 9px; border: 1.5px solid var(--muted); background: var(--clock-hands); }

.imp-list { display: none; margin: 0; padding: 0; list-style: none; }
.imp-line { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 12px 16px; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; }
.imp-list li + li { border-top: 1px solid var(--line-soft); }
.imp-line:hover { background: var(--surface-2); }
.imp-line-round { flex: none; width: 30px; padding-top: 2px; font-size: var(--text-label); }
.imp-line-main { flex: 1; min-width: 0; }
.imp-line-title { display: block; font-size: var(--text-body); font-weight: 700; }
.imp-line-meta, .imp-line-note { display: block; margin-top: 2px; color: var(--muted); font-size: var(--text-small); }
.imp-line-meta b, .imp-line-note { color: var(--ink); }

.imp-edit .eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 52px var(--space-1) 0; font-weight: 400; letter-spacing: 0; }
.imp-edit-close { position: absolute; top: 28px; right: 32px; }
.imp-edit-note { margin: 0 0 var(--space-4); color: var(--ink); font-size: var(--text-label); }
.imp-edit-fields { display: grid; gap: var(--space-4); }
.imp-edit-field { display: grid; gap: 6px; margin: 0; font-size: var(--text-label); font-weight: 600; }
.imp-edit-field :is(input, select) { width: 100%; font-weight: 400; }
.imp-edit-field .imp-bad { border-color: var(--problem-dot); box-shadow: inset 0 0 0 1px var(--problem-dot); }
.imp-edit-check { flex-direction: row; align-items: center; gap: var(--space-2); margin: 0; font-size: var(--text-label); font-weight: 600; }
.imp-edit-check input { width: 18px; height: 18px; margin: 0; }

.imp-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding: 16px 18px; border-radius: 14px; background: var(--surface); }
.imp-foot-text { margin: 0; color: var(--muted); font-size: var(--text-label); }
.imp-foot-text b { color: var(--ink); }
.imp-hint { display: none; }
.imp-foot-actions { display: flex; gap: 8px; }
.imp-foot-actions .btn { min-height: 46px; padding: 0 18px; border-radius: 12px; font-size: var(--text-body); white-space: nowrap; }

@media (max-width: 700px) {
  .imp .head-back { margin-bottom: 10px; font-size: var(--text-body); }
  .imp .page-head .eyebrow, .imp-tabs, .imp-table, .imp-foot-text, .imp-check { display: none; }
  .imp .page-head h1 { font-size: 1.625rem; }
  .imp .page-head > :first-child > p:not(.print-only) { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: var(--text-label); }
  .imp-sheet { margin: 14px -8px 0; }
  .imp-list { display: block; }
  .imp-edit-close { top: 26px; right: 20px; }
  .imp-foot { display: block; margin: 16px -8px 0; padding: 0; background: none; }
  .imp-hint { display: block; margin: 0 0 12px; padding: 14px 16px; border-radius: 14px; background: var(--surface-3); color: var(--muted); font-size: var(--text-label); font-weight: 600; }
  .imp-hint::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--problem-dot); vertical-align: 1px; }
  .imp-foot-actions .btn { flex: 1; }
  .imp-foot-actions .btn.primary { flex: 1.4; }
}

.import-summary {
  margin: 0 0 var(--space-4);
  color: var(--muted);
}

.import-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* A parent's match sheet: the events and the timeline, nothing else. */
.reporter-sheet .scoreboard p {
  margin-top: var(--space-2);
}

/* Call-up as a pitch (experiment): formation picker, tappable positions and the squad beside it. */
/* The title and how-to across the panel; the formation and the count of
   placed players on one line under it. */
.lp-head { display: block; }

.lp-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 0 22px 14px;
}

.lp-toolbar p { margin: 0; color: var(--muted); font-size: var(--text-body); }

.lp-formation {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin: 0;
  gap: 10px;
  font-size: var(--text-small);
  font-weight: 600;
}

.lp-formation select {
  width: auto;
}

.lp-layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 22px;
  padding: 0 22px 18px;
}

/* Every line-up pitch (the editor, the call-up card, the home page's) is the
   whole pitch to scale, 68 x 105 m plus a 2.4 m margin (728 x 1098, as
   MatchesHelper::LINEUP_PITCH_FRAME), with the measured lines on top. */
.lp-pitch {
  position: relative;
  aspect-ratio: 728 / 1098;
  border-radius: 14px;
  overflow: hidden;
  background: repeating-linear-gradient(180deg, var(--blue-deep) 0 10%, var(--blue) 10% 20%);
}

.lp-pitch .pitch-markings { color: rgb(201 215 255 / 65%); }

.lp-slot {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0;
  border: 0;
  background: none;
  transform: translate(-50%, -50%);
  cursor: pointer;
  color: var(--on-navy);
}

.lp-slot b {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px dashed #c9d7ffaa;
  font-size: var(--text-small);
  font-weight: 700;
  color: var(--blue-line);
}

.lp-slot.filled b {
  font-size: var(--text-body);
}

.lp-pos {
  font-size: var(--text-small);
  font-style: normal;
  font-weight: 700;
  letter-spacing: .3px;
}

.lp-slot .lp-pos {
  position: absolute;
  top: -9px;
  left: 50%;
  padding: 1px var(--space-1);
  border-radius: var(--radius);
  background: var(--navy-deep);
  color: var(--on-navy);
  font-size: var(--text-small);
  transform: translateX(-50%);
}

.lp-choice .lp-pos {
  margin-left: auto;
  color: var(--muted);
}

.lp-picker h3 .lp-pos {
  font-size: var(--text-subheading);
  color: var(--blue);
}

.lp-lead {
  margin-top: var(--space-1);
  font-size: var(--text-body);
  line-height: 1.5;
}

/* A placed player (style page "Pitch"): a white disc with the number in
   navy; the goalkeeper's disc navy with a white number. */
.lp-slot.filled b {
  border: 0;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(17 28 58 / 25%);
  color: var(--navy);
  font-weight: 700;
}

.lp-slot.filled.keeper b {
  background: var(--navy);
  color: var(--on-navy);
}

.lp-slot span {
  max-width: 76px;
  overflow: hidden;
  font-size: var(--text-small);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lp-slot:focus-visible b {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

.lp-slot:disabled {
  cursor: default;
}

.lp-squad h3,
.lp-group summary {
  margin: 0 0 var(--space-2);
  font-size: var(--text-subheading);
  font-weight: 700;
}

.lp-group + .lp-group {
  margin-top: 18px;
}

.lp-group summary {
  padding: 6px 0;
  cursor: pointer;
}

.lp-player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--line);
}

.lp-player strong {
  flex: 1;
  font-size: var(--text-small);
  font-weight: 500;
}

.lp-player .lp-number {
  width: 56px;
}

.lp-where {
  min-width: 36px;
  padding: var(--space-1) var(--space-2);
  border: 0;
  border-radius: var(--radius);
  background: var(--blue-soft);
  color: var(--blue-deep);
  font: inherit;
  font-size: var(--text-small);
  font-weight: 700;
  cursor: pointer;
}

/* A starter shows their position; everyone else a substitute toggle. */
.lp-player:not(.on-pitch) .lp-where,
.lp-player.on-pitch .lp-bench { display: none; }

.lp-bench {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.lp-bench input { display: inline-block; width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; accent-color: var(--blue); }
.lp-bench:has(input:checked) { border-color: var(--blue-line); background: var(--blue-soft); color: var(--blue-deep); }

/* Pointing a starter out on the pitch. */
.lp-slot.pulse b { animation: lp-pulse .9s ease-out 2; }

@keyframes lp-pulse {
  0% { box-shadow: 0 0 0 0 var(--yellow); }
  100% { box-shadow: 0 0 0 16px transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .lp-slot.pulse b { animation: none; outline: 3px solid var(--yellow); outline-offset: 3px; }
}

/* The name, with the player's eligibility badges under it. */
.lp-name {
  display: grid;
  flex: 1;
  gap: var(--space-1);
  min-width: 0;
}

.lp-flags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.lp-choice .badge, .lp-flags .badge { white-space: nowrap; }

/* A player who can't play on the day: a grey disc with a thin red ring. */
.lp-slot.blocked b,
.lp-slot.filled.blocked b {
  background: var(--surface-3);
  box-shadow: 0 0 0 2px var(--problem-dot);
  color: var(--muted);
}

.lp-player.on-pitch strong {
  font-weight: 700;
}

.lp-picker {
  width: min(420px, calc(100vw - 32px));
  padding: 20px;
  border: 0;
  border-radius: 14px;
}

.lp-picker h3 {
  margin: 0 0 var(--space-3);
  font-size: var(--text-subheading);
}

.lp-choices {
  outline: none;
  display: grid;
  gap: 6px;
  max-height: 50vh;
  overflow: auto;
}

.lp-choice {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.lp-choice b {
  width: 28px;
  text-align: center;
}

.lp-choice-name { display: grid; gap: var(--space-1); min-width: 0; }
.lp-choice-name strong { font-weight: 500; }

.lp-choice-group {
  margin: var(--space-2) 0 0;
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 600;
}

.lp-choice-group:first-child { margin-top: 0; }

.lp-choice-swap summary { cursor: pointer; border-radius: 6px; }
.lp-choice-swap > div { display: grid; gap: 6px; margin-top: 6px; }

.lp-picker-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: 14px;
}

.formation-pitch {
  width: min(100%, 300px);
  margin: 0 auto;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.formation-pitch .lp-slot {
  cursor: default;
}

/* The read-only pitch names each player under their disc; the position
   shows only on the editor's. */
.formation-pitch .lp-pos { display: none; }

/* The event panel before the game's day or without starters: why it's
   closed, and the way to the call-up. */
.event-gate {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  padding: 28px 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
}

.event-gate h3 { color: var(--ink); font-size: var(--text-subheading); }

.event-gate p { max-width: 360px; font-size: var(--text-small); line-height: 1.5; }

.event-gate .btn { margin-top: 6px; }

.match-recording {
  margin-top: var(--space-1);
  font-size: var(--text-small);
}

.match-recording a {
  color: var(--yellow);
  font-weight: 700;
}

/* On the editor's own pitch the players are bigger than on the printed
   sheet's: a number and a surname readable at a glance. */
.lineup .lp-slot b { width: 48px; height: 48px; }
.lineup .lp-slot.filled b { font-size: var(--text-subheading); }
.lineup .lp-slot span {
  max-width: 104px;
  font-size: var(--text-body);
  line-height: 1.15;
  text-align: center;
  white-space: pre-line;
}
.lineup .lp-slot .lp-pos { top: -11px; }

/* Saving the call-up: the forms' action bar at the panel's end, with how
   many starters and substitutes it saves. */
.lp-actions { margin: 0 22px 22px; }
.lp-actions p { margin: 0; }
.lp-actions .lp-publish { margin-left: var(--space-2); }

/* Phones: the pitch on top, and the player picker as a sheet from the bottom. */
@media (max-width: 760px) {
  .lp-layout {
    grid-template-columns: 1fr;
    padding: 0 14px 14px;
  }

  .lp-toolbar {
    padding: 0 14px var(--space-3);
  }

  .lp-actions { margin: 0 14px 14px; }

  .lineup .lp-slot b { width: 40px; height: 40px; }
  .lineup .lp-slot span { max-width: 80px; font-size: var(--text-small); }

  .lp-player .lp-number {
    width: 50px;
    padding: var(--space-2) 6px;
    text-align: center;
  }

  .lp-picker {
    width: 100%;
    max-width: 100%;
    max-height: 85vh;
    margin: auto 0 0;
    padding: 18px var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom));
    border-radius: 16px 16px 0 0;
  }

  .lp-choices {
    max-height: 60vh;
  }

  .lp-choice {
    padding: var(--space-3) 10px;
  }
}

/* A game's player stats (matches/_stats): the shirt number in a narrow
   muted column, the name as a plain link. */
.stats-table .stats-number { width: 4rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.stats-table td a { color: var(--ink); font-weight: 500; }

/* The score (matches/score), in the display face; the game hero sizes it. */
.match-result {
  color: var(--on-navy);
  font-family: var(--display);
  font-size: 54px;
  font-style: italic;
  font-weight: 400;
  line-height: 1;
}

.match-result span { padding: 0 10px; color: var(--yellow); }

.match-result .match-vs { padding: 0; color: rgb(255 255 255 / 55%); font-size: 30px; }

.sheet-work { margin-bottom: 22px; }

/* During the game the work comes first and the venue follows it. */
.match-sheet.is-on .sheet-overview { margin-top: 22px; }

.sheet-venue .card-head .eyebrow { margin: 0; text-align: right; }

.formation-empty { display: grid; gap: var(--space-1); margin: var(--space-1) 0 var(--space-3); }

.delegate-sheet .timeline-panel { margin-top: 0; }

@media (max-width: 700px) {
  .match-result { font-size: 40px; }

  .match-result span { padding: 0 6px; }

  .sheet-work { margin-bottom: var(--space-4); }
}

/* Quiet connection feedback beside the live sheet, readable on pitch-side phones. */
.match-sync-status.helper { display: block; margin: 0 0 var(--space-3); font-size: var(--text-small); line-height: 1.5; font-variant-numeric: tabular-nums; color: var(--muted); }
.match-sync-status [data-sync-time] { white-space: nowrap; }
.match-sync-status.helper.is-stale { color: var(--ink); font-weight: 600; }
/* The staff game page (boards C-Jogo-D/-P) draws no status line: while the
   page is up to date the line is only read out; it shows when the page
   is offline, needs a review or the recording closed. */
.game-page > .match-sync-status:not(.is-stale) { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media print { .match-sync-status { display: none; } }

/* The staff match page (matches/show, boards Jogo and C-JogoFim). On top
   the way back and the page's small buttons; under the game on navy, two
   columns: before the game the call-up beside what to sort out and the
   availability, once closed the moments beside the players' stats. A phone
   stacks them, "Antes do jogo" first. */
@media (min-width: 701px) { .game-page .only-phone { display: none; } }
@media (max-width: 700px) { .game-page .only-laptop { display: none; } }

.game-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-4); }
.game-top .head-back { margin: 0; font-size: var(--text-label); }
.game-top-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.game-top-actions form, .game-bottom-actions form { display: contents; }
.game-top-actions .small-btn, .game-bottom-actions .btn { min-height: var(--control-height-sm); }
.game-top-actions .more-menu-panel .btn { justify-content: flex-start; min-height: 40px; border: 0; background: none; color: var(--ink); font-size: var(--text-label); font-weight: 500; }
.game-page .game-hero { margin-bottom: var(--space-5); }
.game-hero-meta .match-waiting { display: inline-flex; align-items: center; gap: 5px; color: var(--on-navy); font-weight: 600; }

.game-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
  margin-bottom: var(--space-5);
}
.game-column { display: grid; gap: var(--space-5); min-width: 0; }
.game-story { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* "Convocatória · 3-3-2": the pitch, and beside it the call-up's state,
   the substitutes, who wasn't called up and the yellow way to the editor. */
.call-up-sheet {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  grid-template-areas: "pitch state" "pitch bench" "pitch out" "pitch edit";
  grid-template-rows: auto auto auto 1fr;
  gap: 18px 20px;
  padding: var(--space-4);
}
.call-up-publication { grid-area: state; display: grid; gap: var(--space-3); align-content: start; }
.call-up-pitch { grid-area: pitch; }
.call-up-bench { grid-area: bench; display: grid; gap: var(--space-2); align-content: start; }
.call-up-out { grid-area: out; }
.call-up-edit { grid-area: edit; align-self: end; }
/* Once the editor is open its own button is the yellow one: one per page. */
[data-shown-tab="lineup"] .call-up-edit { display: none; }
.call-up-sheet h3 { margin: 0 0 var(--space-2); color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.call-up-bench h3 { margin: 0; }
.call-up-out p { margin: 0; color: var(--muted); font-size: var(--text-label); line-height: 1.6; }
.call-up-player { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-label); }
.call-up-sheet .formation-pitch { width: 100%; }
.call-up-sheet.is-empty { grid-template-columns: minmax(0, 1fr); grid-template-areas: "state" "pitch" "bench" "out" "edit"; grid-template-rows: none; }
.call-up-sheet .formation-empty { margin: 0; }

/* The call-up's state: the tick once published, the clock while changes
   wait, then how far it reached and the way to its confirmations. */
.call-up-status { display: flex; gap: var(--space-2); margin: 0; font-size: var(--text-label); }
.call-up-status > svg { flex: 0 0 auto; margin-top: 2px; color: var(--muted); }
.call-up-status > span { display: grid; gap: 2px; }
.call-up-status strong { color: var(--ink); }
.call-up-status small { color: var(--muted); font-size: var(--text-small); line-height: 1.5; }

/* A shirt number in a grey disc: the substitutes, the availability lines
   and the stats. */
.shirt-disc { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-3); color: var(--ink); font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* When recording opens and who records, under the call-up. */
.game-note { display: grid; gap: var(--space-1); margin: calc(-1 * var(--space-2)) var(--space-1) 0; color: var(--muted); font-size: var(--text-small); }
.game-note p { display: flex; align-items: center; gap: var(--space-2); margin: 0; }
.game-note :is(.match-recording, .match-staff) { margin: 0; }
.game-note .match-recording a { color: var(--blue); font-weight: 600; }

/* "Antes do jogo" and "Disponibilidade": lines with a red dot or the clock
   at the start, the state in plain text at the end. */
.game-before .row-lead, .game-availability .row-lead { min-width: 18px; justify-content: center; color: var(--muted); }
.game-before .tone-dot { width: 10px; height: 10px; }
.game-before .row-item.is-calm .row-title { color: var(--muted); font-weight: 500; }
.game-before .card-note { margin: 10px var(--space-1) 0; }
.game-page .section-title a { color: var(--blue); }
/* "Pedir de novo" sends at once (a button in a form) but reads as the
   title's link. */
.game-page .section-title .text-btn { min-height: 0; padding: 0; font-size: var(--text-label); font-weight: 600; }
/* These lines keep their state or button at the end, however narrow. */
.game-page :is(.game-availability, .game-before) .row-item { flex-wrap: nowrap; }
.game-page :is(.game-availability, .game-before) .row-main { flex: 1 1 auto; }
.game-page :is(.game-availability, .game-before) .row-aside { order: 0; flex-basis: auto; padding-left: 0; }
.game-availability .row-title small { color: var(--muted); font-size: .75rem; font-weight: 400; }
.game-availability .row-aside { gap: 6px; font-size: var(--text-label); font-weight: 700; }
.game-availability .row-aside svg { color: var(--muted); }
.game-availability-more .row-main { text-align: center; }
.game-availability-more .row-title { color: var(--blue); font-size: var(--text-small); font-weight: 500; }
.game-availability-more > svg { display: none; }
.game-availability-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); text-align: center; }
.game-availability-counts a { display: grid; gap: 2px; padding: 14px 6px; color: var(--ink); }
.game-availability-counts a + a { border-left: 1px solid var(--line-soft); }
.game-availability-counts strong { font-size: 24px; font-weight: 700; }
.game-availability-counts small { color: var(--muted); font-size: var(--text-small); }

/* The call-up editor opens under the page before the game's day, without
   the tabs it sits in on the day. */
.sheet-work.is-tucked > .tabs { display: none; }

/* A closed game: its moments, the minute in blue and the drawn mark, then
   who and what. */
.game-timeline > .panel-head { padding: 0; margin: 0 var(--space-1) 10px; }
.game-timeline > .panel-head h2 { color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.game-timeline > .timeline, .game-timeline > .empty-state { border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.game-timeline .timeline { padding: 0; }
.game-timeline .timeline-event { align-items: center; gap: var(--space-3); padding: 12px 18px; border-bottom: 0; }
.game-timeline .timeline-event + .timeline-event { border-top: 1px solid var(--line-soft); }
.game-timeline .minute { width: 36px; color: var(--blue); font-size: var(--text-label); font-weight: 700; }
.game-timeline .event-symbol { display: flex; justify-content: center; width: 22px; color: var(--ink); }
.game-timeline .event-symbol .card-icon { width: 14px; height: 18px; border-radius: 3px; transform: none; }
.game-timeline .timeline-event strong { color: var(--ink); font-size: var(--text-body); }
.game-timeline .timeline-event small { display: block; margin-top: 2px; color: var(--muted); font-size: var(--text-small); }

/* "O jogo de cada um": the players with something to show, and
   "Os N convocados" opens the whole list. */
.stats-toggle { flex-direction: row; gap: 0; margin: 0; color: var(--blue); font-size: var(--text-label); font-weight: 600; cursor: pointer; }
.stats-toggle:has(:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.game-stats-card.is-trimmed:not(:has(.stats-toggle :checked)) tr.is-quiet { display: none; }
.stats-toggle:has(:checked) span { color: var(--ink); }
.stats-table .stats-figure { width: 48px; text-align: center; }
.stats-table .stats-figure .card-icon { display: inline-block; width: 11px; height: 14px; margin: 0 2px; border-radius: 2px; transform: none; vertical-align: -2px; }
.stats-table td small { display: block; margin-top: 2px; color: var(--muted); font-size: var(--text-small); font-weight: 400; }

.game-bottom-actions { display: flex; gap: var(--space-2); margin-top: var(--space-4); }
.game-bottom-actions > * { flex: 1 1 0; }

@media (max-width: 900px) {
  .game-columns, .game-story { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 700px) {
  .game-columns { gap: var(--space-5); }
  .game-columns > .game-column { display: contents; }
  .game-columns .sheet-needs { order: 1; }
  .game-columns .call-up-card { order: 2; }
  .game-columns .game-availability { order: 3; }
  .game-columns .game-note { order: 4; margin-top: 0; }
  .call-up-sheet { grid-template-columns: minmax(0, 1fr); grid-template-areas: "state" "pitch" "bench"; grid-template-rows: none; gap: var(--space-3); padding: var(--space-3); }
  .call-up-sheet :is(.call-up-out, .call-up-edit) { display: none; }
  /* One line while the substitutes fit, then they wrap: a long bench must
     never push the page wider than the phone. */
  .call-up-bench { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
  .call-up-bench h3 { color: var(--muted); font-size: var(--text-small); font-weight: 400; letter-spacing: 0; text-transform: none; }
  .game-timeline .timeline-event { padding: 11px 14px; }
}

/* Call-up page (call_ups/show, boards Convocatória; prefix callup-). On a
   laptop the called-up players beside the publication and "A resolver"; on
   a phone "A resolver", the players and the publication stacked, the
   publication in one line under the title, the eyebrow and the head's
   buttons gone and "Editar convocatória" with "Imprimir" at the end. A
   player's line: the shirt number in its disc, the name with "Não pode
   jogar", the family's answer and, on a laptop, whether they read it. */
.callup-page .page-head .eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.callup-page .page-head h1 { margin-top: 4px; }
.callup-page .page-head > :first-child > p:has(.callup-status-line) { display: none; }
.callup-status-line { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: var(--text-label); font-weight: 600; }
.callup-status-line svg { flex: none; }
.callup-columns { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); grid-template-areas: "squad pub" "squad resolve"; grid-template-rows: auto 1fr; gap: 24px 20px; align-items: start; margin-top: 24px; }
.callup-squad { grid-area: squad; min-width: 0; }
.callup-pub { grid-area: pub; min-width: 0; }
.callup-resolve { grid-area: resolve; min-width: 0; }
.callup-rows .callup-row { flex-wrap: nowrap; gap: 12px; padding: 10px 16px; }
.callup-rows .row-main { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.callup-rows .row-state .badge { padding: 2px 8px; border-radius: 999px; background: var(--surface-3); font-size: .75rem; }
.callup-rows .callup-row .row-aside { order: 0; flex-basis: auto; padding-left: 0; gap: 0; font-size: var(--text-small); font-weight: 400; }
.callup-answer { display: flex; justify-content: flex-end; min-width: 100px; }
.callup-answer .badge { font-size: .75rem; }
.callup-answer .badge.neutral { font-weight: 600; }
.callup-read { min-width: 130px; color: var(--muted); font-size: .75rem; text-align: right; }
.callup-pub-body { display: grid; gap: 10px; padding: 18px 20px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.callup-pub-body p { margin: 0; color: var(--muted); font-size: var(--text-small); line-height: 1.45; }
.callup-pub-state { display: flex; align-items: center; gap: 8px; }
.callup-pub-body .callup-pub-state { color: var(--ink); font-size: var(--text-body); }
.callup-pub-state svg { flex: none; color: var(--muted); }
.callup-pub-body .callup-pub-reach strong { color: var(--ink); }
.callup-pub-squad summary { color: var(--blue); font-size: var(--text-small); font-weight: 600; cursor: pointer; }
.callup-pub-squad p { margin-top: 6px; }
.callup-pub-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: 4px; }
.callup-pub-actions form { margin: 0; }
.callup-pub-actions .btn:not(.primary) { min-height: var(--control-height-sm); font-size: var(--text-label); }
.callup-resolve .game-before .row-item { flex-wrap: nowrap; }
.callup-resolve .game-before .row-main { flex: 1 1 auto; }
.callup-foot { display: none; }
.callup-empty { border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.callup-dialog-note { margin: 0 0 var(--space-4); color: var(--muted); font-size: var(--text-small); }
@media (max-width: 700px) {
  .callup-page .page-head .eyebrow, .callup-page .page-head .head-actions { display: none; }
  .callup-page .page-head > :first-child > p:has(.callup-status-line) { display: block; margin-top: 6px; }
  .callup-columns { grid-template-columns: minmax(0, 1fr); grid-template-areas: "resolve" "squad" "pub"; grid-template-rows: none; gap: 22px; margin-top: 18px; }
  .callup-read { display: none; }
  .callup-answer { min-width: 0; }
  .callup-rows .row-main { display: grid; flex-basis: auto; }
  .callup-rows .row-state { justify-self: start; }
  .callup-foot { display: flex; gap: 10px; margin-top: 22px; }
  .callup-foot > .btn { flex: 1 1 auto; min-height: 52px; white-space: nowrap; }
  .callup-foot > .btn:first-child { flex-grow: 2; }
}

/* Availability page (match_availabilities/show, C-Disponibilidade; prefix
   avail-). On a computer three columns, those still to answer first, each
   under its heading and count; on a phone one group at a time under tabs,
   the deadline under the title with its "Mudar" link, and the ask button
   full width under the list. A line: the shirt number in its disc, the name
   and when they answered, "convocado" in a grey pill (the red dot when they
   can't come). */
.avail-tabs, .avail-change-link, .avail-state, .avail-foot-ask { display: none; }
.page-head:has(+ .avail-columns, + .avail-tabs, + .avail-closed) .eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.page-head:has(+ .avail-columns, + .avail-tabs, + .avail-closed) h1 { margin-top: 4px; }
.avail-head-only form { margin: 0; }
.avail-closed { margin: var(--space-4) 0 0; color: var(--muted); font-size: var(--text-small); }
.avail-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 20px; margin-top: 24px; }
.avail-rows .avail-row { flex-wrap: nowrap; gap: 12px; padding: 11px 16px; }
.avail-row .row-main { flex: 1 1 auto; gap: 0; }
.avail-row .row-title a { color: var(--ink); font-weight: 700; }
.avail-row .row-title a:hover { color: var(--blue); }
.avail-row .row-aside { display: flex; flex: none; align-items: center; gap: 8px; }
.avail-rows .avail-row:has(> .row-lead) .row-aside { padding-left: 0; }
/* "convocado" is a normal state: plain grey text, no pill (library colour rule). */
.avail-called { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .75rem; font-weight: 600; white-space: nowrap; }
.avail-state { align-items: center; gap: 6px; color: var(--muted); font-size: .75rem; font-weight: 600; white-space: nowrap; }
.avail-empty { margin: 0; padding: 14px 16px; border-radius: var(--radius-lg); box-shadow: inset 0 0 0 1px var(--line); color: var(--faint); font-size: var(--text-label); }
.avail-note { margin: 24px 4px 0; color: var(--muted); font-size: var(--text-small); }
.avail-note a { color: var(--blue); font-weight: 600; }

@media (max-width: 700px) {
  .page-head:has(+ .avail-columns, + .avail-tabs, + .avail-closed) > :first-child { display: flex; flex-direction: column; }
  .page-head:has(+ .avail-columns, + .avail-tabs, + .avail-closed) { margin-bottom: 0; }
  .page-head:has(+ .avail-columns, + .avail-tabs, + .avail-closed) .eyebrow { display: block; order: 1; margin: 4px 0 0; color: var(--muted); font-size: var(--text-label); font-weight: 400; letter-spacing: 0; }
  .page-head:has(+ .avail-columns, + .avail-tabs, + .avail-closed) .eyebrow .badge { display: none; }
  .page-head:has(+ .avail-columns, + .avail-tabs, + .avail-closed) .eyebrow .avail-change-link { display: inline; }
  .page-head:has(+ .avail-columns, + .avail-tabs, + .avail-closed) .eyebrow .text-btn { padding: 0; font-weight: 700; }
  .page-head:has(+ .avail-columns, + .avail-tabs, + .avail-closed) h1 { margin-top: 0; }
  .avail-head-only { display: none; }
  .avail-tabs { display: flex; margin: 18px 0 0; }
  .avail-columns { display: block; margin-top: 18px; }
  .avail-col { display: none; }
  .avail-col.is-current { display: block; }
  .avail-col .section-title { display: none; }
  .avail-rows .avail-row { padding: 12px 14px; }
  /* "convocado" over the answer on the right, so the name keeps one line. */
  .avail-row .row-aside { flex-direction: column; align-items: flex-end; gap: 4px; }
  .avail-row .row-aside { flex-wrap: wrap; justify-content: flex-end; }
  .avail-state { display: inline-flex; }
  .avail-foot-ask { display: block; margin-top: 18px; }
  .avail-foot-ask :is(.btn, form) { width: 100%; }
  .avail-note { display: none; }
}

/* ===== Live recording and the delegate's game page =====
   Match mode and its navy band, the clock, the moment buttons, the moments
   to complete, the last events, and the delegate sheet (delegate_sheets/show).
   Boards JogoAoVivo-P and JogoDelegado-P. */

/* Match mode: while the clock runs (the buttons' "is-live"), the sheet is
   one phone screen: the game's scoreboard with the clock under it on the
   same navy band ("Ficha completa", the phase, the time and the next step),
   the five moment buttons, the moments to complete and the last events. The
   rest of the sheet waits behind "Ficha completa" (full_sheet_controller.js). */
.match-mode {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.match-mode:not(:has(> div > *)) {
  display: none;
}

.match-mode .match-clock {
  flex-wrap: nowrap;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left-width: 4px;
}

.match-mode .match-clock-buttons {
  flex-direction: column;
  align-items: flex-end;
}

/* The band: the scoreboard above loses its lower corners and the clock
   carries on its navy. */
.match-sheet:has(.moment-buttons.is-live) .game-hero {
  margin-bottom: 0;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.match-sheet:has(.moment-buttons.is-live) .match-mode {
  position: relative;
  gap: 0;
  margin-bottom: var(--space-5);
  padding: 14px 16px 18px;
  border-radius: 0 0 22px 22px;
  background: var(--navy);
  color: var(--on-navy);
}

/* The running clock on navy, in match mode and in the delegate's hero: "Ao
   vivo · 1.ª parte" in yellow with its dot, the time big and yellow, the
   next step beside it and "Repor relógio" small under it. */
:is(.match-sheet:has(.moment-buttons.is-live) .match-mode, .hero-clock) .match-clock {
  display: grid;
  grid-template-columns: 1fr auto auto 1fr;
  align-items: center;
  gap: 12px 14px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}

:is(.match-sheet:has(.moment-buttons.is-live) .match-mode, .hero-clock) .match-clock-face {
  display: contents;
}

:is(.match-sheet:has(.moment-buttons.is-live) .match-mode, .hero-clock) .match-clock-half {
  display: flex;
  grid-column: 1 / -1;
  justify-self: end;
  align-items: center;
  gap: 6px;
  color: var(--yellow);
  font-size: .8125rem;
  letter-spacing: .06em;
}

:is(.match-sheet:has(.moment-buttons.is-live) .match-mode, .hero-clock) .match-clock-half::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
}

:is(.match-sheet:has(.moment-buttons.is-live) .match-mode, .hero-clock) .match-clock-time {
  grid-column: 2;
  color: var(--yellow);
  font-size: 2.75rem;
}

.match-sheet:has(.moment-buttons.is-live) .match-mode .match-clock-buttons {
  grid-column: 3;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
}

.match-sheet:has(.moment-buttons.is-live) .match-mode .match-clock-buttons .btn:not(.primary) {
  min-height: 40px;
  border-color: transparent;
  background: var(--navy-2);
  color: var(--on-navy);
}

.match-sheet:has(.moment-buttons.is-live) .match-mode .match-clock-buttons .text-btn {
  color: var(--on-navy-muted);
  font-size: .75rem;
}

/* The delegate's clock: read only, on its own line above the hero's buttons. */
.hero-clock {
  flex: 1 1 100%;
  order: -1;
}

.hero-clock:empty {
  display: none;
}

/* "Ficha completa": at the top left of the band, in match mode only. */
.full-sheet-toggle {
  display: none;
}

.match-sheet:has(.moment-buttons.is-live) .full-sheet-toggle {
  position: absolute;
  top: 14px;
  left: 16px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0;
  border: 0;
  background: none;
  color: var(--on-navy-muted);
  font: inherit;
  font-size: .8125rem;
  font-weight: 600;
  cursor: pointer;
}

.full-sheet-toggle:hover {
  color: var(--on-navy);
}

.full-sheet-toggle[aria-expanded=true] svg {
  transform: rotate(-90deg);
}

.match-sheet:has(.moment-buttons.is-live):not(.is-full) :is(.sheet-full, .match-staff, .match-mode .helper, .game-hero-eyebrow, .game-hero-meta, .game-hero-note, .game-hero .hero-actions, .sheet-work > .tabs, .sheet-work > [data-tab]:not([data-tab=events]), .sheet-timeline) {
  display: none;
}

/* In match mode the buttons show whichever tab was open. */
.match-sheet:has(.moment-buttons.is-live):not(.is-full) .sheet-work > [data-tab=events] {
  display: block !important;
}

/* The moment buttons, the moments to complete and the last events: in the
   "Registar jogo" tab above the timeline, or right under the clock in match
   mode. */
.moment-area {
  display: grid;
  gap: var(--space-5);
  margin-bottom: var(--space-4);
}

.moment-area:not(:has(> div > *)) {
  display: none;
}

/* The five moment buttons: big, one-handed targets, two to a row on a
   phone, "Golo" in blue and "Substituição" across the last row; the
   referee's card colours on the cards. On a wider screen, one row of five. */
.moment-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.moment-buttons form {
  display: contents;
}

.moment-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 96px;
  padding: var(--space-2);
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(17, 28, 58, .08), inset 0 0 0 1px var(--line);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-body);
  font-weight: 700;
  cursor: pointer;
  hyphens: auto;
}

.moment-button .card-icon {
  width: 18px;
  height: 24px;
  border-radius: 3px;
  transform: none;
}

.moment-button:active {
  background: var(--blue-soft);
}

.moment-button.moment-goal {
  background: var(--blue);
  box-shadow: none;
  color: var(--on-navy);
}

.moment-button.moment-goal:active {
  background: var(--blue-deep);
}

.moment-button.moment-substitution {
  grid-column: 1 / -1;
  flex-direction: row;
  min-height: 72px;
}

.moment-button:focus-visible {
  outline: 3px solid var(--yellow);
}

@media (min-width: 701px) {
  .moment-buttons { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .moment-button.moment-substitution { grid-column: auto; flex-direction: column; min-height: 96px; }
}

.moment-toast .text-btn {
  color: var(--yellow);
}

/* The moments still to complete: a white card under a section title, one
   chip each. */
.moments-strip {
  margin-bottom: var(--space-4);
}

.moments-strip h2 {
  margin: 0 var(--space-1) 10px;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.moment-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.moment-chip {
  min-height: var(--control-height);
  padding: 0 var(--space-4);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-body);
  font-weight: 700;
  cursor: pointer;
}

.moment-area .moments-strip {
  margin: 0;
}

/* The last events: a section title, then one line each (the minute, what
   happened and who, the undo on the newest). */
.recent-events .timeline-panel {
  margin: 0;
}

.recent-events .timeline {
  padding: 0;
}

.recent-events .timeline-event {
  padding: 12px var(--space-4);
  border-bottom: 0;
}

.recent-events .timeline-event + .timeline-event {
  border-top: 1px solid var(--line-soft);
}

.recent-events .minute {
  width: 34px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: var(--text-body);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.recent-events .event-symbol {
  font-size: 15px;
}

.recent-events .timeline-event strong {
  color: var(--ink);
  font-size: var(--text-body);
  font-weight: 700;
}

.recent-events .timeline-event small {
  margin-top: 2px;
}

.moment-picker {
  width: min(460px, calc(100vw - 32px));
  padding: 20px;
  border: 0;
  border-radius: 14px;
}

.moment-picker h3 {
  margin: 0 0 var(--space-3);
  font-size: var(--text-subheading);
}

.moment-picker-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

/* The moment's minute, typed or corrected on top of its picker. */
.moment-minute {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  font-size: var(--text-body);
  font-weight: 700;
}

.moment-minute label {
  margin: 0;
}

.moment-minute input {
  width: 5.5rem;
  min-height: var(--control-height);
  font-size: var(--text-input);
}

.moment-question {
  margin: 0 0 var(--space-2);
  font-size: var(--text-body);
  font-weight: 700;
}

/* The delegate's page: the hero across, then the squad and, beside it on a
   laptop (under it on a phone), who records, the match story and the venue.
   The live region (match_sync) holds the hero and the squad without a box
   of its own. */
.delegate-layout {
  display: grid;
  gap: var(--space-5);
}

.delegate-live {
  display: contents;
}

.delegate-lineup, .delegate-side {
  display: grid;
  align-content: start;
  gap: var(--space-5);
  min-width: 0;
}

.delegate-sheet .game-hero {
  margin-bottom: 0;
}

@media (min-width: 1000px) {
  .delegate-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .delegate-layout .game-hero { grid-column: 1 / -1; }
}

/* "Registar o jogo" wide, with when it opens under it while it can't be
   used yet; "Como chegar" a square beside it. */
.delegate-sheet .hero-actions {
  flex-wrap: wrap;
}

.delegate-sheet .hero-actions .hero-wide {
  flex: 1 1 12rem;
  flex-direction: column;
  min-height: 52px;
  line-height: 1.2;
}

.delegate-sheet .hero-actions .hero-wide small {
  font-size: .75rem;
  font-weight: 500;
}

.delegate-sheet .hero-actions .is-waiting {
  background: var(--navy-3);
  color: var(--on-navy-muted);
  cursor: default;
}

.delegate-sheet .hero-actions .hero-square {
  flex: 0 0 auto;
  width: 52px;
  min-height: 52px;
  padding: 0;
  justify-content: center;
}

/* A player: the shirt number in a navy disc (grey on the bench), the full
   name, the position at the end, all on one line. */
.squad-list .shirt-disc {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--yellow);
  font-size: .8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.squad-list .shirt-disc.is-bench {
  background: var(--surface-3);
  color: var(--ink);
}

.squad-list .row-item {
  flex-wrap: nowrap;
  padding-block: 9px;
}

.squad-list .row-item > .row-main {
  flex: 1 1 auto;
}

.squad-list .row-item > .row-aside {
  order: 0;
  flex-basis: auto;
  padding-left: 0;
  color: var(--muted);
  font-size: .75rem;
  letter-spacing: .04em;
}

.squad-list .row-title {
  font-weight: 400;
}

/* Who records the sheet and the staff: grey text on a white card. */
.delegate-note {
  margin: 0;
  padding: 14px var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: var(--text-small);
  line-height: 1.5;
}

.delegate-note p {
  margin: 0;
}

.delegate-note p + p {
  margin-top: 6px;
}

.delegate-note b {
  color: var(--ink);
}

/* ===== End of live recording and the delegate's game page ===== */

/* The shirt-number tiles: the number big, the name and the cards under it. */
.shirt-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: var(--space-2);
  max-height: 50vh;
  margin-bottom: var(--space-3);
  overflow: auto;
}

.shirt-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: var(--space-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.shirt-tile b {
  font-family: var(--display);
  font-size: 1.75rem;
  line-height: 1;
  color: var(--blue);
}

.shirt-tile small {
  max-width: 100%;
  overflow: hidden;
  font-size: var(--text-small);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shirt-tile[hidden] {
  display: none;
}

.shirt-tile:disabled {
  background: var(--surface-3);
  color: var(--muted);
  cursor: not-allowed;
}

.shirt-tile:disabled b {
  color: var(--muted);
}

.timeline-event .minute small {
  display: block;
  font-size: var(--text-small);
  font-weight: 400;
}

@media (max-width: 700px) {
  .moment-picker {
    width: 100%;
    max-width: 100%;
    max-height: 85vh;
    margin: auto 0 0;
    padding: 18px var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom));
    border-radius: 16px 16px 0 0;
  }
}

/* What is still to complete before the sheet closes, above its button. */
.finish-missing {
  margin-top: 0;
  margin-bottom: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius);
  background: var(--warn-bg);
  color: var(--warn);
  font-size: var(--text-body);
  font-weight: 700;
}

/* On a reopened sheet: "Editar" and "Remover" under each event. */
.event-corrections {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.event-corrections form {
  margin: 0;
}

/* After the sheet was first closed: the mark on each corrected event and
   the staff's history of the corrections. */
.correction-mark {
  display: block;
  color: var(--warn);
}

.corrections {
  margin: 0 22px var(--space-4);
  font-size: var(--text-small);
  color: var(--muted);
}

.corrections summary {
  min-height: var(--control-height);
  display: flex;
  align-items: center;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}

.corrections ol {
  margin: 0;
  padding-left: var(--space-4);
}

/* Training sessions use the same rows (training_sessions/_session): a
   cancelled one stays listed, struck through, so nobody turns up. */

/* Games list (matches/index, C-Jogos; prefix games-). The tabs with their
   counts and the team chips share one line over a rule; on a computer each
   week is a row of cards, one column per team under its competition, an
   outlined cell where a team has no game; on a phone a week is one list,
   soonest first. Upcoming games' dates are navy. */
.games-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin: 24px 0 0; border-bottom: 1px solid var(--line); }
.games-bar .tabs { margin: 0; border-bottom: 0; }
.games-bar .choice-chips { padding-bottom: var(--space-2); }
.games-bar .choice-chips a { min-height: 34px; padding: 0 14px; font-size: var(--text-label); }
.games-bar .choice-chips a.selected { box-shadow: none; }
.games-bar ~ .filter-chip { margin: var(--space-4) 0 0; }
.games-bar ~ .list-toolbar { margin: var(--space-4) 0 0; }
.games-add-short { display: none; }
.games-heads, .games-grid { display: grid; grid-template-columns: repeat(var(--games-cols), minmax(0, 1fr)); gap: 16px; }
.games-heads { margin: 20px 0 -8px; }
.games-head { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; padding: 0 4px; color: var(--muted); font-size: var(--text-small); }
.games-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.games-week { margin-top: 22px; }
.games-heads + .games-week { margin-top: 24px; }
.games-cell { display: flex; flex-direction: column; gap: 16px; min-width: 0; margin: 0; padding: 0; list-style: none; }
.games-card.row-item { gap: 14px; padding: 12px 18px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.games-card.row-item + .row-item { border-top: 0; }
.games-card .row-head { flex-wrap: nowrap; }
.games-card .row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; }
.games-needs { position: relative; z-index: 1; }
.games-card .games-needs { color: var(--ink); font-size: var(--text-small); font-weight: 600; line-height: 1.4; }
.games-needs a { color: inherit; }
.games-needs a:hover { color: var(--blue); }
.games-score { min-width: 64px; font-family: var(--display); font-size: 1.625rem; font-style: italic; font-weight: 400; line-height: 1; text-align: right; white-space: nowrap; }
.games-none { display: flex; flex: 1; align-items: center; min-height: 72px; padding: 12px 18px; border-radius: var(--radius-lg); box-shadow: inset 0 0 0 1px var(--line); color: var(--faint); font-size: var(--text-label); box-sizing: border-box; }
.games-end { margin: 18px 12px 0; color: var(--muted); font-size: var(--text-small); }
.games-notice { margin-top: 22px; }
.date-tile.upcoming { background: var(--navy); color: var(--on-navy); }
.date-tile.upcoming small { color: var(--yellow); }

@media (max-width: 700px) {
  .page-head:has(.games-add) { flex-direction: row; align-items: flex-end; justify-content: space-between; }
  .page-head:has(.games-add) .eyebrow { display: none; }
  .page-head:has(.games-add) .head-actions { width: auto; }
  .page-head:has(.games-add) .head-actions > * { flex: none; }
  .page-head .head-actions .games-add { width: auto; min-height: 40px; padding: 0 14px; }
  .games-add-long { display: none; }
  .games-add-short { display: inline; }
  .games-bar { flex-direction: column; align-items: stretch; gap: 14px; margin-top: 14px; border-bottom: 0; }
  .games-bar .tabs { border-bottom: 1px solid var(--line); }
  .games-bar .choice-chips { padding-bottom: 0; }
  .games-heads { display: none; }
  .games-week, .games-heads + .games-week { margin-top: 16px; }
  .games-week + .games-week { margin-top: 24px; }
  .games-grid { display: flex; flex-direction: column; gap: 0; overflow: hidden; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
  .games-cell { display: contents; }
  .games-none { display: none; }
  .games-card.row-item { flex-wrap: nowrap; gap: 12px; padding: 12px 16px; border-radius: 0; box-shadow: 0 -1px 0 var(--line-soft); }
  .games-card.row-item > svg { display: block; }
  .games-card .row-main { flex: 1 1 auto; }
}

/* The game form (matches/_panel): the training form's panel (.tform, in
   training.css) with the game's fields. On edit a grey line under the title
   says what can change. Two fields share a row on a computer (opponent and
   home or away, kickoff and meeting, pitch and competition, address and
   coordinates); on a phone each takes its own row. The hint under a pair
   sits close to it. On a phone the close button stays level with the title
   when the grey line follows it. */
.gform-lead { margin: 6px 0 0; }
.gform-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tform-body > .gform-hint { margin: -10px 0 0; }
.gform .tform-field [type=datetime-local]::-webkit-calendar-picker-indicator { opacity: 0; }
.gform-duration input { max-width: 160px; }
@media (max-width: 700px) {
  .gform .tform-head:has(.gform-lead) { align-items: flex-start; }
  .gform-pair { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .tform-body > .gform-hint { margin-top: -8px; }
}

/* A closed game's scoreboard on a phone (C-JogoTerminado-P): both names
   readable beside a bigger score, our crest small, the lines closer. */
@media (max-width: 700px) {
  .game-page .game-hero.is-scoreboard .game-hero-score { gap: 12px; margin-top: 12px; }
  .game-page .game-hero-side b { font-size: .9375rem; line-height: 1.25; }
  .game-page .game-hero-score .match-result { font-size: 3rem; }
  .game-page .game-hero-crest { margin-bottom: 4px; }
  .game-page .game-hero-crest :is(img, svg) { width: 24px; height: 24px; }
  .game-page .game-hero.is-scoreboard .game-hero-note { margin-top: 12px; }
}
