/* OutBall — shared design system for the public board and admin console.
   Sized for a phone at courtside and a TV on the wall: big numbers, calm chrome. */

:root {
  color-scheme: light dark;

  --bg: #f4f6f9;
  --bg-soft: #eaeef4;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #dfe5ee;
  --border-strong: #c6d0de;
  --text: #0f1620;
  --muted: #5a677a;
  --faint: #8593a6;

  --accent: #0d9488;
  --accent-ink: #ffffff;
  --accent-soft: #d5f2ee;
  --tab-on: #15803d;
  --live: #e11d48;
  --live-soft: #ffe4ea;
  --win: #15803d;
  --win-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fef3c7;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 22, 32, .05), 0 6px 18px rgba(15, 22, 32, .06);
  --shadow-lift: 0 2px 6px rgba(15, 22, 32, .08), 0 14px 34px rgba(15, 22, 32, .10);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f15;
    --bg-soft: #11161f;
    --surface: #151b25;
    --surface-2: #1b2230;
    --border: #263041;
    --border-strong: #35415a;
    --text: #e9eef6;
    --muted: #9aa8bd;
    --faint: #6f7f96;

    --accent: #2dd4bf;
  --tab-on: #15803d;
    --accent-ink: #04211e;
    --accent-soft: #10352f;
    --live: #fb7185;
    --live-soft: #3a1420;
    --win: #4ade80;
    --win-soft: #10301d;
    --warn: #fbbf24;
    --warn-soft: #33260a;

    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .35);
    --shadow-lift: 0 2px 6px rgba(0, 0, 0, .45), 0 14px 34px rgba(0, 0, 0, .45);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.015em; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px 72px;
}

/* ------------------------------------------------------------------ topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--text);
}

.brand-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #f8fca8, #cddb1f 55%, #9aa614);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .10);
  position: relative;
  flex: none;
}
.brand-dot::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 20% 25%, rgba(0,0,0,.30) 1.1px, transparent 1.6px),
    radial-gradient(circle at 72% 22%, rgba(0,0,0,.30) 1.1px, transparent 1.6px),
    radial-gradient(circle at 30% 74%, rgba(0,0,0,.30) 1.1px, transparent 1.6px),
    radial-gradient(circle at 78% 68%, rgba(0,0,0,.30) 1.1px, transparent 1.6px);
}

.topbar-spacer { flex: 1 1 auto; }

.topbar-links { display: flex; align-items: center; gap: 10px; }

/* -------------------------------------------------------------- primitives */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.pill-accent { background: var(--accent-soft); border-color: transparent; color: color-mix(in srgb, var(--accent) 75%, var(--text)); }
.pill-live { background: var(--live-soft); border-color: transparent; color: var(--live); }
.pill-win { background: var(--win-soft); border-color: transparent; color: var(--win); }
.pill-warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.dot-pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.8); }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s, transform .06s, opacity .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-danger { color: var(--live); border-color: color-mix(in srgb, var(--live) 40%, var(--border)); background: transparent; }
.btn-danger:hover { background: var(--live-soft); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }

/* A button that reads as a link. Secondary match actions are one-word verbs
   that do not each need a box; only the primary action keeps its chrome. */
.btn-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
}
.btn-link:hover { color: var(--text); text-decoration: underline; }
.btn-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.btn-link:disabled { opacity: .45; cursor: not-allowed; text-decoration: none; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-block { width: 100%; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section { margin-top: 34px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.section-head h2 { font-size: 15.5px; letter-spacing: -0.01em; font-weight: 750; color: var(--muted); }
.section-head .count { font-size: 13px; color: var(--faint); font-weight: 600; }

.empty {
  padding: 34px 20px;
  text-align: center;
  color: var(--faint);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  font-size: 14.5px;
}

/* ------------------------------------------------------------- match cards */

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
}

.match {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.match-live {
  border-color: color-mix(in srgb, var(--live) 45%, var(--border));
  box-shadow: var(--shadow-lift);
}

.match-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 12.5px;
  font-weight: 650;
  color: var(--muted);
  flex-wrap: wrap;
}
.match-head .spacer { flex: 1 1 auto; }

.court-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 750;
  font-size: 12px;
  letter-spacing: .02em;
}

.side {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
}
.side + .side { border-top: 1px solid var(--border); }
.side-winner { background: color-mix(in srgb, var(--win-soft) 55%, transparent); }

.side-id { min-width: 0; flex: 1 1 auto; }
.side-name {
  font-weight: 700;
  font-size: 16.5px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 7px;
}
.side-name .check { color: var(--win); flex: none; }
.side-players {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.games { display: flex; gap: 6px; align-items: center; flex: none; }
.game-box {
  min-width: 40px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  text-align: center;
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.game-box-won { background: var(--win-soft); border-color: transparent; color: var(--win); }
.game-box-current { border-color: var(--live); box-shadow: 0 0 0 2px color-mix(in srgb, var(--live) 18%, transparent); }
.game-box-lg { font-size: 26px; min-width: 52px; padding: 6px 10px; }

.match-foot {
  padding: 9px 14px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--faint);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------- standings */

.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }

table.standings { width: 100%; border-collapse: collapse; min-width: 620px; }
.standings-note { padding: 10px 14px; font-size: 12.5px; color: var(--faint); border-top: 1px solid var(--border); background: var(--surface-2); }
table.standings th {
  text-align: right;
  font-size: 12px;
  letter-spacing: 0;
  color: var(--faint);
  font-weight: 700;
  padding: 11px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.standings th:first-child, table.standings th:nth-child(2) { text-align: left; }
table.standings td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
}
table.standings td:first-child, table.standings td:nth-child(2) { text-align: left; }
table.standings tr:last-child td { border-bottom: none; }
table.standings tbody tr:hover td { background: var(--surface-2); }
.rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-weight: 750;
  font-size: 13.5px;
}
.rank-1 { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.team-cell strong { display: block; font-weight: 700; font-size: 15.5px; }
.team-cell span { color: var(--muted); font-size: 12.5px; }
.num-strong { font-weight: 750; }
.diff-pos { color: var(--win); }
.diff-neg { color: var(--live); }

/* ------------------------------------------------------------------- forms */

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 650; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--faint); }

input[type="text"], input[type="number"], input[type="password"], select {
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
input:disabled, select:disabled {
  background: var(--surface-2);
  color: var(--faint);
  cursor: not-allowed;
  border-color: var(--border);
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }

/* -------------------------------------------------------------------- misc */

.toast-host {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lift);
  animation: rise .18s ease-out;
  max-width: min(92vw, 520px);
  text-align: center;
}
.toast-error { background: var(--live); color: #fff; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (max-width: 640px) {
  .wrap { padding: 0 14px 60px; }
  .grid { grid-template-columns: 1fr; }
  .side-name { font-size: 16px; }
  /* Points for / against drop away so the table fits without sideways scrolling. */
  table.standings { min-width: 0; }
  /* Points for / against drop away so the table fits. Columns are
     # · Team · Rating · W · L · Games · PF · PA · Diff — PF and PA are 7 and 8. */
  table.standings th:nth-child(7), table.standings td:nth-child(7),
  table.standings th:nth-child(8), table.standings td:nth-child(8) { display: none; }
  table.standings th, table.standings td { padding: 10px 8px; font-size: 14px; }
  .result-line { gap: 6px 8px; }
}

/* ----------------------------------------------------------------- tab bars */
/* Used by the admin console (setup / teams / live) and by the public board to
   switch between classes. Active state comes from either .tab-on or
   aria-selected, so both callers style the same way. */

.tabs {
  display: flex;
  gap: 4px;
  margin-top: 14px;
  padding: 4px;
  background: var(--bg-soft);
  border-radius: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 1 1 auto;
  justify-content: center;
  white-space: nowrap;
  padding: 9px 18px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.tab:hover { color: var(--text); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.tab-on,
.tab[aria-selected="true"] {
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px var(--border);
}

/* The class tabs on the public board are the one place that still shouts: on a
   wall display the question "which class am I looking at" has to answer itself
   from across the room. #15803d is as bright as green gets while keeping white
   text at 5:1 — anything more vivid drops below readable. */
.tabs-class .tab-on {
  background: var(--tab-on);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 800;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .16);
}
.tabs-class .tab-on:hover { color: #fff; }
.tabs-class .tab-on .tab-live { background: #fff; }
.tabs-class .tab-on .tab-done { color: #fff; }

/* A quiet pulse on a class that has matches in play right now. */
.tab-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: tab-pulse 2s ease-in-out infinite;
}
@keyframes tab-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}
@media (prefers-reduced-motion: reduce) {
  .tab-live { animation: none; }
}

.tab-done { color: var(--accent); font-size: 13px; }

@media (max-width: 520px) {
  .tab { padding: 9px 12px; font-size: 14px; }
}

/* ------------------------------------------------------ classes in the admin */

.class-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 18px 0 4px;
}
/* Inside a panel the heading already says these are classes, so the row loses
   its own label and sits tight under the description. */
.class-bar-inset { margin: 14px 0 0; }
.class-bar-label {
  font-size: 12px;
  letter-spacing: 0;
  font-weight: 700;
  color: var(--faint);
}

.chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip-on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* Courts are exclusive, so this reads as a set of switches rather than a list. */
.court-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

.court-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  user-select: none;
}
.court-chip:hover { border-color: var(--border-strong); }
.court-chip:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}
.court-taken {
  opacity: .5;
  cursor: not-allowed;
  font-weight: 550;
}
.court-chip input { accent-color: var(--accent); margin: 0; }

/* Heading that separates one class from the next down the live-scoring page. */
.class-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 30px 0 -6px;
  padding-top: 18px;
  border-top: 2px solid var(--border);
}
.class-head:first-child { margin-top: 12px; border-top: 0; padding-top: 0; }
.class-head h2 {
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -0.02em;
  margin: 0;
}

/* ------------------------------------------------------------ round grouping */
/* A queue of ninety matches reads as noise, so each round gets its own quiet
   grey block. Deliberately recessive: the live cards above should stay the
   brightest thing on the page. */

.round-group {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px 14px;
  margin-bottom: 10px;
}
.round-group:last-child { margin-bottom: 0; }

.round-band {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.round-band-n {
  font-size: 12.5px;
  letter-spacing: 0;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}

.round-band-c {
  font-size: 11.5px;
  font-weight: 650;
  color: var(--faint);
  white-space: nowrap;
}

/* Fills whatever space is left, so the band reads as one ruled line. */
.round-band-rule {
  flex: 1 1 auto;
  height: 1px;
  background: var(--border-strong);
  opacity: .6;
}

/* The round currently on court gets its accent back — it is not "waiting". */
.round-group-live {
  background: var(--surface);
  border-color: var(--accent);
}
.round-group-live .round-band-n { color: var(--accent); }

.round-group .queue { background: transparent; border: 0; box-shadow: none; padding: 0; }
.round-group .grid { margin: 0; }

@media (max-width: 640px) {
  .round-group { padding: 10px 10px 12px; }
}

/* --------------------------------------------------- preset vs custom scoring */
/* A named format and a hand-tuned one are different things, and the form should
   never leave you guessing which you have. The badge states it outright. */

.preset-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.preset-field { flex: 1 1 320px; margin: 0; }

.preset-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 1px;
}
.preset-badge-on {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.preset-badge-custom {
  background: var(--bg-soft);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

/* The numbers the preset stands for, set apart so the two never read as one. */
.custom-block {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}
.custom-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 12.5px;
  letter-spacing: 0;
  font-weight: 800;
  color: var(--muted);
}
.custom-block-note {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  color: var(--faint);
}

/* ------------------------------------------------------- final score entry */
/* Typing a finished score rather than tapping points. Each score sits on its
   own team's side of the row, so the eye goes name → number without crossing
   the card, and the whole thing stays tight enough to see several at once. */

.entry { padding: 10px 14px 4px; }

.entry-names {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 14.5px;
  font-weight: 700;
}
.entry-name { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-name:last-of-type { text-align: right; }
.entry-vs { color: var(--faint); font-size: 11.5px; font-weight: 650; flex: 0 0 auto; }

.entry-games { display: flex; flex-direction: column; gap: 5px; }

.entry-game {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: var(--surface-2);
}

/* Grows to fill the middle, which pins each input to its own edge. */
.entry-game-n {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 750;
  color: var(--faint);
  white-space: nowrap;
}

/* A game that already satisfies the rules, marked as it is typed. */
.entry-game-won { border-color: var(--win); background: var(--win-soft); }
.entry-game-won .entry-game-n { color: var(--win); }

input.entry-score {
  width: 60px;
  flex: 0 0 auto;
  text-align: center;
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  padding: 5px 4px;
}
input.entry-score-win { border-color: var(--win); color: var(--win); }

.entry-flag { display: inline-flex; }
.entry-tick { color: var(--win); font-weight: 800; }

.entry-verdict {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 9px 0 9px;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.3;
}
.entry-verdict-done { color: var(--win); }
.entry-verdict-part { color: var(--muted); }
.entry-verdict-none { color: var(--faint); font-weight: 600; }

/* The whole card lifts when the typed score would finish the match, so a desk
   scanning ten cards can see which are ready to send without reading them. */
.match-ready {
  border-color: var(--win);
  box-shadow: 0 0 0 1px var(--win), var(--shadow);
}

@media (max-width: 420px) {
  input.entry-score { width: 52px; font-size: 17px; }
  .entry-game { gap: 6px; }
}
}

}


/* Forfeit is a details/summary so its two choices stay tucked away. It sits on
   the same line as the rest, styled to match the other text links. */
.forfeit { flex: 0 0 auto; }
.forfeit > summary {
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
}
.forfeit > summary::-webkit-details-marker { display: none; }
.forfeit > summary:hover { color: var(--live); text-decoration: underline; }
.forfeit[open] > summary { color: var(--live); }
/* Open, the choices drop below the line rather than stretching it. */
.forfeit[open] { flex: 1 1 100%; text-align: right; }

/* ------------------------------------------------------------- kiosk badge */
/* Says why the page is moving on its own, for the one person who wonders.
   Quiet enough to ignore from across the room. */

.kiosk-badge {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 40;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 650;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .4s ease, transform .4s ease;
}
.kiosk-badge.kiosk-on { opacity: 1; transform: none; }

@media (max-width: 480px) {
  .kiosk-badge { right: 10px; bottom: 10px; font-size: 11.5px; }
}

/* -------------------------------------------------- per-class running tools */
/* Lengthen, shorten or stop a class mid-event. Sits under the class heading as
   a quiet strip: needed occasionally, never the thing you look at first. */

.class-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 10px 0 -4px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}
.class-tools:empty { display: none; }
.class-tools .spacer { flex: 1 1 auto; }

.class-tools-label {
  font-size: 12px;
  font-weight: 650;
  color: var(--faint);
}

/* Ending a class throws results away, so it reads as the consequential one. */
.btn-link-danger { color: var(--live); }
.btn-link-danger:hover { color: var(--live); }

@media (max-width: 520px) {
  .class-tools { gap: 10px; }
  .class-tools .spacer { flex-basis: 100%; height: 0; }
}

/* ----------------------------------------------------------------- ratings */
/* An estimated, DUPR-shaped number next to a team. Deliberately quiet: it is
   informative, not the score, and must never outshine the actual result. */

.rating {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--bg-soft);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  vertical-align: 2px;
  white-space: nowrap;
}

/* In the standings the rating is a column of its own, so it stands alone. */
.rating-lg {
  margin-left: 0;
  font-size: 13.5px;
  padding: 2px 7px;
  vertical-align: baseline;
  color: var(--text);
}

/* Fewer than three matches: shown, but visibly not to be trusted yet. */
.rating-prov { opacity: .5; font-weight: 650; }

.queue-team .rating { vertical-align: 1px; }
