/* Rencontres */
.match-list {
  display: grid;
}

.match {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(0, 1.6fr) 150px 140px;
  align-items: center;
  gap: 4px 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.match:last-child {
  border-bottom: 0;
}

.match__team,
.match__opponent {
  display: grid;
}

.match__team span,
.match__opponent span {
  color: var(--mut);
  font-size: 14px;
}

.match__result {
  white-space: nowrap;
}

.match__score {
  color: var(--mut);
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
}

.match__sheet {
  font-size: 14.5px;
  font-weight: 600;
}

.result {
  font-weight: 700;
}

.result--victoire {
  color: var(--up);
}

.result--defaite {
  color: var(--down);
}

/* Feuille de match */
.match-sheet {
  display: grid;
  gap: 12px;
}

.match-sheet__title {
  font-size: 24px;
}

.match-sheet__score {
  font-size: 18px;
  font-weight: 700;
}

.game-list {
  display: grid;
}

.game {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 70px;
  align-items: center;
  gap: 4px 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.game__players {
  font-weight: 600;
}

.game__players span {
  color: var(--mut);
  font-weight: 400;
}

.game__sets {
  color: var(--mut);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.game__result {
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}

.game--won .game__result {
  color: var(--up);
}

.game--lost .game__result {
  color: var(--down);
}

.game--pending {
  opacity: 0.8;
}

.dialog {
  width: min(640px, calc(100% - 24px));
  max-height: calc(100% - 32px);
  padding: 22px;
  border: 0;
  border-radius: var(--radius-modal);
  background: var(--panel);
  color: var(--fg);
  box-shadow: 0 24px 60px var(--shadow);
}

.dialog::backdrop {
  background: var(--scrim);
}

.dialog[open] {
  animation: dialog-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.dialog__top {
  display: flex;
  justify-content: flex-end;
}

/* Joueurs */
.choices--inline .choices {
  display: flex;
  flex-wrap: wrap;
}

.choices--inline .choice {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
}

.player-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
}

.player-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
  text-decoration: none;
  transition: background-color 0.15s;
}

.player-row:hover {
  background: var(--soft);
}

.player-row__name {
  font-weight: 700;
}

.player-row__name span {
  font-weight: 400;
}

.player-row__details {
  grid-row: 2;
  color: var(--mut);
  font-size: 14px;
}

.player-row__points {
  grid-row: 1 / span 2;
  align-self: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.player-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 24px;
}

.key-values {
  display: grid;
  margin-bottom: 16px;
}

.key-values div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.key-values dt {
  color: var(--mut);
}

.key-values dd {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.is-up {
  color: var(--up);
}

.is-down {
  color: var(--down);
}

.points-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.points-chart__grid {
  stroke: var(--line);
}

.points-chart__label {
  fill: var(--mut);
  font-family: var(--font-body);
  font-size: 12px;
}

.points-chart__line {
  fill: none;
  stroke: var(--acc);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 1;
  animation: chart-draw 1.1s 0.1s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.points-chart__area {
  fill: var(--acc);
  opacity: 0.08;
}

.points-chart__end {
  fill: var(--ballc);
  stroke: var(--panel);
  stroke-width: 2;
}

@keyframes chart-draw {
  from {
    stroke-dashoffset: 1;
  }
}

.more-details {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.more-details summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--link);
  font-weight: 600;
  cursor: pointer;
}

/* Statistiques */
.progress-bars {
  display: grid;
  gap: 10px;
}

.progress-bars li {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(0, 1.4fr) 48px;
  align-items: center;
  gap: 12px;
}

.progress-bar {
  display: block;
  width: 100%;
  height: 10px;
}

.progress-bar__track {
  fill: var(--soft);
}

.progress-bar__fill {
  fill: var(--acc);
  transform-box: fill-box;
  transform-origin: left;
  animation: bar-grow 0.7s 0.15s var(--ease-out) both;
}

@keyframes bar-grow {
  from {
    transform: scaleX(0);
  }
}

.progress-bars__value {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}

.facts {
  display: grid;
}

.facts div {
  display: grid;
  gap: 2px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.facts dt {
  color: var(--mut);
  font-size: 14.5px;
}

.facts dd {
  font-size: 19px;
  font-weight: 700;
}

@media (max-width: 759.98px) {
  .match {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 12px;
  }

  .match__opponent {
    grid-row: 2;
    grid-column: 1 / -1;
  }

  .match__result {
    grid-row: 1;
    grid-column: 2;
    text-align: right;
  }

  .match__sheet {
    grid-column: 1 / -1;
  }

  .game {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .game__sets {
    grid-row: 2;
    grid-column: 1;
  }

  .player-list,
  .player-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .progress-bars li {
    grid-template-columns: minmax(0, 1fr) 48px;
  }

  .progress-bar {
    grid-row: 2;
    grid-column: 1 / -1;
  }

  .progress-bars__value {
    grid-row: 1;
    grid-column: 2;
  }
}
