/*
 * The compare page (compare.html, js/compare.js) on the red-to-blue background: a party-colored card
 * each, then tiles: Your matches, the stance-by-stance breakdown, head to head, and More to compare
 * (rows with a column per person).
 */
.cmp { --ink: #1e1a67; --quiet: #4e4a7a; --label: #7d78ab; --lav: #f1effe; --line: #efedfb;
  --tile: 0 2px 4px rgba(38, 27, 143, .05), 0 10px 26px rgba(38, 27, 143, .10);
  width: min(100% - 32px, 1200px); margin: 18px auto 56px; display: grid; gap: 16px; color: var(--ink); }
.cmp [hidden] { display: none !important; }
.cmp a { color: inherit; }
.cmp-tile { min-width: 0; padding: 20px; border-radius: 26px; background: #fff; box-shadow: var(--tile); }
.cmp-tile > h2 { margin: 0 0 14px; font-size: 18px; font-weight: 800; }
.cmp-note { margin: 6px 0 0; color: var(--label); font-size: 13px; }
.cmp-fig { font-family: var(--font-fig, system-ui, sans-serif); font-weight: 900; font-synthesis: none; line-height: 1; color: #21167c; }
.cmp-muted { color: #a29ec4; }
.cmp-chip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--lav); color: #21167c; font-size: 12px; font-weight: 700; text-decoration: none; }

/* a person's circle */
.cmp-face { position: relative; display: inline-block; flex: none; width: var(--d, 40px); height: var(--d, 40px); border-radius: 50%; background: #fff center / cover no-repeat;
  color: #8d86c2; font: 800 calc(var(--d, 40px) * .3)/var(--d, 40px) var(--font-read, system-ui, sans-serif); text-align: center; box-shadow: 0 0 0 2px var(--p, var(--party-other)); }
.cmp-face[data-party="democrat"] { --p: var(--party-democrat); } .cmp-face[data-party="republican"] { --p: var(--party-republican); }

/* ---------- the top ---------- */
.cmp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.cmp-head .page-heading { margin: 0; font-size: clamp(28px, 3.4vw, 40px); }
.cmp-notes { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.cmp-notes span { padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, .9); color: var(--ink); font-size: 14px; font-weight: 700; box-shadow: var(--tile); }
.cmp-notes span.is-rel { background: #fff4d6; color: #7a5200; }
/* + add someone (the search from the old strip) */
.cmp-add { position: relative; }
.cmp-add .chip-plus { width: auto; height: auto; padding: 9px 16px; border: 0; border-radius: 14px; background: var(--btn-go, #21167c); color: #fff; font: 800 14px/1.1 var(--font-read, system-ui, sans-serif); cursor: pointer; }
.cmp-add .chip-search { width: 260px; padding: 10px 14px; border: 0; border-radius: 14px; background: #fff; box-shadow: 0 0 0 2px #4232d4; font: 600 15px var(--font-read, system-ui, sans-serif); color: var(--ink); }
.cmp-add .chip-results { position: absolute; right: 0; z-index: 30; width: 300px; margin: 6px 0 0; padding: 6px; list-style: none; border-radius: 16px; background: #fff; box-shadow: 0 12px 36px rgba(21, 14, 94, .22); }
.cmp-add .chip-result { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 11px; cursor: pointer; }
.cmp-add .chip-result.active, .cmp-add .chip-result:hover { background: var(--lav); }
.cmp-add .chip-result b { display: block; font-size: 14px; } .cmp-add .chip-result small { color: var(--label); font-size: 12px; }
.cmp-add .chip-face { width: 30px; height: 30px; border-radius: 50%; background: #fff center / cover; box-shadow: 0 0 0 2px var(--party-other); flex: none; font-size: 11px; line-height: 30px; text-align: center; }
.cmp-add .chip-face[data-party="democrat"] { box-shadow: 0 0 0 2px var(--party-democrat); } .cmp-add .chip-face[data-party="republican"] { box-shadow: 0 0 0 2px var(--party-republican); }

/* ---------- the cards ---------- */
.cmp-cards { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 16px; }
.cmp-card { position: relative; display: grid; justify-items: center; align-content: start; gap: 8px; padding: 26px 18px 20px; border-radius: 28px; color: #fff; text-align: center; overflow: hidden;
  background: radial-gradient(120% 140% at 100% 0%, #8d5be0, #4b33c9 45%, #21167c); box-shadow: var(--tile); transition: transform .35s cubic-bezier(.34, 1.56, .64, 1); }
.cmp-card:hover { transform: translateY(-3px); }
.cmp-card[data-hero="republican"] { background: radial-gradient(120% 140% at 100% 0%, #ff6b6b, #d42a33 45%, #7e0d16); }
.cmp-card[data-hero="democrat"] { background: radial-gradient(120% 140% at 100% 0%, #6b9bff, #2350e0 45%, #0c1f7e); }
.cmp-card[data-hero="green"] { background: radial-gradient(120% 140% at 100% 0%, #6fd697, #1f9a50 45%, #0a5229); }
.cmp-card[data-hero="libertarian"] { background: radial-gradient(120% 140% at 100% 0%, #ffcf5a, #d9930f 45%, #7a4704); }
.cmp-card[data-hero="appointed"] { background: radial-gradient(120% 140% at 100% 0%, #a3abb8, #5f6877 45%, #2b313b); }
.cmp-card > a { display: grid; justify-items: center; gap: 6px; color: #fff; text-decoration: none; }
.cmp-card .cmp-face { --d: 120px; margin-bottom: 6px; box-shadow: 0 0 0 4px #fff, 0 0 0 8px rgba(255, 255, 255, .35), 0 10px 22px rgba(0, 0, 0, .25); }
.cmp-card b { font-size: 22px; font-weight: 800; line-height: 1.15; } .cmp-card small { color: rgba(255, 255, 255, .88); font-size: 14px; }
.cmp-card .cmp-party { padding: 3px 12px; border-radius: 999px; background: #fff; color: #21167c; font-size: 12px; font-weight: 800; }
.cmp-card .stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.cmp-card .stats span { display: grid; gap: 3px; min-width: 64px; padding: 8px 10px; border-radius: 16px; background: rgba(255, 255, 255, .14); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.cmp-card .stats em { font-family: var(--font-fig, system-ui, sans-serif); font-style: normal; font-weight: 900; font-synthesis: none; font-size: 26px; letter-spacing: 0; text-transform: none; }
.cmp-card .fav-btn, .cmp-card .cmp-x { position: absolute; top: 14px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: #21167c; font: 800 18px/1 var(--font-read, system-ui, sans-serif); cursor: pointer; transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.cmp-card .fav-btn { right: 14px; color: #b9b2f0; font-size: 20px; } .cmp-card .fav-btn.is-on { color: #ffb400; }
.cmp-card .cmp-x { left: 14px; }
.cmp-card .fav-btn:hover, .cmp-card .cmp-x:hover { transform: scale(1.12); }
.cmp-empty { padding: 30px; border-radius: 26px; background: #fff; box-shadow: var(--tile); text-align: center; color: var(--quiet); font-size: 16px; }

/* ---------- your matches ---------- */
.cmp-match { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 14px; }
.cmp-match > div { display: grid; justify-items: center; gap: 6px; padding: 16px; border-radius: 22px; background: var(--lav); text-align: center; }
.cmp-match .cmp-face { --d: 56px; }
.cmp-match b { font-size: 16px; } .cmp-match .cmp-fig { font-size: 46px; } .cmp-match small { color: var(--quiet); font-size: 13px; }
.cmp-match > div.is-top { background: #21167c; color: #fff; } .cmp-match > div.is-top .cmp-fig { color: #fff; } .cmp-match > div.is-top small { color: rgba(255, 255, 255, .85); }

/* ---------- stance by stance ---------- */
.cmp-issues { display: grid; }
.cmp-issue, .cmp-colhead { display: grid; grid-template-columns: 190px repeat(var(--n, 2), minmax(0, 1fr)); gap: 12px; align-items: start; }
.cmp-issue { padding: 14px 0; border-top: 1px solid var(--line); }
.cmp-issue > b { padding-top: 8px; font-size: 16px; }
.cmp-colhead { padding-bottom: 6px; }
.cmp-colhead > span { display: flex; justify-content: center; align-items: center; gap: 8px; font-weight: 800; }
.cmp-colhead .cmp-face { --d: 32px; }
.cmp-st { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; padding: 8px 8px 8px 12px; border-radius: 14px; background: var(--lav); font-size: 14px; font-weight: 600; transition: background .2s; }
.cmp-st span { flex: 1; }
.cmp-st button { flex: none; width: 30px; height: 30px; border: 0; border-radius: 50%; background: #fff; font-size: 15px; cursor: pointer; opacity: .55; transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), opacity .2s; }
.cmp-st button:hover { opacity: 1; transform: scale(1.1); }
.cmp-st.is-up { background: #dff6ea; } .cmp-st.is-up button.up { opacity: 1; background: #2bb673; }
.cmp-st.is-down { background: #fde8e8; } .cmp-st.is-down button.down { opacity: 1; background: #ff8b8b; }
.cmp-none { padding: 8px 12px; color: #b0acd0; font-size: 14px; }

/* ---------- head to head ---------- */
.cmp-duel { display: grid; gap: 16px; }
.cmp-duel .row { display: grid; grid-template-columns: 1fr 160px 1fr; gap: 14px; align-items: center; }
.cmp-duel .row > b { text-align: center; font-size: 14px; font-weight: 800; }
.cmp-duel .side { display: flex; align-items: center; gap: 10px; } .cmp-duel .side.l { flex-direction: row-reverse; }
.cmp-duel .bar { flex: 1; display: flex; height: 26px; border-radius: 999px; background: var(--lav); overflow: hidden; }
.cmp-duel .side.l .bar { justify-content: flex-end; }
.cmp-duel .bar i { display: block; height: 100%; border-radius: 999px; background: var(--c); }
.cmp-duel .num { width: 56px; font-family: var(--font-fig, system-ui, sans-serif); font-weight: 900; font-synthesis: none; font-size: 24px; color: #21167c; text-align: center; }
.cmp-duel .txt { flex: 1; color: var(--quiet); font-size: 14px; font-weight: 700; } .cmp-duel .side.l .txt { text-align: right; }
/* (three or four people: a grid, a column each, darker squares for higher numbers) */
.h2h-heat { display: grid; grid-template-columns: 180px repeat(var(--n), minmax(0, 1fr)); gap: 6px; align-items: center; }
.h2h-heat .who { display: grid; justify-items: center; gap: 4px; padding-bottom: 6px; font-size: 13px; }
.h2h-heat .lbl { font-size: 14px; font-weight: 800; }
.h2h-heat .cell { display: grid; place-items: center; height: 52px; border-radius: 14px; background: color-mix(in srgb, var(--c) var(--k), #fff); color: #21167c;
  font-family: var(--font-fig, system-ui, sans-serif); font-weight: 900; font-synthesis: none; font-size: 22px; }
.h2h-heat .cell.dark { color: #fff; } .h2h-heat .cell.top { box-shadow: 0 0 0 3px #fff, 0 0 0 5px #21167c; }
.h2h-heat .cell.na { padding: 0 6px; background: var(--lav); color: var(--label); font: 700 12px/1.2 var(--font-read, system-ui, sans-serif); text-align: center; }
.h2h-heat .cell.tally { height: 36px; background: var(--lav); font: 800 13px var(--font-read, system-ui, sans-serif); }
.h2h-heat .none { grid-column: 2 / -1; color: var(--label); font-size: 13px; }
@media (max-width: 760px) {
  .h2h-heat { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); } .h2h-heat > span:first-child { display: none; }
  .h2h-heat .lbl { grid-column: 1 / -1; margin-top: 6px; } .h2h-heat .none { grid-column: 1 / -1; } .h2h-heat .cell { height: 44px; font-size: 18px; }
  .h2h-heat .who b { font-size: 11px; }
}
/* ---------- more to compare: a row each ---------- */
.cmp-rows { display: grid; }
.cmp-row { display: grid; grid-template-columns: 190px repeat(var(--n, 2), minmax(0, 1fr)); gap: 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.cmp-row.is-section { padding: 22px 0 4px; border: 0; color: var(--label); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.cmp-rows > .cmp-row.is-section:first-child { padding-top: 0; }
.cmp-row > b { font-size: 15px; font-weight: 800; } .cmp-row > b small { display: block; color: var(--label); font-size: 12px; font-weight: 600; }
.cmp-row > div { min-width: 0; color: var(--quiet); font-size: 14px; line-height: 1.45; text-align: center; }
.cmp-row ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; text-align: left; }
.cmp-row li::before { content: "• "; color: #b9b2f0; }
.cmp-row .cmp-fig { font-size: 28px; }
.cmp-row .lr { position: relative; height: 10px; margin: 12px 10px 6px; border-radius: 999px; background: linear-gradient(90deg, var(--party-democrat), var(--party-other), var(--party-republican)); }
.cmp-row .lr i { position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid #1e1a67; transform: translate(-50%, -50%); }
.cmp-row .take { display: flex; justify-content: center; gap: 4px; } .cmp-row .take span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--lav); }
.cmp-allies { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.cmp-allies a, .cmp-allies span { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; background: var(--lav); font-size: 13px; font-weight: 700; text-decoration: none; }
.cmp-allies .cmp-face { --d: 24px; }
.cmp-allies .is-shared { background: #21167c; color: #fff !important; }
.cmp-headline { display: block; margin-top: 6px; color: var(--ink); font-size: 13px; font-weight: 700; text-align: left; text-decoration: none; } .cmp-headline:hover { text-decoration: underline; }
.cmp-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  .cmp { width: min(100% - 24px, 1200px); margin-top: 12px; }
  .cmp-cards, .cmp-match { grid-template-columns: repeat(min(var(--n, 2), 2), minmax(0, 1fr)); gap: 10px; }
  .cmp-card { padding: 20px 10px 16px; } .cmp-card .cmp-face { --d: 84px; } .cmp-card b { font-size: 17px; }
  .cmp-card .stats span { min-width: 54px; padding: 6px 8px; } .cmp-card .stats em { font-size: 20px; }
  .cmp-issue, .cmp-colhead, .cmp-row { grid-template-columns: repeat(min(var(--n, 2), 2), minmax(0, 1fr)); }
  .cmp-issue > b, .cmp-row > b { grid-column: 1 / -1; }
  .cmp-colhead > :first-child { display: none; }
  .cmp-st { flex-wrap: wrap; } .cmp-st span { flex: 1 1 100%; }
  .cmp-duel .row { grid-template-columns: 1fr 1fr; } .cmp-duel .row > b { grid-column: 1 / -1; order: -1; }
  .cmp-duel .num { width: 40px; font-size: 18px; }
  .cmp-add .chip-search { width: 100%; } .cmp-add .chip-results { left: 0; right: auto; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .cmp-card, .cmp-st button { transition: none; } }
