/* Byb. Layout: one phone-width column, a fixed tab bar on the main screens. */
:root {
  --ground: #f3f5f1; --paper: #ffffff; --ink: #17201a; --muted: #5d6a60; --line: #d9ded5; --line-soft: #eef1ec;
  --pitch: #1f6b3a; --pitch-ink: #ffffff; --pitch-soft: #e2eee5; --pitch-deep: #143f24;
  --bib: #e8681f; --bib-text: #c4520f; --blue: #2b4f8a; --gold: #e3b04f; --boost: #9fe0b4;
  --warn-bg: #fbf0d9; --warn-ink: #6e4600; --danger: #b3261e; --danger-bg: #fbeae8; --danger-line: #e4b7b3;
  --chip: #e4e9e2; --field: #ffffff; --field-line: #c9d1c6; --shadow: 0 10px 30px rgba(23,32,26,.18);
  --rate-hi: #1f6b3a; --rate-mid: #9a6200;
  --display: 'Saira Condensed', 'Arial Narrow', sans-serif; --word: 'Saira', 'Arial Black', sans-serif; --body: 'Barlow', 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0f1611; --paper: #161f19; --ink: #e8eee9; --muted: #9fb09f; --line: #2a352d; --line-soft: #202a23;
    --pitch: #2f8a50; --pitch-soft: #1b2e21; --pitch-deep: #10301c; --bib-text: #f08a4b; --blue: #6f95d6;
    --warn-bg: #33270f; --warn-ink: #f0cf8a; --danger: #f2867e; --danger-bg: #3a1d1b; --danger-line: #6b2f2b;
    --chip: #222d25; --field: #1b251e; --field-line: #34413a; --shadow: 0 10px 30px rgba(0,0,0,.5);
    --rate-hi: #9fe0b4; --rate-mid: #e3b04f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #0f1611; --paper: #161f19; --ink: #e8eee9; --muted: #9fb09f; --line: #2a352d; --line-soft: #202a23;
  --pitch: #2f8a50; --pitch-soft: #1b2e21; --pitch-deep: #10301c; --bib-text: #f08a4b; --blue: #6f95d6;
  --warn-bg: #33270f; --warn-ink: #f0cf8a; --danger: #f2867e; --danger-bg: #3a1d1b; --danger-line: #6b2f2b;
  --chip: #222d25; --field: #1b251e; --field-line: #34413a; --shadow: 0 10px 30px rgba(0,0,0,.5);
  --rate-hi: #9fe0b4; --rate-mid: #e3b04f;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--ink); }
body { font: 400 16px/1.45 var(--body); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: var(--pitch); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--bib); outline-offset: 2px; border-radius: 6px; }
h1[tabindex="-1"]:focus, h1[tabindex="-1"]:focus-visible { outline: none; }
[hidden] { display: none !important; }
img { max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding-bottom: env(safe-area-inset-bottom); }
.app[data-tab="yes"] { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
.screen { display: flex; flex-direction: column; gap: 14px; padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 20px max(16px, env(safe-area-inset-left)); }
.pad { padding-top: 28px; }
.loading { display: grid; place-items: center; min-height: 60vh; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--pitch-soft); border-top-color: var(--pitch); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } * { scroll-behavior: auto !important; } }

/* type */
.h1 { margin: 0; font: 800 30px/1.02 var(--display); text-transform: uppercase; letter-spacing: .005em; text-wrap: balance; }
.h1.big { font-size: 38px; }
.h2 { margin: 0; font: 800 22px/1.05 var(--display); text-transform: uppercase; text-wrap: balance; }
.h3 { margin: 0; font: 700 17px/1.3 var(--body); }
.label { font: 600 12px/1.2 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.big-num { font: 800 34px/1 var(--display); font-variant-numeric: tabular-nums; }
.center { text-align: center; }
p { margin: 0; }
.err { color: var(--danger); font-weight: 600; font-size: 14px; }

/* layout */
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row.top { align-items: flex-start; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack.lg { gap: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* header */
.topbar { display: flex; align-items: center; gap: 6px; min-height: 44px; }
.topbar-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.iconbtn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 0; background: none; color: var(--ink); text-decoration: none; flex: none; position: relative; }
.iconbtn.back { margin-left: -12px; }
/* A tight group of header icons (Help, notifications). The last icon's glyph lines up with the content edge. */
.icons { display: flex; align-items: center; flex: none; }
.icons .iconbtn { width: 32px; }
.icons .iconbtn + .iconbtn { margin-left: -8px; }   /* the glyphs sit about 8px apart */
.icons.edge { margin-right: -8.5px; }
.icons .dot { right: 0; }
.iconbtn.edge { margin-right: -11px; }
.dot { position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bib); color: #fff; font: 700 11px/18px var(--body); text-align: center; }

/* cards */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.card.flush { padding: 0; gap: 0; overflow: hidden; }
.card.green { background: var(--pitch); color: #fff; border: 0; }
/* the next game card drawn as a pitch: faint white markings behind the content, no stripes */
.card.pitch { position: relative; overflow: hidden; isolation: isolate; }
.card.pitch > .lines { position: absolute; left: 8px; top: 8px; width: calc(100% - 16px); height: calc(100% - 16px); overflow: visible; pointer-events: none; z-index: -1; }
.card.pitch > .lines * { fill: none; stroke: rgba(255,255,255,.2); stroke-width: 1.5; }
.card.pitch > .lines .spot { fill: rgba(255,255,255,.2); stroke: none; }
/* In / Out on the next game card: solid, raised buttons that press down when tapped */
.btn.inout { border: 0; background: color-mix(in srgb, var(--pitch) 80%, #fff); color: #fff; cursor: pointer; -webkit-tap-highlight-color: transparent;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.4), 0 4px 0 rgba(0,0,0,.22), 0 6px 14px rgba(0,0,0,.14);
  transition: transform .08s ease, box-shadow .08s ease, background-color .15s ease; }
.btn.inout:hover { background: color-mix(in srgb, var(--pitch) 72%, #fff); }
.btn.inout:active { transform: translateY(3px); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.4), 0 1px 0 rgba(0,0,0,.22); }
.btn.inout[aria-pressed="true"] { background: #fff; color: var(--pitch); box-shadow: 0 4px 0 rgba(0,0,0,.22), 0 6px 14px rgba(0,0,0,.14); }
.btn.inout[aria-pressed="true"]:active { box-shadow: 0 1px 0 rgba(0,0,0,.22); }
.btn.inout svg { flex: none; }
.card.pitch .grid2 { padding-bottom: 4px; }
.inout-ask { font: 600 14px var(--body); margin-bottom: -4px; }
@media (prefers-reduced-motion: reduce) { .btn.inout { transition: none; } .btn.inout:active { transform: none; } }
.card.warn { background: var(--warn-bg); color: var(--warn-ink); border: 0; }
.card.danger { background: var(--danger-bg); color: var(--danger); border: 0; }
.card.soft { background: var(--pitch-soft); border-color: transparent; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 0 12px; min-height: 52px; border: 0; border-top: 1px solid var(--line-soft); background: var(--paper); width: 100%; text-align: left; color: var(--ink); text-decoration: none; }
.list-row:first-child { border-top: 0; }
a.list-row:hover, button.list-row:hover { background: var(--ground); }
.list-row .name { font-weight: 600; }
.link-name { color: var(--pitch); font-weight: 600; text-decoration: underline; text-decoration-color: var(--field-line); text-underline-offset: 3px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--field-line); background: var(--paper); color: var(--ink); font: 700 16px var(--body); text-decoration: none; text-align: center; }
.btn.primary { background: var(--pitch); border-color: var(--pitch); color: #fff; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.btn.danger { color: var(--danger); border-color: var(--danger-line); }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.big { min-height: 54px; font-size: 17px; }
.btn.small { min-height: 40px; padding: 0 12px; font-size: 14px; border-radius: 10px; font-weight: 600; }
.btn.block { width: 100%; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--pitch); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn[data-busy] { opacity: .7; }
.linkbtn { border: 0; background: none; padding: 4px 0; color: var(--pitch); font: 600 15px var(--body); text-decoration: underline; text-underline-offset: 3px; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--field-line); background: var(--paper); font: 600 14px var(--body); color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.chip.green.on { background: var(--pitch); border-color: var(--pitch); color: #fff; }
.chip.bib.on { background: #b4511a; border-color: #b4511a; color: #fff; }
.chip.blue.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip.dashed { border-style: dashed; color: var(--pitch); background: transparent; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font: 700 12px var(--body); white-space: nowrap; }
.pill.owed { background: var(--warn-bg); color: var(--warn-ink); }
.pill.paid { background: var(--pitch-soft); color: var(--pitch); }
:root[data-theme="dark"] .pill.paid { color: var(--boost); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill.paid { color: var(--boost); } }
.pill.grey { background: var(--chip); color: var(--muted); }
.tag { font: 700 10px var(--body); letter-spacing: .06em; border: 1px solid currentColor; border-radius: 4px; padding: 1px 5px; white-space: nowrap; }
.tag.new { color: var(--blue); }
.tag.role { color: var(--pitch); }

/* forms */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .field > .label { font: 600 12px var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; min-width: 0; height: 48px; border-radius: 12px; border: 1px solid var(--field-line); background: var(--field); padding: 0 12px; font: 500 16px var(--body); color: var(--ink); }
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; }
.input:focus { border-color: var(--pitch); }
.hint { font-size: 13px; color: var(--muted); }
.switch { position: relative; width: 52px; height: 32px; border-radius: 16px; border: 0; padding: 0; background: var(--field-line); flex: none; }
.switch span { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
.switch.on { background: var(--pitch); }
.switch.on span { left: 23px; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--field-line); background: var(--ground); font: 700 20px var(--body); color: var(--ink); }
.stepper .val { min-width: 34px; text-align: center; font: 800 24px var(--display); font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; accent-color: var(--pitch); height: 30px; }
/* a rating from 1 to 99: − [box] + */
.stepper.rate-step { gap: 6px; flex: none; }
.stepper.rate-step button { width: 44px; height: 44px; flex: none; display: grid; place-items: center; padding: 0; }
.stepper.rate-step button:disabled { opacity: .4; cursor: default; }
.stepper.rate-step .input { width: 56px; height: 44px; padding: 0 4px; text-align: center; font: 800 22px var(--display); font-variant-numeric: tabular-nums; }

.seg { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; background: var(--chip); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: 600 15px var(--body); }
.seg button.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }

/* avatars and badges */
.avatar { display: grid; place-items: center; flex: none; border-radius: 50%; color: #fff; font-family: var(--display); font-weight: 800; object-fit: cover; }
.badge { display: grid; place-items: center; flex: none; border-radius: 10px; color: #fff; font-family: var(--display); font-weight: 800; }
.logo { flex: none; display: block; }
.wordmark-svg { display: block; flex: none; }
.wordmark { font: 800 22px/1 var(--word); letter-spacing: -.02em; }

/* tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 520px; margin: 0 auto; background: var(--paper); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 64px; color: var(--muted); text-decoration: none; font: 500 12px var(--body); }
.tab.on { color: var(--pitch); font-weight: 700; }
:root[data-theme="dark"] .tab.on { color: var(--boost); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tab.on { color: var(--boost); } }

/* toast and dialogs */
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); width: min(92vw, 480px); background: var(--ink); color: var(--ground); border-radius: 12px; padding: 12px 14px; font: 600 15px var(--body); text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); color: #fff; }
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(14,20,16,.55); display: grid; place-items: center; padding: 20px; }
.scrim.bottom { place-items: end center; padding: 10px; }
.dialog { width: min(100%, 440px); background: var(--paper); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); max-height: 90vh; overflow: auto; }
.dialog-body { display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.dialog-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--danger-bg); color: var(--danger); display: grid; place-items: center; }
.sheet { width: min(100%, 500px); background: var(--paper); border-radius: 20px; padding: 18px 16px 22px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }

/* empty states */
.empty { display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; padding: 24px 12px; }

/* the dark match screen */
.dark-screen { --ground: #0e1410; --paper: #18201b; --ink: #e8eee9; --muted: #9aa89e; --line: #2a352d; --line-soft: #202a23; --field: #18201b; --field-line: #34413a; --chip: #18201b; background: #0e1410; color: #e8eee9; color-scheme: dark; }
body:has(.dark-screen) { background: #0e1410; }

/* player card */
.pcard { background: var(--pitch-deep); color: #fff; border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; }
.pcard > * { position: relative; }
.pcard .pgroup { align-self: stretch; text-align: center; font: 700 12px var(--body); letter-spacing: .14em; text-transform: uppercase; opacity: .85;
  padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.18); overflow-wrap: anywhere; }
.pcard .phead { display: flex; align-items: center; gap: 16px; padding: 2px 0 2px; }
.pcard .phead::before { content: ''; position: absolute; left: -53px; top: 50%; width: 210px; height: 210px; margin-top: -105px; border-radius: 50%; border: 2px solid rgba(255,255,255,.08); pointer-events: none; }
.pcard .pphoto { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 3px rgba(255,255,255,.16); }
.pcard span.pphoto { background: var(--bib); font-size: 38px; }
.pcard .pinfo { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 6px; }
.pcard .prating { display: flex; align-items: baseline; gap: 4px; }
.pcard .ovr { font: 800 52px/.85 var(--display); font-variant-numeric: tabular-nums; }
.ovr-label { font: 700 13px var(--body); letter-spacing: .08em; opacity: .85; }
.pcard .pmeta { display: flex; align-items: center; gap: 8px; }
.pcard .ppos { font: 700 14px var(--body); letter-spacing: .08em; }
.pcard .tier { font: 800 12px var(--body); letter-spacing: .1em; color: #143f24; border-radius: 4px; padding: 2px 6px; }
.pcard .pname { font: 800 30px/1 var(--display); text-transform: uppercase; overflow-wrap: anywhere; margin-top: 2px; }
.pcard .pbadges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.pcard .stat { display: flex; flex-direction: column; align-items: center; gap: 2px; background: rgba(255,255,255,.08); border-radius: 8px; padding: 6px 0; }
.pcard .stat b { font: 800 24px/1 var(--display); font-variant-numeric: tabular-nums; display: inline-flex; gap: 1px; align-items: flex-start; }
.pcard .stat span { font: 700 11px var(--body); letter-spacing: .08em; opacity: .85; }
.pcard .up { color: var(--boost); margin-top: 2px; }
.pcard .chipline { font: 600 12px var(--body); background: rgba(255,255,255,.14); border-radius: 999px; padding: 3px 8px; }
.pcard .totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; text-align: center; border-top: 1px solid rgba(255,255,255,.18); padding-top: 10px; }
.pcard .totals b { font: 800 22px/1 var(--display); display: block; }
.pcard .totals span { font-size: 11px; opacity: .85; }
.form-dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 700 13px var(--body); text-decoration: none; flex: none; }
.form-dot.W { background: var(--pitch); color: #fff; }
.form-dot.L { background: var(--line); color: var(--ink); }
.form-dot.D { border: 2px solid var(--muted); color: var(--muted); }

/* teams */
.team-head { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; color: #fff; font: 800 17px var(--display); text-transform: uppercase; }
.pl { display: flex; align-items: center; gap: 6px; padding: 0 8px; min-height: 36px; border: 0; border-top: 1px solid var(--line-soft); background: var(--paper); width: 100%; text-align: left; color: var(--ink); font-size: 14px; }
.pl .pos { font: 700 10px var(--body); color: var(--muted); width: 26px; flex: none; }
.pl .r { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: var(--chip); border-radius: 4px; overflow: hidden; display: flex; }
.bar span { display: block; height: 100%; border-radius: 4px; }
.h2h { display: grid; grid-template-columns: 26px minmax(0, 1fr) 74px minmax(0, 1fr) 26px; gap: 6px; align-items: center; font-size: 14px; font-variant-numeric: tabular-nums; }
.h2h .l { text-align: center; font: 600 10px var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.h2h .win { font-weight: 700; }
.h2h .lose { color: var(--muted); }

/* table */
.trow { display: grid; grid-template-columns: 22px minmax(0, 1fr) 24px 24px 24px 24px 24px 32px; gap: 4px; align-items: center; padding: 0 10px; min-height: 44px; font-size: 14px; font-variant-numeric: tabular-nums; border: 0; border-top: 1px solid var(--line-soft); background: var(--paper); color: var(--ink); width: 100%; text-align: left; }
.trow.head { min-height: 32px; font: 600 11px var(--body); letter-spacing: .06em; color: var(--muted); background: var(--ground); border-top: 0; }
.trow > :nth-child(n+3) { text-align: right; }
.trow .pts { font: 800 18px var(--display); color: var(--pitch); }

/* misc */
.notice { display: flex; align-items: center; gap: 10px; font-size: 14px; border-radius: 12px; padding: 10px 12px; }
.notice.green { background: var(--pitch-soft); }
.notice.orange { background: #fbe7da; color: #6b2c08; }
:root[data-theme="dark"] .notice.orange { background: #3a2415; color: #f3c3a0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .notice.orange { background: #3a2415; color: #f3c3a0; } }
.notice.warn { background: var(--warn-bg); color: var(--warn-ink); }
.kv { display: flex; justify-content: space-between; gap: 10px; }
.divider { height: 1px; background: var(--line); }
.qr { width: 120px; height: 120px; border-radius: 10px; overflow: hidden; flex: none; background: #fff; }
.qr svg { width: 100%; height: 100%; }
.poster { border-radius: 16px; background: #143f24; color: #fff; padding: 18px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; }
.awards-card { aspect-ratio: 1 / 1; width: 100%; border-radius: 16px; background: #e8681f; color: #1a0d05; padding: 18px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.awards-card .bigname { font: 800 clamp(48px, 18vw, 86px)/.9 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.awards-card .kv { background: rgba(255,255,255,.88); border-radius: 8px; padding: 7px 10px; font-size: 14px; color: #1a0d05; }

/* payments & receipts */
.pay-icon { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; font: 800 11px var(--body); letter-spacing: .02em; }
.pay-icon.stripe { background: var(--ink); color: var(--ground); }
.pay-icon.paypal { background: #ffc439; color: #111; }
.pay-icon.cash { background: var(--chip); color: var(--ink); font-size: 15px; }
.receipt { gap: 14px; padding: 18px 16px; }
.receipt-kv { margin: 0; display: grid; grid-template-columns: 104px 1fr; gap: 8px 12px; font-size: 14px; border-top: 1px dashed var(--field-line); padding-top: 12px; }
.receipt-kv dt { color: var(--muted); }
.receipt-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.receipt-kv .mono { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.receipt-sum { border-top: 1px dashed var(--field-line); padding-top: 12px; font-size: 15px; }

/* a row that scrolls sideways with no scroll bar (swipe, drag, or mouse wheel) */
.hscroll { display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; margin: 0 -16px; padding: 2px 16px; scroll-padding: 0 16px;
  scrollbar-width: none; -ms-overflow-style: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { flex: none; white-space: nowrap; }
.hscroll::after { content: ''; flex: 0 0 10px; }   /* room after the last chip when scrolled to the end */
.hscroll.dragging { cursor: grabbing; user-select: none; }

.input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }

/* ---- team colours. Bibs wear the group's bib colour (Group settings); Non-bibs are blue, or orange when the bibs are blue.
   app.js sets data-bib on <html>. --team-x: fill, -ink: text on the fill, -text: the colour as text on the page,
   --tx-tile / --tx-ink: the always-dark match screen's score tiles. */
:root {
  --team-a: #e8681f; --team-a-ink: #ffffff; --team-a-tl: #c4520f; --team-a-td: #f08a4b; --ta-tile: #f08540; --ta-ink: #1a0d05;
  --team-b: #2b4f8a; --team-b-ink: #ffffff; --team-b-tl: #2b4f8a; --team-b-td: #6f95d6; --tb-tile: #7ea3e0; --tb-ink: #0b1424;
  --team-a-text: var(--team-a-tl); --team-b-text: var(--team-b-tl);
}
:root[data-bib="yellow"] { --team-a: #f2c230; --team-a-ink: #1f1a05; --team-a-tl: #8a6a00; --team-a-td: #f2c230; --ta-tile: #f2c230; --ta-ink: #1f1a05; }
:root[data-bib="green"]  { --team-a: #8cc63f; --team-a-ink: #10240a; --team-a-tl: #4d7a14; --team-a-td: #a6d95e; --ta-tile: #8cc63f; --ta-ink: #10240a; }
:root[data-bib="red"]    { --team-a: #c8312b; --team-a-ink: #ffffff; --team-a-tl: #b3261e; --team-a-td: #f2867e; --ta-tile: #e0574f; --ta-ink: #2a0705; }
:root[data-bib="pink"]   { --team-a: #e0569b; --team-a-ink: #ffffff; --team-a-tl: #b8337a; --team-a-td: #f08cbf; --ta-tile: #ec7fb5; --ta-ink: #2a0a1a; }
:root[data-bib="blue"]   { --team-a: #2b4f8a; --team-a-ink: #ffffff; --team-a-tl: #2b4f8a; --team-a-td: #6f95d6; --ta-tile: #7ea3e0; --ta-ink: #0b1424;
                           --team-b: #e8681f; --team-b-ink: #ffffff; --team-b-tl: #c4520f; --team-b-td: #f08a4b; --tb-tile: #f08540; --tb-ink: #1a0d05; }
:root[data-theme="dark"] { --team-a-text: var(--team-a-td); --team-b-text: var(--team-b-td); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --team-a-text: var(--team-a-td); --team-b-text: var(--team-b-td); } }
.dark-screen { --team-a-text: var(--team-a-td); --team-b-text: var(--team-b-td); }
.team-head.A { background: var(--team-a); color: var(--team-a-ink); }
.team-head.B { background: var(--team-b); color: var(--team-b-ink); }
.teamc.A { color: var(--team-a-text); }
.teamc.B { color: var(--team-b-text); }

/* ---- Teams: List / Formation switch, and the formation pitch */
.seg.view-seg { padding: 3px; gap: 3px; border-radius: 10px; flex: none; }
.seg.view-seg button { min-height: 32px; padding: 0 10px; font-size: 14px; border-radius: 8px; }
.pitch-view { --turf-a: #2f7d45; --turf-b: #2a7240; --chalk: rgba(255,255,255,.55);
  position: relative; border-radius: 18px; overflow: hidden; isolation: isolate;
  background: repeating-linear-gradient(180deg, var(--turf-a) 0 46px, var(--turf-b) 46px 92px);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12), 0 8px 24px rgba(20,63,36,.18); }
:root[data-theme="dark"] .pitch-view { --turf-a: #24603a; --turf-b: #205734; --chalk: rgba(255,255,255,.42); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pitch-view { --turf-a: #24603a; --turf-b: #205734; --chalk: rgba(255,255,255,.42); } }
.pitch-view::before { content: ""; position: absolute; inset: 8px; border: 2px solid var(--chalk); border-radius: 4px; pointer-events: none; z-index: 0; }
.pitch-view .mark { position: absolute; border: 2px solid var(--chalk); pointer-events: none; z-index: 0; }
.pitch-view .mark.halfway { left: 8px; right: 8px; top: 50%; height: 0; border-width: 2px 0 0; transform: translateY(-1px); }
.pitch-view .mark.circle { left: 50%; top: 50%; width: 84px; height: 84px; border-radius: 50%; transform: translate(-50%, -50%); }
.pitch-view .mark.box { left: 24%; right: 24%; height: 78px; }
.pitch-view .mark.six { left: 38%; right: 38%; height: 26px; }
.pitch-view .mark.top { top: 8px; border-top: 0; }
.pitch-view .mark.bottom { bottom: 8px; border-bottom: 0; }
.pitch-view .half { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: space-evenly; gap: 6px; padding: 38px 12px 12px; }
.pitch-view .half.B { padding: 12px 12px 38px; }
.pitch-view .line { display: flex; justify-content: space-evenly; gap: 4px; }
.pitch-view .tok { flex: 0 1 calc((100% - 16px) / var(--n)); max-width: 86px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 0; border: 0; background: none; color: #fff; font: inherit; text-decoration: none; cursor: pointer; border-radius: 10px; }
.pitch-view .tok .ring { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font: 800 18px/1 var(--display); font-variant-numeric: tabular-nums; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); transition: transform .12s ease; }
.pitch-view .tok.A .ring { background: var(--team-a); color: var(--team-a-ink); }
.pitch-view .tok.B .ring { background: var(--team-b); color: var(--team-b-ink); }
.pitch-view .tok .ring.unrated { border-style: dashed; }
.pitch-view .tok .nm { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 7px; border-radius: 6px;
  background: rgba(8,18,11,.84); color: #fff; font: 700 12.5px/1.35 var(--body); }
.pitch-view .tok:hover .ring { transform: scale(1.06); }
.pitch-view .tok:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.pitch-view .team-tag { position: absolute; left: 16px; padding: 3px 8px; border-radius: 6px; font: 800 13px/1.2 var(--display); text-transform: uppercase; letter-spacing: .02em; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.pitch-view .half.A .team-tag { top: 14px; background: var(--team-a); color: var(--team-a-ink); }
.pitch-view .half.B .team-tag { bottom: 14px; background: var(--team-b); color: var(--team-b-ink); }
.pitch-view .nobody { margin: 0; text-align: center; color: rgba(255,255,255,.8); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .pitch-view .tok .ring { transition: none; } }
