/* ─── Judge page: reuses /css/admin.css for login/nav/stats + photo popup ─── */

/* Top stats: 2 boxes desktop, stack on phones */
.judge-stats-row {
  display: grid;
  /* One tile now — full width rather than stranded in a half column. */
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: stretch;
}

.judge-stats-row .stat-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Both stat numbers read at the same light weight — the Left-to-Judge one sits
   in a <button>, which was inheriting a heavier weight than Cars Registered. */
.judge-stats-row .stat-num { font-weight: 400; }

.stat-card--btn {
  background: var(--bg-card);
  border: 1px solid var(--primary-border);
  color: inherit;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: border-color 0.15s, transform 0.1s;
  padding: 1.25rem 1.5rem;
  border-radius: 0;
}
.stat-card--btn:hover { border-color: var(--accent); }
.stat-card--btn:active { transform: scale(0.98); }
.stat-card--btn:focus-visible { outline: 2px solid rgba(var(--accent-rgb, 88, 160, 216), 0.4); outline-offset: 2px; }

@media (max-width: 480px) {
  .judge-stats-row { grid-template-columns: 1fr; }
}

/* Your assignment — the classes / clubs this judge owns, named above the
   count. Left accent rule so it reads as a standing fact about the judge,
   not another stat tile; wraps to its own line on a phone. */
.judge-assignment {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 0;
  padding: 0.85rem 1.1rem;
  margin-bottom: 1rem;
  display: grid;
  gap: 0.35rem;
}
.judge-assignment.hidden { display: none; }
.judge-assignment-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.5rem;
  min-width: 0;
}
.judge-assignment-label {
  font-family: var(--font-label);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink, var(--accent));
}
.judge-assignment-value {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.judge-card {
  background: var(--bg-card);
  border: 1px solid rgba(var(--accent-rgb, 88, 160, 216), 0.2);
  border-radius: 0;
  padding: 1.5rem;
  min-width: 0;
  overflow: hidden;
  cursor: grab;
  transition: transform 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}
.judge-card:active { cursor: grabbing; }
.judge-card.dragging {
  opacity: 0.92;
  border-color: var(--primary, var(--accent));
  box-shadow: 0 12px 40px rgba(var(--accent-rgb, 88, 160, 216), 0.35);
  position: relative;
  z-index: var(--z-float);
  transition: none;
  user-select: none;
  touch-action: none;
}
/* Inputs / selects / buttons inside a card shouldn't inherit the grab cursor */
.judge-card input,
.judge-card select,
.judge-card button,
.judge-card a,
.judge-card textarea {
  cursor: auto;
}
.judge-card button,
.judge-card a { cursor: pointer; }
.judge-card,
.judge-card-body {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.judge-card-label {
  font-family: var(--font-label);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.judge-card-body { color: var(--text-primary); }

.judge-empty {
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
}

/* ── Checkered flag — shown once per show, when every car is scored. ──
   A pure-CSS checkered band (no assets) over the same square, stamped
   language as the rest of the system. The band sweeps in once; under
   reduced motion it simply appears. */
.judge-finish {
  text-align: center;
  padding: 2.25rem 1rem 1.5rem;
}
.judge-finish-flag {
  width: min(260px, 70%);
  height: 28px;
  margin: 0 auto 1.25rem;
  background:
    repeating-conic-gradient(var(--text-primary) 0% 25%, transparent 0% 50%)
    0 0 / 28px 28px;
  border: 1px solid var(--border-mid);
  animation: judge-flag-in 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.judge-finish-title {
  font-family: var(--font-label);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 0 0 0.4rem;
}
.judge-finish-sub {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0 auto;
  max-width: 38ch;
  line-height: 1.5;
}
@keyframes judge-flag-in {
  from { opacity: 0; transform: scaleX(0.6); }
}
@media (prefers-reduced-motion: reduce) {
  .judge-finish-flag { animation: none; }
}

.roster-section-label {
  font-family: var(--font-label);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  margin: 0 0 0.75rem 0;
}

/* ─── Roster table (mirrors the /admin table styling) ─────── */
.roster-table .col-regnum {
  width: 3rem;
  color: var(--accent);
  font-family: var(--font-label);
  font-size: 0.92rem;
  white-space: nowrap;
  padding-right: 0.35rem;
}

.roster-table .col-photo {
  width: 88px;
  padding: 0.4rem 0.6rem;
}

/* Desktop columns. Below 760px these same cells become the card the admin
   roster uses on a phone, so each field is a real labelled cell. */
.roster-table .col-owner { color: var(--text-primary); white-space: normal; padding-left: 1.5rem; }
.roster-table .col-vehicle { color: var(--text-secondary); white-space: normal; }
.roster-table .col-club { color: var(--text-muted); white-space: normal; }
.roster-table .veh-color { color: var(--text-muted); }
.roster-table .cell-dash { color: var(--text-muted); }
.roster-table .col-class-text {
  color: var(--accent);
  font-family: var(--font-label);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
/* The button is the card's action; on a laptop the whole row is clickable
   and the column would just be dead width. Mirrors admin's .btn-judge-car. */
.roster-table .col-actions { display: none; }

.col-class { min-width: 180px; }

.class-select {
  width: 100%;
  background: var(--bg-inset);
  color: var(--text-primary);
  border: 1px solid rgba(var(--accent-rgb, 88, 160, 216), 0.3);
  border-radius: 0;
  padding: 0.4rem 0.5rem;
  min-height: 44px;
  font-size: 0.92rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s;
}
.class-select:hover { border-color: var(--accent); }
.class-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb, 88, 160, 216), 0.2);
}
.class-select:disabled {
  opacity: 0.6;
  cursor: wait;
}

.class-save-status {
  display: block;
  font-size: 0.78rem;
  margin-top: 0.2rem;
  min-height: 0.9rem;
  letter-spacing: 0.05em;
}
.class-save-status.saving { color: var(--warning); }
.class-save-status.saved  { color: var(--accent); }
.class-save-status.error  { color: var(--error); }

.roster-thumb {
  width: 64px;
  height: 64px;
  padding: 0;
  border: 1px solid rgba(var(--accent-rgb, 88, 160, 216), 0.3);
  border-radius: 0;
  overflow: hidden;
  background: var(--bg-inset);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, border-color 0.15s;
}

.roster-thumb:hover,
.roster-thumb:focus {
  transform: scale(1.06);
  border-color: var(--accent);
  outline: none;
}

.roster-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.roster-thumb--empty {
  color: var(--text-muted);
  cursor: default;
  font-family: var(--font-label);
  font-size: 0.98rem;
}
.roster-thumb--empty:hover {
  transform: none;
  border-color: rgba(var(--accent-rgb, 88, 160, 216), 0.3);
}

/* Floating popup image fills the JS-sized box at natural aspect ratio */
.vehicle-photo-popup img {
  height: 100% !important;
  object-fit: contain;
}

/* Whole row is now a tap target; keep the pointer cursor and stop the thumb
 * from capturing clicks so the row handler runs on any part of the row. */
.roster-row { cursor: pointer; }
/* The row is the judge's only path to scoring a car, so it has to clear the
 * >=48px field minimum. admin.css's 0.7rem cell padding renders it at 38.4px,
 * too small for a thumb in motion, and 0.83rem data reads as haze in sunlight.
 * Scoped to the roster so the dense operator tables keep their size. */
.roster-table .roster-row td { padding: 0.95rem 0.75rem; font-size: 0.95rem; line-height: 1.4; }
/* A mouse click shouldn't paint a ring, but keyboard and switch users need a
 * visible one. The old rgba(...,0.4) fill measured 1.18:1 in the browser once
 * admin-kinetic overrode it with --accent-glow; derived ink is 5.67:1 at the
 * stock accent and follows the show colour. */
.roster-row:focus { outline: none; }
.roster-table .roster-row:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: -3px; }
.roster-row .roster-thumb { pointer-events: none; }

/* Tapping a row is a full page navigation. On venue LTE that is a dead second
 * with no visual change, so the judge taps again and can land on the wrong
 * car. Mark the row on the way out. Two classes deep to outrank tr:hover. */
.roster-table .roster-row--pending { background: var(--accent-dim); opacity: 0.55; }

/* ─── Judge modal (phone-first full-screen card) ─────── */
.judge-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.judge-modal.hidden { display: none; }

.judge-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.judge-modal-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid rgba(var(--accent-rgb, 88, 160, 216), 0.4);
  border-radius: 0;
  padding: 1.75rem 1.25rem 1.5rem;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.judge-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.6rem;
  border-radius: 0;
}
.judge-modal-close:hover { color: var(--text-primary); background: rgba(0,0,0,0.05); }

.judge-modal-qr {
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-card);
  padding: 12px;
  border-radius: 0;
  margin: 0 auto 1rem;
  width: fit-content;
}
.judge-modal-qr canvas,
.judge-modal-qr img { display: block; }

.judge-modal-photo {
  margin: 0 0 1rem 0;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb, 88, 160, 216), 0.25);
  background: var(--bg-inset);
  max-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.judge-modal-photo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: contain;
}

.judge-modal-info { color: var(--text-primary); }
.judge-modal-name {
  font-family: var(--font-label);
  font-size: 1.3rem;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  margin: 0 0 0.35rem 0;
}
.judge-modal-car {
  color: var(--text-secondary);
  font-size: 1rem;
  margin: 0 0 0.75rem 0;
}
.judge-modal-class {
  display: inline-block;
  background: rgba(var(--accent-rgb, 88, 160, 216), 0.1);
  border: 1px solid rgba(var(--accent-rgb, 88, 160, 216), 0.35);
  color: var(--accent);
  font-family: var(--font-label);
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  padding: 0.4rem 0.8rem;
  border-radius: 0;
  margin: 0;
}

.manual-lookup {
  max-width: 380px;
  margin: 0 auto 1.5rem;
}
.manual-lookup-label {
  display: block;
  font-family: var(--font-label);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.manual-lookup-row {
  display: flex;
  gap: 0.5rem;
}
.manual-lookup-row input {
  flex: 1;
  background: var(--input-bg, var(--bg-card));
  border: 1px solid var(--border-mid);
  color: var(--text-primary);
  padding: 0.85rem 1rem;
  min-height: 48px;
  border-radius: 0;
  font-family: inherit;
  font-size: 1rem;
}
.manual-lookup-row input:focus {
  outline: none;
  border-color: var(--accent);
}
.manual-lookup-btn {
  background: var(--accent);
  color: var(--on-accent, #0D0D12);
  border: none;
  border-radius: 0;
  padding: 0 1.1rem;
  min-height: 48px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.manual-lookup-btn:hover  { filter: brightness(1.08); }
.manual-lookup-btn:active { transform: scale(0.98); }
.manual-lookup-error {
  color: var(--error);
  font-size: 0.92rem;
  margin: 0.45rem 0 0;
}

.judge-modal-open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.25rem;
  padding: 0.75rem 1.4rem;
  min-height: 48px;
  background: var(--accent);
  color: var(--on-accent, #0D0D12);
  border-radius: 0;
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  font-weight: 600;
  transition: transform 0.1s ease, filter 0.15s ease;
}
.judge-modal-open-btn:hover  { filter: brightness(1.08); }
.judge-modal-open-btn:active { transform: scale(0.98); }

.judge-modal-open-hint {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-label);
  letter-spacing: 0.05em;
}

/* On small phones the QR gets a touch smaller so everything fits above the fold */
@media (max-width: 480px) {
  .judge-modal-card { padding: 1.5rem 1rem 1.25rem; }
  .judge-modal-qr { padding: 10px; }
  .judge-modal-photo { max-height: 200px; }
  .judge-modal-photo img { max-height: 200px; }
}

/* ── Roster as CARDS on phones ─────────────────────────────────────────────
 * Deliberately the same card the admin registrations roster becomes below
 * 760px (admin-kinetic.css "Roster cards"): entry number as the headline,
 * name and vehicle full width, club and class paired, action last. Judged,
 * Registered and Free Entry are organizer bookkeeping and are not rendered
 * here at all. Keeping the two in step means a judge who has seen one roster
 * already knows this one. */
@media (max-width: 760px) {
  .roster-table, .roster-table tbody { display: block; width: 100%; }
  .roster-table thead { display: none; } /* labels move onto each cell */
  .roster-table tr.roster-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 0.9rem; row-gap: 0.15rem;
    background: var(--bg-card);
    border: 1px solid var(--border-mid);
    padding: 0.7rem 0.9rem 0.8rem;
    margin-bottom: 0.6rem;
  }
  .roster-table tr.roster-row--pending { background: var(--accent-dim); }
  /* Same specificity as the desktop 48px row rule above, later in the file,
     so the card gets admin's tight rhythm instead of table padding. */
  .roster-table .roster-row td { padding: 0.2rem 0; font-size: 0.95rem; line-height: 1.35; }
  .roster-table td {
    display: block;
    padding: 0.2rem 0;
    border: none;
    text-align: left !important;
    white-space: normal !important;
    overflow-wrap: anywhere; /* long club names wrap instead of overflowing */
    font-size: 0.95rem;
  }
  .roster-table td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-label); font-weight: 700;
    font-size: 0.58rem; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--text-muted);
  }
  /* Headline: the number the judge matches to a windshield, on one line so
     "#129" can't break into "#1 / 29". */
  .roster-table td.col-regnum {
    grid-column: 1 / -1;
    white-space: nowrap !important;
    font-family: var(--font-wordmark);
    font-size: 1.45rem; line-height: 1;
    color: var(--text-primary);
    padding: 0 0 0.45rem; margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--border-mid);
  }
  .roster-table td.col-regnum::before { display: none; }
  .roster-table td.col-owner { grid-column: 1 / -1; font-size: 1.05rem; font-weight: 700; }
  /* Colour rides beside the vehicle rather than under it. */
  .roster-table td.col-vehicle { grid-column: 1 / -1; }
  .roster-table td.col-vehicle br { display: none; }
  .roster-table td.col-vehicle .veh-color { margin-left: 0.4rem; }
  /* Car Club | Class share a row. */
  .roster-table td.col-club,
  .roster-table td.col-class-text { grid-column: auto; min-width: 0; }
  /* The action, full width and thumb-sized. Same treatment as the admin
     roster's "Judge this car". */
  .roster-table td.col-actions { display: block; grid-column: 1 / -1; padding-top: 0.55rem; }
  .roster-table td.col-actions::before { display: none; }
  .roster-table .btn-judge-car {
    display: flex; align-items: center; justify-content: center;
    width: 100%; min-height: 48px; /* field tap target */
    background: var(--accent); color: var(--on-accent, #0D0D12);
    border: 1px solid var(--accent);
    font-family: var(--font-label); font-weight: 700;
    font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase;
    text-decoration: none;
  }
  .roster-table .btn-judge-car:active { background: var(--accent-hover); }
}

/* ─── Shared award cards (used by /admin to show farthest + top clubs) ─── */
.judge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-top: -0.5rem;
  margin-bottom: 2rem;
}
@media (max-width: 760px) {
  .judge-grid { grid-template-columns: 1fr; gap: 1rem; }
}

.farthest-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
}
.farthest-row.has-photo {
  flex-direction: row;
  align-items: flex-start;
}
.farthest-photo {
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb, 88, 160, 216), 0.25);
  background: var(--bg-inset);
  display: flex;
  align-items: center;
  justify-content: center;
}
.farthest-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.farthest-info { flex: 1 1 auto; min-width: 0; }
@media (max-width: 640px) {
  .farthest-row.has-photo { flex-direction: row; align-items: center; }
  .farthest-photo { width: 80px; height: 80px; }
}

.farthest-name {
  font-family: var(--font-label);
  font-size: 1.05rem;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  margin: 0 0 0.25rem 0;
  line-height: 1.2;
}
.farthest-vehicle {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin: 0 0 0.45rem 0;
}
.farthest-distance {
  display: inline-block;
  background: rgba(var(--accent-rgb, 88, 160, 216), 0.1);
  border: 1px solid rgba(var(--accent-rgb, 88, 160, 216), 0.35);
  color: var(--accent);
  padding: 0.3rem 0.65rem;
  border-radius: 0;
  font-family: var(--font-label);
  font-size: 0.92rem;
  letter-spacing: 0.05em;
}
.farthest-origin {
  display: block;
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 0.6rem;
  letter-spacing: 0.04em;
}

.club-list { list-style: none; padding: 0; margin: 0; }
.club-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.club-item:last-child { border-bottom: none; }
.club-rank {
  font-family: var(--font-label);
  font-size: 0.92rem;
  color: var(--accent);
  width: 1.75rem;
  flex-shrink: 0;
}
.club-name {
  flex: 1;
  color: var(--text-primary);
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.club-count {
  font-family: var(--font-label);
  font-size: 0.98rem;
  color: var(--text-secondary);
  background: rgba(var(--accent-rgb, 88, 160, 216), 0.08);
  padding: 0.2rem 0.6rem;
  border-radius: 0;
  /* "88.0 avg · 3 cars" is a lot longer than the old "+264" — the club name
     beside it ellipsises, this pill shouldn't break across two lines. */
  white-space: nowrap;
}

/* One club, one club trophy: the club that takes Club Participation keeps
   its place in the Club Quality ranking but can't win it, so its row reads
   as context rather than as the winner. */
.club-item--ineligible .club-rank,
.club-item--ineligible .club-name,
.club-item--ineligible .club-count { opacity: 0.55; }
/* The note takes its own line under the row instead of competing with the
   club name for width — inline, it squeezed a long name down to one
   letter on a narrow card. */
.club-item--ineligible { flex-wrap: wrap; }
.club-name-note {
  order: 5; flex: 0 0 100%;
  margin: 0.1rem 0 0 1.75rem;
  font-family: var(--font-label); font-weight: 700;
  font-size: 0.62rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted);
}

.club-item--clickable {
  cursor: pointer;
  transition: background 0.12s;
  border-radius: 0;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}
.club-item--clickable:hover {
  background: rgba(var(--accent-rgb, 88, 160, 216), 0.07);
}

.club-modal-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  margin: 0 0 0.75rem;
  font-family: var(--font-label);
}
.club-member-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 360px;
  overflow-y: auto;
}
.club-member-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.25rem;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.club-member-row:last-child { border-bottom: none; }
.club-member-name {
  font-family: var(--font-label);
  font-size: 0.92rem;
  color: var(--text-primary);
  letter-spacing: 0.03em;
}
.club-member-car {
  color: var(--text-secondary);
  font-size: 0.92rem;
  text-align: right;
}
.club-member-empty {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.92rem;
  padding: 0.5rem 0.25rem;
}

/* ─── Registration heatmap (Mapbox GL JS) ─── */
.heatmap-card { grid-column: span 1; }

.heatmap-map-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb, 88, 160, 216), 0.25);
  background: var(--bg-card);
}
.heatmap-map { width: 100%; height: 100%; display: block; object-fit: cover; }

.heatmap-dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.heatmap-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  pointer-events: auto;
  cursor: default;
}
.heatmap-dot-inner {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  /* Layered heat bloom: tight ring + two soft orange halos. Markers stack at
     the same pixel in dense metros, so the halos add up and those areas glow
     hotter — the same intensity feel as the landing map's heat blooms. */
  box-shadow:
    0 0 0 2px rgba(var(--accent-rgb, 88, 160, 216), 0.4),
    0 0 12px 4px rgba(var(--accent-rgb, 88, 160, 216), 0.7),
    0 0 26px 10px rgba(var(--accent-rgb, 88, 160, 216), 0.35);
  transform-origin: center;
  animation: heatmap-throb 2.4s ease-in-out infinite;
  z-index: 2;
}
@keyframes heatmap-throb {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.16); }
}
@media (prefers-reduced-motion: reduce) {
  .heatmap-dot-inner { animation: none; }
}
.heatmap-dot::before,
.heatmap-dot::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb, 88, 160, 216), 0.35);
  animation: heatmap-pulse 2.2s ease-out infinite;
}
.heatmap-dot::after { animation-delay: 1.1s; }
@keyframes heatmap-pulse {
  0%   { transform: scale(1);   opacity: 0.7; }
  80%  { transform: scale(3.2); opacity: 0;   }
  100% { transform: scale(3.2); opacity: 0;   }
}
@media (prefers-reduced-motion: reduce) {
  .heatmap-dot::before,
  .heatmap-dot::after { animation: none; }
}

.heatmap-controls {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.heatmap-btn {
  width: 44px;
  height: 44px;
  border-radius: 0;
  border: 1px solid rgba(var(--accent-rgb, 88, 160, 216), 0.35);
  background: var(--bg-card);
  color: var(--accent);
  font-family: var(--font-label);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.heatmap-btn:hover {
  background: rgba(var(--accent-rgb, 88, 160, 216), 0.15);
  border-color: var(--accent);
}
.heatmap-btn--fit { font-size: 1.4rem; }

.heatmap-zoom-badge {
  margin-left: auto;
  padding: 0.1rem 0.4rem;
  background: rgba(var(--accent-rgb, 88, 160, 216), 0.08);
  color: var(--accent);
  border-radius: 0;
  font-size: 0.78rem;
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-label);
  letter-spacing: 0.04em;
  margin: 0.5rem 0 0;
}
.heatmap-dot-legend {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb, 88, 160, 216), 0.35);
  display: inline-block;
}

/* ─── Registrations over time card ─── */
.timeline-body { padding: 0; }
.timeline-svg {
  width: 100%;
  height: 190px;
  display: block;
}
.timeline-grid {
  stroke: rgba(0,0,0,0.06);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}
.timeline-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  filter: drop-shadow(0 0 4px rgba(var(--accent-rgb, 88, 160, 216), 0.55));
}
.timeline-dot {
  fill: var(--accent);
  stroke: var(--bg-card-alt);
  stroke-width: 1.5;
}
.timeline-axis-label {
  fill: var(--text-muted);
  font-family: var(--font-label);
  font-size: 8px;
  letter-spacing: 0.04em;
}
.timeline-summary {
  display: flex;
  justify-content: space-around;
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(var(--accent-rgb, 88, 160, 216), 0.12);
}
.timeline-stat { text-align: center; }
.timeline-stat-num {
  display: block;
  font-family: var(--font-label);
  font-size: 1.25rem;
  color: var(--accent);
  font-weight: 700;
  line-height: 1.1;
}
.timeline-stat-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 0.25rem;
}

/* ─── People's Choice card ─── */
.peoples-choice-body .pc-row-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.pc-row-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.pc-row-item:last-child { border-bottom: none; }
.pc-row-item--leader .pc-row-name { color: var(--accent); }
.pc-row-rank {
  font-family: var(--font-label);
  font-size: 0.92rem;
  color: var(--text-muted);
  text-align: right;
}
.pc-row-main { display: block; min-width: 0; }
.pc-row-name {
  display: block;
  color: var(--text-primary);
  font-size: 0.98rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pc-row-sub {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pc-row-votes {
  font-family: var(--font-label);
  color: var(--accent);
  font-size: 1rem;
  font-weight: 700;
}
.pc-row-total {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-label);
  letter-spacing: 0.05em;
  text-align: right;
}

/* ─── Specialty Awards dashboard card ─── */
.specialty-awards-body {
  /* Shows ~5 rows comfortably; anything beyond scrolls inside the tile.
     Custom teal scrollbar so it's obvious there's more to see. */
  max-height: 280px;
  overflow-y: auto;
  padding-right: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb, 88, 160, 216), 0.6) rgba(0, 0, 0, 0.25);
}
.specialty-awards-body::-webkit-scrollbar {
  width: 8px;
}
.specialty-awards-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 0;
}
.specialty-awards-body::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-rgb, 88, 160, 216), 0.55);
  border-radius: 0;
}
.specialty-awards-body::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--accent-rgb, 88, 160, 216), 0.85);
}
.sa-list { list-style: none; padding: 0; margin: 0; }
.sa-item {
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.sa-item:last-child { border-bottom: none; }
.sa-btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: inherit;
  text-align: left;
  padding: 0.55rem 0.25rem;
  min-height: 44px;
  cursor: pointer;
  border-radius: 0;
  transition: background 0.1s ease;
}
.sa-btn:hover { background: rgba(var(--accent-rgb, 88, 160, 216), 0.05); }
.sa-winner {
  display: block;
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.25;
}
.sa-winner--empty {
  color: var(--text-muted);
  font-style: italic;
  font-family: inherit;
  font-size: 0.92rem;
}
.sa-name {
  display: block;
  color: var(--accent);
  font-size: 0.85rem;
  margin-top: 0.2rem;
  font-family: var(--font-label);
  letter-spacing: 0.05em;
}

/* ─── Hardship awards card ─── */
.hardship-list-body {
  max-height: 150px;
  overflow-y: auto;
  padding-right: 0.25rem;
}
.hardship-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.hardship-list-item {
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.hardship-list-item:last-child { border-bottom: none; }
.hardship-list-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 0.55rem 0.25rem;
  min-height: 44px;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.hardship-list-btn:hover { background: rgba(var(--accent-rgb, 88, 160, 216), 0.05); }
.hardship-list-item--winner .hardship-list-name {
  color: var(--accent);
}
.hardship-list-item--winner .hardship-list-btn {
  background: rgba(var(--accent-rgb, 88, 160, 216), 0.06);
}
.hardship-list-name {
  display: block;
  font-family: var(--font-label);
  font-size: 0.92rem;
  color: var(--text-primary);
  letter-spacing: 0.03em;
}
.hardship-list-snippet {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hardship-modal-vehicle {
  color: var(--text-secondary);
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
}
.hardship-modal-text {
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.55;
  background: var(--bg-inset);
  border: 1px solid rgba(var(--accent-rgb, 88, 160, 216), 0.2);
  border-radius: 0;
  padding: 0.75rem 0.9rem;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0 0 0.75rem;
}
.hardship-modal-meta {
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-align: right;
  margin: 0;
}

/* ─── Nav link back to /admin ──────────────────────────── */
.admin-nav-link {
  color: rgba(var(--accent-rgb, 88, 160, 216), 0.75);
  font-family: var(--font-label);
  font-size: 0.92rem;
  text-decoration: none;
  letter-spacing: 0.08em;
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0.4rem 0.75rem;
  border: 1px solid rgba(var(--accent-rgb, 88, 160, 216), 0.25);
  border-radius: 0;
  transition: all 0.2s;
}
.admin-nav-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ─── Specialty awards (judge sets the winning car #) ─────── */
.specialty-section { margin-top: 1.75rem; }
.specialty-awards { display: flex; flex-direction: column; gap: 0.6rem; }
.specialty-award {
  border: 1px solid var(--border);
  background: var(--card, #fff);
  padding: 0.85rem 1rem;
}
.specialty-award-head {
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: 0.35rem 1rem;
  margin-bottom: 0.65rem;
}
.specialty-award-name {
  font-family: var(--font-label); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  font-size: 0.95rem; color: var(--text);
}
.specialty-award-sponsor {
  font-family: var(--font-body); font-weight: 400;
  text-transform: none; letter-spacing: 0;
  font-size: 0.8rem; color: var(--text-muted);
}
.specialty-winner {
  font-family: var(--font-mono);
  font-size: 0.8rem; color: var(--accent-ink);
}
.specialty-winner--none {
  color: var(--text-muted); font-style: italic;
  font-family: var(--font-body);
}
.specialty-award-set { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.specialty-num {
  width: 6.5rem; min-height: 48px; padding: 0.6rem 0.7rem;
  border: 1px solid var(--border); background: var(--surface, #fff);
  font-family: var(--font-mono); font-size: 1rem;
  color: var(--text);
}
.specialty-num:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb, 88, 160, 216),0.35);
}
.specialty-set, .specialty-clear { min-height: 48px; }
.specialty-status { font-size: 0.78rem; color: var(--text-muted); }
.specialty-status.error { color: #BA1A1A; }

/* Tap-to-pick flow: the whole award head is the button; the picker pops
   open under it with one search box (car #, name, or model) and tappable
   result rows sized for gloved thumbs on the lot. */
.specialty-award-open {
  width: 100%; border: 0; background: none; padding: 0; margin: 0;
  cursor: pointer; text-align: left; font: inherit; color: inherit;
}
.specialty-award-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.specialty-award:has(.specialty-picker:not(.hidden)) { border-color: var(--accent); }
.specialty-picker { margin-top: 0.35rem; display: flex; flex-direction: column; gap: 0.55rem; }
.specialty-search {
  width: 100%; min-height: 48px; padding: 0.6rem 0.7rem;
  border: 1px solid var(--border); background: var(--surface, #fff);
  font-family: var(--font-body); font-size: 1rem; color: var(--text);
}
.specialty-search:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb, 88, 160, 216),0.35);
}
.specialty-results { display: flex; flex-direction: column; }
.specialty-result {
  display: flex; align-items: center; gap: 0.7rem;
  width: 100%; min-height: 48px; padding: 0.5rem 0.6rem;
  border: 0; border-bottom: 1px solid var(--border);
  background: none; cursor: pointer; text-align: left; color: var(--text);
}
.specialty-result:last-child { border-bottom: 0; }
.specialty-result:hover, .specialty-result:focus-visible { background: rgba(var(--accent-rgb, 88, 160, 216),0.12); outline: none; }
.specialty-result-num {
  font-family: var(--font-mono); font-weight: 600; font-size: 0.95rem;
  color: var(--accent-ink); min-width: 3rem;
}
.specialty-result-main { font-family: var(--font-body); font-size: 0.92rem; display: flex; flex-direction: column; }
.specialty-result-vehicle { font-size: 0.8rem; color: var(--text-muted); }
.specialty-clear { align-self: flex-start; }

/* ── Judge nav header ──────────────────────────────────────────────────────
   Same bar anatomy as every other app surface (admin-kinetic.css): the
   wordmark on the left; "// JUDGING — <Show Name>" (#nav-title, label voice)
   and the signed-in judge's name on the right. Scoped to .judge-page because
   judge.css is also loaded by the organizer console. */
.judge-page .admin-nav-user {
  font-family: var(--font-label);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
}

/* Recolor the nav's bottom border to the show accent (admin.css hard-codes
   orange there). Judge-scoped, so the organizer console keeps its own. */
.judge-page .admin-nav { border-bottom-color: rgba(var(--accent-rgb, 88, 160, 216), 0.18); }

/* "// JUDGING — <Show Name>" carries an arbitrary-length show name. On
   desktop, let the right group shrink and the label ellipsize so a long
   name can never collide with the wordmark. */
.judge-page .admin-nav-right { min-width: 0; }
[data-theme] .judge-page .admin-nav-page {
  min-width: 0; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis;
}

/* Narrow / split-screen widths: give the label its own full-width row UNDER
   the wordmark (nav wraps), where any show name can wrap freely — nothing
   spills over the top bar or shoves the page sideways. Judge name + Logout
   share that row, pinned right. */
@media (max-width: 760px) {
  .judge-page .admin-nav {
    height: auto;
    min-height: 64px;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    gap: 0.35rem 0.6rem;
    flex-wrap: wrap;
  }
  .judge-page .admin-nav-title {
    font-size: 1.5rem;
    min-width: 0;
    line-height: 1.2;
  }
  [data-theme] .judge-page .admin-nav-right {
    flex: 1 1 100%;
    min-width: 0;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 0.35rem;
  }
  [data-theme] .judge-page .admin-nav-page {
    flex: 1 1 12rem;
    min-width: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    text-align: left;
    line-height: 1.45;
  }
}

/* ─── Judge confirm dialog ─────────────────────────────────
   The judge app had no dialog of its own; a browser confirm() reads as a
   system error inside a full-screen PWA. Square corners, stamped offset,
   cream on charcoal — same language as the rest of the console. Used for
   the Best of Show pick, which takes a car out of every other award. */
.judge-dialog { position: fixed; inset: 0; z-index: var(--z-modal, 1000);
  display: flex; align-items: center; justify-content: center; padding: 1.25rem; }
.judge-dialog-backdrop { position: absolute; inset: 0; background: rgba(9, 9, 10, 0.72); }
.judge-dialog-card {
  position: relative;
  width: min(30rem, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: 0;
  padding: 1.35rem 1.35rem 1.15rem;
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.45);
}
.judge-dialog-title {
  font-family: var(--font-display, var(--font-label));
  text-transform: uppercase; letter-spacing: 0.01em;
  font-size: 1.15rem; line-height: 1.1; margin: 0 0 0.5rem;
  color: var(--text-primary);
}
.judge-dialog-text {
  margin: 0 0 1.1rem; font-size: 0.95rem; line-height: 1.5;
  color: var(--text-secondary);
}
.judge-dialog-actions { display: flex; gap: 0.6rem; justify-content: flex-end; flex-wrap: wrap; }
/* Thumb targets: this gets tapped outdoors, in motion. */
.judge-dialog-actions > button { min-height: 48px; }
@media (max-width: 480px) {
  .judge-dialog-actions { flex-direction: column-reverse; }
  .judge-dialog-actions > button { width: 100%; }
}

/* ── Touch floor for the judge surface ──────────────────────────────────────
   PRODUCT.md sets ≥48px for judge flows; several controls in the judging path
   sat under it. `.btn-cancel` carries no min-height at all (0.6rem padding on
   0.88rem text computes to ~38px) and is the face of the Best-of-Show "Clear"
   and of the award-conflict Cancel / OK / Override — small, destructive, and
   tapped while walking. The two 44px controls meet the nav icon floor but not
   the field-control one.

   Keyed to the pointer, not the viewport: these are undersized for a thumb on
   a 1024px tablet and fine for a mouse in a 600px window, so the viewport is
   the wrong question. Scoped to .judge-page so the admin console's dense desk
   layout is left to its own pass. */
@media (pointer: coarse) {
  .judge-page .btn-cancel,
  .judge-page .class-select,
  .judge-page .login-resend-toggle {
    min-height: 48px;
  }
  /* Side-by-side action pairs need room between them as well as size: a
     0.6rem gap puts a destructive button inside the miss radius of the one
     beside it. (The dialog's own buttons already carry the 48px floor; this
     is the spacing half.) */
  .judge-page .judge-dialog-actions { gap: 0.9rem; }
}

/* ── Women's Ride ──────────────────────────────────────────────────────────
   Two pieces, both driven by lib/womensRideAward.

   The VOID notice: the award's winner also took Best of Show, so the award
   is off — nobody gets it and it does not pass down the pool. Same anatomy
   as .judge-assignment (left accent rule, card ground) so it reads as a
   standing fact rather than a failed action, but in flag red, which is the
   system's one alert ink. Never color-only: the kicker says VOID. */
.judge-void {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--danger, #BA1A1A);
  padding: 0.85rem 1.1rem;
  margin-bottom: 1rem;
  display: grid;
  gap: 0.3rem;
}
.judge-void.hidden { display: none; }
.judge-void-kicker {
  font-family: var(--font-label);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--danger, #BA1A1A);
}
.judge-void-line {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
.judge-void-note {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
}
.judge-void-car { font-family: var(--font-mono); color: var(--accent-ink); }

/* The BALLOT: the pool is short and known, so the judge taps a car rather
   than typing a number into a box — one fewer thing to get wrong with a
   clipboard in the other hand. The row the judge voted for stays marked. */
.womens-vote-pool { display: flex; flex-direction: column; }
.womens-vote-car {
  display: flex; align-items: center; gap: 0.7rem;
  width: 100%; min-height: 48px; padding: 0.55rem 0.6rem;
  border: 0; border-bottom: 1px solid var(--border);
  background: none; cursor: pointer; text-align: left; color: var(--text);
  font: inherit;
}
.womens-vote-car:last-child { border-bottom: 0; }
.womens-vote-car:hover,
.womens-vote-car:focus-visible {
  background: rgba(var(--accent-rgb, 88, 160, 216), 0.12);
  outline: none;
}
.womens-vote-car[aria-pressed="true"] {
  background: rgba(var(--accent-rgb, 88, 160, 216), 0.18);
  box-shadow: inset 3px 0 0 var(--accent);
}
.womens-vote-num {
  font-family: var(--font-mono); font-weight: 600; font-size: 0.95rem;
  color: var(--accent-ink); min-width: 3rem;
}
.womens-vote-main { font-family: var(--font-body); font-size: 0.92rem; display: flex; flex-direction: column; }
.womens-vote-vehicle { font-size: 0.8rem; color: var(--text-muted); }
.womens-vote-mine {
  margin-left: auto;
  font-family: var(--font-label); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink);
}
.womens-vote-foot {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  margin-top: 0.65rem;
}
