/* ============================================================
   PAPER THEME LAYER - loaded last, every rule scoped to [data-theme="paper"], so the dark theme never sees it.
   Colours come from the token block in css/tokens.css. This file adds what a token cannot:
   1. a grain of paper fibre (a tiny tiled SVG, multiplied into the page)
   2. ink-coloured court lines and flat, hard "print" shadows instead of soft ones
   3. the "ink on a solid team field" remap: inside a red / blue field the text tokens become the cream ink, so a
      tag word, a digit or a quiet line stays readable without every component knowing about the theme
   ============================================================ */

/* 1 · grain (behind the content: .container and the fixed bars sit above it) */
[data-theme="paper"] body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .7; mix-blend-mode: multiply;
  background: url(../media/riso/grain-paper.webp) 0 0 / 520px 520px;   /* the owner's real paper fibres (media/riso, seamless tile) */
}

/* 2 · ink court lines + print shadows */
[data-theme="paper"] .ds-court-bg {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 134 61' fill='none' stroke='%230b2a52' stroke-opacity='.14' stroke-width='.5'%3E%3Crect x='.25' y='.25' width='133.5' height='60.5'/%3E%3Cpath d='M0 4.6H134M0 56.4H134M67 0V61M47.2 0V61M86.8 0V61M7.6 0V61M126.4 0V61M0 30.5H47.2M86.8 30.5H134'/%3E%3C/svg%3E");
}
[data-theme="paper"] :is(.ds-card, .ds-hero, .login-card, .ds-sheet) { box-shadow: 3px 3px 0 rgba(11, 42, 82, .14); }

/* 3 · ink on a solid team field. The list is every component that paints a solid red / blue field. */
[data-theme="paper"] :is(
  .score-panel, .result-win, .vsi-side,
  .lv-team, .idl-team, .court-snum,
  .tv-field, .tv-team, .tv-ev-result,
  .db-kpi.is-red, .db-kpi.is-blue, .rp-hs-red, .rp-hs-blue,
  .wz-stat.is-red, .wz-stat.is-blue, .arc-stat.is-red, .arc-stat.is-blue,
  .cf-result.is-red, .cf-result.is-blue, .fr-stepper, .fr-live.is-red, .fr-live.is-blue,
  .qs-team.red, .qs-team.blue, .cer-stat.is-red, .cer-stat.is-blue, #trophyBg,
  .mb-slot.filled, .mb-chip.picked,
  :where(#mbPoolTabRed:checked) ~ .mb-pooltabs .mb-pooltab.red, :where(#mbPoolTabBlue:checked) ~ .mb-pooltabs .mb-pooltab.blue,   /* only the SELECTED pool tab is a field; the other is a quiet tab on the track */
  #matchNotiResultLine[data-tone="red"], #matchNotiResultLine[data-tone="blue"]
) {
  --t-hi: var(--on-field); --t-mid: var(--on-field); --t-low: var(--on-field);
  --red-text: var(--red-ink); --blue-text: var(--blue-ink); --gold-text: var(--on-field);
  --digit: var(--on-field); --word: var(--on-field);
  --red-lost: var(--field-lost); --blue-lost: var(--field-lost);   /* the losing numeral: cream, one step quieter */
  --ic-ghost: transparent;                                          /* one cream ink on a field: no overprint ghost (section 5) */
}

/* 4 · small marks that carry their own colour on a field. The team shape beside a TV tag is the edge colour in the dark
   theme (red on dark red); on a solid ink field it would vanish, so it takes the cream of the words next to it. */
[data-theme="paper"] :is(.tv-field, .tv-team) .tv-tag::before { background: var(--on-field); }

/* the -1 disc in a scoring panel: a cream face ringed (--edge) and inked (--fill) in the team's own colour; the dark theme's
   --t-hi glyph is cream here, which on the cream face would be invisible. Pressed = the deep ink fill with the cream glyph. */
[data-theme="paper"] .score-btn-minus { background: var(--on-field); color: var(--fill); }
[data-theme="paper"] .score-btn-minus:active { background: var(--fill-hi); color: var(--on-field); }
[data-theme="paper"] .score-btn-minus.is-zero { border-color: var(--on-field); opacity: .6; }   /* nothing to take back */

/* 5 · Riso mis-registration: every line icon is printed in its ink with a thin red ghost a pixel off, like a second drum
   that did not line up. Zero blur, em-based so it scales with the icon; icons on a solid field switch it off (--ic-ghost, section 3). */
[data-theme="paper"] .ds-ic { filter: drop-shadow(.07em .07em 0 var(--ic-ghost, rgba(225, 29, 36, .5))); }

/* the mascot sits on the paper like a print: the same offset navy shadow the cards have */
[data-theme="paper"] .ds-mascot { filter: drop-shadow(2px 3px 0 rgba(11, 42, 82, .16)); }

/* ---- Riso print marks (generated by the owner's brief 2026-10-30: the poster sheet's rough ink lines, as crisp vector) ----
   cards: a hand-inked navy frame with the red plate printed slightly off; rules: crayon line; team fields: ragged printed edge. */
[data-theme="paper"] { --riso-ragged: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22 preserveAspectRatio=%22none%22%3E%3Cpath d=%22M0.80,0.95 L3.32,0.32 L5.85,0.32 L8.37,0.48 L10.89,0.43 L13.42,0.62 L15.94,0.31 L18.46,0.25 L20.98,0.42 L23.51,0.36 L26.03,0.65 L28.55,0.28 L31.08,1.21 L33.60,0.93 L36.12,0.41 L38.65,0.53 L41.17,0.63 L43.69,0.65 L46.22,0.39 L48.74,1.18 L51.26,1.34 L53.78,0.76 L56.31,0.78 L58.83,0.34 L61.35,0.36 L63.88,0.63 L66.40,0.54 L68.92,1.16 L71.45,0.43 L73.97,0.28 L76.49,1.30 L79.02,0.83 L81.54,0.41 L84.06,0.85 L86.58,0.28 L89.11,0.83 L91.63,1.33 L94.15,1.20 L96.68,1.02 L99.20,0.54 L99.05,3.32 L98.83,5.85 L99.50,8.37 L99.24,10.89 L99.51,13.42 L99.01,15.94 L98.90,18.46 L99.54,20.98 L99.73,23.51 L99.59,26.03 L99.54,28.55 L99.55,31.08 L99.46,33.60 L98.90,36.12 L99.22,38.65 L99.04,41.17 L98.68,43.69 L98.68,46.22 L98.96,48.74 L98.94,51.26 L99.41,53.78 L99.70,56.31 L99.14,58.83 L99.68,61.35 L99.74,63.88 L99.70,66.40 L99.05,68.92 L98.89,71.45 L98.90,73.97 L98.87,76.49 L98.87,79.02 L99.34,81.54 L99.64,84.06 L99.57,86.58 L99.18,89.11 L99.37,91.63 L99.53,94.15 L98.74,96.68 L99.38,99.20 L96.68,99.65 L94.15,99.51 L91.63,99.48 L89.11,99.18 L86.58,98.85 L84.06,99.52 L81.54,99.02 L79.02,99.53 L76.49,99.72 L73.97,99.09 L71.45,99.09 L68.92,99.69 L66.40,99.45 L63.88,98.84 L61.35,98.79 L58.83,98.82 L56.31,99.65 L53.78,99.54 L51.26,98.81 L48.74,99.56 L46.22,99.73 L43.69,99.37 L41.17,99.04 L38.65,99.25 L36.12,98.79 L33.60,98.67 L31.08,99.72 L28.55,99.36 L26.03,99.23 L23.51,99.68 L20.98,99.13 L18.46,99.61 L15.94,99.56 L13.42,98.88 L10.89,98.93 L8.37,98.97 L5.85,98.91 L3.32,99.30 L0.80,98.94 L0.71,96.68 L0.39,94.15 L1.25,91.63 L0.64,89.11 L0.75,86.58 L0.89,84.06 L1.24,81.54 L0.71,79.02 L1.26,76.49 L0.80,73.97 L0.84,71.45 L0.83,68.92 L0.27,66.40 L0.73,63.88 L0.45,61.35 L0.25,58.83 L1.13,56.31 L0.44,53.78 L0.77,51.26 L1.05,48.74 L0.86,46.22 L0.61,43.69 L0.82,41.17 L0.86,38.65 L1.11,36.12 L0.37,33.60 L0.87,31.08 L0.52,28.55 L0.55,26.03 L1.10,23.51 L0.81,20.98 L0.87,18.46 L1.09,15.94 L1.25,13.42 L0.74,10.89 L0.92,8.37 L0.81,5.85 L0.81,3.32Z%22 fill=%22%23000%22/%3E%3C/svg%3E"); }
[data-theme="paper"] { --riso-frame: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2264%22 height=%2264%22 viewBox=%220 0 64 64%22 fill=%22none%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M13.0,12.8 L17.2,13.3 L21.4,15.0 L25.6,12.8 L29.8,13.0 L34.0,13.4 L38.2,11.5 L42.4,13.1 L46.6,13.6 L50.8,14.4 L55.0,11.1 L54.1,17.2 L53.0,21.4 L56.5,25.6 L55.9,29.8 L52.8,34.0 L57.3,38.2 L57.2,42.4 L55.7,46.6 L55.6,50.8 L53.4,55.0 L50.8,52.7 L46.6,55.1 L42.4,52.9 L38.2,53.5 L34.0,53.8 L29.8,52.7 L25.6,54.8 L21.4,54.7 L17.2,56.6 L13.0,55.1 L13.7,50.8 L13.0,46.6 L13.8,42.4 L12.8,38.2 L11.9,34.0 L15.4,29.8 L15.4,25.6 L14.6,21.4 L14.0,17.2Z%22 stroke=%22%23e11d24%22 stroke-opacity=%22.6%22 stroke-width=%225%22/%3E%3Cpath d=%22M10.5,9.7 L14.8,9.3 L19.0,9.6 L23.2,8.6 L27.5,11.7 L31.8,10.1 L36.0,12.0 L40.2,10.0 L44.5,12.5 L48.8,12.0 L53.0,8.3 L51.7,14.8 L54.8,19.0 L52.9,23.2 L55.1,27.5 L52.5,31.8 L51.1,36.0 L53.6,40.2 L54.2,44.5 L52.0,48.8 L51.2,53.0 L48.8,52.3 L44.5,55.0 L40.2,54.1 L36.0,51.3 L31.8,51.9 L27.5,51.2 L23.3,51.1 L19.0,54.3 L14.8,51.6 L10.5,53.3 L10.3,48.8 L9.1,44.5 L11.5,40.2 L8.9,36.0 L11.1,31.8 L8.8,27.5 L10.2,23.3 L9.2,19.0 L9.5,14.8Z%22 stroke=%22%230b2a52%22 stroke-opacity=%22.9%22 stroke-width=%226.5%22/%3E%3C/svg%3E"); }
[data-theme="paper"] :is(.ds-card, .idl-next) {
  border: 6px solid transparent; border-radius: 2px;
  border-image: var(--riso-frame) 22 / 6px / 0 stretch;
}
[data-theme="paper"] :is(.idl-team, .tv-team) {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22 preserveAspectRatio=%22none%22%3E%3Cpath d=%22M0.80,0.95 L3.32,0.32 L5.85,0.32 L8.37,0.48 L10.89,0.43 L13.42,0.62 L15.94,0.31 L18.46,0.25 L20.98,0.42 L23.51,0.36 L26.03,0.65 L28.55,0.28 L31.08,1.21 L33.60,0.93 L36.12,0.41 L38.65,0.53 L41.17,0.63 L43.69,0.65 L46.22,0.39 L48.74,1.18 L51.26,1.34 L53.78,0.76 L56.31,0.78 L58.83,0.34 L61.35,0.36 L63.88,0.63 L66.40,0.54 L68.92,1.16 L71.45,0.43 L73.97,0.28 L76.49,1.30 L79.02,0.83 L81.54,0.41 L84.06,0.85 L86.58,0.28 L89.11,0.83 L91.63,1.33 L94.15,1.20 L96.68,1.02 L99.20,0.54 L99.05,3.32 L98.83,5.85 L99.50,8.37 L99.24,10.89 L99.51,13.42 L99.01,15.94 L98.90,18.46 L99.54,20.98 L99.73,23.51 L99.59,26.03 L99.54,28.55 L99.55,31.08 L99.46,33.60 L98.90,36.12 L99.22,38.65 L99.04,41.17 L98.68,43.69 L98.68,46.22 L98.96,48.74 L98.94,51.26 L99.41,53.78 L99.70,56.31 L99.14,58.83 L99.68,61.35 L99.74,63.88 L99.70,66.40 L99.05,68.92 L98.89,71.45 L98.90,73.97 L98.87,76.49 L98.87,79.02 L99.34,81.54 L99.64,84.06 L99.57,86.58 L99.18,89.11 L99.37,91.63 L99.53,94.15 L98.74,96.68 L99.38,99.20 L96.68,99.65 L94.15,99.51 L91.63,99.48 L89.11,99.18 L86.58,98.85 L84.06,99.52 L81.54,99.02 L79.02,99.53 L76.49,99.72 L73.97,99.09 L71.45,99.09 L68.92,99.69 L66.40,99.45 L63.88,98.84 L61.35,98.79 L58.83,98.82 L56.31,99.65 L53.78,99.54 L51.26,98.81 L48.74,99.56 L46.22,99.73 L43.69,99.37 L41.17,99.04 L38.65,99.25 L36.12,98.79 L33.60,98.67 L31.08,99.72 L28.55,99.36 L26.03,99.23 L23.51,99.68 L20.98,99.13 L18.46,99.61 L15.94,99.56 L13.42,98.88 L10.89,98.93 L8.37,98.97 L5.85,98.91 L3.32,99.30 L0.80,98.94 L0.71,96.68 L0.39,94.15 L1.25,91.63 L0.64,89.11 L0.75,86.58 L0.89,84.06 L1.24,81.54 L0.71,79.02 L1.26,76.49 L0.80,73.97 L0.84,71.45 L0.83,68.92 L0.27,66.40 L0.73,63.88 L0.45,61.35 L0.25,58.83 L1.13,56.31 L0.44,53.78 L0.77,51.26 L1.05,48.74 L0.86,46.22 L0.61,43.69 L0.82,41.17 L0.86,38.65 L1.11,36.12 L0.37,33.60 L0.87,31.08 L0.52,28.55 L0.55,26.03 L1.10,23.51 L0.81,20.98 L0.87,18.46 L1.09,15.94 L1.25,13.42 L0.74,10.89 L0.92,8.37 L0.81,5.85 L0.81,3.32Z%22 fill=%22%23000%22/%3E%3C/svg%3E") center / 100% 100% no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22 preserveAspectRatio=%22none%22%3E%3Cpath d=%22M0.80,0.95 L3.32,0.32 L5.85,0.32 L8.37,0.48 L10.89,0.43 L13.42,0.62 L15.94,0.31 L18.46,0.25 L20.98,0.42 L23.51,0.36 L26.03,0.65 L28.55,0.28 L31.08,1.21 L33.60,0.93 L36.12,0.41 L38.65,0.53 L41.17,0.63 L43.69,0.65 L46.22,0.39 L48.74,1.18 L51.26,1.34 L53.78,0.76 L56.31,0.78 L58.83,0.34 L61.35,0.36 L63.88,0.63 L66.40,0.54 L68.92,1.16 L71.45,0.43 L73.97,0.28 L76.49,1.30 L79.02,0.83 L81.54,0.41 L84.06,0.85 L86.58,0.28 L89.11,0.83 L91.63,1.33 L94.15,1.20 L96.68,1.02 L99.20,0.54 L99.05,3.32 L98.83,5.85 L99.50,8.37 L99.24,10.89 L99.51,13.42 L99.01,15.94 L98.90,18.46 L99.54,20.98 L99.73,23.51 L99.59,26.03 L99.54,28.55 L99.55,31.08 L99.46,33.60 L98.90,36.12 L99.22,38.65 L99.04,41.17 L98.68,43.69 L98.68,46.22 L98.96,48.74 L98.94,51.26 L99.41,53.78 L99.70,56.31 L99.14,58.83 L99.68,61.35 L99.74,63.88 L99.70,66.40 L99.05,68.92 L98.89,71.45 L98.90,73.97 L98.87,76.49 L98.87,79.02 L99.34,81.54 L99.64,84.06 L99.57,86.58 L99.18,89.11 L99.37,91.63 L99.53,94.15 L98.74,96.68 L99.38,99.20 L96.68,99.65 L94.15,99.51 L91.63,99.48 L89.11,99.18 L86.58,98.85 L84.06,99.52 L81.54,99.02 L79.02,99.53 L76.49,99.72 L73.97,99.09 L71.45,99.09 L68.92,99.69 L66.40,99.45 L63.88,98.84 L61.35,98.79 L58.83,98.82 L56.31,99.65 L53.78,99.54 L51.26,98.81 L48.74,99.56 L46.22,99.73 L43.69,99.37 L41.17,99.04 L38.65,99.25 L36.12,98.79 L33.60,98.67 L31.08,99.72 L28.55,99.36 L26.03,99.23 L23.51,99.68 L20.98,99.13 L18.46,99.61 L15.94,99.56 L13.42,98.88 L10.89,98.93 L8.37,98.97 L5.85,98.91 L3.32,99.30 L0.80,98.94 L0.71,96.68 L0.39,94.15 L1.25,91.63 L0.64,89.11 L0.75,86.58 L0.89,84.06 L1.24,81.54 L0.71,79.02 L1.26,76.49 L0.80,73.97 L0.84,71.45 L0.83,68.92 L0.27,66.40 L0.73,63.88 L0.45,61.35 L0.25,58.83 L1.13,56.31 L0.44,53.78 L0.77,51.26 L1.05,48.74 L0.86,46.22 L0.61,43.69 L0.82,41.17 L0.86,38.65 L1.11,36.12 L0.37,33.60 L0.87,31.08 L0.52,28.55 L0.55,26.03 L1.10,23.51 L0.81,20.98 L0.87,18.46 L1.09,15.94 L1.25,13.42 L0.74,10.89 L0.92,8.37 L0.81,5.85 L0.81,3.32Z%22 fill=%22%23000%22/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

/* ---- player faces: the owner's hand-inked Riso rings (art-source/riso-kit/G, cut by scripts/riso/slice-frames.py) ----
   The photo is a circle in the avatar box; the ring is a picture placed so its opening (d) sits on the photo (92 %, so the photo
   runs a little under the ink). Three ring drawings per team, picked per player by js/player-photo.js (pav-r0..2). */
[data-theme="paper"] :is(.idl-faces, .lv-faces, .pdir-pod, .pdir-row) .pav { overflow: visible; border: 0; background: none; }
[data-theme="paper"] :is(.idl-faces, .lv-faces, .pdir-pod, .pdir-row) .pav img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; }
[data-theme="paper"] :is(.idl-faces, .lv-faces, .pdir-pod, .pdir-row) .pav-initials { background: radial-gradient(circle, var(--s1) 62%, transparent 63%); }
[data-theme="paper"] :is(.idl-faces, .lv-faces, .pdir-pod, .pdir-row) .pav::after { content: ''; position: absolute; pointer-events: none; background: no-repeat center / 100% 100%; }
[data-theme="paper"] .pav-red.pav-r0::after, [data-theme="paper"] .uavatar.ua-red.ua-r0::after { background-image: url(../media/riso/ring-red-1.webp); width: 136.6%; aspect-ratio: 560 / 557; left: -17.3%; top: -17.8%; }
[data-theme="paper"] .pav-blue.pav-r0::after, [data-theme="paper"] .uavatar.ua-blue.ua-r0::after { background-image: url(../media/riso/ring-blue-1.webp); width: 138.6%; aspect-ratio: 560 / 541; left: -18.5%; top: -15.9%; }
[data-theme="paper"] .pav-red.pav-r1::after, [data-theme="paper"] .uavatar.ua-red.ua-r1::after { background-image: url(../media/riso/ring-red-2.webp); width: 136.3%; aspect-ratio: 560 / 551; left: -17.2%; top: -16.2%; }
[data-theme="paper"] .pav-blue.pav-r1::after, [data-theme="paper"] .uavatar.ua-blue.ua-r1::after { background-image: url(../media/riso/ring-blue-2.webp); width: 136.7%; aspect-ratio: 560 / 552; left: -17.7%; top: -17.7%; }
[data-theme="paper"] .pav-red.pav-r2::after, [data-theme="paper"] .uavatar.ua-red.ua-r2::after { background-image: url(../media/riso/ring-red-3.webp); width: 137.1%; aspect-ratio: 560 / 553; left: -18.2%; top: -17.5%; }
[data-theme="paper"] .pav-blue.pav-r2::after, [data-theme="paper"] .uavatar.ua-blue.ua-r2::after { background-image: url(../media/riso/ring-blue-3.webp); width: 136.3%; aspect-ratio: 560 / 557; left: -17.3%; top: -17.7%; }
/* sizes: the ring is about 1.37 x the photo, so the photos are a little smaller than the old rim to keep the whole thing as big or bigger */
.idl-faces { --f: clamp(40px, 11.5vw, 46px); gap: calc(var(--f) * .42); padding: calc(var(--f) * .24) calc(var(--f) * .2); }
.idl-faces .pav { --idl-face: var(--f); }
@media (min-width: 640px) { .idl-faces { --f: clamp(88px, 11vw, 170px); } }
.lv-faces { --f: clamp(40px, 11vw, 48px); gap: calc(var(--f) * .42); padding: calc(var(--f) * .2) calc(var(--f) * .2); }
.lv-faces .pav { --lv-face: var(--f); }
@media (min-width: 640px) { .lv-faces { --f: clamp(64px, 9vw, 140px); } }
/* a live card is a solid red / blue field: the ring would vanish in its own ink, so there it is printed in cream */
[data-theme="paper"] .lv-faces .pav::after { filter: brightness(0) invert(.95) sepia(.12); }
[data-theme="paper"] .pdir-row { --pav-box: 44px; }
[data-theme="paper"] .pdir-pod { --pav-box: 52px; }
[data-theme="paper"] .pdir-pod.p1 { --pav-box: 66px; }
[data-theme="paper"] .pdir-row .pav, [data-theme="paper"] .pdir-pod .pav { margin-inline: 8px; }
[data-theme="paper"] .pdir-pod .pav { margin-block: 12px 16px; }
[data-theme="paper"] .pdir-pod.p1 .pav { margin-block: 16px 22px; }
@media (min-width: 640px) {
  [data-theme="paper"] .pdir-row { --pav-box: 52px; }
  [data-theme="paper"] .pdir-pod { --pav-box: 68px; }
  [data-theme="paper"] .pdir-pod.p1 { --pav-box: 88px; }
}

/* ---- umpire app: the same rings on the faces of the match cards and the VS intro (the scoring panels stay plain: nothing between the umpire and the numbers) ---- */
[data-theme="paper"] :is(.mc-team, .vsi-faces) .uavatar { overflow: visible; border: 0; background: none; position: relative; }
[data-theme="paper"] :is(.mc-team, .vsi-faces) .uavatar img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; }
[data-theme="paper"] :is(.mc-team, .vsi-faces) .ua-initials { background: radial-gradient(circle, var(--s1) 62%, transparent 63%); }
[data-theme="paper"] :is(.mc-team, .vsi-faces) .uavatar::after { content: ''; position: absolute; pointer-events: none; background: no-repeat center / 100% 100%; }
[data-theme="paper"] .vsi-faces .uavatar::after { filter: brightness(0) invert(.95) sepia(.12); }   /* the VS intro is two solid team fields: cream ink */
[data-theme="paper"] .mc-team .uavatar { --ua: 30px; margin-inline: 6px; }
[data-theme="paper"] .mc-team .uface-pair { gap: 10px; }
[data-theme="paper"] .vsi-faces .uface-pair { gap: calc(var(--ua, 64px) * .5); }
[data-theme="paper"] .vsi-faces .uavatar { --ua: clamp(52px, 17vw, 80px); }
@media (orientation: landscape) and (max-height: 520px) { [data-theme="paper"] .vsi-faces .uavatar { --ua: clamp(44px, 13vh, 72px); } }

/* umpire chrome: the serving star on the login, a yellow marker under the active tab, a crayon line under screen titles */
[data-theme="paper"]:has(#screen-live) .login-mark { width: auto; height: auto; }
[data-theme="paper"]:has(#screen-live) .login-mark .ds-mascot { width: 104px; }
@media (max-height: 900px) { [data-theme="paper"]:has(#screen-live) .login-mark .ds-mascot { width: 62px; } }
[data-theme="paper"]:has(#screen-live) .tab-btn { position: relative; }
[data-theme="paper"]:has(#screen-live) .tab-btn.active { border-bottom-color: transparent; }
[data-theme="paper"]:has(#screen-live) .tab-btn.active::after { content: ''; position: absolute; left: 10%; right: 10%; bottom: -2px; height: 9px; background: url(../media/riso/marker-yellow-2.webp) center / 100% 100% no-repeat; pointer-events: none; }
[data-theme="paper"]:has(#screen-live) .screen-title::after { content: ''; display: block; width: min(240px, 64%); height: 9px; margin-top: 2px; background: url(../media/riso/line-red.webp) left center / 100% 100% no-repeat; }

/* ---- team marks and labels, Riso: the circle (red) and the diamond (blue) are rough hand-inked stamps (a mask, so they keep the colour
   of whatever they sit on) with the second plate printed slightly off; the team word is a yellow marker label with navy ink ---- */
[data-theme="paper"] :is(.ds-team-red::before, .tsh-red) {
  border-radius: 0; transform: none; width: .9em; height: .9em; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22%3E%3Cpath d=%22M94.16,50.00 L95.63,53.99 L95.16,57.96 L93.99,61.79 L92.13,65.34 L91.88,69.53 L89.86,73.01 L86.82,75.78 L84.13,78.64 L80.72,80.72 L77.27,82.50 L74.66,85.21 L71.60,87.40 L67.57,87.67 L64.80,90.65 L60.80,90.29 L57.25,91.10 L53.60,91.20 L50.00,94.07 L46.19,93.54 L42.28,93.76 L38.57,92.66 L35.27,90.47 L31.31,90.09 L27.49,88.99 L24.58,86.30 L19.99,85.76 L18.00,82.00 L15.77,78.72 L12.09,76.54 L11.68,72.12 L8.28,69.45 L8.26,65.19 L7.24,61.46 L7.35,57.52 L6.88,53.77 L7.84,50.00 L8.67,46.38 L7.21,42.46 L9.70,39.20 L9.45,35.24 L12.12,32.34 L11.90,28.00 L13.87,24.70 L16.20,21.64 L18.50,18.50 L21.40,15.92 L24.03,12.91 L27.98,11.85 L30.88,8.99 L34.15,6.44 L38.40,6.71 L41.89,4.03 L45.95,3.72 L50.00,5.01 L53.88,5.60 L57.71,6.26 L61.35,7.65 L65.39,7.71 L68.18,11.00 L70.87,13.85 L73.88,15.90 L77.68,17.01 L80.89,19.11 L82.49,22.74 L84.84,25.61 L87.16,28.55 L89.63,31.52 L90.16,35.38 L92.64,38.57 L93.75,42.29 L94.83,46.08Z M55.42,63.46 a0.85,0.85 0 1,0 1.70,0 a0.85,0.85 0 1,0 -1.70,0Z M67.91,40.62 a1.10,1.10 0 1,0 2.19,0 a1.10,1.10 0 1,0 -2.19,0Z M45.41,60.84 a0.57,0.57 0 1,0 1.13,0 a0.57,0.57 0 1,0 -1.13,0Z M61.48,20.77 a0.87,0.87 0 1,0 1.75,0 a0.87,0.87 0 1,0 -1.75,0Z M36.56,22.96 a1.40,1.40 0 1,0 2.80,0 a1.40,1.40 0 1,0 -2.80,0Z M70.69,44.04 a1.49,1.49 0 1,0 2.98,0 a1.49,1.49 0 1,0 -2.98,0Z M75.47,43.36 a1.38,1.38 0 1,0 2.77,0 a1.38,1.38 0 1,0 -2.77,0Z M27.23,51.26 a0.75,0.75 0 1,0 1.49,0 a0.75,0.75 0 1,0 -1.49,0Z M59.76,39.82 a0.57,0.57 0 1,0 1.14,0 a0.57,0.57 0 1,0 -1.14,0Z M59.79,20.22 a0.98,0.98 0 1,0 1.97,0 a0.98,0.98 0 1,0 -1.97,0Z M53.52,42.97 a0.76,0.76 0 1,0 1.52,0 a0.76,0.76 0 1,0 -1.52,0Z M43.55,72.59 a0.67,0.67 0 1,0 1.34,0 a0.67,0.67 0 1,0 -1.34,0Z M67.57,58.85 a1.40,1.40 0 1,0 2.80,0 a1.40,1.40 0 1,0 -2.80,0Z M79.94,46.77 a0.98,0.98 0 1,0 1.96,0 a0.98,0.98 0 1,0 -1.96,0Z M48.49,85.25 a1.03,1.03 0 1,0 2.05,0 a1.03,1.03 0 1,0 -2.05,0Z M48.48,44.00 a0.71,0.71 0 1,0 1.42,0 a0.71,0.71 0 1,0 -1.42,0Z%22 fill=%22%23000%22 fill-rule=%22evenodd%22/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22%3E%3Cpath d=%22M94.16,50.00 L95.63,53.99 L95.16,57.96 L93.99,61.79 L92.13,65.34 L91.88,69.53 L89.86,73.01 L86.82,75.78 L84.13,78.64 L80.72,80.72 L77.27,82.50 L74.66,85.21 L71.60,87.40 L67.57,87.67 L64.80,90.65 L60.80,90.29 L57.25,91.10 L53.60,91.20 L50.00,94.07 L46.19,93.54 L42.28,93.76 L38.57,92.66 L35.27,90.47 L31.31,90.09 L27.49,88.99 L24.58,86.30 L19.99,85.76 L18.00,82.00 L15.77,78.72 L12.09,76.54 L11.68,72.12 L8.28,69.45 L8.26,65.19 L7.24,61.46 L7.35,57.52 L6.88,53.77 L7.84,50.00 L8.67,46.38 L7.21,42.46 L9.70,39.20 L9.45,35.24 L12.12,32.34 L11.90,28.00 L13.87,24.70 L16.20,21.64 L18.50,18.50 L21.40,15.92 L24.03,12.91 L27.98,11.85 L30.88,8.99 L34.15,6.44 L38.40,6.71 L41.89,4.03 L45.95,3.72 L50.00,5.01 L53.88,5.60 L57.71,6.26 L61.35,7.65 L65.39,7.71 L68.18,11.00 L70.87,13.85 L73.88,15.90 L77.68,17.01 L80.89,19.11 L82.49,22.74 L84.84,25.61 L87.16,28.55 L89.63,31.52 L90.16,35.38 L92.64,38.57 L93.75,42.29 L94.83,46.08Z M55.42,63.46 a0.85,0.85 0 1,0 1.70,0 a0.85,0.85 0 1,0 -1.70,0Z M67.91,40.62 a1.10,1.10 0 1,0 2.19,0 a1.10,1.10 0 1,0 -2.19,0Z M45.41,60.84 a0.57,0.57 0 1,0 1.13,0 a0.57,0.57 0 1,0 -1.13,0Z M61.48,20.77 a0.87,0.87 0 1,0 1.75,0 a0.87,0.87 0 1,0 -1.75,0Z M36.56,22.96 a1.40,1.40 0 1,0 2.80,0 a1.40,1.40 0 1,0 -2.80,0Z M70.69,44.04 a1.49,1.49 0 1,0 2.98,0 a1.49,1.49 0 1,0 -2.98,0Z M75.47,43.36 a1.38,1.38 0 1,0 2.77,0 a1.38,1.38 0 1,0 -2.77,0Z M27.23,51.26 a0.75,0.75 0 1,0 1.49,0 a0.75,0.75 0 1,0 -1.49,0Z M59.76,39.82 a0.57,0.57 0 1,0 1.14,0 a0.57,0.57 0 1,0 -1.14,0Z M59.79,20.22 a0.98,0.98 0 1,0 1.97,0 a0.98,0.98 0 1,0 -1.97,0Z M53.52,42.97 a0.76,0.76 0 1,0 1.52,0 a0.76,0.76 0 1,0 -1.52,0Z M43.55,72.59 a0.67,0.67 0 1,0 1.34,0 a0.67,0.67 0 1,0 -1.34,0Z M67.57,58.85 a1.40,1.40 0 1,0 2.80,0 a1.40,1.40 0 1,0 -2.80,0Z M79.94,46.77 a0.98,0.98 0 1,0 1.96,0 a0.98,0.98 0 1,0 -1.96,0Z M48.49,85.25 a1.03,1.03 0 1,0 2.05,0 a1.03,1.03 0 1,0 -2.05,0Z M48.48,44.00 a0.71,0.71 0 1,0 1.42,0 a0.71,0.71 0 1,0 -1.42,0Z%22 fill=%22%23000%22 fill-rule=%22evenodd%22/%3E%3C/svg%3E") center / contain no-repeat; filter: drop-shadow(.07em .07em 0 rgba(11, 42, 82, .45));
}
[data-theme="paper"] :is(.ds-team-blue::before, .tsh-blue) {
  border-radius: 0; transform: none; width: .9em; height: .9em; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22%3E%3Cpath d=%22M50.81,2.71 L53.58,4.91 L55.16,7.53 L58.84,9.54 L60.75,12.13 L63.98,14.16 L66.44,19.09 L67.52,20.89 L71.68,24.18 L74.20,25.42 L76.44,29.77 L80.31,30.45 L81.03,33.03 L83.53,36.54 L86.47,40.21 L90.37,41.10 L92.76,44.24 L95.32,46.66 L97.20,49.24 L95.04,53.17 L92.79,54.24 L90.51,58.90 L87.99,61.36 L83.49,63.25 L80.95,66.63 L78.55,69.17 L76.07,71.81 L73.55,72.90 L71.07,76.21 L69.63,78.84 L66.01,82.12 L64.41,83.70 L60.91,87.35 L58.56,91.12 L54.88,93.15 L52.73,95.48 L48.95,98.76 L48.48,94.99 L44.23,93.85 L41.06,88.98 L38.31,88.09 L37.29,84.54 L34.29,80.85 L31.68,79.20 L28.71,76.40 L25.76,73.34 L22.25,71.17 L20.06,69.16 L18.76,66.54 L15.23,62.70 L12.39,60.63 L10.32,59.11 L6.34,55.28 L4.65,53.19 L2.94,50.67 L4.97,47.95 L7.74,45.53 L10.48,42.44 L12.06,40.33 L15.06,36.94 L18.78,35.11 L21.84,30.15 L22.88,28.21 L25.74,25.15 L28.79,22.32 L30.86,21.73 L34.58,17.91 L35.73,16.43 L39.82,11.96 L41.60,10.34 L45.10,6.76 L48.42,4.24Z M48.64,76.47 a0.65,0.65 0 1,0 1.31,0 a0.65,0.65 0 1,0 -1.31,0Z M43.50,38.31 a1.10,1.10 0 1,0 2.20,0 a1.10,1.10 0 1,0 -2.20,0Z M45.52,67.47 a1.44,1.44 0 1,0 2.88,0 a1.44,1.44 0 1,0 -2.88,0Z M30.26,53.92 a1.12,1.12 0 1,0 2.23,0 a1.12,1.12 0 1,0 -2.23,0Z M46.82,61.80 a0.88,0.88 0 1,0 1.77,0 a0.88,0.88 0 1,0 -1.77,0Z M46.79,62.38 a1.46,1.46 0 1,0 2.92,0 a1.46,1.46 0 1,0 -2.92,0Z M73.89,55.56 a1.43,1.43 0 1,0 2.87,0 a1.43,1.43 0 1,0 -2.87,0Z M47.88,46.19 a1.00,1.00 0 1,0 2.00,0 a1.00,1.00 0 1,0 -2.00,0Z M70.57,55.48 a1.20,1.20 0 1,0 2.40,0 a1.20,1.20 0 1,0 -2.40,0Z M49.11,52.51 a1.04,1.04 0 1,0 2.09,0 a1.04,1.04 0 1,0 -2.09,0Z M62.31,58.96 a0.95,0.95 0 1,0 1.91,0 a0.95,0.95 0 1,0 -1.91,0Z M63.17,39.21 a0.63,0.63 0 1,0 1.27,0 a0.63,0.63 0 1,0 -1.27,0Z M55.73,24.77 a1.03,1.03 0 1,0 2.06,0 a1.03,1.03 0 1,0 -2.06,0Z M60.98,53.79 a0.90,0.90 0 1,0 1.81,0 a0.90,0.90 0 1,0 -1.81,0Z M35.75,45.62 a1.30,1.30 0 1,0 2.60,0 a1.30,1.30 0 1,0 -2.60,0Z M63.97,26.94 a1.38,1.38 0 1,0 2.77,0 a1.38,1.38 0 1,0 -2.77,0Z%22 fill=%22%23000%22 fill-rule=%22evenodd%22/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22%3E%3Cpath d=%22M50.81,2.71 L53.58,4.91 L55.16,7.53 L58.84,9.54 L60.75,12.13 L63.98,14.16 L66.44,19.09 L67.52,20.89 L71.68,24.18 L74.20,25.42 L76.44,29.77 L80.31,30.45 L81.03,33.03 L83.53,36.54 L86.47,40.21 L90.37,41.10 L92.76,44.24 L95.32,46.66 L97.20,49.24 L95.04,53.17 L92.79,54.24 L90.51,58.90 L87.99,61.36 L83.49,63.25 L80.95,66.63 L78.55,69.17 L76.07,71.81 L73.55,72.90 L71.07,76.21 L69.63,78.84 L66.01,82.12 L64.41,83.70 L60.91,87.35 L58.56,91.12 L54.88,93.15 L52.73,95.48 L48.95,98.76 L48.48,94.99 L44.23,93.85 L41.06,88.98 L38.31,88.09 L37.29,84.54 L34.29,80.85 L31.68,79.20 L28.71,76.40 L25.76,73.34 L22.25,71.17 L20.06,69.16 L18.76,66.54 L15.23,62.70 L12.39,60.63 L10.32,59.11 L6.34,55.28 L4.65,53.19 L2.94,50.67 L4.97,47.95 L7.74,45.53 L10.48,42.44 L12.06,40.33 L15.06,36.94 L18.78,35.11 L21.84,30.15 L22.88,28.21 L25.74,25.15 L28.79,22.32 L30.86,21.73 L34.58,17.91 L35.73,16.43 L39.82,11.96 L41.60,10.34 L45.10,6.76 L48.42,4.24Z M48.64,76.47 a0.65,0.65 0 1,0 1.31,0 a0.65,0.65 0 1,0 -1.31,0Z M43.50,38.31 a1.10,1.10 0 1,0 2.20,0 a1.10,1.10 0 1,0 -2.20,0Z M45.52,67.47 a1.44,1.44 0 1,0 2.88,0 a1.44,1.44 0 1,0 -2.88,0Z M30.26,53.92 a1.12,1.12 0 1,0 2.23,0 a1.12,1.12 0 1,0 -2.23,0Z M46.82,61.80 a0.88,0.88 0 1,0 1.77,0 a0.88,0.88 0 1,0 -1.77,0Z M46.79,62.38 a1.46,1.46 0 1,0 2.92,0 a1.46,1.46 0 1,0 -2.92,0Z M73.89,55.56 a1.43,1.43 0 1,0 2.87,0 a1.43,1.43 0 1,0 -2.87,0Z M47.88,46.19 a1.00,1.00 0 1,0 2.00,0 a1.00,1.00 0 1,0 -2.00,0Z M70.57,55.48 a1.20,1.20 0 1,0 2.40,0 a1.20,1.20 0 1,0 -2.40,0Z M49.11,52.51 a1.04,1.04 0 1,0 2.09,0 a1.04,1.04 0 1,0 -2.09,0Z M62.31,58.96 a0.95,0.95 0 1,0 1.91,0 a0.95,0.95 0 1,0 -1.91,0Z M63.17,39.21 a0.63,0.63 0 1,0 1.27,0 a0.63,0.63 0 1,0 -1.27,0Z M55.73,24.77 a1.03,1.03 0 1,0 2.06,0 a1.03,1.03 0 1,0 -2.06,0Z M60.98,53.79 a0.90,0.90 0 1,0 1.81,0 a0.90,0.90 0 1,0 -1.81,0Z M35.75,45.62 a1.30,1.30 0 1,0 2.60,0 a1.30,1.30 0 1,0 -2.60,0Z M63.97,26.94 a1.38,1.38 0 1,0 2.77,0 a1.38,1.38 0 1,0 -2.77,0Z%22 fill=%22%23000%22 fill-rule=%22evenodd%22/%3E%3C/svg%3E") center / contain no-repeat; filter: drop-shadow(.07em .07em 0 rgba(11, 42, 82, .45));
}
[data-theme="paper"] :is(.idl-team .idl-tname, .lv-tname, .tv-team .tv-tag) {
  color: #0b2a52; padding: .05em .7em .1em; background: url(../media/riso/marker-yellow-1.webp) center / 100% 100% no-repeat; transform: rotate(-1.2deg); border-bottom-color: transparent;
}
[data-theme="paper"] :is(.idl-team.blue .idl-tname, .lv-team.blue .lv-tname, .tv-team.blue .tv-tag) {
  background-image: url(../media/riso/marker-yellow-2.webp); transform: rotate(1.2deg);
}
[data-theme="paper"] :is(.lv-tname.ds-team-red, .tv-team.red .tv-tag)::before { background: #d81a21; }
[data-theme="paper"] :is(.lv-tname.ds-team-blue, .tv-team.blue .tv-tag)::before { background: #0956b8; }

/* ---- finished-matches tab (and the other lists): the same inked frame, marker tags, crayon pills, offset-plate fields ---- */
[data-theme="paper"] :is(.fm, .fin-legend) { position: relative; }
[data-theme="paper"] :is(.fm, .fin-legend)::after {   /* an overlay, so the team colour edge on the left of a match card stays */
  content: ''; position: absolute; inset: -3px; pointer-events: none; border: 6px solid transparent; border-radius: 2px; border-image: var(--riso-frame) 22 / 6px / 0 stretch;
}
[data-theme="paper"] .filter-pill { border: 1.5px solid #0b2a52; color: #0b2a52; box-shadow: 2px 2px 0 rgba(225, 29, 36, .3); background: var(--s1); }
[data-theme="paper"] .filter-pill.active {
  border-color: transparent; box-shadow: none; background: url(../media/riso/marker-yellow-1.webp) center / 100% 100% no-repeat; color: #0b2a52; font-weight: 800; padding-inline: 18px;
}
[data-theme="paper"] .finished-tag {
  border: 0; border-radius: 0; padding: 0 var(--sp-4); color: #0b2a52;
  background: url(../media/riso/marker-yellow-2.webp) center / 100% 100% no-repeat; transform: rotate(-1deg);
}
[data-theme="paper"] .finished-tag:nth-child(even) { background-image: url(../media/riso/marker-yellow-1.webp); transform: rotate(1deg); }
[data-theme="paper"] .finished-tag .ds-ic { color: #0b2a52; }
[data-theme="paper"] :is(.ds-input, .ds-select, select.ds-input) {
  border: 1.5px solid #0b2a52; border-radius: 4px 8px 5px 9px / 9px 5px 8px 4px; box-shadow: 2px 2px 0 rgba(225, 29, 36, .28); background-color: var(--s1);
}

/* ---- TV (the same marks at TV scale; every size follows --u) ---- */
[data-theme="paper"] :is(.tv-board-face, .tv-faces) .pav { overflow: visible; border: 0; background: none; }
[data-theme="paper"] :is(.tv-board-face, .tv-faces) .pav img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; }
[data-theme="paper"] :is(.tv-board-face, .tv-faces) .pav-initials { background: radial-gradient(circle, var(--s1) 62%, transparent 63%); }
[data-theme="paper"] :is(.tv-board-face, .tv-faces) .pav::after { content: ''; position: absolute; pointer-events: none; background-repeat: no-repeat; background-position: center; background-size: 100% 100%; }
[data-theme="paper"] .tv-faces .pav::after { filter: brightness(0) invert(.95) sepia(.12); }   /* faces on a solid team field: cream ink */
[data-theme="paper"] .tv-board-face .pav { width: calc(var(--u) * 9.4 * var(--bs)); height: calc(var(--u) * 9.4 * var(--bs)); margin: calc(var(--u) * 1.6 * var(--bs)); }
[data-theme="paper"] .tv-faces .pav { width: calc(var(--face, calc(var(--u) * 6)) * .78); height: calc(var(--face, calc(var(--u) * 6)) * .78); }
[data-theme="paper"] .tv-faces { gap: calc(var(--face, calc(var(--u) * 6)) * .3); padding: calc(var(--face, calc(var(--u) * 6)) * .12); }
[data-theme="paper"] .tv-faces .pav + .pav { margin-left: 0; }
/* heading: a yellow marker swipe behind the icon, a crayon line under the title */
[data-theme="paper"] .tv-title { position: relative; }
[data-theme="paper"] .tv-title-ic { border-radius: 0; background: url(../media/riso/marker-yellow-2.webp) center / 100% 100% no-repeat; color: #0b2a52; transform: rotate(-2deg); }
[data-theme="paper"] .tv-title::after { content: ''; position: absolute; left: calc(var(--u) * 7); right: 0; bottom: calc(var(--u) * -1.3); height: calc(var(--u) * 1.1); background: url(../media/riso/line-red.webp) left center / 100% 100% no-repeat; }
[data-theme="paper"] .tv-chip { border: 0; border-radius: 0; background: url(../media/riso/marker-yellow-1.webp) center / 100% 100% no-repeat; color: #0b2a52; padding-inline: calc(var(--u) * 2.4); transform: rotate(-.8deg); }
/* footer: a blue crayon line over it */
[data-theme="paper"] .tv-foot { position: relative; }
[data-theme="paper"] .tv-foot::before { content: ''; position: absolute; left: 0; right: 0; top: calc(var(--u) * -1.3); height: calc(var(--u) * .9); background: url(../media/riso/line-blue.webp) left center / 100% 100% no-repeat; opacity: .55; pointer-events: none; }
/* leaderboard rows and live cards: the inked frame (an overlay, the team edge stays); rank 1 is a marker swipe */
[data-theme="paper"] :is(.tv-board-row, .tv-live-card) { position: relative; }
[data-theme="paper"] :is(.tv-board-row, .tv-live-card)::after {
  content: ''; position: absolute; inset: calc(var(--u) * -.4); pointer-events: none; border: calc(var(--u) * .7) solid transparent; border-radius: 2px; border-image: var(--riso-frame) 22 / calc(var(--u) * .7) / 0 stretch;
}
[data-theme="paper"] .tv-rank { border-radius: 0; }
[data-theme="paper"] .tv-rank.r1 { background: url(../media/riso/marker-yellow-1.webp) center / 100% 100% no-repeat; color: #0b2a52; transform: rotate(-3deg); }
[data-theme="paper"] .tv-court { border-radius: 0; background: url(../media/riso/marker-yellow-2.webp) center / 100% 100% no-repeat; padding-inline: calc(var(--u) * 2.2); }
/* VS / finished fields: the ragged printed edge and the marker word, like the battle panel */
[data-theme="paper"] .tv-field { -webkit-mask: var(--riso-ragged) center / 100% 100% no-repeat; mask: var(--riso-ragged) center / 100% 100% no-repeat; }
[data-theme="paper"] .tv-field .tv-tag { color: #0b2a52; padding: .05em .7em .1em; background: url(../media/riso/marker-yellow-1.webp) center / 100% 100% no-repeat; transform: rotate(-1.2deg); }
[data-theme="paper"] .tv-field.is-blue .tv-tag { background-image: url(../media/riso/marker-yellow-2.webp); transform: rotate(1.2deg); }
[data-theme="paper"] .tv-field.is-red .tv-tag::before { background: #d81a21; }
[data-theme="paper"] .tv-field.is-blue .tv-tag::before { background: #0956b8; }

/* ---- finished matches: who won must be readable from across the room ----
   the result is a solid hand-inked stamp in the winner's ink (a yellow marker for a draw), the winner's names carry a highlighter,
   the winner's game scores are in the team colour and the loser's fade; the card carries a wash of the winner's colour. ---- */
[data-theme="paper"] .fm-result {
  min-height: 36px; padding: 0 16px; border: 0; border-radius: 4px 10px 5px 11px / 11px 5px 10px 4px; font-size: var(--fs-16); font-weight: 800; letter-spacing: .01em;
  box-shadow: 2px 2px 0 rgba(11, 42, 82, .5); transform: rotate(-1.6deg);
}
[data-theme="paper"] .fm-result.red { background: #d81a21; color: #fff6ea; }
[data-theme="paper"] .fm-result.blue { background: #0956b8; color: #fff6ea; }
[data-theme="paper"] .fm-result.draw { background: url(../media/riso/marker-yellow-1.webp) center / 100% 100% no-repeat; color: #0b2a52; box-shadow: none; padding-inline: 22px; }
[data-theme="paper"] .fm-result .tsh { color: currentColor; filter: none; }
[data-theme="paper"] .fm.red { background-image: linear-gradient(90deg, rgba(216, 26, 33, .10), rgba(216, 26, 33, 0) 45%); border-left-width: 8px; }
[data-theme="paper"] .fm.blue { background-image: linear-gradient(90deg, rgba(9, 86, 184, .10), rgba(9, 86, 184, 0) 45%); border-left-width: 8px; }
[data-theme="paper"] .fm.draw { background-image: linear-gradient(90deg, rgba(244, 196, 48, .22), rgba(244, 196, 48, 0) 45%); border-left-width: 8px; }
[data-theme="paper"] .fm-team.win .fm-name > span { background: linear-gradient(transparent 52%, rgba(244, 196, 48, .8) 52% 94%, transparent 94%); padding: 0 .25em; }
[data-theme="paper"] .fm-team:not(.win) .fm-name { opacity: .72; }
[data-theme="paper"] .fm-g { opacity: .55; }
[data-theme="paper"] .fm-g.w { opacity: 1; font-size: 2.3rem; }
[data-theme="paper"] .fm-team.red .fm-g.w { color: #d81a21; }
[data-theme="paper"] .fm-team.blue .fm-g.w { color: #0956b8; }

/* ── type + icons ─────────────────────────────────────────────────────────────
   Digits: 'Riso Num' (the owner's hand-lettered numerals, self-hosted) then Anton for the letters beside them, via --font-num.
   Thai headings and tab labels: Kanit. Body copy and controls stay Noto Sans Thai (small Thai must stay plain).
   Icons: every icon is the hand-drawn Riso set (shared/icons.js from scripts/riso/slice-icons.py; ink = currentColor, plate = --ic-plate). */
[data-theme="paper"] :is(.adm-h, .wz-h, .wz-sum-h, .arc-name, .ld-msg, .gal-year-title, .login-primary-main, .noti-reaction-text, .profile-name, .pd-h, .plb-name, .qr-card-title, .cf-result, .ds-sheet-title, .ds-empty-title, .pause-title, .modal-title, .modal-result, .screen-title, .login-title, .mc-team, .section-title.th, .tab-lbl, .idl-pill) { font-family: var(--font-th-head); }
[data-theme="paper"] :is(.ds-team, .idl-tname, .idl-vs) { font-family: var(--font-num); font-weight: 400; letter-spacing: .08em; }

/* ---- live court cards (Ongoing tab) and the on-court summary: the same Riso language as the finished tab and the TV ----
   inked frame (::before, because .is-mine already draws its star on ::after), score plates with the ragged printed edge and an offset second plate,
   yellow marker court / game / team labels, a crayon rule over each team. A close finish or a deuce keeps its coloured outline. ---- */
[data-theme="paper"] :is(.court-card, .ongoing-hero) { position: relative; overflow: visible; border: 0; border-radius: 2px; background: var(--s1); box-shadow: 4px 4px 0 rgba(11, 42, 82, .16); }
[data-theme="paper"] :is(.court-card, .ongoing-hero)::before {
  content: ''; position: absolute; inset: -3px; z-index: 1; pointer-events: none; border: 6px solid transparent; border-radius: 2px; border-image: var(--riso-frame) 22 / 6px / 0 stretch;
}
[data-theme="paper"] .court-card.climax { box-shadow: 0 0 0 3px var(--gold), 4px 4px 0 rgba(11, 42, 82, .16); }
[data-theme="paper"] .court-card.deuce { box-shadow: 0 0 0 3px var(--warn), 4px 4px 0 rgba(11, 42, 82, .16); }
[data-theme="paper"] .court-card-header { padding-top: var(--sp-4); }
[data-theme="paper"] .court-no { min-height: 30px; padding: 0 20px; border-radius: 0; color: #0b2a52; background: url(../media/riso/marker-yellow-2.webp) center / 100% 100% no-repeat; transform: rotate(-1.6deg); }
[data-theme="paper"] .court-card-round, [data-theme="paper"] .queue-round { border: 1.5px solid #0b2a52; border-radius: 4px 8px 5px 9px / 9px 5px 8px 4px; background: transparent; color: #0b2a52; box-shadow: 2px 2px 0 rgba(225, 29, 36, .28); }
[data-theme="paper"] .court-glabel { border-radius: 0; padding: 2px 14px; color: #0b2a52; background: url(../media/riso/marker-yellow-1.webp) center / 100% 100% no-repeat; transform: rotate(-1.5deg); }
[data-theme="paper"] .court-glabel.g2 { background-image: url(../media/riso/marker-yellow-2.webp); transform: rotate(1.5deg); }
/* the two score plates: a ragged printed edge (mask) with a halftone grain, the offset navy plate rides on the group (a filter follows the mask) */
[data-theme="paper"] .court-score-nums { filter: drop-shadow(3px 3px 0 rgba(11, 42, 82, .45)); }
[data-theme="paper"] .court-snum {
  --fill: #d81a21; color: #fff6ea; border-bottom: 0; border-radius: 0; padding: .08em .14em .03em;
  background: radial-gradient(circle, rgba(255, 246, 234, .13) 1px, transparent 1.4px) 0 0 / 6px 6px, var(--fill);
  -webkit-mask: var(--riso-ragged) center / 100% 100% no-repeat; mask: var(--riso-ragged) center / 100% 100% no-repeat;
}
[data-theme="paper"] .court-snum.blue { --fill: #0956b8; }
[data-theme="paper"] .court-snum.dim.red, [data-theme="paper"] .court-snum.dim.blue { color: #fff6ea; opacity: .6; }
[data-theme="paper"] .court-ssep { color: #0b2a52; }
[data-theme="paper"] .court-team { border-top: 0; padding-top: calc(var(--sp-3) + 8px); }
[data-theme="paper"] .court-team::before { content: ''; position: absolute; left: var(--sp-3); right: var(--sp-3); top: 0; height: 9px; background: url(../media/riso/line-red.webp) center / 100% 100% no-repeat; }
[data-theme="paper"] .court-team.blue::before { background-image: url(../media/riso/line-blue.webp); }
[data-theme="paper"] .court-team { position: relative; }
[data-theme="paper"] .court-team-label { color: #0b2a52; padding: .05em .7em .1em; background: url(../media/riso/marker-yellow-1.webp) center / 100% 100% no-repeat; transform: rotate(-1.2deg); }
[data-theme="paper"] .court-team.blue .court-team-label { background-image: url(../media/riso/marker-yellow-2.webp); transform: rotate(1.2deg); }
[data-theme="paper"] .court-team-label.ds-team-red::before { background: #d81a21; }
[data-theme="paper"] .court-team-label.ds-team-blue::before { background: #0956b8; }
/* faces on the card: the hand-inked ring, like everywhere else */
[data-theme="paper"] .court-pav { width: 34px; height: 34px; margin: 6px; overflow: visible; border: 0; background: none; position: relative; }
[data-theme="paper"] .court-pav img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; }
[data-theme="paper"] .court-pav.pav-initials { background: radial-gradient(circle, var(--s1) 62%, transparent 63%); }
[data-theme="paper"] .court-pav::after { content: ''; position: absolute; pointer-events: none; background: no-repeat center / 100% 100%; }
/* the on-court summary: a big hand-lettered count, the live chip stays */
[data-theme="paper"] .ongoing-hero { padding: var(--sp-5) var(--sp-5); }
[data-theme="paper"] .ongoing-live-count { font-size: 4rem; }
[data-theme="paper"] .login-install { border: 1.5px solid #0b2a52; border-radius: 4px 8px 5px 9px / 9px 5px 8px 4px; box-shadow: 2px 2px 0 rgba(225, 29, 36, .28); background: var(--s1); }

/* ══ whole-app pass: every card, sheet, row, button, chip, banner and table gets the same hand-inked treatment ══
   three levels, so nothing is left as a flat rounded box:
   frame   the inked double-line border (border-image), for the surfaces a page is built from: cards, sheets, dialogs, KPI / stat blocks
   sketch  a hand-cut navy outline with an offset red plate, for rows, tiles and inner boxes
   plate   marker-yellow / team colour plates for buttons, chips and the things that are "on" */
[data-theme="paper"] { --ink: #0b2a52; --sk-r: 4px 9px 5px 10px / 10px 5px 9px 4px; --sk-sh: 2px 2px 0 rgba(225, 29, 36, .24); --sk-r-s: 3px 7px 4px 8px / 8px 4px 7px 3px; }

/* frame */
[data-theme="paper"] :is(.card, .profile-header, .modal-box, .ds-sheet, .login-card, #dashboard .db-kpi, #dashboard .db-card, .backup-row, .bk-box, .adm-collapse, .adm-end, .mb-card, .am-card, .stf, .wz-sum, .arc-card, .qr-card, .gal-admin-bar, #report .rp-kpis, #report .rp-fold, #report .rp-tagfold, #report .rp-ucard, #report .cmp-season-card, .award-card, .cer-col, .queue-row, .court-empty, .fin-empty, .idl-empty, .lv-hub, .match-card, .finished-card, .nav-actions, #matchNotiBox, .pdir-pod, .profile-stats-bar) {
  border: 6px solid transparent; border-image: var(--riso-frame) 22 / 6px / 0 stretch; border-radius: 2px;
}
/* sketch */
[data-theme="paper"] :is(.pdir-row, .mb-pool-col, .pd-fact, .pd-note, .pd-match, .pd-h2h-row, .pd-career-tot > div, .pd-career-row, .awi-item, .wz-stat, .arc-stat, .cf-result, .cf-game, .fr-teams, .fr-stepper, .fr-live, .ed-col, .tag-checkbox-item, .rs-opt, .cer-stat, .dlg-info, .reassign-card, .wz-newblock, #report .rp-prow, #report .rp-ptable-wrap, #report .rp-round, #report .rp-mdetail, #report .cmp-table, .rp-legend, .rp-page .rp-empty, #matchNotiScoreBoard, #matchNotiResultLine, #matchNotiNarrative, #matchNotiOverallScore, .noti-reaction, .gal-item, .gal-selbar, .pause-meta > span, .list-filter, .toast-item, .g1-toast-inner, #dashboard .db-mini > div, .me-opt, .login-role, .idl-q, .ds-seg, .backup-row .bk-reason, .pf-kpis) {
  border: 1.5px solid var(--ink); border-radius: var(--sk-r); box-shadow: var(--sk-sh);
}
[data-theme="paper"] .ds-banner { border-width: 1.5px; border-radius: var(--sk-r); box-shadow: var(--sk-sh); }
[data-theme="paper"] :is(.me-chip, .role-chip, .nav-season, .nav-more, .nav-live) { border-color: var(--ink); box-shadow: var(--sk-sh); }
[data-theme="paper"] .nav-more { border-width: 1.5px; }
/* dialog parts: the heads and feet are not boxes of their own any more, a crayon rule divides them */
[data-theme="paper"] :is(.dlg-head, .dlg-foot) { background: transparent; border-color: transparent; }
[data-theme="paper"] .dlg-head { background: url(../media/riso/line-blue.webp) left bottom / 100% 9px no-repeat; padding-bottom: calc(var(--sp-3) + 8px); }
[data-theme="paper"] .dlg-foot { background: url(../media/riso/line-red.webp) left top / 100% 9px no-repeat; padding-top: calc(var(--sp-3) + 8px); }

/* plates: buttons */
[data-theme="paper"] .ds-btn { border: 1.5px solid var(--ink); border-radius: var(--sk-r); box-shadow: var(--sk-sh); color: var(--ink); background: var(--s1); }
[data-theme="paper"] .ds-btn:active { box-shadow: none; transform: translate(1px, 1px); }
[data-theme="paper"] .ds-btn-primary { border-color: transparent; box-shadow: none; font-weight: 800; background: url(../media/riso/marker-yellow-1.webp) center / 100% 100% no-repeat; }
[data-theme="paper"] .ds-btn-primary:hover { filter: brightness(1.05); }
[data-theme="paper"] .ds-btn-ghost { border-color: transparent; box-shadow: none; background: transparent; }
[data-theme="paper"] .ds-btn-danger { border-color: #d81a21; color: #d81a21; box-shadow: 2px 2px 0 rgba(11, 42, 82, .2); }
[data-theme="paper"] .ds-btn-red { background: #d81a21; color: #fff6ea; }
[data-theme="paper"] .ds-btn-blue { background: #0956b8; color: #fff6ea; }
[data-theme="paper"] .ds-btn[disabled], [data-theme="paper"] .ds-btn.is-disabled { box-shadow: none; }
/* plates: chips (a stamp; the ones that are "on" are a marker swipe) */
[data-theme="paper"] .ds-chip { border: 1.5px solid rgba(11, 42, 82, .6); border-radius: var(--sk-r-s); background: transparent; color: var(--ink); }
[data-theme="paper"] :is(.ds-chip.is-on, .ds-chip-gold, .ds-seg > button.is-on, .ds-seg > button[aria-pressed="true"]) { border-color: transparent; color: var(--ink); background: url(../media/riso/marker-yellow-2.webp) center / 100% 100% no-repeat; }
[data-theme="paper"] .ds-chip-live { color: #05683c; border-color: rgba(5, 104, 60, .6); background: transparent; }
[data-theme="paper"] .ds-chip-red { color: #b5121a; border-color: #d81a21; background: transparent; }
[data-theme="paper"] .ds-chip-blue { color: #0956b8; border-color: #0956b8; background: transparent; }
/* tables: ink head with a rule, dashed rows */
[data-theme="paper"] .ds-table th { background: transparent; color: var(--ink); border-bottom: 2px solid var(--ink); font-family: var(--font-th-head); }
[data-theme="paper"] .ds-table td { border-bottom: 1px dashed rgba(11, 42, 82, .25); }
/* section heads inside pages: a crayon line, like the tab headings */
[data-theme="paper"] :is(.pd-h, .adm-h, .wz-h) { display: flex; align-items: center; gap: var(--sp-3); }
[data-theme="paper"] :is(.pd-h, .adm-h, .wz-h)::after { content: ''; flex: 1; height: 9px; min-width: 24px; background: url(../media/riso/line-blue.webp) center / 100% 100% no-repeat; opacity: .8; }

/* player profile */
[data-theme="paper"] .pd-avatar-wrap { margin: 16px; }
[data-theme="paper"] .pd-avatar-wrap .pav { overflow: visible; border: 0; background: none; position: relative; }
[data-theme="paper"] .pd-avatar-wrap .pav img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; }
[data-theme="paper"] .pd-avatar-wrap .pav-initials { background: radial-gradient(circle, var(--s1) 62%, transparent 63%); }
[data-theme="paper"] .pd-avatar-wrap .pav::after { content: ""; position: absolute; pointer-events: none; background-repeat: no-repeat; background-position: center; background-size: 100% 100%; }
[data-theme="paper"] .pd-award.has-art { border: 0; border-radius: 0; box-shadow: none; background: url(../media/riso/marker-yellow-2.webp) center / 100% 100% no-repeat; padding-inline: var(--sp-5); }
/* a flat riso-yellow dot with an ink outline: the old stretched marker strip + the paper-coloured 3px border read as a white square frame */
[data-theme="paper"] .pf-star { width: 30px; height: 30px; border-radius: 50%; background: var(--gold); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); color: var(--ink); right: -4px; top: -4px; }

/* ── pass 2 ── */
[data-theme="paper"] :is(.pd-h, .adm-h, .wz-h) { flex: 1 1 auto; }
/* "new version - tap to update" (shared/pwa.js): a hand-cut yellow plate */
[data-theme="paper"] #appUpdate { border: 1.5px solid var(--ink); border-radius: var(--sk-r); background: var(--s1); color: var(--ink); box-shadow: 3px 3px 0 rgba(225, 29, 36, .35); }
/* report summary: the red / blue / draw tiles are ragged printed plates with the offset navy plate, like the score plates */
[data-theme="paper"] .rp-hero-scores { filter: drop-shadow(3px 3px 0 rgba(11, 42, 82, .45)); }
[data-theme="paper"] :is(.rp-hs-red, .rp-hs-blue) {
  border: 0; border-radius: 0; color: #fff6ea;
  background: radial-gradient(circle, rgba(255, 246, 234, .13) 1px, transparent 1.4px) 0 0 / 6px 6px, #d81a21;
  -webkit-mask: var(--riso-ragged) center / 100% 100% no-repeat; mask: var(--riso-ragged) center / 100% 100% no-repeat;
}
[data-theme="paper"] .rp-hs-blue { background-color: #0956b8; }
[data-theme="paper"] .rp-hs-draw { border: 1.5px solid var(--ink); border-radius: var(--sk-r); box-shadow: none; }
[data-theme="paper"] :is(.rp-hs-red, .rp-hs-blue) :is(.rp-hs-val, .rp-hs-lbl) { color: #fff6ea; }

/* ── pass 3: umpire result stamps ── */
[data-theme="paper"] .result-badge { border: 0; border-radius: 4px 10px 5px 11px / 11px 5px 10px 4px; box-shadow: 2px 2px 0 rgba(11, 42, 82, .5); transform: rotate(-.8deg); color: #fff6ea; }
[data-theme="paper"] .result-badge.red { background: #d81a21; }
[data-theme="paper"] .result-badge.blue { background: #0956b8; }
[data-theme="paper"] .result-badge.draw { background: url(../media/riso/marker-yellow-1.webp) center / 100% 100% no-repeat; color: var(--ink); box-shadow: none; }

/* ── pass 4: the login's big button and the Color War poster ── */
[data-theme="paper"] .login-primary { border: 0; border-radius: 0; box-shadow: none; background: url(../media/riso/marker-yellow-1.webp) center / 100% 100% no-repeat; color: var(--ink); padding-inline: calc(var(--sp-5) + 6px); }
[data-theme="paper"] .login-primary:hover { filter: brightness(1.05); }
[data-theme="paper"] .ds-hero { border: 6px solid transparent; border-image: var(--riso-frame) 22 / 6px / 0 stretch; border-radius: 2px; box-shadow: 4px 4px 0 rgba(11, 42, 82, .16); background: var(--s1); }

/* ── pass 5: award plates stay card-sized on wide screens ── */
[data-theme="paper"] .pd-awards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 420px)); gap: var(--sp-3); }

/* ── pass 6: the live court card, laid out straight ──
   no tilted stickers; the game label sits centred over its score plates so the plates are on the card's centre line; each team's
   marker label is as wide as its words and sits at its own edge; the faces are big enough to recognise from a step away. ── */
[data-theme="paper"] :is(.court-no, .court-glabel, .court-glabel.g2, .court-team-label, .court-team.blue .court-team-label) { transform: none; }
[data-theme="paper"] .court-score-row { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: var(--sp-2); }
[data-theme="paper"] .court-gside { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; }
[data-theme="paper"] .court-score-nums { justify-content: center; }
[data-theme="paper"] .court-g2-placeholder { padding-top: 0; }
[data-theme="paper"] .court-team-label { align-self: flex-start; }
[data-theme="paper"] .court-team.blue .court-team-label { align-self: flex-end; }
[data-theme="paper"] .court-pav { width: 44px; height: 44px; margin: 8px; }
[data-theme="paper"] .court-player-name { gap: var(--sp-2); font-size: var(--fs-18); }
[data-theme="paper"] .court-team { gap: var(--sp-1); }
@media (min-width: 640px) {
  [data-theme="paper"] .court-pav { width: 52px; height: 52px; margin: 9px; }
  [data-theme="paper"] .court-player-name { font-size: 1.1875rem; }
}

/* ── pass 7: faces big enough for a big screen. The court card steps up on a wide window; the live board and the idle board scale with the window
   (see .lv-faces / .idl-faces above); the TV faces are sized in tv.css (--facen). ── */
@media (min-width: 1100px) {
  #ongoing .court-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 720px)); }
  [data-theme="paper"] .court-snum { font-size: 5.5rem; }
  [data-theme="paper"] .court-pav { width: 76px; height: 76px; margin: 12px; }
  [data-theme="paper"] .court-player-name { gap: var(--sp-3); font-size: 1.5rem; }
  [data-theme="paper"] .court-card-id, [data-theme="paper"] .court-card-timer { font-size: 2rem; }
}

/* the frame is a 6 px border: on a card that has a set width (a grid column, width 100 percent) it must be counted inside that width, or the card pokes out of its column */
[data-theme="paper"] :is(.card, .profile-header, .modal-box, .ds-sheet, .login-card, #dashboard .db-kpi, #dashboard .db-card, .backup-row, .bk-box, .adm-collapse, .adm-end, .mb-card, .am-card, .stf, .wz-sum, .arc-card, .qr-card, .gal-admin-bar, #report .rp-kpis, #report .rp-fold, #report .rp-tagfold, #report .rp-ucard, #report .cmp-season-card, .award-card, .cer-col, .queue-row, .court-empty, .fin-empty, .idl-empty, .lv-hub, .match-card, .finished-card, .nav-actions, #matchNotiBox, .pdir-pod, .profile-stats-bar) { box-sizing: border-box; }

/* podium medals on paper: ink outline + hard shadow like the other stickers; the crown sits on a riso-yellow disc */
[data-theme="paper"] .pdir-medal { border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); }
[data-theme="paper"] .pdir-pod.p1 .pdir-medal { border-width: 3px; box-shadow: 3px 3px 0 var(--ink), 0 0 0 7px rgba(240, 192, 64, .28); background: #ffd23f; color: var(--ink); }
[data-theme="paper"] .pdir-pod.p1 { box-shadow: 0 0 0 2px rgba(240, 192, 64, .55); }
