/* circuit-style.css — Insight Gaming Circuit Leaderboard styles */

#circuit-content {
  max-width: 900px;
  margin: 32px auto;
  padding: 0 24px 100px;
}

/* ── Prize pool banner ──────────────────────────────────────────── */
.circuit-prize-banner {
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
}

/* Top row — three cards side by side */
.circuit-prize-top {
  display: flex;
  align-items: stretch;
}

.circuit-prize-section {
  flex: 1;
  padding: 22px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.circuit-prize-divider {
  width: 1px;
  background: var(--border);
  flex-shrink: 0;
}

/* Bottom row — total prize pool */
.circuit-prize-total-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: rgba(123, 47, 190, 0.07);
}

.circuit-prize-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.circuit-prize-amount {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.06em;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.circuit-prize-tbc {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-dim);
  font-style: italic;
  text-shadow: none;
}

.circuit-prize-sub {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  opacity: 0.7;
}

/* ── Search bar ──────────────────────────────────────────────────── */
.circuit-search-wrap {
  position: relative;
  margin-bottom: 20px;
}

.circuit-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.circuit-search {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px 10px 38px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.circuit-search::placeholder {
  color: var(--text-dim);
}

.circuit-search:focus {
  border-color: var(--purple-bright);
  box-shadow: 0 0 0 2px var(--purple-dim);
}

/* ── Loading state ───────────────────────────────────────────────── */
.circuit-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 48px;
}

/* ── Leaderboard container ───────────────────────────────────────── */
.circuit-leaderboard {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ── Player row ──────────────────────────────────────────────────── */
.circuit-row {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.circuit-row:hover {
  border-color: var(--purple);
}

/* Top 16 get a lighter purple highlight */
.circuit-row--top16 {
  background: rgba(123, 47, 190, 0.1);
  border-color: rgba(123, 47, 190, 0.35);
}

.circuit-row--top16:hover {
  border-color: var(--purple-bright);
  background: rgba(123, 47, 190, 0.15);
}

.circuit-row.open {
  border-color: var(--purple-bright);
}

/* ── Row header ──────────────────────────────────────────────────── */
.circuit-row-main {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
}

.circuit-row-main:focus-visible {
  outline: 2px solid var(--purple-bright);
  outline-offset: -2px;
  border-radius: 8px 8px 0 0;
}

/* ── Rank badge ──────────────────────────────────────────────────── */
.circuit-rank {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  min-width: 34px;
  flex-shrink: 0;
}

.circuit-rank--gold   { color: var(--gold);   text-shadow: 0 0 12px rgba(255, 215, 0, 0.55); }
.circuit-rank--silver { color: var(--silver); text-shadow: 0 0 10px rgba(192, 192, 192, 0.45); }
.circuit-rank--bronze { color: var(--bronze); text-shadow: 0 0 10px rgba(205, 127, 50, 0.45); }

/* ── Player name ─────────────────────────────────────────────────── */
.circuit-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Points breakdown chips ──────────────────────────────────────── */
.circuit-chips {
  display: flex;
  gap: 5px;
  flex-wrap: nowrap;
  align-items: center;
  flex-shrink: 0;
}

.circuit-chip {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
}

.circuit-chip-label {
  font-size: 9px;
  margin-left: 2px;
  opacity: 0.75;
}

.circuit-chip--tf {
  color: var(--amber);
  border-color: rgba(245, 158, 11, 0.35);
}

.circuit-chip--att {
  color: var(--green);
  border-color: rgba(34, 197, 94, 0.35);
}

/* ── Total points ────────────────────────────────────────────────── */
.circuit-total {
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--purple-bright);
  min-width: 42px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Chevron ─────────────────────────────────────────────────────── */
.circuit-chevron {
  color: var(--text-dim);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.circuit-row.open .circuit-chevron {
  transform: rotate(180deg);
}

/* ── Expanded body ───────────────────────────────────────────────── */
.circuit-row-body {
  background: var(--surface-3);
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  overflow-x: auto;
}

/* ── Per-scrim breakdown table ───────────────────────────────────── */
.circuit-scrim-table {
  min-width: 460px;
}

.circuit-scrim-header,
.circuit-scrim-row {
  display: grid;
  grid-template-columns: 1fr 50px 52px 50px 52px 58px;
  gap: 8px;
  align-items: center;
  padding: 5px 2px;
}

.circuit-scrim-header {
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  padding-bottom: 7px;
  margin-bottom: 3px;
}

.circuit-scrim-row {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid rgba(123, 47, 190, 0.1);
}

.circuit-scrim-row:last-child {
  border-bottom: none;
}

.circuit-scrim-header span:not(:first-child),
.circuit-scrim-row span:not(:first-child) {
  text-align: center;
}

.circuit-scrim-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.circuit-scrim-date {
  display: block;
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 400;
  margin-top: 1px;
}

.circuit-scrim-total {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--purple-bright);
  text-align: right !important;
}

/* ── Divider between top 30 and full standings ───────────────────── */
.circuit-section-divider {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  padding: 18px 0 10px;
  letter-spacing: 0.1em;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

/* ── Empty / error states ────────────────────────────────────────── */
.circuit-empty,
.circuit-error {
  text-align: center;
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  color: var(--text-dim);
  padding: 48px 24px;
  line-height: 1.7;
}

.circuit-error {
  color: var(--red);
}

.circuit-no-scrims {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  margin: 0;
  padding: 4px 0;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 640px) {
  #circuit-content {
    padding: 0 12px 100px;
  }

  .circuit-prize-top {
    flex-direction: column;
  }

  .circuit-prize-divider {
    width: auto;
    height: 1px;
  }

  .circuit-prize-section {
    padding: 14px 16px;
  }

  .circuit-prize-amount {
    font-size: 1.3rem;
  }

  /* Hide breakdown chips on small screens — total still visible */
  .circuit-chips {
    display: none;
  }

  .circuit-row-main {
    gap: 8px;
    padding: 10px 12px;
  }

  .circuit-name {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .circuit-row,
  .circuit-chevron,
  .circuit-search {
    transition: none;
  }
}
