/* Stop log page (/coach/log): the blind-spots table, the filters and one
   card per stop or flag with its small boards (ui/miniboard.js draws
   them). */

body.page-coach-log { --mode: var(--mino-J); }

.log-main {
  width: min(1200px, 100%);
}

.log-body {
  display: grid;
  gap: 1.2rem;
}

.log-totals {
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
}

.log-notice p {
  margin: 0 0 0.8rem;
  color: var(--muted);
}

/* Blind spots */

.blind-spots .hint {
  margin: 0 0 0.7rem;
}

.blind-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-min);
  font-variant-numeric: tabular-nums;
}

.blind-table th {
  padding: 0 0.6rem 0.4rem 0;
  color: var(--muted);
  font-size: var(--text-min);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-align: left;
  text-transform: uppercase;
}

.blind-table td {
  padding: 0.35rem 0.6rem 0.35rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}

.blind-name strong {
  display: block;
  color: #fff;
}

.blind-name code {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-min);
}

.blind-table .num,
.blind-count {
  text-align: right;
}

.fit-svg svg,
.fit-inline svg {
  display: block;
}

.fit-inline {
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.5rem;
}

/* Filters */

.log-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.6rem 1rem;
  margin-bottom: 0.4rem;
}

.log-filters .panel-title {
  margin: 0 auto 0 0;
  align-self: center;
}

.log-filters .field {
  min-width: 11rem;
}

.log-filters .log-search {
  flex: 1 1 18rem;
}

.log-search input {
  width: 100%;
}

/* The end of the list: what is loading, or that there is no more. The
   page watches it to load the next rows, so it keeps a height when
   empty. */
.log-end {
  min-height: 1.2rem;
  margin: 0 0 0.6rem;
  text-align: center;
}

/* What the number under each board is: close under the filters, apart
   from the status line. */
.log-score-hint {
  margin: 0.2rem 0 0.45rem;
}

.fit-filter {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  color: var(--muted);
  font-size: var(--text-min);
}

/* Stop cards: head row, boards, then the text, the Practice link and the
   verdict. A flag's card has its board at the flag and his note. */

.stop-list {
  display: grid;
  gap: 0.8rem;
  margin: 0.6rem 0 1rem;
  padding: 0;
  list-style: none;
}

.stop-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "head head"
    "boards body";
  gap: 0.6rem 1.2rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0) 50%),
    linear-gradient(180deg, #1a1b20, #141518);
  box-shadow: var(--shadow-panel);
}

.stop-head {
  grid-area: head;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.8rem;
}

.stop-piece {
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 0.35rem;
  background: var(--piece-c);
  color: #fff;
  font-weight: 900;
}

.stop-problem {
  color: #fff;
}

.stop-when,
.stop-id {
  color: var(--muted);
  font-size: var(--text-min);
}

.stop-id {
  font-variant-numeric: tabular-nums;
}

.stop-outcome {
  margin-left: auto;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--mode-line);
  border-radius: 999px;
  color: var(--accent);
  font-size: var(--text-min);
}

.stop-verdict-badge {
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: var(--text-min);
  font-weight: 700;
}

/* The badge names the board he picked as best. */
.stop-card:not([data-verdict="none"]) .stop-verdict-badge {
  background: rgba(134, 239, 172, 0.14);
  color: #86efac;
}

.stop-card[data-outcome="first-try"] .stop-outcome { color: #86efac; }
.stop-card[data-outcome="skipped"] .stop-outcome { color: var(--muted); }

/* A flag: he marked it himself, so it is set off in amber. */
.flag-card {
  border-left: 3px solid #fbbf24;
}

.flag-card .flag-badge {
  border-color: rgba(251, 191, 36, 0.45);
  color: #fbbf24;
}

.stop-boards {
  grid-area: boards;
  display: flex;
  gap: 0.6rem;
}

/* As wide as its board: a long caption, the names of boards shown as
   one, wraps under it. */
.stop-board {
  width: min-content;
  margin: 0;
}

.stop-board svg {
  display: block;
}

/* How far the board is behind the best of the three, when he replayed it. */
.stop-board-score {
  margin: 0.1rem 0 0;
  color: var(--text);
  font-size: var(--text-min);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stop-board figcaption {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: var(--text-min);
  text-align: center;
}

/* "Coach T's" in a caption stays on one line. */
.stop-board .coach-nowrap {
  white-space: nowrap;
}

.stop-body {
  grid-area: body;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.stop-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
}

.stop-style {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-min);
}

/* Verdict: two toggle buttons and a note. */

.stop-verdict {
  display: grid;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.2rem;
}

.verdict-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.verdict-buttons .btn[aria-pressed="true"] {
  border-color: #86efac;
  background: rgba(134, 239, 172, 0.18);
  color: #86efac;
}

.verdict-note {
  box-sizing: border-box;
  width: 100%;
  max-width: 34rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  font: inherit;
  font-size: var(--text-min);
  resize: vertical;
}

@media (max-width: 760px) {
  .log-filters .field {
    flex: 1 1 100%;
  }

  .stop-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "head" "boards" "body";
  }

  .stop-boards {
    overflow-x: auto;
  }
}
