/* Le Classement: five players a day, to put in order of one figure. The board, the verdict line
   (.feedback, .verdict-mark), the counter (.lives) and the buttons are shared (assets/styles.css, DESIGN.md). */

/* What to rank, in a night blue band, as Le Top 10: the figure in small, the competition and season
   in Anton, which way in gold. */
.rk-head {
  display: grid;
  gap: 4px;
  justify-items: center;
  margin-bottom: 18px;
  padding: 12px 14px 14px;
  text-align: center;
  background: var(--cover);
  color: var(--paper);
  border-bottom: 3px solid var(--gold);
}

.rk-stat {
  font-size: 13px;
  font-weight: 600;
  color: var(--sand);
}

.rk-what,
.rk-find {
  margin: 0;
  font-family: 'Anton', Impact, sans-serif;
  font-weight: 400;
  text-transform: uppercase;
}

.rk-what {
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.rk-find {
  font-size: 17px;
  letter-spacing: 0.03em;
  color: var(--gold);
}

/* The five places, from the first to the fifth. */
.rk-rows {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rk-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 6px 10px 6px 6px;
  text-align: left;
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--ink);
}

/* A row held on a phone selects no text and opens no menu: a selection left behind would take the
   next tap (« Valider » touched for nothing). No double-tap zoom either, between two quick taps. */
button.rk-row {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

@media (hover: hover) {
  button.rk-row:hover:not(.is-right) {
    background: color-mix(in srgb, var(--gold-soft) 45%, var(--card));
  }
}

/* Its rank, in Anton, on the night blue. */
.rk-rank {
  display: grid;
  place-items: center;
  height: 34px;
  font-family: 'Anton', Impact, sans-serif;
  font-size: 18px;
  background: var(--ink);
  color: var(--gold);
}

.rk-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.rk-name {
  font-family: 'Anton', Impact, sans-serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.rk-club {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}

/* The place picked first: a gold frame, as the cases picked at Le Onze and Les Buteurs. */
.rk-row.is-picked {
  background: var(--gold-soft);
  border-color: var(--gold);
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

/* The handle of a row still to place: three bars, held to drag the row (touch-action: none, so that
   the finger moves the row and not the page). Wide enough to be a 44 px target. */
.rk-grip {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  align-self: stretch;
  width: 44px;
  margin: -6px -10px -6px 0;
  cursor: grab;
  touch-action: none;
}

.rk-grip i {
  width: 20px;
  height: 3px;
  border-radius: 2px;
  background: var(--ink-soft);
}

/* While a row is dragged: it follows the pointer above the others, which make room for it. */
.rk-rows.is-sorting .rk-row {
  transition: transform 0.15s ease;
}

.rk-rows.is-sorting .rk-row.is-dragging {
  position: relative;
  z-index: 2;
  transition: none;
  cursor: grabbing;
  background: var(--gold-soft);
  border-color: var(--gold);
  box-shadow: var(--shadow-card);
}

.rk-rows.is-sorting .rk-row.is-dragging .rk-grip {
  cursor: grabbing;
}

/* A place right: green filet and ✓; it no longer moves. A place wrong at the end: red filet and ✘. */
.rk-row.is-right {
  border-left: 6px solid var(--green);
  cursor: default;
}

.rk-row.is-wrong {
  border-left: 6px solid var(--red-strong);
}

.rk-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  font-family: 'Anton', Impact, sans-serif;
  font-size: 16px;
  color: var(--paper);
  background: var(--green);
}

.rk-row.is-wrong .rk-mark {
  background: var(--red-strong);
}

/* After the game: the figure in a gold pill, then the mark. */
.rk-row:not(button) {
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
}

.rk-value {
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--gold);
  color: var(--ink);
}

/* Where the last try had a player put wrongly, in the red of a mistake. */
.rk-was {
  font-size: 12px;
  font-weight: 600;
  color: var(--red-strong);
}

.rk-list-title {
  margin: 0 0 10px;
}

/* How to play, then the verdict of the last try, under the places. */
.rk-note {
  min-height: 20px;
  margin: 16px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

.rk-note.has-verdict {
  font-size: 15px;
}

.rk-note.feedback--good {
  color: var(--green);
}

.rk-note.feedback--bad {
  color: var(--red-strong);
}

/* The tries left, and « Valider » on the right. */
.rk-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

@media (max-width: 560px) {
  .rk-row {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 8px;
    padding-right: 8px;
  }

  .rk-row:not(button) {
    grid-template-columns: 30px minmax(0, 1fr) auto auto;
  }

  .rk-rank {
    height: 30px;
    font-size: 16px;
  }

  .rk-name {
    font-size: 16px;
  }

  .rk-row:not(button) {
    gap: 6px;
  }

  .rk-value {
    padding: 3px 7px;
    font-size: 12px;
  }

  .rk-grip {
    margin-right: -8px;
  }

  .rk-mark {
    width: 22px;
    height: 22px;
    font-size: 14px;
  }

  .rk-what {
    font-size: 20px;
  }

  .rk-find {
    font-size: 15px;
  }
}
