/* Court tools kit (views/_court.cjs + client/court-kit.js): americano-generator, pickleball-round-robin, king-of-court and
 * the shared pieces of doubles-draw. Every rule sits under #visu-tools .vt-ct. Used on a phone at the court: 46px tap
 * targets, numeric score boxes, 1px hairlines. */
#visu-tools .vt-ct [hidden] { display: none !important; }
#visu-tools .vt-ct .vt-btn { white-space: normal; text-align: center; }
#visu-tools .vt-ct .vt-link-btn:disabled { opacity: .45; cursor: not-allowed; }
#visu-tools .vt-ct .vt-ct-armed { color: var(--vt-err) !important; }

/* Setup form */
#visu-tools .vt-ct .vt-ct-count { margin-top: 8px !important; font-size: 14px; color: var(--vt-muted); }
#visu-tools .vt-ct .vt-ct-setup > .vt-hint { margin-top: 8px !important; }
#visu-tools .vt-ct .vt-ct-setup > .vt-field:not(:first-child) { margin-top: 16px; }
#visu-tools .vt-ct .vt-ct-seg { margin-top: 16px !important; }
#visu-tools .vt-ct .vt-ct-nums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
#visu-tools .vt-ct .vt-ct-setup > .vt-actions { margin-top: 18px; }

/* Live tournament */
#visu-tools .vt-ct .vt-ct-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--vt-line); }
#visu-tools .vt-ct .vt-ct-head > div { min-width: 0; display: grid; gap: 2px; }
#visu-tools .vt-ct .vt-ct-summary { font-weight: 650; font-size: 15px; line-height: 1.4; color: var(--vt-ink); }
#visu-tools .vt-ct .vt-ct-head .vt-link-btn { flex: 0 0 auto; max-width: 50%; text-align: right; white-space: nowrap; }
#visu-tools .vt-ct .vt-ct-head .vt-ct-armed { flex-shrink: 1; white-space: normal; }
#visu-tools .vt-ct .vt-ct-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
#visu-tools .vt-ct .vt-ct-navb { width: 46px; height: 46px; padding: 0; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--vt-line-2); background: #fff; color: var(--vt-ink); cursor: pointer; }
#visu-tools .vt-ct .vt-ct-navb:hover:not(:disabled) { border-color: var(--vt-ink); }
#visu-tools .vt-ct .vt-ct-navb:disabled { opacity: .35; cursor: default; }
#visu-tools .vt-ct .vt-ct-rlabel { font-size: 17px; font-weight: 700; color: var(--vt-ink); text-align: center; }
#visu-tools .vt-ct .vt-ct-matches { display: grid; gap: 10px; margin-top: 14px; }
#visu-tools .vt-ct .vt-ct-rtitle { font-size: 16px !important; font-weight: 700 !important; margin-top: 12px !important; }
#visu-tools .vt-ct .vt-ct-rtitle:first-child { margin-top: 0 !important; }
#visu-tools .vt-ct .vt-ct-match { padding: 10px 12px 12px; border: 1px solid var(--vt-line); border-radius: 14px; background: var(--vt-bg); }
#visu-tools .vt-ct .vt-ct-court { margin-bottom: 6px !important; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--vt-muted); }
#visu-tools .vt-ct .vt-ct-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; }
#visu-tools .vt-ct .vt-ct-team { display: grid; gap: 2px; min-width: 0; font-size: 15.5px; font-weight: 600; line-height: 1.3; color: var(--vt-ink); }
#visu-tools .vt-ct .vt-ct-team span { overflow-wrap: anywhere; }
#visu-tools .vt-ct .vt-ct-b { text-align: right; }
#visu-tools .vt-ct .vt-ct-mid { display: flex; align-items: center; gap: 6px; }
#visu-tools .vt-ct .vt-ct-x { font-size: 13px; color: var(--vt-muted); }
#visu-tools .vt-ct input.vt-ct-score { width: 52px !important; min-height: 46px; padding: 6px 2px !important; text-align: center; font-size: 18px !important; font-weight: 700 !important; font-variant-numeric: tabular-nums; }
#visu-tools .vt-ct input.vt-ct-score:disabled { background: transparent !important; border-color: var(--vt-line) !important; color: var(--vt-text) !important; opacity: 1; }
#visu-tools .vt-ct .vt-ct-bad input.vt-ct-score { border-color: #d98a1c !important; background: #fff7e8 !important; }
#visu-tools .vt-ct .vt-ct-rest { padding: 0 2px; font-size: 14px; }
#visu-tools .vt-ct .vt-ct-rest strong { color: var(--vt-ink); font-weight: 650; }
#visu-tools .vt-ct .vt-ct-hint { margin-top: 10px !important; }
#visu-tools .vt-ct .vt-ct-roundacts { margin-top: 14px; }

/* Ranking */
#visu-tools .vt-ct .vt-ct-podium { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
#visu-tools .vt-ct .vt-ct-pod { display: grid; gap: 2px; min-width: 0; padding: 10px 8px; text-align: center; border: 1px solid var(--vt-line); border-radius: 12px; background: var(--vt-tint); }
#visu-tools .vt-ct .vt-ct-pod-1 { border-color: var(--vt-accent); }
#visu-tools .vt-ct .vt-ct-pod-n { font-size: 12px; font-weight: 700; color: var(--vt-accent-text); }
#visu-tools .vt-ct .vt-ct-pod strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; color: var(--vt-ink); }
#visu-tools .vt-ct .vt-ct-table { width: 100%; margin: 0 !important; border: 0 !important; border-collapse: collapse; table-layout: auto; font-size: 14.5px; font-variant-numeric: tabular-nums; background: none !important; }
#visu-tools .vt-ct .vt-ct-table :is(th, td) { padding: 7px 6px; border: 0 !important; border-bottom: 1px solid var(--vt-line) !important; background: none !important; text-align: right; white-space: nowrap; color: var(--vt-text); font-weight: 500; }
#visu-tools .vt-ct .vt-ct-table thead th { font-size: 12px; font-weight: 650; color: var(--vt-muted); }
#visu-tools .vt-ct .vt-ct-table :is(th, td):first-child { width: 30px; padding-left: 0; text-align: left; color: var(--vt-muted); }
#visu-tools .vt-ct .vt-ct-table :is(th, td):nth-child(2) { width: 100%; max-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: left; }
#visu-tools .vt-ct .vt-ct-table tbody th { font-weight: 600; color: var(--vt-ink); }
#visu-tools .vt-ct .vt-ct-table :is(th, td):last-child { padding-right: 0; }
#visu-tools .vt-ct .vt-ct-table .vt-ct-pts { font-weight: 750; color: var(--vt-ink); }
#visu-tools .vt-ct .vt-ct-top .vt-ct-pos { font-weight: 750; color: var(--vt-accent-text); }
#visu-tools .vt-ct .vt-ct-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
#visu-tools .vt-ct .vt-ct-replay { display: block; font-size: 14px; }
#visu-tools .vt-ct .vt-ct-replay a { font-weight: 600; }

@media (max-width: 600px) {
  #visu-tools .vt-ct .vt-ct-match { padding: 10px; }
  #visu-tools .vt-ct .vt-ct-row { gap: 8px; }
  #visu-tools .vt-ct .vt-ct-team { font-size: 15px; }
  #visu-tools .vt-ct input.vt-ct-score { width: 48px !important; }
  #visu-tools .vt-ct .vt-ct-table { font-size: 14px; }
  #visu-tools .vt-ct .vt-ct-table :is(th, td) { padding: 7px 5px; }
}

/* The choices of these forms are two or three short words: wrap them on a phone instead of the scroll strip. */
@media (max-width: 600px) {
  #visu-tools .vt-ct .vt-seg-items { flex-wrap: wrap; overflow-x: visible; margin: 0; padding: 0; }
}
