/* Dinkaroos Open Play — minimalist premium theme */
:root {
  /* Light: the logo's own palette — off-white #FBF8F3, navy #132942, teal #5EBFBF */
  --bg: #fbf8f3;
  --card: #ffffff;
  --card-2: #f4f0e9;
  --line: #e9e3da;
  --line-2: #d9d1c6;
  --text: #132942;
  --muted: #5b6878;
  --primary: #132942;
  --primary-ink: #ffffff;
  --accent: #5ebfbf;
  --accent-text: #1f8583;
  --accent-soft: #e4f5f5;
  --court: #1f8583;          /* teal used as text on white: dark enough to read */
  --court-soft: #e2f3f2;
  --warn: #9a5a0c;
  --warn-soft: #fbf1e6;
  --danger: #b4261a;
  --danger-soft: #fbeae8;
  --l1: #1f8583; --l1-soft: #e2f3f2;
  --l2: #132942; --l2-soft: #e7ecf2;
  --l3: #8f6a00; --l3-soft: #f7efd9;
  --radius: 14px;
  --radius-sm: 8px;
  --tabbar: 62px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --font-brand: Montserrat, Inter, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1626; --card: #0f1f33; --card-2: #142842; --line: #1e3350; --line-2: #2a4260;
    --text: #eef3f7; --muted: #8aa0b6;
    --primary: #f7f5f2; --primary-ink: #06304f;
    --accent: #3fc4b8; --accent-text: #3fc4b8; --accent-soft: #113a3f;
    --court: #3fc4b8; --court-soft: #113a3f;
    --warn: #e0a656; --warn-soft: #3a2a12;
    --danger: #f08a80; --danger-soft: #3d1a17;
    --l1: #3fc4b8; --l1-soft: #113a3f; --l2: #9cc3e6; --l2-soft: #16304a; --l3: #e0b955; --l3-soft: #3a3012;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1626; --card: #0f1f33; --card-2: #142842; --line: #1e3350; --line-2: #2a4260;
  --text: #eef3f7; --muted: #8aa0b6;
  --primary: #f7f5f2; --primary-ink: #06304f;
  --accent: #3fc4b8; --accent-text: #3fc4b8; --accent-soft: #113a3f;
  --court: #3fc4b8; --court-soft: #113a3f;
  --warn: #e0a656; --warn-soft: #3a2a12;
  --danger: #f08a80; --danger-soft: #3d1a17;
  --l1: #3fc4b8; --l1-soft: #113a3f; --l2: #9cc3e6; --l2-soft: #16304a; --l3: #e0b955; --l3-soft: #3a3012;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; touch-action: manipulation; }   /* no double-tap zoom on phones; pinch and scroll still work */
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.45 var(--font); letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: contain;
}
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
h1, h2, h3 { margin: 0; font-weight: 600; }
a { color: var(--accent-text); }

#app { min-height: 100%; padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }

/* ---- labels ---- */
.eyebrow, .section-title, .badge, .court > header h2, #tabs button span, .kpi small, .team .w, .vs, .court footer.next .label, .seg button small, label.field > span, label.field {
  font-family: var(--font-brand);
}
.section-title { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 10px 2px 0; display: flex; justify-content: space-between; align-items: center; }
.section-title .muted { font-family: var(--font); text-transform: none; letter-spacing: 0; font-weight: 500; }

/* ---- top bar ---- */
#topbar {
  position: sticky; top: 0; z-index: 20;
  display: grid; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
#topbar:empty { display: none; }
#topbar .bar { display: flex; align-items: center; gap: 10px; }
#topbar .bar.admin { gap: 7px; }
.bar.admin .brand { gap: 8px; }
.bar.admin .brand img { width: 34px; height: 34px; }
.bar.admin .brand .wm b { font-size: 12px; letter-spacing: .14em; }
.bar.admin .brand .wm small { letter-spacing: .22em; }
.bar.admin .counts { font-size: 11px; }
.bar.admin .iconbtn { width: 34px; height: 34px; border-radius: 9px; }
.bar.admin .iconbtn svg { width: 17px; height: 17px; }
#topbar .bar .iconbtn { flex: none; }
.viewer-pill { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px 0 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line-2); cursor: pointer; }
.viewer-pill.set { border-color: var(--accent-text); }
/* unanswered: pulse yellow + a bouncing arrow callout until the player picks their name */
.viewer-pill.unset { border-color: var(--warn); border-width: 2px; animation: pill-pulse 1.1s ease-in-out infinite; }
.viewer-pill.unset .vl, .viewer-pill.unset .vn { color: var(--warn); }
.viewer-pill.unset .vn { font-weight: 700; }
@keyframes pill-pulse { 0%, 100% { background: var(--card); box-shadow: 0 0 0 0 transparent; transform: scale(1); } 50% { background: var(--warn-soft); box-shadow: 0 0 0 6px color-mix(in srgb, var(--warn) 30%, transparent); transform: scale(1.015); } }
.pick-callout { display: flex; align-items: center; gap: 8px; padding: 2px 4px 0 12px; color: var(--warn); font-weight: 700; font-size: 13.5px; }
.pick-callout .pc-arrow { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--warn); color: #fff; animation: arrow-bounce .9s ease-in-out infinite; flex: none; }
.pick-callout svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
@keyframes arrow-bounce { 0%, 100% { transform: translateY(3px); } 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .viewer-pill.unset { animation: none; background: var(--warn-soft); } .pick-callout .pc-arrow { animation: none; } }
.viewer-pill .vl { font-family: var(--font-brand); font-size: 9.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.viewer-pill .vn { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-pill.set .vn { color: var(--accent-text); }
.viewer-pill .caret { width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg) translateY(-2px); flex: none; }
.viewer-pill select { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; font-size: 16px;
  /* invisible in place, but NOT via opacity: desktop Chrome paints the dropdown list with the select's opacity and text colour */
  appearance: none; -webkit-appearance: none; background: transparent; border: 0; color: transparent; outline: none; }
.viewer-pill select:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); border-radius: inherit; }
select option, .viewer-pill select option { color: var(--text); background: var(--card); opacity: 1; }
/* the browser-drawn dropdown follows the active theme, not the OS setting */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
.bell.on { color: var(--accent-text); border-color: var(--accent-text); background: var(--accent-soft); }
.bell:disabled { opacity: .4; }
.iconbtn.mini { width: 32px; height: 32px; border-radius: 8px; background: var(--card-2); border-color: transparent; flex: none; }
.iconbtn.mini svg { width: 16px; height: 16px; }
.alert-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.alert-row:first-child { border-top: 0; }
.alert-row b { display: block; font-size: 15px; font-weight: 600; }
.alert-row small { color: var(--muted); font-size: 12.5px; }

/* ---- full-screen court alert ---- */
#alert-root:empty { display: none; }
.court-alert { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; background: color-mix(in srgb, var(--text) 92%, transparent); color: var(--bg); animation: fade .2s; cursor: pointer; }
:root[data-theme="dark"] .court-alert { background: rgba(6, 48, 79, .96); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .court-alert { background: rgba(6, 48, 79, .96); color: #fff; } }
.court-alert.next { background: rgba(6, 48, 79, .96); color: #fff; }
.ca-inner { display: grid; justify-items: center; gap: 10px; text-align: center; animation: pop .35s cubic-bezier(.2,.8,.2,1); }
@keyframes pop { from { transform: scale(.85); opacity: 0 } }
.ca-kicker { font-family: var(--font-brand); font-size: 13px; letter-spacing: .3em; text-transform: uppercase; opacity: .8; }
.ca-court { font-size: 64px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; color: #3fc4b8; }
.ca-lineup { font-size: 18px; font-weight: 600; margin-top: 10px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; }
.ca-lineup em { font-style: normal; opacity: .6; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; }
.ca-hint { font-size: 13px; opacity: .7; margin-top: 18px; }

/* ---- avatars ---- */
.av { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: none; background: var(--card-2); border: 1px solid var(--line); }
.av.ph { display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--muted); font-family: var(--font-brand); }
.team .av { width: 22px; height: 22px; margin-right: -2px; }
.court footer.next .av { width: 18px; height: 18px; vertical-align: -4px; margin-right: 2px; }
.snip-head .av { width: 40px; height: 40px; vertical-align: middle; margin-right: 8px; }
.snip-head .av.ph { font-size: 15px; }

/* ---- roster import ---- */
.imp-list { display: grid; max-height: 46dvh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 10px; }
.imp-row { display: grid; grid-template-columns: 18px 26px minmax(0, 1fr); grid-template-areas: 'cb av nm' 'cb av ctl'; align-items: center; column-gap: 8px; row-gap: 6px; padding: 8px 0; border-top: 1px solid var(--line); }
.imp-row > input[type=checkbox] { grid-area: cb; } .imp-row > .av { grid-area: av; } .imp-row > .nm { grid-area: nm; }
.imp-row > .seg { grid-area: ctl; }
.imp-row > .seg.levels { justify-self: start; } .imp-row > .seg.sex { justify-self: end; }
.imp-row > .seg.levels, .imp-row > .seg.sex { grid-area: ctl; }
.imp-row .ctl { grid-area: ctl; display: flex; gap: 8px; justify-content: space-between; }
.imp-row:first-child { border-top: 0; }
.imp-row .nm { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-row .nm small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }
.imp-row .seg { flex: none; width: 138px; padding: 2px; gap: 2px; }
.imp-row .ctl .seg { width: auto; flex: 1; }
.imp-row .ctl .seg.sex { flex: .7; max-width: none; }
.imp-row .seg button { min-height: 26px; font-size: 11px; }
.imp-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent-text); flex: none; }
textarea { width: 100%; min-height: 96px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--card); font: inherit; font-size: 14px; resize: vertical; }

/* ---- full size image view ---- */
/* ---- full-size viewer: the image fills the screen; X floats top right; caption + Close overlay the bottom of the image above the safe area ---- */
.fullview { position: fixed; inset: 0; z-index: 70; background: #000; display: flex; align-items: center; justify-content: center; animation: fade .18s; }
.fullview img { display: block; flex: none; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; -webkit-touch-callout: default; -webkit-user-select: auto; user-select: auto; }
.fullview .fv-x { position: absolute; z-index: 2; top: calc(10px + env(safe-area-inset-top)); right: 12px; width: 40px; height: 40px; border-radius: 50%; background: rgba(0, 0, 0, .45); border: 1px solid rgba(255, 255, 255, .28); color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.fullview .fv-x svg { width: 18px; height: 18px; }
.fv-bar { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 12px; color: rgba(255, 255, 255, .85); font-size: 12.5px;
  padding: 36px 14px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(to top, rgba(0, 0, 0, .9) 0%, rgba(0, 0, 0, .6) 55%, rgba(0, 0, 0, 0)); }
.fv-bar span { flex: 1; min-width: 0; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.fv-bar b { color: #fff; }
.fv-bar .btn { color: #fff; border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .12); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); min-height: 40px; padding: 0 16px; flex: none; }

/* ---- admin quick actions ---- */
.qas { display: flex; gap: 5px; flex: none; }
.qa { min-height: 30px; padding: 0 9px; border-radius: 7px; font-size: 11.5px; font-weight: 600; background: var(--card-2); border: 1px solid var(--line-2); color: var(--text); white-space: nowrap; }
.prow.tappable .rt { font-size: 12px; }
.prow.tappable .badge { padding: 0 6px; letter-spacing: .06em; }
.prow.tappable .pos { width: 18px; }
.qa.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: transparent; }
.prow.tappable { cursor: pointer; }
.brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.status { flex: none; }
.brand img { width: 38px; height: 38px; object-fit: contain; flex: none; }
.brand img.ballimg { width: 30px; height: 30px; margin: 0 4px; }
.pin-screen img.ballimg.big { width: 72px; height: 72px; }
.qr-club { font-family: var(--font-brand); font-weight: 700; font-size: 22px; letter-spacing: .08em; text-transform: uppercase; color: #132942; text-align: center; max-width: 260px; }
.brand .wm { display: grid; line-height: 1.05; min-width: 0; font-family: var(--font-brand); text-transform: uppercase; }
.brand .wm b { font-size: 14px; font-weight: 700; letter-spacing: .22em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .wm small { font-size: 9.5px; font-weight: 600; letter-spacing: .3em; color: var(--accent-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.brand .wm small.line2 { font-size: 14px; font-weight: 700; letter-spacing: .22em; margin-top: 1px; }   /* the second half of the club name: same size as the first */
.lockup { display: block; width: auto; height: auto; max-width: 100%; object-fit: contain; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brandimg { filter: invert(1) hue-rotate(180deg) brightness(1.15); } }
:root[data-theme="dark"] .brandimg { filter: invert(1) hue-rotate(180deg) brightness(1.15); }
.status { display: grid; justify-items: end; gap: 2px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-family: var(--font-brand); }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--court); animation: pulse 2s infinite; }
.live.off i { background: var(--warn); animation: none; }
.live.ended i { background: var(--danger); animation: none; }
.nextup.ended { border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.nextup.ended .nu-head { color: var(--danger); }
.seg.mini { display: inline-grid; grid-auto-flow: column; padding: 1px; gap: 1px; border-radius: 6px; }
.seg.mini button { min-height: 20px; padding: 0 7px; font-size: 10px; border-radius: 4px; letter-spacing: .02em; }
.seg.mini button.on { border: 0; }
.seg.mini.lvl button.on:nth-child(1) { color: var(--l1); } .seg.mini.lvl button.on:nth-child(2) { color: var(--l2); } .seg.mini.lvl button.on:nth-child(3) { color: var(--l3); }
.seg.mini.lvl button:only-child.on, :root .seg.mini.lvl[data-two] button.on { color: var(--text); }
.seg.mini.sx { margin-left: 4px; }
.seg.mini.sx button.on.m { color: #7fb3e6; } .seg.mini.sx button.on.f { color: #e58fb3; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--court) 55%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.counts { font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.iconbtn { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); color: var(--text); }
.iconbtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---- banner ---- */
#banner:empty { display: none; }
.banner { margin: 10px 14px 0; padding: 8px 12px; border-radius: 12px; display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); }
.banner::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.banner.playing::before, .banner.waiting::before { background: var(--court); }
.banner.next::before { background: var(--warn); }
.banner .txt { flex: 1; min-width: 0; }
.banner b { display: block; font-size: 14px; font-weight: 600; line-height: 1.25; }
.banner small { color: var(--muted); font-size: 12px; line-height: 1.3; display: block; }
.banner .actions { display: flex; gap: 6px; }

/* ---- generic ---- */
main { padding: 10px 14px 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
main > * { min-width: 0; }
/* single-column grids must never grow past their container because of a long, non-wrapping row */
.list, .mlist, .hist, .imp-list, .snip, .stack, .cmp-controls { grid-template-columns: minmax(0, 1fr); }
.list > *, .mlist > *, .hist > *, .imp-list > *, .snip > *, .stack > * { min-width: 0; }
.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); padding: 14px; }
.muted { color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; background: var(--card); color: var(--text); border: 1px solid var(--line-2); transition: transform .08s, background .15s; }
.btn:active { transform: scale(.985); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.btn.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn.warn { background: transparent; color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.row { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; }
input[type=text], input[type=number], input[type=password], input[type=tel], input[type=url] { width: 100%; min-width: 0; min-height: 46px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--card); outline: none; font-size: 16px; }
input:focus { border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
label.field { display: grid; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
label.field input, .field input { letter-spacing: 0; text-transform: none; font-weight: 500; }
.field > span { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 6px; font-family: var(--font-brand); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; background: var(--card-2); border: 1px solid var(--line); padding: 3px; border-radius: var(--radius-sm); }
.seg button { min-height: 40px; border-radius: 6px; font-weight: 600; font-size: 13.5px; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--text); border: 1px solid var(--line-2); }
.seg.levels button.on[data-v="1"] { color: var(--l1); } .seg.levels button.on[data-v="2"] { color: var(--l2); } .seg.levels button.on[data-v="3"] { color: var(--l3); }
.seg button small { display: block; font-size: 9.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .75; margin-top: 2px; }
.help { font-size: 12.5px; color: var(--muted); margin: 2px 2px 0; }

.chip { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 20px; padding: 0 6px; border-radius: 5px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; font-family: var(--font-brand); }
.chip.sx { min-width: 18px; padding: 0 5px; background: var(--card-2); color: var(--muted); border: 1px solid var(--line-2); margin-left: 4px; }
.chip.sx.f { color: #e58fb3; } .chip.sx.m { color: #7fb3e6; }
.badge.mk { color: var(--muted); }
.seg.sex { grid-auto-columns: 1fr; max-width: 160px; }
.imp-row .seg.sex { max-width: 96px; padding: 2px; }
.imp-row .seg.sex button { min-height: 28px; font-size: 11px; }
.kpi b .muted { font-size: 12px; font-weight: 600; }
.kpi b.mk3 { font-size: 15px; white-space: nowrap; line-height: 33px; }   /* same height as a 22px figure so the tile matches its neighbours */
.kpi b .muted { font-size: 11px; }
.chip.l1 { background: var(--l1-soft); color: var(--l1); } .chip.l2 { background: var(--l2-soft); color: var(--l2); } .chip.l3 { background: var(--l3-soft); color: var(--l3); }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 5px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; border: 1px solid currentColor; white-space: nowrap; }
.badge.next { color: var(--warn); }
.badge.playing { color: var(--court); }
.badge.me { color: var(--accent-text); }
.badge.showdown { color: var(--l3); }
.badge.deficit { color: var(--warn); }
.badge.cu { color: var(--accent-text); height: 17px; font-size: 9.5px; padding: 0 5px; letter-spacing: .1em; }
.badge.org { color: var(--accent-text); }
.badge.org.held { color: var(--muted); }
.games-tag { font-size: 10.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.court .start-row { display: flex; gap: 8px; padding: 6px 14px 8px; }
.court .start-row.second { padding-top: 0; }
.court .empty-msg .start-row.second { padding: 8px 0 0; }
.badge.req { color: var(--accent-text); }
.badge.last { color: var(--warn); }
.rp { width: 22px; height: 20px; border-radius: 5px; display: inline-grid; place-items: center; background: var(--card-2); border: 1px solid var(--line-2); color: var(--muted); flex: none; cursor: pointer; margin-left: 2px; }
.rp svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rp:active { color: var(--accent-text); transform: scale(.94); }
.swapbtn { width: 26px; height: 22px; border-radius: 6px; display: inline-grid; place-items: center; background: var(--card-2); border: 1px solid var(--line-2); color: var(--muted); flex: none; }
.swapbtn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.swapbtn:active { transform: scale(.94); color: var(--accent-text); }
.nu-head .nu-tags { display: flex; gap: 8px; align-items: center; }
.nu-cad.warn { color: var(--warn); }
.nextup.plan { border-style: dashed; }
.nextup.plan .nu-head { color: var(--accent-text); }
.nextup.plan.over { border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.nextup.plan.over .nu-head { color: var(--warn); }
.nextup.plan .nu-head .qa { font-family: var(--font); text-transform: none; letter-spacing: 0; text-decoration: none; }
.pin-screen a.btn { text-decoration: none; margin: 6px 0; }
.nextup.final { border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.nextup.final .nu-head { color: var(--warn); }
.nextup.reqs .nu-head { color: var(--accent-text); align-items: center; }
.nextup.reqs .nu-head .qa { font-family: var(--font); text-transform: none; letter-spacing: 0; }
.nu-sub { font-size: 11px; color: var(--muted); padding: 0 0 4px 44px; }
.nu-row.req .qas { display: flex; gap: 6px; flex: none; }
.nu-row.pair .lineup .nu-cad { margin-left: 6px; }
.lineup-teams { display: grid; gap: 10px; }
.lu-team { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card-2); }
.lu-label { font-family: var(--font-brand); font-size: 9.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.lu-swap { justify-self: center; }
input[type=time] { min-width: 0; flex: 1; min-height: 46px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--card); outline: none; font-size: 16px; color: var(--text); }
.badge.sub { color: var(--accent-text); height: 18px; font-size: 9px; padding: 0 5px; }
.mmr { font-size: 11px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: .02em; padding: 1px 5px; border-radius: 4px; border: 1px dashed var(--line-2); }
.court footer.next.showdown { background: var(--l3-soft); }
.court footer.next.showdown .label { color: var(--l3); }

/* ---- courts (compact: three cards fit a phone screen) ---- */
.court { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.court > header { display: flex; align-items: center; gap: 8px; padding: 8px 14px 2px; min-height: 34px; }
.court > header h2 { font-size: 10.5px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; flex: 1; display: flex; align-items: center; gap: 8px; color: var(--muted); white-space: nowrap; min-width: 0; }
.court > header .badge { height: 18px; font-size: 8.5px; padding: 0 6px; letter-spacing: .08em; flex: none; }
.court > header h2 i { width: 7px; height: 7px; border-radius: 50%; background: var(--court); display: inline-block; }
.court.empty > header h2 i { background: var(--line-2); }
.court.closed > header h2 i { background: var(--danger); }
/* admin: projected Next / Then drawn like courts, but gray and without WIN */
.next-grid { margin-top: 8px; }
.court.next-card { background: color-mix(in srgb, var(--card) 55%, var(--bg)); border-style: dashed; opacity: .92; }
.court.next-card > header h2 i { background: var(--warn); }
.court.next-card > header h2 { color: var(--warn); }
.court.next-card .team .p { color: var(--muted); }
.court.next-card .team .p.me { color: var(--accent-text); }
.court.next-card .team .p .av { opacity: .8; }
.nextup.nx-wrap { padding-bottom: 8px; }
.nx-head .nu-tags .qa { font-family: var(--font); text-transform: none; letter-spacing: 0; }
.timer { font-variant-numeric: tabular-nums; font-weight: 500; font-size: 12.5px; color: var(--muted); letter-spacing: .04em; }
.timer.long { color: var(--warn); }
.game { padding: 0 14px 6px; display: grid; }
.team { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 6px 0; border-radius: 0; background: none; min-height: 34px; }
.team.tappable { padding: 6px 8px; margin: 0 -8px; width: calc(100% + 16px); border-radius: var(--radius-sm); }
.team.tappable:active { background: var(--card-2); }
.team .names { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.team .p { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.team .p + .p::before { content: '&'; color: var(--muted); font-weight: 500; font-size: 13px; margin-right: 2px; }
.team .p.me { color: var(--accent-text); }
.team .p.gone { text-decoration: line-through; opacity: .5; }
.team .w { font-size: 9.5px; font-weight: 600; letter-spacing: .14em; color: var(--muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 3px 7px; flex: none; }
.vs { display: flex; align-items: center; gap: 10px; font-size: 8.5px; font-weight: 600; letter-spacing: .2em; color: var(--muted); height: 12px; }
.vs::before, .vs::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.court .empty-msg { padding: 6px 14px 12px; color: var(--muted); font-size: 13.5px; }
.court footer.next { border-top: 1px solid var(--line); padding: 6px 14px 7px; display: flex; align-items: center; gap: 10px; background: var(--card-2); min-height: 32px; }
.court footer.next .label { font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .16em; color: var(--warn); white-space: nowrap; }
.court footer.next .lineup { flex: 1; font-size: 13px; font-weight: 500; display: flex; flex-wrap: wrap; gap: 1px 5px; align-items: center; min-width: 0; }
.court footer.next .lineup em { font-style: normal; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .1em; margin: 0 4px; }
.court footer.next .lineup .me { color: var(--accent-text); font-weight: 600; }
.court footer.next.none .lineup { color: var(--muted); font-weight: 400; }

/* short phones (iPhone SE class): squeeze so three courts still fit */
@media (max-height: 700px) {
  main { padding: 6px 12px 10px; gap: 6px; }
  .courts-grid { gap: 6px !important; }
  .banner { margin: 6px 12px 0; padding: 6px 12px; }
  .banner small { display: none; }
  .court > header { min-height: 28px; padding: 5px 12px 0; }
  .game { padding: 0 12px 3px; }
  .team { padding: 4px 0; min-height: 30px; }
  .team .p { font-size: 15px; }
  .vs { height: 10px; }
  .court footer.next { padding: 4px 12px 5px; min-height: 28px; }
  .court footer.next .lineup { font-size: 12.5px; }
  #topbar { padding-top: calc(6px + env(safe-area-inset-top)); padding-bottom: 6px; gap: 6px; }
  .viewer-pill { min-height: 36px; }
  .brand img { width: 32px; height: 32px; }
}

/* ---- up next (shared queue projection) ---- */
.nextup { background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 14px 6px; display: grid; gap: 2px; }
.nu-head { font-family: var(--font-brand); font-size: 9.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--warn); display: flex; justify-content: space-between; gap: 8px; }
.nu-cad { font-family: var(--font); text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 11px; }
.nu-row { display: flex; align-items: center; gap: 10px; min-height: 28px; }
.nu-row .label { font-family: var(--font-brand); font-size: 9.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); width: 34px; flex: none; }
.nu-row .lineup { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; display: flex; flex-wrap: wrap; gap: 1px 5px; align-items: center; }
.nu-row .lineup em { font-style: normal; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .1em; margin: 0 4px; }
.nu-row .lineup .me { color: var(--accent-text); font-weight: 600; }
.nu-row .lineup .av { width: 18px; height: 18px; vertical-align: middle; margin: -2px 2px 0 0; }
.nu-row .lineup .av.ph { font-size: 9px; line-height: 18px; }
@media (max-height: 700px) { .nextup { padding: 5px 12px 4px; } .nu-row { min-height: 24px; } .nu-row .lineup { font-size: 12.5px; } }

/* ---- check-in ---- */
.checkin h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 4px; }
.checkin p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.checkin form { display: grid; gap: 14px; }

/* ---- players ---- */
.list { display: grid; padding: 4px 14px; }
.prow { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); width: 100%; text-align: left; }
.prow:first-child { border-top: 0; }
.prow .pos { width: 22px; font-variant-numeric: tabular-nums; font-weight: 500; color: var(--muted); font-size: 13px; }
.prow .nm { flex: 1; min-width: 0; font-weight: 600; display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; font-size: 15.5px; line-height: 1.2; }
.prow .nm > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .nm .meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.prow .nm .meta .badge { height: 18px; font-size: 9px; padding: 0 6px; }
.prow .nm .meta .chip { height: 17px; font-size: 9.5px; }
.prow .nm .meta .mmr { font-size: 10px; padding: 0 4px; }
.prow .nm.me span { color: var(--accent-text); }
.prow .rt { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; display: grid; justify-items: end; gap: 3px; }
.prow .rt .wait.long { color: var(--warn); font-weight: 600; }
.prow.dim .nm { opacity: .5; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--line-2); }
.prow .rt .st { display: flex; align-items: center; gap: 10px; }
.prow .rt .dot { margin-right: 3px; }  /* ring edge lines up with the card padding */
.dot.on { background: var(--court); box-shadow: 0 0 0 3px var(--court-soft); }
.empty { color: var(--muted); font-size: 14px; padding: 10px 0; }

/* ---- stats ---- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 6px; text-align: right; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
th { font-size: 10px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); border-top: 0; font-weight: 600; font-family: var(--font-brand); }
td:first-child, th:first-child { text-align: left; padding-left: 2px; color: var(--muted); }
td.name { text-align: left; font-weight: 600; color: var(--text); }
td.name .chip { margin-left: 6px; }
tr.me td.name { color: var(--accent-text); }
td.num { white-space: nowrap; }
table.tight { font-size: 13px; }
table.tight th, table.tight td { padding: 9px 4px; }
table.tight th { font-size: 9px; letter-spacing: .08em; }
table.tight td:last-child, table.tight th:last-child { padding-right: 2px; }
td .dm { font-size: 10.5px; margin-left: 2px; }
.streak.hot { color: var(--court); font-weight: 600; } .streak.cold { color: var(--danger); font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-items: stretch; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.kpi b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.5; white-space: nowrap; }
.kpi b.mk2 { font-size: 19px; line-height: 33px; }
.kpi small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .14em; font-weight: 600; }
.hist { display: grid; gap: 8px; }
.hrow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); font-size: 14px; }
.hrow .meta { color: var(--muted); font-size: 11.5px; white-space: nowrap; letter-spacing: .04em; }
.hrow .who { flex: 1; min-width: 0; }
.hrow .who b { color: var(--court); font-weight: 600; }
.hrow .who .l { color: var(--muted); font-size: 13px; }

/* ---- who is viewing / snippet ---- */
.select { width: 100%; min-height: 46px; padding: 0 40px 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--card); font-size: 15px; font-weight: 500; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.snip { display: grid; gap: 12px; }
.snip-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 2px; }
.snip-name { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.kpis.four { grid-template-columns: repeat(4, 1fr); gap: 6px; }
.kpis.four .kpi { padding: 10px 4px; text-align: center; background: var(--card-2); border-color: transparent; }
.kpis.four .kpi b { font-size: 19px; }
.kpi-sub { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi b.hot { color: var(--court); } .kpi b.cold { color: var(--danger); }
.mlist { display: grid; }
.mrow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.mrow:first-child { border-top: 0; }
.mrow .res { width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; font-family: var(--font-brand); }
.mrow .res.w { background: var(--court-soft); color: var(--court); } .mrow .res.l { background: var(--danger-soft); color: var(--danger); }
.mrow .who { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow .who .l { color: var(--muted); font-weight: 500; font-size: 12px; }
.mrow .meta { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.alltime { text-align: center; }
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--muted); user-select: none; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle span { width: 40px; height: 24px; border-radius: 12px; background: var(--line-2); position: relative; transition: background .15s; flex: none; }
.toggle span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(16px); }
.toggle em { font-style: normal; }
.toggle.inline { justify-content: center; min-height: 40px; }
.story-wrap { border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; padding: 12px; border: 1px solid var(--line);
  background: repeating-conic-gradient(#d8d4ce 0 25%, #f1eee9 0 50%) 0 0 / 20px 20px; }
/* ---- full-height composer sheet: everything fits one phone screen ---- */
.sheet.full { top: 0; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; overflow: hidden; display: flex; flex-direction: column; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 14px calc(10px + env(safe-area-inset-bottom)); }
.sheet.full .grab { display: none; }
.cmp-head { display: flex; align-items: center; gap: 10px; flex: none; }
.cmp-head h3 { font-size: 17px; margin: 0; }
.cmp-hint { flex: 1; min-width: 0; font-size: 11px; color: var(--muted); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-stage { flex: 1; min-height: 0; display: flex; justify-content: center; align-items: center; padding: 6px; border-radius: 12px; border: 1px solid var(--line);
  background: repeating-conic-gradient(#d8d4ce 0 25%, #f1eee9 0 50%) 0 0 / 18px 18px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cmp-stage { background: repeating-conic-gradient(#1a2b44 0 25%, #12213a 0 50%) 0 0 / 18px 18px; } }
:root[data-theme="dark"] .cmp-stage { background: repeating-conic-gradient(#1a2b44 0 25%, #12213a 0 50%) 0 0 / 18px 18px; }
.cmp-stage canvas { width: auto; height: auto; max-width: 100%; max-height: 100%; aspect-ratio: 9 / 16; border-radius: 8px; touch-action: none; cursor: grab; display: block; }
.cmp-stage canvas:active { cursor: grabbing; }
.cmp-controls { flex: none; display: grid; gap: 8px; }
.cmp-controls .row { gap: 6px; }
.cmp-controls .btn.sm { min-height: 36px; padding: 0 10px; }
.cmp-controls .btn.primary.grow { min-height: 40px; }
.cmp-controls .row:last-child .btn.grow { min-height: 40px; font-size: 13px; padding: 0 8px; white-space: nowrap; letter-spacing: -0.01em; }
.cmp-controls .btn:not(.sm):not(.grow) { min-height: 40px; padding: 0 12px; font-size: 13px; }
.seg.compact { flex: 1.1; padding: 2px; gap: 2px; min-width: 110px; }
.seg.compact button { min-height: 32px; font-size: 12.5px; }
.seg.compact.icons { flex: 1; min-width: 132px; }
.seg.compact.icons button { display: grid; place-items: center; color: var(--muted); }
.seg.compact.icons button.on { color: var(--accent-text); }
.seg.compact.icons svg { width: 22px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.range.mini { flex: 1; min-width: 0; grid-template-columns: auto 1fr auto; gap: 6px; font-size: 9.5px; }
.range.mini b { font-size: 11px; min-width: 30px; }
.range.mini input[type=range] { height: 24px; min-width: 0; }
.cmp-controls .toggle { flex: none; gap: 6px; }
.cmp-controls .toggle span { width: 36px; height: 22px; }
.cmp-controls .toggle input:checked + span::after { transform: translateX(14px); }
.cmp-controls .toggle span::after { width: 16px; height: 16px; }
@media (min-width: 720px) {
  .sheet.full { top: 16px; bottom: 16px; height: auto; max-height: none; max-width: 520px; border-radius: 20px; border: 1px solid var(--line); }
}
.story-wrap.composer { padding: 8px; }
.story-wrap canvas, .story-wrap img { width: min(100%, 300px); height: auto; aspect-ratio: 9 / 16; border-radius: 10px; display: block; -webkit-touch-callout: default; touch-action: none; cursor: grab; }
.story-wrap canvas:active { cursor: grabbing; }
.range { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-family: var(--font-brand); }
.range b { font-family: var(--font); font-size: 13px; letter-spacing: 0; color: var(--text); min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.range input[type=range] { width: 100%; accent-color: var(--accent-text); height: 28px; margin: 0; }
[hidden] { display: none !important; }

/* ---- tabs ---- */
#tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
#tabs button { display: grid; justify-items: center; gap: 4px; color: var(--muted); font-size: 9.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; padding-top: 9px; position: relative; }
#tabs button.on { color: var(--text); }
#tabs button.on::after { content: ''; position: absolute; top: 0; width: 28px; height: 2px; background: var(--accent); border-radius: 0 0 2px 2px; }
#tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---- sheet ---- */
#sheet-root:empty { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(6, 30, 50, .45); z-index: 40; animation: fade .18s; backdrop-filter: blur(2px); }
@keyframes fade { from { opacity: 0 } }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 90dvh; overflow: auto; background: var(--card); border-radius: 20px 20px 0 0; padding: 8px 18px calc(22px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); animation: up .22s cubic-bezier(.2,.8,.2,1); }
@keyframes up { from { transform: translateY(40px); opacity: 0 } }
.sheet .grab { width: 36px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 6px auto 16px; }
.sheet h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 4px; }
.sheet .sub { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.sheet .stack { display: grid; gap: 10px; }
.sheet .divider { height: 1px; background: var(--line); margin: 16px -18px; }
.qr { display: grid; place-items: center; gap: 10px; padding: 16px 14px; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); }
.qr .lockup { width: 150px; }
.sheet.qr-sheet { background: transparent; border: 0; padding: 0 20px calc(28px + env(safe-area-inset-bottom)); box-shadow: none; }
.sheet.qr-sheet .grab { display: none; }
.qr.clean { gap: 14px; padding: 26px 22px 22px; border-radius: 22px; border: 0; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.qr.clean .lockup { width: 170px; }
.qr.clean svg { width: min(72vw, 260px); height: auto; }
.qr-cap { font-family: var(--font-brand); font-size: 10.5px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: #6f7d8c; }
.qr-url { margin-top: -8px; font-family: var(--font-brand); font-size: 11px; font-weight: 500; letter-spacing: .08em; color: #9aa6b2; }
.powered { text-align: center; font-family: var(--font-brand); font-size: 10.5px; letter-spacing: .1em; color: var(--muted); padding: 6px 0 2px; opacity: .8; }
.powered b { font-weight: 600; color: var(--muted); }
.podium-powered { margin: -6px 0 12px; padding: 0; }   /* tucked under the top-three cards */
.qr svg { width: 220px; height: 220px; display: block; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 44px; height: 44px; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--line-2); font-size: 20px; font-weight: 500; }
.stepper b { flex: 1; text-align: center; font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pin-screen { min-height: 70dvh; display: grid; place-content: center; gap: 14px; text-align: center; padding: 24px; }
.pin-screen img { width: 210px; margin: 0 auto 10px; }
.pin-screen h2 { font-family: var(--font-brand); font-size: 13px; letter-spacing: .24em; text-transform: uppercase; }
.pin-screen input { text-align: center; font-size: 28px; letter-spacing: .3em; min-height: 60px; }

/* ---- toast ---- */
#toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; pointer-events: none; }
#toast div { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 500; font-size: 13.5px; margin-top: 8px; animation: up .2s; max-width: 90vw; }
#toast div.err { background: var(--danger); color: #fff; }

@media (min-width: 720px) {
  main { max-width: 760px; margin: 0 auto; width: 100%; }
  #banner { max-width: 760px; margin: 0 auto; }
  .courts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .sheet { max-width: 520px; left: 50%; transform: translateX(-50%); border-radius: 20px; bottom: 24px; border: 1px solid var(--line); }
  @keyframes up { from { transform: translate(-50%, 40px); opacity: 0 } to { transform: translateX(-50%) } }
}
@media (max-width: 719px) { .courts-grid { display: grid; gap: 8px; } }

/* Desktop: the frosted-glass blur on the sticky header and the tab bar is repainted on every scroll frame across a
   wide viewport, which is what makes the desk feel sluggish on laptops. Solid bars there; the blur stays on phones. */
@media (min-width: 900px) {
  #topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  #tabs { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .scrim { backdrop-filter: none; }
  .viewer-pill.unset { animation: none; background: var(--warn-soft); }
}
@media (prefers-reduced-motion: reduce) { .live i { animation: none; } }

/* the desk and player view are an app, not a document: no text selection or I-beam on labels and buttons */
body { user-select: none; -webkit-user-select: none; cursor: default; }
input, textarea, select, [contenteditable], .qr-url, .selectable { user-select: text; -webkit-user-select: text; cursor: auto; }
button, .btn, .qa, .iconbtn, .seg button, #tabs button, .prow, .court header, .chip, label { cursor: pointer; }
a { cursor: pointer; }

/* laptops: header contents and the tab bar share the content column instead of spanning the whole window */
@media (min-width: 900px) {
  #topbar > * { max-width: 760px; margin-left: auto; margin-right: auto; width: 100%; }
  body.wide-desk #topbar > * { max-width: 1280px; }
  body.wide-desk #tabs { max-width: 1280px; }
  #tabs { left: 50%; right: auto; transform: translateX(-50%); width: 100%; max-width: 760px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 16px 16px 0 0; }
}

a.brand { color: inherit; text-decoration: none; }

.inst-step { display: flex; align-items: flex-start; gap: 12px; }
.inst-step span { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 13px; }
.inst-step p { margin: 3px 0 0; color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.inst-step b { color: var(--text); }
.share-ic { width: 18px; height: 18px; vertical-align: -3px; fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin: 0 2px; }

.seg.courts { grid-template-columns: repeat(8, 1fr); }
.seg.courts button { min-height: 40px; padding: 0; font-size: 15px; font-variant-numeric: tabular-nums; }
.seg button:disabled { opacity: .35; cursor: not-allowed; }
.stack.tight { gap: 14px; }
.stack.tight .field > span { margin-bottom: 6px; }
.stack.tight .help { margin: 6px 0 0; font-size: 12.5px; }

/* soft nudge on an empty desk: a line with an arrow toward the Players tab, not a banner */
.soft-hint { display: flex; align-items: center; gap: 8px; padding: 8px 4px 2px; font-size: 14px; color: var(--muted); }
.soft-hint .link { background: none; border: 0; padding: 0; color: var(--accent-text); font-weight: 600; font-size: 14px; cursor: pointer; }
.soft-hint .link { line-height: 1; }
.help .link { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }   /* an in-caption link, e.g. History in the settings sheet */
.soft-hint .hint-arrow { display: inline-flex; align-items: center; height: 16px; }
.soft-hint .hint-arrow svg { display: block; width: 16px; height: 16px; fill: none; stroke: var(--accent-text); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; animation: nudge 1.2s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateX(0) } 50% { transform: translateX(4px) } }
@media (prefers-reduced-motion: reduce) { .soft-hint .hint-arrow svg { animation: none; } }
/* the admin's player picker on the Profile tab: same pill, in a card, no pulse */
.viewer-pill.inline { min-height: 44px; }
.viewer-pill.inline.unset { animation: none; border-width: 1px; border-color: var(--line-2); background: var(--card); }

/* the small "i": a caption that only appears on hover or tap; it spans the field's width so it can never spill past the sheet */
.stack.tight .field > span { position: relative; display: block; }
.info { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 6px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font: 700 10px/1 var(--font); letter-spacing: 0; text-transform: none; vertical-align: -2px; cursor: help; }
.info::after { content: attr(data-tip); position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 5; padding: 10px 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line-2); box-shadow: 0 10px 30px rgba(0,0,0,.35); color: var(--text); font: 500 12.5px/1.45 var(--font); letter-spacing: 0; text-transform: none; text-align: left; white-space: normal; opacity: 0; pointer-events: none; transform: translateY(-4px); transition: opacity .15s, transform .15s; }
@media (hover: hover) { .info:hover::after { opacity: 1; transform: none; } }
.info.open::after { opacity: 1; transform: none; }

/* nothing on the page is selectable or shows an I-beam unless it is a real text field */
*, *::before, *::after { user-select: none; -webkit-user-select: none; }
input, textarea, select, [contenteditable="true"] { user-select: text; -webkit-user-select: text; cursor: auto; }
:where(body, body *) { cursor: default; }
:where(a, button, .btn, summary, label.btn, .chip, .tabs a, .copy-ic, .info, .qa, .iconbtn, .seg button, #tabs button, .prow, .link, .theme-btn, select, .viewer-pill, .toggle), :where(a, button, .btn, summary, label.btn, .chip, .tabs a, .copy-ic, .info, .qa, .iconbtn, .seg button, #tabs button, .prow, .link, .theme-btn, select, .viewer-pill, .toggle) * { cursor: pointer; }
:where(input:not([type=range]):not([type=color]), textarea) { cursor: text; }
input[type=range], input[type=color], .story-wrap canvas, .cmp-stage canvas { cursor: pointer; }
.cmp-stage canvas, .story-wrap canvas { cursor: grab; }

/* ---- wide desk: courts + players panel ---- */
@media (min-width: 900px) {
  main.wide { max-width: 1280px; }
  main.wide #banner { max-width: 1280px; }
  .dsk-split { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; align-items: start; }
  .dsk-side { position: sticky; top: 66px; max-height: calc(100dvh - 66px - var(--tabbar) - 24px); overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; scrollbar-width: thin; }
}
.dsk-head { display: grid; gap: 6px; margin-bottom: 6px; }
.dsk-legend { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.dsk-legend .sdot { margin-right: -4px; }
#dsk-search { width: 100%; min-height: 34px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font-size: 16px; }
#dsk-search:focus { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
.dsk-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dsk-cols.one { grid-template-columns: 1fr; margin-top: 10px; }
.dsk-col { min-width: 0; }
.dsk-colhead { font-family: var(--font-brand); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 2px 4px 4px; }
.dsk-row { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-top: 1px solid var(--line); min-width: 0; }
.dsk-row:first-of-type { border-top: 0; }
.dsk-row .nm { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 5px; line-height: 1.2; }
.dsk-row .nm > span { font-weight: 600; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsk-row .nm small { color: var(--muted); font-size: 10.5px; white-space: nowrap; flex: none; }
.dsk-row.out .nm, .dsk-row.paused .nm { opacity: .7; }
.dsk-row .qas { display: flex; gap: 3px; flex: none; }
.dsk-row .qa { min-height: 22px; padding: 0 6px; font-size: 10.5px; border-radius: 6px; }
.dsk-empty { color: var(--muted); font-size: 12px; padding: 6px; }
.sdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--muted); }
.sdot.playing { background: #22c55e; } .sdot.waiting { background: #f59e0b; } .sdot.paused { background: #ef4444; } .sdot.out { background: #6b7280; }

.roster-search { width: 100%; min-height: 44px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--card); color: var(--text); font-size: 16px; margin-bottom: 8px; }
.roster-search:focus { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }

/* on court right now: the row itself glows green */
.dsk-row.playing { background: color-mix(in srgb, #22c55e 18%, transparent); border-radius: 6px; }
:root[data-theme="light"] .dsk-row.playing { background: color-mix(in srgb, #22c55e 22%, #fff); }

/* search box with its own × */
.srch { position: relative; }
.srch input { width: 100%; min-height: 34px; padding: 0 60px 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font-size: 16px; }
.srch.roster input { min-height: 44px; background: var(--card); margin-bottom: 8px; }
.srch input:focus { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
.srch input::-webkit-search-cancel-button { display: none; }
.srch-x { position: absolute; right: 30px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); border: 1px solid var(--line-2); color: var(--muted); }
.srch.roster .srch-x { top: calc(50% - 4px); }
.srch-x svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

/* wide desk: breathing room between the stacked cards under the courts */
@media (min-width: 900px) { .dsk-main { display: grid; gap: 12px; } .dsk-main .courts-grid { margin: 0; } .dsk-main > .nextup, .dsk-main > .reqs, .dsk-main > section { margin: 0; } }

/* desk admin: the logo + name top-left is the way back to the dashboard; on a mouse it reads as a link */
a.brand .wm b, a.brand .wm small, a.brand img { transition: color .15s, transform .15s, opacity .15s; }
@media (hover: hover) {
  a.brand:hover .wm b { color: var(--accent-text); }
  a.brand:hover .wm small { opacity: .75; }
  a.brand:hover img { transform: scale(1.06); }
}
a.brand:active img { transform: scale(.96); }


/* sliders: our own track so the fill always reaches the thumb, on iOS too (--p is set by paintRange) */
.range input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; }
.range input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--accent-text) 0, var(--accent-text) var(--p, 50%), var(--line-2) var(--p, 50%), var(--line-2) 100%); }
.range input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--accent-text); margin-top: -8px; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.range input[type=range]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--line-2); }
.range input[type=range]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--accent-text); }
.range input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--accent-text); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.range input[type=range]:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: 6px; }
/* the Card row: label, on/off switch, slider, value */
.range.with-toggle { grid-template-columns: auto auto 1fr auto; }
.toggle.mini span { width: 34px; height: 20px; border-radius: 10px; }
.toggle.mini span::after { width: 14px; height: 14px; }
.toggle.mini input:checked + span::after { transform: translateX(14px); }
.cmp-controls .btn:disabled { opacity: .4; }

/* composer: the theme switch is moot while the card is off */
.seg.off { opacity: .45; }

/* ---- desk header rows. Tablet and up: brand · status · tools on one row, the viewer pill on its own row below.
   Phone: row 1 is brand (the whole name, up to two lines) with Live · N in · N waiting at the far right; row 2 is the
   viewer pill (players) with the QR, theme and settings buttons at the far right, or just the buttons (admin). ---- */
#topbar .bar { flex-wrap: wrap; }
#topbar .tools { display: flex; align-items: center; gap: 10px; flex: none; }
#topbar .bar.admin .tools { gap: 7px; }
#topbar .brk { display: none; }
#topbar .bar .viewer-pill { flex: 1 1 100%; order: 10; }
@media (max-width: 767px) {
  #topbar .brk { display: block; flex: 1 1 100%; height: 0; margin: -4px 0 0; }
  #topbar .bar .viewer-pill { flex: 1 1 0; order: 3; min-width: 0; }
  #topbar .tools { order: 4; margin-left: auto; }
  .status { margin-left: auto; }
  .brand .wm b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; letter-spacing: .1em; font-size: 13px; line-height: 1.15; }
  .bar.admin .brand .wm b { font-size: 12px; letter-spacing: .1em; }
  .bar:not(.admin) .brand .wm small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; letter-spacing: .18em; line-height: 1.25; }
  #topbar .bar { row-gap: 8px; }
}

/* a club's uploaded logo is shown as it is; the dark-mode invert is only for the house wordmark */
:root .brandimg.asis, :root[data-theme="dark"] .brandimg.asis { filter: none !important; }
.brand img.asis.round { border-radius: 50%; }   /* only a logo with a solid background; a transparent one keeps its shape */

/* import sheet: the +1 note */
.imp-note { margin: 0; }
.imp-note b { color: var(--text); font-weight: 600; }

/* request rows: the status word (Locked, Waiting, Forced…) is wider than the Next/Then label column, so it sizes to its text */
.nu-row.req .label { width: auto; min-width: 78px; white-space: nowrap; }

/* iPhone browsers turn text that looks like an address or date into hidden links ("Court 1 · Open court" matched); keep them looking like plain text */
a[x-apple-data-detectors] { color: inherit !important; text-decoration: none !important; font: inherit !important; letter-spacing: inherit !important; pointer-events: none; }

/* a due showdown: the only button on the open court, gently pulsing so the desk sees it */
.btn.showdown-due { background: var(--l3, #e0b955); color: var(--bg); border-color: transparent; animation: showdown-blink 1.1s ease-in-out infinite; }
@keyframes showdown-blink { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 color-mix(in srgb, var(--l3, #e0b955) 60%, transparent); } 50% { opacity: .55; box-shadow: 0 0 0 6px color-mix(in srgb, var(--l3, #e0b955) 0%, transparent); } }
@media (prefers-reduced-motion: reduce) { .btn.showdown-due { animation: none; } }

/* hidden ratings: fixed number columns so values sit under their headings; the name takes what is left, tags wrap under it */
table.ratings { table-layout: fixed; }
table.ratings col.c-n { width: 24px; } table.ratings col.c-r { width: 52px; } table.ratings col.c-g { width: 42px; } table.ratings col.c-t { width: 60px; } table.ratings col.c-s { width: 44px; }
table.ratings th { font-size: 8.5px; letter-spacing: .04em; padding-left: 2px; padding-right: 2px; white-space: nowrap; overflow: visible; }
table.ratings td { padding-left: 3px; padding-right: 3px; }
table.ratings td.name .tags { flex-wrap: nowrap; }
table.ratings td.name .tags .chip { height: 18px; min-width: 0; padding: 0 5px; font-size: 9px; }
table.ratings th:nth-child(n+4), table.ratings td:nth-child(n+4) { text-align: center; }
table.ratings th:nth-child(3), table.ratings td:nth-child(3) { text-align: right; }
table.ratings td { vertical-align: middle; }
table.ratings td.name { overflow: hidden; }
table.ratings td.name .nm { display: block; overflow-wrap: anywhere; line-height: 1.2; }
table.ratings td.name .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
table.ratings td.name .tags:empty { display: none; }
table.ratings td.name .tags .chip { margin-left: 0; }
table.ratings td:nth-child(3) .dm { display: block; margin: 1px 0 0; }

/* desk game log: slide to remove */
.hrow.swipe { position: relative; touch-action: pan-y; transition: transform .2s ease, background .15s; user-select: none; }
.hrow.swipe.dragging { transition: none; }
.hrow.swipe .hdel { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: inherit; background: var(--danger, #ef4444); color: #fff; font-weight: 700; letter-spacing: .06em; opacity: 0; pointer-events: none; transition: opacity .15s; }
.hrow.swipe.armed .hdel { opacity: .92; }

/* stats: desk sub-tabs, the top-three cards, avatars beside leaderboard names */
.stats-seg { margin-bottom: 12px; width: 100%; }
@media (min-width: 700px) { .stats-seg { max-width: 360px; } }
.lb-kicker { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 2px 0 10px; font-family: var(--font-brand); font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--accent-text); }
.lb-kicker b { color: var(--text); font-weight: 700; } .lb-kicker span { color: var(--muted); }
.stats-seg button { min-height: 34px; font-size: 13px; }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.podium.n1 { grid-template-columns: minmax(0, 1fr); } .podium.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pcard { position: relative; display: grid; justify-items: center; align-content: start; gap: 6px; padding: 12px 8px 10px; border-radius: var(--radius); background: linear-gradient(180deg, color-mix(in srgb, var(--court) 9%, var(--card)), var(--card)); border: 1px solid var(--line); min-width: 0; }
.pcard.r1 { border-color: color-mix(in srgb, var(--l3) 55%, var(--line)); background: linear-gradient(180deg, color-mix(in srgb, var(--l3) 12%, var(--card)), var(--card)); }
.pcard.me { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: -2px; }
.pcard .rank { position: absolute; top: 7px; left: 9px; font-family: var(--font-brand); font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--muted); }
.pcard.r1 .rank { color: var(--l3); }
.pcard .av { width: 44px; height: 44px; } .pcard .av.ph { font-size: 17px; }
.pcard .pn { font-size: 13px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .form { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; align-content: flex-start; height: 46px; overflow: hidden; }   /* room for three rows on every card, so pictures and names line up */
.pcard .form i { font-style: normal; width: 14px; height: 14px; border-radius: 3px; display: grid; place-items: center; font-size: 8.5px; font-weight: 700; font-family: var(--font-brand); }
.pcard .form i.w { background: var(--court-soft); color: var(--court); } .pcard .form i.l { background: var(--danger-soft); color: var(--danger); }
/* leaderboard: the picture has its own narrow column between # and the name, so the Player heading lines up with the names */
/* an even 8px from the number to the picture and from the picture to the name */
table.lboard td:first-child, table.lboard th:first-child { width: 1%; white-space: nowrap; padding-right: 0; }
table.lboard .lbav { width: 26px; padding: 10px 8px; text-align: left; }
table.lboard td.name, table.lboard th:nth-child(3) { padding-left: 0; }
td.lbav .av { width: 26px; height: 26px; display: block; } td.lbav .av.ph { display: grid; font-size: 10px; }

/* hidden ratings: check-in and first-game times as columns on wide desks, as a line under the name on phones */
table.ratings col.c-w { width: 54px; }
table.ratings .when-inline { display: none; font-size: 11px; color: var(--muted); margin-top: 2px; }
@media (max-width: 699px) {
  table.ratings th.when, table.ratings td.when, table.ratings col.c-w { display: none; }
  table.ratings .when-inline { display: block; }
}

/* hidden ratings on a desk or laptop: the columns share the width evenly from the middle out, with real breathing room */
@media (min-width: 700px) {
  table.ratings col.c-n { width: 40px; }
  table.ratings col.c-r { width: 12%; } table.ratings col.c-g { width: 9%; } table.ratings col.c-t { width: 10%; } table.ratings col.c-s { width: 10%; } table.ratings col.c-w { width: 10%; }
  table.ratings th { font-size: 10px; letter-spacing: .12em; padding: 10px 12px; }
  table.ratings td { padding: 11px 12px; font-size: 14px; }
  table.ratings th:nth-child(n+3), table.ratings td:nth-child(n+3) { text-align: center; }
  table.ratings td:nth-child(3) .dm { display: inline; margin: 0 0 0 6px; }
  table.ratings td.name .tags .chip { height: 20px; font-size: 10px; padding: 0 7px; }
}

.dsk-row .nm small { font-size: 10px; }   /* games count: small, the name gets the room */

/* share link: the button's "new" tag, the link box and the preview picture */
.iconbtn.linkbtn { position: relative; overflow: visible; }
.iconbtn .newtag { position: absolute; top: -7px; right: -7px; font-family: var(--font-brand); font-style: normal; font-size: 8px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; line-height: 1; padding: 3px 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink, #04202a); box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.linkbox { margin: 4px 0 10px; }
.linkbox input { width: 100%; min-height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card-2); color: var(--text); font: inherit; font-size: 15px; user-select: all; -webkit-user-select: all; }
.link-preview { display: block; width: 100%; margin-top: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); aspect-ratio: 1200 / 630; object-fit: cover; }

/* ---------- seasonal theme: Halloween. The accent turns pumpkin; a fixed layer of webs, ghosts, bats, a spider, pumpkins and a zombie
   drifts over the page (no pointer events); switching it off sends everything up and away like ghosts ---------- */
:root[data-season="halloween"] { --accent: #d9640c; --accent-text: #b4520a; --accent-soft: #fde9d6; }
:root[data-season="halloween"][data-theme="dark"] { --accent: #f6a21e; --accent-text: #f6a21e; --accent-soft: #3a2608; }
.iconbtn.season-btn .season-ico { font-size: 19px; line-height: 1; filter: grayscale(1) opacity(.5); transition: filter .3s; }
.iconbtn.season-btn.on { border-color: var(--accent); }
.iconbtn.season-btn.on .season-ico { filter: none; }
#season { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; animation: fade .6s; }
#season > * { animation-fill-mode: both; }
#season .web { position: absolute; top: 0; width: 150px; height: 150px; color: var(--text); opacity: .28; }
#season .web path { fill: none; stroke: currentColor; stroke-width: .9; stroke-linecap: round; }
#season .web.tl { left: 0; } #season .web.tr { right: 0; transform: scaleX(-1); }
#season .sp { position: absolute; font-size: 30px; line-height: 1; filter: drop-shadow(0 4px 10px rgba(0,0,0,.35)); will-change: transform; }
#season .ghost { top: 20%; animation: drift 24s linear infinite, bob 3s ease-in-out infinite alternate; opacity: .92; }
#season .ghost.g2 { top: 58%; font-size: 24px; animation-duration: 34s, 2.5s; animation-delay: -15s, -1s; }
#season .bat { top: 9%; animation: fly 17s linear infinite, flap .38s ease-in-out infinite alternate; }
#season .bat.b2 { animation-duration: 23s, .42s; animation-delay: -8s, -.1s; font-size: 22px; }
#season .bat.b3 { animation-duration: 29s, .34s; animation-delay: -17s, -.2s; font-size: 26px; }
#season .thread { position: absolute; top: 0; left: 70%; width: 2px; height: 120px; background: linear-gradient(rgba(255,255,255,.45), rgba(255,255,255,.08)); animation: drop 9s ease-in-out infinite; }
:root[data-theme="light"] #season .thread { background: linear-gradient(rgba(20,30,40,.4), rgba(20,30,40,.08)); }
#season .thread .spider { position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%); font-size: 22px; animation: spin 4s ease-in-out infinite alternate; }
#season .pumpkin { bottom: calc(76px + env(safe-area-inset-bottom)); font-size: 36px; transform-origin: bottom center; animation: wobble 2.8s ease-in-out infinite; }
#season .pumpkin.p1 { left: 10px; } #season .pumpkin.p2 { right: 12px; animation-delay: -1.3s; font-size: 30px; }
#season .zombie { bottom: calc(74px + env(safe-area-inset-bottom)); font-size: 32px; animation: walk 52s linear infinite, lurch .9s ease-in-out infinite alternate; }
@keyframes drift { from { left: -8%; } to { left: 104%; } }
@keyframes bob { from { transform: translateY(-8px) rotate(-5deg); } to { transform: translateY(8px) rotate(5deg); } }
@keyframes fly { 0% { left: 104%; top: 7%; } 35% { top: 14%; } 70% { top: 5%; } 100% { left: -8%; top: 10%; } }
@keyframes flap { from { transform: scaleX(1); } to { transform: scaleX(.6); } }
@keyframes drop { 0%, 100% { height: 60px; } 50% { height: 190px; } }
@keyframes spin { from { transform: translateX(-50%) rotate(-12deg); } to { transform: translateX(-50%) rotate(12deg); } }
@keyframes wobble { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg) translateY(-2px); } }
@keyframes walk { from { left: -8%; } to { left: 104%; } }
@keyframes lurch { from { transform: rotate(-7deg) translateY(0); } to { transform: rotate(7deg) translateY(-4px); } }
#season.bye > * { animation: ghostOut .9s ease-in forwards !important; }
@keyframes ghostOut { to { opacity: 0; transform: translateY(-80px) scale(1.15); filter: blur(8px); } }
@media (max-width: 600px) { #season .sp { font-size: 24px; } #season .web { width: 110px; height: 110px; } #season .ghost.g2, #season .bat.b3 { display: none; } #season .pumpkin { font-size: 28px; } #season .thread { left: 62%; } }
@media (prefers-reduced-motion: reduce) { #season > *, #season .thread .spider { animation: none !important; } }

/* a saved session's player view has no Courts tab: three tabs across, no dead space */
#tabs.three { grid-template-columns: repeat(3, 1fr); }

/* the desk's History (Stats tab): saved sessions with icon buttons */
.hist-list .hsess { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); }
.hist-list .hsess:first-child { border-top: 0; }
.hsess.cur { background: var(--accent-soft); }
.hsess .hs-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.hsess .hs-txt b { font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.hsess .hs-day { color: inherit; text-decoration: none; }
.hsess .hs-day:hover { text-decoration: underline; }
.hsess small { color: var(--muted); font-size: 12px; }
.hsess .qas { display: flex; gap: 6px; flex: none; }
.qa.ico { width: 36px; min-height: 34px; padding: 0; display: inline-grid; place-items: center; text-decoration: none; color: var(--text); }
.qa.ico svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.qa.on { border-color: var(--warn); color: var(--warn); }   /* a requested matchup that is holding its players */
