/* player_history.css — single-player value timeline + chart.
 *
 * Shared .section primitive lives in base.css.
 */

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.ph-controls {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.ph-controls input,
.ph-controls select,
.ph-controls button {
  background: var(--bg-input);
  color: var(--text-2);
  border: 1px solid var(--stroke);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.ph-controls input { width: 280px; }

.ph-controls button {
  background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent) 100%);
  border-color: rgba(124, 58, 255, 0.45);
  color: white;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(124, 58, 255, 0.28);
}
.ph-controls button:hover { filter: brightness(1.08); }

/* Autocomplete picker */
.ph-picker { position: relative; }

.ph-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  margin-top: 4px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 50;
}

.suggestion-item {
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--stroke-soft);
}

.suggestion-item:last-child { border-bottom: 0; }
.suggestion-item:hover,
.suggestion-item.active { background: rgba(31, 111, 235, 0.18); }

.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat {
  background: var(--bg-panel-2);
  border: 1px solid var(--stroke-soft);
  padding: 14px;
  border-radius: var(--radius-sm);
}

.stat .label {
  font-size: 10px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
}

.stat .value {
  font-size: 22px;
  color: var(--accent-gold);
  font-weight: 700;
  font-family: var(--font-mono);
  margin-top: 5px;
}

.stat .delta { font-size: 11px; margin-top: 2px; font-family: var(--font-mono); }
.delta.up    { color: var(--accent-good); }
.delta.down  { color: var(--accent-bad); }

.chart-wrapper { position: relative; }
.axis-label    { font-size: 11px; fill: var(--text-muted); }
.grid-line     { stroke: var(--stroke); stroke-width: 0.5; stroke-dasharray: 2, 2; }
.data-line     { fill: none; stroke: var(--accent); stroke-width: 2; }
.data-fill     { fill: url(#grad); }
.data-point    { fill: var(--accent); }

.tooltip {
  position: absolute;
  background: var(--bg-panel);
  border: 1px solid var(--stroke);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 11px;
  pointer-events: none;
  display: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Trade volume strip (below the value chart) */
.vol-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--stroke);
}

.vol-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.vol-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.vol-meta { font-size: 11px; color: var(--text-muted); }

.vol-bar { transition: fill-opacity 0.1s; cursor: pointer; }
.vol-bar:hover { fill-opacity: 1 !important; }

.vol-legend {
  font-size: 11px;
  line-height: 1.5;
  margin-top: 8px;
  font-style: italic;
}

.vol-note {
  margin-top: 16px;
  padding: 12px;
  font-size: 12px;
  font-style: italic;
  background: var(--bg-panel-2, rgba(0,0,0,0.2));
  border-radius: 6px;
}

/* Recent corpus trades involving this player */
.pv-trades { margin-top: 18px; }
.pv-tr-row {
  display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: baseline;
  padding: 8px 4px; border-bottom: 1px solid var(--stroke);
}
.pv-tr-row:last-of-type { border-bottom: none; }
.pv-tr-date { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.pv-tr-sides { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: 14px; }
.pv-tr-side { color: var(--text-2); }
.pv-tr-target { color: var(--text); font-weight: 700; }
.pv-tr-swap { color: var(--text-faint); padding: 0 2px; }
