/* /results -- monthly standings and honors. Sits on top of theme.css
   and landing.css, which already supply the page frame, the nav and the
   type scale; everything here is specific to a month block. Colours come
   from theme.css tokens, except the team dots, which are gameplay
   colours and are set inline by results.js the same way the map does. */

/* landing.css turns .landing-wrap into two columns above 900px, which
   is right for About's short independent panels and wrong here: a month
   is one tall block of a wide table plus a wide honors list, and multicol
   flowed the honors into the second column, outside the card that owns
   them. This page opts back out and narrows instead, so a month stays
   one unbroken card at a comfortable measure. break-inside is belt and
   braces for any future column context. */
.rs-wrap { max-width: 860px; }

@media (min-width: 900px) {
  .rs-wrap { column-count: 1; }
}

.rs-month { break-inside: avoid; }

.rs-board-toggle {
  display: flex;
  gap: 0;
  margin: 0 0 28px;
  border: 1px solid var(--mw-bronze);
  border-radius: 6px;
  overflow: hidden;
  width: fit-content;
}

.rs-board-btn {
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 8px 20px;
  background: transparent;
  color: var(--mw-gold);
  border: 0;
  cursor: pointer;
}

.rs-board-btn.active {
  background: var(--mw-bronze);
  color: var(--mw-gold-light);
}

.rs-board-btn:focus-visible {
  outline: 2px solid var(--mw-gold-light);
  outline-offset: -2px;
}

/* ---- one month ------------------------------------------------------ */
.rs-month {
  background: var(--mw-panel);
  border: 1px solid var(--mw-line);
  border-radius: 8px;
  padding: 20px 22px;
  margin-bottom: 24px;
}

.rs-month-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--mw-gold-light);
  margin: 0 0 4px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--mw-gold);
}


.rs-sub {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--mw-gold);
  margin: 22px 0 10px;
}

/* ---- standings ------------------------------------------------------ */
.rs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  /* Captures/Check-ins/Points are read down the column, so the digits
     have to line up rather than merely be right-aligned. */
  font-variant-numeric: tabular-nums;
}

.rs-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mw-text-6);
  padding: 0 10px 6px 0;
  border-bottom: 1px solid var(--mw-line);
}

.rs-table td {
  padding: 7px 10px 7px 0;
  border-bottom: 1px solid var(--mw-line);
}

.rs-table tr:last-child td { border-bottom: 0; }
.rs-num { text-align: right; padding-right: 0 !important; }
/* A numeric column's HEADER has to sit over its numbers. `.rs-table th`
   (0,1,1) outranks a bare `.rs-num` (0,1,0), so every numeric header
   stayed left-aligned above right-aligned values -- a gap as wide as the
   column, and glaring once a third number column with a long name
   (EXPLORATION) arrived. */
.rs-table th.rs-num { text-align: right; }
.rs-rank { color: var(--mw-text-6); width: 2rem; }
.rs-total { color: var(--mw-gold-light); font-weight: 700; }

.mc-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: baseline;
}

/* ---- honors --------------------------------------------------------- */
.rs-honors {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1px;
  background: var(--mw-line);   /* shows through as hairline rules between rows */
  border-radius: 4px;
  overflow: hidden;
}

.rs-honor {
  display: grid;
  grid-template-columns: minmax(9rem, 1.1fr) minmax(7rem, 1fr) auto;
  gap: 10px 16px;
  align-items: baseline;
  padding: 9px 12px;
  background: var(--mw-panel);
  font-size: 0.9375rem;
}

.rs-honor-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-weight: 700;
  color: var(--mw-gold-light);
  letter-spacing: 0.02em;
}

.rs-honor-who { color: var(--mw-text-1); }

.rs-scope {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--mw-text-6);
  white-space: nowrap;
}

/* What the number counts, under the award name. Deliberately quiet: it
   is there for the first read and should disappear on every one after. */
.rs-detail {
  font-weight: 400;
  letter-spacing: 0;
  color: var(--mw-text-6);
  font-size: 0.8125rem;
  line-height: 1.35;
}

.rs-honor-value {
  text-align: right;
  color: var(--mw-gold-light);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---- by team -------------------------------------------------------
   The per-team awards as one row per team instead of fourteen honor
   lines. Inherits .rs-table for the rules, the header type and the
   tabular figures; only the things a five-column table needs are set
   here, and only in tokens, so the neon skin follows for free. */
.rs-table-scroll {
  overflow-x: auto;
  /* A table that has to scroll should say so by being scrollable, not
     by dragging the whole page sideways on a phone. */
  -webkit-overflow-scrolling: touch;
}

.rs-team-table {
  /* Player names are the variable-width part; the two number columns
     stay narrow so the pairs read as name-then-count. */
  min-width: 30rem;
}

/* "Taken back" is two words in a column sized for three digits, and it
   wrapped, making the header row twice as tall as the standings one
   directly above. The column widens to hold it instead. */
.rs-team-table th { white-space: nowrap; }

.rs-team-table .rs-team-cell {
  color: var(--mw-gold-light);
  font-weight: 700;
  white-space: nowrap;
}

/* .rs-num zeroes its right padding because in the standings it is
   always the last column. Here one number column sits mid-table with a
   name after it, so the gap is given back -- except on the last cell,
   which keeps the flush right edge the standings table has. */
.rs-team-table .rs-num { width: 5.25rem; padding-right: 18px !important; }
.rs-team-table th:last-child.rs-num,
.rs-team-table td:last-child.rs-num { padding-right: 0 !important; }

/* A team that holds one award and not the other. Quiet on purpose: the
   dash is a stated absence, and should not compete with the names
   either side of it. */
.rs-team-table .rs-none { color: var(--mw-text-6); }

/* The one line about the month still being played. Sits above the
   finished months and reads as a note, not as a result -- no card, no
   panel, nothing that looks like a standing. */
.rs-open {
  color: var(--mw-gold-light);
  font-size: 0.9375rem;
  line-height: 1.5;
  margin: 0 0 22px;
  padding-left: 12px;
  border-left: 2px solid var(--mw-gold);
}

/* ---- the month in progress (preview hosts only) ---------------------
   Rendered only when app/config.py's results_preview_current_month is
   on, which it is not in production. The card has to read as unfinished
   at a glance so nobody quotes it as a result: a dashed border instead
   of the solid one a finished month gets, an accent-washed ground, and
   the state said in words as well as colour. Tokens only, so the neon
   skin gets it for free. */
.rs-month-preview {
  border-style: dashed;
  border-color: var(--mw-accent-wash-line);
  background: var(--mw-accent-deep);
}

.rs-preview-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mw-gold-light);
  background: var(--mw-accent-wash);
  border: 1px dashed var(--mw-accent-wash-line);
  border-radius: 4px;
  padding: 3px 8px;
  white-space: nowrap;
}

.rs-preview-note {
  color: var(--mw-text-4);
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 10px 0 0;
  padding-left: 12px;
  border-left: 2px dashed var(--mw-gold);
}

.rs-empty, .rs-loading {
  color: var(--mw-text-6);
  font-size: 0.9375rem;
  margin: 4px 0 0;
}

/* On a phone the three honor columns stop fitting side by side; stack
   them and let the detail sit under the name rather than squeezing all
   three into 320px. */
@media (max-width: 560px) {
  .rs-honor {
    grid-template-columns: 1fr auto;
  }
  .rs-honor-who { grid-column: 1; }
  .rs-honor-value { grid-column: 2; grid-row: 1; }
  .rs-month { padding: 16px 14px; }
}

/* An honor nobody won is listed rather than hidden, but must not read
   as loudly as one that was earned -- see results.js renderHonors. */
.rs-honor-none .rs-honor-name,
.rs-honor-none .rs-honor-who,
.rs-honor-none .rs-honor-value { color: var(--mw-text-5); }
.rs-honor-none .rs-honor-who { font-style: italic; }

/* An honor that can be shown on the map. Underlined on hover only, so a
   list of honors does not read as a list of links -- most of them are
   not. */
.rs-honor-link { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--mw-text-4); }
.rs-honor-link:hover,
.rs-honor-link:focus-visible { color: var(--mw-gold); border-bottom-color: currentColor; }

/* A By team row belongs to one team throughout, so the colour is carried
   once -- by the team cell and this edge -- rather than smeared across
   every name in the row. */
.rs-team-row .rs-team-cell {
  border-left: 3px solid var(--rs-team-edge, transparent);
  padding-left: 8px;
}
