/* ------------------------------------------------------------------
   The twenty-round game: the circular timer, the round money panel,
   districts and grants, END ROUND, and the lobby's round clock.

   Loaded after menu.css, so it wins where the two overlap.
   ------------------------------------------------------------------ */

/* ------------------------------------------------- the circular timer */

.round-bar-main {
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 12px;
}

.round-timer {
  position: relative;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
}
.rt-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.rt-track { stroke: var(--line-soft); }
.rt-arc {
  stroke: var(--wheat);
  transition: stroke-dasharray 0.25s linear;
}
.round-timer.is-low .rt-arc { stroke: var(--danger); }
.round-timer.is-out .rt-arc,
.round-timer.is-counting .rt-arc { stroke: var(--river); }

.rt-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.round-clock {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}
.round-clock.is-low { color: var(--danger); }
.round-clock.is-counting { color: var(--river); letter-spacing: 0.1em; }

.round-bar-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.round-spend {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--wheat);
  font-variant-numeric: tabular-nums;
}
.round-moves-label {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.round-moves-label.is-ready { color: var(--river); }

.round-ready {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.round-ready:empty { display: none; }
.round-ready-count {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}
.round-ready-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.round-ready.is-all .round-ready-count,
.round-ready.is-all .round-ready-label { color: var(--river); }

/* ---------------------------------------------- the round money panel */

.g-money-panel { gap: 12px; }

.g-money-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.g-money-fig {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.g-money-fig-label {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.g-money-fig-value {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}
.g-money-fig.is-lead .g-money-fig-value {
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.1;
  color: var(--wheat);
}

.g-money-grants {
  appearance: none;
  border: 1px solid var(--wash-blue-2);
  border-radius: var(--radius-sm);
  background: var(--wash-blue);
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: left;
  font-family: var(--font);
  color: var(--cream);
  cursor: pointer;
}
.g-money-grants .g-money-fig-value { color: var(--river); }

.g-money-progress {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.g-money-track {
  height: 4px;
  border-radius: 2px;
  background: var(--ink-3);
  overflow: hidden;
}
.g-money-fill {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--wheat-deep);
}
.g-money-progress-note {
  font-size: 0.64rem;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------- districts, grants */

.g-grant-balance {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--river);
  font-variant-numeric: tabular-nums;
}

.g-districts {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.g-district {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: start;
  gap: 10px;
  padding: 8px 0 8px 10px;
  border-top: 1px solid var(--line-soft);
  border-left: 2px solid var(--line);
}
.g-district:first-child { border-top: 0; }
.g-district.is-held { border-left-color: var(--wheat); }
.g-district-name {
  font-size: 0.86rem;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/*
 * Whether the district is controlled sits under its name rather than beside
 * it, because the name is the thing being ellipsised and a status that gets
 * cut off is worse than no status at all.
 */
.g-district-state {
  display: block;
  margin-top: 2px;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--wheat);
}
.g-district-state.is-quiet {
  color: var(--muted-2);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: none;
}
.g-district-seats {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.g-district-grant {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--wheat);
  font-variant-numeric: tabular-nums;
}
.g-district-grant.is-quiet {
  color: var(--muted-2);
  font-weight: 500;
}

/* ------------------------------------------------------------ end round */

.g-end { padding: 6px 0 4px; }
.g-end:empty { display: none; }

.btn-end {
  width: 100%;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-2);
  padding: 13px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  font-family: var(--font);
  color: var(--cream);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.btn-end:hover {
  border-color: var(--wheat-deep);
  background: var(--ink-3);
}
.btn-end:focus-visible {
  outline: 2px solid var(--river);
  outline-offset: 2px;
}
.btn-end-title {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.btn-end-note {
  font-size: 0.66rem;
  color: var(--muted-2);
}

.g-ready {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  border: 1px solid var(--wash-blue-2);
  border-radius: var(--radius);
  background: var(--wash-blue);
}
.g-ready-tick {
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  color: var(--river);
}
.g-ready-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.g-ready-title {
  font-size: 0.86rem;
  font-weight: 700;
}
.g-ready-note {
  font-size: 0.7rem;
  color: var(--muted-2);
}

/* ------------------------------------------------ the lobby round clock */

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

.clock-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.clock-option {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--ink-2);
  padding: 11px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  font-family: var(--font);
  color: var(--cream);
  cursor: pointer;
}
.clock-option.is-active {
  border-color: var(--wheat);
  background: var(--wash-gold-2);
}
.clock-option-value {
  font-size: 0.95rem;
  font-weight: 700;
}
.clock-option-note {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.lobby-note {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
}

/* --------------------------------------------------------- rejoining */

.resume-link {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--ink-2);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  align-items: flex-start;
  font-family: var(--font);
  color: var(--cream);
  cursor: pointer;
  text-align: left;
}
.resume-link.is-rejoin {
  border-color: var(--wash-blue-2);
  background: var(--wash-blue);
}
.resume-title {
  font-size: 0.86rem;
  font-weight: 700;
}
.resume-note {
  font-size: 0.68rem;
  color: var(--muted-2);
}

/* -------------------------------------------------- sheet item detail */

.sheet-item-title { display: block; font-size: 0.9rem; font-weight: 600; }
.sheet-item-note {
  display: block;
  margin-top: 2px;
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--muted-2);
}
.sheet-text.is-quiet { color: var(--muted-2); font-size: 0.8rem; }

/*
 * What a move does, on the row that offers it.
 *
 * The corruption and bribe rows used to carry a four-line breakdown as well,
 * open on the list for every action whether anybody was considering it or
 * not. All four are worth knowing and none of them until you are deciding, so
 * they are lines on the confirmation now and the row says the one thing that
 * belongs on a list: what this move is for.
 */
.act-what {
  display: block;
  margin-top: 1px;
  font-size: 0.7rem;
  line-height: 1.35;
  color: var(--muted-2);
}

/* ------------------------------------------------------------------
   The lobby, in steps.

   Candidate, party, round length (host only), waiting room — the same order
   the solo screen asks in, because they are the same decisions. The sections
   are built once and shown one at a time, so the poll that repaints this
   screen every couple of seconds cannot take the caret out of a half-typed
   party name.
   ------------------------------------------------------------------ */

.lobby-steps { margin-bottom: 6px; }
.lobby-step[hidden] { display: none; }

.lobby-walk {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lobby-walk .btn-quiet[hidden] { display: none; }
