/* cric.run Observatory component styles (class prefix `cc-`).
 *
 * TASK-138 moved the rules of `observatory.css` into this file. The pages of the website
 * load this file after `docs/design/tokens.css`. Every value is a token of
 * `docs/design/tokens.json`. A number that `tokens.json` does not hold is built from a
 * spacing token with calc(). The component README of the design folder names each case.
 *
 * A component class sets colour, shape, spacing and layout only. It sets no type value.
 * Every text node in the markup carries one type class from `tokens.css`:
 * .score-xl, .score-lg, .title-1, .title-2, .title-3, .label-caps, .body-lg, .body,
 * .body-sm, .caption.
 *
 * The look is flat. No shadow and no gradient. A panel has a 1px `line` edge.
 * The one exception is the `cc-ring` motion of a live avatar.
 */

/* ---- 1. Accent choice (K-143, K-144) -------------------------------------
 * A client sets `accent` and `accent-ink` together. The default is Sun.
 * `accent` is the bright fill. `accent-ink` is accent text, a link and a thin line.
 */
[data-accent="pitch"] { --accent: var(--pitch); --accent-ink: var(--pitch-ink); }
[data-accent="sun"] { --accent: var(--sun); --accent-ink: var(--sun-ink); }
[data-accent="berry"] { --accent: var(--berry); --accent-ink: var(--berry-ink); }
[data-accent="sky"] { --accent: var(--sky); --accent-ink: var(--sky-ink); }

/* ---- 2. Screen shell and page ------------------------------------------- */
/* Every component measures its box inside its edge. */
.cc-ad,
.cc-avatar,
.cc-ball,
.cc-chip,
.cc-cover,
.cc-key,
.cc-menu,
.cc-nav,
.cc-page,
.cc-side,
.cc-swatch,
.cc-switch,
.cc-tool {
  box-sizing: border-box;
}

.cc {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
}

/* The stage of a screen or of a page. The side gutter is space-4 on a phone. */
.cc-screen {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

.cc-scroll {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* The content column of a website page. BRAND-BOOK: maximum width 1280px,
 * side padding space-8. 1280px = 32 x space-10. */
.cc-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  width: 100%;
  max-width: calc(var(--space-10) * 32);
  margin-inline: auto;
  padding-inline: var(--space-8);
}

/* A wide website page holds the side bar and the content side by side.
 * The side bar is 240px = 6 x space-10. tokens.json holds no side bar width. */
.cc-shell {
  display: grid;
  grid-template-columns: calc(var(--space-10) * 6) minmax(0, 1fr);
  min-height: 100%;
  background: var(--bg);
}

/* A row of two actions of the same weight. */
.cc-actions {
  display: flex;
  gap: var(--space-2);
}

.cc-actions > * { flex: 1; }

/* The head of a section: the title and the "See all" action on one line. */
.cc-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

/* A column of lines with the space-1 gap: a title and its hint, a row and its caption. */
.cc-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

/* A row of chips. */
.cc-chips {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* A text link inside a sentence. `link` follows the accent (K-144). The underline is the
 * second sign of a link, so the colour is never the only sign. */
.cc-link {
  color: var(--link);
  text-decoration: underline;
}

/* A row, a bar item, a chip, a key and a button are one control. A control takes no
 * underline when it is a link. Only `.cc-link` is underlined. */
.cc-row,
.cc-nav__item,
.cc-side__item,
.cc-menu__item,
.cc-btn,
.cc-chip,
.cc-ball,
.cc-tab,
.cc-icon-btn,
.cc-key,
.cc-tool,
.cc-swatch,
.cc-switch,
.cc-logo {
  text-decoration: none;
}

/* ---- 3. Rules and dividers ---------------------------------------------- */
/* A 1px rule in `line`. Decoration only. */
.cc-rule {
  height: var(--border-rule);
  background: var(--line);
  border: 0;
  margin: 0;
}

/* ---- 4. Header and navigation (K-146 to K-148) -------------------------- */
/* The header holds the logo or the screen title, one back control, the actions of the
 * screen and the menu. The menu holds Account, Appearance and About. */
.cc-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--touch-min);
  padding: 0 var(--space-4);
  background: var(--surface);
  border-bottom: var(--border-rule) solid var(--line);
}

.cc-header__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* An icon-only control. It is a real button with an accessible name. */
.cc-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  padding: 0;
  border: var(--border-rule) solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
}

.cc-icon-btn:active { background: var(--surface-2); }

/* The bottom bar of the app and of a narrow website. Flat: a `surface` fill and a top
 * rule. The labels are `text-muted`. The current button uses `accent-ink` and weight 700.
 * It holds 4 buttons and no more: Home, Matches, Tournaments, Players. */
.cc-nav {
  display: flex;
  align-items: stretch;
  height: var(--nav-h);
  padding: 0 var(--space-2);
  background: var(--surface);
  border-top: var(--border-rule) solid var(--line);
}

.cc-nav__item {
  flex: 1;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  border: var(--border-rule) solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
}

.cc-nav__item[aria-current="page"] {
  color: var(--accent-ink);
  font-weight: 700;
}

/* The side bar of a wide website. The same items in the same order. */
.cc-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4);
  background: var(--surface);
  border-right: var(--border-rule) solid var(--line);
}

.cc-side__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--touch-min);
  padding: 0 var(--space-3);
  border: var(--border-rule) solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
}

.cc-side__item[aria-current="page"] {
  background: var(--surface-2);
  color: var(--accent-ink);
  font-weight: 700;
}

/* The menu of the header: Account, Appearance, About and Sign out. */
.cc-menu {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: calc(var(--space-10) * 5);
  padding: var(--space-2);
  background: var(--surface);
  border: var(--border-rule) solid var(--line);
  border-radius: var(--radius-md);
}

.cc-menu__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--touch-min);
  padding: 0 var(--space-3);
  border: var(--border-rule) solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  text-align: start;
}

.cc-menu__item:active { background: var(--surface-2); }
.cc-menu__item--danger { color: var(--danger); }

/* ---- 5. Button ---------------------------------------------------------- */
/* One primary button for each screen area. The label is `body` weight 700 in the markup:
 * <button class="cc-btn cc-btn--primary body">Score a match</button> */
.cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--touch-min);
  padding: 0 var(--space-4);
  border: var(--border-rule) solid var(--outline);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

.cc-btn:active { background: var(--surface-2); }

/* The main action: an accent fill with `on-bright` text. */
.cc-btn--primary {
  background: var(--accent);
  color: var(--on-bright);
  border-color: var(--accent);
  font-weight: 700;
}

.cc-btn--primary:active { border-color: var(--on-bright); }

/* A text action, for example "See all". The old variant name `ghost` gives the same look. */
.cc-btn--quiet {
  padding: 0 var(--space-2);
  border-color: transparent;
  background: transparent;
  color: var(--link);
  font-weight: 700;
}

.cc-btn--quiet:active { background: var(--surface-2); }

/* A destructive action. The label holds the verb, for example "Delete account". */
.cc-btn--danger {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--surface);
}

.cc-btn--block { display: flex; width: 100%; }

.cc-btn[disabled] {
  border-color: var(--line);
  color: var(--text-muted);
  background: var(--surface-2);
}

/* ---- 6. Chip ------------------------------------------------------------ */
/* A pill that shows a state. The text is `label-caps` in capitals and holds a word:
 * "LIVE · OVER 14.2", "RESULT", "OFFLINE · 12 BALLS SAVED". */
.cc-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--space-6);
  padding: 0 var(--space-3);
  border: var(--border-rule) solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text);
}

.cc-chip--live {
  background: var(--accent);
  color: var(--on-bright);
  border-color: var(--accent);
}

.cc-chip--result {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--line);
}

.cc-chip--upcoming {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--line);
}

/* The scorer offline chip. It is never red. */
.cc-chip--offline {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--outline);
}

.cc-chip--danger {
  background: var(--surface);
  color: var(--danger);
  border-color: var(--danger);
}

/* Freshness text: "Updated 2s ago". The markup adds `caption` and this class. */
.cc-fresh { color: var(--text-muted); }

/* ---- 7. BallChip -------------------------------------------------------- */
/* One ball of the last over. A round chip: radius-round (BRAND-BOOK). 24px in a list
 * (space-6) and 32px on a hero card (space-8). tokens.json holds no ball chip size. */
.cc-ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--space-6);
  height: var(--space-6);
  border: var(--border-rule) solid var(--line);
  border-radius: var(--radius-round);
  background: var(--surface-2);
  color: var(--text);
}

.cc-ball--hero {
  width: var(--space-8);
  height: var(--space-8);
}

/* Four and six: the accent fill with `on-bright` text (BRAND-BOOK). */
.cc-ball--four,
.cc-ball--six {
  background: var(--accent);
  color: var(--on-bright);
  border-color: var(--accent);
}

/* A wicket: the letter W in `danger` with a `danger` edge. */
.cc-ball--wicket {
  background: var(--surface);
  color: var(--danger);
  border-color: var(--danger);
}

/* An extra: Wd, Nb, Bye, LB. */
.cc-ball--extra {
  background: var(--surface-2);
  color: var(--text-muted);
  border-color: var(--outline);
}

/* A ball that has not happened yet. */
.cc-ball--empty {
  background: transparent;
  color: var(--text-muted);
  border-style: dashed;
  border-color: var(--line);
}

/* ---- 8. ScoreCard ------------------------------------------------------- */
/* The live-score card of a spectator screen. It is a `surface` panel with a 1px `line`
 * edge and no shadow. The numbers use `score-lg` (phone) or `score-xl` (web). */
.cc-score {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface);
  border: var(--border-rule) solid var(--line);
  border-radius: var(--radius-md);
}

.cc-score__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.cc-score__row--baseline { align-items: baseline; }
.cc-score__num { color: var(--text); }
.cc-score__team { color: var(--text); font-weight: 700; }
.cc-score__other { color: var(--text-muted); }

/* The chase line: "Need 27 off 34 balls". Accent ink with a small accent mark. */
.cc-score__need {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--accent-ink);
  font-weight: 700;
}

.cc-score__need::before {
  content: "";
  width: var(--border-1);
  height: var(--space-4);
  background: var(--accent);
}

.cc-score__balls {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* A page hides the chase line when the match has no chase. The rule lets the `hidden`
 * attribute win over the display of the line. */
.cc-score__need[hidden] { display: none; }

/* ---- 9. MatchRow -------------------------------------------------------- */
/* One match in a list. 52px high = touch-min + space-2. The whole row is one tap target. */
.cc-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  /* 52px = touch-min + space-2. The tap target check of the module reads one token value,
   * so `height` gives it the token and `min-height` gives the real height. */
  height: var(--touch-min);
  min-height: calc(var(--touch-min) + var(--space-2));
  padding: var(--space-2) var(--space-3);
  background: var(--surface);
  border: var(--border-rule) solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-align: start;
}

/* Line 1 of a row: the two teams or the name. It is the strong line of the row. */
.cc-row__title { font-weight: 700; }

.cc-row__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cc-row__line { color: var(--text-muted); }
.cc-row__state { flex-shrink: 0; }

/* An avatar: a circle with the initials of a team or of a person. The fill is `surface-2`
 * and the initials are `text`. A team colour is the 1px edge, not a large fill. */
.cc-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: var(--space-8);
  height: var(--space-8);
  border: var(--border-rule) solid var(--line);
  border-radius: var(--radius-round);
  background: var(--surface-2);
  color: var(--text);
}

.cc-avatar--pitch { border-color: var(--pitch); }
.cc-avatar--sun { border-color: var(--sun); }
.cc-avatar--berry { border-color: var(--berry); }
.cc-avatar--sky { border-color: var(--sky); }

/* ---- 10. Tabs ----------------------------------------------------------- */
/* The tabs of a tournament screen: Fixtures, Standings, Overview. The current tab uses
 * `accent-ink` for its underline and weight 700. */
.cc-tabs {
  display: flex;
  border-bottom: var(--border-rule) solid var(--line);
}

.cc-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-min);
  padding: 0 var(--space-2);
  border: 0;
  border-bottom: var(--border-1) solid transparent;
  background: transparent;
  color: var(--text-muted);
}

.cc-tab[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--accent-ink);
  font-weight: 700;
}

/* ---- 11. Table ---------------------------------------------------------- */
/* A table for a scorecard or a leaderboard. The head is `surface-2`. A row divider is a
 * 1px `line`. A number is right aligned with tabular digits. On a small screen the table
 * scrolls sideways in its own box. */
.cc-table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: var(--border-rule) solid var(--line);
  border-radius: var(--radius-sm);
}

.cc-table {
  width: 100%;
  border-collapse: collapse;
}

.cc-table caption {
  caption-side: top;
  padding: var(--space-2) var(--space-3);
  color: var(--text-muted);
  text-align: start;
}

.cc-table th {
  padding: var(--space-2) var(--space-3);
  border-bottom: var(--border-rule) solid var(--line);
  background: var(--surface-2);
  color: var(--text-muted);
  text-align: start;
  font-weight: 700;
}

.cc-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: var(--border-rule) solid var(--line);
  color: var(--text);
}

.cc-table tr:last-child td { border-bottom: 0; }

/* A number cell. */
.cc-num {
  text-align: end;
  font-variant-numeric: tabular-nums;
}

/* A number in the head row of a table is at the end too. */
.cc-table th.cc-num { text-align: end; }

/* The current row, for example the striker in a batting table. */
.cc-table tr[aria-current="true"] td { font-weight: 700; }

/* ---- 12. RunPad --------------------------------------------------------- */
/* The run pad of the scorer. Four columns. A key is `key-h` high (66px) with a 1px
 * `outline` edge. Four and six use the accent fill. W has a `danger` edge. Undo has a
 * dashed edge. No animation. */
.cc-pad {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
}

.cc-key {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--key-h);
  border: var(--border-rule) solid var(--outline);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
}

.cc-key:active { background: var(--line); }

.cc-key--four,
.cc-key--six {
  background: var(--accent);
  color: var(--on-bright);
  border-color: var(--accent);
}

.cc-key--four:active,
.cc-key--six:active {
  background: var(--accent);
  border-color: var(--on-bright);
}

.cc-key--wicket {
  background: var(--surface);
  color: var(--danger);
  border-color: var(--danger);
  border-width: var(--border-1);
  font-weight: 700;
}

.cc-key--undo {
  background: transparent;
  border-style: dashed;
}

/* The tool keys under the run pad: Bowler, Swap ends, End innings and
 * Retire, Penalty, Stop play. Two rows of 3 keys.
 * 52px = touch-min + space-2. */
.cc-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.cc-tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  /* 52px = touch-min + space-2. See the note of `.cc-row`. */
  height: var(--touch-min);
  min-height: calc(var(--touch-min) + var(--space-2));
  padding: var(--space-1);
  border: var(--border-rule) solid var(--outline);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

.cc-tool:active { background: var(--surface-2); }
.cc-tool--danger { color: var(--danger); border-color: var(--danger); }

/* The pad of a match that stopped. The keys are disabled. The screen shows the reason. */
.cc-key[disabled],
.cc-tool[disabled] {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--text-muted);
}

.cc-key[disabled].cc-key--four,
.cc-key[disabled].cc-key--six,
.cc-key[disabled].cc-key--wicket {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--text-muted);
}

/* ---- 13. AppearanceControls -------------------------------------------- */
/* Theme, accent, text size and the two switches. */
.cc-seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.cc-seg__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: var(--touch-min);
  padding: 0 var(--space-2);
  border: var(--border-rule) solid var(--outline);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

.cc-seg__btn[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-bright);
  border-color: var(--accent);
  font-weight: 700;
}

.cc-swatches {
  display: flex;
  gap: var(--space-3);
}

.cc-swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-min);
  height: var(--touch-min);
  padding: 0;
  border: var(--border-1) solid var(--outline);
  border-radius: var(--radius-round);
  color: var(--on-bright);
}

.cc-swatch--pitch { background: var(--pitch); }
.cc-swatch--sun { background: var(--sun); }
.cc-swatch--berry { background: var(--berry); }
.cc-swatch--sky { background: var(--sky); }

.cc-swatch[aria-pressed="true"] { border-color: var(--text); }

/* The switch row is the tap target: a real <button> that holds role="switch". The
 * switch itself is a part of the row and takes no focus. 44px high. */
.cc-switch-row,
.cc-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: var(--touch-min);
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: start;
}

/* 52px wide (space-10 + space-3) and 28px high (space-6 + space-1). */
.cc-switch {
  position: relative;
  width: calc(var(--space-10) + var(--space-3));
  height: calc(var(--space-6) + var(--space-1));
  padding: 0;
  border: var(--border-rule) solid var(--outline);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
}

.cc-switch::after {
  content: "";
  position: absolute;
  top: var(--border-1);
  left: var(--border-1);
  width: var(--space-6);
  height: var(--space-6);
  border-radius: var(--radius-round);
  background: var(--text-muted);
}

.cc-switch-row[aria-checked="true"] .cc-switch,
.cc-field[aria-checked="true"] .cc-switch { background: var(--accent); }

.cc-switch-row[aria-checked="true"] .cc-switch::after,
.cc-field[aria-checked="true"] .cc-switch::after {
  left: calc(100% - var(--space-6) - var(--border-1));
  background: var(--on-bright);
}

/* ---- 14. AdSlot --------------------------------------------------------- */
/* An ad slot appears only on a spectator screen, a list, a result or the website.
 * BRAND-BOOK: banner 358 x 50 on a phone, rectangle 300 x 250 on the web. */
.cc-ad {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 0 var(--space-3);
  border: var(--border-rule) dashed var(--ad-border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
}

.cc-ad--banner {
  width: 358px;
  height: 50px;
  max-width: 100%;
}

.cc-ad--rect {
  width: 300px;
  height: 250px;
  justify-content: center;
}

/* The AD tag. The word is in capitals with `label-caps` in the markup. */
.cc-ad__tag {
  padding: 0 var(--space-2);
  border: var(--border-rule) solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-muted);
}

.cc-ad--rect .cc-ad__tag {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
}

/* ---- 15. EmptyState and ErrorState ------------------------------------- */
/* An empty list, a failed read or an empty chart. A word says what happened. Colour is
 * never the only signal. */
.cc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-4);
  border: var(--border-rule) solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-muted);
  text-align: center;
}

.cc-empty__icon { color: var(--text-muted); }

/* The title of a state is strong text. The hint under it is `text-muted`. */
.cc-empty__title { color: var(--text); }

.cc-error {
  border-color: var(--danger);
}

/* A banner at the top of a screen: the text starts at the start edge. */
.cc-empty--inline {
  align-items: flex-start;
  text-align: start;
}

.cc-error .cc-empty__icon { color: var(--danger); }

/* ---- 16. Cover ---------------------------------------------------------- */
/* The header artwork of a tournament. Thin contour lines in `grid` decorate it. Do not
 * put small text on the lines. No gradient and no shadow. */
.cc-cover {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: var(--border-rule) solid var(--line);
  border-radius: var(--radius-md);
}

.cc-cover__art {
  position: absolute;
  inset: 0 0 0 auto;
  width: 78%;
  height: 100%;
  pointer-events: none;
}

.cc-cover__contour {
  fill: none;
  stroke: var(--grid);
  stroke-width: var(--border-rule);
}

.cc-cover__contour--lead {
  stroke: var(--accent-ink);
  stroke-width: var(--border-1);
}

.cc-cover__body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4);
  min-height: calc(var(--space-10) * 4);
}

/* ---- 17. Scorer screen (K-145) ----------------------------------------- */
/* The screen holds a header, the score block and the pad. It has no navigation bar,
 * no ad and no animation. */
.cc-scorer {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  background: var(--bg);
}

.cc-scorer__body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4) var(--space-4);
}

.cc-scorer__pad {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4) var(--space-4);
  border-top: var(--border-rule) solid var(--line);
  background: var(--bg);
}

/* The score line: 127/3 (16.0) and the two rates. */
.cc-scoreline {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.cc-rates {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-left: auto;
  color: var(--text-muted);
}

/* The chase line of the scorer: "Need 32 from 24 · Target 159". */
.cc-need {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--accent-ink);
  font-weight: 700;
}

.cc-need::before {
  content: "";
  width: var(--border-1);
  height: var(--space-5);
  background: var(--accent);
}

/* One batter or one bowler line. The striker is `accent-ink` with a star. */
.cc-player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: var(--space-8);
  padding: 0;
  color: var(--text);
}

.cc-player--on { color: var(--accent-ink); font-weight: 700; }
.cc-player__name { min-width: 0; }
.cc-player__value { color: var(--text); font-variant-numeric: tabular-nums; }

/* "This over" and the six ball slots. */
.cc-over {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: var(--space-8);
}

.cc-over__balls {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* The save state in the score header: "Saved", "Offline · 12 balls saved". */
.cc-save {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--text-muted);
}

/* ---- 18. Status marks --------------------------------------------------- */
/* A small accent dot for the live state. It always comes with a word. */
.cc-dot {
  display: inline-block;
  width: var(--space-2);
  height: var(--space-2);
  border-radius: var(--radius-round);
  background: var(--accent);
}

.cc-dot--muted { background: var(--text-muted); }
.cc-dot--danger { background: var(--danger); }

/* ---- 19. Logo ----------------------------------------------------------- */
/* The logo is the lockup file of TASK-135: the mark and the wordmark, with the red
 * leather ball in place of the dot. It is not a text style: do not type the wordmark.
 * The wordmark is 24px in a header, so the small form of the lockup is used. */
.cc-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
}

.cc-logo__lockup,
.cc-logo__mark {
  display: block;
  height: calc(var(--space-4) + var(--space-1));
  width: auto;
}

/* ---- 20. Focus ring (BRAND-BOOK) --------------------------------------- */
/* 3px solid `focus-ring` with a 3px offset. Both values are 3 x border-rule. */
.cc-btn:focus-visible,
.cc-icon-btn:focus-visible,
.cc-key:focus-visible,
.cc-tool:focus-visible,
.cc-tab:focus-visible,
.cc-seg__btn:focus-visible,
.cc-swatch:focus-visible,
.cc-switch:focus-visible,
.cc-nav__item:focus-visible,
.cc-side__item:focus-visible,
.cc-menu__item:focus-visible,
.cc-row:focus-visible,
.cc-ball:focus-visible,
.cc-link:focus-visible {
  outline: calc(var(--border-rule) * 3) solid var(--focus-ring);
  outline-offset: calc(var(--border-rule) * 3);
}

/* ---- 21. Motion (BRAND-BOOK) ------------------------------------------- */
/* A changed number pops. A new line drops. A live avatar rings. Stop all three when the
 * user asks for less motion. The scorer screen uses none of them. */
@keyframes cc-pop {
  0% { transform: scale(0.9); }
  60% { transform: scale(1.06); }
  100% { transform: none; }
}

@keyframes cc-drop {
  0% { transform: translateY(calc(var(--space-3) * -1)); }
  100% { transform: none; }
}

@keyframes cc-ring {
  0% { box-shadow: 0 0 0 0 var(--accent); }
  100% { box-shadow: 0 0 0 var(--space-2) transparent; }
}

.cc-pop { animation: cc-pop 0.5s ease-out; }
.cc-drop { animation: cc-drop 0.5s ease-out; }
.cc-ring { animation: cc-ring 1.5s infinite; }

@media (prefers-reduced-motion: reduce) {
  .cc-pop, .cc-drop, .cc-ring { animation: none; }
}

[data-motion="reduce"] .cc-pop,
[data-motion="reduce"] .cc-drop,
[data-motion="reduce"] .cc-ring {
  animation: none;
}