/* The More page: how it works, stats, contributions, reset, matrices. */

/* PAGE 4: MORE */
#page-more {
  padding: 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  padding: 16px;
}
.stat-card {
  background: var(--card);
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
}
.stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  display: inline-block;
}
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.stats-section {
  padding: 0 16px 24px;
}
.stats-section h3 {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--card-alt);
}

/* USER CONTRIBUTIONS */
.contrib-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--card-alt);
  --highlight: var(--text-muted);
  --bar-bg: var(--bg);
  --bar-fill: var(--purple);
}
.contrib-item.contrib-you {
  background: var(--card-alt);
  border-radius: 8px;
  padding: 10px;
  border-bottom: none;
  margin-bottom: 2px;
  --highlight: var(--accent);
  --bar-bg: var(--border);
  --bar-fill: var(--accent);
}
.contrib-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  background: var(--card-alt);
  color: var(--highlight);
}
.contrib-you .contrib-rank {
  background: var(--accent-bg);
}
.contrib-info {
  flex: 1;
  min-width: 0;
}
.contrib-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--highlight);
  margin-bottom: 4px;
}
.contrib-bar-track {
  height: 6px;
  background: var(--bar-bg);
  border-radius: 3px;
  overflow: hidden;
}
.contrib-bar-fill {
  height: 100%;
  background: var(--bar-fill);
  border-radius: 3px;
  transition: width 0.5s ease;
}
.contrib-stats {
  text-align: right;
  flex-shrink: 0;
}
.contrib-votes {
  font-size: 16px;
  font-weight: 700;
  color: var(--highlight);
}
@keyframes vote-bump {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.4);
  }
  100% {
    transform: scale(1);
  }
}
.contrib-votes.changed,
.contrib-count.changed,
.stat-value.changed,
.board-score.score-changed {
  animation: vote-bump 0.4s ease;
}
.contrib-detail {
  font-size: 11px;
  color: var(--text-muted);
}
.contrib-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.contrib-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.contrib-label {
  font-size: 12px;
  color: var(--text-muted);
  width: 60px;
  text-align: right;
  flex-shrink: 0;
}
.contrib-bar-track {
  flex: 1;
  height: 20px;
  background: var(--card-alt);
  border-radius: 4px;
  overflow: hidden;
}
.contrib-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  min-width: 2px;
}
.contrib-bar.contrib-you {
  background: var(--purple);
}
.contrib-count {
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.contrib-num {
  display: inline-block;
  min-width: 3.5ch;
  text-align: right;
  font-weight: 700;
}

/* ABOUT / HOW IT WORKS */
.about-section {
  padding: 16px;
}
.about-section h3 {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--card-alt);
}
.about-content p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.about-content a {
  color: var(--purple);
  text-decoration: none;
}
.about-content a:hover {
  text-decoration: underline;
}
.about-content code {
  background: var(--card-alt);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}
.about-content h4 {
  font-size: 13px;
  color: var(--text);
  margin-top: 16px;
  margin-bottom: 6px;
}
.about-content h4:first-child {
  margin-top: 0;
}
.about-content p.math {
  font-family: 'Times New Roman', 'Georgia', serif;
  font-size: 15px;
  color: var(--text);
  background: var(--card-alt);
  padding: 8px 12px;
  border-radius: 6px;
  text-align: center;
  margin: 8px 0;
}
.bt-demo {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin: 10px 0;
}
.bt-demo canvas {
  display: block;
  margin: 0 auto;
}
.bt-sim-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
}
.bt-sim-btn {
  background: var(--card-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}
.bt-sim-btn:hover {
  background: var(--card-selected);
}
.bt-sim-header {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 4px;
}

/* RESET VOTES */
.reset-section {
  padding: 16px 16px 0;
}
.reset-btn {
  background: var(--card);
  color: #b33;
  border: 1px solid #d99;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}
.reset-btn:hover {
  background: #fef0f0;
}

/* MATRIX */
.matrix-section {
  padding: 16px;
}
.matrix-section h3 {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--card-alt);
}
.matrix-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.matrix-top-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--card-alt);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: var(--bg);
}
.matrix-top-scroll + .matrix-scroll-wrapper {
  border-top: none;
  border-radius: 0 0 8px 8px;
}
.matrix-scroll-wrapper {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--card-alt);
  border-radius: 8px;
  background: var(--bg);
}
.matrix-canvas {
  display: block;
}
#matrix-tooltip {
  position: fixed;
  pointer-events: none;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  max-width: 70vw;
  white-space: pre-wrap;
  overflow: hidden;
}
.matrix-empty {
  color: var(--text-muted);
  padding: 20px;
  text-align: center;
}
