/* ratings.css — Elo History page (root ratings.html + ratings.js) */

.rh-hero { margin-bottom: 1.4rem; }
.rh-lede {
  color: var(--color-text-muted);
  text-align: center;
  margin: 0.5rem auto 0;
  max-width: 620px;
  font-size: 0.95rem;
}

/* --- Controls row ------------------------------------------------------- */
.rh-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem 1.2rem;
  margin-bottom: 0.7rem;
}
.rh-play { min-width: 108px; white-space: nowrap; }
.rh-play.rh-playing { color: var(--color-gold-light); border-color: var(--color-border-gold); }
.rh-speed-wrap { color: var(--color-text-muted); font-size: 0.85rem; display: flex; align-items: center; gap: 0.4rem; }
.rh-speed {
  background: rgba(0, 0, 0, 0.35);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.3rem 0.45rem;
  font: inherit;
  font-size: 0.85rem;
}
/* Range chips reuse .tl-filters look (timeline.css isn't loaded here) */
.rh-controls .tl-filters { display: flex; gap: 0.45rem; flex-wrap: wrap; justify-content: center; }
.rh-controls .tl-filter {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  border-radius: 999px;
  padding: 0.32rem 0.9rem;
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.rh-controls .tl-filter:hover { border-color: var(--color-border-gold); color: var(--color-text-primary); }
.rh-controls .tl-filter.is-active {
  border-color: var(--color-gold);
  color: var(--color-gold-light);
  background: var(--color-gold-glow);
}

.rh-facts { margin-bottom: 1.4rem; font-size: 0.88rem; min-height: 1.2em; }

/* --- Layout -------------------------------------------------------------- */
.rh-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 1.2rem;
  align-items: stretch;
}
.rh-chart-card { padding: 0.9rem 1rem 0.8rem; display: flex; flex-direction: column; }
.rh-chart-card #rh-chart { flex: 1 1 auto; display: flex; }
.rh-chart-card #rh-chart .rh-svg { margin: auto 0; }

.rh-svg { width: 100%; height: auto; display: block; cursor: crosshair; touch-action: none; }
.rh-svg text { user-select: none; }

/* --- SVG parts ----------------------------------------------------------- */
.rh-grid { stroke: rgba(255, 255, 255, 0.06); stroke-width: 1; }
.rh-grid-y { stroke: rgba(255, 255, 255, 0.045); }
.rh-axis { stroke: rgba(255, 255, 255, 0.16); stroke-width: 1; }
.rh-lbl { fill: var(--color-text-muted); font-size: 11px; font-family: var(--font-body, sans-serif); }
.rh-band-lbl { fill: var(--color-gold); font-size: 10px; letter-spacing: 0.06em; }
.rh-evtick { stroke: rgba(212, 175, 55, 0.4); stroke-width: 1; }
.rh-band-bg { fill: rgba(0, 0, 0, 0.35); }
.rh-seg { opacity: 0.85; }

.rh-line {
  fill: none;
  stroke-width: 1.9;
  stroke-linejoin: round;
  stroke-linecap: round;
  transition: opacity 0.12s ease, stroke-width 0.12s ease;
}
.rh-line-dim { opacity: 0.18; }
.rh-line-hot { stroke-width: 3; }

.rh-dot { stroke: rgba(0, 0, 0, 0.55); stroke-width: 1.2; pointer-events: none; }
.rh-cursor { stroke: var(--color-gold); stroke-width: 1.2; stroke-dasharray: 3 3; opacity: 0.9; pointer-events: none; }
.rh-cursor-date {
  fill: var(--color-gold-light);
  font-size: 12px;
  font-family: var(--font-heading, serif);
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.8);
  stroke-width: 3px;
  pointer-events: none;
}

/* Decorative SVG parts must not steal the pointer from the scrub surface */
.rh-svg path, .rh-svg circle, .rh-svg text, .rh-svg line, .rh-svg rect.rh-seg, .rh-svg rect.rh-band-bg { pointer-events: none; }

/* --- Slider --------------------------------------------------------------- */
.rh-slider {
  width: 100%;
  margin: 0.5rem 0 0.2rem;
  appearance: none;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  cursor: pointer;
}
.rh-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-gold);
  border: 2px solid #1a1206;
  box-shadow: 0 0 6px rgba(212, 175, 55, 0.6);
  cursor: grab;
}
.rh-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-gold);
  border: 2px solid #1a1206;
  box-shadow: 0 0 6px rgba(212, 175, 55, 0.6);
  cursor: grab;
}

/* --- Line color dot (leaderboard rows) ------------------------------------ */
.rh-chip-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.rh-chart-note { color: var(--color-text-muted); font-size: 0.74rem; margin: 0.35rem 0 0; }

/* --- Leaderboard panel ----------------------------------------------------- */
.rh-panel { padding: 0.9rem 1rem; position: sticky; top: 1rem; }
.rh-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.rh-date {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--color-gold-light);
  font-variant-numeric: tabular-nums;
}
.rh-board { display: flex; flex-direction: column; gap: 0.22rem; margin-top: 0.7rem; }
.rh-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.28rem 0.45rem;
  border-radius: 6px;
  overflow: hidden;
  cursor: default;
}
.rh-row.rh-hot { background: rgba(212, 175, 55, 0.1); }
.rh-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.13), rgba(212, 175, 55, 0.035));
  border-radius: 6px;
  pointer-events: none;
}
.rh-row > *:not(.rh-bar) { position: relative; }
.rh-rank {
  width: 1.5em;
  text-align: right;
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  flex: none;
}
.rh-r1 .rh-rank { color: #ffd700; }
.rh-r2 .rh-rank { color: #c9ccd6; }
.rh-r3 .rh-rank { color: #cd9a62; }
.rh-name {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
  cursor: pointer;
}
.rh-name:hover { color: var(--color-gold-light); text-decoration: underline; }
.rh-elo { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 0.88rem; color: var(--color-text-secondary); flex: none; }
.rh-r1 .rh-elo { color: var(--color-gold-light); font-weight: 600; }
.rh-empty { color: var(--color-text-muted); font-size: 0.85rem; padding: 0.6rem 0.2rem; }
.rh-panel-note { color: var(--color-text-muted); font-size: 0.74rem; margin-top: 0.8rem; line-height: 1.45; }

/* --- Responsive ------------------------------------------------------------ */
@media (max-width: 940px) {
  .rh-layout { grid-template-columns: 1fr; }
  .rh-panel { position: static; }
}
