:root {
  /* Think Volley: black on white, thin wide-spaced type; green / red / yellow only for the game itself */
  color-scheme: light;
  --bg: #f5f5f3;
  --card: #ffffff;
  --text: #111111;
  --muted: #6b6b6b;
  --border: #e2e2df;
  --primary: #111111;
  --primary-text: #ffffff;
  --accent: #111111;
  /* one green and one red in the whole app (the Monitor's): bars, lines, text and buttons alike; never the
     profile's accent colour in statistics. --us-score is kept as a name for text and is the same green */
  --us: #1a9e4b;
  --us-text: #ffffff;
  --us-score: var(--us);
  --them: #d6301e;
  --court: #ffffff;
  --court-line: #1c2420;
  --sel: var(--us);
}

/* Dark theme, like a match-day dashboard: near-black background, blue-grey cards, light text */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0f14;
  --card: #141a22;
  --text: #e6ebf0;
  --muted: #8b97a6;
  --border: #263242;
  --primary: #e6ebf0;
  --primary-text: #0b0f14;
  --accent: #e6ebf0;
  --us: #22c55e;
  --us-text: #04210f;
  --us-score: var(--us);
  --them: #ef4444;
  --court: #10161d;
  --court-line: #c9d3dc;
  --sel: var(--us);
  --tint-yellow: #3a3112;
  --tint-yellow-line: #8a7417;
}
:root[data-theme="dark"] .pos.libero, :root[data-theme="dark"] .mc.libero, :root[data-theme="dark"] .court .pos.libero, :root[data-theme="dark"] .rv-lib { background: var(--tint-yellow); border-color: var(--tint-yellow-line); color: var(--text); }
:root[data-theme="dark"] .mc { background: #1b232d; }
:root[data-theme="dark"] .mc b { color: var(--text); } :root[data-theme="dark"] .mc span { color: var(--muted); }
:root[data-theme="dark"] .tag-tentative { background: #3a3112; color: #f3df9a; }
:root[data-theme="dark"] input, :root[data-theme="dark"] select, :root[data-theme="dark"] textarea { background: #0f141a; color: var(--text); border-color: var(--border); }
:root[data-theme="dark"] .card h2 { color: var(--muted); }
:root[data-theme="dark"] .brand-mark { filter: invert(1); } /* the black logo on the dark background */

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
/* full browser width, side gutter grows with the window */
:root { --gutter: clamp(16px, 2.5vw, 36px); }
main { margin: 0; padding: 12px var(--gutter) 40px; }
h1 { font-size: 1.5rem; margin: 8px 0 12px; }
h2 { font-size: 1.1rem; margin: 0 0 10px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.muted { color: var(--muted); font-size: .9rem; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1; }

button {
  font: inherit; border: 1px solid var(--border); background: var(--card); color: var(--text);
  border-radius: 10px; padding: 10px 14px; min-height: 44px; cursor: pointer; touch-action: manipulation;
}
button:active { transform: scale(.97); }
button.primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); font-weight: 600; }
button.danger { color: var(--them); }
button.small { min-height: 36px; padding: 6px 10px; font-size: .9rem; }
button:disabled { opacity: .4; }
input, select {
  min-width: 0;
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; min-height: 40px; width: 100%;
}
label { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 8px; }
label > input, label > select { margin-top: 4px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.easy-big { width: 100%; min-height: 64px; font-size: 1.15rem; margin-bottom: 10px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.roster-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto auto; gap: 8px; margin-bottom: 6px; }
.roster-name { display: flex; gap: 6px; align-items: center; min-width: 0; }
.roster-name input { flex: 1; min-width: 0; margin: 0; }
.roster-name button { white-space: nowrap; }
.roster-check .row { gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }

/* tabellone */
.score { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; text-align: center; gap: 8px; }
.score .team { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score .pts { font-size: 2.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.score .us .pts { color: var(--us-score); }
.score .them .pts { color: var(--them); }
.serve-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--sel); border: 1px solid var(--muted); vertical-align: middle; margin-left: 6px; }

/* campo a rombo */
.court {
  position: relative; background: var(--court); border: 3px solid var(--court-line); border-radius: 0;
  margin: 4px auto 12px; width: min(100%, 64vh); min-width: min(100%, 280px); aspect-ratio: 1; container-type: size;
  --attack: 33.333%; /* 6v6: half court 9 x 9 m, attack line 3 m from the net */
}
.court.f4 { --attack: 42.857%; } /* 4v4: half court 7 x 7 m, line at 3 m */
.court::after { content: ''; position: absolute; left: 0; right: 0; top: var(--attack); border-top: 2px solid var(--court-line); pointer-events: none; }
.court .net { position: absolute; top: -3px; left: -3px; right: -3px; height: 8px; background: var(--text); border-radius: 3px; }
.court .net-label { position: absolute; top: 8px; width: 100%; text-align: center; font-size: .75rem; color: var(--court-line); }
.pos {
  position: absolute; transform: translate(-50%, -50%); width: clamp(80px, 18cqw, 150px); height: clamp(62px, 21cqh, 112px); border-radius: 14px;
  background: var(--card); border: 2px solid var(--border); display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 0; line-height: 1.1;
}
.pos .num { font-size: clamp(1.35rem, 5cqw, 2.6rem); font-weight: 700; }
.pos .name { font-size: clamp(1.05rem, 3.4cqw, 1.7rem); font-weight: 600; color: var(--text); max-width: 94%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos .tag { position: absolute; top: -12px; left: -12px; font-size: .95rem; font-weight: 700; background: var(--text); color: var(--bg); border-radius: 10px; padding: 2px 8px; }
.pos.libero { background: #fff1c2; border-color: #e0b100; }
.pos.setter { border-color: var(--us-score); border-width: 3px; }
.pos.setter .tag { background: var(--us-score); color: #fff; }
.pos .rep { font-size: .62rem; color: #6b5600; }
.pos.libero .tag { background: #e0b100; color: #1c2420; }
.pos.sel { border-color: var(--sel); box-shadow: 0 0 0 3px var(--sel); }
/* keep the centring translate when pressed, otherwise the box jumps away from the finger and the tap is lost */
.pos:active { transform: translate(-50%, -50%) scale(.97); }
.pos * { pointer-events: none; }
.pos.server .num::after { content: ""; font-size: 1rem; }
/* 4v4: diamond, P1 serves from the back */
.f4 .p3 { left: 50%; top: 22%; }
.f4 .p4 { left: 18%; top: 56%; }
.f4 .p2 { left: 82%; top: 56%; }
.f4 .p1 { left: 50%; top: 84%; }
/* 6v6: front row P4 P3 P2, back row P5 P6 P1 */
.f6 .pos { width: clamp(72px, 23cqw, 140px); height: clamp(54px, 18cqh, 106px); }
.f6 .pos .name { font-size: clamp(.92rem, 3cqw, 1.5rem); }
.f6 .p4 { left: 17%; top: 17%; }
.f6 .p3 { left: 50%; top: 17%; }
.f6 .p2 { left: 83%; top: 17%; }
.f6 .p5 { left: 17%; top: 67%; }
.f6 .p6 { left: 50%; top: 67%; }
.f6 .p1 { left: 83%; top: 67%; }

.skills, .evals { display: grid; gap: 8px; margin-bottom: 10px; }
.skills { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.evals { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.skills button.sel { background: var(--sel); color: var(--us-text); border-color: var(--sel); font-weight: 700; }
.evals button { font-size: 1.4rem; font-weight: 700; min-height: 56px; }
.evals button small { display: block; font-size: .62rem; font-weight: 400; color: var(--muted); }
.points { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.points button { min-height: 56px; font-weight: 700; color: #fff; border: none; }
.points .us { background: var(--us); color: var(--us-text); }
.points .them { background: var(--them); }

.log { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.log li { padding: 5px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 8px; }
.log li.point-row { color: var(--muted); }
.log-scroll { position: relative; max-height: 55vh; overflow-y: auto; }
.log li.now { background: rgba(0, 213, 78, .18); box-shadow: inset 3px 0 0 var(--us); }
.log-tools { display: inline-flex; gap: 4px; margin-left: 8px; }
.log-ev { margin-left: 4px; }
.log li > .log-tools { margin-left: auto; flex: none; }
.log-tools button { margin: 0; padding: 2px 8px; }
.log li.log-edit { flex-wrap: wrap; align-items: center; }
.log li.log-edit select { width: auto; margin: 2px 4px 2px 0; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90vw;
  z-index: 100; /* above the video pane and the input mask */
}
#toast.show { opacity: .95; }

@media (min-width: 760px) {
  .match { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
}
/* wide screens: bigger buttons to hit from a distance */
@media (min-width: 1200px) {
  .match { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; }
  .skills button { min-height: 60px; font-size: 1.1rem; }
  .evals button { min-height: 76px; font-size: 1.8rem; }
  .points button { min-height: 72px; font-size: 1.15rem; }
}
.danger-text { color: var(--them); font-size: .9rem; }
.import-list { list-style: none; margin: 8px 0; padding: 0; max-height: 280px; overflow: auto; }
.import-list li { padding: 4px 0; border-bottom: 1px solid var(--border); }
.import-list label { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--text); font-size: .95rem; }
.import-list input { width: auto; min-height: 0; margin: 0; }
.badge { font-size: .7rem; font-weight: 700; border-radius: 6px; padding: 1px 5px; background: var(--border); color: var(--text); }
textarea { font: inherit; width: 100%; min-height: 140px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: var(--bg); color: var(--text); }
.team-summary { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.app-header { display: block; background: var(--card); border-bottom: 1px solid var(--text); margin: -12px calc(-1 * var(--gutter)) 14px; padding: 10px var(--gutter); }
.app-header > .row { gap: 12px; }
.app-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.app-nav button { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.app-nav .grow { flex: 1 1 0; min-width: 0; }
.app-nav .nav-warn { border-color: var(--them); color: var(--them); }
@media (max-width: 560px) {
  .app-nav .nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .app-nav button { min-width: 44px; justify-content: center; font-size: 1.05rem; }
}
.app-header h1 { margin: 4px 0; color: var(--text); text-transform: uppercase; font-weight: 400; letter-spacing: .25em; font-size: 1.05rem; }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand { line-height: 1.15; }
.brand-name { text-transform: uppercase; letter-spacing: .32em; font-weight: 400; font-size: 1.05rem; }
.brand-sub { text-transform: uppercase; letter-spacing: .32em; font-size: .68rem; color: var(--muted); }
.brand-sub::before { content: ''; display: inline-block; width: 18px; border-top: 1px solid var(--text); vertical-align: middle; margin-right: 8px; }
h2 { text-transform: uppercase; letter-spacing: .14em; font-weight: 500; font-size: .95rem; }

/* video scouting */
#videoPane { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px var(--gutter) 4px; }
#videoPane[hidden] { display: none; }
.video-wrap { position: relative; }
#courtLayer { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.tap-card { position: absolute; z-index: 3; width: min(360px, calc(100% - 8px)); padding: 8px; background: rgba(255, 255, 255, .97); color: #1c2420; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); font-size: .9rem; }
.tap-card[hidden] { display: none; }
.tap-card .tap-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.tap-card .tap-head b { font-variant-numeric: tabular-nums; }
.tap-card .tap-label { margin: 0 0 6px; font-weight: 700; }
.tap-card .tap-meas { margin: 0 0 8px; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.tap-card .tap-row { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.tap-card .tap-row:last-child { margin-bottom: 0; }
.tap-card button { min-height: 34px; padding: 4px 8px; font-size: .85rem; }
.tap-card .tap-pl b { font-size: 1rem; }
.tap-card button.sel { outline: 3px solid #ffd84d; outline-offset: -3px; font-weight: 700; }
.tap-card .tap-skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tap-card .tap-evals { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }
.tap-card .tap-ev { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.tap-card .tap-ev small { font-size: .7rem; font-weight: 400; }
.tap-times { margin: 8px 0 0; font-variant-numeric: tabular-nums; }
.vid-cap { position: absolute; left: 10px; bottom: 12px; max-width: calc(100% - 20px); padding: 5px 10px 5px 8px; border-left: 4px solid var(--muted); border-radius: 4px; background: rgba(0, 0, 0, .72); color: #fff; font-size: .95rem; font-weight: 700; line-height: 1.25; pointer-events: none; z-index: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vid-cap[hidden] { display: none; }
.vid-cap.good { border-left-color: var(--us); } .vid-cap.bad { border-left-color: var(--them); } .vid-cap.mid { border-left-color: #e0b100; }
#videoPane video { width: 100%; max-height: 38vh; background: #000; border-radius: 10px; display: block; }
.video-controls { margin-top: 6px; }
.vc-row { display: flex; gap: 6px 16px; align-items: center; flex-wrap: wrap; }
.vc-tools { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
.vc-group { min-width: 0; max-width: 100%; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.vc-group:not(:has(> :not([hidden]))) { display: none; }
.vc-end { margin-left: auto; gap: 14px; }
.vc-row > select { width: auto; flex: 0 1 auto; min-width: 0; }
@media (max-width: 600px) { .vc-row > select { flex-basis: 100%; } }
.video-controls button { min-height: 40px; padding: 6px 12px; }
.video-controls button.small { min-height: 34px; padding: 4px 10px; font-size: .85rem; }
.autopause { display: flex; align-items: center; gap: 6px; font-size: .85rem; }
.autopause[hidden] { display: none; }
.autopause input { width: auto; min-height: 0; margin: 0; }
.log li[data-act="seek"] { cursor: pointer; }
.rally-bar { position: relative; height: 22px; margin-top: 6px; background: var(--card); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; overflow: hidden; }
.rally-bar[hidden] { display: none; }
.act-bar { margin-top: 8px; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 6px; }
.act-bar[hidden] { display: none; }
.act-labels { display: flex; flex-direction: column; font-size: .68rem; color: var(--muted); text-align: right; }
.act-labels span { display: flex; align-items: center; justify-content: flex-end; white-space: nowrap; }
.act-track { position: relative; background: var(--card); border: 1px solid var(--border); cursor: pointer; overflow: hidden; }
.act-layer { position: absolute; inset: 0; }
.act-band { position: absolute; top: 0; bottom: 0; border-right: 1px solid var(--border); }
.act-band.odd { background: var(--bg); }
.act-score { position: absolute; top: 2px; right: 2px; font-size: .62rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.act-score.good { color: var(--us-score); } .act-score.bad { color: var(--them); }
.act-lane { position: absolute; left: 0; right: 0; height: 18px; border-top: 1px dashed var(--border); pointer-events: none; }
.act-tick { position: absolute; height: 12px; min-width: 12px; padding: 0 2px; margin-left: -6px; border-radius: 2px; font-size: .58rem; font-weight: 700; line-height: 12px; text-align: center; color: #fff; background: var(--muted); z-index: 1; }
.act-tick.good { background: var(--us-score); } .act-tick.bad { background: var(--them); } .act-tick.mid { background: #e0b100; color: #1c2420; }
.act-tick:hover { transform: scale(1.3); z-index: 3; }
.act-tick.dim { opacity: .18; z-index: 0; }
.act-pos { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); z-index: 2; pointer-events: none; }
.act-scale { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.rally-tick { position: absolute; top: 3px; bottom: 3px; width: 2px; background: var(--primary); }
.rally-pos { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--them); z-index: 1; }
#rallyStatus { font-size: .85rem; margin-top: 4px; min-height: 1.2em; }
.rally-nav[hidden], #findRallies[hidden], #syncSheet[hidden], #syncPoints[hidden], #removeVideo[hidden] { display: none; }
.reopen-row { display: flex; gap: 6px; align-items: flex-start; }
.reopen-row > button:first-child { flex: 1; }
.reopen-row > .small { min-height: 40px; }
.video-thumb { display: block; width: 160px; max-width: 100%; aspect-ratio: 16 / 9; object-fit: cover; margin: 0 auto 6px; border: 1px solid var(--border); }
.video-thumb[hidden] { display: none; }
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal .card { max-width: 980px; width: 100%; max-height: 95vh; overflow: auto; }
.modal canvas { width: 100%; height: auto; display: block; border-radius: 8px; cursor: crosshair; touch-action: none; }
.log .vt { color: var(--primary); font-size: .8rem; margin-right: 6px; }
@media (min-width: 1000px) {
  body.with-video { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(380px, 1fr); align-items: start; }
  body.with-video #videoPane { height: 100vh; max-width: none; margin: 0; padding: 12px; }
  body.with-video #videoPane video { max-height: calc(100vh - 80px); }
  body.with-video main { max-width: none; margin: 0; }
  body.with-video .match { grid-template-columns: 1fr; }
  /* the action list under the video: the video gets smaller, the list takes the rest of the column */
  body.with-video #videoPane.has-log { display: flex; flex-direction: column; }
  body.with-video #videoPane.has-log video { max-height: 52vh; }
  #paneLog { flex: 1; min-height: 0; margin-top: 8px; }
  #paneLog .card { height: 100%; margin: 0; display: flex; flex-direction: column; }
  #paneLog .log-scroll { max-height: none; flex: 1; min-height: 0; }
}

#videoSetSel { width: auto; min-height: 40px; }
.set-select { width: auto; min-height: 32px; padding: 2px 6px; font-size: .9rem; }
.notice { --notice: #4f7cf0; position: relative; background: color-mix(in srgb, var(--notice) 7%, var(--card)); border: 1.5px solid color-mix(in srgb, var(--notice) 45%, var(--card));
  color: var(--text); border-radius: 12px; padding: 10px 14px 10px 50px; min-height: 44px; margin-bottom: 12px; font-size: .9rem; }
/* four grades: info (blue), success (green), warning (orange), error (red): a light card, a coloured line, the icon in a coloured square */
.notice.success { --notice: #34c27a; }
.notice.warning { --notice: #f5a524; }
.notice.error { --notice: #f0707a; }
.notice::before { content: '\f129'; position: absolute; left: 12px; top: 9px; width: 26px; height: 26px; border-radius: 8px; background: var(--notice); color: #fff;
  display: flex; align-items: center; justify-content: center; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: .8rem; }
.notice.success::before { content: '\f00c'; }
.notice.warning::before, .notice.error::before { content: '\21'; }
.notice.video-dl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.notice.video-dl::before, .notice.video-other::before { top: 50%; transform: translateY(-50%); } /* one line with a button: icon in the middle */

.stats { border-collapse: collapse; width: 100%; font-size: .9rem; margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.stats th, .stats td { border-bottom: 1px solid var(--border); padding: 5px 6px; text-align: right; white-space: nowrap; }
.stats th:first-child, .stats td:first-child { text-align: left; }
.stats th { color: var(--muted); font-weight: 600; font-size: .8rem; }
.stats tr.group th { text-align: center; color: var(--text); border-left: 1px solid var(--border); }
/* player stats: a line where each skill starts, down the whole table */
.pstats tr:not(.group) > :is(:nth-child(2), :nth-child(6), :nth-child(10), :nth-child(15), :nth-child(16)) { border-left: 1px solid var(--border); }
.pstats tr.group th:first-child { border-left: 0; }
.stats tr.sum td { font-weight: 700; background: var(--bg); }
.stats .bar { display: inline-block; height: 8px; background: var(--primary); border-radius: 4px; vertical-align: middle; margin-left: 6px; }
.table-wrap { overflow-x: auto; }
.vlink-wrap { position: relative; display: inline-block; }
.vlink-pop { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 30; width: min(420px, calc(100vw - 32px)); margin: 0; padding: 12px; text-align: left; font-size: .85rem; box-shadow: 0 8px 24px rgba(0, 0, 0, .15); }
.vlink-pop input { display: block; width: 100%; margin: 4px 0 8px; }
.vlink-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.rot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.rot-card { border: 1px solid var(--border); border-radius: 10px; padding: 8px; background: var(--card); }
.rot-card h3 { margin: 0 0 6px; font-size: 1rem; }
.mini-court { position: relative; background: var(--court); border: 2px solid var(--court-line); border-top: 5px solid #1c2420; border-radius: 4px; padding: 6px; display: grid; gap: 5px;
  aspect-ratio: 1; align-items: center; --attack: 33.333%; }
.mini-court::before { content: ''; position: absolute; left: 0; right: 0; top: var(--attack); border-top: 2px solid var(--court-line); }
.mini-court > * { position: relative; }
.mini-court.f4 { --attack: 42.857%; }
.mini-court.f6 { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: 1fr 2fr; }
.mini-court.f4 { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: 3fr 2fr 2fr; }
.mc { background: #f2f2ef; border-radius: 6px; padding: 3px 2px; text-align: center; line-height: 1.1; min-height: 38px; border: 2px solid transparent; }
.mc b { display: block; font-size: 1rem; color: #1c2420; }
.mc span { display: block; font-size: .62rem; color: #5d6a62; overflow-wrap: anywhere; hyphens: auto; }
.mc.setter { border-color: var(--us-score); }
.mc.libero { background: #fff1c2; }
.mc.server b::after { content: ''; font-size: .7rem; }
.mc.empty { background: transparent; }
/* season: names instead of numbers, a little bigger (wider cards, taller boxes) */
.rot-grid:has(.mc.named) { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.mc.named { min-height: 56px; display: grid; place-items: center; padding: 6px 3px; }
.mc.named b { font-size: 1.2rem; }
.rot-stats { font-size: .82rem; margin-top: 6px; line-height: 1.4; }
.results { border-collapse: collapse; margin: 8px 0 12px; font-size: .95rem; }
.results th, .results td { border: 1px solid var(--border); padding: 4px 12px; text-align: center; }
.results th { background: var(--bg); font-weight: 600; }

/* Technical evaluation */
.eval-list { list-style: none; padding: 0; margin: 0 0 10px; }
.eval-list li { padding: 6px 10px; border-left: 4px solid var(--border); margin-bottom: 4px; background: var(--bg); border-radius: 0 6px 6px 0; }
.eval-list li.good { border-left-color: var(--us); }
.eval-list li.ok { border-left-color: #f2c200; }
.eval-list li.weak { border-left-color: var(--them); }
.evaluation details { margin-bottom: 8px; }
.evaluation summary { cursor: pointer; font-weight: 600; }
.stats td.good { color: var(--us-score); font-weight: 700; }
.stats td.weak { color: var(--them); font-weight: 700; }
p.weak { color: var(--them); }

/* Input mask over everything: players | skill 1/3 + result 2/3 */
/* mask colours: black (default) or white (☀ toggle) */
.mask { --mk-bg: #0d0d0d; --mk-fg: #f4f4f2; --mk-btn: #1b1b1b; --mk-line: #2a2a2a; --mk-muted: #a8a8a4;
  --mk-good: #1f5a33; --mk-good-line: #2f7a48; --mk-mid: #4d4217; --mk-mid-line: #6f5f1c; --mk-bad: #5a1f26; --mk-bad-line: #7d2b35; --mk-tint-fg: #f4f4f2; }
.mask.light { --mk-bg: #ffffff; --mk-fg: #0d0d0d; --mk-btn: #f0f0ee; --mk-line: #c9c9c5; --mk-muted: #55554f;
  --mk-good: #bfe8c9; --mk-good-line: var(--us); --mk-mid: #f6e7a6; --mk-mid-line: #b89400; --mk-bad: #f6c9ce; --mk-bad-line: #c0392b; --mk-tint-fg: #0d0d0d; }
body.mask-on { overflow: hidden; }
.mask { position: fixed; inset: 0; z-index: 40; background: var(--mk-bg); color: var(--mk-fg); display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px calc(10px + env(safe-area-inset-bottom, 0px)); }
.mask button { color: var(--mk-fg); background: var(--mk-btn); border: 1px solid var(--mk-line); border-radius: 12px; margin: 0; }
.mask-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mask-head .grow { flex: 1; }
.mask-score { font-size: 2.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.mask-score small { font-size: .7rem; font-weight: 500; color: var(--mk-muted); letter-spacing: .12em; text-transform: uppercase; margin-left: 6px; }
.mask .chip { font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; border: 1px solid var(--mk-line); border-radius: 99px; padding: 4px 10px; color: var(--mk-muted); font-variant-numeric: tabular-nums; }
.mask .chip b { color: var(--mk-fg); }
.mask .chip.warn { border-color: var(--them); background: #5a1f26; color: #fff; }
.mask .mask-btn { min-height: 44px; padding: 0 12px; font-weight: 600; }
.mask-body { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 2.2fr); gap: 14px; min-height: 0; }
.mask-body.mirror { direction: rtl; }
.mask-body.mirror > * { direction: ltr; }
.mask-stack { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
.mask-label { font-size: .85rem; text-transform: uppercase; letter-spacing: .18em; color: var(--mk-muted); margin: 0 0 6px; }
.mask-players { display: grid; grid-auto-rows: minmax(0, 1fr); gap: 8px; min-height: 0; }
.mask .kp-player { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 12px; text-align: left; padding: 8px 12px; min-height: 64px; }
.kp-player * { pointer-events: none; }
/* review: the last place of the players' column, the court in small (net on top) and the other libero */
.mask .kp-mini { display: flex; flex-direction: column; gap: 4px; min-height: 0; }
.kp-mini .mini-court { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 3px; border-top: 3px solid var(--mk-fg); padding-top: 3px; min-height: 0; }
.mask .kp-mini button { padding: 0; min-height: 0; line-height: 1; font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.kp-mini .mini-libs { display: flex; gap: 4px; }
.kp-mini .mini-libs button { flex: 1; }
.mask .kp-mini button.libero { border-color: #e0b100; }
.mask .kp-mini button.sel { background: var(--mk-fg); color: var(--mk-bg); border-color: var(--mk-fg); }
.kp-player .num { grid-row: 1 / 3; font-size: 3rem; font-weight: 800; min-width: 1.6em; text-align: center; font-variant-numeric: tabular-nums; }
.kp-player .name { font-weight: 800; font-size: 1.15rem; letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kp-player .tag { font-size: .85rem; font-weight: 700; color: var(--mk-muted); letter-spacing: .04em; }
.mask .kp-player.libero { border-color: #e0b100; }
.mask .kp-player.sel { background: var(--mk-fg); color: var(--mk-bg); border-color: var(--mk-fg); }
.mask .kp-player.sel .tag { color: inherit; opacity: .7; }
.mask-right { display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, 2fr); gap: 12px; min-height: 0; }
.mask-skills { display: grid; grid-auto-rows: minmax(0, 1fr); gap: 8px; min-height: 0; }
.mask .mask-skill { font-weight: 800; font-size: 1.9rem; letter-spacing: .04em; min-height: 56px; position: relative; padding: 4px; white-space: nowrap; overflow: hidden; }
/* label scales with the button width so 5-letter labels (BLOCK) fit when the mask is docked beside the video */
@supports (container-type: inline-size) {
  .mask .mask-skill { container-type: inline-size; overflow: visible; }
  .mask .mask-skill > .lbl { display: block; font-size: clamp(.8rem, 22cqi, 1.6rem); overflow: hidden; text-overflow: clip; }
}
.mask .mask-skill.suggest:not(.sel) { border: 2px dashed var(--mk-muted); }
.mask .mask-skill.sel { background: var(--mk-fg); color: var(--mk-bg); border-color: var(--mk-fg); }
.mask-skill.suggest:not(.sel)::after { content: attr(data-hint); position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; background: var(--mk-bg); color: var(--mk-muted); padding: 0 4px; }
.mask-results { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 10px; min-height: 0; }
.mask .mask-result { text-align: center; justify-items: center; padding: 8px; display: grid; align-content: center; gap: 2px; border-radius: 14px; }
.mask-result .sym { font-size: 3.6rem; font-weight: 800; line-height: 1; font-family: ui-monospace, Menlo, monospace; }
.mask-result .word { font-size: 1.15rem; font-weight: 700; line-height: 1.15; }
.mask-result .pt { font-size: .95rem; font-weight: 700; opacity: .85; }
.mask .mask-result.win { background: var(--us); color: var(--us-text); border-color: var(--us); }
.mask .mask-result.win span { color: #04260f; }
.mask .mask-result.good { background: var(--mk-good); border-color: var(--mk-good-line); color: var(--mk-tint-fg); }
.mask .mask-result.mid { background: var(--mk-mid); border-color: var(--mk-mid-line); color: var(--mk-tint-fg); }
.mask .mask-result.bad { background: var(--mk-bad); border-color: var(--mk-bad-line); color: var(--mk-tint-fg); }
.mask .mask-result.lose { background: var(--them); color: #fff; border-color: var(--them); }
.mask .mask-result.lose span { color: #ffe3e6; }
.mask-wait { display: grid; place-items: center; text-align: center; color: var(--mk-muted); border: 1px dashed var(--mk-line); border-radius: 14px; padding: 16px; grid-column: 1 / -1; }
.mask-foot { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.mask .mask-foot button { min-height: 72px; font-weight: 800; font-size: 1.35rem; }
.mask .mask-foot .us { background: var(--us); color: var(--us-text); border-color: var(--us); }
.mask .mask-foot .them { background: var(--them); color: #fff; border-color: var(--them); }
/* team drawer: bench slides in from the left, drag a player onto another to substitute */
.mask .mask-btn.on { background: var(--mk-fg); color: var(--mk-bg); border-color: var(--mk-fg); }
.kbd-help { position: absolute; top: 64px; right: 12px; z-index: 2; max-width: min(440px, calc(100% - 24px)); max-height: calc(100% - 80px); overflow-y: auto;
  background: var(--mk-bg); color: var(--mk-fg); border: 1px solid var(--mk-line); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); padding: 10px 14px; font-size: .9rem; }
.kbd-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.kbd-help table { border-collapse: collapse; width: 100%; }
.kbd-help th { text-align: left; color: var(--mk-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; padding: 10px 0 4px; }
.kbd-help td { padding: 3px 0; vertical-align: top; }
.kbd-help td:first-child { white-space: nowrap; padding-right: 12px; }
.kbd-help kbd { display: inline-block; min-width: 1.6em; text-align: center; padding: 1px 6px; border: 1px solid var(--mk-line); border-bottom-width: 2px; background: var(--mk-btn); font: 600 .8rem/1.4 inherit; }
@media (hover: none) { .mask .kbd-btn { display: none; } }
.mask-body.team-body { grid-template-columns: minmax(150px, 1fr) minmax(0, 2fr); }
.bench-col.slide { animation: bench-in .22s ease-out; }
.bench-col { background: var(--mk-btn); border-radius: 14px; padding: 8px; }
@keyframes bench-in { from { transform: translateX(-105%); opacity: 0; } }
.mask-bench { display: grid; grid-auto-rows: minmax(64px, auto); gap: 8px; overflow: auto; align-content: start; }
.mask .mask-bench .kp-player { background: var(--mk-bg); }
.team-body .mask-players { grid-auto-rows: minmax(0, 1fr); }
.mask [data-drag-n], .mask [data-drag-pos] { touch-action: none; user-select: none; -webkit-user-select: none; }
.mask .kp-player.dragging { opacity: .35; }
.mask .kp-player.drop-over { outline: 4px solid var(--us); outline-offset: -4px; }
.mask .kp-player.sel { background: var(--mk-fg); color: var(--mk-bg); border-color: var(--mk-fg); }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; opacity: .92; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.sub-hint { margin: 8px 0 0; text-transform: none; letter-spacing: .02em; }
.mask .team-reset { margin-top: 8px; min-height: 52px; font-weight: 800; font-size: 1.1rem; }
.mask .team-reset:disabled { opacity: .35; }
@media (max-width: 700px) {
  .mask-body, .mask-body.mirror { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); direction: ltr; }
  .mask-players { grid-template-columns: repeat(var(--pcols, 3), minmax(0, 1fr)); grid-auto-rows: auto; }
  .mask .kp-player { grid-template-columns: 1fr; text-align: center; padding: 4px; min-height: 50px; }
  .kp-player .num { grid-row: auto; font-size: 2rem; line-height: 1; }
  .kp-player .name { font-size: 1rem; }
  .kp-player .tag { display: none; }
  .mask-right { grid-template-rows: auto minmax(0, 1fr); }
  .mask-skills { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; grid-auto-rows: minmax(46px, auto); }
  .mask .mask-skill { min-height: 50px; font-size: 1.35rem; }
  .mask .mask-skill > .lbl { font-size: clamp(.8rem, 22cqi, 1.35rem); }
  .mask .chip.rot { display: none; }
  .mask-label { margin-bottom: 3px; }
  .mask-results { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(64px, 1fr); overflow: auto; }
  .mask-foot { grid-template-columns: 1fr 1fr; }
  .mask-body.team-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; overflow: auto; }
  .mask-bench { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: auto; }
  .mask .mask-foot button { min-height: 54px; font-size: 1.1rem; }
  /* phone: one header row, results show only the word */
  .mask-head { flex-wrap: nowrap; gap: 4px; }
  .mask-head .chip:not(.warn) { display: none; }
  .mask-score { font-size: 1.6rem; white-space: nowrap; }
  .mask .chip { font-size: .75rem; padding: 3px 7px; white-space: nowrap; }
  .mask .chip.live { display: none; }
  .mask .mask-btn { min-height: 40px; min-width: 38px; padding: 0 6px; }
  .mask-btn .lbl { display: none; }
  .mask .mask-result { text-align: center; padding: 6px; align-content: center; justify-items: center; overflow: hidden; }
  .mask-result .sym { font-size: 2.2rem; }
  .mask-result .word { font-size: .85rem; }
  .mask-result .pt { display: none; }
  .mask-results { grid-auto-rows: minmax(68px, 1fr); }
}

/* dictation */
.mask .mask-btn.mic.on { background: var(--them); border-color: var(--them); animation: mic-pulse 1.4s ease-in-out infinite; }
@keyframes mic-pulse { 50% { box-shadow: 0 0 0 6px rgba(220, 53, 69, .35); } }
@media (prefers-reduced-motion: reduce) { .mask .mask-btn.mic.on { animation: none; } }
.mask .chip.voice { color: var(--mk-fg); border-color: var(--them); max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; letter-spacing: 0; }
button.mic-on { background: var(--them); color: #fff; border-color: var(--them); }
/* with the video beside the app, the mask covers only the app column: the video stays visible */
@media (min-width: 1000px) { body.with-video .mask { left: 58%; } }

/* admin */
.admin-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.admin-tile { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.admin-tile b { display: block; font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.admin-tile span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
@media (max-width: 600px) { .admin-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.admin-weeks { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; height: 140px; align-items: end; }
.admin-week { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; text-align: center; font-size: .7rem; }
.admin-week .bar { align-self: end; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 2px; }
.admin-week .lbl { color: var(--muted); font-size: .6rem; padding-top: 3px; white-space: nowrap; overflow: hidden; }
.admin-week .n { font-weight: 700; font-variant-numeric: tabular-nums; }
.admin-table tr.idle td { color: var(--muted); }

select.move-select { width: auto; min-height: 36px; padding: 4px 8px; font-size: .85rem; }

/* starting lineup laid out like the court (net on top) */
.lineup-court { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; background: var(--court); border: 3px solid var(--court-line); padding: 8px; margin-bottom: 12px; }
.lineup-court .lu-net { grid-column: 1 / -1; background: var(--text); color: var(--bg); text-align: center; font-size: .7rem; letter-spacing: .3em; text-transform: uppercase; margin: -8px -8px 2px; padding: 2px 0; }
.lineup-court .lu-cell { background: var(--card); padding: 6px; margin: 0; font-weight: 700; color: var(--text); }
.lineup-court .lu-cell select { margin-top: 4px; }
.lineup-court.f4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.lineup-court.f4 .lu-p3, .lineup-court.f4 .lu-p1 { grid-column: 2 / 4; }
.lineup-court.f4 .lu-p4 { grid-column: 1 / 3; }
.lineup-court.f4 .lu-p2 { grid-column: 3 / 5; }

/* quick corrections in the team drawer: rotation and score */
.fix-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.fix-row .mask-label { margin: 0; min-width: 7.5em; }
.mask .fix-row > button { flex: 1; min-height: 52px; font-weight: 800; font-size: 1.1rem; }
.fix-score { flex: 1; display: flex; align-items: center; gap: 6px; }
.fix-score b { font-size: .9rem; min-width: 3em; }
.fix-score strong { font-size: 1.8rem; min-width: 1.6em; text-align: center; font-variant-numeric: tabular-nums; }
.mask .fix-score button { min-height: 52px; min-width: 52px; font-size: 1.5rem; font-weight: 800; }
.mask .mask-score { cursor: pointer; }
@media (max-width: 700px) {
  .fix-row .mask-label { flex-basis: 100%; }
  .fix-score { flex: 1 1 45%; }
  .fix-score b { min-width: 0; }
  .mask .fix-score button { min-width: 44px; }
}
.lineup-court { border-radius: 6px; overflow: hidden; }
.lineup-court .lu-cell { border-radius: 8px; }

/* buttons of different widths: equal columns, two rows */
.toolbar { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.toolbar > button, .toolbar > select { width: 100%; margin: 0; min-height: 48px; padding: 6px 4px; line-height: 1.2; white-space: normal; font-size: .88rem; hyphens: auto; -webkit-hyphens: auto; }
.card .toolbar { margin: 8px 0 0; }
.toolbar.one-row { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.toolbar.one-row > button, .toolbar.one-row > select { min-height: 40px; }
@media (max-width: 700px) {
  .toolbar { grid-template-columns: repeat(var(--cols-phone), minmax(0, 1fr)); }
  .toolbar > button, .toolbar > select { font-size: .82rem; padding: 4px 2px; }
  .toolbar.one-row { grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }
}

/* analysis: score progression and our serve turns */
.tl-set { margin-bottom: 12px; }
.tl-chart { width: 100%; height: auto; display: block; }
/* the set's score rally by rally: the look of the momentum chart (.mo-*) */
.tl-grid { stroke: var(--border); stroke-width: 1; }
.tl-srv { font-size: 10px; font-weight: 600; fill: var(--us-score); }
.tl-band { fill: var(--us); opacity: .12; }
.tl-l { fill: none; stroke-width: 1.75; stroke-linejoin: miter; }
.tl-l.us { stroke: var(--us); } .tl-l.them { stroke: var(--them); } .tl-l.other { stroke: var(--muted); }
.tl-end { font-size: 12px; font-weight: 700; }
.tl-end.us { fill: var(--us-score); }
.tl-end.them { fill: var(--them); }
.turn-list { margin-top: 10px; }
.turn-row { display: grid; grid-template-columns: 170px 150px 140px minmax(0, 1fr); gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.turn-who small { color: var(--muted); }
.turn-boxes { display: flex; flex-wrap: wrap; gap: 3px; }
.turn-boxes i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.turn-boxes i.won { background: var(--us); }
.turn-boxes i.lost { background: var(--them); }
.turn-score { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.turn-front { white-space: nowrap; }
@media (max-width: 700px) {
  .turn-row { grid-template-columns: 1fr auto; }
  .turn-boxes { grid-column: 1 / -1; order: 3; }
  .turn-front { grid-column: 1 / -1; order: 4; }
}

/* Match dashboard (analysis): cards on a grid, the evaluation table and the rates across the full width */
.dash { --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100; --c0: #b9b8b3; }
.dash-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; margin-bottom: 12px; }
.dash-top .card { margin: 0; }
.dash h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dash-total { font-size: .85rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.dash-result { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0 0 10px; }
.dash-result b { font-size: 2rem; font-variant-numeric: tabular-nums; }
.dash-result .won { color: var(--text); font-weight: 700; }
.dash-leaders, .dash-legend, .dash-bars { list-style: none; margin: 0; padding: 0; }
.dash-leaders li { display: grid; grid-template-columns: 6.5em minmax(0, 1fr) auto; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border); align-items: baseline; }
.dash-leaders li b, .dash-legend b, .dash-bars b { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.dash-leaders li > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-stack { display: flex; gap: 2px; height: 14px; margin: 4px 0 12px; }
.dash-stack span { min-width: 4px; }
.dash-stack span:first-child { border-radius: 4px 0 0 4px; }
.dash-stack span:last-child { border-radius: 0 4px 4px 0; }
.dash-stack span:only-child { border-radius: 4px; }
.dash .c1 { background: var(--c1); } .dash .c2 { background: var(--c2); } .dash .c3 { background: var(--c3); } .dash .c4 { background: var(--c4); } .dash .c0 { background: var(--c0); }
.dash-legend li { display: grid; grid-template-columns: 12px 1fr 3em 2.5em; gap: 8px; align-items: center; padding: 5px 0; border-top: 1px solid var(--border); }
.dash-legend i { width: 12px; height: 12px; border-radius: 3px; }
.dash-legend .muted { text-align: right; font-variant-numeric: tabular-nums; }
.dash-bars li { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 2.5em; gap: 8px; align-items: center; padding: 5px 0; }
.dash-bars li > span:first-child { overflow-wrap: anywhere; line-height: 1.2; }
.dash .track { position: relative; display: block; height: 10px; background: var(--bg); border-radius: 4px; }
.dash .fill { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 4px; }
.dash .fill.f-them, .dash .fill.f-neg { background: var(--them); }
.dash .fill.f-neg { left: auto; } /* a negative efficiency grows left from the middle line */
.dash .fill.f-pos { background: var(--c1); }
.dash .fill.f-eff { background: var(--us); }
.dash .track.div::before { content: ''; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--muted); }
.dash-eval td { position: relative; }
.dash-eval td[style] { background: rgba(42, 120, 214, calc(var(--p) * .45)); }
.dash-eval td small { display: block; font-size: .72rem; color: var(--muted); }
.dash-eval tr.sub td:first-child { padding-left: 18px; color: var(--muted); }
.dash-eval th { text-align: center; }
.dash-eval .ev { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-weight: 800; color: #fff; font-size: .8rem; }
.ev.evp { background: #1f7a3a; } .ev.evg { background: var(--us); } .ev.evo { background: #6b6b6b; } .ev.evn { background: #b07800; } .ev.evb { background: #c0392b; } .ev.eve { background: var(--them); }
.dash-rates { display: grid; grid-template-columns: minmax(0, 11em) 1fr 1fr; gap: 8px 14px; align-items: center; margin-bottom: 8px; }
.dash-rates .hd { font-size: .8rem; font-weight: 600; color: var(--muted); }
.dash-rates .lbl.sub { padding-left: 12px; color: var(--muted); }
.dash-rates .rate { display: grid; grid-template-columns: 1fr 3.2em; gap: 8px; align-items: center; }
.dash-rates .rate b { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .dash-rates { grid-template-columns: minmax(0, 7em) 1fr 1fr; gap: 8px; } }

/* rotation labels in the analysis tables open that rotation's formation */
.rot-link { all: unset; cursor: pointer; font-weight: 700; border-bottom: 1px dashed currentColor; }
.rot-link:focus-visible { outline: 2px solid var(--us-score); outline-offset: 2px; }
.rot-pop { border: 1px solid var(--border); border-radius: 12px; padding: 14px; width: min(92vw, 340px); background: var(--card); color: var(--text); box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
.rot-pop::backdrop { background: rgba(0, 0, 0, .25); }
.rot-pop h3 { margin: 0 0 8px; font-size: 1rem; }
.rot-pop .mc { min-height: 48px; }
.rot-pop .mc b { font-size: 1.3rem; }
.rot-pop .mc span { font-size: .75rem; }
.rot-pop p { margin: 8px 0 0; }

/* easy mode mask: one big attack-point button */
.mask .mask-result.easy-kill .sym { font-family: inherit; }
.mask .mask-result.easy-kill .word { font-size: clamp(1.4rem, 4vw, 2.6rem); font-weight: 800; }
/* white court: players as light grey cards above the lines */
.court .pos { z-index: 1; background: var(--bg); border-color: #cfcfca; }
.court .pos.libero { background: #fff1c2; }

/* Player cards (analysis): evaluation shares per skill and efficiency against the team */
.ev-p { background: #145c2c; color: #fff; } .ev-g { background: #3f9e5a; color: #fff; } .ev-o { background: #d6d5cf; color: #111; }
.ev-n { background: #ef8a3c; color: #111; } .ev-b { background: #9c2530; color: #fff; } .ev-e { background: #e0505c; color: #fff; }
.pc-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .85rem; margin-bottom: 10px; }
.pc-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 12px; margin-bottom: 8px; }
.pcard { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; break-inside: avoid; }
.pcard h3 { margin: 0 0 8px; font-size: 1rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; }
.pcard h3 .muted { font-size: .8rem; font-weight: 400; }
.pcard .mask-label { margin: 8px 0 4px; color: var(--muted); font-size: .72rem; }
.pc-grid { display: grid; grid-template-columns: 6.5em minmax(0, 1fr) 2.8em; gap: 5px 8px; align-items: center; font-size: .85rem; }
.pc-grid b { text-align: right; font-variant-numeric: tabular-nums; }
.pc-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-stack { display: flex; gap: 2px; height: 16px; }
.pc-stack span { min-width: 3px; font-size: .62rem; font-weight: 700; line-height: 16px; text-align: center; overflow: hidden; }
.pc-stack span:first-child { border-radius: 4px 0 0 4px; } .pc-stack span:last-child { border-radius: 0 4px 4px 0; } .pc-stack span:only-child { border-radius: 4px; }
.pc-eff { position: relative; height: 12px; background: var(--bg); border-radius: 4px; }
.pc-eff::before { content: ''; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--muted); }
.pc-eff .fill { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.pc-eff .team { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; background: var(--text); border-radius: 2px; }

/* PDF export: the browser's print dialog ("Save as PDF") with a clean page */
.print-only { display: none; }
@media print {
  @page { margin: 12mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body, body.with-video { display: block; background: #fff; }
  #videoPane, .toast, .no-print, .rot-pop, .lang, .app-nav, [data-act="home"], .app-header button { display: none !important; }
  .print-only { display: block; }
  main { padding: 0; }
  .card { break-inside: avoid; border-color: #ccc; box-shadow: none; }
  .pcards-card, .timeline, .dash-top + .card { break-inside: auto; }
  .table-wrap { overflow: visible; }
  .stats { font-size: .68rem; }
  .stats th, .stats td { padding: 3px 4px; }
  .dash-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-top > :nth-child(3) { grid-column: 1 / -1; }
  .pcards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rot-link { border-bottom: 0; }
}

/* remote live from the SAMS ticker */
.sams-status { text-align: center; font-size: .85rem; color: var(--us-score); font-weight: 600; margin-top: 4px; }
.mask .chip.sams { border-color: var(--us); color: var(--mk-fg); }
.sams-facts { padding-left: 18px; margin: 10px 0; }

/* Report: six indicators, what decided the match, players */
.report h3 { margin: 16px 0 6px; font-size: .95rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 10px; margin: 10px 0 4px; }
.kpi { border: 1px solid var(--border); border-left: 5px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.kpi.good { border-left-color: var(--us-score); } .kpi.ok { border-left-color: #e0a100; } .kpi.weak { border-left-color: var(--them); }
.kpi-name { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kpi-val { display: flex; align-items: baseline; gap: 8px; }
.kpi-val b { font-size: 1.8rem; font-variant-numeric: tabular-nums; }
.kpi-icon { font-weight: 800; font-size: 1.1rem; }
.kpi.good .kpi-icon { color: var(--us-score); } .kpi.ok .kpi-icon { color: #b07800; } .kpi.weak .kpi-icon { color: var(--them); }
.kpi.few .kpi-val b, .kpi.none .kpi-val b { color: var(--muted); }
.kpi-sub, .kpi-n { font-size: .78rem; color: var(--muted); }
.impact, .pnotes { list-style: none; padding: 0; margin: 0; }
.impact li { padding: 7px 10px; border-radius: 8px; margin-bottom: 6px; background: var(--bg); border-left: 4px solid var(--border); }
.impact li.plus { border-left-color: var(--us-score); } .impact li.minus { border-left-color: var(--them); }
.impact li.plus b { color: var(--us-score); } .impact li.minus b { color: var(--them); }
.pnotes li { padding: 6px 0; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.pn-good { color: var(--us-score); } .pn-weak { color: var(--them); }
.pn-rel { color: var(--muted); font-size: .85em; }
details.sect { margin-bottom: 12px; }
details.sect > summary { cursor: pointer; font-weight: 700; padding: 12px 14px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; list-style-position: inside; }
details.sect[open] > summary { margin-bottom: 12px; }
.few { opacity: .4; }
@media print { details.sect > summary { display: none; } .kpi { break-inside: avoid; } }
.stats.lines td:first-child { white-space: normal; }
.stats tr.few td { opacity: .45; }
.subs-list { list-style: none; padding: 0; margin: 0 0 8px; }
.subs-list li { padding: 4px 0; border-top: 1px solid var(--border); }
.subs-line { font-size: .9rem; margin: 0 0 10px; }
.subs-line span { white-space: nowrap; }
.rv-rally { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.rv-rally > button { min-width: 56px; min-height: 52px; font-size: 1.2rem; }
.rv-follow { display: flex; gap: 8px; align-items: center; font-size: .9rem; color: var(--muted); }
.rv-follow input { width: auto; }
.sams-card a { word-break: break-all; }
.sams-card p { margin: 6px 0; }
/* review: court and actions side by side, a compact court */
.rv-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; align-items: start; }
.rv-body .pos { width: 25cqw; height: 22cqh; }
.rv-body .pos .num { font-size: clamp(1.1rem, 9cqw, 2rem); }
.rv-body .pos .name { font-size: clamp(.75rem, 5cqw, 1.1rem); }
.rv-body .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rv-body .skills button { min-height: 44px; font-size: 1rem; }
.rv-body .court { width: 100%; min-width: 0; margin-top: 0; }
.rv-body .evals { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.rv-lib { width: 100%; margin-top: 6px; background: #fff1c2; border-color: #e0b100; }
.rv-lib.sel { background: var(--sel); border-color: var(--sel); }
.mask-players.many { gap: 5px; }
.mask .mask-players.many .kp-player { min-height: 0; padding: 4px 10px; }
.mask-players.many .kp-player .num { font-size: 2.1rem; }
.mask-players.many .kp-player .name { font-size: 1.1rem; }
.mask-players.many .kp-player .tag { font-size: .8rem; }
.rv-touches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; font-size: .9rem; }
.rv-touches .touch { margin: 0; }
.rv-touches .touch.us { border: 2px solid var(--us); font-weight: 600; }
.rv-touches .touch.them { opacity: .65; }
.mask.with-touches { grid-template-rows: auto auto minmax(0, 1fr) auto; }
.mask .rv-touches { margin: 0; }
.lib-line { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: .9rem; margin-top: 6px; }
.lib-line select { width: auto; min-width: 7em; margin: 0; }
.mask .mask-foot.rv-foot { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.mask .mask-foot.rv-foot button { font-size: clamp(.85rem, 1.25vw, 1.2rem); padding: 4px 6px; line-height: 1.15; overflow-wrap: break-word; hyphens: auto; }
.mask .mask-foot.rv-foot .us:not(.known), .mask .mask-foot.rv-foot .them:not(.known) { opacity: .55; }
.rally-zero { position: absolute; top: -2px; bottom: -2px; width: 3px; background: var(--us); font-size: .6rem; font-weight: 800; color: var(--us-score); line-height: 0; }
.rally-zero::after { content: attr(title); position: absolute; top: -12px; left: 4px; white-space: nowrap; line-height: 1; font-size: .62rem; }
#markZero[hidden] { display: none; }


/* season: trend and bench sheet */
.spark polyline { fill: none; stroke: var(--text); stroke-width: 1.5; }
.spark circle { fill: var(--us); }
.bench-list { padding-left: 22px; }
.bench-list li { margin: 10px 0; }
.bench-list li > div { margin-top: 2px; }
.bench-line { margin: 4px 0; padding: 6px 10px; border-left: 3px solid var(--them); background: var(--bg); border-radius: 0 6px 6px 0; }
.bench-line ul { margin: 4px 0; padding-left: 18px; }
.tag-tentative { font-size: .75rem; padding: 1px 6px; border-radius: 6px; background: #fff3c4; color: #6b5200; white-space: nowrap; }
#printBox { display: none; }
@media print { body.print-bench > :not(#printBox) { display: none !important; } body.print-bench #printBox { display: block; } }

/* technical scouting */
.mode-switch { display: flex; flex-wrap: wrap; gap: 10px; }
.mode-switch button { min-width: 130px; }
.tech-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: 8px; margin-bottom: 8px; }
.tech-opts button { margin: 0; }
/* optional details: a label and small chips on one line */
.tech-more { margin: 4px 0; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; opacity: .65; }
.tech-attr { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.tech-lbl { font-size: .8rem; font-weight: 600; min-width: 110px; opacity: .8; }
.tech-opts.small-opts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.tech-opts.small-opts button { min-height: 34px; padding: 4px 12px; font-size: .85rem; font-weight: 600; }
.tech-split tr.group-start > * { border-top: 2px solid var(--border); }
.tech-opts button.sel { background: var(--primary); color: var(--primary-text); }
.tech-eval { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
.tech-eval button { min-height: 64px; font-size: 1.15rem; font-weight: 700; margin: 0; }
.tech-good { background: var(--us); color: var(--us-text); border-color: var(--us); }
.tech-bad { background: var(--them); color: #fff; border-color: var(--them); }
.mask .mask-results.tech-wrap { display: block; overflow: auto; }
.mask .tech-mask { display: grid; gap: 8px; width: 100%; align-content: start; }
.mask .tech-opts, .mask .tech-eval { margin: 0; }
.mask .tech-opts:not(.small-opts) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mask .tech-attr, .mask .tech-more { margin: 0; }
.mask .tech-chip { min-height: 52px; font-size: 1.05rem; font-weight: 600; }
.mask .tech-chip.sel { background: var(--mk-fg); color: var(--mk-bg); }
.mask .tech-eval button { min-height: 96px; font-size: 1.5rem; }
.mask .tech-eval .tech-good { background: var(--us); color: var(--us-text); border-color: var(--us); }
.mask .tech-eval .tech-bad { background: var(--them); color: #fff; border-color: var(--them); }

/* analysis as a match-day dashboard */
.dash-hero { text-align: center; }
.hero-meta { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.hero-score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 8px 0; }
.hero-team { font-weight: 700; font-size: 1.15rem; text-align: right; }
.hero-team.them { text-align: left; }
.hero-sets { display: flex; gap: 10px; align-items: baseline; font-size: 2.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.hero-sets b { color: var(--muted); }
.hero-sets b.win { color: var(--text); }
.hero-sets span { color: var(--muted); font-weight: 300; }
.hero-chips, .hero-actions, .hero-form { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin-top: 8px; }
.hero-chips button, .hero-actions button { margin: 0; }
.hero-form .form { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; font-weight: 800; font-size: .8rem; color: #fff; }
.hero-form .form.w { background: var(--us-score); }
.hero-form .form.l { background: var(--them); }
.dash-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--border); margin: 4px 0 12px; scrollbar-width: none; }
.dash-tabs button { background: none; border: none; border-bottom: 2px solid transparent; border-radius: 0; margin: 0; padding: 10px 14px; color: var(--muted); white-space: nowrap; font-weight: 600; }
.dash-tabs button.on { color: var(--text); border-bottom-color: var(--us); }
.tab-panel { display: none; }
.tab-panel.on { display: block; }
@media print { .tab-panel { display: block; } .tab-panel h2.print-only { display: block; } }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.dash-grid > .card { margin: 0 0 12px; }
.cmp-head { display: flex; justify-content: space-between; font-weight: 700; font-size: .85rem; margin-bottom: 4px; }
.cmp-head span:last-child { color: var(--them); }
.cmp-head span:first-child { color: var(--us-score); }
.cmp-row { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 4px 10px; margin: 10px 0; }
.cmp-row > span { text-align: center; font-size: .85rem; color: var(--muted); }
.cmp-row > b { font-variant-numeric: tabular-nums; }
.cmp-bar { grid-column: 1 / -1; display: flex; gap: 2px; height: 5px; }
.cmp-bar i { border-radius: 3px; }
.cmp-bar .us { background: var(--us); }
.cmp-bar .them { background: var(--them); }
.perf { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.perf:first-of-type { border-top: none; }
.perf-num { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--bg); border: 1px solid var(--border); font-weight: 800; }
.perf-who small { display: block; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.perf-val { background: var(--us-score); color: #fff; font-weight: 800; border-radius: 6px; padding: 4px 8px; font-size: .85rem; white-space: nowrap; }
.analysis-settings summary { cursor: pointer; font-weight: 600; }
.playlist-card > summary { cursor: pointer; list-style-position: inside; }
.playlist-card > summary h2 { display: inline; margin: 0; }
.playlist-card[open] > summary { margin-bottom: 10px; }

/* ---------- Look: a palette per profile, square buttons, Roboto ----------
   --hl: the fill of main buttons and selections (with --hl-text on it), --hl2: tabs, bars, underlines.
   A palette also tints background, cards and lines, in the light and in the dark theme. */
/* Four simple themes: one electric colour, the rest black and light grey */
:root { --hl: #eeff00; --hl-text: #000000; --hl2: #eeff00; }
:root:not([data-theme="dark"])[data-accent] {
  /* white background, four greys: g1 wells and plain buttons, g2 lines and tracks, g3 secondary text, g4 strong text */
  --g1: #f4f4f4; --g2: #e3e3e3; --g3: #8c8c8c; --g4: #3d3d3d;
  --bg: #ffffff; --card: #ffffff; --text: #0a0a0a; --border: var(--g2); --muted: var(--g3); --court: #ffffff;
}
:root:not([data-theme="dark"])[data-style="modern"] { --well: var(--g1); }
:root:not([data-theme="dark"])[data-style="modern"] .card { box-shadow: 0 0 0 1px var(--g2), 0 6px 20px rgba(0, 0, 0, .05); }
:root:not([data-theme="dark"]) .app-header { border-bottom: 1px solid var(--g2); }
:root:not([data-theme="dark"]) .court .pos, :root:not([data-theme="dark"]) .pos { background: var(--g1); }
:root[data-theme="dark"][data-accent] { --bg: #0a0a0a; --card: #171717; --text: #f2f2f2; --border: #2a2a2a; --muted: #9a9a9a; }
:root[data-accent="red"] { --hl: #ff0062; --hl-text: #ffffff; --hl2: #ff0062; }
:root[data-accent="green"] { --hl: #00ff9c; --hl-text: #000000; --hl2: #00ff9c; }
:root[data-accent="yellow"] { --hl: #eeff00; --hl-text: #000000; --hl2: #eeff00; }
:root[data-accent="blue"] { --hl: #00eaff; --hl-text: #000000; --hl2: #00eaff; }
/* on light grey the yellow and green lines are too pale: lines and underlines in black there */
:root:not([data-theme="dark"])[data-accent="yellow"], :root:not([data-theme="dark"])[data-accent="green"], :root:not([data-theme="dark"])[data-accent="blue"] { --hl2: #0a0a0a; }
/* buttons as pills; fields and the input mask's big keys stay square */
button { border-radius: 999px !important; }
input, select, textarea { border-radius: 0 !important; }
/* input mask: keys slightly rounded (big tiles, not pills) */
.mask button, .mask .mask-result, .mask-wait { border-radius: 10px !important; }
.mask .mask-head button, .mask .chip { border-radius: 999px !important; }
/* mask keys: colour only, no outline (the suggested skill keeps its dashed hint) */
.mask button:not(.suggest), .mask .mask-result { border-color: transparent !important; }
.mask .mask-skill.suggest:not(.sel) { border-width: 2px; }
.dash-tabs button { border-radius: 0 !important; }
/* players on the court (and the libero under it): slightly rounded tiles, not pills */
.court .pos, .pos, .rv-lib, .lineup-court button, .mini-court button { border-radius: 6px !important; }
/* the grade keys and the tool grid under the court: tiles too (as pills they turn into circles and blobs) */
.evals button, .toolbar button, .swatch { border-radius: 10px !important; }
.card, .admin-tile, .rot-card, .rally-bar, #videoPane video, .modal canvas { border-radius: 2px; }
button.primary { background: var(--hl); color: var(--hl-text); border-color: var(--hl); font-weight: 700; }
.dash-tabs button.on { color: var(--text); border-bottom: 3px solid var(--hl2); }
.hero-sets b.win { box-shadow: inset 0 -6px 0 var(--us); }
.stats .bar { background: var(--us); } .admin-week .bar { background: var(--hl2); }
/* the input mask stays neutral: no theme colour there, only the game's green / orange / red */
.tech-opts button.sel:not(.mask button) { background: var(--hl); color: var(--hl-text); border-color: var(--hl); }
.accent-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-width: 720px; }
@media (max-width: 559px) { .accent-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.swatch { display: grid; grid-template-rows: 34px auto; padding: 0; min-height: 0; background: var(--card); color: var(--text); border: 3px solid var(--border); text-align: left; overflow: hidden; }
.swatch .strip { display: flex; }
.swatch .strip i { flex: 1; }
.swatch span { padding: 6px 8px; font-weight: 700; font-size: .85rem; }
.swatch.on { border-color: var(--hl); }

/* smart scouting: the players likely to touch next */
.mask .kp-player.likely:not(.sel) { border: 2px dashed var(--hl); }

/* keyboard shortcuts: only worth showing where there is a keyboard */
.key-hint { font-size: .8rem; }
@media (hover: none) { .key-hint { display: none; } }


/* Font Awesome icons: same width, so labels line up */
.app-nav .fa-solid { width: 1.15em; text-align: center; }

/* emoji turned into Font Awesome icons: the text keeps its own space after the icon */
.fa-solid { line-height: 1; }

/* home: the ways to start a match, a row of pills (the main one first) */
.start-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.start-actions button { margin: 0; padding: 8px 16px; min-height: 40px; }
.start-actions > .muted { align-self: center; font-size: .9rem; }

/* profile: light, dark, another profile, sign out: four in a row on a computer, two on a phone */
.profile-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; max-width: 720px; }
.profile-actions button { margin: 0; }
@media (max-width: 559px) { .profile-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Modern style (profile: Stile moderno / classico) ----------
   Soft surfaces: cards without borders, large radius and a light shadow; fields as soft wells; plain-case titles;
   switches as a track with the chosen option as a dark pill. */
:root[data-style="modern"] { --radius: 22px; --well: color-mix(in srgb, var(--text) 5%, var(--card)); --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 10px 28px rgba(0, 0, 0, .07); }
:root[data-style="modern"][data-theme="dark"] { --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .35); --well: color-mix(in srgb, var(--text) 7%, var(--card)); }
:root[data-style="modern"] .card, :root[data-style="modern"] .admin-tile { border: none; border-radius: var(--radius) !important; box-shadow: var(--shadow); padding: 18px; }
:root[data-style="modern"] .rot-card, :root[data-style="modern"] .kpi, :root[data-style="modern"] .perf, :root[data-style="modern"] .ask-a { border-radius: 16px; }
:root[data-style="modern"] .app-header { border-bottom: none; }
/* titles: plain case, bold */
:root[data-style="modern"] h2 { text-transform: none; letter-spacing: 0; font-weight: 700; font-size: 1.05rem; }
:root[data-style="modern"] .card h2 { color: var(--text); }
/* fields: soft wells, no border */
:root[data-style="modern"] input, :root[data-style="modern"] select, :root[data-style="modern"] textarea { border-radius: 14px !important; border-color: transparent; background: var(--well); min-height: 44px; }
/* a textarea is a sheet to write on: square corners also in the modern style */
:root[data-style="modern"] textarea { border-radius: 0 !important; }
:root[data-style="modern"] input:focus, :root[data-style="modern"] select:focus, :root[data-style="modern"] textarea:focus { outline: 2px solid var(--hl2); outline-offset: 1px; }
/* plain buttons: soft fill instead of an outline */
:root[data-style="modern"] button:not(.mask button):not(.primary):not(.easy-big):not(.us):not(.them):not(.tech-good):not(.tech-bad):not(.danger-fill):not(.swatch):not(.sel):not(.on):not(.mic-on) { background: var(--well); border-color: transparent; }
/* tiles: rounder */
:root[data-style="modern"] .court .pos, :root[data-style="modern"] .pos, :root[data-style="modern"] .rv-lib { border-radius: 14px !important; }
:root[data-style="modern"] .evals button, :root[data-style="modern"] .toolbar button, :root[data-style="modern"] .swatch { border-radius: 16px !important; }
:root[data-style="modern"] .court { border-radius: 0; overflow: hidden; }
/* switches as a track: modes, sets of the analysis, light/dark */
:root[data-style="modern"] .hero-chips { background: var(--well); border-radius: 999px; padding: 4px; gap: 4px; }
:root[data-style="modern"] .hero-chips { display: inline-flex; max-width: 100%; overflow-x: auto; }
:root[data-style="modern"] .hero-chips button { background: transparent !important; border-color: transparent !important; box-shadow: none; }
:root[data-style="modern"] .hero-chips button.primary { background: var(--text) !important; color: var(--bg) !important; }
:root[data-style="modern"] .dash-tabs { border-bottom: none; background: var(--well); border-radius: 999px; padding: 4px; display: inline-flex; max-width: 100%; }
:root[data-style="modern"] .dash-tabs button { border-radius: 999px !important; border-bottom: none !important; padding: 8px 16px; }
:root[data-style="modern"] .dash-tabs button { background: transparent !important; }
:root[data-style="modern"] .dash-tabs button.on { background: var(--text) !important; color: var(--bg); }
/* the badges of values: a soft highlight */
:root[data-style="modern"] .perf-val { border-radius: 999px !important; padding: 4px 10px; }
:root[data-style="modern"] .perf-num { background: var(--well); border: none; }
:root[data-style="modern"] .cmp-bar { height: 8px; } :root[data-style="modern"] .cmp-bar i { border-radius: 999px; }
:root[data-style="modern"] .log li { border-bottom-color: color-mix(in srgb, var(--text) 8%, transparent); }

.account-head { gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.account-head h2 { margin: 0; }
.account-head button { margin: 0; }

/* the kill-point button of the easy mode is a game action: always the game green */
.easy-big:not(:disabled) { background: var(--us); color: var(--us-text); border-color: var(--us); }

/* login: 'forgot your key?' as a text link, the email box under it */
button.link-btn { background: none !important; border: none !important; padding: 4px 0; min-height: 0; color: var(--text); text-decoration: underline; font-size: .9rem; }
.forgot-box { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--border); }

/* profile: the active keys */
.key-list { list-style: none; padding: 0; margin: 0 0 6px; max-width: 720px; }
.key-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--border); }
.key-list li .muted { flex: 1; font-size: .85rem; }
.key-mask { font-weight: 700; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.key-list button { margin: 0; }

/* Directions: our court from behind our end line (SVG, 1 unit = 10 cm), arrows coloured by the result */
.dir-court { display: block; width: 100%; max-height: 62vh; margin: 0 auto 6px; touch-action: manipulation; user-select: none; }
.dir-court[data-act] { cursor: crosshair; touch-action: none; }
.dir-drag-dot { fill: var(--text); }
.dir-floor { fill: var(--court); stroke: var(--court-line); stroke-width: 1; }
.dir-grid { stroke: var(--border); stroke-width: .5; stroke-dasharray: 2 2; }
.dir-line { stroke: var(--court-line); stroke-width: .6; }
.dir-net { stroke: var(--text); stroke-width: 2.2; }
.dir-label { font-size: 8px; fill: var(--muted); text-anchor: middle; }
.dir-arrow { stroke-width: 1.3; fill: none; opacity: .85; }
.dir-court marker path { stroke: none; }
.dir-pt { stroke: var(--us); fill: var(--us); }
.dir-err { stroke: var(--them); fill: var(--them); }
.dir-oth { stroke: var(--muted); fill: var(--muted); }
.dir-cur { stroke: var(--text); fill: var(--text); }
.dir-prop { stroke: var(--sel); fill: var(--sel); }
.dir-arrow.dir-prop { stroke-dasharray: 3 2; }
.dir-arrow.dir-cur { stroke-width: 1.8; opacity: 1; }
.dir-dot { stroke: none; opacity: .85; }
.dir-start { stroke: var(--card); stroke-width: .8; }
.dir-zones, .dir-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; max-width: 380px; margin: 6px auto 10px; }
.dir-zones-net { grid-column: 1 / -1; text-align: center; font-size: .75rem; color: var(--muted); border-bottom: 3px solid var(--text); padding-bottom: 2px; }
.dir-tiles .dir-zones-net { border-bottom: none; border-top: 3px solid var(--text); padding: 2px 0 0; }
.dir-tiles .dir-zones-net.top { border-top: none; border-bottom: 3px solid var(--text); padding: 0 0 2px; }
.dir-zones button { min-height: 58px; font-size: 1.3rem; font-weight: 700; margin: 0; }
.dir-zones button.prop { outline: 2px dashed var(--sel); outline-offset: -4px; }
.dir-tile { border: 1px solid var(--border); padding: 8px 4px; text-align: center; display: flex; flex-direction: column; gap: 2px;
  background: color-mix(in srgb, var(--us) calc(var(--share) * .7), var(--card)); }
.dir-tile b { font-size: .8rem; color: var(--muted); }
.dir-tile .dir-pct { font-size: 1.4rem; font-weight: 700; }
.dir-tile small { font-size: .72rem; color: var(--muted); }
.dir-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 8px; }
.dir-filters select { margin: 0; }
:root .dash-tabs.dir-tabs { display: flex; }
:root .dash-tabs.dir-tabs button { flex: 1; padding-left: 6px; padding-right: 6px; }
.dash-tabs button small { font-weight: 400; color: var(--muted); }

/* Opponent scouting: usual lineup as a small court seen from behind their end line, set thirds */
.opp-court { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; max-width: 320px; margin: 6px auto 8px; border-top: 3px solid var(--text); padding-top: 6px; }
.opp-court span { border: 1px solid var(--border); background: var(--court); padding: 8px 4px; text-align: center; display: flex; flex-direction: column; }
.opp-court span.empty { border: none; background: none; }
.opp-court span.libero { background: #fff1c2; }
.opp-court b { font-size: 1.3rem; }
.opp-court small { font-size: .7rem; color: var(--muted); }
.stats td.opp-danger { color: var(--them); font-weight: 700; }
.opp-thirds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.opp-thirds div { border: 1px solid var(--border); padding: 8px; text-align: center; display: flex; flex-direction: column; }
.opp-thirds b { font-size: 1.4rem; }
.opp-thirds small { color: var(--muted); font-size: .75rem; }

.opp-sheets { margin-top: 12px; }
.opp-sheets summary { cursor: pointer; font-weight: 600; }
.opp-sheets .log { margin: 8px 0; }

/* Opponent matches: the row, then the chart that opens under it */
.log li.opp-match { display: block; }
.opp-match-row { display: flex; justify-content: space-between; gap: 8px; }
.opp-tl summary { cursor: pointer; font-size: .9rem; color: var(--muted); margin-top: 4px; }
.opp-tl[open] summary { color: var(--text); font-weight: 600; margin-bottom: 6px; }
.tl-band.them { fill: var(--them); opacity: .12; }
.tl-srv.them { fill: var(--them); }
.tl-end.other { fill: var(--muted); }

/* Coach's insights: results strip (oldest → latest) and the sentences */
.form-strip { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.form-chip { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; color: #fff; }
.form-chip.w { background: var(--us-score); }
.form-chip.l { background: var(--them); }
.form-strip .muted { margin-left: 4px; }
.insights { margin: 0 0 8px; padding-left: 18px; }
.insights li { margin-bottom: 6px; }

/* Match card: buttons at their own width, in rows by use; the same gap everywhere */
.match-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row button { width: auto; margin: 0; padding-left: 18px; padding-right: 18px; }
.btn-row.secondary { border-top: 1px solid var(--border); padding-top: 10px; }
.match-actions > div > div[style] { margin-bottom: 0 !important; }
.match-actions .reopen-row > button:first-child, .match-actions button[style*="width:100%"] { width: auto !important; flex: 0 1 auto; }

/* Season squad: grids by matchday / time, compact cells */
.sq-grid td, .sq-grid th { text-align: center; }
.sq-grid td:first-child, .sq-grid th:first-child, .sq-main td:first-child, .sq-main th:first-child { text-align: left; position: sticky; left: 0; background: var(--card); white-space: nowrap; }
@media (max-width: 600px) { .sq-main .bar { display: none; } }

/* live view on the bench: the set being played, a pulsing dot while the match is on */
.live-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.live-dot::before { content: ''; display: inline-block; width: .6em; height: .6em; margin-right: .45em; border-radius: 50%; background: #d32f2f; animation: live-pulse 1.6s ease-in-out infinite; }
@keyframes live-pulse { 50% { opacity: .25; } }
@media print { .live-bar { display: none; } }
.live-note { flex-basis: 100%; font-size: .8rem; }
.share-url { width: 100%; font-size: .85rem; margin-bottom: 8px; }
/* live: the court at a glance and the last rallies */
.live-court .court { width: min(100%, 340px); min-width: 0; }
.live-court .pos .tag { font-size: .62rem; }
.live-rallies { list-style: none; margin: 0; padding: 0; }
.live-rallies li { display: grid; grid-template-columns: 3.2em 1fr auto; gap: 8px; align-items: baseline; padding: 6px 8px; border-left: 4px solid var(--border); border-bottom: 1px solid var(--border); }
.live-rallies li.won { border-left-color: var(--us-score); }
.live-rallies li.lost { border-left-color: #d32f2f; }
.lr-score { font-weight: 700; font-variant-numeric: tabular-nums; }
.lr-touches { font-size: .9rem; }
.lr-who { font-size: .8rem; color: var(--muted); max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-court .pos.server { border-color: var(--sel); box-shadow: 0 0 0 3px var(--sel); }

/* attack detail: one optional tap after an attack (hit; for an error, where it ended) */
.att-detail { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 8px 0; }
.att-lbl { font-weight: 600; font-size: .9rem; }
.att-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.att-detail button.sel { background: var(--sel); color: #111; border-color: var(--sel); }
.att-detail.in-mask { margin: 0; padding: 6px 4px; border-top: 1px solid var(--mk-line); }
.att-detail.in-mask .att-lbl { color: var(--mk-muted); }
.att-detail.in-mask button { background: var(--mk-btn); color: var(--mk-fg); border: 1px solid var(--mk-line); min-height: 44px; padding: 0 16px; font-size: 1rem; }
.att-detail.in-mask button.sel { background: var(--sel); color: #111; border-color: var(--sel); }

/* Progressi: one card per skill, one labelled column per match */
.pg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 12px; }
.pg-skill { border: 1px solid var(--border); padding: 12px 14px; }
.pg-value { margin-top: 14px; }
.pg-head { display: flex; align-items: baseline; gap: 8px; }
.pg-verdict { margin-left: auto; font-size: .85rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.pg-verdict.better { color: var(--us-score); } .pg-verdict.worse { color: var(--them); }
.pg-big { margin: 4px 0 8px; } .pg-big b { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.pg-big .muted { font-size: .8rem; }
.pg-cols { display: flex; gap: 6px; align-items: flex-end; overflow-x: auto; padding-bottom: 2px; }
.pg-col { flex: 0 0 44px; display: grid; justify-items: center; gap: 2px; font-variant-numeric: tabular-nums; }
.pg-v { font-size: .78rem; font-weight: 700; }
.pg-v.up { color: var(--us-score); } .pg-v.down { color: var(--them); }
.pg-bar { position: relative; width: 26px; height: 70px; background: var(--bg); border-bottom: 1px solid var(--border); }
.pg-bar i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--us); }
.pg-avg { position: absolute; left: -6px; right: -6px; border-top: 2px dashed var(--text); opacity: .55; }
.pg-x { font-size: .72rem; color: var(--muted); }
.pg-n { font-size: .72rem; color: var(--muted); }
.pg-text { margin: 8px 0 0; font-size: .85rem; }
.psheet h1 { margin: 0; font-size: 1.5rem; } .psheet h2 { font-size: 1rem; margin: 18px 0 8px; }
.ps-head { display: flex; gap: 14px; align-items: center; border-bottom: 2px solid var(--text); padding-bottom: 10px; }
.ps-head p { margin: 2px 0 0; color: var(--muted); }
.ps-num { font-size: 2.2rem; font-weight: 700; min-width: 64px; text-align: center; border: 2px solid var(--text); padding: 2px 8px; }
.ps-title { margin-left: auto; text-align: right; font-weight: 700; }
.ps-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 24px; }
.ps-two ul { padding-left: 18px; margin: 0; } .ps-two li { margin: 4px 0; }
.psheet .stats { width: 100%; }
.ps-lines i { display: block; height: 30px; border-bottom: 1px solid #bbb; }
@media print { .psheet .pg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .psheet .pg-skill { break-inside: avoid; } .psheet .stats, .psheet .stats .muted { font-size: .85rem; } }
.hc-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.hc-group { border-left: 4px solid var(--border); padding: 2px 0 2px 12px; }
.hc-group h3 { margin: 0 0 6px; font-size: .95rem; }
.hc-group ul { margin: 0; padding-left: 16px; } .hc-group li { margin: 4px 0; font-size: .9rem; }
.hc-group.good { border-color: var(--us-score); } .hc-group.watch { border-color: #e0b100; } .hc-group.bad { border-color: var(--them); }
.hc-trend.better { color: var(--us-score); } .hc-trend.worse { color: var(--them); }
.health h3 { font-size: .95rem; margin: 14px 0 6px; }
.hc-rots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.hc-rot { display: grid; justify-items: center; gap: 4px; padding: 6px; border: 1px solid var(--border); font-size: .8rem; font-variant-numeric: tabular-nums; text-align: center; }
.hc-rot .mini-court { width: 100%; padding: 3px; gap: 3px; }
.hc-rot .mc { min-height: 30px; padding: 2px 1px; }
.hc-rot .mc b { font-size: .85rem; } .hc-rot .mc span { display: block; font-size: .62rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* a name stays whole on one line; app.js (fitNames) makes the font smaller only when it does not fit its box */
.mc.named b { white-space: nowrap; display: inline-block; max-width: none; }
.hc-rot-nums { display: flex; gap: 8px; }
.hc-rot b { font-size: .9rem; } .hc-rot small { color: var(--muted); font-size: .68rem; }
.hc-rot .good { color: var(--us-score); font-weight: 700; } .hc-rot .weak { color: var(--them); font-weight: 700; }
.hc-rot.worst { border: 2px solid var(--them); }
.goals { margin: 14px 0 6px; }
.goal .pg-head button { margin-left: 4px; min-height: 28px; padding: 2px 8px; }
.pg-verdict.reached, .pg-verdict.closer { color: var(--us-score); } .pg-verdict.missed { color: var(--them); }
.goal-bar { height: 8px; background: var(--bg); border: 1px solid var(--border); margin-bottom: 4px; }
.goal-bar i { display: block; height: 100%; background: var(--us); }
.goal-add { margin-top: 10px; }
.goal-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 8px 0; }
.goal-form label { flex: 0 1 auto; margin-bottom: 0; }
.goal-form button { margin: 0; min-height: 40px; } :root[data-style="modern"] .goal-form button { min-height: 44px; }
.pg-diverge .pg-bar { height: 80px; border-bottom: 0; background: linear-gradient(var(--border), var(--border)) center / 100% 1px no-repeat; }
.pg-diverge .pg-bar i.up { bottom: 50%; background: var(--us); }
.pg-diverge .pg-bar i.down { top: 50%; bottom: auto; background: var(--them); }

/* Recording: the live camera, small in a corner (click: bigger), above the scouting mask */
#recBox { position: fixed; right: 12px; bottom: 12px; z-index: 60; width: 220px; background: #000; border: 1px solid var(--border); box-shadow: 0 6px 20px rgba(0, 0, 0, .35); cursor: pointer; }
#recBox[hidden] { display: none; }
#recBox.big { width: min(640px, calc(100vw - 24px)); }
#recBox video { width: 100%; display: block; aspect-ratio: 16 / 9; object-fit: contain; background: #000; }
.rec-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px; color: #fff; font-size: .8rem; font-variant-numeric: tabular-nums; }
#recState.on { color: #ff5a4f; font-weight: 700; }
.rec-bar button { min-height: 28px; padding: 2px 8px; }

/* Best players: the 2nd and 3rd of each ranking, smaller under the leader */
.perf.perf-sub { border-top: none; padding: 2px 0; }
.perf.perf-sub .perf-num { width: 30px; height: 30px; justify-self: center; font-size: .85rem; font-weight: 700; }
.perf.perf-sub .perf-who { font-size: .9rem; }
.perf.perf-sub .perf-val { background: none; color: var(--text); border: 1px solid var(--border); font-weight: 700; }

/* Overview: "Noi e loro" as tall as "I migliori", its rows spread over the height */
.dash-grid:has(> .dash-compare) { align-items: stretch; }
.dash-compare { display: flex; flex-direction: column; }
.dash-compare > .cmp-row { flex: 1 1 auto; align-content: center; }

/* Finished match: scoreboard, set chips, grouped actions, video tiles */
.final-label { margin: 0 0 6px; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; }
.final-score { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; padding: 6px 0 14px; }
.final-team { font-size: 1.1rem; font-weight: 700; overflow-wrap: anywhere; }
.final-team:last-child { text-align: right; }
.final-score b { font-size: 2.6rem; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; white-space: nowrap; }
.final-score b span { margin: 0 .2em; color: var(--muted); font-weight: 400; }
.final-score.won b { color: var(--us-score); } .final-score.lost b { color: var(--them); }
.set-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.set-chip { display: grid; justify-items: center; gap: 2px; min-width: 84px; padding: 8px 12px; border: 1px solid var(--border); border-top: 3px solid var(--border); background: var(--bg); }
.set-chip.won { border-top-color: var(--us-score); } .set-chip.lost { border-top-color: var(--them); }
.set-chip small { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.set-chip b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.btn-row.secondary + .ma-video { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }
.ma-video-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ma-video-head h3 { margin: 0; font-size: 1rem; }
.ma-video > div[style] { margin-bottom: 0 !important; }
.video-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.video-tile-row { position: relative; }
.video-tile-row .video-tile { width: 100%; margin: 0; display: flex; align-items: center; gap: 12px; padding: 8px 40px 8px 8px; text-align: left; min-height: 0; border-radius: 0 !important; }
.vt-pic { position: relative; flex: none; width: 112px; aspect-ratio: 16 / 9; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--border); font-size: 1.4rem; overflow: hidden; }
.vt-pic .video-thumb { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; border: 0; }
.vt-text { display: grid; gap: 2px; min-width: 0; }
.vt-text b { font-size: .95rem; }
.vt-text small { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-tile-row .vt-remove, .video-tile-row .vt-replace { position: absolute; top: 6px; right: 6px; min-height: 28px; width: 28px; padding: 0; margin: 0; }
.video-tile-row .vt-replace { top: auto; bottom: 6px; }
@media (max-width: 520px) { .final-score b { font-size: 2rem; } .final-team { font-size: .95rem; } }
.final-score { max-width: 680px; }

/* Finished match: the set chips in the hero are labels, not buttons */
.hero-chips .set-pill { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 14px; font-size: .9rem; white-space: nowrap; }
.hero-chips .set-pill small { font-size: .75rem; }

/* Season by opponent level: filter chips and the list of opponents with their level */
.opp-filter { text-align: center; }
.opp-filter details { text-align: left; margin-top: 10px; }
.opp-filter summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.opp-levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 16px; margin-top: 8px; }
.opp-levels label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; }
.opp-levels select, select.opp-level { width: auto; margin: 0; }
select.opp-level.small { min-height: 34px; font-size: .85rem; padding: 2px 8px; }

/* In the league: our row highlighted, results as a short list */
.league-card tr.lg-us td { font-weight: 700; }
.league-card tr.lg-them td { font-weight: 700; color: var(--them); }
.nm-card > summary { cursor: pointer; list-style-position: inside; }
.nm-card > summary h2 { display: inline; margin: 0 8px 0 0; }
.nm-card[open] > summary { margin-bottom: 8px; }
.nm-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--border); }
.nm-row:first-of-type { border-top: 0; }
.nm-info { flex: 1; min-width: 0; }
.nm-venue { font-size: .85rem; margin-top: 2px; }
.lg-games, .lg-common { list-style: none; margin: 4px 0 8px; padding: 0; font-size: .9rem; }
.lg-games li, .lg-common li { padding: 3px 0; border-top: 1px solid var(--border); }
.lg-games li.w b { color: var(--us-score); } .lg-games li.l b { color: var(--them); }
.league-card h3 { font-size: .95rem; margin: 12px 0 4px; }
.league-card .stats td:nth-child(2), .league-card .stats th:nth-child(2) { text-align: left; }

/* Impressum / Datenschutz at the bottom of every page (not next to the video, not on paper) */
#legal { max-width: 1100px; margin: 24px auto 16px; padding: 0 var(--gutter, 16px); text-align: center; font-size: .8rem; color: var(--muted); }
#legal a { color: var(--muted); }
body.with-video #legal, body.mask-on #legal { display: none; }

/* Roster with the role (6v6) */
.roster-row.with-role { grid-template-columns: 70px minmax(0, 1fr) auto auto auto; }
.roster-row.with-role select { width: auto; min-width: 70px; margin: 0; }

.start-hint { margin: 6px 0 14px; font-size: .85rem; }

/* Match list: one compact row, info left, small buttons right (wrapping under on narrow screens) */
.match-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-top: 12px; padding-bottom: 12px; }
.mr-info { flex: 1 1 320px; min-width: 0; }
.mr-info .muted { font-size: .85rem; }
.mr-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.mr-chip { font-size: .75rem; padding: 1px 8px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); white-space: nowrap; }
.mr-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.mr-actions button, .mr-actions select { width: auto; margin: 0; min-height: 34px; }
.mr-actions button.icon { padding: 4px 10px; }
.mr-actions .move-select { max-width: 150px; font-size: .8rem; }

/* versions of a match, deleted matches */
.vr-list { list-style: none; padding: 0; margin: 8px 0; }
.vr-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }

/* split a whole-match video into sets */
.split-row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: flex-end; padding: 8px 0; border-top: 1px solid var(--border); }
.split-row label { margin: 0; }
.split-on { display: flex; align-items: center; gap: 6px; color: var(--text); min-width: 70px; }
.split-on input { width: auto; min-height: 0; }
.split-time { display: flex; gap: 4px; margin-top: 4px; }
.split-time input { width: 74px; padding: 6px 8px; }
.split-time .small { padding: 4px 8px; min-height: 36px; }
.split-row > label:not(.split-on) { flex: 0 0 auto; }
.split-opts { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-end; margin: 10px 0; }
/* read-only key: a band on top; a new read-only key shown once */
.ro-bar { background: #e6f0ff; color: #1c2420; padding: 8px 16px; font-size: .9rem; text-align: center; }
.key-big { font-size: 1.3rem; letter-spacing: .08em; font-variant-numeric: tabular-nums; }

/* read-only key: nothing that changes the data is shown */
body.ro [data-act="open"],
body.ro [data-act="reviewOpen"],
body.ro [data-act="dirsOpen"],
body.ro [data-act="maskOpen"],
body.ro [data-act="setup"],
body.ro [data-act="importSheet"],
body.ro [data-act="dvwImport"],
body.ro [data-act="samsNew"],
body.ro [data-act="addTeam"],
body.ro [data-act="deleteTeam"],
body.ro [data-act="toggleTeam"],
body.ro [data-act="addPlayer"],
body.ro [data-act="removePlayer"],
body.ro [data-act="toggleLibero"],
body.ro [data-act="importOpen"],
body.ro [data-act="deleteMatch"],
body.ro [data-act="editStart"],
body.ro [data-act="endSet"],
body.ro [data-act="finish"],
body.ro [data-act="nextSet"],
body.ro [data-act="undo"],
body.ro [data-act="logEdit"],
body.ro [data-act="logDel"],
body.ro [data-act="logDelPoint"],
body.ro [data-act="logDelSub"],
body.ro [data-act="forgetVideo"],
body.ro [data-act="replaceVideo"],
body.ro [data-act="goalAdd"],
body.ro [data-act="goalDel"],
body.ro [data-act="oppUpload"],
body.ro [data-act="oppDel"],
body.ro [data-act="oppDelAll"],
body.ro [data-act="versionRestore"],
body.ro [data-act="trashOpen"],
body.ro [data-act="samsConnect"],
body.ro [data-act="samsToggle"],
body.ro [data-act="shareCreate"],
body.ro [data-act="recPanel"],
body.ro [data-act="splitStart"],
body.ro [data-act="attDetail"],
body.ro [data-act="teamReset"],
body.ro [data-act="deleteSet"],
body.ro [data-act="relinkSet"],
body.ro [data-act="closeMatch"],
body.ro [data-v="splitVideo"],
body.ro [data-v="replaceVideo"],
body.ro [data-v="removeVideo"],
body.ro [data-v="findRallies"],
body.ro [data-v="syncSheet"],
body.ro [data-v="syncPoints"],
body.ro [data-v="addMark"],
body.ro [data-v="markZero"],
body.ro [data-v="removeMark"],
body.ro [data-v="clearMarks"],
body.ro [data-v="touches"],
body.ro [data-v="court"],
body.ro .opp-level,
body.ro .opp-filter details,
body.ro .analysis-settings,
body.ro .goal-add,
body.ro .start-actions,
body.ro [data-target],
body.ro .log-tools { display: none !important; }

/* scouting with the video: SAMS as a closed row, the keyboard help folded */
.sams-card > summary { cursor: pointer; list-style-position: inside; }
.sams-card > summary h2 { display: inline; margin: 0 8px 0 0; }
.sams-card[open] > summary { margin-bottom: 8px; }
.key-hint summary { cursor: pointer; }
.key-hint { font-size: .85rem; margin: 6px 0 10px; }

/* scouting with the video: a lower court (the boxes a little smaller), the other-set notice on one line */
@media (min-width: 1000px) {
  body.with-video .court { width: 100%; aspect-ratio: 16 / 9; margin-bottom: 8px; }
  body.with-video .f6 .pos { width: clamp(68px, 21cqw, 130px); height: clamp(50px, 20cqh, 84px); }
  body.with-video .f6 .pos .num { font-size: clamp(1.2rem, 4cqw, 2rem); }
  body.with-video .f6 .pos .name { font-size: clamp(.85rem, 2.4cqw, 1.15rem); }
  body.with-video .f6 .p4, body.with-video .f6 .p3, body.with-video .f6 .p2 { top: 19%; }
  body.with-video .f6 .p5, body.with-video .f6 .p6, body.with-video .f6 .p1 { top: 69%; }
}
.video-other { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.video-other .small, .video-dl .small { margin: 0; }

/* test site: a strip on top (app.js adds the class on test.*) */
html.staging body { border-top: 22px solid #e0b100; }
html.staging body::before { content: 'TEST · dati di prova · Testdaten'; position: fixed; top: 0; left: 0; right: 0; height: 22px; line-height: 22px; text-align: center; font: 700 12px/22px Roboto, sans-serif; letter-spacing: .12em; color: #000; background: #e0b100; z-index: 9999; pointer-events: none; }
/* season analyses: players by name, no number badge */
.perf:has(.perf-num:empty) { grid-template-columns: 1fr auto; }
.perf-num:empty, .ps-num:empty { display: none; }
/* 4v4 season court (a diamond): a name may grow into the empty places next to its box */
.mini-court.f4 > .mc.named { width: max-content; min-width: 100%; max-width: 170%; justify-self: center; }
.mini-court.f4 > .mc.named:nth-child(4) { justify-self: start; }
.mini-court.f4 > .mc.named:nth-child(6) { justify-self: end; }

/* FIVB rankings: one small table per ranking */
.fivb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px 32px; }
.fivb-block h3 { margin: 0 0 4px; font-size: 1rem; }
.fivb-block td.num { text-align: right; white-space: nowrap; padding-left: 10px; }
.fivb-block td:first-child { width: 1.6em; color: var(--muted, #888); }
.fivb-block table { width: 100%; }
.fivb-block td:nth-child(2) { text-align: left; width: 100%; }

/* printed match report: the long report card may run on to the next page; FIVB details small like the tables */
@media print { .card.report { break-inside: auto; } .fivb-block .stats small { font-size: .6rem; } .fivb-block h3 { font-size: .85rem; } }
@media print { .tab-panel > h2.print-only { break-after: avoid; } }

/* ---------- Match report: A4 pages (screen: on a grey desk; print: one page each) ---------- */
.rdoc { --r-us: #1a9e4b; --r-them: #d6301e; --r-ink: #111827; --r-muted: #6b7280; --r-line: #e5e7eb; --r-soft: #f3f4f6; color: var(--r-ink); }
.rdoc-bar { display: flex; gap: 8px; justify-content: center; margin: 0 0 14px; }
.rpage { width: 210mm; max-width: 100%; min-height: 297mm; margin: 0 auto 18px; background: #fff; padding: 13mm 14mm 16mm; box-sizing: border-box; box-shadow: 0 4px 24px rgba(0, 0, 0, .12); display: flex; flex-direction: column; font-family: Roboto, system-ui, sans-serif; }
.rhead { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 3px solid var(--r-ink); }
.rhead img { width: 40px; height: 40px; }
.rbrand { font-size: 1.05rem; font-weight: 500; letter-spacing: .32em; text-transform: uppercase; }
.rsub { font-size: .72rem; letter-spacing: .28em; text-transform: uppercase; color: var(--r-muted); }
.rmeta { margin-left: auto; text-align: right; font-size: .8rem; color: var(--r-muted); line-height: 1.45; }
.rscore { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; margin: 26px 0 10px; }
.rteam { font-size: 1.45rem; font-weight: 800; line-height: 1.15; }
.rteam:first-child { text-align: right; }
.rsets { display: flex; align-items: center; gap: 10px; font-size: 4rem; font-weight: 800; line-height: 1; }
.rsets b { color: #9ca3af; } .rsets b.win { color: var(--r-ink); }
.rsets span { color: #d1d5db; font-size: 3rem; }
.rsetline { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.rsetline span { display: grid; justify-items: center; min-width: 64px; padding: 5px 10px; border-radius: 8px; background: var(--r-soft); font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.rsetline span.won { background: #dcfce7; } .rsetline span.lost { background: #fee2e2; }
.rsetline small { font-size: .62rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--r-muted); }
.rh { font-size: .78rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; margin: 24px 0 10px; padding-bottom: 5px; border-bottom: 1px solid var(--r-line); }
.rkpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.rkpi { border: 1px solid var(--r-line); border-top: 4px solid var(--r-us); border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; }
.rkpi small { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--r-muted); }
.rkpi b { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.rkpi span { font-size: .78rem; color: var(--r-muted); }
.rsrc { display: grid; grid-template-columns: 1fr; gap: 14px; }
.rsrc h3 { margin: 0 0 6px; font-size: .9rem; } .rsrc h3 b { float: right; font-size: 1.1rem; }
.rbar { display: flex; height: 26px; border-radius: 6px; overflow: hidden; background: var(--r-soft); }
.rbar i, .rlegend i { font-style: normal; }
.rbar i { display: grid; place-items: center; color: #fff; font-size: .75rem; font-weight: 800; min-width: 2px; }
.rlegend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: .74rem; color: var(--r-muted); }
.rlegend span { display: inline-flex; align-items: center; gap: 4px; } .rlegend b { color: var(--r-ink); }
.rlegend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.c1 { background: var(--us); } .c5 { background: #86efac; } .c2 { background: #2563eb; } .c3 { background: #7c3aed; } .c4 { background: #9ca3af; } .c0 { background: #d1d5db; }
.e1 { background: var(--them); } .e2 { background: #ea580c; } .e3 { background: #f59e0b; } .e4 { background: #ca8a04; } .e5 { background: #9f1239; } .e6 { background: #b45309; }
.rbests { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.rbest { border-radius: 10px; background: var(--r-soft); padding: 10px 12px; display: grid; gap: 2px; }
.rbest small { font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--r-muted); }
.rbest b { font-size: 1.02rem; font-weight: 800; line-height: 1.2; }
.rbest > span { font-size: .8rem; color: var(--r-muted); }
.rnum { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 3px; border-radius: 4px; background: var(--r-ink); color: #fff; font-size: .7rem; font-weight: 800; vertical-align: 1px; }
.rtable { width: 100%; border-collapse: collapse; font-size: .8rem; font-variant-numeric: tabular-nums; }
.rtable th { text-align: center; font-size: .7rem; font-weight: 800; padding: 5px 4px; border-bottom: 2px solid var(--r-ink); }
.rtable th small { display: block; font-weight: 500; color: var(--r-muted); font-size: .62rem; }
.rtable th:nth-child(2) { text-align: left; }
.rtable td { text-align: center; padding: 6px 4px; border-bottom: 1px solid var(--r-line); white-space: nowrap; }
.rtable tbody tr:nth-child(even) td { background: #fafafa; }
.rtable .rnumc { font-weight: 800; color: var(--r-muted); width: 2em; }
.rtable .rname { text-align: left; font-weight: 700; white-space: normal; }
.rtable .rpts { position: relative; min-width: 70px; text-align: left; }
.rtable .rpts b { position: relative; z-index: 1; padding-left: 4px; }
.rtable .rpts i { position: absolute; left: 4px; top: 25%; height: 50%; background: #bbf7d0; border-radius: 3px; }
.rdim { color: #d1d5db; }
.rnote { font-size: .72rem; color: var(--r-muted); margin: 6px 0 0; }
.rnone { margin-top: 22px; padding: 12px 14px; border-radius: 8px; background: var(--r-soft); font-size: .85rem; }
.rlines { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rline { border: 1px solid var(--r-line); border-left: 4px solid var(--r-us); border-radius: 8px; padding: 10px 12px; display: grid; gap: 4px; }
.rline small { font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--r-muted); }
.rline b { font-weight: 700; line-height: 1.5; } .rline > span { font-size: .78rem; color: var(--r-muted); }
.rfoot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--r-line); font-size: .68rem; color: var(--r-muted); text-align: center; }
@media (max-width: 760px) { .rpage { padding: 16px; min-height: 0; } .rkpis, .rbests { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rsrc, .rlines { grid-template-columns: 1fr; } .rsets { font-size: 2.8rem; } .rteam { font-size: 1.05rem; } }
@media print {
  @page { size: A4; margin: 0; }
  .rdoc .rsrc, .rdoc .rkpis, .rdoc .rbests, .rdoc .rtable tr, .rdoc .rlines { break-inside: avoid; }
  body:has(.rdoc) { background: #fff; }
  body:has(.rdoc) main { padding: 0; max-width: none; }
  .rdoc .rpage { box-shadow: none; margin: 0; width: auto; height: auto; min-height: 0; padding: 12mm 14mm 8mm; break-after: page; }
  .rdoc .rfoot { margin-top: 28px; }
  html.staging body { border-top: 0; } html.staging body::before { display: none; }
  .rdoc .rpage:last-child { break-after: auto; }
  .rdoc .rkpis, .rdoc .rbests { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rdoc .rsets { font-size: 4rem; } .rdoc .rteam { font-size: 1.45rem; }
}

/* opponents report: one A4 page per opponent */
.opp-rep .tr-chips { margin: 8px 0 12px; }
.opp-rep .chip small { opacity: .7; }
.opp-rep-go { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.opp-rep-go .muted { font-size: .85rem; }
.or-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 22px 0 14px; flex-wrap: wrap; }
.or-title h1 { margin: 0; font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.or-title p { margin: 4px 0 0; color: var(--r-muted); font-size: .9rem; }
.rdoc .form-strip { display: flex; align-items: center; gap: 4px; margin: 0; }
.rdoc .form-strip span:not(.form-chip) { font-size: .72rem; color: var(--r-muted); margin-left: 4px; }
.rdoc .form-chip { width: 22px; height: 22px; font-size: .72rem; border-radius: 4px; }
.rdoc .form-chip.w { background: var(--r-us); } .rdoc .form-chip.l { background: var(--r-them); }
.or-ins { margin: 0; padding-left: 18px; font-size: .84rem; line-height: 1.45; }
.or-ins li { margin-bottom: 4px; } .or-ins .rdimtext { color: var(--r-muted); }
.or-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.or-cols .rh { margin-top: 18px; }
.rdoc .opp-court { max-width: 260px; margin: 4px auto 6px; border-top-color: var(--r-ink); }
.rdoc .opp-court span { border-color: var(--r-line); background: var(--r-soft); padding: 6px 4px; }
.rdoc .opp-court span.libero { background: #fff1c2; }
.rdoc .opp-court b { font-size: 1.15rem; } .rdoc .opp-court small { color: var(--r-muted); }
.orpage .rtable th:nth-child(2) { text-align: center; }
.orpage .rtable td small { color: var(--r-muted); font-size: .68rem; }
.orpage .rtable td.rgood { color: var(--r-us); font-weight: 800; } .orpage .rtable td.rbad { color: var(--r-them); font-weight: 800; }
.orpage .opp-ini { font-size: .62rem; color: var(--r-muted); margin-left: 3px; }
.or-thirds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.or-thirds div { background: var(--r-soft); border-radius: 8px; padding: 8px; text-align: center; display: grid; }
.or-thirds b { font-size: 1.3rem; font-weight: 800; } .or-thirds small { font-size: .68rem; color: var(--r-muted); text-transform: uppercase; letter-spacing: .06em; }
.or-games { list-style: none; margin: 0; padding: 0; font-size: .8rem; }
.or-games li { padding: 4px 0; border-bottom: 1px solid var(--r-line); }
.or-games li > span { display: block; color: var(--r-muted); font-size: .72rem; }
.or-games b { display: inline-block; min-width: 2.4em; } .or-games b.rw { color: var(--r-us); } .or-games b.rl { color: var(--r-them); }
@media (max-width: 760px) { .or-cols { grid-template-columns: 1fr; } .or-title h1 { font-size: 1.4rem; } }
.orpage .or-title { margin: 16px 0 10px; }
.orpage .rkpi { padding: 7px 10px; } .orpage .rkpi b { font-size: 1.6rem; }
.orpage .rh { margin: 14px 0 7px; }
.orpage .rtable td { padding: 4px; }
.orpage .rfoot { margin-top: auto; }
@media print { .rdoc .or-cols { grid-template-columns: 1fr 1fr; } .rdoc .or-ins li, .rdoc .or-games li { break-inside: avoid; }
  .rdoc .orpage { height: 270mm; overflow: hidden; padding: 10mm 12mm 7mm; break-after: page; break-inside: avoid; }
  .rdoc .orpage .or-in { transform: scale(var(--orz, 1)); transform-origin: 0 0; width: calc(100% / var(--orz, 1)); } .rdoc .orpage .rfoot { margin-top: 16px; } }
/* measured at A4 width (orFit), in print layout */
.rdoc.or-measure .orpage { width: 210mm; max-width: none; min-height: 0; padding: 10mm 12mm 7mm; }
.rdoc.or-measure .or-cols { grid-template-columns: 1fr 1fr; } .rdoc.or-measure .rkpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rdoc.or-measure .orpage .rfoot { margin-top: 16px; }

/* report: who received, one bar per receiver (# + others =) */
.rrec { display: grid; gap: 10px; }
.rrecp { display: grid; grid-template-columns: 210px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; }
.rrecp > b { grid-row: 1 / 3; font-weight: 700; }
.rrecp .rbar { height: 18px; }
.rrecp > span { font-size: .74rem; color: var(--r-muted); }
.rrec .rlegend { margin-top: 0; }

/* «How to read it» under a table */
details.help { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 8px; font-size: .9rem; }
details.help > summary { cursor: pointer; font-weight: 600; color: var(--muted); list-style-position: inside; }
details.help[open] > summary { margin-bottom: 8px; }
details.help dl { margin: 0; display: grid; grid-template-columns: minmax(0, 9em) minmax(0, 1fr); gap: 6px 14px; }
details.help dt { font-weight: 700; }
details.help dd { margin: 0; line-height: 1.45; }
details.targets { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); font-size: .9rem; }
details.targets > summary { cursor: pointer; font-weight: 600; color: var(--muted); list-style-position: inside; }
details.targets[open] > summary { margin-bottom: 8px; }
details.help + details.targets { border-top: 0; margin-top: 4px; padding-top: 0; }
@media (max-width: 600px) { details.help dl { grid-template-columns: 1fr; gap: 2px; } details.help dd { margin-bottom: 8px; } }

/* practice priorities at the top of the report */
ol.prio { margin: 0 0 14px; padding-left: 1.4em; display: grid; gap: 6px; }
ol.prio li { line-height: 1.45; padding-left: 4px; }
ol.prio li::marker { font-weight: 800; }
ol.prio i { color: var(--muted); font-style: normal; }
/* opponent: the weight of each match, drawn at the page's width, thin marks */
.od-chart { width: 100%; height: auto; display: block; margin: 4px 0 6px; }
.od-ax { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.od-hit { fill: transparent; }
.od-hit:hover { fill: var(--border); opacity: .3; }
.od-chart .tl-grid { stroke: var(--border); stroke-width: .75; }
.ow-heavy { fill: var(--them); opacity: .08; }
.ow-heavy-label { font-weight: 700; fill: var(--them); }
.ow-avg { stroke: var(--muted); stroke-width: .75; stroke-dasharray: 2 3; }
.ow-so, .ow-br { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; }
.ow-br { stroke-dasharray: 5 4; }
.ow-so-dot { fill: var(--accent); }
.ow-br-dot { fill: var(--card); stroke: var(--accent); stroke-width: 1.5; }
.ow-key { display: inline-block; width: 18px; height: 0; border-top: 1.5px solid var(--accent); vertical-align: middle; }
.ow-key.br { border-top-style: dashed; }
.ow-res { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ow-res.won { fill: var(--us-score); }
.ow-res.lost { fill: var(--them); }

/* Gegner: who played in each match */
.ab-grid { border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.ab-grid th, .ab-grid td { padding: 3px 4px; text-align: center; border-bottom: 1px solid var(--border); }
.ab-grid tr:first-child th { vertical-align: bottom; font-weight: 400; min-width: 46px; }
.ab-grid tr:first-child th > * { display: block; white-space: nowrap; }
.ab-grid tr:first-child small { color: var(--muted); font-size: 10px; }
.ab-grid th:first-child { text-align: right; padding-right: 8px; }
.ab-grid tr.ab-reg th { font-weight: 700; }
.ab-res { font-weight: 700; }
.ab-res.won { color: var(--us-score); }
.ab-res.lost { color: var(--them); }
.ab-n { color: var(--muted); }
.ab i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; box-sizing: border-box; vertical-align: middle;
  font-style: normal; font-size: 8px; line-height: 10px; font-weight: 700; color: var(--card); }
.ab-S i { background: var(--text); }
.ab-C i { background: linear-gradient(to top, var(--text) 50%, transparent 50%); border: 1px solid var(--text); }
.ab-L i { background: var(--accent); width: 12px; height: 12px; line-height: 12px; font-size: 9px; }
.ab-B i { border: 1px solid var(--muted); }
.ab-A i { width: 8px; height: 0; border-radius: 0; border-top: 1px solid var(--muted); }
.ab-u i { width: 0; }
td.ab-miss { background: color-mix(in srgb, var(--them) 14%, transparent); }
td.ab-miss.ab-A i, td.ab-miss.ab-B i { border-color: var(--them); }
.ab-legend .ab i { margin-right: 2px; }

/* Gegner: starting lineups, a block per match */
.lu-wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px 28px; margin: 6px 0 10px; }
.lu-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding-bottom: 5px; margin-bottom: 4px;
  border-bottom: 1px solid var(--border); font-size: 13px; }
.lu-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lu-res { font-size: 12px; padding: 1px 7px; border-radius: 4px; color: #fff; font-variant-numeric: tabular-nums; }
.lu-res.won { background: var(--us-score); }
.lu-res.lost { background: var(--them); }
.lu-grid { border-collapse: separate; border-spacing: 3px 3px; font-size: 13px; font-variant-numeric: tabular-nums; }
.lu-grid th { font-size: 10px; font-weight: 400; color: var(--muted); padding: 0; }
.lu-grid td { padding: 0; text-align: center; }
.lu-set { color: var(--muted); font-size: 11px; width: 16px; text-align: left !important; }
.lu-p { display: inline-block; width: 28px; padding: 3px 0; border-radius: 4px; background: color-mix(in srgb, var(--text) 7%, transparent); }
.lu-p.other { background: var(--text); color: var(--card); font-weight: 700; }
.lu-sc { text-align: left !important; padding-left: 8px !important; white-space: nowrap; font-size: 12px; font-weight: 700; }
.lu-sc .won { color: var(--us-score); }
.lu-sc .lost { color: var(--them); }
.lu-tag { display: block; width: max-content; margin-top: 1px; font-size: 9px; line-height: 1.4; font-weight: 400; color: var(--muted); border: 1px solid var(--border); border-radius: 3px; padding: 0 4px; }
.lu-tag.new { color: var(--text); border-color: var(--text); }
/* Gegner: a player's initials next to the number (from sheets with initials) */
.opp-ini { margin-left: 3px; font-size: 0.72em; font-weight: 400; color: var(--muted); }
.lu-p .opp-ini, .opp-court .opp-ini { display: block; margin: 0; line-height: 1.1; }
.lu-p.other .opp-ini { color: inherit; opacity: 0.8; }
.lu-p { min-width: 28px; width: auto; padding: 3px 2px; }
.ab-grid th small.muted { display: block; font-size: 10px; font-weight: 400; white-space: nowrap; }

/* Training plans: the sheet of a session (rows like the coach's own plan: minutes, type, description, material) */
.tr-list li { align-items: center; }
.tr-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; }
.tr-head h2 { margin: 0; }
.tr-date { max-width: 200px; margin: 0; }
.tr-field { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 6px 12px; margin: 12px 0 0; }
.tr-label { font-weight: 700; font-size: .9rem; }
.tr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tr-chips .chip { min-height: 40px; padding: 6px 12px; }
.tr-player.tr-absent { color: var(--muted); }
.tr-count { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .85rem; }
.tr-focus { width: 100%; }
.tr-rows { margin: 18px 0 12px; border-top: 2px solid var(--text); }
.tr-row { display: grid; grid-template-columns: 64px 150px minmax(0, 1fr) 200px 160px; gap: 8px; align-items: start; padding: 6px 0;
  border-bottom: 1px solid var(--border); }
.tr-row:nth-child(odd):not(.tr-th):not(.tr-total) { background: color-mix(in srgb, var(--text) 3%, transparent); }
.tr-th { font-size: .75rem; color: var(--muted); padding: 4px 0; }
.tr-row input, .tr-row textarea { width: 100%; box-sizing: border-box; margin: 0; font: inherit; }
.tr-row textarea { resize: vertical; min-height: 2.6em; line-height: 1.35; overflow: hidden; }
.tr-min { text-align: right; }
.tr-type { font-weight: 700; }
.tr-mat { font-size: .85rem; }
.tr-tools { display: flex; gap: 4px; }
.tr-total { border-bottom: 2px solid var(--text); font-size: 1.05rem; }
.tr-total b { text-align: right; padding-right: 10px; }
.tr-past { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.tr-past-desc { display: block; white-space: pre-line; margin: 2px 0; }
/* medium screens: the description keeps the width, material under it, the tools beside the title row */
@media (min-width: 761px) and (max-width: 1199px) {
  .tr-row:not(.tr-ro) { grid-template-columns: 56px 140px minmax(0, 1fr) auto; }
  .tr-ex-row .tr-desc { grid-column: 3; grid-row: 1; }
  .tr-ex-row .tr-mat { grid-column: 3; grid-row: 2; }
  .tr-ex-row .tr-tools { grid-column: 4; grid-row: 1 / span 2; display: grid; grid-template-columns: repeat(2, auto); align-content: start; }
  .tr-th:not(.tr-ro) span:nth-child(4) { display: none; }
}
@media (max-width: 760px) {
  .tr-field { grid-template-columns: 1fr; }
  .tr-count { grid-column: 1; }
  .tr-row { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .tr-desc, .tr-mat { grid-column: 1 / -1; }
  .tr-th { display: none; }
}
@media print {
  .tr-sheet { border: 0; padding: 0; }
  .tr-sheet input, .tr-sheet textarea { border: 0 !important; background: transparent !important; padding: 0 !important; box-shadow: none !important; resize: none; }
  .tr-sheet input[type="date"]::-webkit-calendar-picker-indicator { display: none; }
  .card.tr-sheet { break-inside: auto; }
  .tr-row { grid-template-columns: 34px 110px minmax(0, 1fr) 150px; break-inside: avoid; font-size: .85rem; padding: 4px 0; }
  .tr-desc, .tr-mat { grid-column: auto; }
  .tr-th { display: grid; }
  .tr-field { grid-template-columns: 90px 1fr; margin-top: 6px; }
  .tr-count { grid-column: 2; }
  .tr-type { font-weight: 700; }
  .tr-row textarea { min-height: 0; }
  .tr-sheet ::placeholder { color: transparent; }
  .tr-chips .chip:not(.primary) { display: none; }
  .tr-chips .chip { border: 0; min-height: 0; padding: 0 6px 0 0; background: none !important; color: #000 !important; font-weight: 400; }
  .tr-count { display: inline; }
}
/* the training running: attendance and the plan to read */
.tr-sheet h3 { margin: 16px 0 4px; }
.tr-count-n { font-size: .85rem; font-weight: 400; }
.tr-teams { margin: 8px 0; }
.tr-people { margin: 6px 0 10px; }
.tr-people .chip { min-height: 44px; min-width: 64px; }
.tr-guests { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; align-items: center; margin-top: 8px; }
.tr-guests input { width: 180px; margin: 0; }
.tr-row.tr-ro { grid-template-columns: 52px 130px minmax(0, 1fr) 190px; }
.tr-ro .tr-min { text-align: right; padding-right: 6px; }
.tr-text { white-space: pre-line; }
@media (max-width: 760px) { .tr-guests { grid-template-columns: 1fr; } .tr-row.tr-ro { grid-template-columns: 44px minmax(0, 1fr); } .tr-ro .tr-text { grid-column: 1 / -1; } }
.tr-name { font-weight: 700; font-size: 1.05rem; }
.tr-guest-add { display: inline-flex; gap: 6px; align-items: center; }
.card > .profile-actions + .tr-list { margin-top: 12px; }
@media (max-width: 640px) {
  .tr-list li { flex-wrap: wrap; }
  .tr-list li > span:first-child { flex: 1 1 100%; }
  .tr-list .log-tools { margin: 6px 0 0 auto; }
}
/* training scouting: tablet first, big targets */
.tr-scout .tr-head { margin-bottom: 10px; }
.tr-sc-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.tr-sc-tabs .chip { min-height: 44px; padding: 6px 14px; }
.tr-sc-n { display: inline-block; min-width: 1.4em; padding: 0 5px; border-radius: 9px; font-size: .75rem; background: color-mix(in srgb, currentColor 18%, transparent); }
.tr-sc-ex { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 2px solid var(--text); border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tr-sc-min { font-weight: 700; text-align: right; }
.tr-sc-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tr-sc-p { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 68px; padding: 10px 12px; text-align: left; margin: 0; }
.tr-sc-p.sel { outline: 3px solid var(--sel); outline-offset: -1px; }
.tr-sc-name { font-size: 1.02rem; line-height: 1.2; }
.tr-marks { display: inline-flex; gap: 4px; font-size: .85rem; }
.tr-m { min-width: 1.7em; padding: 1px 6px; border-radius: 4px; text-align: center; font-weight: 700; }
.tr-g { background: var(--us); color: var(--us-text); }
.tr-o { background: #f2c94c; color: #3d2f00; }
.tr-b { background: var(--them); color: #fff; }
.tr-sc-panel { margin: 14px 0 4px; padding: 12px; border: 2px solid var(--sel); border-radius: 8px; }
.tr-sc-who { display: flex; align-items: center; gap: 12px; font-size: 1.1rem; margin-bottom: 10px; }
.tr-sc-rate { display: flex; flex-wrap: wrap; gap: 10px; }
.tr-r { min-width: 130px; min-height: 60px; font-size: 1.1rem; font-weight: 700; margin: 0; }
.tr-r-g { border-color: var(--us); }
.tr-r-o { border-color: #e0b232; }
.tr-r-b { border-color: var(--them); }
.tr-r-g.on, .tr-r-g:active { background: var(--us); color: var(--us-text); }
.tr-r-o.on, .tr-r-o:active { background: #f2c94c; color: #3d2f00; }
.tr-r-b.on, .tr-r-b:active { background: var(--them); color: #fff; }
.tr-sc-why { display: grid; gap: 8px; margin-top: 12px; }
.tr-sc-why input { width: 180px; margin: 0; }
.tr-sc-hint { margin: 14px 0 4px; }
.tr-sum-wrap { overflow-x: auto; margin: 4px 0 8px; }
.tr-sum { border-collapse: collapse; width: 100%; font-size: .9rem; }
.tr-sum th, .tr-sum td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; white-space: nowrap; }
.tr-sum thead th { font-size: .75rem; color: var(--muted); font-weight: 600; }
.tr-sum tbody th { font-weight: 400; }
.tr-sum-all { min-width: 110px; }
.tr-sum-all b { display: inline-block; min-width: 3em; }
.tr-sum-why { white-space: normal !important; min-width: 160px; font-size: .85rem; }
.tr-bar { display: inline-flex; width: 70px; height: 8px; border-radius: 4px; overflow: hidden; vertical-align: middle; gap: 1px; background: var(--border); }
.tr-bar i { display: block; height: 100%; }
@media (max-width: 640px) { .tr-sc-people { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tr-r { min-width: 0; flex: 1 1 0; } .tr-sc-ex { grid-template-columns: 1fr; } .tr-sc-min { text-align: left; } }
@media print { .tr-scout .tr-sc-tabs, .tr-scout .profile-actions { display: none; } .tr-m, .tr-bar i { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.tr-r-g { box-shadow: inset 0 -5px 0 var(--us); }
.tr-r-o { box-shadow: inset 0 -5px 0 #f2c94c; }
.tr-r-b { box-shadow: inset 0 -5px 0 var(--them); }
.tr-r.on { box-shadow: none; }
/* training lists: aims and focus big */
.tr-item { display: flex; flex-direction: column; gap: 4px; }
.tr-item-name { font-size: 1rem; }
.tr-aims { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.tr-aim { padding: 3px 10px; border-radius: 4px; background: var(--text); color: var(--bg); font-weight: 700; font-size: .95rem; text-transform: uppercase; letter-spacing: .03em; }
.tr-big-focus { display: block; font-size: 1.3rem; font-weight: 700; line-height: 1.25; margin: 2px 0; }
.tr-list .tr-aims + .tr-big-focus, .tr-list .muted + .tr-aims { margin-top: 4px; }
.tr-focus-chips .chip { min-height: 40px; }
@media print { .tr-label-sub { display: none; } }
/* scouting cards (v349): name on top, three rating keys under it, one tap each */
.tr-sc-people { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.tr-sc-card { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.tr-sc-card.sel { border-color: var(--sel); box-shadow: 0 0 0 2px var(--sel); }
.tr-sc-name { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.tr-sc-num { flex: none; min-width: 38px; height: 38px; padding: 0 4px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--text); color: var(--bg); font-weight: 800; font-size: 1.15rem; }
.tr-sc-nm { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.tr-sc-nm b { font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-sc-nm small { color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-sc-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.tr-s { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-height: 56px; padding: 4px 2px; margin: 0; border-radius: 8px !important; line-height: 1.1; border-width: 2px; }
.tr-s b { font-size: 1.25rem; min-height: 1.1em; }
.tr-s small { font-size: .72rem; font-weight: 600; white-space: nowrap; }
.tr-s-g { border-color: color-mix(in srgb, var(--us) 60%, transparent); }
.tr-s-o { border-color: #ecc54a; }
.tr-s-b { border-color: color-mix(in srgb, var(--them) 60%, transparent); }
.tr-s-g.has { background: color-mix(in srgb, var(--us) 22%, var(--card)); }
.tr-s-o.has { background: color-mix(in srgb, #f2c94c 28%, var(--card)); }
.tr-s-b.has { background: color-mix(in srgb, var(--them) 18%, var(--card)); }
.tr-s-g:active, .tr-s-g.pop { background: var(--us); color: var(--us-text); }
.tr-s-o:active, .tr-s-o.pop { background: #f2c94c; color: #3d2f00; }
.tr-s-b:active, .tr-s-b.pop { background: var(--them); color: #fff; }
.tr-s.pop { animation: trPop .5s ease-out; }
@keyframes trPop { 0% { transform: scale(1.12); } 100% { transform: scale(1); } }
.tr-sc-people .tr-sc-panel { grid-column: 1 / -1; margin: 0; display: grid; gap: 10px; background: color-mix(in srgb, var(--sel) 6%, var(--card)); }
.tr-sc-panel .tr-sc-who { margin: 0; font-size: 1rem; gap: 8px; flex-wrap: wrap; }
.tr-sc-panel .tr-chips .chip { min-height: 44px; padding: 6px 14px; }
.tr-sc-panel input { width: 200px; margin: 0; }
.tr-actions { display: flex; flex-wrap: wrap; max-width: none; }
.tr-actions button { white-space: nowrap; min-width: 160px; }
@media (max-width: 640px) { .tr-sc-people { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .tr-sc-card { padding: 8px; } .tr-s small { font-size: .66rem; } .tr-actions button { min-width: 0; flex: 0 1 auto; white-space: normal; } .tr-s small { white-space: normal; text-align: center; } .tr-sc-panel .tr-guest-add { flex-wrap: wrap; } .tr-sc-panel input { flex: 1 1 120px; width: auto; min-width: 0; } }
/* the theme greys every button: the rating keys keep their colours */
.tr-sc-seg .tr-s { border-radius: 8px !important; border: 2px solid transparent !important; color: var(--text); }
.tr-sc-seg .tr-s-g { border-color: var(--us) !important; background: color-mix(in srgb, var(--us) 8%, var(--card)) !important; }
.tr-sc-seg .tr-s-o { border-color: #ecc54a !important; background: color-mix(in srgb, #f2c94c 10%, var(--card)) !important; }
.tr-sc-seg .tr-s-b { border-color: var(--them) !important; background: color-mix(in srgb, var(--them) 7%, var(--card)) !important; }
.tr-sc-seg .tr-s-g.has { background: color-mix(in srgb, var(--us) 30%, var(--card)) !important; }
.tr-sc-seg .tr-s-o.has { background: color-mix(in srgb, #f2c94c 38%, var(--card)) !important; }
.tr-sc-seg .tr-s-b.has { background: color-mix(in srgb, var(--them) 24%, var(--card)) !important; }
.tr-sc-seg .tr-s-g:active, .tr-sc-seg .tr-s-g.pop { background: var(--us) !important; color: var(--us-text); }
.tr-sc-seg .tr-s-o:active, .tr-sc-seg .tr-s-o.pop { background: #f2c94c !important; color: #3d2f00; }
.tr-sc-seg .tr-s-b:active, .tr-sc-seg .tr-s-b.pop { background: var(--them) !important; color: #fff; }
.tr-s small { font-size: .8rem; }
.tr-sc-card { border-radius: 10px !important; }
.tr-sc-panel button[data-act="trainWhyDone"] { white-space: nowrap; }
/* v350: the last tap in a bar fixed at the bottom (undo, what was wrong); the cards stay where they are */
.tr-sc-bar { position: sticky; bottom: 0; z-index: 5; margin: 14px -14px -14px; padding: 10px 14px 12px; border-radius: 0 0 12px 12px; background: var(--card); border-top: 3px solid var(--text); box-shadow: 0 -6px 16px rgba(0,0,0,.08); display: grid; gap: 8px; }
.tr-sc-last { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 1.05rem; }
.tr-sc-last .tr-m { font-size: .95rem; padding: 3px 10px; }
.tr-sc-lastwho { flex: 1 1 auto; }
.tr-sc-last button { margin: 0; }
.tr-sc-bar .tr-sc-why { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin: 0; }
.tr-sc-bar .tr-chips .chip { min-height: 42px; padding: 6px 14px; }
.tr-sc-bar input { width: 160px; margin: 0; }
@media (max-width: 640px) { .tr-sc-bar { padding-bottom: 10px; gap: 6px; } .tr-sc-bar .tr-sc-why { display: grid; gap: 4px; } .tr-sc-bar .tr-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; } .tr-sc-bar .tr-chips .chip { flex: none; min-height: 40px; padding: 4px 12px; white-space: nowrap; } .tr-sc-bar .tr-guest-add { flex: none; } .tr-sc-bar input { width: 130px; } }
/* KAR (v351): the dials of an exercise */
.tr-kar-line { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 2px 0 8px 72px; font-size: .82rem; }
.tr-kar-dials, .tr-kar-crit { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.tr-kar-d { white-space: nowrap; font-weight: 600; }
.tr-kar-d i { font-style: normal; letter-spacing: 1px; color: var(--text); }
.tr-kar-d.info { color: var(--muted); }
.tr-kar-crit .tr-m { font-size: .72rem; padding: 0 5px; }
.tr-kar { margin: 4px 0 12px; padding: 12px; border: 2px solid var(--text); border-radius: 8px; background: var(--card); }
.tr-kar-hint { margin: 0 0 6px; font-size: .85rem; }
.tr-kar h4 { margin: 12px 0 6px; font-size: .9rem; }
/* the KAR dials: one row each, a bar of 3 boxes filled up to the level */
.kar-rows { display: grid; gap: 2px; margin-bottom: 8px; }
.kar-row { display: grid; grid-template-columns: minmax(120px, 190px) auto 1fr; align-items: center; gap: 4px 12px; padding: 3px 6px; border-radius: 6px; }
.kar-row.on { background: color-mix(in srgb, var(--sel) 12%, transparent); }
.kar-row .kar-nm { all: unset; margin: 0 !important; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; color: inherit; cursor: pointer; font-weight: 600; font-size: .92rem; display: flex; align-items: center; gap: 6px; min-height: 36px; }
.kar-row .kar-nm i, .kar-row .kar-nm svg { font-size: .7rem; color: var(--muted); }
.kar-row .kar-nm:focus-visible, .kar-bar .kar-box:focus-visible { outline: 2px solid var(--sel); outline-offset: 2px; }
.kar-row.unset .kar-nm { color: var(--muted); }
.kar-bar { display: flex; gap: 4px; }
.kar-bar .kar-box { all: unset; box-sizing: border-box; width: 34px; height: 26px; min-height: 0 !important; margin: 0 !important; padding: 0 !important; border: 2px solid var(--border) !important; border-radius: 4px !important; background: var(--card) !important; box-shadow: none !important; cursor: pointer; }
.kar-bar .kar-box.fill { border-color: var(--sel) !important; background: var(--sel) !important; }
.kar-bar .kar-box:not(.fill):hover { border-color: var(--muted) !important; }
.kar-row .tr-kar-sug { grid-column: 1 / -1; margin: 0 0 4px; }
.kar-lvname { font-size: .85rem; color: var(--muted); }
.kar-pmrow { grid-column: 1 / -1; display: flex; gap: 6px; padding: 2px 0 4px; }
.kar-pmrow button { margin: 0; }
.kar-infobtn { margin: 4px 0 8px; }
@media (max-width: 420px) { .kar-row { grid-template-columns: minmax(0, 1fr) auto 44px; gap: 4px 8px; } .kar-lvname { font-size: .78rem; } .kar-bar .kar-box { width: 30px !important; } }
.tr-kar-sug { margin-top: 10px; padding: 10px; border-radius: 8px; background: color-mix(in srgb, var(--sel) 8%, var(--card)); }
.tr-kar-sug ul { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.tr-kar-sug li button { text-align: left; white-space: normal; margin: 0; border-radius: 8px !important; }
.tr-kar-critedit { display: grid; gap: 6px; }
.tr-kar-critedit label { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 8px; margin: 0; }
.tr-kar-critedit label .tr-m { text-align: center; }
.tr-kar-critedit input { margin: 0; width: 100%; box-sizing: border-box; }
.tr-sc-crit { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: -4px 0 14px; font-size: .95rem; }
.tr-sc-crit.proposal { color: var(--muted); }
.tr-sc-crit .tr-m { margin-right: 4px; }
.tr-sc-dials { flex-basis: 100%; font-size: .82rem; color: var(--muted); }
@media (max-width: 760px) { .tr-kar-line { padding-left: 0; } .tr-kar-critedit label { grid-template-columns: 1fr; } }
@media print { .tr-kar-line { padding: 0 0 4px 34px; font-size: .75rem; } .tr-kar-line .tr-m { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
@media (max-width: 560px) {
  .tr-kar { padding: 10px 8px; }
  .tr-kar-critedit label .tr-m { justify-self: start; }
}

/* ---------- Training: an exercise on its own page, and its drawing on the court (drill.js) ---------- */
.tr-ex-row { cursor: pointer; }
.tr-ex-row:hover { background: color-mix(in srgb, var(--text) 6%, transparent) !important; }
.tr-ex-row .tr-min { text-align: right; padding-right: 6px; font-weight: 700; }
.tr-row-draw { display: block; max-width: 360px; margin-top: 6px; }
.tr-row-draw svg { width: 100%; height: auto; display: block; }
.tr-ex-top { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.tr-ex-top label, .tr-ex-f { display: grid; gap: 4px; margin: 12px 0 0; }
.tr-ex-top label { margin: 0; }
.tr-ex input, .tr-ex textarea { width: 100%; box-sizing: border-box; margin: 0; font: inherit; }
/* the text fields grow with their lines: no corner to pull */
.tr-ex textarea { resize: none; overflow: hidden; min-height: 0; line-height: 1.4; }
.tr-ex .tr-desc { min-height: 6em; }
.tr-ex .tr-type { font-weight: 700; }
.dr-tools { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 8px; }
.dr-group { display: flex; flex-wrap: wrap; gap: 6px; }
.dr-tools button { min-height: 40px; }
.dr-t-a i, .dr-t-la i, .dr-t-sa i { color: #1e63d6; } .dr-t-b i, .dr-t-lb i, .dr-t-sb i { color: #d6301e; } .dr-t-cone i { color: #e8352c; } .dr-t-ball i { color: #1747a6; } .dr-t-cart i { color: #555; } .dr-t-target i { color: #d6301e; } .dr-t-mat i { color: #3d7fc4; } .dr-t-box i { color: #a8692e; }
.dr-tools button.primary i { color: inherit; }
.dr-board { touch-action: none; user-select: none; -webkit-user-select: none; border: 1px solid var(--border); margin: 0 0 8px; cursor: crosshair; }
.dr-board svg { width: 100%; height: auto; max-height: 72vh; display: block; }
.dr-board svg.dr-half { max-width: 620px; margin: 0 auto; }
.tr-row-draw svg.dr-half { max-width: 220px; }
.dr-floor { fill: color-mix(in srgb, var(--text) 7%, var(--card)); }
.dr-court { fill: var(--card); stroke: var(--text); stroke-width: .07; }
.dr-line { stroke: var(--text); stroke-width: .05; }
.dr-net { stroke: var(--text); stroke-width: .16; }
.dr-p text { font: 700 .52px Roboto, sans-serif; text-anchor: middle; fill: #fff; }
.dr-a circle { fill: #1e63d6; } .dr-b circle { fill: #d6301e; }
/* the libero: a jersey of another colour, the side's colour around it and on the L */
.dr-la circle, .dr-lb circle { fill: #fff; stroke-width: .12; } .dr-la circle { stroke: #1e63d6; } .dr-lb circle { stroke: #d6301e; }
.dr-la text { fill: #1e63d6; } .dr-lb text { fill: #d6301e; }
/* the setter: the side's colour with a white ring inside */
.dr-sa circle { fill: #1e63d6; } .dr-sb circle { fill: #d6301e; }
.dr-sa circle.ring, .dr-sb circle.ring { fill: none; stroke: #fff; stroke-width: .07; }
.dr-c circle { fill: var(--text); } .dr-c text { fill: var(--card); }
.dr-ball-base { fill: #ffd400; }
.dr-ball-band { fill: #1747a6; stroke: #0d2350; stroke-width: .05; stroke-linejoin: round; }
.dr-ball-rim { fill: none; stroke: #0d2350; stroke-width: .09; }
.dr-cone path, .dr-cone .base { stroke-width: .035; stroke-linejoin: round; }
.dr-cone .hole { fill: #222; }
.dr-cone-y path { fill: #f5d31c; } .dr-cone-y .base { fill: #c9a800; } .dr-cone-y path, .dr-cone-y .base { stroke: #8a7300; }
.dr-cone-r path { fill: #e8352c; } .dr-cone-r .base { fill: #b3211a; } .dr-cone-r path, .dr-cone-r .base { stroke: #7a140f; }
.dr-cone-b path { fill: #2463d6; } .dr-cone-b .base { fill: #18459c; } .dr-cone-b path, .dr-cone-b .base { stroke: #0f2d66; }
.dr-cone-w path { fill: #fbfbfb; } .dr-cone-w .base { fill: #d4d4d4; } .dr-cone-w path, .dr-cone-w .base { stroke: #777; }
.dr-cols { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; }
.dr-col i { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid #555; vertical-align: -2px; }
.dr-col-y i { background: #f5d31c; } .dr-col-r i { background: #e8352c; } .dr-col-b i { background: #2463d6; } .dr-col-w i { background: #fbfbfb; }
.dr-board.dr-moving { cursor: move; }
.dr-run polyline, .dr-pass polyline, .dr-pen polyline { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.dr-run polyline { stroke: var(--text); stroke-width: .09; } .dr-run polygon { fill: var(--text); }
.dr-pass polyline { stroke: var(--text); stroke-width: .08; stroke-dasharray: .3 .2; } .dr-pass polygon { fill: var(--text); }
.dr-pen polyline { stroke: #7a3db8; stroke-width: .08; }
@media (max-width: 559px) { .tr-ex-top { grid-template-columns: 90px minmax(0, 1fr); } }
@media print { .dr-board { border: 0; } .tr-row-draw { max-width: 300px; } }
.tr-tools { justify-content: flex-end; }
.dr-cart rect { fill: #d9d9d9; stroke: #444; stroke-width: .07; } .dr-cart circle { fill: #ffd400; stroke: #1747a6; stroke-width: .05; }
.dr-target circle { fill: none; stroke: #d6301e; stroke-width: .1; } .dr-target .in { stroke-width: .06; } .dr-target .dot { fill: #d6301e; stroke: none; }
.dr-mat rect { fill: #a9cdee; stroke: #2c5f94; stroke-width: .06; } .dr-mat line { stroke: #2c5f94; stroke-width: .03; }
.dr-box rect { fill: #e3b27c; stroke: #7a4a1c; stroke-width: .07; } .dr-box path { stroke: #7a4a1c; stroke-width: .04; fill: none; }
.dr-score > rect { fill: #2b2b2b; stroke: #111; stroke-width: .04; } .dr-score .pane { fill: #fff; stroke: none; }
.dr-score text { font: 700 .46px Roboto, sans-serif; text-anchor: middle; fill: #111; }
.dr-t-score i { color: #2b2b2b; }

/* ---------- Training list: plans and trainings as cards, three in a row; the filter by focus above ---------- */
.tr-filter { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 6px 12px; align-items: center; margin: 14px 0 4px; }
.tr-filter .chip small { opacity: .65; margin-left: 2px; }
.tr-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.tr-card { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--border); background: var(--card); min-width: 0; }
.tr-card .tr-big-focus { font-size: 1.15rem; overflow-wrap: anywhere; }
.tr-card-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
@media (max-width: 980px) { .tr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .tr-grid { grid-template-columns: 1fr; } .tr-filter { grid-template-columns: 1fr; } }
.tr-past .log li { align-items: center; } .tr-past .log-tools { align-self: center; } .tr-past .log-tools button { height: auto; }
.tr-type-sub { display: block; font-weight: 400; }
.tr-ex-title { font-size: 1.15rem; font-weight: 700; }
.tr-ex-title.tr-missing:placeholder-shown { outline: 2px solid var(--them); }

/* ---------- Exercise: level, aim, variations; drawing: areas and texts ---------- */
.tr-ex-level { grid-column: 1 / -1; display: grid; gap: 4px; }
.tr-aim-l, .tr-vars-l { display: block; }
.tr-aim-l { margin-bottom: 2px; } .tr-vars-l { margin-top: 2px; }
.dr-zone rect { stroke-width: .05; }
.dr-zone-g rect { fill: rgba(122, 184, 58, .45); stroke: #4f8a1c; }
.dr-zone-y rect { fill: rgba(245, 211, 28, .5); stroke: #a58a00; }
.dr-zone-b rect { fill: rgba(56, 146, 214, .42); stroke: #1f6aa8; }
.dr-zone-x rect { fill: rgba(214, 48, 30, .08); stroke: #c0392b; stroke-dasharray: .2 .12; }
.dr-zone-x path { stroke: #c0392b; stroke-width: .04; opacity: .7; }
.dr-text { font: 700 .55px Roboto, sans-serif; text-anchor: middle; fill: var(--text); stroke: var(--card); stroke-width: .14; paint-order: stroke; stroke-linejoin: round; }
.dr-zc-g i { background: #7ab83a; } .dr-zc-y i { background: #f5d31c; } .dr-zc-b i { background: #3892d6; }
.dr-zc-x i { background: repeating-linear-gradient(45deg, #c0392b 0 2px, #fff 2px 5px); }
.dr-zc-g i, .dr-zc-y i, .dr-zc-b i, .dr-zc-x i { border-radius: 3px; }
#drText { min-width: 260px; flex: 1 1 260px; max-width: 420px; }
.dr-t-zone i { color: #4f8a1c; } .dr-t-text i { color: var(--text); }

/* ---------- Local assistant (Ollama on this computer) ---------- */
.llm-card summary i { margin-right: 4px; }
.llm-ask { display: grid; gap: 8px; margin-top: 8px; }
.llm-ask label { display: flex; gap: 8px; align-items: center; } .llm-ask select { max-width: 280px; }
.llm-ask textarea { width: 100%; resize: vertical; }
.llm-answer { margin-top: 10px; line-height: 1.5; } .llm-answer:empty { display: none; }
.llm-answer p { margin: 0 0 8px; } .llm-answer ul, .llm-answer ol { margin: 0 0 8px; padding-left: 22px; }
.llm-wait { animation: llmBlink 1s steps(1) infinite; } @keyframes llmBlink { 50% { opacity: 0; } }
.llm-help ol { padding-left: 20px; } .llm-help code { font-size: .85em; overflow-wrap: anywhere; background: color-mix(in srgb, var(--text) 8%, transparent); padding: 1px 4px; }

.modal .llm-guide { max-width: 760px; } .llm-guide h3 { margin: 14px 0 4px; font-size: 1rem; } .llm-guide p { margin: 0 0 6px; }
.llm-cmd { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 8px; }
.llm-cmd pre { flex: 1; min-width: 0; margin: 0; padding: 8px 10px; overflow-x: auto; font-size: .78rem; line-height: 1.35; background: color-mix(in srgb, var(--text) 7%, var(--card)); border: 1px solid var(--border); white-space: pre-wrap; word-break: break-all; }

.tr-who { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

.tr-kar-warn { margin: 8px 0 0; padding: 8px 10px; border-left: 3px solid #e0a000; background: color-mix(in srgb, #e0a000 10%, var(--card)); font-size: .9rem; }
.tr-felt { margin-top: 14px; } .tr-felt .muted { align-self: center; font-size: .9rem; }
.tr-sum-felt th, .tr-sum-felt td { border-top: 2px solid var(--border); white-space: nowrap; } .tr-felt-d { color: var(--muted); }

.tr-viewmode { display: inline-flex; gap: 4px; margin-left: auto; align-self: center; }
.tr-thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin-top: 4px; }
.tr-thumb { position: relative; display: block; border: 1px solid var(--border); background: var(--card); line-height: 0; }
.tr-thumb svg { width: 100%; height: auto; display: block; }
.tr-thumb b { position: absolute; top: 2px; left: 3px; font-size: .7rem; line-height: 1; padding: 1px 3px; background: var(--card); color: var(--text); }
.tr-thumb-more { display: flex; align-items: center; justify-content: center; border: 1px dashed var(--border); font-size: .8rem; color: var(--muted); }
.tr-grid.tr-list { grid-template-columns: 1fr; gap: 0; }
.tr-grid.tr-list .tr-card { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 14px; border-width: 0 0 1px; padding: 8px 4px; }
.tr-grid.tr-list .tr-card .tr-big-focus { font-size: .95rem; }
.tr-grid.tr-list .tr-card-tools { margin: 0 0 0 auto; padding: 0; }

/* practice match in a training: score, the court (two halves and the net), one bench, big scouting buttons */
/* the same look as the exercise drawing (drill.js): grey surround, white court, thin dark lines, thick net, A blue, B red */
:root { --tg-floor: var(--card); --tg-line: var(--text); --tg-a: #1e63d6; --tg-b: #d6301e; }
.tg-score { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 8px 0 12px; }
.tg-score > b { font-size: 2.6rem; font-variant-numeric: tabular-nums; line-height: 1; }
.tg-dash { font-size: 1.8rem; color: var(--muted); }
.tg-t { font-weight: 700; padding: 3px 10px; border-radius: 4px; color: #fff; background: var(--tg-a); }
.tg-tb { background: var(--tg-b); color: #fff; }
.tg-sets { flex-basis: 100%; }
.tg-field { margin: 6px 0; padding: 10px 24px 22px; border-radius: 8px; background: color-mix(in srgb, var(--text) 7%, var(--card)); }
.tg-heads { display: flex; justify-content: space-between; margin-bottom: 10px; }
.tg-head { font-weight: 700; font-size: .9rem; display: flex; gap: 6px; align-items: center; min-height: 22px; }
.tg-nexttag { font-size: .75rem; font-weight: 700; padding: 1px 8px; border-radius: 4px; background: var(--sel); color: #06301a; }
/* the court 18 x 9 (4 vs 4: 14 x 7), the 3 m lines a third of each half from the net, the net beyond the side lines */
.tg-court { position: relative; aspect-ratio: 2 / 1; max-width: 900px; margin: 0 auto; border: 2px solid var(--tg-line); background: var(--tg-floor);
  background-image: linear-gradient(to right, transparent calc(33.333% - 1px), var(--tg-line) calc(33.333% - 1px) calc(33.333% + 1px), transparent calc(33.333% + 1px), transparent calc(66.667% - 1px), var(--tg-line) calc(66.667% - 1px) calc(66.667% + 1px), transparent calc(66.667% + 1px)); }
.tg-net { position: absolute; left: calc(50% - 3px); width: 6px; top: -16px; bottom: -16px; background: var(--tg-line); z-index: 2; pointer-events: none; }
.tg-hl { position: absolute; top: 0; bottom: 0; width: 50%; background: color-mix(in srgb, var(--sel) 16%, transparent); box-shadow: inset 0 0 0 3px var(--sel); pointer-events: none; }
.tg-hl-a { left: 0; } .tg-hl-b { left: 50%; }
.tg-tok { position: absolute; transform: translate(-50%, -50%); z-index: 1; margin: 0; width: 15%; max-width: 130px; height: 22%; min-height: 0; padding: 2px 4px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; min-width: 0; font-size: 1.05rem; font-weight: 700; border: 0 !important; border-radius: 12px !important; color: #fff !important; background: var(--tg-a) !important; box-shadow: 0 2px 0 rgba(0,0,0,.25) !important; }
.tg-tok-b { background: var(--tg-b) !important; color: #fff !important; }
.tg-tok small { font-size: .85rem; font-weight: 800; opacity: .9; }
.tg-tok span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-tok.on { outline: 4px solid var(--sel); outline-offset: 2px; z-index: 3; }
.tg-tok.srv { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--text) !important; }
.tg-tok.tg-empty { background: transparent !important; border: 2px dashed color-mix(in srgb, var(--text) 45%, transparent) !important; color: var(--text) !important; box-shadow: none !important; }
.tg-tok.tg-empty:disabled { opacity: .7; }
.tg-tok.tg-empty:not(:disabled) { border-color: var(--sel) !important; background: color-mix(in srgb, var(--sel) 25%, transparent) !important; }
.tg-bench { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; margin: 8px 0; }
.tg-chipwrap { display: inline-flex; gap: 2px; align-items: center; }
.tg-bchip { margin: 0; min-height: 44px; padding: 4px 14px; border-radius: 22px; font-weight: 700; }
.tg-bchip.on { outline: 4px solid var(--sel); outline-offset: 1px; }
.tg-x { min-width: 30px; padding: 2px 6px; margin: 0; }
.tg-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 12px; max-width: 820px; }
.tg-sk { margin: 0; min-height: 64px; font-size: 1.1rem; font-weight: 800; }
.tg-sk.sug { box-shadow: inset 0 0 0 3px var(--sel); background: color-mix(in srgb, var(--sel) 16%, var(--card)); }
.tg-ev { margin: 0; min-height: 84px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; border-radius: 12px; }
.tg-ev b { font-size: 2rem; } .tg-ev small { font-size: .75rem; color: var(--muted); }
.tg-ev-p:not(:disabled) { background: color-mix(in srgb, var(--us) 30%, var(--card)); }
.tg-ev-g:not(:disabled) { background: color-mix(in srgb, var(--us) 14%, var(--card)); }
.tg-ev-b:not(:disabled) { background: color-mix(in srgb, var(--them) 16%, var(--card)); }
.tg-pts { grid-template-columns: 1fr 1fr 1fr; max-width: 620px; }
.tg-pt { margin: 0; min-height: 60px; font-size: 1.05rem; font-weight: 700; }
.tg-pt-a { box-shadow: inset 0 -4px 0 var(--tg-a); } .tg-pt-b { box-shadow: inset 0 -4px 0 var(--tg-b); }
.tg-last { margin: 10px 0; }
.tg-setup { display: grid; gap: 10px; }
.tg-subhint { margin: 6px 0; padding: 8px 10px; border-left: 3px solid var(--sel); background: color-mix(in srgb, var(--sel) 8%, var(--card)); }
.tg-sum { margin-bottom: 12px; } .tg-sum h3 { margin: 0 0 4px; font-size: 1rem; } .tg-sum p { margin: 2px 0; }
@media (max-width: 560px) {
  .tg-field { padding: 8px 8px 18px; }
  .tg-court { aspect-ratio: 1.45 / 1; }
  .tg-tok { width: 17%; height: 22%; font-size: .82rem; border-radius: 8px !important; padding: 1px 2px; }
  .tg-tok small { font-size: .7rem; }
  .tg-row { gap: 5px; }
  .tg-sk { min-height: 56px; font-size: .85rem; padding: 2px; }
  .tg-ev { min-height: 72px; padding: 2px; } .tg-ev b { font-size: 1.6rem; } .tg-ev small { font-size: .62rem; }
  .tg-bench { grid-template-columns: 1fr; }
}
/* the tokens stay where they are when tapped (the buttons' pressed / hover effects would move them off their place) */
.tg-tok, .tg-tok:hover, .tg-tok:active, .tg-tok:focus, .tg-tok.on { transform: translate(-50%, -50%) !important; transition: none !important; }
/* Direzioni on one screen: a compact head, the court lying down on the left and the rest beside it */
.dir-head { padding-bottom: 10px; }
.dir-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.dir-top h2 { margin: 0; }
.dir-topbtns { display: flex; gap: 6px; }
.dir-topbtns button { margin: 0; }
.dir-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
.dir-bar .dir-tabs { flex: 1 1 320px; margin: 0; }
.dir-modes { display: flex; gap: 6px; }
.dir-modes button { margin: 0; }
.dir-hint { margin: 6px 0 0; font-size: .82rem; }
.dir-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(240px, 1fr); gap: 12px 20px; align-items: start; }
.dir-side { display: grid; gap: 8px; align-content: start; }
.dir-side p, .dir-side h3, .dir-side label { margin: 0; }
.dir-side h3 { font-size: 1rem; }
.dir-nav { margin: 0; }
.dir-pos { font-size: .8rem; }
.dir-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.dir-btns button { margin: 0; }
.dir-side .dir-tiles, .dir-side .dir-filters { margin: 0; }
.dir-side .dir-filters { grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .dir-layout { grid-template-columns: 1fr; } }
/* dragging a player: the copy under the finger, the place it would go to */
.tg-tok[data-k], .tg-bchip { touch-action: none; user-select: none; -webkit-user-select: none; }
.tg-ghost { position: fixed !important; z-index: 1000 !important; pointer-events: none; opacity: .9; transform: translate(-50%, -50%) scale(1.05) !important; }
.tg-dragging { opacity: .35; }
.tg-drop { outline: 4px dashed var(--sel) !important; outline-offset: 2px; }
.tg-bench.tg-drop { outline-offset: 4px; border-radius: 8px; }

/* SAMS ticker beside the scouting, only to look at (an iframe of the ticker site) */
.ticker-dock { position: fixed; right: 12px; bottom: 12px; width: min(var(--td-w), calc(100vw - 24px)); height: min(72vh, 760px); z-index: 60;
  display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.25); overflow: hidden; }
.ticker-dock[hidden] { display: none; }
.ticker-dock .td-head { display: flex; gap: 6px; align-items: center; padding: 8px; flex-wrap: wrap; }
.ticker-dock .td-head strong { font-size: .85rem; flex: 1 1 100%; }
.ticker-dock .td-head input { flex: 1; min-width: 0; padding: 6px 8px; font-size: .85rem; }
.ticker-dock .td-hint { margin: 0 8px 6px; font-size: .75rem; }
/* the ticker page is as wide as its window (100vw): with a visible scrollbar it would scroll sideways by the bar's width;
   the frame is a bit larger than its box and the bars stay outside (it scrolls with the wheel, the trackpad, the finger) */
.ticker-dock .td-frame { flex: 1; position: relative; overflow: hidden; background: #fff; }
.ticker-dock iframe { position: absolute; top: 0; left: 0; width: calc(100% + 18px); height: calc(100% + 18px); border: 0; transform-origin: 0 0; }
.ticker-dock.empty .td-frame { display: none; }
.ticker-dock.empty { height: auto; }
@media (max-width: 700px) { .ticker-dock { left: 8px; right: 8px; bottom: 8px; width: auto; height: 46vh; } }
/* the page makes room for the ticker: beside it on a wide screen, under it on a phone */
body.ticker-open { padding-right: calc(var(--td-w) + 24px); }
@media (max-width: 700px) { body.ticker-open { padding-right: 0; padding-bottom: 48vh; } }
/* the scouting mask (full screen) also leaves the ticker its place */
body.ticker-open .mask { right: calc(var(--td-w) + 24px); }
/* on a phone the mask needs the whole screen: the ticker waits under it until the mask is closed */
@media (max-width: 700px) { body.ticker-open .mask { right: 0; } body.mask-on .ticker-dock { display: none; } }
/* on a wide screen the ticker is as tall as the window */
@media (min-width: 701px) { .ticker-dock:not(.empty) { top: 12px; bottom: 12px; height: auto; } }

:root { --td-w: clamp(440px, 32vw, 600px); } /* the ticker page needs about this width, or it scrolls sideways */

/* the SAMS ticker link over the scouting mask, under its head */
.mask-link { position: absolute; z-index: 3; top: calc(64px + env(safe-area-inset-top, 0px)); right: 16px; width: min(460px, calc(100% - 32px));
  background: var(--mk-btn); border: 1px solid var(--mk-line); border-radius: 14px; padding: 12px; display: grid; gap: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.mask-link label { font-size: .85rem; color: var(--mk-muted); margin: 0; }
.mask-link input { width: 100%; box-sizing: border-box; min-height: 44px; font-size: 16px; color: var(--mk-fg); background: var(--mk-bg); border: 1px solid var(--mk-line); border-radius: 10px; padding: 0 10px; }
.mask-link .btn-row { display: flex; gap: 8px; justify-content: flex-end; margin: 0; }
.mask-link .btn-row button { min-height: 40px; padding: 0 14px; }
.mask-link .btn-row button.primary { background: var(--mk-fg); color: var(--mk-bg); border-color: var(--mk-fg); }

/* rotation planner (Analisi rotazioni): the six and the marks side by side, then the grid of the 6 rotations as in the Excel */
.rp-top { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 16px; align-items: start; }
.rp-top > .card { margin-top: 0; margin-bottom: 0; }
@media (max-width: 900px) { .rp-top { grid-template-columns: minmax(0, 1fr); } }
.rp-hint { font-size: .8rem; margin: 10px 0 0; }
.rp-chips { margin: 0 0 8px; }
.rp-namerow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.rp-namerow input { flex: 1 1 140px; min-width: 0; }
.rp-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.rp-court { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 8px; background: var(--court); border: 2px solid var(--court-line); border-top-width: 5px; }
.rp-net { grid-column: 1 / -1; text-align: center; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.rp-zone { display: flex; align-items: center; gap: 4px; min-width: 0; }
.rp-zone > span { font-size: .7rem; color: var(--muted); width: 1em; text-align: center; flex: none; }
.rp-zone select { flex: 1; min-width: 0; font-size: .85rem; padding-left: 4px; padding-right: 2px; }
.rp-roles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.rp-roles label { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: .8rem; }
.rp-roles select { min-width: 0; width: 100%; font-size: .85rem; }
.rp-heat[style] { background: hsl(var(--heat) 70% 50% / .22); }
:root[data-theme="dark"] .rp-heat[style] { background: hsl(var(--heat) 60% 45% / .32); }
.rp-marks { border-collapse: separate; border-spacing: 2px; font-size: .82rem; width: 100%; }
.rp-marks th { font-size: .68rem; font-weight: 600; color: var(--muted); padding: 2px; text-align: center; white-space: nowrap; }
.rp-marks td { padding: 0; text-align: center; }
.rp-marks td.rp-who { text-align: left; white-space: nowrap; padding-right: 8px; color: var(--muted); }
.rp-marks tr.on td.rp-who { color: var(--text); }
.rp-marks input.rp-mark { width: 100%; min-width: 2.2em; height: 28px; min-height: 0; border-radius: 0; padding: 0; text-align: center; border: 0; background: transparent; font: inherit; color: var(--text); -moz-appearance: textfield; }
.rp-marks input.rp-mark::-webkit-outer-spin-button, .rp-marks input.rp-mark::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rp-marks input.rp-mark::placeholder { color: var(--text); opacity: .55; }
.rp-marks input.rp-mark.own { font-weight: 700; text-decoration: underline; }
.rp-marks input.rp-mark:focus { outline: 2px solid var(--sel); }
.rp-grid-t { border-collapse: separate; border-spacing: 0 3px; width: 100%; font-size: .9rem; }
.rp-grid-t th { font-size: .72rem; font-weight: 600; color: var(--muted); text-align: center; padding: 2px 6px; white-space: nowrap; }
.rp-grid-t th:nth-child(-n+3) { text-align: left; }
.rp-grid-t td { padding: 7px 8px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); white-space: nowrap; }
.rp-grid-t td.rp-heat { text-align: center; font-variant-numeric: tabular-nums; width: 3.6em; }
.rp-grid-t td.tot { font-weight: 700; font-size: 1.05rem; }
.rp-grid-t tr > td:first-child { border-left: 4px solid transparent; }
.rp-grid-t tr.best > td:first-child { border-left-color: var(--us-score); }
.rp-grid-t tr.worst > td:first-child { border-left-color: var(--them); }
.rp-rotn b { font-size: 1.05rem; }
.rp-tag { display: block; font-size: .62rem; font-weight: 700; text-transform: uppercase; }
.rp-tag.good { color: var(--us-score); } .rp-tag.weak { color: var(--them); }
.rp-line { white-space: nowrap; }
.rp-p { display: inline-block; margin-right: 10px; }
.rp-p b { font-variant-numeric: tabular-nums; }
.rp-p.setter { padding: 0 4px; outline: 2px solid var(--us-score); outline-offset: 0; }
.rp-p.server::before { content: '\f45f'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: .7rem; color: var(--muted); margin-right: 3px; }
.rp-grid-t tr.mean td { font-weight: 700; border-top: 2px solid var(--text); }
.rp-recv-edit select, .rp-zone select, .rp-roles select { min-height: 34px; padding-top: 4px; padding-bottom: 4px; }
.rp-recv-btn { display: flex; gap: 4px; align-items: center; background: none; border: 0; padding: 0; cursor: pointer; color: inherit; font: inherit; height: auto; min-height: 0; }
.rp-recv-btn > span { padding: 3px 6px; font-size: .82rem; }
.rp-recv-btn > span small { color: var(--muted); }
.rp-recv-btn:hover > span { outline: 1px solid var(--border); }
.rp-auto { font-size: .68rem; }
.rp-recv-edit { display: flex; gap: 6px; align-items: end; }
.rp-recv-edit label { display: flex; flex-direction: column; gap: 1px; }
.rp-recv-edit select { font-size: .8rem; min-width: 7em; max-width: 9em; }
.rp-recv-btn .nr { display: none; }
.rp-grid-t td.rp-form div { white-space: nowrap; }
.rp-grid-t td.rp-form div + div { margin-top: 3px; padding-top: 3px; border-top: 1px dashed var(--border); }
.rp-grid-t tr.grp th { padding-bottom: 0; }
.rp-grid-t th.rp-g { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text); border-bottom: 2px solid var(--border); }
.rp-grid-t th.rp-g.so { border-bottom-color: var(--us-score); } .rp-grid-t th.rp-g.br { border-bottom-color: var(--them); }
.rp-grid-t td.ph { font-weight: 700; }
.rp-grid-t td.tot { border-left: 2px solid var(--border); }
.rp-grid-t td.rp-real { font-size: .82rem; }
.rp-grid-t td.rp-real small { display: block; font-size: .62rem; color: var(--muted); }
.rp-natk { font-size: .62rem; color: var(--muted); margin-left: 2px; }
.rp-marks input[type=checkbox] { width: 18px; height: 18px; min-height: 0; padding: 0; margin: 0; vertical-align: middle; }
@media (max-width: 700px) {
  .rp-grid-t { font-size: .85rem; }
  .rp-grid-t td { padding: 6px 5px; }
  .rp-grid-t .nm, .rp-auto { display: none; }
  .rp-p { margin-right: 6px; }
  .rp-recv-btn .nr { display: inline; }
  .rp-recv-btn { flex-direction: column; align-items: stretch; gap: 2px; }
  .rp-recv-btn > span { padding: 1px 4px; font-size: .78rem; }
  .rp-grid-t td.rp-heat { width: auto; }
  .rp-recv-edit { flex-direction: column; align-items: stretch; }
}
.rp-libfor { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 8px; font-size: .8rem; }
.rp-p.libero { padding: 0 4px; background: var(--tint-yellow, #fff1c2); }
.rp-swap { color: var(--muted); font-size: .75rem; margin: 0 3px 0 -6px; }
.rp-sys { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 10px; font-size: .8rem; }
.rp-p.setter2 { padding: 0 4px; outline: 1px dashed var(--muted); }

/* the «Scout» bookmark to drag into the favourites bar: looks like a primary button */
a.tk-bm { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 10px 18px; border-radius: 10px;
  background: var(--primary); color: var(--primary-text); border: 1px solid var(--primary); font-weight: 600; text-decoration: none; cursor: grab; }
/* what was read from the ticker text: on top, framed, a short flash when it appears */
.card.tk-found { border: 2px solid var(--primary); }
.card.tk-found.flash { animation: tk-flash 1.2s ease-out; }
@keyframes tk-flash { 0% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 45%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* after «Fehler Gegner»: which error, the guess already chosen */
.opp-err { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 22px; margin: 10px 0 4px; }
.opp-err .mask-label { margin: 0 4px 8px 0; }
.oe-group small { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 3px 2px; }
.oe-seg { display: flex; gap: 5px; }
.opp-err button { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.opp-err button.sel { background: var(--primary); color: var(--primary-text); border-color: var(--primary); font-weight: 600; }
/* a picked player's new shirt number: one line (label, short field, button), in place of the hint */
.fix-row.renum { flex-wrap: nowrap; }
.fix-row.renum .mask-label { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fix-row.renum input { flex: 0 0 5.5em; width: 5.5em; margin: 0; min-height: 52px; text-align: center; font-size: 1.1rem; font-weight: 700; }
.mask .fix-row.renum > button { flex: 1 1 auto; }
@media (max-width: 700px) { .fix-row.renum { flex-wrap: wrap; } .fix-row.renum .mask-label { flex-basis: 100%; } }
/* team drawer on a wide screen: the players on court in two (four) columns at the bench cards' height, the same size
   whatever appears below (rotation, score, serve, new number); it scrolls when the window is very low */
@media (min-width: 701px) {
  .team-body .mask-players { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 64px; align-content: start; overflow: auto; }
}
@media (min-width: 1000px) { .team-body .mask-players { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* 6v6: the players on court as on the court, the net on top: 4 3 2 / 5 6 1 */
.team-body .mask-players.court6 { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(60px, 96px)); grid-auto-rows: unset; align-content: start;
  border-top: 4px solid var(--mk-fg); padding-top: 10px; row-gap: 14px; }
@media (max-width: 999px) {
  .team-body .mask-players.court6 .kp-player { grid-template-columns: 1fr; text-align: center; padding: 4px; gap: 0; }
  .team-body .mask-players.court6 .kp-player .num { grid-row: auto; font-size: 1.9rem; line-height: 1; }
  .team-body .mask-players.court6 .kp-player .tag { display: none; }
}
/* the opponent's errors by kind, under our points (statistics) and in the report */
.dash .dash-sub { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 14px 0 6px; }
.dash .fill.f-opperr { background: var(--c4); }
.roe { margin: 6px 0 0; font-size: .85rem; }
/* phone: the team drawer scrolls as one page, so the players on court take their own height (no overlap with the rows below) */
@media (max-width: 700px) {
  .team-body .mask-stack { display: block; }
  .team-body .mask-players.court6 { grid-template-rows: none; grid-auto-rows: minmax(64px, auto); overflow: visible; }
  .team-body .mask-stack > * + * { margin-top: 8px; }
}
@media (max-width: 700px) { .opp-err .mask-label { flex-basis: 100%; margin-bottom: 0; } }
/* the opponent's errors in the opponent card (outside the .dash page) */
.bench-opperr .track { position: relative; display: block; height: 10px; background: var(--bg); border-radius: 4px; }
.bench-opperr .fill { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 4px; background: #eda100; }
/* Recording while the scouting mask is open: a small bar in the empty middle of the mask's header (red dot, time, stop),
   never over the buttons; the camera shows when tapped (big), the fixed camera needs no watching while scouting */
body.mask-on #recBox:not(.big) { bottom: auto; right: auto; width: auto; white-space: nowrap; border-radius: 10px; } /* top/left: its slot in the header (recPlace) */
.mask-head .rec-slot { flex: 1 1 0; min-width: 170px; height: 30px; } /* the free middle of the header */
@media (max-width: 700px) { .mask-head:has(.rec-slot) { flex-wrap: wrap; } .mask-head .rec-slot { order: 99; flex: 0 0 100%; } }
body.mask-on #recBox:not(.big) video { display: none; }
body.mask-on #recBox:not(.big) .rec-bar { padding: 4px 10px; }
body.mask-on #recBox.big { top: 60px; bottom: auto; }

/* details after an action (serve type, reception, set, attack, block): one small title per group */
.att-g { display: flex; flex-direction: column; gap: 3px; }
.att-g > small { font-size: .72rem; opacity: .75; text-transform: uppercase; letter-spacing: .03em; }
.att-detail { gap: 6px 18px; }
/* in the mask one row (the title beside its buttons) so the players above keep their height */
.att-detail.in-mask .att-g { flex-direction: row; align-items: center; gap: 6px; }
.att-detail.in-mask .att-g > small { color: var(--mk-muted); opacity: 1; }
/* the details of the last action sit on top of «Wie», under its title: the players keep their height */
/* in place of the grades: big buttons, one group per row, «skip» at the end */
.mask-det { min-height: 0; overflow: auto; border: 1px dashed var(--mk-line); border-radius: 14px; padding: 12px; }
.mask-det .att-detail.in-mask { flex-direction: column; flex-wrap: nowrap; min-height: 100%; align-items: stretch; gap: 12px; border-top: 0; padding: 0; margin: 0; }
.mask-det .att-lbl { font-size: 1.05rem; color: var(--mk-fg) !important; }
.mask-det .att-g { flex-direction: column !important; align-items: stretch !important; gap: 4px !important; }
.mask-det .att-group { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.mask-det .att-detail.in-mask .att-group button { min-height: 64px; font-size: 1.2rem; font-weight: 700; }
.mask-det .att-detail.in-mask .att-skip { align-self: flex-end; margin-top: auto; min-height: 44px; font-size: 1rem; background: transparent; }

/* all exercises on one page: cards with the drawing, chosen ones marked, a bar to use them */
.tl-card { cursor: default; }
.tl-card [data-act="trainLibShow"]:not(button) { cursor: pointer; }
.tl-card.tl-on { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.tl-draw { display: block; line-height: 0; border: 1px solid var(--border); }
.tl-draw svg { width: 100%; height: auto; display: block; }
.tl-text { white-space: pre-line; overflow-wrap: anywhere; font-size: .92rem; }
.tl-card:not(.tl-open) .tl-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tl-bar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; background: var(--card); border-top: 2px solid var(--text); box-shadow: 0 -4px 12px rgba(0,0,0,.08); }
.tl-to { display: inline-flex; gap: 6px; align-items: center; }
.tl-to select { max-width: 220px; }
@media (max-width: 900px) { .tlib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .tlib-grid { grid-template-columns: minmax(0, 1fr); } }
.tl-bar button { white-space: nowrap; }
@media (max-width: 560px) { .tl-bar { gap: 6px; padding: 8px 10px; } .tl-to { flex: 1 1 100%; } .tl-to select { flex: 1; max-width: none; } }

/* scouting mask, 6v6: the players as on the court, the net on top (4 3 2 / 5 6 1), number over name */
.mask-body.court6 { grid-template-columns: minmax(0, 1.25fr) minmax(0, 2fr); }
.mask-body:not(.team-body) .mask-players.court6 { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); grid-auto-rows: unset;
  border-top: 4px solid var(--mk-fg); padding-top: 10px; row-gap: 12px; }
.mask-body:not(.team-body) .mask-players.court6 .kp-player { grid-template-columns: 1fr; grid-template-rows: auto auto auto; text-align: center; padding: 4px; column-gap: 0; justify-items: center; align-content: center; }
.mask-body:not(.team-body) .mask-players.court6 .kp-player .num { grid-row: auto; line-height: 1; }
.mask-body:not(.team-body) .mask-players.court6 .kp-player .name { max-width: 100%; }
@media (max-width: 700px) {
  .mask-body.court6 { grid-template-columns: minmax(0, 1fr); }
  .mask-body:not(.team-body) .mask-players.court6 { grid-template-rows: none; grid-auto-rows: auto; }
}

/* under the court: the player out for the libero and the bench, small; tap a bench player, then who goes out */
.mask-stack.with-bench { grid-template-rows: auto minmax(0, 1fr) auto; }
.bench-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.bench-row .mask-label { margin: 0 4px 0 6px; letter-spacing: .1em; }
.mask .bench-chip { min-height: 38px; padding: 2px 10px; font-size: .95rem; font-weight: 600; }
.mask .bench-chip b { font-size: 1.15rem; font-weight: 800; }
.mask .bench-chip small { color: var(--mk-muted); font-size: .75rem; }
.mask .bench-chip.sel, .mask .bench-chip.armed { background: var(--mk-fg); color: var(--mk-bg); border-color: var(--mk-fg); }
.mask .bench-chip.armed small, .mask .bench-chip.sel small { color: inherit; }

/* court keys lower: room under them for the rotation, the player out for the libero and the bench */
.mask-stack.with-bench { grid-template-rows: auto auto auto auto; align-content: start; }
.mask-body:not(.team-body) .mask-players.court6 { grid-template-rows: repeat(2, clamp(64px, 17vh, 130px)); }
.rot-line { margin: 10px 0 0; font-size: 1rem; }
.rot-line b { font-size: 1.15rem; }
.mask .bench-chip.drop-over { outline: 3px solid var(--us); }
@media (max-width: 700px) { .mask-body:not(.team-body) .mask-players.court6 { grid-template-rows: none; } .rot-line { margin-top: 6px; font-size: .9rem; } }
/* bigger again: court keys and bench (v438) */
.mask-body:not(.team-body) .mask-players.court6 { grid-template-rows: repeat(2, clamp(84px, 22vh, 180px)); }
.mask .bench-chip { min-height: 52px; padding: 4px 14px; font-size: 1.1rem; }
.mask .bench-chip b { font-size: 1.5rem; }
.mask .bench-chip small { font-size: .85rem; }
.bench-row { gap: 8px; }
@media (max-width: 700px) {
  .mask-body:not(.team-body) .mask-players.court6 { grid-template-rows: none; grid-auto-rows: minmax(64px, auto); }
  .mask .bench-chip { min-height: 46px; padding: 2px 10px; font-size: 1rem; }
  .mask .bench-chip b { font-size: 1.3rem; }
}
/* the court takes the room the rotation line and the bench leave (a long bench never covers it) */
.mask-stack.with-bench { grid-template-rows: auto minmax(0, 1fr) auto auto; align-content: stretch; }
.mask-body:not(.team-body) .mask-players.court6 { grid-template-rows: repeat(2, minmax(0, 1fr)); max-height: 400px; }
@media (max-width: 700px) {
  .mask-stack.with-bench { grid-template-rows: auto auto auto auto; }
  .mask-body:not(.team-body) .mask-players.court6 { grid-template-rows: none; max-height: none; }
  /* phone: the bench in one row that scrolls sideways */
  .bench-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .bench-row > * { flex: none; }
}
/* «Ändern» panel: the right side scrolls as one (court, rotation, score, setter, libero, serve), the court keeps its height */
@media (min-width: 701px) {
  .team-body > .mask-stack:not(.bench-col) { display: block; overflow: auto; }
  .team-body > .mask-stack:not(.bench-col) > * + * { margin-top: 8px; }
  .team-body .mask-players.court6 { grid-template-rows: repeat(2, 84px); overflow: visible; }
}
.fix-row select { width: auto; min-width: 180px; }
.fix-lib .lib-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fix-lib .lib-line > span:first-child { font-size: .85rem; text-transform: uppercase; letter-spacing: .18em; color: var(--mk-muted); }

/* live mask: the rally's steps on top (done / now), the step's grades big */
.live-right { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.live-right .mask-results { flex: 1; min-height: 0; }
.live-steps { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 700; font-size: 1rem; letter-spacing: .06em; }
.live-steps > span { padding: 4px 10px; border-radius: 99px; border: 1px solid var(--mk-line); color: var(--mk-muted); }
.live-steps > span.done { color: var(--mk-fg); text-decoration: line-through; opacity: .6; }
.live-steps > span.now { background: var(--mk-fg); color: var(--mk-bg); border-color: var(--mk-fg); }
.live-steps > span.grow { border: 0; padding: 0; }
.live-steps i { font-style: normal; color: var(--mk-muted); }
.live-steps button { min-height: 44px; }
.live-title { font-size: 1.05rem; letter-spacing: .04em; text-transform: none; color: var(--mk-fg); font-weight: 700; margin: 0; }
.live-pick { display: flex; gap: 8px; }
.mask .live-pick button { flex: 1; min-height: 52px; font-size: 1.15rem; font-weight: 800; }
.mask .live-pick button.sel { background: var(--mk-fg); color: var(--mk-bg); }
/* the court never squeezes below a readable height: a long bench scrolls instead */
@media (min-width: 701px) {
  .mask-stack.with-bench { grid-template-rows: auto auto auto minmax(0, 1fr); }
  .mask-body:not(.team-body) .mask-players.court6 { grid-template-rows: repeat(2, clamp(88px, 19vh, 190px)); max-height: none; }
  .mask-stack.with-bench .bench-row { overflow-y: auto; align-content: flex-start; min-height: 0; }
  /* the header in one row: the chips shrink, the buttons keep their size */
  .mask-head { flex-wrap: nowrap; }
  .mask-head .chip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex-shrink: 1; }
  .mask-head .mask-btn { flex-shrink: 0; }
}
@media (min-width: 701px) { .mask-head .mask-score { white-space: nowrap; flex-shrink: 0; } }

/* live: the rally's end as two rows of normal buttons (no giant tiles) */
.live-end { display: flex; flex-direction: column; gap: 6px; }
.live-end .mask-label { margin: 6px 0 0; }
.live-end-row { display: flex; flex-wrap: wrap; gap: 8px; }
.mask .live-end-btn { min-height: 64px; padding: 6px 18px; font-size: 1.15rem; font-weight: 800; flex: 0 1 auto; min-width: 140px; }
.mask .live-end-btn.win { background: var(--us); color: #0a0a0a; border-color: var(--us); }
.mask .live-end-btn.win.soft { background: transparent; color: var(--mk-fg); }
.mask .live-end-btn.lose { background: transparent; border: 2px solid var(--them); color: var(--mk-fg); }
.live-right .live-end + * { flex: 0; }

/* live: the grades at a fixed comfortable height, not stretched over the whole column */
@media (min-width: 701px) { .live-right .mask-results { flex: 0 0 auto; grid-auto-rows: clamp(84px, 15vh, 130px); grid-template-rows: none; } }
.mask .live-end-btn.win.soft { background: revert-layer; color: inherit; border-color: var(--us); border-width: 2px; border-style: solid; }
.mask .live-end-btn.lose { background: var(--them); color: #fff; border: 0; }
.live-right { overflow-y: auto; }
@media (max-width: 700px) {
  .mask .live-end-btn { min-width: 0; flex: 1 1 28%; min-height: 50px; padding: 4px 8px; font-size: 1rem; }
  .live-end .mask-label { margin-top: 2px; }
}

/* live end: up to three balanced rows (equal buttons filling the width), each appearing after the one above */
.live-end { gap: 8px; }
.live-end-row { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 8px; animation: liveRowIn .18s ease-out; }
@keyframes liveRowIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.mask .live-end-btn { min-width: 0; min-height: 76px; padding: 4px 8px; }
.mask .live-end-btn.win { background: transparent; color: var(--mk-fg); border: 2px solid var(--us); }
.mask .live-end-btn.lose { background: transparent; color: var(--mk-fg); border: 2px solid var(--them); }
.mask .live-end-btn.win.on, .mask .live-end-row:not(:first-child) .live-end-btn.win { background: var(--us); color: #0a0a0a; }
.mask .live-end-btn.lose.on, .mask .live-end-row:not(:first-child) .live-end-btn.lose { background: var(--them); color: #fff; }
.mask .live-end-row:nth-child(2) .live-end-btn.lose.on { box-shadow: inset 0 0 0 3px var(--mk-fg); }
@media (max-width: 700px) { .mask .live-end-btn { min-height: 54px; font-size: .95rem; flex: none; } .live-end-row { gap: 6px; } }
.mask .live-end-btn.win:not(.on) { box-shadow: inset 0 0 0 3px var(--us); }
.mask .live-end-btn.lose:not(.on) { box-shadow: inset 0 0 0 3px var(--them); }
.mask .live-end-row:not(:first-child) .live-end-btn { box-shadow: none; }
.mask .live-end-row:nth-child(2) .live-end-btn.lose.on { box-shadow: inset 0 0 0 4px var(--mk-fg); }
@media (max-width: 700px) { .mask .live-end-btn { font-size: .85rem; padding: 2px 4px; overflow-wrap: anywhere; line-height: 1.15; } }
@media (max-width: 700px) { .mask .live-end-btn { overflow-wrap: normal; hyphens: auto; font-size: .78rem; } }
/* Monitor: one card per player, a chart per skill (efficiency after each touch) */
.mon h3 { margin: 16px 0 8px; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mon-grid-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .mon-grid-cards { grid-template-columns: minmax(0, 1fr); } }
.mon-card { border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.mon-card > :last-child { border-radius: 0 0 12px 12px; }
.mon-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
/* the player's head stays on top while scrolling through his charts, until the next card */
.mon-head { position: sticky; top: 0; z-index: 3; background: var(--card); border-radius: 12px 12px 0 0; }
.mon-num { font-weight: 700; font-size: 1.05rem; min-width: 2em; text-align: center; }
.mon-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mon-who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mon-who small { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.mon-pts { display: flex; flex-direction: column; gap: 3px; width: 92px; }
.mon-bar { display: flex; height: 5px; border-radius: 3px; overflow: hidden; background: var(--border); }
.mon-bar .w { background: var(--us); } .mon-bar .l { background: var(--them); }
.mon-pts small { display: flex; justify-content: space-between; font-size: .7rem; }
.mon-pts .w { color: var(--us); } .mon-pts .l { color: var(--them); }
.mon-bal { min-width: 2.6em; text-align: center; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--border); }
.mon-bal.mon-bal-pos { background: rgba(26, 158, 75, .14); color: #138040; border-color: transparent; }
.mon-bal.mon-bal-neg { background: rgba(214, 48, 30, .12); color: #b3261a; border-color: transparent; }
.mon-skill { padding: 10px 12px 8px; border-top: 1px solid var(--border); }
.mon-skill:first-of-type { border-top: 0; }
.mon-sk-head { display: flex; align-items: baseline; gap: 8px; }
.mon-sk-head > b:first-child { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.mon-sk-head small { color: var(--muted); font-weight: 400; text-transform: none; }
.mon-n { font-size: .75rem; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; }
.mon-val { margin-left: auto; font-size: 1.25rem; }
.mon-val.good { color: var(--us); } .mon-val.mid { color: #c98a00; } .mon-val.weak { color: var(--them); }
.mon-range { display: flex; align-items: center; gap: 6px; margin: 4px 0 2px; font-size: .7rem; color: var(--muted); }
.mon-track { flex: 1; position: relative; height: 2px; background: var(--border); }
.mon-track i { position: absolute; top: -5px; width: 10px; height: 10px; margin-left: -5px; transform: rotate(45deg); background: var(--muted); }
.mon-track i.good { background: var(--us); } .mon-track i.mid { background: #e0a400; } .mon-track i.weak { background: var(--them); }
.mon-chart { width: 100%; height: auto; display: block; background: color-mix(in srgb, var(--text) 3%, var(--card)); border-radius: 8px; margin-top: 4px; }
.mon-grid { stroke: var(--border); stroke-width: .7; } .mon-grid.zero { stroke: var(--muted); stroke-width: .8; }
.mon-ax { font: 8px Roboto, sans-serif; fill: var(--muted); text-anchor: end; }
.mon-sep { stroke: var(--muted); stroke-width: .8; stroke-dasharray: 3 3; }
.mon-set { font: 8px Roboto, sans-serif; fill: var(--muted); }
.mon-seg { stroke-width: 1.6; stroke-linecap: round; }
.mon-seg.up { stroke: #5cbf7c; } .mon-seg.down { stroke: #e0786c; } .mon-seg.flat { stroke: #b7b7b7; }
.mon-dot { stroke: var(--card); stroke-width: .8; } .mon-dot.early { opacity: .45; }
.e-x { fill: var(--us); background: var(--us); } .e-p { fill: #8ccf8e; background: #8ccf8e; } .e-o { fill: #e8c240; background: #e8c240; }
.e-m { fill: #e08a2c; background: #e08a2c; } .e-s { fill: #a8a8a8; background: #a8a8a8; } .e-e { fill: var(--them); background: var(--them); }
.mon-note { margin-top: 4px; font-size: .75rem; font-weight: 600; }
.mon-note .mon-pos { color: #138040; } .mon-note .mon-neg { color: #b3261a; }
.mon-none { padding: 10px 12px; margin: 0; }
.mon-rest { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .85rem; }
.mon-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: .75rem; color: var(--muted); align-items: center; }
.mon-dot-l { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
/* rotation against rotation */
.xtab th, .xtab td { text-align: center; }
.xtab td { min-width: 52px; }
.xtab td b { display: block; font-size: .85rem; } .xtab td small { color: var(--muted); font-size: .7rem; }
.xtab .x-cell.good { background: rgba(26, 158, 75, .14); } .xtab .x-cell.mid { background: rgba(232, 194, 64, .16); } .xtab .x-cell.weak { background: rgba(214, 48, 30, .13); }
.xtab .x-tot { background: color-mix(in srgb, var(--text) 4%, var(--card)); }
.x-setter { max-width: 320px; }
@media (max-width: 560px) { .mon-ax, .mon-set { font-size: 13px; } .mon-chart { margin-top: 6px; } }
/* play by play */
.pbp-set { margin: 18px 0 8px; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pbp-item { border: 1px solid var(--border); border-left: 4px solid var(--them); border-radius: 10px; padding: 8px 12px; margin: 0 0 8px; background: var(--card); }
.pbp-item.won { border-left-color: var(--us); }
.pbp-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.pbp-score b { font-size: 1.1rem; } .pbp-score small { color: var(--muted); } .pbp-score i { font-size: .7rem; color: var(--muted); }
.pbp-serve { font-size: .8rem; color: var(--muted); }
.pbp-rot { font-size: .75rem; font-weight: 700; border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; }
.pbp-tag { margin-left: auto; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 6px; }
.pbp-tag.so, .pbp-tag.bp { background: rgba(26, 158, 75, .14); color: #138040; }
.pbp-tag.sot, .pbp-tag.bpt { background: rgba(214, 48, 30, .12); color: #b3261a; }
.pbp-touches { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 6px 0 4px; font-size: .85rem; }
.pbp-touch { white-space: nowrap; }
.pbp-arrow { color: var(--muted); font-style: normal; }
.pbp-end { font-size: .85rem; }
.pbp-item.won .pbp-who { color: #138040; } .pbp-item.lost .pbp-who { color: #b3261a; }
.pbp-setend { text-align: center; font-size: .85rem; padding: 8px; margin: 4px 0 10px; border-radius: 8px; background: color-mix(in srgb, var(--text) 5%, var(--card)); }
.pbp-setend.won b { color: #138040; } .pbp-setend.lost b { color: #b3261a; }
.astab th, .astab td { text-align: center; } .astab tr > th:first-child { text-align: left; }
.astab td small { display: block; color: var(--muted); font-size: .7rem; }
/* live: the important things at a glance */
.ls { display: flex; flex-direction: column; gap: 10px; }
.ls-score { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; }
.ls-team { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-team:last-child { text-align: right; }
.ls-sets { font-size: 1.6rem; } .ls-sets small { margin: 0 4px; color: var(--muted); }
.ls-now { text-align: center; } .ls-now small { display: block; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; } .ls-now b { font-size: 2.4rem; line-height: 1.1; }
.ls-chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.ls-set { font-size: .8rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.ls-set.won { background: rgba(26, 158, 75, .14); color: #138040; } .ls-set.lost { background: rgba(214, 48, 30, .12); color: #b3261a; }
.ls-last { display: flex; justify-content: center; align-items: center; gap: 8px; font-size: .75rem; color: var(--muted); }
.ls-last span { display: flex; gap: 4px; } .ls-last i { width: 12px; height: 12px; border-radius: 50%; }
.ls-last i.w { background: var(--us); } .ls-last i.l { background: var(--them); }
.ls-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.ls-kpi { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.ls-kpi small { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ls-kpi b { font-size: 1.5rem; } .ls-kpi span { font-size: .75rem; color: var(--muted); }
.ls-serve { margin: 0; font-size: .85rem; }
.ls-alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: .85rem; }
.ls-alerts li { padding: 6px 10px; border-radius: 8px; }
.ls-alerts li.bad { background: rgba(214, 48, 30, .1); color: #b3261a; } .ls-alerts li.good { background: rgba(26, 158, 75, .1); color: #138040; }
/* box score */
.bx th, .bx td { text-align: center; white-space: nowrap; padding-left: 6px; padding-right: 6px; }
.bx .bx-name { text-align: left; }
.bx .bx-sep, .pstats .bx-sep { border-left: 2px solid var(--border); }
.eff-legend { font-size: .85rem; margin-top: 6px; }
.bx .bx-set { padding-left: 3px; padding-right: 3px; }
.bx-pos { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 1.5px solid var(--text); border-radius: 50%; font-size: .75rem; font-weight: 700; }
.bx-pos.setter { background: var(--text); color: var(--card); }
.bx-sub { font-size: .72rem; color: var(--muted); } .bx-lib { font-weight: 700; color: var(--muted); }
.bx-neg { color: #b3261a; }
.bx-idle td { color: var(--muted); }
.bx-sub-row td { font-size: .8rem; color: var(--muted); background: color-mix(in srgb, var(--text) 3%, var(--card)); }
.bx-open { min-height: 0; padding: 0 6px 0 0; border: 0; background: none !important; box-shadow: none; color: var(--muted); }
.bx-won { color: #138040; font-weight: 700; } .bx-lost { color: #b3261a; font-weight: 700; }
/* a switch between views inside a tab */
.sub-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.sub-panel { display: none; } .sub-panel.on { display: block; }
@media print { .sub-panel { display: block; } .sub-panel h2.print-only { display: block; } }
.rot-turns > summary { cursor: pointer; font-weight: 700; }
.mon-bar-opts { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 12px; }
.mon-sw { display: inline-flex; gap: 6px; }
.mon-team { margin-bottom: 4px; }
.mon-team-skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mon-team-skills .mon-skill:nth-child(2) { border-top: 0; }
.mon-team-skills .mon-skill:nth-child(odd) { border-right: 1px solid var(--border); }
@media (max-width: 760px) { .mon-team-skills { grid-template-columns: minmax(0, 1fr); } .mon-team-skills .mon-skill:nth-child(2) { border-top: 1px solid var(--border); } .mon-team-skills .mon-skill:nth-child(odd) { border-right: 0; } }
.mon-toggle { min-height: 0; padding: 4px 8px; border: 0; background: none !important; box-shadow: none; color: var(--muted); }
.mon-card.shut .mon-head { border-bottom: 0; }
.pbp-top[data-act] { cursor: pointer; }
.pbp-more { color: var(--muted); font-size: .8rem; }
.pbp-tally { color: var(--muted); font-size: .8rem; }
.pbp-court { display: inline-grid; gap: 4px; margin: 8px 0 2px; padding: 0 6px 6px; border: 1.5px solid var(--text); border-top: 0; background: color-mix(in srgb, var(--text) 3%, var(--card)); }
.pbp-court .net { height: 3px; background: var(--text); margin: 0 -6px 2px; }
.pbp-court .row { display: grid; grid-template-columns: repeat(3, 34px); gap: 6px; }
.pbp-court span { display: flex; align-items: center; justify-content: center; height: 28px; border: 1px solid var(--border); border-radius: 6px; background: var(--card); font-weight: 700; font-size: .85rem; }
.pbp-court span.st { background: var(--text); color: var(--card); }
.pbp-court span.srv { outline: 2px solid #e0a400; }
.press > summary { cursor: pointer; font-weight: 700; }
.press textarea { width: 100%; font: inherit; line-height: 1.45; resize: vertical; }
.bx th.bx-won { color: #138040; } .bx th.bx-lost { color: #b3261a; }
/* view switches (Tabellino | Forma, Ganzes Spiel | Letzte 10, …): one joined group each, aligned with the cards */
.sub-tabs, .mon-sw { display: inline-flex; flex-wrap: nowrap; gap: 2px; padding: 3px; background: var(--well, color-mix(in srgb, var(--text) 6%, var(--card))); border-radius: var(--radius, 0); }
.sub-tabs { margin: 0 0 12px; }
.sub-tabs button, .mon-sw button { margin: 0; border-color: transparent; box-shadow: none; white-space: nowrap; }
.sub-tabs button:not(.primary), .mon-sw button:not(.primary) { background: transparent; }
.mon-bar-opts { align-items: center; }
.sub-tabs, .mon-sw { border-radius: 999px; padding: 4px; }
.sub-tabs button, .mon-sw button { display: inline-flex; align-items: center; justify-content: center; line-height: 1; min-height: 34px; padding: 0 14px; }
.sub-tabs button, .mon-sw button { padding-top: 3px; }
/* Formkurve compact: a table, a row per player */
.mon-tbl { border-collapse: collapse; width: 100%; font-size: .9rem; margin-bottom: 8px; }
.mon-tbl th { font-size: .7rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 6px 6px; text-align: center; white-space: nowrap; }
.mon-tbl tr.group th { background: color-mix(in srgb, var(--text) 4%, var(--card)); }
.mon-tbl td { padding: 8px 6px; border-top: 1px solid var(--border); text-align: center; white-space: nowrap; vertical-align: middle; }
.mon-tbl .mon-t-sep { border-left: 1px solid var(--border); }
.mon-tbl .mon-t-num { color: var(--muted); font-weight: 700; width: 28px; }
.mon-tbl .mon-t-name { text-align: left; position: sticky; left: 0; background: var(--card); z-index: 1; }
.mon-tbl .mon-t-name small { display: block; font-size: .7rem; color: var(--muted); }
.mon-tbl .mon-t-n { color: var(--muted); font-weight: 600; }
.mon-tbl .mon-t-none { color: var(--muted); }
.mon-tbl .mon-t-spark { width: 120px; padding-left: 2px; padding-right: 2px; }
.mon-spark { display: block; width: 120px; height: 22px; }
.mon-spark polyline { fill: none; stroke: var(--muted); stroke-width: 1.8; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.mon-spark.good polyline { stroke: var(--us); } .mon-spark.mid polyline { stroke: #c98a00; } .mon-spark.weak polyline { stroke: var(--them); }
.mon-tbl .mon-t-val { font-weight: 800; font-size: 1rem; }
.mon-tbl .mon-t-l10 { font-size: .8rem; font-weight: 600; color: var(--muted); }
.mon-tbl .good { color: var(--us); } .mon-tbl .mid { color: #c98a00; } .mon-tbl .weak { color: var(--them); }
.mon-tbl { width: auto; }
.mon-tbl.tight .mon-t-spark, .mon-tbl.tight .mon-spark { width: 72px; }
.mon-tbl td, .mon-tbl th { padding-left: 5px; padding-right: 5px; }
.mon-tbl .mon-t-name > span { display: inline-block; vertical-align: middle; }
.mon-tbl .mon-t-name .mon-t-num { width: 26px; color: var(--muted); font-weight: 700; }
.mon-tbl .mon-t-spark, .mon-spark { width: 100px; }
.mon-tbl.tight .mon-t-spark, .mon-tbl.tight .mon-spark { width: 64px; }
/* time-outs: in the team panel, the log and the set chart */
.to-row button small { opacity: .7; margin-left: 4px; }
.log li.to-log { font-weight: 700; }
.tl-to-list { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 4px 0 8px; font-size: .85rem; color: var(--muted); }
.tl-to-list .us b { color: var(--us-score); } .tl-to-list .them b { color: var(--them); }
.to-pop .to-choice { justify-content: stretch; }
.to-pop .to-choice button { flex: 1; min-height: 56px; font-size: 1.05rem; font-weight: 700; }
.to-pop .to-choice button.us { background: var(--us-score); color: #fff; border-color: var(--us-score); }
.to-pop .to-choice button.them { background: var(--them); color: #fff; border-color: var(--them); }
.to-pop .to-choice small { opacity: .85; margin-left: 6px; }
/* exercise progressions: more drawings of one exercise */
.dr-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.dr-steps .sub-tabs { margin: 0; }
.dr-step-text { margin: 0 0 10px; }
.dr-step-text input { width: 100%; box-sizing: border-box; }
.dr-prog { display: block; margin-top: 8px; }
.dr-prog-l { display: block; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.tl-progs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.tl-progs .tl-prog svg { width: 100%; height: auto; }
/* the drawing and its progressions side by side, wrapping when there is no room */
.tr-draws { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: flex-start; }
.tr-draws:empty { display: none; }
.tr-draws .tr-row-draw { flex: 0 1 260px; min-width: 0; }
@media print { .tr-draws .tr-row-draw { flex-basis: 240px; } }
/* a player again at a later place: the small number beside the circle */
.dr-p text.dr-k { font: 800 .42px Roboto, sans-serif; fill: var(--text, #111); stroke: var(--card, #fff); stroke-width: .12px; paint-order: stroke; text-anchor: middle; }
/* the list of plans on a wide screen: the name on the left, the rest in columns lined up on the right */
@media (min-width: 900px) {
  .tr-grid.tr-list.tr-plans { display: grid; grid-template-columns: minmax(220px, 1fr) repeat(5, auto); column-gap: 18px; }
  .tr-grid.tr-list.tr-plans .tr-card { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center; gap: 0 18px; }
  .tr-grid.tr-list.tr-plans .tr-card > * { margin: 0; grid-column: auto; grid-row: auto; }
  .tr-grid.tr-list.tr-plans .tr-aims { justify-content: flex-start; }
  .tr-grid.tr-list.tr-plans .tr-nex { text-align: right; white-space: nowrap; }
  .tr-grid.tr-list.tr-plans .tr-card-tools { justify-self: end; }
}
.tr-grid.tr-list.tr-plans .tr-who:empty, .tr-grid.tr-list.tr-plans .tr-aims:empty, .tr-grid.tr-list.tr-plans .tr-big-focus:empty { min-height: 0; padding: 0; }
/* season and competition filter of the season view */
.season-filter .hero-chips + .hero-chips { margin-top: 8px; }
.season-filter .season-one { margin: 0; font-weight: 700; }
.comp-list { display: grid; gap: 2px; max-height: 340px; overflow: auto; margin: 8px 0; }
.comp-row { display: grid; grid-template-columns: auto 90px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 4px; border-bottom: 1px solid var(--border); margin: 0; font-weight: 400; }
.comp-row input { width: auto; min-height: 0; margin: 0; }
.comp-set { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.comp-set input { flex: 1 1 220px; max-width: 360px; margin: 0; }
.season-filter .hero-chips { display: flex; width: fit-content; max-width: 100%; margin-left: auto; margin-right: auto; flex-wrap: wrap; }
.comp-row { grid-template-columns: auto 150px minmax(0, 1fr) auto; }
.comp-row > span:first-of-type { white-space: nowrap; }
@media (max-width: 600px) { .comp-row { grid-template-columns: auto minmax(0, 1fr); } .comp-row > span:first-of-type { grid-column: 2; } .comp-row b, .comp-row .muted { grid-column: 2; } }
/* lead rally by rally (above the box score): fine lines, a grid line at every point */
.mo-chart { width: 100%; height: auto; display: block; font-feature-settings: "tnum"; }
.mo-panel { fill: var(--text); opacity: .025; }
.mo-head { font-size: 11px; font-weight: 600; fill: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.mo-fin { font-size: 13px; font-weight: 700; } .mo-fin.w { fill: var(--us-score); } .mo-fin.l { fill: var(--them); } .mo-fin.o { fill: var(--muted); }
.mo-hdl { stroke: var(--border); stroke-width: 1; }
.mo-grid { stroke: var(--muted); stroke-width: .5; opacity: .18; pointer-events: none; }
.mo-grid.lab { opacity: .38; stroke-dasharray: 2 3; }
.mo-zero { stroke: var(--text); stroke-width: .75; opacity: .55; }
.mo-ax { font-size: 10px; fill: var(--muted); } .mo-ax.us { fill: var(--us-score); } .mo-ax.them { fill: var(--them); }
.mo-up { fill: url(#moGu); stroke: none; } .mo-down { fill: url(#moGd); stroke: none; }
.mo-gu0 { stop-color: var(--us-score); stop-opacity: .32; } .mo-gu1 { stop-color: var(--us-score); stop-opacity: .04; }
.mo-gd0 { stop-color: var(--them); stop-opacity: .3; } .mo-gd1 { stop-color: var(--them); stop-opacity: .04; }
.mo-l { fill: none; stroke-width: 1.25; stroke-linejoin: miter; }
.mo-l.us { stroke: var(--us-score); } .mo-l.them { stroke: var(--them); }
.mo-side { stroke-width: 2; } .mo-side.us { stroke: var(--us); } .mo-side.them { stroke: var(--them); }
.mo-tag { font-size: 9.5px; font-weight: 700; letter-spacing: .14em; } .mo-tag.us { fill: var(--us-score); } .mo-tag.them { fill: var(--them); }
.mo-bar { pointer-events: none; } .mo-bar.us { fill: var(--us); } .mo-bar.them { fill: var(--them); } /* the same colours as the bars of "Wir und sie" */
.mo-run path { fill: none; stroke-width: 1; } .mo-run text { font-size: 10px; font-weight: 700; }
.mo-run.us path { stroke: var(--us); } .mo-run.us text { fill: var(--us-score); } .mo-run.them path { stroke: var(--them); } .mo-run.them text { fill: var(--them); }
.mo-tick { stroke: var(--muted); stroke-width: .75; }
.mo-sc { font-size: 10px; fill: var(--muted); } .mo-sc .us { fill: var(--us-score); font-weight: 600; } .mo-sc .them { fill: var(--them); font-weight: 600; }
.mo-peak circle { stroke: var(--card); stroke-width: 1; } .mo-peak text { font-size: 10px; font-weight: 700; }
.mo-peak.us circle, .mo-peak.us text { fill: var(--us-score); } .mo-peak.them circle, .mo-peak.them text { fill: var(--them); }
.mo-to line { stroke-dasharray: 2 2; stroke-width: .75; }
.mo-to.us line { stroke: var(--us-score); } .mo-to.them line { stroke: var(--them); }
.mo-to.us rect { fill: var(--us-score); } .mo-to.them rect { fill: var(--them); }
.mo-to text { font-size: 7.5px; font-weight: 700; fill: #fff; letter-spacing: .05em; }
.mo-hit { fill: transparent; } .mo-hit:hover { fill: var(--text); opacity: .06; }
.mo-hint { font-size: .85rem; margin: 8px 0 0; }
.lg-table tr.lg-us td { background: color-mix(in srgb, var(--us-score) 10%, transparent); }
.lg-table tr.lg-them td { background: color-mix(in srgb, var(--them) 8%, transparent); }
.lg-day { margin: 10px 0 4px; } .lg-day summary { cursor: pointer; font-weight: 600; font-size: .95rem; }
.lg-games li.lg-mine { font-weight: 600; }
.lg-games li.d b { color: var(--muted); }
.opp-pick { display: flex; align-items: flex-end; gap: 8px; margin: 12px 0 14px; }
.opp-pick label { flex: 1; min-width: 0; margin: 0; }
.opp-pick button { flex: none; margin-bottom: 4px; white-space: nowrap; }
@media (max-width: 560px) { .opp-pick { flex-wrap: wrap; } .opp-pick label { flex-basis: 100%; } }
.lu-ph { display: block; font-size: .7em; color: var(--muted); font-weight: 600; }

/* print of a plan / training: a first page with the list, then one page per exercise */
.tp-doc { color: #000; font-size: 12.5pt; line-height: 1.45; }
.tp-page { break-after: page; padding: 12mm 14mm; box-sizing: border-box; }
.tp-measure { position: absolute; left: -10000px; top: 0; width: 210mm; background: #fff; }
.tp-mm { height: 100mm; width: 1px; }
.tp-page:last-child { break-after: auto; }
.tp-doc h1 { font-size: 1.75em; margin: 0 0 6px; }
.tp-doc h2 { font-size: 1.45em; margin: 4px 0 2px; display: flex; align-items: baseline; gap: 10px; }
.tp-n { display: inline-block; min-width: 1.6em; padding: 0 6px; text-align: center; background: #000; color: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.tp-sub { margin: 2px 0 4px; color: #444; }
.tp-plan { font-size: .76em; color: #555; border-bottom: 1px solid #999; padding-bottom: 3px; margin-bottom: 6px; }
.tp-list { padding-left: 1.6em; margin: 16px 0; font-size: 1.05em; }
.tp-list li { padding: 5px 0; border-bottom: 1px solid #ddd; }
.tp-min { display: inline-block; width: 3em; font-weight: 700; }
.tp-muted { color: #555; font-size: .88em; }
.tp-total { font-size: 1.05em; }
.tp-draw { margin: 10px 0 12px; break-inside: avoid; }
.tp-draw svg { width: 100%; height: auto; max-height: 110mm; display: block; margin: 0 auto; }
.tp-draw svg.dr-half { width: auto; max-width: 100%; }
.tp-doc p { margin: 6px 0; }
.tp-aim { font-size: 1.08em; }
.tp-progs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 8px 0; }
.tp-progs.tp-progs3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tp-prog { display: block; break-inside: avoid; }
.tp-prog small { display: block; font-size: .88em; font-weight: 700; margin-bottom: 2px; }
.tp-prog svg { width: 100%; height: auto; display: block; max-height: 60mm; }
.tp-doc .tr-kar-line { padding: 8px 0 0; font-size: .88em; border-top: 1px solid #999; margin-top: 10px; }
.tp-doc svg, .tp-doc .tr-m { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
@media print { body.print-bench:has(.tp-doc) { margin: 0; padding: 0; border: 0; } body.print-bench #printBox:has(.tp-doc) { margin: 0; padding: 0; } .tp-doc { width: 210mm; } }
.tp-h3 { font-size: 1.1em; margin: 22px 0 8px; }
.tp-people { list-style: none; padding: 0; margin: 0; columns: 3; column-gap: 24px; }
.tp-people li { break-inside: avoid; padding: 5px 0; border-bottom: 1px solid #ddd; display: flex; align-items: center; gap: 8px; }
.tp-box { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border: 1.5px solid #000; font-style: normal; font-weight: 700; font-size: 12px; flex: none; }
/* «Esercizio già usato»: a list with the drawing, the title and the aim */
.tr-pick { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.tr-pick li { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px; border: 1px solid var(--border); border-radius: 10px; }
.tr-pick-draw { display: block; min-height: 1px; }
.tr-pick-draw svg { width: 100%; height: auto; display: block; }
.tr-pick-draw svg.dr-half { max-width: 90px; margin: 0 auto; }
.tr-pick-txt { display: grid; gap: 2px; min-width: 0; }
.tr-pick-t { font-size: 1.02rem; }
.tr-pick-aim { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tr-pick-txt .muted { font-size: .8rem; }
@media (max-width: 560px) { .tr-pick li { grid-template-columns: 96px minmax(0, 1fr); } .tr-pick-add { grid-column: 1 / -1; } }

/* login: the way to the presentation, quiet, as a small framed link (not the browser's blue) */
.intro-link-row { margin: 14px 0 0; }
a.intro-link { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); text-decoration: none; font-size: .92rem; font-weight: 500; background: var(--card); }
a.intro-link .fa-newspaper { color: var(--muted); }
a.intro-link .fa-arrow-right { color: var(--muted); font-size: .8em; transition: transform .15s; }
a.intro-link:hover { border-color: var(--muted); }
a.intro-link:hover .fa-arrow-right { transform: translateX(3px); color: var(--text); }

/* beside the video the players are one column (P1–P6): wide enough for the whole names */
@media (min-width: 1000px) {
  body.with-video .mask-body:not(.team-body) { grid-template-columns: minmax(200px, .8fr) minmax(0, 1.5fr); gap: 10px; }
  body.with-video .mask .mask-head .mask-btn .lbl { display: none; } /* icons only: the score keeps its room */
  body.with-video .mask .mask-head .chip.live, body.with-video .mask .mask-head .chip.rot { display: none; } /* side-out / rotation numbers: no room beside the video */
  body.with-video .mask .mask-head .chip { flex-shrink: 0; }
  body.with-video .mask .mask-players:not(.court6) .kp-player { column-gap: 8px; padding: 4px 10px; min-height: 0; }
  body.with-video .mask .mask-players:not(.court6) .kp-player .num { font-size: clamp(1.8rem, 2.4vw, 2.6rem); min-width: 1.4em; }
}
@media (min-width: 1000px) and (max-width: 1500px) { body.with-video .mask .mask-head .kbd-btn { display: none; } } /* the list opens with «?» too */
@media (min-width: 1000px) and (max-width: 1300px) { body.with-video .mask .mask-head .theme-btn, body.with-video .mask .mask-head .swap-btn { display: none; } }
/* Gegnervergleich: names left and sticky, the selected team marked, form as S/N letters */
.opp-cmp td:first-child, .opp-cmp th:first-child { text-align: left; position: sticky; left: 0; background: var(--card); white-space: nowrap; }
.opp-cmp tr.on td:first-child { box-shadow: inset 3px 0 0 var(--text); }
.opp-cmp td:nth-child(5), .opp-cmp td:nth-child(6) { white-space: nowrap; }
.opp-cmp-form span { display: inline-block; width: 1.3em; font-weight: 700; }
.opp-cmp-form span.good { color: var(--us-score); } .opp-cmp-form span.weak { color: var(--them); }
.opp-grp { margin: 8px 0; }
.opp-grp-new { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.opp-grp-new input { width: auto; flex: 0 1 240px; }
.opp-cmp th .oc-sort { font-weight: 700; text-decoration: none; font-size: inherit; padding: 0; white-space: nowrap; }
.opp-cmp tr.oc-us td { border-top: 2px solid var(--text); }
/* Konto löschen: at the bottom of the profile, closed */
.del-account { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 12px; }
.del-account summary { cursor: pointer; color: var(--them); font-weight: 600; }
.del-account label { max-width: 420px; }
.del-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
/* the public demo: a notice card under the menu (eye icon in the coloured square), with the button on the right */
.notice.demo-note { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; }
.notice.demo-note::before { content: '\f06e'; top: 50%; transform: translateY(-50%); }
.notice.demo-note p { margin: 0; min-width: 220px; flex: 1; }
.notice.demo-note button { margin: 0; }
.demo-entry { margin-top: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
/* Taktiktafel: the whole page like an LCD coaching board: the black court as high as the screen, the white sheet beside */
.tf-page { position: fixed; inset: 0; z-index: 50; background: #e7e9e8; color: #111; display: flex; flex-direction: column; overflow: auto; }
.tf-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; flex-wrap: wrap; }
.tf-bar button { margin: 0; }
.tf-title { font-size: .95rem; }
.tf-main { flex: 1; display: flex; gap: 16px; padding: 0 12px 12px; min-height: 0; }
.tf-board { flex: 0 0 auto; height: calc(100vh - 64px); aspect-ratio: 10.6 / 19.6; max-width: 100%; background: #fff; border: 1px solid #cfd3d1; border-radius: 26px; padding: 14px; box-shadow: 0 2px 12px rgba(0,0,0,.18); }
.tf-svg { display: block; width: 100%; height: 100%; border-radius: 10px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; }
.tf-sheet { flex: 1; min-width: 0; background: #fff; border-radius: 26px; padding: 18px 22px; box-shadow: 0 2px 12px rgba(0,0,0,.18); overflow: auto; height: calc(100vh - 64px); }
.tf-sets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tf-sets button { margin: 0; }
.tf-teams { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-bottom: 18px; }
.tf-name { margin: 0 0 6px; font-weight: 700; font-size: .9rem; }
.tf-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 3px solid #111; }
.tf-c { position: relative; margin: 0; border-right: 2px solid #111; border-bottom: 2px solid #111; }
.tf-c:nth-child(3n) { border-right: 0; } .tf-c:nth-child(n+4) { border-bottom: 0; }
.tf-page .tf-c input { width: 100%; aspect-ratio: 1; min-height: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: #111; text-align: center; font-size: 2rem; font-weight: 700; padding: 0 0 10px; }
.tf-c small { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; font-size: .7rem; color: #888; pointer-events: none; }
.tf-page .tf-line { display: flex; align-items: baseline; gap: 10px; margin: 0 0 4px; color: #111; }
.tf-page .tf-c input, .tf-page .tf-line input { border-radius: 0 !important; }
.tf-page .tf-c input:focus, .tf-page .tf-line input:focus { outline: none; background: #f1f7f3; }
.tf-page .tf-line input { flex: 1; border: 0; border-bottom: 2px solid #111; border-radius: 0; background: transparent; box-shadow: none; color: #111; min-height: 38px; padding: 4px 2px; font-size: 1.05rem; }
.tf-lib { margin: 0 auto 12px; max-width: 320px; }
.tf-page .tf-lib input { text-align: center; font-weight: 700; font-size: 1.3rem; }
.tf-subs-h { text-align: center; margin: 8px 0 4px; }
/* one side at a time: the court in the middle, as high as the screen (or as wide, on a narrow one); the sheet full width */
.tf-only-court { justify-content: center; }
.tf-only-court .tf-board { height: auto; width: min(100%, calc((100vh - 70px) * 0.54)); margin: 0 auto; }
.tf-only-court .tf-board.tf-land { aspect-ratio: 19.6 / 10.6; width: min(100%, calc((100vh - 70px) * 1.85)); }
.tf-main.tf-only-sheet { flex: 1 0 auto; align-items: flex-start; } /* the sheet as long as its content, the page scrolls */
.tf-only-sheet .tf-sheet { max-width: 1000px; margin: 0 auto; height: auto; overflow: visible; }
@media (max-width: 560px) { .tf-teams { grid-template-columns: 1fr; } }
/* 4v4: a diamond of four boxes, each with its own border, the corners empty */
.tf-grid.tf-n4 { border: 0; gap: 8px; max-width: 340px; }
.tf-grid.tf-n4 .tf-c { border: 3px solid #111; }
.tf-grid.tf-n4 .tf-empty { border: 0; }
/* the board's tally: per player and basic skill, + (positive, green) and = (error, red); big for a finger or the pen */
.tf-tally { width: 100%; border-collapse: collapse; margin-top: 18px; color: #111; }
.tf-tally th { text-align: center; font-size: .85rem; padding: 4px; border-bottom: 2px solid #111; }
.tf-tally td { padding: 5px 4px; border-bottom: 1px solid #ddd; text-align: center; }
.tf-tally .tf-who { text-align: left; white-space: nowrap; font-size: .95rem; }
.tf-pm { display: inline-flex; gap: 6px; }
.tf-page .tf-pm button, .tf-page .tf-pm span { min-width: 64px; min-height: 44px; margin: 0; padding: 4px 10px; font-size: 1.05rem; border-radius: 10px !important; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.tf-page .tf-pm .tf-plus { background: color-mix(in srgb, #1a9e4b 12%, #fff) !important; color: #1a9e4b !important; border: 2px solid #1a9e4b !important; }
.tf-page .tf-pm .tf-err { background: color-mix(in srgb, #d6301e 10%, #fff) !important; color: #d6301e !important; border: 2px solid #d6301e !important; }
.tf-pm b { min-width: 1ch; color: #111; }
.tf-tally .tf-sum td { border-bottom: 0; border-top: 2px solid #111; font-weight: 700; }
.tf-tally .tf-sum .tf-pm span { border-style: dashed; }
/* the sheet: drag a player from the list into the lineup */
.tf-tally .tf-who { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.tf-grip { color: #aaa; margin-right: 6px; font-size: .85em; }
.tf-ghost { position: fixed; z-index: 200; transform: translate(-50%, -60%); pointer-events: none; min-width: 56px; height: 56px; padding: 0 10px;
  border-radius: 28px; background: #111; color: #fff; font-size: 1.6rem; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.tf-page .tf-drop { background: #e3f4ea; outline: 3px solid #1a9e4b; outline-offset: -3px; }
/* the board's snapshots: small courts in a grid, each with when, the score, «on the court» and delete */
.tf-snaps { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; padding: 0 12px 16px; }
.tf-snaps-empty { grid-column: 1 / -1; background: #fff; border-radius: 16px; padding: 18px; color: #555; }
.tf-snap { background: #fff; border-radius: 16px; padding: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.12); display: flex; flex-direction: column; gap: 6px; color: #111; }
.tf-snap-img { aspect-ratio: 10.6 / 19.6; max-height: 260px; margin: 0 auto; border: 1px solid #ddd; border-radius: 8px; overflow: hidden; }
.tf-snap-img.tf-land { aspect-ratio: 19.6 / 10.6; max-height: none; width: 100%; }
.tf-snap-img svg { display: block; width: 100%; height: 100%; }
.tf-snap p { margin: 0; font-size: .85rem; }
.tf-snap-acts { display: flex; gap: 6px; } .tf-snap-acts button { margin: 0; }
.tf-main[hidden] { display: none; }
/* the pen's colours on the board: round dots, the chosen one with a ring */
.tf-pens { display: inline-flex; gap: 8px; align-items: center; padding: 0 4px; }
.tf-page .tf-pen { width: 34px; height: 34px; min-height: 0; padding: 0; margin: 0; border-radius: 50% !important; background: var(--pen) !important; border: 3px solid #fff !important; box-shadow: 0 0 0 1px #bbb; }
.tf-page .tf-pen.on { box-shadow: 0 0 0 3px #111; }

/* reception zones: the team's editor and the court in the mask */
.rz-editor { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.rz-edit { width: min(320px, 100%); touch-action: none; user-select: none; cursor: crosshair; }
.rz-side { flex: 1; min-width: 220px; }
.rz-svg { display: block; width: 100%; height: auto; }
.rz-sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, .25); vertical-align: -1px; }
.mask-results.rz-mode { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); grid-auto-rows: auto; }
.mask-results.rz-mode .rz-court { min-height: 0; display: flex; flex-direction: column; align-items: center; cursor: crosshair; }
.mask-results.rz-mode .rz-court svg { max-height: calc(100% - 26px); width: auto; max-width: 100%; flex: 1 1 auto; background: #ffffff; border-radius: 8px; }
.mask-results.rz-mode .rz-court p { margin: 4px 0 0; font-size: .85rem; color: var(--mk-muted); }
.mask-results.rz-mode .rz-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 8px; min-height: 0; }
