/* GolfScore — shared styles. Mobile first; large tap targets for use on the course. */

:root {
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-2: #eef2ec;
  --text: #17201a;
  --muted: #5d6b61;
  --line: #d6ddd3;
  --brand: #1f6b3a;
  --brand-ink: #ffffff;
  --brand-soft: #e3efe6;
  --accent: #c58a10;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --ok: #1f7a3f;
  --warn: #9a6400;
  --under: #b3261e;   /* better than (net) par: red */
  --over: #1d4f91;
  --par: #1d4f91;     /* net par: blue */
  --radius: 12px;
  --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 4px 16px rgb(0 0 0 / .05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101512; --surface: #18201b; --surface-2: #1f2a23; --text: #e8efe9; --muted: #9aaa9f;
    --line: #2d3a31; --brand: #3fa463; --brand-ink: #08130c; --brand-soft: #1d3325;
    --accent: #e0a92f; --danger: #f2827a; --danger-soft: #3a1d1b; --ok: #59c27f; --warn: #e0a92f;
    --under: #ff8a80; --over: #8ab4f8; --par: #8ab4f8; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101512; --surface: #18201b; --surface-2: #1f2a23; --text: #e8efe9; --muted: #9aaa9f;
  --line: #2d3a31; --brand: #3fa463; --brand-ink: #08130c; --brand-soft: #1d3325;
  --accent: #e0a92f; --danger: #f2827a; --danger-soft: #3a1d1b; --ok: #59c27f; --warn: #e0a92f;
  --under: #ff8a80; --over: #8ab4f8; --par: #8ab4f8; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* player and leaderboard pages (phones): no pinch zoom and no double-tap zoom while tapping scores */
html.nozoom, html.nozoom body { touch-action: pan-x pan-y; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 var(--font); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
a { color: var(--brand); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.spacer { flex: 1; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: .75rem; }

/* ---------- layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; background: var(--brand); color: var(--brand-ink);
  padding: .6rem 16px; display: flex; align-items: center; gap: .75rem; min-height: 52px;
}
.topbar .title { font-weight: 700; font-size: 1.05rem; line-height: 1.15; }
.topbar .sub { font-size: .8rem; opacity: .85; }
/* the title lines take the room left by the logo and save icon, and cut long names short rather than wrap */
.topbar .titles { flex: 1; min-width: 0; }
.topbar .titles > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* hole by hole: a taller header with the club name on top and a bigger logo */
.topbar.big { min-height: 68px; }
.topbar.big .title { font-size: 1.2rem; }
.topbar.big .toplogo { height: 52px; max-width: 96px; }
.topbar a, .topbar button.link { color: var(--brand-ink); }
.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }
.wrap.wide { max-width: 1200px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }

/* ---------- forms ---------- */
label { display: block; font-size: .85rem; font-weight: 600; margin: .6rem 0 .25rem; color: var(--muted); }
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: .6rem .7rem; min-height: 44px;
}
textarea { min-height: 120px; font-family: var(--mono); font-size: .85rem; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 1px; }
input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; vertical-align: middle; }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 500; color: var(--text); font-size: .95rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
@media (max-width: 520px) { .grid3 { grid-template-columns: 1fr 1fr; } }

button, .btn {
  font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 10px; padding: .55rem 1rem; min-height: 44px; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; gap: .4rem; text-decoration: none;
}
button.primary, .btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
button.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
button.big { width: 100%; min-height: 56px; font-size: 1.1rem; }
button.small, .btn.small { min-height: 34px; padding: .25rem .65rem; font-size: .85rem; }
button.link { background: none; border: 0; padding: 0; min-height: 0; color: var(--brand); text-decoration: underline; font-weight: 500; }
button:disabled { opacity: .5; cursor: not-allowed; }

.notice { padding: .7rem .9rem; border-radius: 10px; background: var(--brand-soft); margin: .5rem 0; }
.notice.error { background: var(--danger-soft); color: var(--danger); }
.pill { display: inline-block; padding: .05rem .5rem; border-radius: 99px; font-size: .75rem; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.pill.ok { background: var(--brand-soft); color: var(--ok); }
.pill.warn { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--warn); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { padding: .45rem .5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
td.r, th.r { text-align: right; } td.c, th.c { text-align: center; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- score entry ---------- */
/* save state: a cloud icon of fixed size. Saved is dimmed (inactive); sending lights up and pulses; offline or not saved is red */
.sync { position: relative; flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: rgb(255 255 255 / .12); opacity: .55; transition: opacity .2s, background .2s; }
.sync svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sync .arrow, .sync .cross { display: none; }
.sync.waiting { opacity: 1; background: rgb(255 255 255 / .3); animation: syncpulse 1.2s ease-in-out infinite; }
.sync.waiting .tick { display: none; } .sync.waiting .arrow { display: inline; }
.sync.offline { opacity: 1; background: #d93025; color: #fff; }
.sync.offline .tick { display: none; } .sync.offline .cross { display: inline; }
.sync .badge { position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; background: #ffcc4d; color: #222; font-size: .65rem; font-weight: 700; line-height: 16px; text-align: center; }
.sync .badge:empty { display: none; }
@keyframes syncpulse { 50% { background: rgb(255 255 255 / .12); } }
@media (prefers-reduced-motion: reduce) { .sync.waiting { animation: none; } }

.holebar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.holebar .nav { width: 52px; height: 52px; font-size: 1.4rem; padding: 0; flex: none; }
.holeinfo { flex: 1; text-align: center; }
.holeinfo .h { font-size: 1.9rem; font-weight: 800; line-height: 1; }
.holeinfo .m { color: var(--muted); font-size: .9rem; margin-top: .2rem; }

.player { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.player:last-child { border-bottom: 0; }
/* "by draw": a heavier line where the next team (of 1 or 2 players) starts */
.player.newteam { border-top: 3px solid var(--brand); }
.player .nm { font-weight: 700; font-size: 1.05rem; }
.player .meta { font-size: .8rem; color: var(--muted); }
.player .res { font-size: .85rem; font-weight: 700; color: var(--brand); }
.stepper { display: grid; grid-template-columns: 42px 48px 54px 48px; gap: 4px; align-items: center; }
.stepper button { height: 56px; font-size: 1.6rem; padding: 0; }
.stepper .pickbtn { font-size: 1.1rem; font-weight: 800; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.stepper .pickbtn.on { background: var(--danger); color: #fff; border-color: var(--danger); }
.player .meta { white-space: nowrap; }
.player .meta .res { color: var(--brand); font-weight: 700; }
.player .meta .dots-shots { color: var(--accent); letter-spacing: 1px; font-size: .7rem; }
.player .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the name opens that player's card player by player */
.player button.nm { display: block; max-width: 100%; min-height: 0; padding: 0; border: 0; background: none; font: inherit; font-weight: 700; font-size: 1.05rem; color: var(--text); text-align: left; text-decoration: underline dotted color-mix(in srgb, var(--text) 40%, transparent); text-underline-offset: 3px; }
.player > div:first-child { min-width: 0; }
/* confirming handicaps: the tee details wrap beside a three-button stepper (no "X" column) */
.player.allow .nm, .player.allow .meta { white-space: normal; overflow-wrap: anywhere; }   /* full names, so team-mates can be told apart */
.nowrap { white-space: nowrap; }
.player.allow .stepper { grid-template-columns: 48px 54px 48px; }
.stepper .val { height: 56px; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 800; border-radius: 10px; background: var(--surface-2); }
.stepper .val.empty { color: var(--muted); font-weight: 500; font-size: 1.2rem; }
.stepper .val.under { color: var(--under); } .stepper .val.atpar { color: var(--par); } .stepper .val.over { color: var(--text); }
.pick { margin-top: 4px; font-size: .8rem; }
.teamline { display: flex; justify-content: space-between; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--brand-soft); font-weight: 700; }

/* hole by hole: the next hole slides in from the right, the previous one from the left */
.card.slide-next, .ninewrap.slide-next { animation: slide-next .22s ease-out; }
.card.slide-prev, .ninewrap.slide-prev { animation: slide-prev .22s ease-out; }
@keyframes slide-next { from { transform: translateX(40px); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes slide-prev { from { transform: translateX(-40px); opacity: .3; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .card.slide-next, .card.slide-prev, .ninewrap.slide-next, .ninewrap.slide-prev { animation: none; } }
/* scorecard screens: names and handicaps in the header, one nine at a time */
.cardnames { display: flex; flex-wrap: wrap; gap: .2rem 1rem; margin: 0; font-size: 1.05rem; }
.tabs.ninetabs { margin-bottom: 0; }
.ninetabs button { flex: 1; }

.dots { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; margin: 12px 0; }
.dots button { min-height: 36px; padding: 0; font-size: .85rem; border-radius: 8px; }
.dots button.done { background: var(--brand-soft); border-color: transparent; color: var(--ok); }
.dots button.cur { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

/* player by player (singles): holes 1-18 down the screen, the action buttons stay under the title bar */
.ppbar { position: sticky; top: 52px; z-index: 9; background: var(--bg); margin: -16px -16px 12px; padding: 10px 16px 8px; border-bottom: 1px solid var(--line); }
.ppbar .tabs { margin: 8px 0 0; }
.pp-who { margin-top: 6px; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.pp { padding: 8px 12px; }
.pp-row { display: grid; grid-template-columns: 2.2rem 1.6rem 2.5rem 1fr 2.4rem; gap: 4px; align-items: center; text-align: center; padding: 2px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.pp-row:last-child { border-bottom: 0; }
.pp-row.head { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 4px 0; }
.pp-row.sub > div { line-height: 1.6rem; }
.pp-row.sub > div:first-child { font-size: .8rem; }
.pp-row.sub .pp-step, .pp-row.sub .pp-gross { height: auto; }
.pp-row.sub { font-weight: 800; background: var(--surface-2); border-radius: 8px; padding: 8px 0; margin: 2px 0; border-bottom: 0; }
.pp-hole { min-height: 42px; padding: 0; flex-direction: column; gap: 0; font-weight: 800; font-size: 1rem; background: var(--brand-soft); border-color: transparent; color: var(--brand); line-height: 1; }
.pp-si { display: flex; align-items: center; justify-content: center; gap: 2px; }
.pp-si .dots-shots { color: var(--accent); font-size: .55rem; letter-spacing: 0; display: flex; flex-direction: column; line-height: .75; }   /* one shot dot above another (up to 3 or 4) */
.pp-si .dots-shots i { font-style: normal; }
/* scrolling the card snaps (animated) to holes 1-9, holes 10-18, then the totals */
html.pp-snap { scroll-snap-type: y mandatory; }
.pp-sec { scroll-snap-align: start; scroll-snap-stop: always; }
.pp-sec .pp-row:last-child { border-bottom: 0; }
.pp-step { grid-template-columns: 38px 44px 38px; justify-content: center; }
.pp-step.x { grid-template-columns: 32px 38px 44px 38px; }
.pp-step button, .pp-step .val { height: 42px; }
.pp-step button { font-size: 1.3rem; }
.pp-step .pickbtn { font-size: .95rem; }
.pp-step .val { font-size: 1.35rem; }
.pp-step .val.empty { font-size: 1rem; }
.pp-score { font-weight: 800; color: var(--brand); }
.pp-gross { font-weight: 800; text-align: center; }

/* rules and notes: the size is set by the A− / A+ buttons; long web addresses wrap */
.notes { line-height: 1.5; overflow-wrap: anywhere; }

.scorecard { font-size: .85rem; min-width: 640px; }
.scorecard td:first-child { padding-right: .6rem; }
.scorecard th, .scorecard td { padding: .3rem .25rem; text-align: center; }
.scorecard td:first-child, .scorecard th:first-child { text-align: left; white-space: nowrap; }
.scorecard .tot { font-weight: 800; background: var(--surface-2); }
.scorecard tr.teamtotal td { font-weight: 800; border-top: 2px solid var(--line); background: color-mix(in srgb, var(--brand) 10%, var(--surface-2)); }
/* one nine holes per block (leaderboard detail): narrow enough for a phone without sideways scrolling */
tr.clash td { background: var(--danger-soft); }
.scorecard.nine { min-width: 0; width: 100%; font-size: .8rem; table-layout: fixed; }
.scorecard.nine th, .scorecard.nine td { padding: .3rem .05rem; }
.scorecard.nine td:first-child, .scorecard.nine th:first-child { width: 3.9rem; overflow: hidden; text-overflow: ellipsis; padding-right: .3rem; }
.scorecard.nine th { font-size: .62rem; letter-spacing: 0; padding-left: 0; padding-right: 0; }
.scorecard.nine th.sum { width: 1.65rem; }
.scorecard.nine th:first-child { text-transform: none; font-size: .66rem; overflow: visible; white-space: nowrap; padding-left: .25rem; }
.counts { background: color-mix(in srgb, var(--brand) 22%, transparent); font-weight: 800; border-radius: 6px; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--brand) 55%, transparent); }
.sc-under { color: var(--under); font-weight: 700; } .sc-over { color: var(--over); }
/* the player's own screens: blue = net par, black = worse than net par, red = better */
.sn-under { color: var(--under); font-weight: 700; } .sn-par { color: var(--par); font-weight: 700; } .sn-over { color: var(--text); }

.codebox { font-family: var(--mono); font-size: 1.4rem; text-align: center; letter-spacing: .08em; text-transform: uppercase; }
#scanVideo { width: 100%; border-radius: var(--radius); background: #000; margin-top: 8px; }

/* ---------- leaderboard ---------- */
.lb td { padding: .55rem .5rem; }
.lb .pos { width: 3rem; font-weight: 800; }
.lb .pts { font-weight: 800; font-size: 1.1rem; text-align: right; }
/* To par: white on red when better than par, white on black when worse, white on blue when level */
.lb .tp { display: inline-block; min-width: 3rem; padding: .2rem .55rem; border-radius: 8px; text-align: center; font-weight: 800; font-size: 1.05rem; line-height: 1.3; }
.lb .tp.neg, .lb .tp.pos, .lb .tp.zero { color: #fff; }
.lb .tp.neg { background: #c62828; }
.lb .tp.pos { background: #000; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45); }
.lb .tp.zero { background: #1d4f91; }
.lb .thru { color: var(--muted); text-align: right; width: 3.5rem; }
/* the name column takes the spare width, so the number columns sit close together on the right */
.lb td.nm { width: 100%; }
.lb .lbname { white-space: nowrap; }
/* below computer width the name column can't push the table wider than the screen: long names end in "…" instead,
   and a team lists one player per line in a smaller font */
@media (max-width: 720px) {
  .lb td.nm { max-width: 0; }
  .lb .lbname { display: block; overflow: hidden; text-overflow: ellipsis; }
  .lb td.nm.team { font-size: .85rem; line-height: 1.25; }
}
.lb .idx { color: var(--muted); white-space: nowrap; }
@media (max-width: 480px) {   /* phones: leave more room for the names */
  .lb th, .lb td { padding-left: .18rem; padding-right: .18rem; }
  .lb td.nm { font-size: .9rem; }
  .lb .idx { font-size: .8rem; }
  .lb .pos { width: 1.8rem; }
  .lb .tp { min-width: 2.4rem; padding: .15rem .3rem; font-size: .95rem; }
  .lb .pts { font-size: 1rem; }
  .lb .thru { width: 2.2rem; }
  .lb th { font-size: .68rem; white-space: nowrap; letter-spacing: .02em; }
}
.lb tr.click { cursor: pointer; }
/* the leaderboard's "updated" time stays on one line; the title text wraps beside it instead */
#updated { white-space: nowrap; }
@media (max-width: 340px) {   /* the smallest phones: everything a touch smaller so a 13-letter name still fits */
  .lb td.nm { font-size: .8rem; } .lb td.nm.team { font-size: .75rem; } .lb .idx { font-size: .75rem; } .lb th { font-size: .58rem; }
  .lb .tp { min-width: 2rem; font-size: .85rem; } .lb .pts { font-size: .9rem; } .lb .pos { width: 1.4rem; }
}
.lb .under { color: var(--under); } .lb .over { color: var(--over); }
.lb tr.detail td { background: var(--surface-2); max-width: 0; }
.card { min-width: 0; }
html, body { overflow-x: hidden; }
/* clip, not hidden, where supported: hidden turns the page into its own scroll box and the sticky bars stop sticking */
@supports (overflow: clip) { html, body { overflow-x: clip; } }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button { min-height: 36px; }
.tabs button.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

body.tv { font-size: clamp(18px, 1.6vw, 34px); background: #0c120e; color: #eef4ef; }
body.tv .topbar { background: #0f3d22; padding: .8rem 2rem; }
body.tv .wrap { max-width: none; padding: 1rem 2rem; }
body.tv .card { background: #121b15; border-color: #24332a; box-shadow: none; }
body.tv th { color: #9db3a4; }
body.tv td { border-color: #24332a; }
body.tv .lb .pts, body.tv .lb .tp { font-size: 1.3em; }
body.tv .progress { height: 4px; background: #3fa463; transition: width 1s linear; }

/* ---------- admin ---------- */
.adminnav { display: flex; gap: 4px; overflow-x: auto; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 52px; z-index: 9; }
.adminnav button { min-height: 38px; white-space: nowrap; border-color: transparent; background: none; }
.adminnav button.on { background: var(--brand-soft); color: var(--brand); }
.holegrid { display: grid; grid-template-columns: 3.5rem repeat(9, 1fr); gap: 4px; align-items: center; font-size: .85rem; }
.holegrid input { min-height: 36px; padding: .25rem; text-align: center; }
.holegrid .hd { text-align: center; color: var(--muted); font-weight: 700; }
.tee-row { display: grid; grid-template-columns: 1.4fr .9fr 1fr 1fr auto; gap: 6px; margin-bottom: 6px; }
.tee-row input, .tee-row select { min-height: 38px; }
@media (max-width: 520px) { .tee-row { grid-template-columns: 1fr 1fr; } }

/* ---------- printable entry cards ---------- */
/* Entry-code labels: A4, 3 x 10 labels of 60 x 29 mm */
.label-preview { zoom: .6; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.label-page { width: 210mm; height: 297mm; box-sizing: border-box; padding: var(--top) 0 0 var(--left); background: #fff; color: #111;
  display: grid; grid-template-columns: repeat(3, 60mm); grid-template-rows: repeat(10, 29mm); column-gap: var(--gx); row-gap: var(--gy);
  align-content: start; overflow: hidden; box-shadow: 0 1px 6px rgba(0,0,0,.25); break-after: page; page-break-after: always; }
.label-page:last-child { break-after: auto; page-break-after: auto; }
.label { width: 60mm; height: 29mm; box-sizing: border-box; padding: 2mm; display: flex; align-items: center; gap: 2mm; overflow: hidden; outline: 1px dashed #c8c8c8; outline-offset: -1px; }
.label .lq svg { display: block; width: 24mm; height: 24mm; }
.label .lt { min-width: 0; flex: 1; line-height: 1.12; }
.label .ln, .label .ls, .label .lp { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label .ln { font-weight: 700; font-size: 8.5pt; }
.label .ls { font-size: 7.5pt; color: #333; margin-top: .8mm; }
.label .lp { font-size: 7.5pt; font-weight: 600; margin-top: .8mm; }
.label .lw { font-size: 6pt; color: #888; margin-top: .4mm; }
.label .lc { font-family: var(--mono); font-weight: 700; font-size: 8.5pt; letter-spacing: .02em; margin-top: 1mm; white-space: nowrap; }
@media print {
  body { background: #fff; }
  .topbar, .adminnav, .noprint { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .label-preview { zoom: 1 !important; display: block; }
  .label-page { box-shadow: none; margin: 0; }
  .label { outline: 0; }
}
/* the player's own scorecard: room for "Player PC" in the label column */
.ninewrap .scorecard.nine td:first-child, .ninewrap .scorecard.nine th:first-child { width: 4.8rem; }
.ninewrap .scorecard.nine td.tot:last-child:empty { background: none; }
@media (max-width: 360px) { .ninewrap .scorecard.nine td:first-child, .ninewrap .scorecard.nine th:first-child { width: 4.1rem; font-size: .72rem; } .ninewrap .scorecard.nine tr.teamtotal td { font-size: .7rem; } }
/* the club's logo in the title bar, on a white tile so a dark logo still shows on the club colour */
.toplogo { height: 36px; max-width: 72px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px; flex: none; }
/* splash page: the first screen a player sees each day (club logo, app name, competition, sponsor) */
.splash { position: fixed; inset: 0; z-index: 50; background: var(--surface); display: flex; flex-direction: column; overflow-y: auto; cursor: pointer; }
.splash-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; padding: 32px 24px 16px; text-align: center; }
.splash-club { max-width: min(70vw, 280px); max-height: 30vh; object-fit: contain; }
.splash-clubname { font-size: 1.6rem; font-weight: 800; color: var(--brand); }
.splash-app { font-size: 1rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); margin-bottom: .6rem; }
.splash-comp { font-size: 1.5rem; font-weight: 800; line-height: 1.2; }
.splash-players { font-size: 1rem; color: var(--muted); line-height: 1.35; }
.splash-by { margin-top: 1rem; font-size: .9rem; color: var(--muted); font-style: italic; }
.splash-sponsor { font-size: 1.2rem; font-weight: 700; }
.splash-sponsorlogo { max-width: min(60vw, 240px); max-height: 18vh; object-fit: contain; }
.splash .big { margin-top: 1.4rem; width: min(100%, 320px); }
.splash-copy { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); font-size: .7rem; color: var(--muted); text-align: center; }
/* admin: colour choice and logo fields */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.swatch { display: flex; align-items: center; gap: .5rem; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 500; margin: 0; }
.swatch span { width: 22px; height: 22px; border-radius: 50%; flex: none; }
.swatch input { width: 20px; height: 20px; min-height: 0; margin: 0; padding: 0; flex: none; }
.swatch:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.logopick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.logoprev { max-height: 72px; max-width: 200px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px; }
/* dark mode: logos sit on a white tile, so dark lettering on a transparent logo stays readable */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .splash-club, :root:not([data-theme="light"]) .splash-sponsorlogo { background: #fff; border-radius: 12px; padding: 8px; } }
:root[data-theme="dark"] .splash-club, :root[data-theme="dark"] .splash-sponsorlogo { background: #fff; border-radius: 12px; padding: 8px; }

/* squads (admin): one box per squad, teams dragged (or tapped) between them */
.sqgrid { display: grid; grid-template-columns: minmax(200px, 260px) 1fr; gap: 10px; align-items: stretch; }
.sqsquads { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; align-items: start; align-content: start; }
@media (max-width: 560px) { .sqgrid { grid-template-columns: 1fr; } }
.sqbox { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); padding: 8px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.sqbox.sqfree { border-style: dashed; }
.sqbox.full { border-color: var(--brand); }
.sqbox.over { outline: 2px solid var(--brand); outline-offset: -2px; }
.sqhead { display: flex; align-items: center; gap: 6px; }
.sqhead b, .sqname { flex: 1; min-width: 0; }
.sqname { font-weight: 700; padding: .3rem .45rem; min-height: 0; }
.sqlist { display: flex; flex-direction: column; gap: 4px; }
.sqteam { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .4rem .55rem; cursor: grab; font-size: .9rem; }
.sqteam > b, .sqnames { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sqteam.picked { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft, rgba(0,0,0,.15)); }
.sqteam.dragging { opacity: .5; }
.sqdrop { box-sizing: border-box; height: var(--sqchip, 3.45rem); display: flex; align-items: center; justify-content: center; border: 1px dashed var(--line); border-radius: 8px; }
.sqteam { box-sizing: border-box; min-height: var(--sqchip, 3.45rem); }
