:root {
  /* ScoreClays palette (Gary's design principles, 2026-11-21 —
     recorded in TASKS.md): one paper-scorecard-inspired system.
     Warm earth tones on card stock; CLAY ORANGE (the orange of a
     clay target) is the action/highlight colour; the dark is an
     inky charcoal — pen/pencil ink on the card — used for text,
     rules and dark surfaces. NO pure black anywhere. Scoring Mode
     stays strictly paper-like; interface screens may be more
     app-like inside the same system. Meaning is never carried by
     colour alone (marks, labels and numbers always ride along). */
  --paper: #faf6ec;
  --card: #fffdf7;
  --ink: #2b2620;
  --muted: #6f6353;
  --line: #ddd2bf;
  --earth: #5d4a33;
  --clay: #e85d1f;
  --clay-deep: #bc4a15;
  --green: #1f3d2b;
  --warn-bg: #fdf3e0;
  --warn-line: #d9a441;
  /* Foreground on filled action surfaces (clay / green buttons). */
  --on-accent: #fff;
  /* Danger (form errors) — the one place a red family appears; the
     text and border carry the meaning, never the colour alone. */
  --danger-ink: #8c2b1d;
  --danger-bg: #fbeae6;
  --danger-line: #d9a091;
  /* Corner radii — one small scale, used everywhere. */
  --radius-s: 8px;
  --radius-m: 10px;
  --radius-l: 12px;
  --radius-xl: 14px;
  --radius-pill: 999px;
  /* Motion (Gary, 2026-11-21): short, ease-out, decoration only —
     animation never gates input. */
  --dur-press: 120ms;
  --dur-ui: 150ms;
  --dur-expand: 200ms;
  --dur-screen: 220ms;
  --ease-out: ease-out;
  /* Sheets float above the screen flow; nothing else stacks. */
  --z-sheet: 10;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--paper);
}

button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius-m);
  padding: 0.6rem 1rem;
  color: var(--ink);
  /* Touch-target floor outside Scoring Mode (whose controls are
     sized by PRD §10 and override this where they differ). */
  min-height: 44px;
}

/* Keyboard focus is always visible: a clay-deep ring, offset so
   it never merges with the control's own border. Nothing in the
   app removes outlines; this makes the ring deliberate and
   on-palette on every surface. */
:focus-visible {
  outline: 3px solid var(--clay-deep);
  outline-offset: 2px;
}

button.primary {
  background: var(--clay-deep);
  border-color: var(--clay-deep);
  color: var(--on-accent);
  font-weight: 600;
}

button:disabled {
  opacity: 0.45;
  cursor: default;
}

.big-btn {
  display: block;
  width: 100%;
  min-height: 56px;
  font-size: 1.15rem;
  margin-top: 1.25rem;
}

.row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.hint {
  color: var(--muted);
}

.shell {
  max-width: 40rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

h1 {
  color: var(--earth);
  font-size: 2.25rem;
  margin: 0 0 0.25rem;
}

.tagline {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.build-marker {
  display: inline-block;
  margin: 0.25rem 0 0;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: 0.85rem;
}

.doors {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.door {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 1.25rem;
}

.door h2 {
  margin: 0 0 0.5rem;
  font-size: 1.3rem;
  color: var(--green);
}

.door p {
  margin: 0 0 0.5rem;
}

.coming {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.resume-card {
  margin-top: 1.5rem;
  background: var(--card);
  border: 1px solid var(--warn-line);
  border-radius: var(--radius-l);
  padding: 1rem 1.25rem;
}

footer {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------------- Setup ---------------- */

.back {
  margin-bottom: 0.5rem;
}

.template-choice {
  display: block;
  width: 100%;
  text-align: left;
  margin: 0.5rem 0;
  min-height: 56px;
  font-weight: 600;
}

.template-title {
  font-weight: 700;
  margin: 1rem 0 0.25rem;
}

.template-menu {
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.warnings {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: var(--radius-m);
  padding: 0.5rem 1rem;
  margin: 0.75rem 0;
}

.shooter-row {
  display: flex;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

/* One text-input look for the name-style fields wherever they
   appear (setup shooters, fixture guests, team create) — these
   share the rule instead of some rendering as bare browser
   inputs. */
.shooter-name,
.shooter-handle,
.fixture-guest-name,
#team-name {
  font: inherit;
  min-height: 52px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--card);
  color: var(--ink);
}

.shooter-name {
  flex: 1;
}

.fixture-guest-name {
  display: block;
  width: 100%;
  margin: 0.5rem 0;
}

.shooter-remove {
  min-width: 52px;
}

/* The setup screen's full-width selects (scorer, presentation
   variant) share one rule — the variant picker used to render as
   a bare browser select. */
#scorer-select,
#variant-select {
  font: inherit;
  width: 100%;
  min-height: 52px;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--card);
  color: var(--ink);
}

/* ---------------- Scoring Mode ----------------
   PRD §10 sizes are requirements, not taste:
   - HIT + MISS together fill >= 70% of usable height (flex 44 + 30
     of the column), each at least 120pt (= 160px) tall, fixed order:
     HIT upper, MISS directly under it. They never move or swap.
   - The Problem strip is deliberately small (well under the 56pt cap).
   - Hit/miss are distinguished by label, glyph (/ vs –) and position,
     never by colour alone. */

.scoring {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 44rem;
  margin: 0 auto;
  padding: 0.5rem 0.75rem;
  background: var(--card);
}

.strip-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.strip {
  display: flex;
  gap: 0.4rem;
}

.box {
  flex: 1;
  border: 2px solid var(--ink);
  border-radius: var(--radius-s);
  min-height: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--card);
  padding: 0.15rem;
}

.box .box-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.box .box-mark {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.1;
  min-height: 1.9rem;
}

.box.current {
  outline: 4px solid var(--green);
  outline-offset: 1px;
  transform: scale(1.05);
}

.box.unscored {
  opacity: 0.55;
}

.box.big {
  min-height: 60px;
  min-width: 52px;
}

.seeall {
  align-self: flex-end;
  border: none;
  background: none;
  color: var(--green);
  font-weight: 600;
  padding: 0.25rem;
  min-height: 40px;
}

.scoring-header {
  padding: 0.4rem 0.1rem;
}

.hdr-shooter {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
}

.hdr-detail {
  font-size: 1.05rem;
  color: var(--ink);
}

.hdr-score {
  font-size: 1.05rem;
  color: var(--muted);
}

.btn-hit,
.btn-miss {
  width: 100%;
  border: none;
  border-radius: var(--radius-xl);
  color: var(--on-accent);
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  min-height: 160px;
  margin-top: 0.5rem;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.btn-hit {
  background: var(--green);
  flex: 44 1 0;
}

.btn-miss {
  background: var(--ink);
  flex: 30 1 0;
}

.btn-mark {
  font-size: 3rem;
  margin-right: 0.75rem;
}

.scoring-bottom {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.scoring-bottom button {
  flex: 1;
  height: 48px;
  font-weight: 600;
}

#btn-exit.holding {
  background: var(--warn-bg);
  border-color: var(--warn-line);
}

.exit-bar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  padding: 0.5rem;
  border: 1px solid var(--warn-line);
  border-radius: var(--radius-m);
  background: var(--warn-bg);
}

.sync-line {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.4rem 0 0;
}

.sheet {
  position: fixed;
  inset: auto 0 0 0;
  background: var(--card);
  border-top: 2px solid var(--ink);
  padding: 1rem;
  z-index: var(--z-sheet);
}

.sheet-title {
  font-weight: 700;
  margin: 0 0 0.75rem;
}

.problem-choices {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.problem-choice {
  min-height: 56px;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: left;
}

/* ---------------- Stand summary / See all / scorecard ---------------- */

.marks-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.5rem 0;
}

.marks-name {
  flex: 0 0 6.5rem;
  font-weight: 700;
  font-size: 1.05rem;
}

.marks-boxes {
  display: flex;
  gap: 0.35rem;
  flex: 1;
}

.marks-boxes .box {
  flex: 1;
}

.summary-progress {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 1.25rem 0 0;
}

.correction-bar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  border: 1px solid var(--warn-line);
  background: var(--warn-bg);
  border-radius: var(--radius-m);
  padding: 0.6rem 0.75rem;
  margin: 0.75rem 0;
}

.seeall-station {
  margin-bottom: 1.25rem;
}

.seeall-total {
  font-size: 1.4rem;
  font-weight: 700;
}

.finish-row {
  font-size: 1.6rem;
  font-weight: 700;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}

.card-where {
  font-size: 1.1rem;
  margin: 0.25rem 0;
}

.card-meta {
  color: var(--muted);
  margin: 0 0 1rem;
}

.card-shooter {
  margin-bottom: 1.5rem;
}

.card-shooter h3 {
  color: var(--green);
  margin: 0 0 0.25rem;
}

/* Accounts (Slice 2) */

.account-area {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  color: var(--muted);
}

.field {
  display: block;
  margin: 0.75rem 0;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.6rem;
  font: inherit;
  font-weight: 400;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--card);
  color: var(--ink);
}

.field input,
.field select {
  min-height: 44px;
}

.field-inline {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0.75rem 0;
  font-weight: 600;
}

.form-error {
  color: var(--danger-ink);
  background: var(--danger-bg);
  border: 1px solid var(--danger-line);
  border-radius: var(--radius-m);
  padding: 0.6rem 0.8rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
  text-transform: capitalize;
}

.history-row {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
}

.shooter-handle {
  max-width: 11rem;
}

/* Venues & template builder (Slice 3) */

#venue-search {
  flex: 1;
  min-width: 12rem;
  min-height: 44px;
  padding: 0.6rem;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--card);
  color: var(--ink);
}

#venue-results {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
}

#course-link {
  flex: 1;
  min-height: 44px;
  padding: 0.6rem;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--card);
  color: var(--ink);
}

.station-number {
  width: 4.5rem;
  min-height: 44px;
  padding: 0.5rem;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
}

.station-notes {
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 0.5rem 0;
  padding: 0.5rem;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
}

.target-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
}

.target-seq {
  font-weight: 700;
  color: var(--green);
  min-width: 2rem;
}

.target-row select,
.target-row input {
  min-height: 44px;
  padding: 0.45rem;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--card);
  color: var(--ink);
}

.target-pair {
  width: 4.5rem;
}

.target-trap {
  flex: 1;
  min-width: 7rem;
}

#builder-error {
  white-space: pre-line;
}

/* ---- Leagues (Slice 5) ---- */

.tabs {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
}

.tab {
  flex: 1;
  padding: 0.6rem;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}

.tab.active {
  background: var(--green);
  color: var(--on-accent);
  border-color: var(--green);
}

.rules-summary p {
  margin: 0.25rem 0;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 1rem;
}

.standings-table th,
.standings-table td {
  text-align: left;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.standings-table td.weeks {
  font-size: 0.85em;
  color: var(--muted);
}

.dropped {
  text-decoration: line-through;
  opacity: 0.65;
}

/* Live view (Slice 6, FR-505) — spectator rendering: big type, the
   same slash/dash boxes as the paper card, no interactive styling
   because there is nothing here to interact with. */
.live-banner {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: var(--radius-m);
  padding: 0.6rem 1rem;
  font-weight: 600;
}

.live-progress {
  font-size: 1.15rem;
  font-weight: 600;
}

.live-shooter,
.live-shooter-name {
  margin: 0 0 0.25rem;
  font-size: 1.4rem;
}

.live-total {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
  font-weight: 700;
}

.live-station {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.3rem 0;
}

.live-station-name {
  min-width: 4.5rem;
  color: var(--muted);
  font-weight: 600;
}

/* Slice 7: venue problem inbox + allowed users. Safety is flagged
   with icon, words, position and a heavy border — the amber tint is
   only one cue among several, never the only one. */
.inbox-badge {
  display: inline-block;
  border: 1px solid var(--warn-line);
  background: var(--warn-bg);
  border-radius: var(--radius-pill);
  padding: 0.1rem 0.6rem;
  font-size: 0.85rem;
  font-weight: 700;
  vertical-align: middle;
}

.inbox-filters {
  align-items: end;
}

/* Inbox entries get the same ruled-card treatment as review and
   claim cards (a 2px rule between entries) instead of floating
   as unstyled text blocks. The safety variant's full border
   below still overrides the top rule. */
.problem-event {
  border-top: 2px solid var(--line);
  padding: 0.75rem 0;
}

.problem-event h3 {
  margin: 0 0 0.5rem;
}

.problem-event p {
  margin: 0.25rem 0;
}

.problem-safety {
  border: 3px solid var(--warn-line);
  background: var(--warn-bg);
}

.problem-resolved {
  opacity: 0.65;
}

.allowed-user-row {
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--card);
  padding: 0.6rem 1rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

/* ---- Reviews & business claims (Slice 8) ----
   Paper-card language inside the interface screens: ruled lines
   between entries, stars in clay orange ALWAYS paired with the
   numeric average (never colour alone), difficulty shown as a
   labelled level, never as stars. */

.review-headline {
  font-size: 1.15rem;
  margin: 0.5rem 0;
}

.review-stars {
  color: var(--clay-deep);
  letter-spacing: 0.08em;
}

.review-breakdown {
  margin: 0.5rem 0;
}

.review-breakdown .stat-row {
  border-bottom: 1px solid var(--line);
  padding: 0.3rem 0;
}

.review-difficulty {
  font-weight: 600;
  color: var(--earth);
}

.review-card,
.claim-card {
  border-top: 2px solid var(--line);
  padding: 0.75rem 0;
}

.review-card p,
.claim-card p {
  margin: 0.3rem 0;
}

.review-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.shot-here-badge {
  display: inline-block;
  border: 1px solid var(--earth);
  color: var(--earth);
  border-radius: var(--radius-pill);
  padding: 0 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.star-picker {
  display: flex;
  gap: 0.35rem;
  margin: 0.35rem 0 0.75rem;
}

.star-picker button {
  min-width: 52px;
  min-height: 52px;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  background: var(--card);
}

/* Filled stars: glyph change (★ vs ☆) + weight + border carry
   the state, never colour alone. The .set class is the visual
   fill; aria-checked on the chosen value carries it to AT. */
.star-picker button.set {
  color: var(--clay-deep);
  border-color: var(--clay-deep);
  font-weight: 700;
}

.difficulty-picker button {
  font-size: 1.05rem;
  font-weight: 600;
}

.review-form label.field {
  margin-top: 0.9rem;
}

.claim-status-line {
  border: 1px solid var(--line);
  border-left: 5px solid var(--clay);
  background: var(--card);
  border-radius: var(--radius-m);
  padding: 0.6rem 1rem;
}

.claim-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--card);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.search-result-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--card);
  padding: 0.6rem 1rem;
  margin-bottom: 0.6rem;
}

.search-result-card .template-choice {
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 0.2rem 0;
}

.breakdown-toggle {
  margin-top: 0.35rem;
}

/* ---- Motion (Gary, 2026-11-21) ----
   Subtle and short (150–300ms, ease-out), decoration only:
   animation NEVER gates input — a tap registers instantly and the
   motion plays on top of the already-changed state. In Scoring
   Mode the next target is scorable the moment the mark lands;
   nothing here touches the scoring loop. Reduced-motion turns
   all of it off. A full motion pass over the older screens rides
   with the re-theme follow-up. */

.screen {
  animation: screen-in var(--dur-screen) var(--ease-out);
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

button {
  transition:
    background-color var(--dur-ui) var(--ease-out),
    border-color var(--dur-ui) var(--ease-out),
    color var(--dur-ui) var(--ease-out);
}

.review-breakdown:not([hidden]),
.claim-group,
.review-card {
  animation: expand-in var(--dur-expand) var(--ease-out);
}

@keyframes expand-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.star-picker button {
  transition:
    transform var(--dur-press) var(--ease-out),
    color var(--dur-ui) var(--ease-out),
    border-color var(--dur-ui) var(--ease-out);
}

.star-picker button:active {
  transform: scale(0.9);
}

/* ---- Slice 9: offerings & business console ---- */

.offering-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0;
}

.offering-chip {
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-pill);
  padding: 0.15rem 0.7rem;
  background: var(--card);
  font-weight: 600;
  white-space: nowrap;
}

.offerings-empty {
  font-style: italic;
}

.offering-group {
  margin: 0.35rem 0;
}

.offering-main {
  font-weight: 600;
  display: block;
  padding: 0.3rem 0;
}

.offering-variants {
  margin-left: 1.8rem;
  animation: expand-in var(--dur-expand) var(--ease-out);
}

.offering-variants[hidden] {
  display: none;
}

.offering-variant {
  display: block;
  padding: 0.2rem 0;
}

.offering-group input[type="checkbox"] {
  width: 1.3rem;
  height: 1.3rem;
  accent-color: var(--clay-deep);
  vertical-align: -0.25rem;
}

.console-tabs {
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.6rem 0 1rem;
}

/* Console tabs are the shared .tab component at natural width —
   seven of them must wrap, not squeeze into one row. */
.console-tabs .tab {
  flex: 0 1 auto;
}

.console-card {
  margin-bottom: 1rem;
}

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