/* "Hôm nay" (tournament-today.js, approved previews 195, 256, 257): the organisers' court board, the number pad and the
   W.O. screen, in the tournament pages' light look (white cards, Barlow Condensed numbers, amber when late, green when
   early, red for what is live or needs acting now). Everything here starts with .td- so no other page changes. On a
   computer the board takes the pages' 1120 px column with the courts side by side; the pad and the W.O. screen keep
   the phone column. */

.tour-page {
  --td-amber-bg: #fff4df;
  --td-amber-ink: #8a4f00;
  --td-up: #16804d;
  --td-up-bg: #e3f3ea;
  --td-down: #bf3a30;
  --td-down-bg: #fbe8e6;
  --td-live: #ff3b30;
  --td-lose: #a9b3c4;
  --td-wait: #dfe4ec;
  --td-line: rgba(11, 23, 52, 0.1);
}
@media (prefers-color-scheme: dark) {
  html.in-app .tour-page {
    --td-amber-bg: rgba(255, 190, 70, 0.16);
    --td-amber-ink: #ffc65c;
    --td-up: #4cc38a;
    --td-up-bg: rgba(76, 195, 138, 0.16);
    --td-down: #ff7a6e;
    --td-down-bg: rgba(255, 122, 110, 0.14);
    --td-lose: #56627a;
    --td-wait: #2a3348;
    --td-line: rgba(255, 255, 255, 0.08);
  }
}

/* ---------- 195: the day, the courts, one alert ---------- */

.td-sum { display: flex; align-items: center; gap: 14px; height: 68px; margin-top: 14px; padding: 0 16px 0 10px; border-radius: 22px; background: var(--tp-card); }
.td-ring { display: block; flex: none; }
.td-ring .is-done { stroke: var(--td-up); }
.td-ring .is-live { stroke: var(--td-down); }
.td-ring .is-wait { stroke: var(--td-wait); }
.td-sum-t { font: 600 min(2.125rem, 56px)/1 var(--font-score); color: var(--tp-brand-ink); }
.td-sum-t small { font-size: min(1.375rem, 56px); color: var(--tp-muted); }
.td-lg { display: flex; gap: 14px; margin-left: auto; }
.td-lg > span { display: flex; align-items: center; gap: 6px; }
.td-lg i { width: 10px; height: 10px; border-radius: 50%; background: var(--td-wait); }
.td-lg i.is-live { background: var(--td-live); }
.td-lg b { font: 600 min(1.375rem, 56px)/1 var(--font-score); color: var(--tp-ink2); }

.td-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.td-cc {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 226px;
  padding: 12px 12px 10px;
  border: 0;
  border-radius: 22px;
  background: var(--tp-card);
  color: var(--tp-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 120ms ease-out;
}
.td-cc:active { transform: scale(0.98); }
.td-cc:disabled { cursor: default; transform: none; }
.td-cc:focus-visible { outline: 2px solid var(--tp-brand-ink); outline-offset: 2px; }
.td-ch { display: flex; align-items: center; gap: 6px; height: 28px; }
.td-court { font: 600 min(1.6875rem, 56px)/1 var(--font-score); letter-spacing: 0.02em; color: var(--tp-brand-ink); }
.td-cam { display: flex; color: var(--td-live); }
.td-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--td-live); }
.td-tag { display: grid; place-items: center; min-height: 26px; margin-left: auto; padding: 0 9px; border-radius: 13px; font: 600 1.0625rem/1 var(--font-score); }
.td-tag.is-late { background: var(--td-amber-bg); color: var(--td-amber-ink); }
.td-tag.is-early { background: var(--td-up-bg); color: var(--td-up); }
.td-ev { display: flex; align-items: center; gap: 5px; margin: 8px 0 4px; }
.td-ev .tr-etile { min-height: 22px; padding: 0 6px; border-radius: 7px; font-size: 0.9375rem; }
.td-ev .tr-gb { min-height: 22px; min-width: 22px; padding: 0 4px; border-radius: 7px; font-size: 0.875rem; }
.td-tam { margin-left: 2px; font: 500 0.8125rem/1 var(--tp-font); color: var(--td-amber-ink); }
.td-tam.is-act { color: var(--td-down); }
.td-sd { display: flex; align-items: center; height: 44px; }
.td-sn { display: none; }
.td-g { margin-left: auto; font: 600 min(2.375rem, 57px)/1 var(--font-score); color: var(--tp-brand-ink); white-space: nowrap; }
.td-sd.is-lo .td-g { color: var(--td-lose); }
.td-ft { display: flex; align-items: center; gap: 7px; min-height: 35px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--td-line); }
.td-ref { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--tp-muted); }
.td-ref-n { font: 500 0.9375rem/1.2 var(--tp-font); color: var(--tp-ink2); white-space: normal; overflow-wrap: anywhere; }
/* What needs BTC now (17/11 test L10): a chip on the court, a red or amber outline, and a row above the courts. */
.td-flags { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 4px; }
.td-flag { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 9px; border-radius: 12px; background: var(--td-amber-bg); color: var(--td-amber-ink); font: 600 0.8125rem/1.2 var(--tp-font); }
.td-flag.is-red { background: var(--td-down-bg); color: var(--td-down); }
.td-cc.is-act { box-shadow: inset 0 0 0 2px var(--td-down); }
.td-cc.is-wait { box-shadow: inset 0 0 0 2px var(--td-amber-ink); }
.td-need { min-height: 60px; margin-top: 10px; }
.td-need.is-red { background: var(--td-down-bg); color: var(--td-down); }
.td-sh-g { margin-left: auto; font: 600 min(1.875rem, 56px)/1 var(--font-score); color: var(--tp-brand-ink); }
.td-sh-g.is-lo { color: var(--td-lose); }
.td-sh-st { margin: 8px 0 2px; font: 600 0.9375rem/1.2 var(--tp-font); }
.td-sh-st .td-tam { margin: 0; font-size: 0.9375rem; font-weight: 600; }
.td-sh-st.is-wait { color: var(--td-amber-ink); }
.td-tm { display: flex; align-items: center; gap: 4px; margin-left: auto; font: 600 min(1.1875rem, 56px)/1 var(--font-score); color: var(--tp-ink2); }
.td-tm.is-late { color: var(--td-amber-ink); }

.td-alert { display: flex; align-items: center; gap: 10px; min-height: 66px; margin-top: 12px; padding: 0 10px 0 14px; border-radius: 22px; background: var(--td-amber-bg); color: var(--td-amber-ink); }
.td-alert b { flex: 1; min-width: 0; font: 600 min(1.125rem, 56px)/1.2 var(--tp-font); }
.td-alert b .tp-num { font-size: min(1.375rem, 56px); }
.td-move { flex: none; min-height: 44px; padding: 0 18px; border: 0; border-radius: 22px; background: var(--navy); color: #fff; font: 600 1rem/1 var(--tp-font); cursor: pointer; }

/* The court's sheet: the match, then only its possible actions. */
.td-sh-hd { display: flex; align-items: center; gap: 7px; }
.td-sh-hd .td-court { margin-right: 4px; font-size: min(1.875rem, 56px); }
.td-sh-code { font: 600 1.0625rem/1 var(--font-score); color: var(--tp-muted); }
.td-sh-time { margin-left: auto; font: 600 min(1.25rem, 56px)/1 var(--font-score); color: var(--tp-ink2); }
.td-sh-sd { display: flex; align-items: center; gap: 12px; min-height: 52px; }
.td-acts { display: flex; flex-direction: column; gap: 10px; }
.tour-page .tp-btn.td-quiet { background: var(--tp-soft); color: var(--tp-ink); }
.tour-page .tp-btn.td-red { background: #c0392b; color: #fff; }
.tour-page .tp-btn.td-ghost { background: transparent; color: var(--tp-ink); box-shadow: inset 0 0 0 2px var(--tp-bar); }
.td-refs .tp-chip { min-height: 40px; padding: 0 16px; border: 0; border-radius: 20px; background: var(--tp-soft); color: var(--tp-ink); font: 500 1rem/1 var(--tp-font); cursor: pointer; }
.td-refs .tp-chip.is-on { background: var(--navy); color: #fff; }

/* ---------- 256 and 257: phone screens without the dock ---------- */

body.td-nodock .dock, body.td-nodock .dock-sheet { display: none !important; }
body.td-nodock { padding-bottom: 0; }
.td-nodock #tour { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
.td-cta { position: fixed; z-index: 20; left: 0; right: 0; bottom: calc(24px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; padding: 0 16px; }
.td-cta .tp-btn { min-height: 56px; border-radius: 28px; font-size: min(1.125rem, 56px); }
.td-cta .tp-btn:disabled { background: #dfe4ec; color: #7c879c; cursor: default; filter: none; }

.td-seg { display: flex; height: 44px; margin-top: 14px; padding: 3px; border-radius: 22px; background: var(--tp-seg-track); }
.td-seg button { flex: 1; border: 0; border-radius: 19px; background: none; color: var(--tp-ink2); font: 500 1rem/1 var(--tp-font); cursor: pointer; }
.td-seg button[aria-checked="true"] { background: var(--tp-seg-on); color: var(--tp-ink); font-weight: 600; box-shadow: var(--tp-seg-shadow); }
.td-sets { display: flex; gap: 8px; margin-top: 10px; }
.td-sets .tp-chip { min-height: 44px; padding: 0 14px; border: 0; border-radius: 22px; background: var(--tp-card); color: var(--tp-ink2); font: 500 0.9375rem/1 var(--tp-font); cursor: pointer; }
.td-sets .tp-chip.is-on { background: var(--navy); color: #fff; }
.td-sets .tp-chip b { font-size: 1.0625rem; }
.td-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.td-r { display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 0 10px 0 14px; border-radius: 20px; background: var(--tp-card); cursor: pointer; }
.td-nm { flex: 1; min-width: 0; font: 400 0.9375rem/1.2667 var(--tp-font); color: var(--tp-ink); }
.td-nm b { display: block; font-weight: 400; white-space: normal; overflow-wrap: anywhere; }
.td-bx { display: grid; flex: none; place-items: center; width: 72px; height: 58px; border-radius: 14px; background: var(--tp-soft); font: 600 42px/1 var(--font-score); color: var(--tp-brand-ink); cursor: pointer; }
.td-bx.is-on { display: flex; align-items: center; justify-content: center; background: var(--tp-card); box-shadow: inset 0 0 0 3px var(--tp-brand-ink); }
.td-bx.is-on::after { content: ""; width: 3px; height: 30px; margin-left: 4px; background: var(--tp-brand-ink); animation: td-caret 1s steps(1) infinite; }
@keyframes td-caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .td-bx.is-on::after { animation: none; } }
.td-mk { flex: none; padding: 7px 10px; border-radius: 14px; font: 600 0.8125rem/1 var(--tp-font); }
.td-mk.is-absent, .td-mk.is-retired { background: var(--td-down-bg); color: var(--td-down); }
.td-r.is-marked .tr-pr, .td-r.is-marked .td-nm { opacity: 0.5; }
.td-kp { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.td-kp button { min-height: 60px; border: 0; border-radius: 16px; background: var(--tp-card); color: var(--tp-ink); font: 500 min(1.875rem, 56px)/1 var(--font-score); box-shadow: 0 1px 0 rgba(7, 22, 52, 0.08); cursor: pointer; }
.td-kp button .tp-ic { margin: 0 auto; }
.td-kp button:active { filter: brightness(0.94); }
.td-kp button:disabled { opacity: 0.4; cursor: default; }
.tour-page .td-switch { width: 100%; margin: 16px 0 0; font-size: 1rem; }
.td-pad .tp-error, .td-wo .tp-error { margin-top: 10px; }

.td-clock { display: flex; align-items: center; justify-content: center; gap: 22px; height: 132px; margin-top: 14px; border-radius: 24px; background: var(--tp-card); }
.td-rw { position: relative; width: 108px; height: 108px; }
.td-rw > b { position: absolute; inset: 0; display: grid; place-items: center; font: 600 min(2.75rem, 66px)/1 var(--font-score); color: var(--tp-brand-ink); }
.td-rw > b.is-late { color: var(--td-down); }
.td-woring { display: block; }
.td-woring .is-track { stroke: var(--tp-bar); }
.td-woring .is-bar { stroke: var(--tp-brand-ink); }
.td-woring.is-late .is-bar { stroke: var(--td-down); }
.td-lg2 { display: flex; flex-direction: column; gap: 8px; }
.td-lg2 i { display: flex; align-items: center; gap: 7px; font: 500 1rem/1 var(--tp-font); font-style: normal; color: var(--tp-muted); }
.td-lg2 b { font: 600 min(2.5rem, 60px)/1 var(--font-score); color: var(--tp-brand-ink); }
.td-wo-sd { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; min-height: 116px; margin-top: 14px; padding: 12px 16px; border-radius: 24px; background: var(--tp-card); }
.td-wo-sd.is-gone .tr-pr, .td-wo-sd.is-gone .td-nm { opacity: 0.45; filter: grayscale(1); }
.td-st { display: inline-flex; flex: none; align-items: center; gap: 5px; min-height: 34px; padding: 0 14px; border-radius: 17px; font: 600 0.9375rem/1 var(--tp-font); white-space: nowrap; }
.td-st.is-ok { background: var(--td-up-bg); color: var(--td-up); }
.td-st.is-no { background: var(--td-down-bg); color: var(--td-down); }
.td-res { display: flex; align-items: center; justify-content: center; gap: 14px; height: 76px; margin-top: 14px; border-radius: 22px; box-shadow: inset 0 0 0 2px var(--tp-bar); }
.td-res b { font: 600 min(2.5rem, 60px)/1 var(--font-score); color: var(--tp-brand-ink); }
.td-two { position: fixed; z-index: 20; left: 0; right: 0; bottom: calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; max-width: 560px; margin: 0 auto; padding: 0 16px; }
.td-two .tp-btn { min-height: 56px; border-radius: 28px; font-size: min(1.125rem, 56px); }
.td-two .td-ghost { background: var(--tp-card); }
.td-wo { padding-bottom: 150px; }

/* ---------- 260 "Dời trận": the two courts side by side, the move as a dashed arrow ---------- */

.td-mv { padding-bottom: 60px; }
.td-mv-grid { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; padding: 12px; border-radius: 24px; background: var(--tp-card); color: var(--tp-brand-ink); }
.td-mv-grid.is-one { grid-template-columns: 1fr; }
.td-mv-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.td-mv-ch { display: flex; align-items: center; justify-content: center; gap: 8px; height: 40px; }
.td-mv-ch b { font: 600 min(1.5rem, 56px)/1 var(--font-score); letter-spacing: 0.02em; color: var(--tp-brand-ink); }
.td-mv-d { display: inline-flex; align-items: center; gap: 4px; min-height: 26px; padding: 0 8px; border-radius: 13px; font: 600 1rem/1 var(--font-score); }
.td-mv-d s { opacity: 0.55; text-decoration-thickness: 2px; }
.td-mv-d.is-ok { background: var(--td-up-bg); color: var(--td-up); }
.td-mv-d.is-late { background: var(--td-amber-bg); color: var(--td-amber-ink); }
.td-mv-c { display: flex; flex-direction: column; justify-content: space-between; min-width: 0; height: 84px; padding: 8px 10px; border-radius: 16px; background: var(--tp-bg); box-sizing: border-box; }
.td-mv-c.is-live { background: var(--tp-card); box-shadow: inset 0 0 0 2px #f2a19a; }
.td-mv-c.is-ghost { background: transparent; opacity: 0.6; outline: 2px dashed var(--tp-ghost); outline-offset: -2px; }
.td-mv-c.is-new { background: var(--tp-optic-soft); box-shadow: 0 0 0 3px var(--optic); }
.td-mv-t { display: flex; align-items: center; gap: 6px; }
.td-mv-t .tr-etile { min-height: 22px; padding: 0 6px; border-radius: 7px; font-size: 0.9375rem; }
.td-mv-tm { margin-left: auto; font: 600 min(1.125rem, 56px)/1 var(--font-score); color: var(--tp-ink2); }
.td-mv-tm.is-late { color: var(--td-amber-ink); }
.td-mv-ps { display: flex; align-items: center; gap: 4px; min-width: 0; }
.td-mv-vs { font: 600 0.75rem/1 var(--font-score); color: #a3adbf; text-transform: uppercase; }
.td-mv-sc { margin-left: auto; font: 600 min(1.3125rem, 56px)/1 var(--font-score); color: var(--tp-brand-ink); white-space: nowrap; }
.td-mv-arrow { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.td-mv-nt { display: flex; align-items: center; gap: 10px; min-height: 56px; margin-top: 14px; padding: 0 16px; border-radius: 18px; background: var(--tp-card); font: 500 1rem/1 var(--tp-font); color: var(--tp-ink2); }
.td-mv-nt .tp-ic { flex: none; color: var(--tp-brand-ink); }
.td-mv-nt b { margin-right: 4px; font-size: min(1.375rem, 56px); font-weight: 600; color: var(--tp-brand-ink); }
.td-mv-out { margin: 10px 0 0; padding: 12px 16px; border-radius: 14px; background: var(--td-amber-bg); color: var(--td-amber-ink); font: 500 0.9375rem/1.35 var(--tp-font); }
.td-mv .tp-error { margin-top: 10px; }
.td-mv-cta { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.td-mv-other { min-height: 40px; padding: 0 16px; border: 0; background: none; color: var(--tp-brand-ink); font: 500 0.9375rem/1 var(--tp-font); cursor: pointer; }
.td-mv-targets .tp-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 22px; background: var(--tp-soft); color: var(--tp-ink); font: 500 1rem/1 var(--tp-font); cursor: pointer; }
.td-mv-targets .tp-chip b { font: 600 min(1.1875rem, 56px)/1 var(--font-score); }
.td-mv-targets .tp-chip small { font: 600 0.9375rem/1 var(--font-score); color: var(--tp-muted); }
.td-mv-targets .tp-chip.is-on { background: var(--navy); color: #fff; }
.td-mv-targets .tp-chip.is-on small { color: rgba(255, 255, 255, 0.75); }

/* ---------- 265: the Zalo message (copy) and the schedule image (save) ---------- */

.td-zl { display: flex; flex-direction: column; gap: 12px; }
.td-zl-msg { display: flex; align-items: flex-end; gap: 10px; }
.td-zl-bub { flex: 1; min-width: 0; margin: 0; padding: 10px 12px; border-radius: 14px; background: var(--tp-soft); font: 400 1.0625rem/1.3529 var(--tp-font); color: var(--tp-ink); }
.td-zl-copy { display: inline-flex; flex: none; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 0; border-radius: 20px; background: var(--tp-soft); color: var(--tp-brand-ink); font: 600 0.9375rem/1 var(--tp-font); cursor: pointer; }
.td-zl-img { display: flex; justify-content: center; }
.td-zl-img img { display: block; width: 100%; max-width: 300px; height: auto; border-radius: 14px; }
.tour-page .td-zl-save, .td-zl-save { min-height: 52px; border-radius: 26px; font-size: 1.0625rem; }
.td-zl-save:disabled { background: #dfe4ec; color: #7c879c; cursor: default; }

/* ---------- Computers (the desktop language of 236–245) ---------- */

@media (min-width: 1100px) {
  .td-board .td-sum { height: 76px; padding: 0 22px 0 14px; }
  .td-board .td-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 16px; }
  .td-board .td-cc { min-height: 250px; padding: 16px 16px 12px; }
  .td-board .td-cc:hover { box-shadow: 0 0 0 1.5px var(--tp-line); }
  .td-board .td-court { font-size: min(1.875rem, 56px); }
  .td-board .td-g { font-size: min(2.75rem, 66px); }
  .td-board .td-sd { gap: 10px; height: 50px; }
  .td-board .td-sn { display: block; flex: 1; min-width: 0; font: 500 0.9375rem/1.2 var(--tp-font); color: var(--tp-ink2); white-space: normal; overflow-wrap: anywhere; }
  .td-board .td-sd.is-lo .td-sn { color: var(--tp-muted); }
  .td-board .td-g { margin-left: 0; }
  .td-board .td-alert { margin-top: 16px; padding: 0 12px 0 22px; }
  .td-col { max-width: 560px; margin: 0 auto; }
}

/* W6: the referees' place from "Hôm nay" (a whistle with a red badge), a court without a referee, two courts at once. */
.td-refs-go { position: relative; }
.td-ref.is-none .td-ref-n { color: #8a5a00; }

/* Large text (W7): one court per row, its header wrapping. */
html.tp-tight .td-grid, html.tp-tight .td-mv-grid { grid-template-columns: 1fr; }
html.tp-tight .td-tag { white-space: normal; }
html.tp-tight .td-ch { flex-wrap: wrap; height: auto; min-height: 28px; }

/* BTC's W.O. view: who the referee ticked present on each side (R-B N1). */
.td-wo-ps { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; padding-bottom: 2px; }
.td-wo-p { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 12px; font: 500 0.875rem/1.2 var(--tp-font); }
.td-wo-p.is-ok { background: var(--tp-ok-soft); color: var(--tp-ok); }
.td-wo-p.is-no { background: var(--tp-bad-soft); color: var(--tp-bad); }

/* A court done for the day (R-D 5): its last result under "Xong cả ngày". */
.td-tag.is-done { margin-left: auto; background: var(--tp-ok-soft); color: var(--tp-ok); }
.td-tag.is-ready { background: var(--tp-optic-soft); color: var(--tp-ink); font-family: var(--tp-font); font-size: 0.875rem; }
.td-own { margin: 8px 0; font: 600 1rem/1.3 var(--tp-font); color: var(--tp-amber-ink); text-align: center; }
