/* history.css — historia partii i statystyki (Faza 7) */

.history-layout {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  max-width: 760px;
  margin: 0 auto;
}

/* ---- statystyki ---- */
.stats-empty { color: var(--text-dim); font-size: 13.5px; margin: 0; }

.stats-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-3);
  align-items: stretch;
  margin-bottom: var(--sp-3);
}
.stats-tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-sunken);
  border-radius: var(--radius);
  min-width: 130px;
}
.stats-tile-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); }
.stats-tile-value { font-size: 26px; font-weight: 700; font-family: var(--font-mono); }
.stats-tile--chart { min-width: 0; }

.sparkline { width: 100%; height: 40px; }
.sparkline polyline { fill: none; stroke: var(--accent-strong); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }

.stats-breakdown { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.stats-breakdown-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-sunken);
}
.stats-breakdown-row span:first-child { font-weight: 600; }
.stats-breakdown-row span:last-child { font-family: var(--font-mono); color: var(--text-dim); }

.stats-suggestion {
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  align-items: flex-start;
}
.stats-suggestion p { margin: 0; font-size: 13.5px; color: var(--text); line-height: 1.5; }

/* ---- lista partii ---- */
.games-empty { color: var(--text-dim); font-size: 13.5px; margin: 0; }
.games-list[hidden] { display: none; }
.games-list { display: flex; flex-direction: column; gap: var(--sp-2); }

.game-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 10px var(--sp-3);
  background: var(--bg-sunken);
  border-radius: var(--radius);
}
.game-row-main {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  font-size: 13px;
}
.game-row-result { font-weight: 700; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, currentColor 16%, transparent); }
.game-row-mode { color: var(--text); font-weight: 550; }
.game-row-date { color: var(--text-dim); font-family: var(--font-mono); font-size: 12px; }
.game-row-acc { color: var(--accent-strong); font-family: var(--font-mono); font-size: 12px; }

@media (max-width: 560px) {
  .stats-summary { grid-template-columns: 1fr; }
  .game-row { flex-direction: column; align-items: stretch; }
}
