/* report.css — Tournament report page styles */
/* Dark mode: html[data-theme="dark"] (standardized from html.dark / @media prefers-color-scheme) */

/* ============================================================
   REPORT-SCOPED DESIGN TOKENS (not in core.css)
   ============================================================ */

:root {
  --accent-report: #16a34a;
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --green-light: #f0fdf4;
  --highlight-player-bg: #fef9ec;
  --status-warning: #f59e0b;
  --status-warning-bg: rgba(245, 158, 11, 0.08);
  --text-tertiary: #94a3b8;
}

html[data-theme="dark"] {
  --accent-report: #4ade80;
  --green-light: #052e16;
  --highlight-player-bg: #3b2f1a;
  --text-tertiary: #64748b;
}

/* ============================================================
   REPORT HEADER
   ============================================================ */

.report-header {
  max-width: 1000px;
  margin: 12px auto 24px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
}

.report-header-logo-link { display: none; }
.report-header-logo { display: none; }

.report-header-text {
  text-align: center;
}

h1 {
  color: var(--text-primary);
  text-align: center;
  margin: 0;
  font-size: 2.2em;
  font-weight: bold;
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
}

/* ============================================================
   TOURNAMENT NAME / DATES ROW
   ============================================================ */

.tournament-dates-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 8px 0 12px;
}

.tournament-dates {
  text-align: center;
  color: var(--text-primary);
  font-size: 1.3em;
  font-weight: 600;
  font-family: var(--font-heading);
}

.deadline-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--status-warning);
  background: var(--status-warning-bg);
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-primary);
  white-space: nowrap;
}
html[data-theme="dark"] .deadline-badge {
  border-color: #d97706;
  background: rgba(217, 119, 6, 0.12);
}

.deadline-countdown {
  font-weight: 700;
  color: var(--status-warning);
}

.deadline-date {
  font-size: 11px;
  color: var(--text-secondary);
}

.tournament-info {
  text-align: center;
  color: var(--text-secondary);
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.6;
}

.tournament-info a {
  color: inherit;
  text-decoration: underline;
}

.partner-jump {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

tr.partner-highlight td {
  background: var(--highlight-player-bg) !important;
}

tr.seeded-team td:first-child {
  border-left: 4px solid #cfe3ff;
}

/* ============================================================
   TABLE META / KEY STATS / LINK LEGEND
   ============================================================ */

.table-meta {
  max-width: 1000px;
  margin: 10px auto 6px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

/* Align section titles with the table left edge */
.table-section-title {
  max-width: 1000px;
  width: 100%;
  margin: 32px auto 12px;
  padding-left: 14px;
  position: relative;
  color: var(--text-primary);
  font-size: 1.3em;
  font-weight: 700;
  text-align: left;
  font-family: var(--font-heading);
}
.table-section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 3px;
  background: var(--green-primary);
  border-radius: 2px;
}

.key-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
  font-size: 12px;
  color: var(--text-primary);
}

.key-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
}

.key-stat .key-value {
  font-weight: 700;
  color: #1f3b68;
}

.key-stat:not(:last-child)::after {
  content: "•";
  margin-left: 8px;
  color: #9aa9c0;
}

.link-legend {
  text-align: right;
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  font-style: italic;
}

.selection-callout {
  margin: 8px 0 12px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-primary);
  background-color: var(--green-light);
  border-left: 3px solid var(--green-primary);
  border-radius: var(--radius-sm);
}

/* ============================================================
   TABLE STYLES
   ============================================================ */

table {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  border-collapse: collapse;
  background-color: var(--bg-secondary);
  box-shadow: var(--card-shadow);
}

th {
  background-color: var(--court-green);
  color: rgba(255, 255, 255, 0.85);
  padding: 10px 10px;
  text-align: left;
  font-weight: 700;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: none;
  border-right: none;
}

.players-table th {
  white-space: nowrap;
}

th:last-child {
  border-right: none;
}

/* Sortable column indicator */
th.sortable {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

th.sortable:hover {
  background-color: var(--court-green-light);
  color: #fff;
}

th.sortable[data-sort="asc"],
th.sortable[data-sort="desc"] {
  background-color: var(--court-green-light);
  color: #fff;
}

th.sortable::after {
  content: ' ⇅';
  font-size: 0.65em;
  opacity: 0.45;
  margin-left: 4px;
}

th.sortable[data-sort="asc"]::after {
  content: ' ↑';
  opacity: 1;
}

th.sortable[data-sort="desc"]::after {
  content: ' ↓';
  opacity: 1;
}

td {
  padding: 8px 10px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

/* Alternating row colors */
tbody tr:nth-child(odd) {
  background-color: var(--bg-primary);
}

tbody tr:nth-child(even) {
  background-color: var(--bg-secondary);
}

/* Hover effect */
tbody tr:hover {
  background-color: var(--green-light) !important;
  cursor: pointer;
}

/* Highlighted player row — green accent */
tr.highlight-player {
  background-color: var(--green-light) !important;
}

tr.highlight-player:hover {
  background-color: var(--green-light) !important;
}

tr.highlight-player td {
  color: var(--text-primary);
  font-weight: 600;
}

tr.highlight-player td.col-wtn {
  font-weight: normal;
}

tr.highlight-player td:nth-child(1) {
  border-left: 4px solid var(--green-primary);
}

/* Column alignment */
.col-rank {
  text-align: center;
  width: 50px;
  font-weight: 600;
  color: var(--text-secondary);
}

.col-wtn {
  text-align: right;
  font-weight: normal;
}

.col-utr, .col-national {
  text-align: right;
  font-weight: 600;
}

.col-wtn, .col-utr {
  width: 70px;
}

.col-national {
  width: 85px;
}

tbody td:nth-child(3) {
  text-transform: capitalize;
}

td.col-wtn, td.col-utr, td.col-national {
  box-shadow: inset 0 0 0 9999px rgba(68, 114, 196, 0.06);
}

/* Links inside metric cells (keep visual style) */
td.col-wtn a, td.col-utr a, td.col-national a {
  color: inherit;
  text-decoration: none;
  display: inline-block;
  width: 100%;
}

td.col-wtn a:hover, td.col-utr a:hover, td.col-national a:hover {
  text-decoration: underline;
}

/* ============================================================
   STATISTICS SECTION
   ============================================================ */

.stats-section {
  max-width: 1000px;
  margin: 30px auto;
  padding: 20px;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
}

.stats-section h2 {
  color: var(--text-primary);
  margin-top: 0;
  border-bottom: 2px solid var(--green-primary);
  padding-bottom: 10px;
  font-family: var(--font-heading);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-top: 15px;
}

.stat-box {
  padding: 15px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--green-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 5px;
}

.stat-value {
  font-size: 20px;
  font-weight: bold;
  color: var(--text-primary);
}

/* ============================================================
   UTR HISTOGRAM
   ============================================================ */

.utr-histogram {
  max-width: 1000px;
  margin: 20px auto;
  padding: 16px 20px;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
}

.utr-histogram h2,
.utr-histogram h3 {
  color: var(--text-primary);
  margin-top: 0;
  border-bottom: 2px solid var(--green-primary);
  padding-bottom: 8px;
  font-family: var(--font-heading);
}

.utr-subtitle {
  font-weight: normal;
  font-size: 12px;
  color: var(--text-muted);
}

.utr-histogram-chart {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.utr-bin {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-primary);
}

.utr-bin-label {
  width: 90px;
  text-align: right;
  color: var(--text-muted);
}

.utr-bin-bar-wrap {
  flex: 1;
  height: 12px;
  background-color: #eef2f8;
  border-radius: 999px;
  overflow: hidden;
}

.utr-bin-bar {
  height: 100%;
  background-color: var(--green-primary);
  border-radius: 999px;
}

.utr-bin.is-highlight .utr-bin-bar {
  background-color: var(--highlight-player);
}

.utr-bin-count {
  width: 28px;
  text-align: right;
  font-weight: 600;
  color: var(--text-primary);
}

.utr-histogram-caption {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 12px;
  padding-bottom: 4px;
  text-align: center;
}

/* ============================================================
   TOURNAMENT DETAILS PAGE
   ============================================================ */

.tournament-details-page {
  max-width: 1000px;
  margin: 30px auto;
  padding: 30px;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  page-break-before: always;
}

.tournament-details-page h2 {
  color: var(--text-primary);
  border-bottom: 3px solid var(--accent-report);
  padding-bottom: 10px;
  margin-top: 0;
  font-family: var(--font-heading);
}

.tournament-details-page h3 {
  color: var(--accent-report);
  margin-top: 25px;
  margin-bottom: 10px;
  font-family: var(--font-heading);
}

.detail-row {
  display: grid;
  grid-template-columns: minmax(140px, 180px) minmax(0, 1fr);
  column-gap: 12px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.detail-label {
  font-weight: bold;
  color: var(--text-secondary);
  display: block;
}

.detail-value {
  color: var(--text-primary);
  min-width: 0;
  overflow-wrap: anywhere;
}

.important-note {
  background-color: #fff9e6;
  border-left: 4px solid #ffc107;
  padding: 15px;
  margin-top: 20px;
  border-radius: var(--radius-sm);
}

/* ============================================================
   SHARE BUTTON
   ============================================================ */

.share-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--accent-report);
  color: white;
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.share-button:hover {
  background-color: #2c5aa0;
  transform: scale(1.05);
}

.share-button:active {
  transform: scale(0.95);
}

/* ============================================================
   STICKY HEADER
   ============================================================ */

.sticky-header {
  position: sticky;
  top: 52px;
  z-index: 100;
  box-shadow: 0 1px 6px rgba(0,0,0,0.12);
}

/* Opaque background when stuck so rows don't bleed through */
.sticky-header th {
  background-color: var(--court-green);
}

html[data-theme="dark"] .sticky-header th {
  background-color: var(--court-green);
}

/* ============================================================
   LINKS
   ============================================================ */

/* Click-to-call phone link */
a[href^="tel"] {
  color: var(--accent-report);
  text-decoration: none;
  font-weight: 600;
}

a[href^="tel"]:hover {
  text-decoration: underline;
}

/* ============================================================
   DARK MODE — TOKEN OVERRIDES
   ============================================================ */

html[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: rgba(255,255,255,0.08);
  --border-color: #334155;
  --border-subtle: rgba(255,255,255,0.04);
  --accent-report-light: #2a3a52;
  --highlight-player-bg: #3b2f1a;
  --green-primary: #4ade80;
  --green-light: #052e16;
  --green-border: #4ade80;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
}

/* Also carry mobile dark-mode variables */
html[data-theme="dark"] {
  --mobile-bg: #0a0a0f;
  --mobile-surface: #16161e;
  --mobile-surface-elevated: #1e1e28;
  --mobile-border: #2a2a38;
  --mobile-text-primary: #f5f5f7;
  --mobile-text-secondary: #c7c7cc;
  --mobile-text-muted: #9a9aa0;
  --mobile-accent: #ff9f0a;
  --mobile-accent-soft: rgba(255, 159, 10, 0.15);
  --mobile-green: #30d158;
  --mobile-green-soft: rgba(48, 209, 88, 0.15);
  --mobile-blue: #0a84ff;
  --mobile-blue-soft: rgba(10, 132, 255, 0.15);
  --mobile-purple: #bf5af2;
}

/* ============================================================
   DARK MODE — COMPONENT OVERRIDES
   ============================================================ */

html[data-theme="dark"] .report-header-logo {
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

html[data-theme="dark"] th {
  background-color: var(--court-green);
  color: rgba(255, 255, 255, 0.85);
  border-bottom: none;
}

html[data-theme="dark"] tbody tr:hover {
  background-color: rgba(74, 222, 128, 0.08) !important;
}

html[data-theme="dark"] tr.highlight-player {
  background-color: var(--green-light) !important;
}

html[data-theme="dark"] tr.highlight-player:hover {
  background-color: var(--green-light) !important;
}

html[data-theme="dark"] tr.highlight-player td {
  color: var(--text-primary);
}

html[data-theme="dark"] tr.highlight-player td:nth-child(1) {
  border-left-color: var(--green-primary);
}

html[data-theme="dark"] .stats-section h2, html[data-theme="dark"] .tournament-details-page h2,
html[data-theme="dark"] .tournament-details-page h3, html[data-theme="dark"] .utr-histogram h2,
html[data-theme="dark"] .utr-histogram h3 {
  border-bottom-color: var(--green-primary);
}

html[data-theme="dark"] .stat-box {
  border-left-color: var(--green-primary);
}

html[data-theme="dark"] .utr-bin-bar-wrap {
  background-color: #2f3644;
}

html[data-theme="dark"] .utr-bin-bar {
  background-color: var(--green-primary);
}

html[data-theme="dark"] .utr-bin.is-highlight .utr-bin-bar {
  background-color: var(--highlight-player);
}

html[data-theme="dark"] .key-stat {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
}

html[data-theme="dark"] .key-stat .key-value {
  color: var(--text-primary);
}

html[data-theme="dark"] td.col-wtn, html[data-theme="dark"] td.col-utr,
html[data-theme="dark"] td.col-national {
  box-shadow: inset 0 0 0 9999px rgba(120, 160, 220, 0.08);
}

html[data-theme="dark"] .selection-callout {
  background-color: var(--green-light);
  border-left-color: var(--green-primary);
}

html[data-theme="dark"] .important-note {
  background-color: #3a3a1a;
  border-left-color: #d4a700;
}

html[data-theme="dark"] a {
  color: #6b9bd1;
}

html[data-theme="dark"] a:hover {
  color: #8bb3e0;
}

html[data-theme="dark"] .share-button {
  background-color: #3a5a8a;
}

html[data-theme="dark"] .share-button:hover {
  background-color: #4a6a9a;
}

/* ============================================================
   MOBILE LAYOUT VARIABLES (light mode defaults)
   ============================================================ */

:root {
  --mobile-bg: #f5f5f7;
  --mobile-surface: #ffffff;
  --mobile-surface-elevated: #f8f8f8;
  --mobile-border: #d1d1d6;
  --mobile-text-primary: #000000;
  --mobile-text-secondary: #6e6e73;
  --mobile-text-muted: #8e8e93;
  --mobile-accent: #ff9f0a;
  --mobile-accent-soft: rgba(255, 159, 10, 0.12);
  --mobile-green: #34c759;
  --mobile-green-soft: rgba(52, 199, 89, 0.12);
  --mobile-blue: #007aff;
  --mobile-blue-soft: rgba(0, 122, 255, 0.12);
  --mobile-purple: #af52de;
}

/* ============================================================
   VIEW TOGGLE (desktop/mobile)
   ============================================================ */

/* Default: Hide mobile, show desktop */
.mobile-view {
  display: none;
}

.desktop-view {
  display: block;
}

.desktop-view-toggle {
  display: none;
}

/* Mobile Layout Styles */
.mobile-view {
  font-family: var(--font-body);
  background: var(--mobile-bg);
  color: var(--mobile-text-primary);
  line-height: 1.5;
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
}

/* ============================================================
   MOBILE HEADER
   ============================================================ */

.mobile-header {
  padding: 16px 20px;
  background: var(--mobile-surface);
  border-bottom: 1px solid var(--mobile-border);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 80px;
}

.mobile-header-top {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.mobile-header-logo-link {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  padding: 2px;
  text-decoration: none;
}

.mobile-header-logo-link:focus-visible {
  outline: 2px solid var(--mobile-accent);
  outline-offset: 4px;
}

.mobile-header-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.mobile-header-content {
  flex: 1;
  padding-left: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mobile-header-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin: 0 0 4px 0;
  color: var(--mobile-accent);
  text-transform: uppercase;
  line-height: 1.2;
  text-align: center;
}

.mobile-header-meta {
  font-size: 13px;
  color: var(--mobile-text-secondary);
  line-height: 1.3;
  text-align: center;
}

.mobile-header-meta a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mobile-deadline-badge {
  margin-top: 6px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid var(--mobile-border);
  background: var(--mobile-surface);
  font-size: 11px;
  line-height: 1.2;
  color: var(--mobile-text-secondary);
}

.mobile-deadline-countdown {
  font-weight: 700;
  color: var(--mobile-accent);
  font-size: 12px;
}

.mobile-deadline-date {
  font-size: 11px;
  color: var(--mobile-text-secondary);
}

/* ============================================================
   MOBILE HERO STATS
   ============================================================ */

.mobile-hero-stats {
  padding: 16px 20px;
  margin: 16px 20px;
  background: var(--mobile-surface);
  border-radius: 14px;
  border: 1px solid var(--mobile-border);
}

/* Tournament Name Link (inside hero stats card) */
.mobile-tournament-link {
  display: block;
  text-align: center;
  padding: 0 0 12px 0;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--mobile-text-secondary);
  text-decoration: none;
  border-bottom: 1px solid var(--mobile-border);
}

.mobile-tournament-link:active {
  opacity: 0.6;
}

/* Stats Grid */
.mobile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.mobile-stat-card {
  background: var(--mobile-surface-elevated);
  border-radius: 14px;
  padding: 14px 12px;
  text-align: center;
  border: 1px solid var(--mobile-border);
}

.mobile-stat-card.highlight {
  background: var(--mobile-accent-soft);
  border-color: rgba(255, 159, 10, 0.3);
}

.mobile-stat-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* "Closes" can be text (e.g., 'Registration closed') so allow wrapping. */
#mobile-seed {
  font-size: 14px;
  line-height: 1.15;
  white-space: normal;
  word-break: break-word;
}

.mobile-stat-card.highlight .mobile-stat-value {
  color: var(--mobile-accent);
}

.mobile-stat-label {
  font-size: 11px;
  color: var(--mobile-text-secondary);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ============================================================
   MOBILE ALEXIS SPOTLIGHT CARD
   ============================================================ */

.mobile-alexis-card {
  margin: 16px 20px;
  background: linear-gradient(135deg, rgba(255, 159, 10, 0.12) 0%, rgba(191, 90, 242, 0.08) 100%);
  border: 1px solid rgba(255, 159, 10, 0.25);
  border-radius: 16px;
  padding: 16px;
}

.mobile-alexis-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.mobile-alexis-avatar {
  width: 44px;
  height: 44px;
  background: var(--mobile-accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #000;
}

.mobile-alexis-name {
  flex: 1;
}

.mobile-alexis-name h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
}

.mobile-alexis-name span {
  font-size: 13px;
  color: var(--mobile-text-secondary);
}

.mobile-alexis-seed {
  background: var(--mobile-accent);
  color: #000;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
}

.mobile-alexis-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.mobile-alexis-stat {
  text-align: center;
  padding: 10px 4px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
}

.mobile-alexis-stat-value {
  font-size: 16px;
  font-weight: 700;
}

.mobile-alexis-stat-label {
  font-size: 10px;
  color: var(--mobile-text-secondary);
  margin-top: 2px;
  text-transform: uppercase;
}

/* ============================================================
   MOBILE POSITION GAUGE
   ============================================================ */

.mobile-position-gauge {
  margin: 16px 20px;
  background: var(--mobile-surface);
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--mobile-border);
}

.mobile-gauge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.mobile-gauge-title {
  font-size: 13px;
  color: var(--mobile-text-secondary);
}

.mobile-gauge-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--mobile-green);
}

.mobile-gauge-bar {
  height: 8px;
  background: var(--mobile-surface-elevated);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.mobile-gauge-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--mobile-green) 0%, var(--mobile-accent) 100%);
  border-radius: 4px;
  position: relative;
  transition: width 1s ease-out;
}

.mobile-gauge-marker {
  position: absolute;
  right: -1px;
  top: -4px;
  width: 3px;
  height: 16px;
  background: var(--mobile-text-primary);
  border-radius: 2px;
}

.mobile-gauge-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  color: var(--mobile-text-muted);
}

.mobile-gauge-note {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--mobile-green-soft);
  border-radius: 8px;
  font-size: 12px;
  color: var(--mobile-green);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================================
   MOBILE SECTION HEADERS
   ============================================================ */

.mobile-section-header {
  padding: 20px 20px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--mobile-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mobile-group-header {
  margin: 14px 0 8px;
  padding: 0 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--mobile-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.mobile-partner-jump {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  color: var(--mobile-accent);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* ============================================================
   MOBILE SORT CONTROLS
   ============================================================ */

.mobile-sort-controls {
  padding: 0 20px 12px;
  display: flex;
  gap: 8px;
}

.mobile-sort-btn {
  flex: 1;
  padding: 8px 12px;
  background: var(--mobile-surface);
  border: 1px solid var(--mobile-border);
  border-radius: 10px;
  color: var(--mobile-text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.mobile-sort-btn.active {
  background: var(--mobile-accent-soft);
  border-color: rgba(255, 159, 10, 0.3);
  color: var(--mobile-accent);
  font-weight: 600;
}

/* ============================================================
   MOBILE PLAYER CARDS
   ============================================================ */

.mobile-player-list {
  padding: 0 20px;
}

.mobile-player-card {
  background: var(--mobile-surface);
  border: 1px solid var(--mobile-border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-player-card.top-seed {
  border-color: rgba(48, 209, 88, 0.3);
  background: linear-gradient(135deg, var(--mobile-surface) 0%, var(--mobile-green-soft) 100%);
}

.mobile-player-card.target-player {
  border: 1px solid rgba(255, 159, 10, 0.4);
  background: linear-gradient(135deg, rgba(255, 159, 10, 0.12) 0%, rgba(191, 90, 242, 0.08) 100%);
}

.mobile-player-rank {
  width: 28px;
  height: 28px;
  background: var(--mobile-surface-elevated);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--mobile-text-secondary);
  flex-shrink: 0;
}

.mobile-player-card.top-seed .mobile-player-rank {
  background: var(--mobile-green);
  color: #000;
}

.mobile-player-card.target-player .mobile-player-rank {
  background: var(--mobile-accent);
  color: #000;
}

.mobile-player-info {
  flex: 1;
  min-width: 0;
}

.mobile-player-name {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-player-location {
  font-size: 12px;
  color: var(--mobile-text-muted);
}

.mobile-player-ratings {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.mobile-rating-badge {
  padding: 6px 10px;
  border-radius: 8px;
  text-align: center;
  min-width: 52px;
  text-decoration: none;
  display: inline-block;
  transition: opacity 0.2s;
}

a.mobile-rating-badge:active {
  opacity: 0.6;
}

.mobile-rating-badge.utr {
  background: var(--mobile-blue-soft);
}

.mobile-rating-badge.nat {
  background: var(--mobile-surface-elevated);
}

.mobile-rating-value {
  font-size: 14px;
  font-weight: 700;
}

.mobile-rating-badge.utr .mobile-rating-value {
  color: var(--mobile-blue);
}

.mobile-rating-label {
  font-size: 9px;
  color: var(--mobile-text-muted);
  text-transform: uppercase;
  margin-top: 1px;
}

/* Player Card Expand Icon */
.mobile-player-expand-icon {
  font-size: 10px;
  color: var(--mobile-text-muted);
  margin-left: 4px;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.mobile-player-card.expanded .mobile-player-expand-icon {
  transform: rotate(180deg);
}

/* Player Details (Expandable) */
.mobile-player-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  margin: 0 20px;
  margin-top: -8px;
}

.mobile-player-details.expanded {
  max-height: 200px;
}

.mobile-player-details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px;
  background: var(--mobile-surface-elevated);
  border: 1px solid var(--mobile-border);
  border-top: none;
  border-radius: 0 0 12px 12px;
}

.mobile-detail-item {
  text-align: center;
  padding: 8px 4px;
  background: var(--mobile-surface);
  border-radius: 8px;
}

.mobile-detail-label {
  font-size: 9px;
  color: var(--mobile-text-secondary);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.mobile-detail-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--mobile-text-primary);
}

/* Cutoff Divider */
.mobile-cutoff-divider {
  margin: 8px 20px;
  padding: 8px 12px;
  background: var(--mobile-surface);
  border: 1px dashed var(--mobile-border);
  border-radius: 8px;
  font-size: 11px;
  color: var(--mobile-text-muted);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Show More Button */
.mobile-show-more {
  margin: 8px 20px 20px;
  padding: 14px;
  width: calc(100% - 40px);
  background: var(--mobile-surface);
  border: 1px solid var(--mobile-border);
  border-radius: 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--mobile-blue);
  cursor: pointer;
  transition: all 0.2s;
}

.mobile-show-more:hover {
  background: var(--mobile-surface-elevated);
}

/* ============================================================
   MOBILE HISTOGRAM
   ============================================================ */

.mobile-chart-section {
  padding: 0 20px;
  margin-bottom: 16px;
}

.mobile-chart-card {
  background: var(--mobile-surface);
  border: 1px solid var(--mobile-border);
  border-radius: 14px;
  padding: 16px;
}

.mobile-histogram {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 80px;
  margin-bottom: 8px;
}

.mobile-histogram-bar {
  flex: 1;
  background: var(--mobile-blue-soft);
  border-radius: 4px 4px 0 0;
  position: relative;
  min-height: 4px;
  transition: height 0.6s ease-out;
}

.mobile-histogram-bar.alexis-range {
  background: var(--mobile-accent);
}

.mobile-histogram-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--mobile-text-muted);
}

.mobile-chart-legend {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--mobile-text-secondary);
}

.mobile-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mobile-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.mobile-legend-dot.blue {
  background: var(--mobile-blue);
}

.mobile-legend-dot.orange {
  background: var(--mobile-accent);
}

/* ============================================================
   MOBILE TOURNAMENT INFO CARDS
   ============================================================ */

.mobile-info-section {
  padding: 0 20px 20px;
}

.mobile-info-card {
  background: var(--mobile-surface);
  border: 1px solid var(--mobile-border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 12px;
}

.mobile-info-card-header {
  padding: 14px 16px;
  background: var(--mobile-surface-elevated);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--mobile-border);
}

.mobile-info-row {
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--mobile-border);
}

.mobile-info-row.is-stacked {
  flex-direction: column;
  gap: 6px;
}

.mobile-info-row:last-child {
  border-bottom: none;
}

.mobile-info-label {
  font-size: 13px;
  color: var(--mobile-text-secondary);
  flex-shrink: 0;
}

.mobile-info-value {
  font-size: 13px;
  text-align: right;
  color: var(--mobile-text-primary);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mobile-info-row.is-stacked .mobile-info-value {
  width: 100%;
  text-align: left;
}

.mobile-info-value a {
  color: var(--mobile-blue);
  text-decoration: none;
}

/* View Toggle */
.mobile-view-toggle {
  padding: 20px;
  text-align: center;
}

.mobile-view-toggle a {
  color: var(--mobile-text-secondary);
  font-size: 14px;
  text-decoration: none;
}

/* ============================================================
   MOBILE RESPONSIVE — Show mobile on small screens
   ============================================================ */

@media (max-width: 600px) {
  body {
    margin: 0;
    padding: 0;
    background-color: var(--mobile-bg);
    border-top: none;
  }

  .mobile-view {
    display: block;
  }

  .desktop-view {
    display: none;
  }

  .desktop-view-toggle {
    display: block;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
  }

  .desktop-view-toggle a {
    display: inline-block;
    padding: 12px 20px;
    background: var(--mobile-surface);
    border: 1px solid var(--mobile-border);
    border-radius: 12px;
    color: var(--mobile-text-secondary);
    font-size: 14px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }
}

/* ============================================================
   FORCE VIEW CLASSES (for manual toggle)
   ============================================================ */

body.force-mobile {
  margin: 0;
  padding: 0;
  background-color: var(--mobile-bg);
  border-top: none;
}

body.force-mobile .mobile-view {
  display: block !important;
}

body.force-mobile .desktop-view {
  display: none !important;
}

body.force-desktop .mobile-view {
  display: none !important;
}

body.force-desktop .desktop-view {
  display: block !important;
}

/* ============================================================
   DESKTOP/TABLET RESPONSIVE OVERRIDES
   ============================================================ */

@media screen and (max-width: 768px) {
  body {
    margin: 10px;
  }

  .report-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 8px auto 10px;
  }

  .report-header-logo {
    width: 96px;
    height: 96px;
    position: static;
    transform: none;
  }

  h1 {
    font-size: 1.8em;
  }

  .tournament-info {
    font-size: 12px;
    margin-bottom: 15px;
  }

  .table-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .link-legend {
    align-self: stretch;
    text-align: left;
  }

  /* Table container for horizontal scrolling */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 12px;
  }

  thead, tbody {
    display: table;
    width: 100%;
  }

  /* Larger tap targets for sortable headers */
  th.sortable {
    padding: 15px 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(68, 114, 196, 0.3);
  }

  th, td {
    padding: 10px 6px;
  }

  /* Make row numbers and ratings more prominent */
  .col-rank {
    font-size: 13px;
    font-weight: bold;
  }

  .col-wtn, .col-utr {
    font-size: 13px;
  }

  /* Hide Location column on very small screens (under 480px) */
  @media screen and (max-width: 480px) {
    th:last-child,
    td:last-child {
      display: none;
    }
  }

  /* Stats section - stack on mobile */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .utr-histogram {
    padding: 15px;
    margin: 20px 0;
  }

  .utr-bin-label {
    width: 70px;
    font-size: 10px;
  }

  .utr-bin-count {
    width: 24px;
    font-size: 10px;
  }

  .stat-box {
    padding: 12px;
  }

  .stat-label {
    font-size: 10px;
  }

  .stat-value {
    font-size: 16px;
  }

  /* Tournament details - better mobile layout */
  .tournament-details-page {
    padding: 15px;
    margin: 15px 0;
  }

  .tournament-details-page h2 {
    font-size: 1.5em;
  }

  .tournament-details-page h3 {
    font-size: 1.2em;
    margin-top: 20px;
  }

  .detail-row {
    grid-template-columns: 1fr;
    row-gap: 4px;
    column-gap: 0;
    padding: 8px 0;
    font-size: 13px;
  }

  .detail-label {
    display: block;
    width: 100%;
    margin-bottom: 3px;
    font-size: 11px;
  }

  .detail-value {
    display: block;
    padding-left: 0;
  }

  /* Touch-friendly links */
  .detail-value a {
    display: inline-block;
    padding: 8px 0;
    line-height: 1.4;
    -webkit-tap-highlight-color: rgba(68, 114, 196, 0.2);
  }

  .important-note {
    padding: 12px;
    font-size: 13px;
  }

  /* Show share button on mobile */
  .share-button {
    display: flex;
  }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */

@media print {
  /* Page setup */
  @page {
    size: letter;
    margin: 0.5in;
  }

  body {
    background-color: white;
    margin: 0;
    padding: 0;
  }

  /* Hide share button in print */
  .share-button {
    display: none !important;
  }

  /* Remove shadows and unnecessary decorations */
  table, .stats-section, .tournament-details-page, .utr-histogram {
    box-shadow: none;
    border: 1px solid #ddd;
  }

  /* Table optimizations */
  table {
    font-size: 10pt;
    page-break-inside: auto;
  }

  thead {
    display: table-header-group;
  }

  tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }

  tbody tr:hover {
    background-color: inherit !important;
  }

  /* Keep alternating row colors for readability */
  tbody tr:nth-child(odd) {
    background-color: white !important;
  }

  tbody tr:nth-child(even) {
    background-color: #f0f0f0 !important;
  }

  /* Highlight player in print */
  tr.highlight-player td {
    color: #000 !important;
    font-weight: bold !important;
    background-color: #ffffcc !important;
  }

  tr.highlight-player td.col-wtn {
    font-weight: normal !important;
  }

  /* Column widths for print */
  .col-rank {
    width: 30px;
  }

  th, td {
    padding: 6px 8px;
  }

  /* Stats section */
  .stats-section {
    page-break-before: auto;
    page-break-after: auto;
    page-break-inside: avoid;
    margin: 20px 0;
    padding: 15px;
  }

  .utr-histogram {
    page-break-inside: avoid;
    margin: 20px 0;
    padding: 15px;
  }

  .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }

  .stat-box {
    background-color: #f8f9fa !important;
    border: 1px solid #ddd;
  }

  /* Tournament details page */
  .tournament-details-page {
    page-break-before: always;
    margin: 0;
    padding: 20px;
  }

  .tournament-info {
    font-size: 11pt;
    margin-bottom: 20px;
  }

  h1 {
    font-size: 18pt;
    margin-bottom: 5px;
  }

  h2 {
    font-size: 16pt;
    margin-top: 15px;
  }

  h3 {
    font-size: 13pt;
    margin-top: 15px;
    margin-bottom: 8px;
  }

  /* Make links visible in print */
  a {
    color: #000;
    text-decoration: underline;
  }

  /* Important note styling */
  .important-note {
    background-color: #f9f9f9 !important;
    border: 2px solid #666;
    padding: 12px;
    margin-top: 15px;
  }

  .detail-row {
    padding: 6px 0;
    font-size: 11pt;
  }
}

/* ============================================================
   UPDATED BADGE (from report_updated_badge.py)
   ============================================================ */

/* Updated badge — subtle timestamp below tournament header */
.report-updated-badge {
  max-width: 1000px;
  margin: -8px auto 10px;
  padding: 0 10px;
  text-align: right;
  user-select: none;
  pointer-events: none;
}

.report-updated-badge__pill {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

@media (max-width: 600px) {
  .report-updated-badge {
    max-width: none;
    padding: 0 14px;
    margin-bottom: 8px;
  }
}

html[data-theme="dark"] .report-updated-badge__pill {
  color: var(--text-muted);
}

@media print {
  .report-updated-badge {
    display: none !important;
  }
}

/* ============================================================
   ROSTER H2H BLOCK (from report_roster_h2h.py)
   ============================================================ */

.h2h-block { max-width: 1000px; margin: 28px auto; font-family: inherit; }
.h2h-section-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.h2h-section-title { font-size: 18px; font-weight: 700; margin: 0; position: relative; padding-left: 12px; }
.h2h-section-title::before { content: ''; position: absolute; left: 0; top: 2px; bottom: 2px; width: 3px; background: var(--green-primary, #16a34a); border-radius: 2px; }
.h2h-section-subtitle { font-size: 13px; color: var(--text-muted, #94a3b8); }
.h2h-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.h2h-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 20px; border: 1px solid var(--border-color, #e2e8f0); background: var(--bg-secondary, #f8fafc); font-size: 13px; text-decoration: none; color: inherit; transition: border-color 0.15s, background 0.15s; }
.h2h-chip:hover { border-color: var(--green-primary, #16a34a); background: rgba(22,163,74,0.07); }
.h2h-chip-name { font-weight: 600; }
.h2h-chip-record { font-size: 12px; color: var(--text-muted, #94a3b8); }
.h2h-player-card { background: var(--bg-primary, #fff); border: 1px solid var(--border-color, #e2e8f0); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.h2h-player-card-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--bg-secondary, #f8fafc); border-bottom: 1px solid var(--border-color, #e2e8f0); gap: 12px; flex-wrap: wrap; }
.h2h-player-name-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.h2h-player-name { font-size: 15px; font-weight: 700; color: inherit; }
.h2h-player-loc { font-size: 12px; color: var(--text-muted, #94a3b8); }
.h2h-record-summary { font-size: 13px; font-weight: 700; white-space: nowrap; color: var(--text-secondary, #475569); }
.h2h-matches { padding: 4px 0; }
.h2h-match { display: grid; grid-template-columns: max-content 30px 1fr auto; gap: 10px; align-items: center; padding: 8px 16px; border-bottom: 1px solid var(--border-color, #e2e8f0); font-size: 13px; }
.h2h-match:last-child { border-bottom: none; }
.h2h-match-date { font-size: 12px; color: var(--text-muted, #94a3b8); font-weight: 500; white-space: nowrap; padding-top: 2px; }
.h2h-pill { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 22px; border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: 0.3px; flex-shrink: 0; }
.h2h-pill-w { background: rgba(22,163,74,0.12); color: #16a34a; }
.h2h-pill-l { background: rgba(220,38,38,0.10); color: #dc2626; }
.h2h-pill-d { background: rgba(0,0,0,0.07); color: var(--text-muted, #94a3b8); }
.h2h-match-event { min-width: 0; }
.h2h-match-event-main { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h2h-match-event-main a { color: inherit; text-decoration: none; }
.h2h-match-event-main a:hover { text-decoration: underline; }
.h2h-match-event-sub { font-size: 11px; color: var(--text-muted, #94a3b8); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h2h-match-score { font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 600; color: var(--text-secondary, #475569); white-space: nowrap; text-align: right; padding-top: 2px; }
.h2h-rel-badge { display: inline-block; font-size: 10px; background: rgba(99,102,241,0.10); color: #6366f1; border-radius: 4px; padding: 1px 5px; font-weight: 600; vertical-align: middle; margin-left: 4px; }
.h2h-match-hidden { display: none; }
.h2h-show-more-row { display: flex; justify-content: center; padding: 0 0 2px; }
.h2h-show-more { display: inline-flex; align-items: center; gap: 3px; background: none; border: none; padding: 4px 10px; border-radius: 20px; cursor: pointer; color: var(--text-muted, #94a3b8); font-size: 11px; font-weight: 600; letter-spacing: 0.2px; transition: color 0.15s, background 0.15s; }
.h2h-show-more:hover { color: var(--green-primary, #16a34a); background: rgba(22,163,74,0.07); }
.h2h-smc { display: block; transition: transform 0.22s ease; flex-shrink: 0; }
.h2h-show-more[data-open="1"] .h2h-smc { transform: rotate(180deg); }
.h2h-smn { transition: opacity 0.15s; }
.h2h-show-more[data-open="1"] .h2h-smn { opacity: 0; pointer-events: none; }

html[data-theme="dark"] .h2h-player-card { background: var(--bg-secondary, #1e293b); border-color: var(--border-color, #334155); }
html[data-theme="dark"] .h2h-player-card-header { background: rgba(255,255,255,0.04); border-color: var(--border-color, #334155); }
html[data-theme="dark"] .h2h-match { border-color: var(--border-color, #334155); }
html[data-theme="dark"] .h2h-chip { background: rgba(255,255,255,0.05); border-color: var(--border-color, #334155); }
html[data-theme="dark"] .h2h-chip:hover { background: rgba(22,163,74,0.15); border-color: var(--green-primary, #16a34a); }
html[data-theme="dark"] .h2h-pill-w { background: rgba(22,163,74,0.18); color: #4ade80; }
html[data-theme="dark"] .h2h-pill-l { background: rgba(239,68,68,0.15); color: #f87171; }
html[data-theme="dark"] .h2h-pill-d { background: rgba(255,255,255,0.08); }
html[data-theme="dark"] .h2h-show-more:hover { background: rgba(22,163,74,0.12); }

@media (max-width: 640px) {
  .h2h-match { grid-template-columns: max-content 26px 1fr auto; gap: 6px; padding: 8px 12px; }
  .h2h-player-card-header { padding: 10px 12px; }
}

/* Entry status row colors */
tr.entry-list-player:not(.highlight-player) {
  background-color: rgba(34, 139, 34, 0.08);
}
tr.alternate-player:not(.highlight-player) {
  background-color: rgba(255, 193, 7, 0.10);
}

/* ============================================================
   H2H INLINE COLUMN (table badge + tooltip)
   ============================================================ */
th.col-h2h { width: 52px; text-align: center; font-size: 11px; }
td.col-h2h { text-align: center; white-space: nowrap; }
td.col-h2h .h2h-badge { margin-left: 0; }
.h2h-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: default;
  white-space: nowrap;
}
.h2h-win  { background: rgba(22,163,74,0.15);  color: #16a34a; }
.h2h-loss { background: rgba(220,38,38,0.15);  color: #dc2626; }
.h2h-even { background: rgba(220,38,38,0.08);  color: #ef4444; }
html[data-theme="dark"] .h2h-win  { background: rgba(74,222,128,0.15);  color: #4ade80; }
html[data-theme="dark"] .h2h-loss { background: rgba(248,113,113,0.15); color: #f87171; }
html[data-theme="dark"] .h2h-even { background: rgba(248,113,113,0.08); color: #fca5a5; }
#h2h-tooltip {
  position: fixed; z-index: 9999; pointer-events: none; display: none;
  background: var(--bg-primary, #fff); border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 10px 12px; min-width: 220px; max-width: 320px; font-size: 13px;
}
.h2h-tip-header { font-weight: 700; margin-bottom: 6px; font-size: 13px; }
.h2h-tip-match { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0;
  border-bottom: 1px solid var(--border-color, #e2e8f0); }
.h2h-tip-match:last-child { border-bottom: none; }
.h2h-tip-result { font-weight: 700; font-size: 12px; flex-shrink: 0; padding-top: 1px; }
.h2h-tip-result.win  { color: #16a34a; }
.h2h-tip-result.loss { color: #dc2626; }
html[data-theme="dark"] .h2h-tip-result.win  { color: #4ade80; }
html[data-theme="dark"] .h2h-tip-result.loss { color: #f87171; }
.h2h-tip-sets { font-weight: 600; font-size: 12px; flex-shrink: 0; }
.h2h-tip-meta { font-size: 11px; color: var(--text-secondary, #6b7280); line-height: 1.45; }
