/*


 */

:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #e5e5e0;
  --accent: #4338ca;
  --accent-light: #eef2ff;
  --winner: #059669;
  --winner-bg: #ecfdf5;
  --eliminated: #dc2626;
  --eliminated-bg: #fef2f2;
  --radius: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  background: var(--accent);
  color: #fff;
  padding: 2rem 0 1.5rem;
}
.site-header h1 { font-size: 1.75rem; font-weight: 700; }
.site-header h1 a { color: #fff; text-decoration: none; }
.site-header .subtitle {
  color: rgba(255,255,255,0.75);
  font-size: 1rem;
  margin-top: 0.25rem;
}

/* Navigation */
.site-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-nav .container {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.nav-pill {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  white-space: nowrap;
  transition: all 0.15s ease;
}
.nav-pill:hover { color: var(--accent); border-color: var(--accent); }
.nav-pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Main content */
main { padding: 2rem 0; }

/* Page title */
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.page-description {
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 640px;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.card h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--accent);
}
.card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1.25rem 0 0.75rem;
}

/* Ballot list */
.ballot-list { list-style: none; }
.ballot-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.ballot-list li:last-child { border-bottom: none; }
.ballot-weight {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  padding: 0.2rem 0.5rem;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 4px;
}
.ballot-ranking {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.ballot-ranking .candidate {
  padding: 0.15rem 0.5rem;
  background: #f3f4f6;
  border-radius: 4px;
  font-size: 0.85rem;
}
.ballot-ranking .arrow {
  color: var(--text-muted);
  font-size: 0.75rem;
}
.ballot-partial {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th, td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.table-wrap { overflow-x: auto; }

/* Comparison table */
.comparison-table td:first-child { font-weight: 600; }
.comparison-table .winner-cell {
  color: var(--winner);
  font-weight: 600;
}

/* Result badge */
.winner-badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  background: var(--winner-bg);
  color: var(--winner);
  font-weight: 700;
  border-radius: 20px;
  font-size: 0.9rem;
}
.eliminated-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: var(--eliminated-bg);
  color: var(--eliminated);
  font-weight: 500;
  border-radius: 4px;
  font-size: 0.8rem;
}

/* Round display */
.round {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
  background: var(--bg);
}
.round-header {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.tally-bar-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.tally-label {
  min-width: 5rem;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: right;
}
.tally-bar-track {
  flex: 1;
  height: 1.25rem;
  background: #f3f4f6;
  border-radius: 4px;
  overflow: hidden;
}
.tally-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s ease;
  min-width: 2px;
}
.tally-bar-fill.winner { background: var(--winner); }
.tally-bar-fill.eliminated { background: var(--eliminated); opacity: 0.5; }
.tally-value {
  min-width: 2.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.round-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Beats matrix */
.beats-matrix th, .beats-matrix td { text-align: center; }
.beats-matrix .self-cell { background: #f3f4f6; }
.beats-matrix .win-cell { background: var(--winner-bg); color: var(--winner); font-weight: 600; }
.beats-matrix .loss-cell { background: var(--eliminated-bg); color: var(--eliminated); }
.beats-matrix .row-label { text-align: left; font-weight: 600; }

/* Method grid on index */
.method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.method-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.method-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(67, 56, 202, 0.1);
}
.method-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 0.5rem;
}
.method-card .method-winner {
  margin-top: 0.75rem;
}
.method-card .method-type {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

/* Explanation blocks */
.explanation {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.9rem;
  line-height: 1.7;
}

/* Seats selector */
.seats-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.seats-tab {
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg);
  color: var(--text-muted);
}
.seats-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}
