/* Election night mode (assets/night.js): the locked-forecast banner, the
   certainty grades, the Result column and the tally. Colours are the tokens
   in app.css. */

.night-banner { background: var(--text); color: var(--bg); font-size: 14px; border-bottom: 1px solid var(--line); }
.night-banner .wrap { padding-top: 10px; padding-bottom: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.night-banner strong { display: inline-flex; align-items: center; gap: 6px; }
.night-banner.is-test { background: var(--banner-bg); color: var(--banner-ink); }
.night-test-tag { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 2px 6px; border: 1px solid currentColor; }
.night-exit, .night-reset { font: inherit; font-size: 13px; color: inherit; background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }

/* Certainty grades on the favourite */
.grade { display: inline-block; margin-left: 6px; padding: 1px 6px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border: 1px solid var(--line2); color: var(--muted); vertical-align: 1px; }
.grade-safe { background: var(--text); border-color: var(--text); color: var(--bg); }
.grade-likely { border-color: var(--text); color: var(--text); }
.grade-too_close { background: var(--toss); border-color: var(--toss-line); color: var(--toss-text); }

/* Result column */
.seat-table .night-col { padding: 0 10px; min-width: 210px; }
.night-th { display: block; padding: 10px 0; font-weight: 700; font-size: 13px; }
.night-pick-wrap { display: inline-flex; gap: 6px; align-items: center; }
.night-pick { font: inherit; font-size: 13px; height: 30px; padding: 0 6px; color: var(--text); background: var(--panel); border: 1px solid var(--line2); }
.night-lock { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; font: inherit; font-size: 13px; font-weight: 700;
  background: var(--btn-on-bg); color: var(--btn-on-ink); border: 1px solid var(--btn-on-bg); cursor: pointer; }
.night-lock:disabled { background: transparent; color: var(--muted); border-color: var(--line); cursor: default; }
.night-won { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px; background: var(--c); color: #fff; font-size: 13px; }
.night-verdict { margin-left: 8px; font-size: 12px; font-weight: 700; }
.night-verdict.is-right { color: var(--muted); }
.night-verdict.is-wrong { color: var(--alp-text); }
.night-undo { margin-left: 6px; width: 24px; height: 24px; font-size: 16px; line-height: 1; color: var(--muted); background: none; border: 1px solid var(--line); cursor: pointer; }
.night-undo:hover { color: var(--text); border-color: var(--text); }
.seat-table tr.night-done td.seat-name { color: var(--muted); }

/* Tally */
.night-panel { display: flex; flex-direction: column; gap: 20px; margin: 4px 0 28px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.night-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.night-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--c); }
.night-stat-name { font-size: 13px; font-weight: 600; color: var(--body); }
.night-stat b { font-size: 30px; line-height: 1.1; }
.night-chart { display: flex; flex-direction: column; gap: 10px; }
.night-row { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 12px; }
.night-row-label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.night-row-label small { display: block; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); }
.night-squares { position: relative; display: flex; gap: 2px; }
.night-sq { flex: 1 1 0; min-width: 0; height: 30px; border-radius: 2px; border: 1.5px solid var(--c); cursor: pointer; }
.night-sq.g-safe, .night-sq.g-won { background: var(--c); }
.night-sq.g-likely { background: color-mix(in srgb, var(--c) 60%, var(--panel)); }
.night-sq.g-favoured { background: color-mix(in srgb, var(--c) 25%, var(--panel)); }
.night-sq.g-too_close { border-color: var(--toss-line); background: repeating-linear-gradient(135deg, var(--c) 0 3px, var(--toss) 3px 7px); }
.night-sq.g-pending { border: 1.5px dashed var(--line2); background: transparent; }
.night-sq.is-upset { box-shadow: inset 0 -6px 0 var(--text); }
.night-mark { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: var(--text); pointer-events: none; }
.night-axis { position: relative; height: 18px; margin-left: 162px; }
.night-axis strong { position: absolute; font-size: 12px; white-space: nowrap; }
.night-axis .before { transform: translateX(-100%); padding-right: 6px; }
.night-axis .after { padding-left: 6px; }
.night-key { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); }
.night-key span { display: inline-flex; align-items: center; gap: 6px; }
.night-key .night-sq { flex: none; width: 14px; height: 18px; cursor: default; }
.night-close-box { display: flex; flex-direction: column; gap: 10px; }
.night-close-list { display: flex; flex-wrap: wrap; gap: 8px; }
.night-close { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: 13px; text-decoration: none;
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--c); }
.night-close .mono { color: var(--muted); font-size: 12px; }
.night-close-won { display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; background: var(--c); color: #fff; font-size: 12px; font-weight: 700; }

@media (max-width: 760px) {
  .night-row { grid-template-columns: 1fr; gap: 6px; }
  .night-axis { margin-left: 0; }
  .night-squares { gap: 1px; }
  .night-sq { height: 24px; border-width: 1px; border-radius: 1px; }
  .seat-table .night-col { min-width: 180px; }
}
