:root {
  --felt-1: #0b3d2e;
  --felt-2: #052b21;
  --card: #ffffff;
  --ink: #f8fafc;
  --muted: #cbd5e1;
  --line: rgba(15, 23, 42, 0.10);
  --shadow: 0 10px 24px rgba(0, 0, 0, .18);
  --shadow-soft: 0 8px 18px rgba(0, 0, 0, .10);
  --btn: #111827;
  --btn2: #0f766e;
  --danger: #b91c1c;
  --ok: #15803d;
  --warn: #b45309;
  --chip: #0b1220;
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  /* רקע לבד — SVG fractalNoise, ללא ריבועים */
  background-color: #1a5e3c;
  background-image:
    radial-gradient(ellipse 110% 50% at 50% 0%,   rgba(255,255,255,0.06) 0%, transparent 65%),
    radial-gradient(ellipse 110% 50% at 50% 100%, rgba(0,0,0,0.32)       0%, transparent 65%),
    radial-gradient(ellipse 88%  88% at 50% 50%,  transparent 52%, rgba(0,0,0,0.22) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72%200.28' numOctaves='4' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='256' height='256' fill='white' filter='url(%23f)' opacity='0.085'/%3E%3C/svg%3E");
  min-height: 100vh;
  color: var(--ink);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 14px 28px;
}

/* Links: readable on felt by default; paper surfaces switch to ink (components.css). P023-UX */
a,
.link {
  color: var(--color-paper-50);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  font-weight: 600;
}

a:hover,
.link:hover {
  color: var(--color-paper-100);
  text-decoration-thickness: 2px;
}

.userbox,
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.userbox {
  color: #fff;
  justify-content: flex-end;
}

.actions {
  justify-content: flex-end;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .14);
  font-size: 13px;
  white-space: nowrap;
}

.badge {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: bold;
  background: rgba(0, 0, 0, .22);
  border: 1px solid rgba(255, 255, 255, .14);
  color: #fff;
}

.badge.admin {
  background: rgba(168, 85, 247, .30);
}

.badge.magician {
  background: rgba(34, 197, 94, .25);
}

.badge.player {
  background: rgba(59, 130, 246, .25);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(17, 24, 39, .85);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  transition: .15s transform, .15s opacity, .15s background, .15s color, .15s border-color;
}

.btn:hover {
  transform: translateY(-1px);
  opacity: .95;
}

.btn.secondary {
  background: rgba(15, 118, 110, .85);
}

.btn.ghost {
  background: rgba(255, 255, 255, .10);
}

.btn.danger {
  background: rgba(185, 28, 28, .85);
}

.btn.success:hover {
  background: rgba(22, 101, 52, .9);
}

.grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.game-card-full {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
}

.game-card,
.panel,
.table-wrap {
  color: #0f172a;
}

/* ===== game-card as full white card ===== */
.game-card {
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

/* inside a game-card, table-wrap doesn't need its own card styling */
.game-card .table-wrap {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

/* ===== game results — summary bar ===== */
.result-summary {
  padding: 12px 16px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  font-size: 13px;
  background: rgba(2, 6, 23, 0.02);
}

.result-summary-item {
  display: flex;
  gap: 5px;
  align-items: center;
}

.result-summary-label {
  color: #64748b;
}

.result-summary-value {
  font-weight: 700;
  color: #0f172a;
}

.result-summary-ok   { font-weight: 700; color: var(--ok); }
.result-summary-warn { font-weight: 700; color: var(--warn); }

/* ===== inline inputs in results edit table ===== */
.results-input {
  width: 88px;
  padding: 5px 7px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 6px;
  font-size: 13px;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.results-input:focus {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.15);
}

/* ===== game type badge ===== */
.game-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(15, 118, 110, 0.12);
  border: 1px solid rgba(15, 118, 110, 0.22);
  color: #065f46;
}

/* ===== app-form — used in add_game, login, signup ===== */
.app-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.form-row label {
  font-size: 12.5px;
  font-weight: 700;
  color: #374151;
  letter-spacing: 0.01em;
}

.form-row input[type="text"],
.form-row input[type="date"],
.form-row input[type="password"],
.form-row input[type="email"],
.form-row select {
  padding: 9px 11px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: #0f172a;
  width: 100%;
  max-width: 380px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-row input:focus,
.form-row select:focus {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

/* ===== auth-card — login / signup page ===== */
.auth-card {
  max-width: 420px;
  margin: 40px auto 0;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
  padding: 30px 28px 24px;
  color: #0f172a;
}

.auth-card .page-title {
  margin: 0 0 20px;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* בתוך auth-card — השדות מלאים לרוחב */
.auth-card .form-row input,
.auth-card .form-row select {
  max-width: 100%;
}

.auth-card .btn.primary {
  width: 100%;
  margin-top: 6px;
  justify-content: center;
  padding: 11px;
  font-size: 15px;
}

.auth-alt {
  margin-top: 16px;
  font-size: 13px;
  color: #475569;
  text-align: center;
}

.auth-alt a {
  color: #0f766e;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(600px 120px at 20% 0%, rgba(15, 118, 110, .18), transparent 60%),
    linear-gradient(180deg, rgba(2, 6, 23, .03), transparent);
}

.game-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chip {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: conic-gradient(from 45deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, .15), rgba(255, 255, 255, .85));
  border: 1px solid rgba(15, 23, 42, .10);
  display: grid;
  place-items: center;
  color: var(--chip);
  font-weight: 900;
  box-shadow: 0 10px 18px rgba(0, 0, 0, .12);
}

.game-title h2 {
  margin: 0;
  font-size: 18px;
}

.game-title .note {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.game-body {
  padding: 14px;
  display: grid;
  gap: 12px;
  min-width: 0;
  overflow: visible;
}

.two {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(2, 6, 23, .02), transparent);
  overflow: visible;
  min-width: 0;
}

.panel h3 {
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  color: #111827;
}

.panel .panel-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, .18);
  border: 1px solid rgba(103, 232, 249, .35);
  font-size: 13px;
  font-weight: 800;
}

.panel h3 small {
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
}

.player-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
  margin-bottom: 16px;
}

.stat-card {
  min-width: 0;
  min-height: 150px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.stat-card h3 {
  margin: 0 0 10px;
  justify-content: center;
  text-align: center;
  font-size: 14px;
  line-height: 1.25;
}

.stat-value {
  display: block;
  width: 100%;
  min-width: 0;
  text-align: center;
  font-size: clamp(2rem, 2.4vw, 3rem);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}

.stat-subline {
  margin-top: 8px;
  text-align: center;
  font-size: 0.84rem;
  line-height: 1.2;
  color: #64748b;
  font-weight: 700;
}

.stat-value.is-rank {
  font-size: clamp(1.7rem, 2vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.year-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 6px 0 10px;
  flex-wrap: wrap;
}

.year-selector .btn {
  padding: 8px 10px;
  border-radius: 10px;
  min-width: 64px;
  font-weight: 700;
}

.game-card .year-selector .btn {
  background: rgba(15, 23, 42, .06);
  border: 1px solid rgba(15, 23, 42, 0.10);
  color: #111827;
}

.game-card .year-selector .btn:hover {
  background: rgba(15, 23, 42, .10);
}

.game-card .year-selector .btn.active {
  background: rgba(15, 118, 110, .12);
  border-color: rgba(15, 118, 110, .35);
  color: #0f766e;
}

.game-card .year-selector .btn.total-btn {
  background: rgba(17, 24, 39, .92);
  border-color: rgba(17, 24, 39, .92);
  color: #fff;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  display: block;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  direction: ltr;
}

.game-card .table-wrap {
  overflow-x: auto !important;
  /* card already provides the white background — strip table-wrap's own card styling */
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.table-wrap table {
  direction: rtl;
}

table,
.games-table,
.players-table,
.leaders-table,
.leaders-table.big {
  width: 100%;
  border-collapse: collapse;
}

table {
  min-width: 0;
  table-layout: fixed;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

th {
  text-align: right;
  background: rgba(15, 23, 42, .04);
  color: #111827;
  font-weight: 700;
}

tbody tr:nth-child(even) {
  background: rgba(2, 6, 23, .02);
}

.num {
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.profit.pos {
  color: var(--ok);
  font-weight: 700;
}

.profit.neg {
  color: var(--danger);
  font-weight: 700;
}

.empty {
  color: var(--muted);
  font-size: 13px;
  padding: 8px 2px;
}

.link {
  color: #0f766e;
  text-decoration: none;
  font-weight: 700;
}

.link:hover {
  text-decoration: underline;
}

.leaders-table th:nth-child(1),
.leaders-table td:nth-child(1) {
  width: 48px;
}

.leaders-table th:nth-child(3),
.leaders-table td:nth-child(3) {
  width: 150px;
}

.games-table th {
  color: #e6fffa;
  font-size: 15px;
  font-weight: 800;
  background: rgba(0, 0, 0, .28);
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .18);
  text-align: right;
}

.games-table td {
  color: #f8fafc;
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.games-table tr:hover {
  background: rgba(255, 255, 255, .06);
}

.players-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
}

.players-table th,
.players-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  vertical-align: middle;
  text-align: right;
}

.players-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-weight: 800;
  font-size: 0.82rem;
  text-transform: none;
  letter-spacing: 0.01em;
  color: #475569;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  white-space: nowrap;
}

.players-table td {
  font-size: 0.95rem;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.94);
}

.players-table tbody tr:nth-child(even) td {
  background: rgba(248, 250, 252, 0.96);
}

.players-table tbody tr:hover td {
  background: rgba(226, 232, 240, 0.65);
}

.players-table td:first-child,
.players-table th:first-child {
  padding-right: 1.2rem;
}

.players-table td:last-child,
.players-table th:last-child {
  padding-left: 1.2rem;
}

.players-table .player-name,
.players-table td a,
.players-table td .link {
  color: #0f172a;
  font-weight: 800;
}

.players-table .player-name:hover,
.players-table td a:hover,
.players-table td .link:hover {
  color: #0f766e;
}

/* קישורים בתוך טבלאות ו-recent cards — כחול כהה, לא טורקיז */
.leaders-table td a,
.recent-line-name a {
  color: #1e40af;
  text-decoration: none;
  font-weight: 600;
}
.leaders-table td a:hover,
.recent-line-name a:hover {
  text-decoration: underline;
  color: #1e3a8a;
}

/* כפתורי toggle מרכוז בדף משחקים */
.games-toggle-wrap {
  display: flex;
  justify-content: center;
  padding: 14px 14px 6px;
}
.games-toggle {
  display: flex !important;
  grid-template-columns: unset !important;
  gap: 10px;
  margin-bottom: 0 !important;
}
.games-toggle .btn {
  min-width: 90px;
}

.sort-link {
  color: inherit;
  text-decoration: none;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sort-link:hover {
  text-decoration: underline;
}

.table-wrap.big {
  width: 100%;
  overflow-x: auto;
  max-width: 100%;
}

.leaders-table.big {
  font-size: 20px;
  table-layout: auto;
}

.leaders-table.big th,
.leaders-table.big td {
  padding: 14px 16px;
}

.leaders-table.big th {
  white-space: normal;
  line-height: 1.2;
  opacity: .85;
}

.leaders-table.big td.num {
  font-variant-numeric: tabular-nums;
}

.leaders-table th,
.leaders-table td {
  text-align: center;
}

/* Stats player table: center every header and cell so each column lines up
   (desktop). Uses the table's id for high specificity so it reliably wins over
   the generic .leaders-table and .num rules. */
#playerAnalysisTable th,
#playerAnalysisTable td,
#playerAnalysisTable td.num {
  text-align: center;
}

.footer-note {
  margin-top: 12px;
  color: rgba(255, 255, 255, .75);
  font-size: 12px;
  text-align: center;
}

/* === FIX: outer @media wrapper removed (was opened here, never closed,
   trapped most of the file inside max-width:900px). Nested media queries
   below stand on their own. === */

  .table-actions {
    display: flex;
    justify-content: flex-start;
    padding: 10px 0 0;
  }

  .toggle-row {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
  }

  .game-card-full {
    grid-column: 1 / -1;
  }

  .header-actions {
    margin-right: auto;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
  }

  .row-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
  }

  .icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    font-size: 20px;
    line-height: 1;
  }

  .flash-stack {
    margin: 16px 0;
  }

  .flash {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-weight: 500;
    border: 1px solid;
  }

  .flash-success {
    background: #e8f7e8;
    color: #1f6b1f;
    border-color: #b7e0b7;
  }

  .flash-error {
    background: #fdeaea;
    color: #8b1e1e;
    border-color: #f3b7b7;
  }

  .flash-warning {
    background: #fff6e5;
    color: #8a5a00;
    border-color: #f0d28a;
  }

  .flash-info {
    background: #eaf3ff;
    color: #174a8b;
    border-color: #b9d3f7;
  }

  .admin-import-grid {
    display: grid;
    gap: 12px;
    margin-top: 12px;
  }

  .admin-import-grid form {
    margin: 0;
  }

  .admin-import-grid .btn {
    width: 100%;
    text-align: center;
  }

  .form-hint {
    margin-top: 8px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
  }

  .table-meta {
    margin-bottom: 0.75rem;
    color: #e2e8f0;
    font-size: 0.95rem;
  }

  .players-toolbar {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 1rem;
  }

  .top-links.players-toolbar {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 1rem;
  }

  .top-links.players-toolbar .players-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    background: transparent;
    border: 0;
    width: 100%;
  }

  .top-links.players-toolbar .players-filter-toggle .players-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: transform 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
    flex: 1 1 0;
    min-width: 0;
  }

  .top-links.players-toolbar .players-filter-toggle .players-tab.ghost {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.82);
    box-shadow: none;
  }

  .top-links.players-toolbar .players-filter-toggle .players-tab.ghost:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
  }

  .top-links.players-toolbar .players-filter-toggle .players-tab.active {
    background: #ffffff;
    color: #0f172a;
    border-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
    transform: translateY(-1px);
  }

  .top-links.players-toolbar .players-filter-toggle .players-tab.active:hover {
    background: #ffffff;
  }

  .games-page .btn.ghost {
    color: #0f172a;
    border-color: #0f172a;
  }

  .games-page .btn.primary {
    color: #ffffff;
  }

  .games-page h2,
  .games-page h3,
  .games-page th,
  .games-page td {
    color: #0f172a;
  }

  /* Player detail page */
  .player-page-shell {
    max-width: 1240px;
    margin: 0 auto;
  }

  .player-page-top {
    display: grid;
    grid-template-columns: minmax(320px, 0.95fr) minmax(560px, 1.35fr);
    gap: 22px;
    align-items: stretch;
    margin-bottom: 22px;
  }

  .player-hero {
    min-height: 100%;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    padding: 24px 26px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.06));
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(6px);
  }

  .player-hero-text {
    display: grid;
    gap: 8px;
    align-content: center;
    width: 100%;
  }

  .player-kicker {
    margin: 0;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
  }

  .player-name {
    margin: 0;
    font-size: clamp(2.4rem, 3vw, 3.6rem);
    line-height: 0.98;
    font-weight: 900;
    color: #ffffff;
    max-width: none;
  }

  .player-subtitle {
    margin: 0;
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.82);
  }

  .player-table-wrap {
    width: 100%;
    margin-top: 0;
    border-radius: 20px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
  }

  /* player-games-table sizing handled in player-detail.css */

  /* Players expandable rows */
  .players-table-wrap {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .col-expand {
    width: 42px;
    text-align: center;
  }

  .row-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    font-weight: 900;
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.12);
    cursor: pointer;
  }

  .player-details[hidden] {
    display: none !important;
  }

  .player-details {
    background: rgba(255, 255, 255, 0.96);
  }

  .player-details-inner {
    padding: 12px;
  }

  .player-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
  }

  .player-name-cell a,
  .col-name a,
  .details-link {
    color: #0f172a;
    font-weight: 700;
    text-decoration: none;
  }

  .player-name-cell a:hover,
  .col-name a:hover,
  .details-link:hover {
    text-decoration: underline;
  }

  .currency-label {
    font-size: 0.52em;
    font-weight: 700;
    color: currentColor;
    opacity: 0.9;
    white-space: nowrap;
  }

  @media (min-width: 1100px) {
    .player-hero::after {
      content: "";
      display: block;
      min-height: 150px;
      border-radius: 20px;
      background:
        radial-gradient(circle at top right, rgba(103, 232, 249, 0.16), transparent 38%),
        radial-gradient(circle at bottom left, rgba(255, 255, 255, 0.12), transparent 42%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
      border: 1px solid rgba(255, 255, 255, 0.10);
    }
  }

  @media (max-width: 900px) {

    html,
    body {
      overflow-x: hidden;
    }

    .container {
      width: 100%;
      max-width: 100%;
      margin: 0 auto;
      padding: 10px 10px 18px;
      box-sizing: border-box;
    }

    .userbox,
    .actions {
      width: 100%;
      justify-content: space-between;
    }

    .grid {
      grid-template-columns: 1fr;
      width: 100%;
      max-width: 100%;
      margin-top: 10px;
    }

    .game-card,
    .game-body,
    .panel {
      min-width: 0;
      max-width: 100%;
    }

    .year-selector {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 8px;
      overflow-x: auto;
      justify-content: flex-start;
      max-width: 100%;
    }

    .year-selector .btn {
      flex: 0 0 auto;
      min-width: 52px;
      max-width: 72px;
      padding: 6px 8px;
      font-size: 11px;
    }

    .table-wrap {
      width: 100%;
      max-width: 100%;
      overflow-x: auto;
      overflow-y: hidden;
      -webkit-overflow-scrolling: touch;
    }

    .table-wrap table {
      direction: rtl;
      table-layout: auto;
      min-width: 760px;
      width: 100%;
    }

    .leaders-table,
    .leaders-table.big {
      width: 100%;
      min-width: 0 !important;
    }

    .leaders-table.big+.btn,
    .btn[onclick*="צמצם"] {
      white-space: nowrap;
      padding: 6px 10px;
      font-size: 12px;
      min-width: 0;
    }

    .players-table {
      width: 100%;
      border-collapse: collapse;
      table-layout: auto;
    }

    .players-table th,
    .players-table td {
      padding: 0.72rem 0.75rem;
      border-bottom: 1px solid rgba(15, 23, 42, 0.10);
      text-align: right;
      vertical-align: middle;
    }

    .players-table thead th {
      font-size: 0.78rem;
      white-space: nowrap;
    }

    .players-table tbody td {
      font-size: 0.88rem;
    }

    .player-page-top {
      grid-template-columns: 1fr;
    }

    .player-stats-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  @media (max-width: 700px) {
    .top-links.players-toolbar .players-filter-toggle {
      gap: 8px;
      width: 100%;
    }

    .top-links.players-toolbar .players-filter-toggle .players-tab {
      flex: 1 1 0;
      min-width: 0;
      min-height: 44px;
      padding: 10px 12px;
      font-size: 13px;
    }

    .row-toggle {
      display: inline-flex;
      width: 36px;
      height: 36px;
    }

    .players-table thead th {
      font-size: 0.70rem;
    }

    .players-table tbody td {
      font-size: 0.82rem;
    }

    .player-details-grid {
      grid-template-columns: 1fr;
    }
  }

  @media (min-width: 701px) {
    .col-expand {
      display: none;
    }

    .player-details {
      display: none !important;
    }
  }

  @media (max-width: 640px) {
    .player-page-top {
      gap: 14px;
      margin-bottom: 14px;
    }

    .player-hero {
      padding: 14px;
      border-radius: 16px;
    }

    .player-name {
      font-size: clamp(1.8rem, 8vw, 2.4rem);
    }

    .player-subtitle {
      font-size: 0.95rem;
    }

    .player-stats-grid {
      grid-template-columns: 1fr;
      gap: 10px;
    }

    .stat-card {
      min-height: auto;
      padding: 14px;
    }

    .stat-card h3 {
      font-size: 14px;
    }

    .stat-value {
      font-size: clamp(1.9rem, 8vw, 2.5rem);
    }

    .player-table-wrap {
      border-radius: 14px;
    }

    /* player-games-table mobile layout is now handled in player-detail.css */

    .players-table .col-total,
    .players-table .col-year-avg,
    .players-table .col-year-games,
    .players-table .col-last-result,
    .players-table .col-last-position {
      display: none !important;
    }

    .players-table .col-expand,
    .players-table .col-name,
    .players-table .col-year-profit {
      display: table-cell !important;
    }

    .player-page-title {
      width: min(88vw, 260px);
      margin: 16px auto 14px;
      padding: 12px 16px;
      border-radius: 16px;
    }

    .player-page-title h2 {
      font-size: clamp(1.35rem, 7vw, 1.8rem);
    }
  }

  @media (max-width: 520px) {

    .leaders-table th,
    .leaders-table td {
      padding: 8px;
      font-size: 13px;
    }

    .players-table th,
    .players-table td {
      padding: 0.72rem 0.75rem;
      font-size: 0.84rem;
    }
  }

  .home-dashboard {
    width: 100%;
  }

  .home-board {
    width: 100%;
    max-width: 1120px;
    margin-inline: auto;
  }

  .leaders-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
  }

  .subnote {
    color: var(--muted, #8b8f97);
    font-size: 0.95rem;
    margin-top: 4px;
  }

  .view-switch-top {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
  }

  .view-switch-top .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    width: 100%;
    padding: 10px 14px;
    text-align: center;
    font-weight: 800;
    font-size: 15px;
    line-height: 1.2;
    border-radius: 14px;
    white-space: nowrap;
    text-decoration: none !important;
    opacity: 1;
  }

  .view-switch-top .btn.ghost,
  .view-switch-top .btn.ghost:visited {
    background: #e8edf3;
    color: #243041;
    border: 1px solid #b8c4d3;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  }

  .view-switch-top .btn.ghost:hover,
  .view-switch-top .btn.ghost:focus-visible {
    background: #dbe4ee;
    color: #111827;
    border-color: #93a4b8;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
  }

  .view-switch-top .btn.primary,
  .view-switch-top .btn.primary:visited {
    background: #2f3447;
    color: #ffffff;
    border: 1px solid #2f3447;
    box-shadow: 0 2px 6px rgba(47, 52, 71, 0.18);
  }

  .table-actions {
    display: flex;
    justify-content: flex-start;
    padding: 10px 0 0;
  }

  .money {
    direction: ltr;
    unicode-bidi: isolate;
    display: inline-block;
  }

  @media (max-width: 640px) {
    .leaders-header {
      flex-direction: column;
      align-items: stretch;
    }

    .view-switch-top {
      grid-template-columns: 1fr;
    }

    .view-switch-top .btn {
      white-space: normal;
    }
  }

/* ===== Mobile tables: flex rows — bypasses table-layout entirely ===== */
@media (max-width: 600px) {

  /* ביטול min-width:760px שמוגדר ב-max-width:900px */
  .games-table {
    min-width: 0 !important;
    width: 100% !important;
  }

  /* ── shared: convert every row to flex ── */
  .games-table thead tr,
  .games-table tbody tr {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .games-table th,
  .games-table td {
    font-size: 12px !important;
    padding: 7px 5px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
  }

  /* ── games-list (3 cols: date | location | actions) ── */
  .games-page .games-table:not(.results-table) th:nth-child(1),
  .games-page .games-table:not(.results-table) td:nth-child(1) {
    flex: 0 0 68px !important;
    width: 68px !important;
  }
  .games-page .games-table:not(.results-table) th:nth-child(2),
  .games-page .games-table:not(.results-table) td:nth-child(2) {
    flex: 1 1 auto !important;
  }
  .games-page .games-table:not(.results-table) th:nth-child(3),
  .games-page .games-table:not(.results-table) td:nth-child(3) {
    flex: 0 0 72px !important;
    width: 72px !important;
    text-align: center !important;
    justify-content: center !important;
  }

  /* ── results table (4 cols: player | buyin | cashout | profit) ── */
  .results-table th:nth-child(1),
  .results-table td:nth-child(1) {
    flex: 1 1 auto !important;
    font-weight: 600 !important;
  }
  .results-table th:nth-child(2),
  .results-table td:nth-child(2),
  .results-table th:nth-child(3),
  .results-table td:nth-child(3) {
    flex: 0 0 56px !important;
    width: 56px !important;
    text-align: center !important;
  }
  .results-table th:nth-child(4),
  .results-table td:nth-child(4) {
    flex: 0 0 62px !important;
    width: 62px !important;
    text-align: center !important;
  }

  /* inputs בעריכה */
  .results-input {
    width: 48px !important;
    padding: 3px !important;
    font-size: 11px !important;
    text-align: center !important;
  }

  .row-actions { gap: 3px; justify-content: center; }
  .icon-btn {
    padding: 4px 6px !important;
    font-size: 14px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    border-radius: 8px !important;
  }
}

/* קישורים בתוך טבלאות — כחול כהה */
.games-table td a,
.results-table td a {
  color: #1e40af;
  text-decoration: none;
  font-weight: 600;
}
.games-table td a:hover,
.results-table td a:hover {
  color: #1e3a8a;
  text-decoration: underline;
}

/* ===== Recent Cards — Desktop: horizontal row ===== */
.recent-cards {
  display: flex;
  flex-direction: row;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}
@media (max-width: 600px) {
  .recent-cards { flex-direction: column; overflow-x: visible; }
  .recent-card { flex: none; }
}

.recent-card {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  background: rgba(15, 118, 110, 0.07);
  border: 1px solid rgba(103, 232, 249, 0.25);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recent-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recent-date {
  font-size: 12px;
  font-weight: 700;
  color: #0f766e;
}

.recent-location {
  font-size: 12px;
  color: #374151;
}

.recent-type {
  font-size: 11px;
  color: #6b7280;
}

.recent-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.recent-line {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.recent-line-label {
  color: #6b7280;
  font-size: 11px;
  flex: 0 0 auto;
}

.recent-line-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: 12px;
}

.recent-line-value {
  font-weight: 700;
  font-size: 12px;
  flex: 0 0 auto;
}

.recent-line-value.pos { color: #15803d; }
.recent-line-value.neg { color: #b91c1c; }

.record-box {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 18px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #1a2e1f 0%, #0f2018 100%);
    border: 1px solid rgba(212,160,23,.40);
    border-radius: 18px;
    box-shadow: 0 6px 18px rgba(0,0,0,.22);
}
.record-crown { font-size: 2.2rem; line-height: 1; flex-shrink: 0; }
@media (max-width: 600px) {
  .record-box { flex-direction: column; align-items: center; text-align: center; padding: 14px 16px; }
}
.record-body { display: flex; flex-direction: column; gap: 3px; text-align: center; }
.record-label { font-size: .7rem; font-weight: 900; letter-spacing: .08em; color: #d4a017; text-transform: uppercase; }
.record-player a { font-size: 1.1rem; font-weight: 900; color: #f1f5f9; text-decoration: none; }
.record-player a:hover { color: #fde68a; }
.record-amount { font-size: 1.3rem; font-weight: 900; color: #4ade80; direction: ltr; unicode-bidi: isolate; text-align: center; display: block; }
.record-date a { font-size: .78rem; color: rgba(255,255,255,.45); font-weight: 700; text-decoration: none; }
.record-date a:hover { color: rgba(255,255,255,.8); }

/* =========================================================
   עמוד סטטיסטיקות כלליות
   ========================================================= */

.stats-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 0 var(--space-7, 48px);
}

.stats-page-header {
  padding: var(--space-4) 0 var(--space-3);
}
.stats-page-header h2 {
  margin: 0 0 4px;
  font-family: var(--font-headline);
  font-size: var(--fs-h2);
  font-weight: var(--fw-black);
  color: var(--color-ink-900);
}
.stats-page-header .subnote {
  font-size: var(--fs-small);
  color: var(--color-muted-500);
}

.stats-section {
  margin-bottom: var(--space-6);
}
.stats-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: var(--border-bold);
}
.stats-section-title {
  font-family: var(--font-headline);
  font-size: var(--fs-h3);
  font-weight: var(--fw-black);
  color: var(--color-ink-900);
  margin: 0;
}
.stats-section-subtitle {
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: var(--fw-regular);
  color: var(--color-muted-500);
  margin-right: var(--space-2);
}
.stats-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}
.stats-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.stats-section-note {
  font-size: var(--fs-small);
  color: var(--color-muted-500);
}
.filter-divider {
  color: var(--color-paper-200);
  margin: 0 var(--space-1);
}

/* ---- KPI grid ---- */
.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-3);
}
.stats-kpi-card {
  background: var(--color-paper-100);
  border: 1px solid var(--color-paper-200);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-3);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}
.stats-kpi-icon { font-size: 1.5rem; line-height: 1; color: var(--color-accent-600); }
.stats-kpi-icon svg { stroke: var(--color-accent-600); }
.stats-kpi-value {
  font-family: var(--font-headline);
  font-size: var(--fs-h3);
  font-weight: var(--fw-black);
  color: var(--color-ink-900);
  direction: ltr;
  unicode-bidi: isolate;
}
.stats-kpi-label {
  font-size: var(--fs-small);
  color: var(--color-muted-500);
  font-weight: var(--fw-bold);
}

/* ---- Records grid ---- */
.stats-records-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}
.stats-record-card {
  background: var(--color-paper-100);
  border: 1px solid var(--color-paper-200);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: background var(--transition-fast);
}
.stats-record-card:hover { background: var(--color-paper-200); }

.stats-record-card.win-card   { border-right: 3px solid #16a34a; }
.stats-record-card.loss-card  { border-right: 3px solid var(--color-danger-700); }
.stats-record-card.pot-card   { border-right: 3px solid var(--color-accent-600); }
.stats-record-card.best-card  { border-right: 3px solid #16a34a; }
.stats-record-card.worst-card { border-right: 3px solid var(--color-danger-700); }
.stats-record-card.active-card{ border-right: 3px solid var(--color-accent-600); }
.stats-record-card.streak-win-card  { border-right: 3px solid #16a34a; }
.stats-record-card.streak-loss-card { border-right: 3px solid var(--color-danger-700); }

.stats-record-icon  { font-size: 1.4rem; line-height: 1; color: var(--color-muted-500); }
.stats-record-icon svg { stroke: var(--color-muted-500); }
.win-card .stats-record-icon,
.best-card .stats-record-icon,
.streak-win-card .stats-record-icon { color: var(--color-gold-500) !important; }
.win-card .stats-record-icon svg,
.best-card .stats-record-icon svg,
.streak-win-card .stats-record-icon svg { stroke: var(--color-gold-500) !important; }
/* גביע חגיגי — זוהר זהב */
.win-card .stats-record-icon {
  filter: drop-shadow(0 2px 8px rgba(201,155,58,0.6));
}
.loss-card .stats-record-icon,
.worst-card .stats-record-icon,
.streak-loss-card .stats-record-icon { color: var(--color-danger-700) !important; }
.loss-card .stats-record-icon svg,
.worst-card .stats-record-icon svg,
.streak-loss-card .stats-record-icon svg { stroke: var(--color-danger-700) !important; }
.pot-card .stats-record-icon,
.active-card .stats-record-icon { color: var(--color-accent-600) !important; }
.pot-card .stats-record-icon svg,
.active-card .stats-record-icon svg { stroke: var(--color-accent-600) !important; }
.stats-record-label {
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
  color: var(--color-ink-700);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.stats-record-amount {
  font-family: var(--font-headline);
  font-size: var(--fs-h3);
  font-weight: var(--fw-black);
  color: var(--color-ink-900);
  direction: ltr;
  unicode-bidi: isolate;
  display: block;
}
.stats-record-amount.pos     { color: #16a34a; }
.stats-record-amount.neg     { color: var(--color-danger-700); }
.stats-record-amount.neutral { color: var(--color-accent-600); }
.stats-record-player {
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  color: var(--color-ink-700);
}
.stats-record-player a {
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  color: var(--color-ink-900);
  text-decoration: none;
}
.stats-record-player a:hover { color: var(--color-accent-600); }
.stats-record-date,
.stats-record-date a {
  font-size: var(--fs-small);
  color: var(--color-muted-500);
  text-decoration: none;
}
.stats-record-date a:hover { color: var(--color-ink-700); }

/* ---- Charts ---- */
.stats-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
.stats-chart-card {
  background: var(--color-paper-100);
  border: 1px solid var(--color-paper-200);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}
.stats-chart-title {
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
  color: var(--color-ink-700);
  margin-bottom: var(--space-3);
  text-align: center;
}
.chart-subtitle {
  font-weight: var(--fw-regular);
  color: var(--color-muted-500);
  font-size: var(--fs-small);
  display: block;
}
.stats-chart-wrap {
  position: relative;
  height: 220px;
}

/* ── Player analysis highlights ── */
.stats-analysis-highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.stats-highlights-nowrap {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.stats-highlight-card {
  background: var(--color-paper-100);
  border: 1px solid var(--color-paper-200);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}
.stats-hl-icon { font-size: 1.5rem; line-height: 1; flex-shrink: 0; color: var(--color-muted-500); }
.stats-hl-icon svg { stroke: var(--color-muted-500); }
.stats-hl-body { flex: 1; }
.stats-hl-label {
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
  color: var(--color-muted-500);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: var(--space-1);
}
.stats-hl-name a {
  font-weight: var(--fw-bold);
  color: var(--color-ink-900);
  text-decoration: none;
  font-size: var(--fs-body);
}
.stats-hl-name a:hover { color: var(--color-accent-600); }
.stats-hl-value {
  font-family: var(--font-headline);
  font-size: var(--fs-h3);
  font-weight: var(--fw-black);
  margin: var(--space-1) 0;
}
.stats-hl-value.pos  { color: #16a34a; }
.stats-hl-value.neg  { color: var(--color-danger-700); }
.stats-hl-value.neutral { color: var(--color-accent-600); }
.stats-hl-sub {
  font-size: var(--fs-small);
  color: var(--color-muted-500);
}
.stats-hl-explain-mini {
  font-size: 11px;
  color: var(--color-ink-700);
  line-height: 1.5;
  margin-top: var(--space-1);
}

/* ── Locations ── */
.stats-locations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
}
.stats-location-card {
  background: var(--color-paper-100);
  border: 1px solid var(--color-paper-200);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.stats-location-icon { font-size: 1.2rem; }
.stats-location-body { flex: 1; }
.stats-location-player a { font-weight: var(--fw-bold); color: var(--color-ink-900); text-decoration: none; font-size: var(--fs-body); }
.stats-location-arrow { font-size: var(--fs-small); color: var(--color-muted-500); }
.stats-location-name { font-size: var(--fs-body); color: var(--color-ink-700); font-weight: var(--fw-bold); }
.stats-location-value { font-size: var(--fs-small); margin-top: 2px; }
.stats-location-value.pos { color: #16a34a; }
.stats-location-value.neg { color: var(--color-danger-700); }

@media (max-width: 640px) {
  .stats-charts-grid { grid-template-columns: 1fr; }
  .stats-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-records-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-analysis-highlights { grid-template-columns: 1fr; }
}

/* ── Win-rate badge ── */
.winrate-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
}
.winrate-badge.wr-high { background: rgba(22,163,74,.12); color: #166534; }
.winrate-badge.wr-mid  { background: rgba(202,138,4,.12);  color: #92400e; }
.winrate-badge.wr-low  { background: rgba(185,28,28,.10);  color: #991b1b; }
.stats-player-table .muted { color: var(--color-muted-500); }

/* ── leaders-table in DS context ── */
.bk .leaders-table th,
.bk .leaders-table td {
  border-bottom: 1px solid var(--color-paper-200);
  color: var(--color-ink-900);
  background: transparent;
}
.bk .leaders-table thead tr {
  border-bottom: var(--border-bold);
  background: transparent;
}
.bk .leaders-table th {
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
  color: var(--color-muted-500);
}
.bk .leaders-table tbody tr:hover td {
  background: var(--color-paper-100);
}
.bk .leaders-table td a {
  color: var(--color-accent-600);
  text-decoration: none;
  font-weight: var(--fw-bold);
}
.bk .leaders-table td a:hover { text-decoration: underline; }

/* ── Stats player analysis table (DS override) ── */
.stats-player-table {
  font-size: var(--fs-body) !important;
  table-layout: auto;
}
.stats-player-table th,
.stats-player-table td {
  padding: var(--space-3) var(--space-3) !important;
  font-size: var(--fs-body) !important;
  color: var(--color-ink-900) !important;
  background: transparent !important;
  border-bottom: 1px solid var(--color-paper-200) !important;
  text-align: right;
  opacity: 1 !important;
  white-space: normal;
}
.stats-player-table thead th {
  font-size: var(--fs-small) !important;
  font-weight: var(--fw-bold) !important;
  color: var(--color-muted-500) !important;
  border-bottom: var(--border-bold) !important;
}
.stats-player-table tbody tr:hover td {
  background: var(--color-paper-100) !important;
}
.stats-player-table td a {
  color: var(--color-ink-900) !important;
  font-weight: var(--fw-bold) !important;
  text-decoration: none !important;
}
.stats-player-table td a:hover { color: var(--color-accent-600) !important; }
.stats-player-table th.num,
.stats-player-table td.num { text-align: center; }
/* Mobile: shrink the stats table text a touch and keep amounts on one line
   so the minus sign in e.g. "-₪141" doesn't wrap to a second row. */
@media (max-width: 600px) {
  #playerAnalysisTable th,
  #playerAnalysisTable td {
    font-size: 14px;
    padding: 9px 6px;
  }
  #playerAnalysisTable td.num,
  #playerAnalysisTable .ils {
    white-space: nowrap;
  }
}
.stats-player-table .muted { color: var(--color-muted-500) !important; }
.stats-player-table .sortable { cursor: pointer; }
.stats-player-table .sortable:hover { color: var(--color-ink-900) !important; }

/* ── Unify the generic .data-table (home, games, admin, demo) with the
   design-system table look used on the players/stats pages: roomier cells,
   paper borders, subtle row hover. The dark header still comes from the
   global `.bk table th` rule below. ── */
.bk .data-table {
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
}
.bk .data-table th,
.bk .data-table td {
  padding: 0.9rem 1rem !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  vertical-align: middle;
  text-align: right;
}
.bk .data-table td {
  font-size: 0.95rem !important;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.94) !important;
}
.bk .data-table tbody tr:nth-child(even) td {
  background: rgba(248, 250, 252, 0.96) !important;
}
.bk .data-table tbody tr:hover td {
  background: rgba(226, 232, 240, 0.65) !important;
}
/* Player-name links inside data-tables should read as links (not plain text).
   Excludes action buttons (.btn). */
.bk .data-table td a:not(.btn) {
  color: var(--color-accent-600) !important;
  font-weight: 700;
  text-decoration: none;
}
.bk .data-table td a:not(.btn):hover {
  text-decoration: underline !important;
}

/* ── Global dark table header in DS context ── */
.bk table th {
    background: var(--color-ink-900) !important;
    color: var(--color-paper-200) !important;
    border-bottom: none !important;
}
.bk table thead tr {
    border-bottom: none;
}

/* ── Desktop: roomier type on game results ── */
@media (min-width: 601px) {
  .bk .game-results-table td {
    font-size: 1.05rem !important;
  }
  .bk .game-results-table th {
    font-size: 0.8rem !important;
    letter-spacing: 0.03em;
  }
  .bk .game-results-table td input { font-size: 1rem !important; }
}
