/* Виджет «Прогнозы на теннис». Цвета — переменными, сайт может переопределить их у .tp */
.tp {
  --tp-bg: #ffffff; --tp-panel: #f4f6f9; --tp-line: #e3e7ee; --tp-text: #15202b; --tp-muted: #6b7684;
  --tp-accent: #0f7b5f; --tp-accent-soft: #e2f4ee; --tp-b: #3b5bdb; --tp-b-soft: #e7ecfd;
  --tp-win: #1a9a5b; --tp-loss: #d64545; --tp-warn: #b7791f; --tp-radius: 12px;
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--tp-text); background: var(--tp-bg); border: 1px solid var(--tp-line);
  border-radius: var(--tp-radius); padding: 16px; box-sizing: border-box; max-width: 980px;
}
[data-theme="dark"] .tp, .tp.tp-dark {
  --tp-bg: #12171f; --tp-panel: #1a212c; --tp-line: #273140; --tp-text: #e8edf3; --tp-muted: #95a1b0;
  --tp-accent: #2fc28f; --tp-accent-soft: #143a2e; --tp-b: #7c96ff; --tp-b-soft: #1d2747;
}
.tp *, .tp *::before, .tp *::after { box-sizing: border-box; }
.tp h3, .tp h4, .tp p, .tp ul { margin: 0; padding: 0; }
.tp ul { list-style: none; }
.tp button { font: inherit; color: inherit; }

.tp-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.tp-title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.tp-upd { color: var(--tp-muted); font-size: 12px; }
.tp-acc { background: var(--tp-accent-soft); color: var(--tp-accent); border-radius: 999px; padding: 5px 12px; font-size: 13px; }
.tp-acc small { color: var(--tp-muted); }
.tp-note { display: flex; gap: 8px; align-items: center; margin: 12px 0; padding: 8px 12px; background: var(--tp-panel);
  border-radius: 8px; color: var(--tp-muted); font-size: 13px; }
.tp-18 { flex: none; font-weight: 700; font-size: 11px; color: #fff; background: var(--tp-loss); border-radius: 50%;
  width: 28px; height: 28px; display: grid; place-items: center; }

.tp-tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; }
.tp-tab { border: 1px solid var(--tp-line); background: var(--tp-bg); padding: 6px 14px; border-radius: 999px;
  cursor: pointer; font-weight: 600; font-size: 13px; white-space: nowrap; }
.tp-tab.is-on { background: var(--tp-text); color: var(--tp-bg); border-color: var(--tp-text); }

.tp-group { margin-bottom: 14px; border: 1px solid var(--tp-line); border-radius: 10px; overflow: hidden; }
.tp-group[hidden] { display: none; }
.tp-gh { color: var(--tp-text); display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--tp-panel); flex-wrap: wrap; }
.tp-gname { font-weight: 700; }
.tp-gcity { color: var(--tp-muted); font-size: 13px; }
.tp-tour { font-size: 11px; font-weight: 800; padding: 2px 6px; border-radius: 4px; color: #fff; background: #1d3f8f; }
.tp-tour-wta { background: #8a2c80; }
.tp-surf { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; margin-left: auto; }
.tp-surf-Hard { background: #e0ebff; color: #1f4fae; }
.tp-surf-Clay { background: #fde6d8; color: #a2471a; }
.tp-surf-Grass { background: #dff3dc; color: #2f7a25; }
.tp-chip { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--tp-panel); border: 1px solid var(--tp-line); }

.tp-match + .tp-match { border-top: 1px solid var(--tp-line); }
.tp-row { display: grid; grid-template-columns: 74px 1fr auto 18px; gap: 12px; align-items: center; width: 100%;
  padding: 10px 12px; background: none; border: 0; text-align: left; cursor: pointer; }
.tp-row:hover { background: var(--tp-panel); }
.tp-time { display: flex; flex-direction: column; font-size: 12px; color: var(--tp-muted); }
.tp-time b { font-size: 15px; color: var(--tp-text); }
.tp-round { font-size: 11px; }
.tp-live { color: var(--tp-loss) !important; }
.tp-players { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tp-pl { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tp-pl.is-fav .tp-name { font-weight: 700; }
.tp-cc { flex: none; font-size: 10px; font-weight: 700; width: 34px; text-align: center; padding: 2px 0;
  border-radius: 4px; background: var(--tp-panel); border: 1px solid var(--tp-line); color: var(--tp-muted); }
.tp-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-rank { color: var(--tp-muted); font-size: 12px; }
.tp-short { display: none; }
.tp-form { display: inline-flex; gap: 2px; margin-left: auto; }
.tp-f { font-style: normal; font-size: 9px; font-weight: 700; color: #fff; width: 15px; height: 15px; border-radius: 3px;
  display: grid; place-items: center; }
.tp-f-w { background: var(--tp-win); }
.tp-f-l { background: var(--tp-loss); opacity: .85; }
.tp-odds { display: flex; flex-direction: column; gap: 6px; }
.tp-o { width: 76px; border: 1px solid var(--tp-line); border-radius: 8px; padding: 3px 8px; display: flex;
  justify-content: space-between; align-items: baseline; background: var(--tp-bg); }
.tp-o b { font-size: 14px; }
.tp-o small { color: var(--tp-muted); font-size: 11px; }
.tp-o.is-fav { background: var(--tp-accent-soft); border-color: var(--tp-accent); }
.tp-o.is-fav b { color: var(--tp-accent); }
.tp-chev { width: 9px; height: 9px; border-right: 2px solid var(--tp-muted); border-bottom: 2px solid var(--tp-muted);
  transform: rotate(45deg); transition: transform .15s; justify-self: center; }
.tp-row[aria-expanded="true"] .tp-chev { transform: rotate(-135deg); }

.tp-detail { padding: 4px 12px 16px; }
.tp-detail[hidden] { display: none; }
.tp-bar { display: flex; height: 30px; border-radius: 8px; overflow: hidden; font-size: 12px; font-weight: 700; margin: 4px 0 10px; }
.tp-bar span { display: flex; align-items: center; padding: 0 10px; white-space: nowrap; overflow: hidden; }
.tp-bar-a { background: var(--tp-accent); color: #fff; min-width: 0; }
.tp-bar-b { flex: 1; justify-content: flex-end; background: var(--tp-b-soft); color: var(--tp-b); }
.tp-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 13px; color: var(--tp-muted); }
.tp-meta b { color: var(--tp-text); }
.tp-meter { display: inline-flex; gap: 2px; vertical-align: middle; }
.tp-meter i { width: 12px; height: 8px; border-radius: 2px; background: var(--tp-line); }
.tp-meter-1 i:nth-child(-n+1), .tp-meter-2 i:nth-child(-n+2), .tp-meter-3 i { background: var(--tp-accent); }
.tp-warn { margin-top: 8px; color: var(--tp-warn); font-size: 13px; }
.tp-cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; margin-top: 12px; }
.tp-block + .tp-block { margin-top: 14px; }
.tp-block h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--tp-muted); margin-bottom: 8px; }
/* сравнение игроков: значение 1 | показатель | значение 2, полоса от центра — в чью сторону склоняет */
.tp-cmp-head { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.tp-cmp-a { color: var(--tp-accent); }
.tp-cmp-b { color: var(--tp-b); text-align: right; }
.tp-st { padding: 7px 0; border-bottom: 1px dashed var(--tp-line); }
.tp-st-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; }
.tp-st-top > b { font-weight: 600; white-space: nowrap; }
.tp-st-top > b:last-child { text-align: right; }
.tp-st-top > span { color: var(--tp-muted); font-size: 12px; text-align: center; }
.tp-st-top > b.is-up-a { color: var(--tp-accent); font-weight: 800; }
.tp-st-top > b.is-up-b { color: var(--tp-b); font-weight: 800; }
.tp-tug { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin-top: 5px; }
.tp-tug i { display: flex; height: 5px; border-radius: 3px; background: var(--tp-panel); }
.tp-tug i:first-child { justify-content: flex-end; }
.tp-tug span { height: 100%; border-radius: 3px; }
.tp-tug-a { background: var(--tp-accent); }
.tp-tug-b { background: var(--tp-b); }
.tp-form5 { display: inline-flex; gap: 2px; }
.tp-st-top > b:last-child .tp-form5 { justify-content: flex-end; }
.tp-hint { font-size: 12px; color: var(--tp-muted); margin-top: 8px !important; }
.tp-h2h li { display: grid; grid-template-columns: 84px 1fr auto auto; gap: 8px; font-size: 12px; padding: 4px 0; border-bottom: 1px dashed var(--tp-line); }
.tp-h2h span { color: var(--tp-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-rec, .tp-cond { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; }
.tp-muted { color: var(--tp-muted); font-size: 13px; }
.tp-sun { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #f5b400; margin-right: 6px;
  box-shadow: 0 0 0 3px rgba(245, 180, 0, .25); vertical-align: -1px; }
.tp-sun.is-night { background: #6c7a96; box-shadow: none; }
.tp-cta { display: inline-block; margin-top: 14px; background: var(--tp-accent); color: #fff; text-decoration: none;
  font-weight: 700; padding: 9px 18px; border-radius: 8px; }

.tp-results[hidden], .tp-list[hidden] { display: none; }
.tp-res { display: grid; grid-template-columns: 60px 1fr auto auto; gap: 12px; align-items: center; padding: 9px 4px;
  border-bottom: 1px solid var(--tp-line); font-size: 13px; }
.tp-res-d { color: var(--tp-muted); }
.tp-res-p b { font-weight: 500; }
.tp-res-p b.is-win { font-weight: 700; }
.tp-res-p small { display: block; color: var(--tp-muted); }
.tp-res-pick { color: var(--tp-muted); font-size: 12px; }
.tp-badge { position: relative; font: inherit; font-size: 12px; font-weight: 700; padding: 3px 10px; border: 0;
  border-radius: 999px; cursor: pointer; }
/* окно с нашим прогнозом над значком */
.tp-tip { display: none; position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 5; width: max-content; max-width: 260px;
  background: var(--tp-text); color: var(--tp-bg); padding: 8px 11px; border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
  font-size: 12px; font-weight: 400; line-height: 1.5; text-align: left; white-space: normal; cursor: default; }
.tp-tip::after { content: ""; position: absolute; right: 18px; top: 100%; border: 6px solid transparent; border-top-color: var(--tp-text); }
.tp-tip-l { display: block; }
.tp-tip b { color: inherit; }
.tp-badge:hover .tp-tip, .tp-badge:focus-visible .tp-tip, .tp-badge.is-open .tp-tip { display: block; }
.tp-badge.is-hit { background: #ddf3e6; color: var(--tp-win); }
.tp-badge.is-miss { background: #fbe3e3; color: var(--tp-loss); }
.tp-empty { padding: 24px; text-align: center; color: var(--tp-muted); }
.tp-disc { margin-top: 14px; font-size: 12px; color: var(--tp-muted); border-top: 1px solid var(--tp-line); padding-top: 10px; }

@media (max-width: 600px) {
  .tp { padding: 12px; }
  .tp-row { grid-template-columns: 52px 1fr auto; gap: 8px; padding: 10px 8px; }
  .tp-chev { display: none; }
  .tp-form { display: none; }
  .tp-full { display: none; }
  .tp-short { display: inline; }
  .tp-cc { width: 30px; font-size: 9px; }
  .tp-rank { font-size: 11px; }
  .tp-o { width: 62px; padding: 3px 6px; }
  .tp-o small { display: none; }
  .tp-cols { grid-template-columns: 1fr; }
  .tp-res { grid-template-columns: 1fr auto; }
  .tp-res-d, .tp-res-pick { display: none; }
}
