/* Stats — windmc-inspired player leaderboard (Oriole violet OLED) */

.stats-page {
  min-height: 100vh;
  background: var(--bg, #09090b);
}

.st {
  padding: var(--page-pad, 1.5rem 0 4rem);
  max-width: 72rem;
}

.st-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line, #27272a);
  border-radius: var(--radius, 12px);
  background: var(--surface, #18181b);
}

.st-hero__main {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.st-hero__logo {
  flex-shrink: 0;
  border-radius: 10px;
}

.st-hero h1 {
  margin: 0;
  font-family: var(--display, inherit);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.st-hero__ip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--line, #27272a);
  border-radius: 8px;
  background: var(--bg, #09090b);
  color: var(--muted, #d4aafb);
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.82rem;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.st-hero__ip:hover,
.st-hero__ip.is-copied {
  color: #fff;
  border-color: var(--accent, #a855f7);
}

.st-hero__ip .ph {
  font-size: 0.95rem;
}

.st-hero__online {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted, #d4aafb);
}

.st-hero__online strong {
  font-family: var(--display, inherit);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.st-bridge-hint {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: var(--radius, 12px);
  background: rgba(251, 191, 36, 0.08);
  color: var(--muted, #d4aafb);
  font-size: 0.88rem;
  line-height: 1.5;
}

.st-bridge-hint strong,
.st-bridge-hint code {
  color: #fff;
}

.st-bridge-hint code {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.82em;
}

.st-empty code {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.85em;
  color: #fff;
}

.st-tabs {
  display: flex;
  width: 100%;
  gap: 0.2rem;
  padding: 0.2rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line, #27272a);
  border-radius: 12px;
  background: var(--surface, #18181b);
}

.st-tabs__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  color: #a1a1aa;
  font-size: 0.88rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}

.st-tabs__btn:hover {
  color: #fff;
  background: var(--bg, #09090b);
}

.st-tabs__btn.is-active {
  color: #fff;
  background: var(--accent, #a855f7);
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.25);
}

.st-tabs__btn:focus-visible {
  outline: 2px solid var(--accent, #a855f7);
  outline-offset: 2px;
}

.st-panel--levels .lv {
  padding: 0;
}

.st-activity {
  margin-bottom: 1rem;
  border: 1px solid var(--line, #27272a);
  border-radius: var(--radius, 12px);
  background: var(--surface, #18181b);
  overflow: hidden;
  box-shadow: none;
}

.st-activity__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line, #27272a);
}

.st-activity__head h2 {
  margin: 0;
  font-family: var(--display, inherit);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.st-activity__meta {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--muted, #d4aafb);
}

.st-activity__kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  margin: 0;
}

.st-activity__kpi {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.st-activity__kpi dt {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #d4aafb);
  opacity: 0.8;
}

.st-activity__kpi dd {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.1rem 0 0;
  font-family: var(--display, inherit);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.st-activity__live {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--ok, #5dce8a);
}

.st-chart-panel {
  padding: 0.75rem 1rem 0.85rem;
}

.st-chart-wrap {
  position: relative;
  padding: 0;
  background: transparent;
}

.st-chart {
  display: block;
  width: 100%;
  height: 180px;
}

.st-chart.is-empty {
  opacity: 0.35;
  height: 120px;
}

.st-chart__line {
  vector-effect: non-scaling-stroke;
}

.st-chart__grid-h {
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 1;
}

.st-chart__ylabel {
  fill: rgba(212, 170, 251, 0.55);
  font-size: 9px;
  font-family: var(--font, system-ui, sans-serif);
}

.st-chart__cursor {
  stroke: rgba(196, 181, 253, 0.35);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.st-chart__dot--live {
  fill: #c4b5fd;
  stroke: #a855f7;
  stroke-width: 1.5;
}

.st-chart__tooltip {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  transform: translate(-50%, -100%);
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(168, 85, 247, 0.25);
  background: rgba(24, 24, 27, 0.92);
  white-space: nowrap;
  text-align: center;
}

.st-chart__tip-val {
  display: block;
  font-family: var(--display, inherit);
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
}

.st-chart__tip-time {
  display: block;
  margin-top: 0.05rem;
  font-size: 0.65rem;
  color: var(--muted, #d4aafb);
}

.st-chart__times {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.25rem;
  margin-top: 0.35rem;
  padding: 0;
  font-size: 0.68rem;
  color: rgba(212, 170, 251, 0.55);
  text-align: center;
}

.st-chart__times span:last-child {
  color: rgba(212, 170, 251, 0.85);
}

.st-chart__empty {
  margin: 0;
  padding: 0.5rem 0 0.25rem;
  font-size: 0.85rem;
  color: var(--muted, #d4aafb);
  text-align: center;
}

.st-players {
  border: 1px solid var(--line, #27272a);
  border-radius: var(--radius, 12px);
  background: var(--surface, #18181b);
  overflow: hidden;
}

.st-players__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line, #27272a);
}

.st-players__head h2 {
  margin: 0;
  font-family: var(--display, inherit);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.st-players__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
}

@media (min-width: 640px) {
  .st-players__tools {
    width: auto;
    justify-content: flex-end;
  }
}

.st-search {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1 1 12rem;
  min-width: 0;
  padding: 0 0.75rem;
  border: 1px solid var(--line, #27272a);
  border-radius: 10px;
  background: var(--bg, #09090b);
}

.st-search .ph {
  color: var(--muted, #d4aafb);
  font-size: 1rem;
  flex-shrink: 0;
}

.st-search input {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 0.88rem;
}

.st-search input:focus {
  outline: none;
}

.st-search:focus-within {
  border-color: var(--accent, #a855f7);
  outline: 2px solid var(--accent, #a855f7);
  outline-offset: 0;
}

.st-sort {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.15rem;
  border: 1px solid var(--line, #27272a);
  border-radius: 10px;
  background: var(--bg, #09090b);
}

.st-sort__btn {
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  color: #a1a1aa;
  font-size: 0.8rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}

.st-sort__btn:hover {
  color: #fff;
}

.st-sort__btn.is-active {
  color: #fff;
  background: var(--surface, #18181b);
}

.st-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.st-row {
  display: grid;
  grid-template-columns: 2.2rem 1fr auto;
  align-items: center;
  gap: 0.65rem 0.75rem;
  padding: 0.65rem 1.1rem;
  border-bottom: 1px solid rgba(39, 39, 42, 0.85);
  transition: background 0.15s ease;
}

.st-row:last-child {
  border-bottom: 0;
}

.st-row:hover {
  background: rgba(9, 9, 11, 0.55);
}

.st-row.is-hidden {
  display: none;
}

.st-row__rank {
  font-family: var(--display, inherit);
  font-size: 0.88rem;
  font-weight: 700;
  color: #71717a;
  text-align: center;
}

.st-row--top1 .st-row__rank { color: #fbbf24; }
.st-row--top2 .st-row__rank { color: #d4d4d8; }
.st-row--top3 .st-row__rank { color: #d97706; }

.st-row__player {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.st-row__player:hover .st-row__name {
  color: var(--accent, #a855f7);
}

.st-row__player img {
  flex-shrink: 0;
  border-radius: 8px;
  image-rendering: pixelated;
}

.st-row__name {
  font-weight: 650;
  font-size: 0.92rem;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.st-row__dot {
  flex-shrink: 0;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: rgba(93, 206, 138, 0.15);
  color: var(--ok, #5dce8a);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.st-row__stats {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.st-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #a1a1aa;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.st-stat .ph {
  color: var(--muted, #d4aafb);
  font-size: 0.95rem;
}

.st-miss {
  margin: 0;
  padding: 1.25rem 1.1rem;
  color: var(--muted, #d4aafb);
  font-size: 0.9rem;
  text-align: center;
}

.st-empty {
  padding: 2.5rem 1.25rem;
  text-align: center;
  color: var(--muted, #d4aafb);
}

.st-empty .ph {
  display: block;
  margin: 0 auto 0.5rem;
  font-size: 2rem;
  color: var(--accent, #a855f7);
  opacity: 0.75;
}

.st-empty p {
  margin: 0;
  line-height: 1.5;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 560px) {
  .st {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .st-row {
    grid-template-columns: 1.75rem 1fr;
    grid-template-rows: auto auto;
  }

  .st-row__stats {
    grid-column: 2;
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .st-row,
  .st-hero__ip,
  .st-tabs__btn {
    transition: none;
  }
}
