:root {
  --bg: #0f1419;
  --panel: #1a2128;
  --panel-2: #222b34;
  --line: #2c3742;
  --text: #e6edf3;
  --muted: #8b98a5;
  --accent: #c3f53c;
  --live: #ff4d4f;
  --win: #c3f53c;
  --skeleton: #222b34;
}

[data-theme="light"] {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-2: #e8ecf0;
  --line: #d0d7de;
  --text: #1f2328;
  --muted: #656d76;
  --accent: #2d8a4e;
  --live: #cf222e;
  --win: #2d8a4e;
  --skeleton: #e0e4e8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* Installed (standalone) the page draws under the status bar and the gesture
   bar, so the insets are added to the normal padding. env() resolves to 0 in a
   regular browser tab, which leaves the desktop layout untouched. */
.app {
  max-width: 980px;
  margin: 0 auto;
  padding:
    calc(20px + env(safe-area-inset-top))
    calc(16px + env(safe-area-inset-right))
    calc(60px + env(safe-area-inset-bottom))
    calc(16px + env(safe-area-inset-left));
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 18px;
}
.topbar h1 { font-size: 22px; margin: 0; }

.live-indicator {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--muted);
}
.live-indicator .dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--muted);
}
.live-indicator.on .dot { background: var(--live); box-shadow: 0 0 8px var(--live); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin-bottom: 18px;
}
.tabs { display: flex; gap: 4px; background: var(--panel); padding: 4px; border-radius: 10px; }
.tab {
  border: 0; background: transparent; color: var(--muted);
  padding: 7px 14px; border-radius: 7px; cursor: pointer; font-size: 14px;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--accent); color: #0f1419; font-weight: 600; }

select {
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 12px; font-size: 14px; cursor: pointer;
}

.mainnav { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.navbtn {
  border: 0; background: transparent; color: var(--muted);
  padding: 10px 4px; margin-right: 18px; cursor: pointer; font-size: 15px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.navbtn:hover { color: var(--text); }
.navbtn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* filter bar */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; align-items: center; }
.filters input[type="search"] {
  flex: 1 1 220px; min-width: 180px; background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font-size: 14px;
}
.filters input[type="search"]:focus, select:focus { outline: none; border-color: var(--accent); }
.filters select { flex: 0 1 auto; }
.link-btn { background: transparent; border: 0; color: var(--muted); cursor: pointer;
  font-size: 13px; text-decoration: underline; padding: 6px; }
.link-btn:hover { color: var(--text); }
.match-count { color: var(--muted); font-size: 13px; }

.matches { display: grid; gap: 10px; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* tournament groups */
.tour-group { margin-bottom: 18px; }
.tour-head { display: flex; align-items: center; gap: 8px; padding: 6px 2px 10px;
  position: sticky; top: 0; background: var(--bg); z-index: 2; }
.tour-title { flex: 1; font-size: 14px; font-weight: 700; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.tour-count { background: var(--panel-2); color: var(--muted); font-size: 12px;
  font-weight: 700; padding: 1px 9px; border-radius: 20px; }
.tour-matches { display: grid; gap: 8px; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; cursor: pointer; transition: border-color .15s, transform .05s;
}
.card:hover { border-color: var(--accent); }
.card:active { transform: scale(.997); }
.card--live { border-left: 3px solid var(--live); }

.card-head, .d-head {
  display: flex; align-items: center; gap: 8px; font-size: 12px;
  color: var(--muted); margin-bottom: 8px;
}
.card-head .tour, .d-head .tour { flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.cat { background: var(--panel-2); padding: 2px 8px; border-radius: 6px;
  font-weight: 600; color: var(--text); }

.badge { padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.badge--live { background: rgba(255,77,79,.15); color: var(--live); }
.badge--scheduled { background: var(--panel-2); color: var(--muted); }
.badge--finished { background: var(--panel-2); color: var(--muted); }

/* scoreboard */
.board { display: grid; gap: 6px; }
.brow {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) 12px auto auto;
  align-items: center; gap: 9px;
}
.bname { display: flex; align-items: baseline; gap: 7px; min-width: 0;
  font-size: 16px; font-weight: 500; }
.bname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brow.win .bname { color: var(--win); font-weight: 700; }
.brow.loser { opacity: .5; }
.won-check { display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%; background: var(--win); color: #0f1419;
  font-size: 11px; font-weight: 800; margin-left: 4px; flex-shrink: 0; }

/* surface chips */
.surf { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 6px;
  color: #0f1419; flex-shrink: 0; }
.surf--clay { background: #d57b46; }
.surf--hard { background: #4a90d9; color: #fff; }
.surf--grass { background: #5bab5b; }
.surf--carpet { background: #9b7bd4; color: #fff; }
.surf--indoor { background: #8a98a5; }
.tour-country { color: var(--muted); font-size: 12px; }

/* broadcast chip */
.broadcast { display: inline-block; font-size: 11px; color: var(--muted);
  background: var(--panel-2); border-radius: 8px; padding: 1px 7px; white-space: nowrap;
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.d-broadcast { font-size: 13px; color: var(--muted); margin: 6px 0; padding: 6px 10px;
  background: var(--panel-2); border-radius: 8px; }
.cal-bc { font-size: 11px; color: var(--muted); flex-shrink: 0; white-space: nowrap; }

/* win probability bar */
.winprob { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.wp-label { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums;
  min-width: 30px; }
.wp-label:last-child { text-align: right; }
.wp-track { flex: 1; height: 5px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.wp-fill { height: 100%; background: var(--accent); border-radius: 3px; }
.wp-label--fav { color: var(--text); font-weight: 700; }
.winprob--past .wp-fill { background: var(--muted); }
.wp-verdict { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px;
  white-space: nowrap; }
.wp-verdict--ok { background: rgba(46, 204, 113, .15); color: var(--win); }
.wp-verdict--miss { background: rgba(231, 76, 60, .15); color: #e74c3c; }

/* bookmaker odds line */
.oddsline { display: flex; align-items: center; gap: 8px; margin-top: 6px;
  font-size: 12px; color: var(--muted); }
.odds-tag { font-weight: 600; white-space: nowrap; }
.odds-side { flex: 1; font-variant-numeric: tabular-nums; }
.odds-side b { color: var(--text); }
.odds-side small { color: var(--muted); }
.odds-side--r { text-align: right; }

/* probability detail (expanded match) */
.prob-fav { font-size: 13px; color: var(--muted); margin: 8px 0 4px; }
.prob-verdict { font-size: 13px; margin: 8px 0 4px; }
.prob-verdict--ok { color: var(--win); }
.prob-verdict--miss { color: #e74c3c; }
.prob-factors { font-size: 12px; color: var(--muted); margin: 4px 0; }
.prob-chip { display: inline-block; background: var(--panel-2); border-radius: 10px;
  padding: 1px 8px; margin-right: 4px; font-size: 11px; }

/* probability stats (player profile) */
.prob-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px; margin: 8px 0; }
.prob-stat { background: var(--panel-2); border-radius: 8px; padding: 10px;
  display: flex; flex-direction: column; gap: 2px; }
.ps-val { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ps-key { font-size: 11px; color: var(--muted); }
.pm-prob { font-size: 12px; font-weight: 600; color: var(--accent);
  font-variant-numeric: tabular-nums; flex-shrink: 0; }

/* model accuracy badge */
.count-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 4px 2px 12px; }
.model-badge { font-size: 12px; color: var(--muted); background: var(--panel-2);
  border-radius: 12px; padding: 2px 10px; }
.pl-rank { font-style: normal; color: var(--muted); font-size: 12px; font-weight: 600;
  flex-shrink: 0; }

.serve { font-size: 9px; color: transparent; transition: color .2s; }
.brow.serving .serve { color: var(--accent); }

.bsets { display: flex; gap: 4px; }
.g { min-width: 20px; text-align: center; font-variant-numeric: tabular-nums;
  font-size: 16px; color: var(--muted); font-weight: 600; padding: 1px 2px; border-radius: 4px;
  transition: background .15s, color .15s; }
.g--won { color: var(--text); }
.g--cur { color: var(--text); background: var(--panel-2); }
.g--flash { animation: flash-score .8s ease-out; }
@keyframes flash-score {
  0% { background: var(--accent); color: #0f1419; }
  100% { background: transparent; color: inherit; }
}
.g sup { font-size: 9px; vertical-align: super; margin-left: 1px; color: var(--muted); }
.bpts { min-width: 30px; text-align: center; font-size: 17px; font-weight: 700;
  color: var(--live); font-variant-numeric: tabular-nums; transition: background .15s; }
.bpts--flash { animation: flash-score .8s ease-out; }
.bwon { min-width: 22px; text-align: center; font-size: 18px; font-weight: 700;
  font-variant-numeric: tabular-nums; }
.brow--flash-serve .serve { animation: flash-serve .8s ease-out; }
@keyframes flash-serve {
  0% { color: var(--accent); transform: scale(1.5); }
  100% { color: var(--accent); transform: scale(1); }
}

.mini-photo { width: 30px; height: 30px; border-radius: 50%; object-fit: cover;
  flex-shrink: 0; background: var(--panel-2); }
.mini-photo--ph { display: inline-flex; align-items: center; justify-content: center; }
.mini-photo--ph svg { width: 18px; height: 18px; opacity: .35; }

/* compact set chips (used in the match drawer) */
.sets-won { display: grid; gap: 6px; text-align: center; font-size: 18px; font-weight: 700; }
.sets-won i { font-style: normal; }
.sets { display: flex; gap: 8px; }
.set { display: grid; gap: 6px; text-align: center; font-variant-numeric: tabular-nums;
  color: var(--muted); font-size: 15px; }
.set b { color: var(--text); font-weight: 600; }
.set i { font-style: normal; }

.card-foot { margin-top: 10px; font-size: 12px; color: var(--muted);
  display: flex; align-items: center; justify-content: space-between; }
.card-toggle { transition: transform .2s; opacity: .6; }
.card--open { border-color: var(--accent); cursor: default; }
.card--open .card-toggle { transform: rotate(180deg); }

.card-detail { margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line);
  cursor: default; }
.card-detail .d-sec { margin: 16px 0 8px; font-size: 13px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; }
.card-detail .d-sec:first-child { margin-top: 0; }
.card-detail .d-meta { color: var(--muted); font-size: 12px; margin: 0 0 4px; }
.empty.small { padding: 14px 0; font-size: 13px; }

/* drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 10; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(460px, 100%);
  background: var(--panel); border-left: 1px solid var(--line); z-index: 11;
  padding: 22px; overflow-y: auto; box-shadow: -8px 0 30px rgba(0,0,0,.4);
}
.drawer-close {
  position: absolute; top: 14px; right: 16px; background: transparent; border: 0;
  color: var(--muted); font-size: 28px; line-height: 1; cursor: pointer;
}
.drawer-close:hover { color: var(--text); }

.d-head { margin-top: 6px; }
.d-score { margin: 14px 0; }
.d-players { display: grid; gap: 8px; font-size: 18px; }
.d-players .win { color: var(--win); font-weight: 700; }
.d-sets { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.d-sets .sets-won { font-size: 22px; }
.d-meta { color: var(--muted); font-size: 13px; }

.drawer h3 { margin: 22px 0 10px; font-size: 15px; }
table.stats { width: 100%; border-collapse: collapse; }
table.stats thead th { color: var(--muted); font-size: 13px; padding: 6px 4px;
  border-bottom: 1px solid var(--line); }
table.stats thead th:first-child { text-align: left; }
table.stats thead th:last-child { text-align: right; }
table.stats tbody th { font-weight: 500; color: var(--muted); font-size: 13px;
  text-align: center; padding: 8px 4px; }
table.stats td.sv { font-variant-numeric: tabular-nums; font-weight: 600;
  width: 35%; padding: 8px 4px; }
table.stats td.sv:first-child { text-align: left; }
table.stats td.sv:last-child { text-align: right; }
table.stats tbody tr { border-bottom: 1px solid var(--line); }

/* ATP player cards in drawer */
.pcard { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  margin-bottom: 10px; padding: 4px 12px; }
.pcard summary { cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 8px 0; list-style: none; }
.pcard summary::-webkit-details-marker { display: none; }
.pc-photo { width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
  background: var(--bg); flex-shrink: 0; }
.pc-rank { color: var(--accent); font-weight: 700; min-width: 34px; }
.pc-name { flex: 1; font-weight: 600; }
.pc-pts { color: var(--muted); font-size: 13px; }
.flag-chip { background: var(--bg); color: var(--muted); font-size: 10px;
  padding: 1px 5px; border-radius: 4px; margin-left: 4px; vertical-align: middle; }
.pcard--empty { color: var(--muted); font-size: 13px; padding: 10px 12px; }
.pcard--empty span { display: block; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.pcard--empty p { margin: 0; }
table.bio { width: 100%; border-collapse: collapse; margin: 4px 0 10px; }
table.bio th { text-align: left; color: var(--muted); font-weight: 500; font-size: 13px;
  padding: 5px 0; vertical-align: top; width: 48%; }
table.bio td { text-align: right; font-size: 13px; padding: 5px 0; font-weight: 600; }
table.bio tr { border-bottom: 1px solid var(--line); }

/* ATP rankings list */
.rank-list { display: grid; gap: 6px; }
.rank-row {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 16px; cursor: pointer; color: var(--text);
  font-size: 15px; transition: border-color .15s, transform .05s;
}
.rank-row:hover { border-color: var(--accent); }
.rank-row:active { transform: scale(.997); }
.rank-num { min-width: 30px; text-align: center; font-weight: 700; font-size: 17px;
  color: var(--muted); font-variant-numeric: tabular-nums; }
.rank-row .mini-photo { width: 40px; height: 40px; }
.rank-name { flex: 1; font-weight: 600; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.rank-country { color: var(--muted); font-size: 12px; letter-spacing: .04em;
  background: var(--panel-2); padding: 2px 8px; border-radius: 6px; }
.rank-pts { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 74px;
  text-align: right; }
.rank-pts small { color: var(--muted); font-weight: 400; margin-left: 3px; font-size: 11px; }
.podium .rank-num { color: #0f1419; border-radius: 50%; width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center; }
.podium--1 .rank-num { background: #ffd34d; }
.podium--2 .rank-num { background: #cdd7e0; }
.podium--3 .rank-num { background: #e0a071; }
.podium--1 { border-color: rgba(255,211,77,.4); }
.rank-wrap code { background: var(--panel-2); padding: 2px 6px; border-radius: 4px; }
.rank-search { width: 100%; margin-bottom: 10px; background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font-size: 14px;
  box-sizing: border-box; }
.rank-search:focus { outline: none; border-color: var(--accent); }

/* calendar view (day-grouped) */
.cal-wrap { display: flex; flex-direction: column; gap: 18px; }
.cal-note { color: var(--muted); font-size: 12px; margin: 0 2px; }
.cal-day { display: flex; flex-direction: column; gap: 8px; }
.cal-day-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  position: sticky; top: 0; background: var(--bg); z-index: 1;
  padding: 6px 2px; border-bottom: 1px solid var(--line); }
.cal-day-label { font-size: 18px; font-weight: 800; text-transform: capitalize; }
.cal-day-count { color: var(--muted); font-size: 13px; }
.cal-live { color: var(--live, #e74c3c); }

.cal-tour { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.cal-tour > summary { display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  cursor: pointer; list-style: none; }
.cal-tour > summary::-webkit-details-marker { display: none; }
.cal-tour > summary::before { content: '▸'; color: var(--muted); font-size: 11px;
  transition: transform .15s; }
.cal-tour[open] > summary::before { transform: rotate(90deg); }
.cal-tour-name { font-weight: 700; flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.cal-tour-country { color: var(--muted); font-size: 12px; }
.cal-tour-count { background: var(--panel-2); border-radius: 10px; padding: 1px 9px;
  font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.cal-matches { border-top: 1px solid var(--line); }
.cal-match { display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-bottom: 1px solid var(--line); font-size: 14px; }
.cal-match:last-child { border-bottom: none; }
.cal-match--live { background: rgba(231, 76, 60, .06); }
.cal-time { width: 64px; flex-shrink: 0; color: var(--muted); font-size: 13px;
  font-variant-numeric: tabular-nums; }
.cal-players { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.cal-players em { color: var(--muted); font-style: normal; flex-shrink: 0; }
.cal-side { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; }
.cal-side--r { justify-content: flex-end; }
.cal-side .mini-photo { width: 22px; height: 22px; flex-shrink: 0; }
.cal-nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-fav-name .cal-nm { font-weight: 700; }
.cal-odds { flex-shrink: 0; background: var(--panel-2); color: var(--muted);
  border-radius: 10px; padding: 1px 8px; font-size: 11px; font-variant-numeric: tabular-nums; }
.cal-tour-kind { color: var(--muted); font-weight: 600; font-size: 11px; }
.cal-h2h { flex-shrink: 0; background: var(--panel-2); color: var(--muted);
  border-radius: 10px; padding: 1px 8px; font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums; }

/* compact head-to-head (match detail) */
.h2h-compact { display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2); border-radius: 8px; padding: 4px 10px; margin: 6px 0;
  font-size: 12px; white-space: nowrap; cursor: default; }
.h2h-c-label { font-weight: 700; color: var(--muted); font-size: 10px;
  letter-spacing: .03em; margin-right: 2px; }
.h2h-c-name { font-weight: 600; color: var(--text); max-width: 80px;
  overflow: hidden; text-overflow: ellipsis; }
.h2h-c-name--r { text-align: right; }
.h2h-c-score { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent); }
.h2h-c-score em { color: var(--muted); font-style: normal; font-weight: 400; margin: 0 2px; }
.h2h-c-note { color: var(--muted); font-size: 11px; }
.cal-fav { flex-shrink: 0; background: var(--panel-2); color: var(--accent);
  border-radius: 10px; padding: 1px 8px; font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums; }
.cal-score { flex-shrink: 0; background: rgba(255,77,79,.15); color: var(--live);
  border-radius: 10px; padding: 1px 8px; font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.cal-serve { color: var(--accent); font-size: 9px; vertical-align: middle; }

/* calendar controls (search + category) */
.cal-controls { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.cal-controls input[type="search"] { flex: 1 1 220px; min-width: 160px;
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 12px; font-size: 14px; }
.cal-controls input[type="search"]:focus { outline: none; border-color: var(--accent); }

/* skeleton loading */
.skeleton { pointer-events: none; }
.s-line { display: inline-block; height: 14px; border-radius: 7px; background: var(--skeleton);
  animation: sk-shimmer 1.4s ease-in-out infinite; }
.s-line--sm { height: 10px; }
.s-line--lg { height: 20px; }
.s-circle { display: inline-block; width: 30px; height: 30px; border-radius: 50%;
  background: var(--skeleton); animation: sk-shimmer 1.4s ease-in-out infinite; }
@keyframes sk-shimmer { 0% { opacity: 1; } 50% { opacity: .4; } 100% { opacity: 1; } }

/* topbar actions (theme toggle, live indicator) */
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.icon-btn { background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  color: var(--muted); cursor: pointer; font-size: 18px; padding: 6px 10px; line-height: 1;
  transition: border-color .15s, color .15s; }
.icon-btn:hover { border-color: var(--accent); color: var(--text); }

/* ATP / WTA toggle in the rankings view */
.tour-toggle { display: inline-flex; gap: 4px; margin-bottom: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.tour-btn { background: none; border: none; color: var(--muted); cursor: pointer;
  font-weight: 700; font-size: 13px; padding: 5px 18px; border-radius: 999px; }
.tour-btn.active { background: var(--accent); color: #0f1419; }

/* player matches in drawer */
.ply-sec { margin: 20px 0 8px; font-size: 13px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; }
.ply-tours { display: flex; flex-wrap: wrap; gap: 6px; }
.ply-tour { background: var(--panel-2); padding: 3px 9px; border-radius: 6px; font-size: 12px; }
.ply-matches { display: grid; gap: 6px; }
.ply-match { display: flex; align-items: center; gap: 10px; font-size: 14px;
  padding: 6px 0; border-bottom: 1px solid var(--line); }
.pm-res { width: 20px; height: 20px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-size: 11px; font-weight: 800; flex-shrink: 0; }
.pm-res--V { background: var(--win); color: #0f1419; }
.pm-res--D { background: var(--panel-2); color: var(--muted); }
.pm-res--x { background: var(--panel-2); color: var(--muted); }
.pm-opp { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-tour { color: var(--muted); font-size: 12px; }

/* player compare */
.compare-row { margin: 8px 0; }
.compare-select { width: 100%; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font-size: 14px; }
.compare-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px;
  align-items: start; margin: 8px 0; }
.compare-col { display: flex; flex-direction: column; gap: 4px; }
.compare-col--r { text-align: right; }
.compare-vs { font-size: 12px; font-weight: 800; color: var(--muted);
  padding: 20px 4px 0; }
.c-name { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.c-stat { display: flex; justify-content: space-between; gap: 8px;
  font-size: 13px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.compare-col--r .c-stat { flex-direction: row-reverse; }

/* recent-form strip (V/D dots) */
.form-strip { display: flex; align-items: center; gap: 4px; font-size: 12px;
  color: var(--muted); margin: 8px 0; }
.form-dot { width: 18px; height: 18px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-size: 10px; font-weight: 800; }
.form-dot--w { background: var(--win); color: #0f1419; }
.form-dot--l { background: var(--panel-2); color: var(--muted); }

/* player drawer hero */
.ply-hero { display: flex; align-items: center; gap: 16px; margin: 6px 0 18px; }
.ply-photo { width: 90px; height: 90px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--line); flex-shrink: 0; background: var(--panel-2); }
.ply-id h2 { margin: 4px 0 2px; font-size: 20px; }
.ply-id p { margin: 0; color: var(--muted); font-size: 14px; }
.ply-rank { color: var(--accent); font-weight: 700; font-size: 14px; }
