/* ==========================================================================
   CardedGolf — application styles
   Consumes the tokens in brand.css. Import brand.css first.

   The organising idea: the logo's notation language is the interface's
   notation language. A circle means under par, a square means over par,
   and the ink-over-red double rule means "this is a total". Those three
   devices appear on the mark and on the card, and they mean the same thing
   in both places.
   ========================================================================== */

/* --------------------------------------------------------------- reset */

*, *::before, *::after { box-sizing: border-box; }

body, h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }

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

body {
  min-block-size: 100vh;
  background: var(--cg-bg);
  color: var(--cg-text);
  font-family: var(--cg-font-body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-inline-size: 100%; }

a { color: inherit; }

button, input, select { font: inherit; color: inherit; }

/* Visible focus everywhere. Never remove without replacing. */
:focus-visible {
  outline: 2px solid var(--cg-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ------------------------------------------------------------ typography */

:root {
  --cg-font-body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI",
                  Roboto, Helvetica, Arial, sans-serif;
  /* Display and body are the same family for now. When Söhne or Founders
     Grotesk is licensed, change --cg-font-display only. */
  --cg-font-display: var(--cg-font-body);

  --cg-step-0: 1rem;
  --cg-step-1: 1.125rem;
  --cg-step-2: 1.375rem;
  --cg-step-3: 1.75rem;
  --cg-step-4: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  --cg-step-5: clamp(2.5rem, 1.5rem + 4.4vw, 4.5rem);

  --cg-gutter: clamp(1.25rem, 0.8rem + 2vw, 2.5rem);
  --cg-measure: 62ch;
}

h1, h2, h3 {
  font-family: var(--cg-font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

h1 { font-size: var(--cg-step-5); }
h2 { font-size: var(--cg-step-4); }
h3 { font-size: var(--cg-step-2); letter-spacing: -0.015em; }

p { text-wrap: pretty; }

/* Small caps-style label. Used for column headings and section eyebrows —
   the same voice as the printed headers on a paper scorecard. */
.cg-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cg-text-muted);
}

.cg-lede {
  font-size: var(--cg-step-2);
  color: var(--cg-text-muted);
  max-inline-size: var(--cg-measure);
}

/* ---------------------------------------------------------------- layout */

.cg-shell {
  inline-size: min(100% - (var(--cg-gutter) * 2), 76rem);
  margin-inline: auto;
}

.cg-section { padding-block: clamp(3rem, 2rem + 4vw, 6rem); }
.cg-section + .cg-section { padding-block-start: 0; }

.cg-stack > * + * { margin-block-start: var(--flow, 1rem); }

/* ---------------------------------------------------------------- header */

.cg-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--cg-bg);
  border-block-end: 1px solid var(--cg-rule);
}

.cg-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  padding-block: 1rem;
}

.cg-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.cg-brand__mark { inline-size: 5.25rem; height: auto; color: var(--cg-text); }

.cg-brand__name {
  font-family: var(--cg-font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.cg-brand__name span { font-weight: 300; color: var(--cg-text-muted); }

.cg-nav { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; }

.cg-nav a {
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--cg-text-muted);
  padding-block: 0.25rem;
  border-block-end: 2px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}
.cg-nav a:hover { color: var(--cg-text); }
.cg-nav a[aria-current="page"] {
  color: var(--cg-text);
  border-block-end-color: var(--cg-accent);
}

/* --------------------------------------------------------------- buttons */

.cg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--cg-text);
  border-radius: 2px;
  background: var(--cg-text);
  color: var(--cg-bg);
  font-weight: 600;
  font-size: 0.975rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}
.cg-btn:hover {
  background: var(--cg-accent);
  border-color: var(--cg-accent);
  color: var(--cg-card);
}

.cg-btn--ghost {
  background: transparent;
  color: var(--cg-text);
  border-color: currentColor;
}
.cg-btn--ghost:hover { background: var(--cg-text); color: var(--cg-bg); }

/* ---------------------------------------------------------------- panels */

.cg-panel {
  background: var(--cg-surface);
  border: 1px solid var(--cg-rule);
  border-radius: 3px;
  padding: clamp(1.25rem, 1rem + 1vw, 2rem);
}

/* ==========================================================================
   SIGNATURE — the scorecard
   ========================================================================== */

.cg-card-wrap {
  /* position: relative is load-bearing. Without it the table's overflow
     propagates past this scroller and the whole page scrolls sideways on
     mobile — the card scrolls correctly either way, so the bug is invisible
     until you check document scrollWidth. Verified at 390px. */
  position: relative;
  overflow-x: auto;
  border: 1px solid var(--cg-rule);
  border-radius: 3px;
  background: var(--cg-surface);
  -webkit-overflow-scrolling: touch;
}

.cg-scorecard {
  inline-size: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  white-space: nowrap;
}

.cg-scorecard th,
.cg-scorecard td {
  padding: 0.5rem 0.4rem;
  text-align: center;
  border-inline-end: 1px solid var(--cg-rule);
}
.cg-scorecard th:last-child,
.cg-scorecard td:last-child { border-inline-end: 0; }

.cg-scorecard thead th {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cg-text-muted);
  border-block-end: 1px solid var(--cg-rule);
  padding-block: 0.65rem;
}

/* Player name column stays put while the holes scroll under it. */
.cg-scorecard [scope="row"],
.cg-scorecard thead th:first-child {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  background: var(--cg-surface);
  text-align: start;
  padding-inline-start: 0.9rem;
  min-inline-size: 8.5rem;
  border-inline-end: 1px solid var(--cg-rule);
}

.cg-scorecard tbody tr + tr th,
.cg-scorecard tbody tr + tr td { border-block-start: 1px solid var(--cg-rule); }

/* The turn. A heavier divide where the front nine ends, because that's a
   real break in the round and not just a column. */
.cg-scorecard .is-turn { border-inline-end: 2px solid var(--cg-text); }

.cg-col-sub {
  background: color-mix(in srgb, var(--cg-graphite) 8%, transparent);
  font-weight: 600;
}

/* ------------------------------------------------- the notation glyphs */

/* Base cell. No mark on a par — same as a paper card, where only the
   exceptions get drawn. */
.cg-score {
  display: inline-grid;
  place-items: center;
  inline-size: 2.1rem;
  block-size: 2.1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  border: 2px solid transparent;
}

.cg-score--birdie,
.cg-score--eagle,
.cg-score--albatross {
  border-color: var(--cg-score-under);
  border-radius: 50%;
}

.cg-score--bogey,
.cg-score--double,
.cg-score--worse { border-color: var(--cg-score-over); }

/* Doubled notation — eagle and double bogey. One rule serves both, because
   the ring inherits whatever border-radius the base glyph already has. */
.cg-score--eagle,
.cg-score--albatross,
.cg-score--double,
.cg-score--worse {
  box-shadow: 0 0 0 2px var(--cg-surface), 0 0 0 4px currentColor;
}
.cg-score--eagle, .cg-score--albatross { color: var(--cg-score-under); }
.cg-score--double, .cg-score--worse    { color: var(--cg-score-over); }

.cg-score--empty { color: var(--cg-text-muted); opacity: 0.4; }

/* ------------------------------------------------------- the total rule */

/* Ink line over red line. The same device as the logo, meaning the same
   thing: everything above this adds up to what's below. */
.cg-scorecard tfoot th,
.cg-scorecard tfoot td { font-weight: 700; }

/* Ink line over red line, on the first footer row only. Several format blocks
   can stack below it; they get a hairline instead so the total device stays
   singular and keeps meaning "everything above adds up to this". */
.cg-scorecard tfoot tr:first-child > th,
.cg-scorecard tfoot tr:first-child > td {
  position: relative;
  padding-block-start: 0.85rem;
  border-block-start: 2px solid var(--cg-text);
}
.cg-scorecard tfoot tr:first-child > th::after,
.cg-scorecard tfoot tr:first-child > td::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 3px;
  block-size: 2px;
  background: var(--cg-accent);
}

.cg-scorecard tfoot tr + tr > th,
.cg-scorecard tfoot tr + tr > td { border-block-start: 1px solid var(--cg-rule); }

/* Footer row groups alternate subtly so stacked formats stay readable. */
.cg-scorecard tfoot tr > th { font-weight: 600; }

.cg-total { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ==========================================================================
   Live status — the thing a paper card cannot tell you
   ========================================================================== */

.cg-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1px;
  background: var(--cg-rule);
  border: 1px solid var(--cg-rule);
  border-radius: 3px;
  overflow: hidden;
}

.cg-status__item {
  background: var(--cg-surface);
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cg-status__value {
  font-family: var(--cg-font-display);
  font-size: var(--cg-step-3);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.cg-status__value--accent { color: var(--cg-accent); }
.cg-status__meta { font-size: 0.85rem; color: var(--cg-text-muted); }

/* -------------------------------------------------------------- format chips */

.cg-formats { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 0; }

/* Toggle buttons. The leading circle is the notation's own "on" mark, so state
   is carried by shape and fill as well as colour. */
.cg-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.85rem;
  border: 1px solid var(--cg-rule);
  border-radius: 999px;
  background: transparent;
  color: var(--cg-text-muted);
  font-size: 0.85rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.cg-chip::before {
  content: "";
  inline-size: 0.6rem;
  block-size: 0.6rem;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  flex: none;
}

.cg-chip:hover { border-color: var(--cg-text); color: var(--cg-text); }

.cg-chip--on {
  background: var(--cg-text);
  border-color: var(--cg-text);
  color: var(--cg-bg);
  font-weight: 600;
}
.cg-chip--on::before { background: currentColor; }
.cg-chip--on:hover { color: var(--cg-bg); }

/* The last format on. Still focusable and clickable so the reason can be
   explained, rather than a dead disabled control. */
.cg-chip--locked { cursor: not-allowed; }
.cg-chip--locked::before { box-shadow: 0 0 0 2px var(--cg-text), 0 0 0 3.5px var(--cg-bg); }

.cg-notice {
  margin-block-start: 0.75rem;
  padding: 0.6rem 0.85rem;
  border-inline-start: 3px solid var(--cg-accent);
  background: var(--cg-surface);
  font-size: 0.9rem;
  color: var(--cg-text);
}

/* ---------------------------------------------------------- score entry */

.cg-entry { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }

.cg-field { display: flex; flex-direction: column; gap: 0.3rem; }

.cg-field select,
.cg-field input {
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--cg-graphite);
  border-radius: 2px;
  background: var(--cg-bg);
  font-variant-numeric: tabular-nums;
  min-inline-size: 7rem;
}

/* ------------------------------------------------------------- marketing */

.cg-hero { padding-block: clamp(3.5rem, 2rem + 8vw, 8rem); }
.cg-hero h1 { max-inline-size: 16ch; }
.cg-hero .cg-lede { margin-block-start: 1.5rem; }
.cg-hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-block-start: 2.5rem; }

.cg-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.5rem;
}

.cg-feature h3 { margin-block-end: 0.5rem; }
.cg-feature p { color: var(--cg-text-muted); }

/* A legend that teaches the notation by showing it. Doubles as a key for
   the card below it. */
.cg-legend { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; }
.cg-legend__item { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }

/* ---------------------------------------------------------------- footer */

.cg-footer {
  margin-block-start: clamp(3rem, 2rem + 4vw, 6rem);
  border-block-start: 1px solid var(--cg-rule);
  padding-block: 2.5rem;
  color: var(--cg-text-muted);
  font-size: 0.9rem;
}
.cg-footer__inner { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; align-items: center; }
.cg-footer__tagline { color: var(--cg-text-muted); }

/* ----------------------------------------------------------------- utils */

.cg-visually-hidden {
  position: absolute;
  inline-size: 1px; block-size: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

@media (max-width: 40rem) {
  .cg-nav { gap: 1.1rem; inline-size: 100%; }
  .cg-brand__mark { inline-size: 4rem; }
  .cg-scorecard th, .cg-scorecard td { padding: 0.45rem 0.3rem; }
  .cg-scorecard [scope="row"], .cg-scorecard thead th:first-child { min-inline-size: 6.5rem; }
}

/* Footer note for the case where a format is on but can't produce totals —
   match play with a field other than two. An explanation, not an empty row. */
.cg-foot-note {
  text-align: start;
  font-weight: 400;
  white-space: normal;
  color: var(--cg-text-muted);
  padding-inline: 0.9rem;
}

/* ==========================================================================
   LEADERBOARD
   The card is for entering scores; the board is for reading them across a
   room. Bigger type, fewer columns, one job per column.
   ========================================================================== */

.cg-board__head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  justify-content: space-between;
}
.cg-board__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.cg-board__section + .cg-board__section { margin-block-start: 2.5rem; }

.cg-board__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.9rem;
  margin-block-end: 0.85rem;
}
.cg-board__title h2 { font-size: var(--cg-step-3); }
.cg-board__note { font-size: 0.85rem; color: var(--cg-text-muted); }

.cg-cut-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--cg-accent);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--cg-accent);
}

/* ---------------------------------------------------------------- the table */

.cg-board__table {
  inline-size: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.cg-board__table th,
.cg-board__table td {
  text-align: start;
  padding: 0.7rem 0.9rem;
  border-block-end: 1px solid var(--cg-rule);
  white-space: nowrap;
}

.cg-board__table thead th {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cg-text-muted);
  padding-block: 0.6rem;
}

.cg-board__table tbody tr:last-child > * { border-block-end: 0; }

.cg-board__pos {
  inline-size: 4.5rem;
  font-weight: 700;
  color: var(--cg-text-muted);
}
.cg-board__score { font-weight: 700; font-size: 1.1em; }
.cg-board__standing { color: var(--cg-text-muted); }
.cg-board__detail { color: var(--cg-text-muted); font-size: 0.9em; }

/* Sortable headers. Whole cell is the target, so it works on a touchscreen. */
.cg-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: inherit;
}
.cg-sort:hover { color: var(--cg-text); }
.cg-sort__arrow { font-size: 0.9em; color: var(--cg-accent); }

/* ------------------------------------------------------------- the cut line */

/* A single red band, deliberately unlike the ink-over-red double rule. The
   double rule means "this is a total"; this means "the field stops here". Two
   consequential lines, two distinct devices. */
.cg-cutrow > td {
  padding-block: 0.3rem;
  background: color-mix(in srgb, var(--cg-accent) 12%, transparent);
  border-block: 2px solid var(--cg-accent);
}
.cg-cutrow__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cg-accent);
}

.cg-board__table tr.is-cut > * { opacity: 0.5; }

/* -------------------------------------------------------- cut configuration */

.cg-cutbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1.25rem;
}
.cg-cutbar__hint {
  font-size: 0.85rem;
  color: var(--cg-text-muted);
  max-inline-size: 34ch;
  margin-block-start: 0.25rem;
}
.cg-cutbar__config { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; }
.cg-cutbar__config input[type="number"] { min-inline-size: 5rem; }

.cg-check { display: inline-flex; align-items: center; gap: 0.45rem; padding-block-end: 0.7rem; }
.cg-check input { inline-size: 1.05rem; block-size: 1.05rem; accent-color: var(--cg-accent); }

/* ==========================================================================
   DISPLAY MODE — a screen in the clubhouse, read from across the room
   ========================================================================== */

body.is-display {
  /* Force the dark scheme regardless of the viewer's preference; a bright
     panel in a dim room is unreadable. */
  --cg-bg: #101A22;
  --cg-surface: #16232E;
  --cg-text: #EFEAE0;
  --cg-text-muted: #8A949C;
  --cg-rule: color-mix(in srgb, #78838C 32%, transparent);
  --cg-score-under: #EFEAE0;
  --cg-score-over: #EFEAE0;
}

body.is-display .cg-header,
body.is-display .cg-footer { display: none; }

body.is-display .cg-section { padding-block: 2rem; }
body.is-display .cg-shell { inline-size: min(100% - 3rem, 90rem); }

body.is-display h1 { font-size: clamp(2.5rem, 1.5rem + 3.5vw, 4rem); }
body.is-display .cg-board__title h2 { font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.4rem); }

body.is-display .cg-board__table { font-size: clamp(1.05rem, 0.85rem + 0.7vw, 1.6rem); }
body.is-display .cg-board__table th,
body.is-display .cg-board__table td { padding: 0.85rem 1.1rem; }
body.is-display .cg-board__table thead th { font-size: 0.8rem; }

/* Detail is for a phone in your hand, not a wall. */
body.is-display .cg-board__detail { display: none; }
body.is-display .cg-sort { pointer-events: none; }

body.is-display .cg-board__actions { opacity: 0.35; }
body.is-display .cg-board__actions:hover,
body.is-display .cg-board__actions:focus-within { opacity: 1; }

@media (max-width: 48rem) {
  .cg-board__detail { display: none; }
  .cg-board__table th, .cg-board__table td { padding: 0.6rem 0.55rem; }
  .cg-board__pos { inline-size: 3.2rem; }
}

/* ==========================================================================
   TEAMS
   ========================================================================== */

.cg-teams {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1rem;
}

.cg-team {
  border: 1px solid var(--cg-rule);
  border-radius: 3px;
  background: var(--cg-surface);
  padding: 1.1rem 1.25rem;
}

.cg-team__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-block-end: 0.75rem;
}
.cg-team__head h3 { font-size: 1.15rem; }

.cg-team__remove {
  background: none;
  border: 0;
  padding: 0;
  font-size: 0.8rem;
  color: var(--cg-text-muted);
  text-decoration: underline;
  cursor: pointer;
}
.cg-team__remove:hover { color: var(--cg-accent); }

.cg-team__members { list-style: none; margin: 0; padding: 0; }
.cg-team__members li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.3rem;
  border-block-end: 1px solid var(--cg-rule);
}
.cg-team__members li:last-child { border-block-end: 0; }

.cg-team__hcp {
  font-variant-numeric: tabular-nums;
  color: var(--cg-text-muted);
  font-size: 0.9em;
}

.cg-team__meta {
  margin-block-start: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--cg-text-muted);
}
.cg-team__badge {
  border: 1px solid var(--cg-rule);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}

.cg-team__warn {
  margin-block-start: 0.7rem;
  font-size: 0.82rem;
  color: var(--cg-accent);
}

.cg-fieldset { border: 0; margin: 0; padding: 0; }

.cg-picklist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0.4rem 1rem;
  margin-block-start: 0.5rem;
}
.cg-picklist .cg-check { padding-block-end: 0; }

/* Which boards are on screen. */
.cg-viewswitch { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.cg-viewswitch .cg-chip { text-decoration: none; }

/* Separates the individual boards from the team boards. */
.cg-board__divider {
  block-size: 2px;
  background: var(--cg-rule);
  margin-block: 1rem;
}

.cg-board__kind {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cg-text-muted);
  border: 1px solid var(--cg-rule);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}

/* Persistent reminder that the numbers on screen are gross, not net. */
.cg-basis-flag {
  padding: 0.6rem 0.9rem;
  border-inline-start: 3px solid var(--cg-accent);
  background: var(--cg-surface);
  font-size: 0.9rem;
  font-weight: 600;
}
body.is-display .cg-basis-flag { font-size: 1.2rem; }

/* ==========================================================================
   CATALOG — roster, courses, tees, new round
   ========================================================================== */

/* Numeric inputs sitting inside a scorecard cell. Sized to the column so an
   18-hole grid stays one screen wide on a laptop. */
.cg-cell-input {
  inline-size: 3.2rem;
  padding: 0.3rem 0.25rem;
  text-align: center;
  border: 1px solid var(--cg-rule);
  border-radius: 2px;
  background: var(--cg-bg);
  color: var(--cg-text);
  font-variant-numeric: tabular-nums;
}
.cg-cell-input:focus-visible { border-color: var(--cg-accent); }

.cg-inline-form { display: flex; align-items: center; gap: 0.4rem; }
.cg-inline-form input[type="number"] {
  inline-size: 5rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--cg-rule);
  border-radius: 2px;
  background: var(--cg-bg);
  color: var(--cg-text);
  font-variant-numeric: tabular-nums;
}

.cg-btn--small { padding: 0.35rem 0.7rem; font-size: 0.85rem; }

/* A tee is named by its colour, so show the colour. */
.cg-tee { display: inline-flex; align-items: center; gap: 0.5rem; }
.cg-tee__dot {
  inline-size: 0.7rem;
  block-size: 0.7rem;
  border-radius: 50%;
  border: 1px solid var(--cg-rule);
  flex: none;
}

.cg-teams .cg-team__head a { text-decoration: none; }
.cg-teams .cg-team__head a:hover { color: var(--cg-accent); }

.cg-field input[type="color"] {
  inline-size: 4rem;
  block-size: 2.6rem;
  padding: 0.2rem;
  border: 1px solid var(--cg-graphite);
  border-radius: 2px;
  background: var(--cg-bg);
}

.cg-check input[type="radio"] {
  inline-size: 1.05rem;
  block-size: 1.05rem;
  accent-color: var(--cg-accent);
}

/* The picker rows carry two pieces of information, so give them room. */
.cg-picklist .cg-check { align-items: flex-start; padding-block: 0.3rem; }
.cg-picklist .cg-check > span { display: flex; flex-direction: column; gap: 0.1rem; }
