/* Your Town and Ballot-ready (the owner's pick of mock-progress): the Games page's Your town view and tile
   (js/townview.js, js/town.js), the profile's town card (js/profile.js), and the Ballot-ready meters in the
   voter guide (js/voter.js) and the home page's election box (js/home.js). Dark mode: css/dark.css, built. */

/* ---------- Your town (learn#town) ---------- */
.tn { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(290px, 1fr); gap: 20px; align-items: start; margin: 6px 0 40px; }
.tn-stage { position: sticky; top: 12px; overflow: hidden; border-radius: 26px; background: linear-gradient(#e9f3ff, #f6f1ff 70%); box-shadow: 0 10px 30px rgba(38, 27, 143, .1); }
.tn-stage-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px 0; }
/* the evening, 6 pm to 6 am (js/townview.js; the owner's pick of mock-friendly3): a dusk sky behind the town, whose lit windows glow */
.tn-stage.is-night { background: linear-gradient(#241a5e, #4b2f86 55%, #8a4f9c); }
.tn-stage.is-night :is(.tn-name, .tn-grow output, .tn-grow) { color: #fff; }
.tn-name { display: block; font-size: 20px; color: #150e5e; }
.tn-place { font-size: 13.5px; color: #4e4a7a; }
.tn-tier { flex: none; padding: 6px 12px; border-radius: 999px; background: #fff; color: #150e5e; box-shadow: 0 2px 8px rgba(30, 26, 103, .12); font-weight: 800; font-size: 14px; }
.tn-canvas { position: relative; }
.tn-canvas canvas { display: block; width: 100%; cursor: pointer; touch-action: manipulation; }
.tn-pop { position: absolute; z-index: 3; width: 230px; padding: 12px 14px; border-radius: 16px; background: #fff; color: #150e5e; box-shadow: 0 10px 30px rgba(23, 18, 63, .25); font-size: 14px; line-height: 1.35; transform: translate(-50%, calc(-100% - 12px)); }
.tn-pop b { display: block; font-size: 15px; }
.tn-pop small { display: block; margin-top: 2px; color: #5d5a7d; }
.tn-pop .tn-btn { margin-top: 8px; padding: 6px 12px; font-size: 13px; }
.tn-grow { display: flex; align-items: center; gap: 12px; padding: 4px 20px 16px; }
.tn-grow[hidden] { display: none; }
.tn-play { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #d3cdfb; color: #150e5e; font-size: 15px; cursor: pointer; }
.tn-slider { flex: 1; display: grid; gap: 2px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #6b6890; }
.tn-slider input { width: 100%; height: 22px; margin: 0; background: none; -webkit-appearance: none; appearance: none; cursor: pointer; }
.tn-slider input::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: linear-gradient(90deg, #967dfc, #f0b4f1); }
.tn-slider input::-moz-range-track { height: 8px; border-radius: 999px; background: linear-gradient(90deg, #967dfc, #f0b4f1); }
.tn-slider input::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -7px; border: 3px solid #fff; border-radius: 50%; background: #21167c; box-shadow: 0 2px 6px rgba(30, 26, 103, .35); }
.tn-slider input::-moz-range-thumb { width: 16px; height: 16px; border: 3px solid #fff; border-radius: 50%; background: #21167c; box-shadow: 0 2px 6px rgba(30, 26, 103, .35); }
.tn-grow output { flex: none; min-width: 56px; text-align: right; font-weight: 800; font-size: 15px; color: #150e5e; }

.tn-side { display: grid; gap: 14px; }
.tn-card { padding: 16px 18px; border-radius: 22px; background: #fff; color: #150e5e; box-shadow: 0 8px 22px rgba(38, 27, 143, .09); }
.tn-card p { margin: 0 0 10px; font-size: 14.5px; line-height: 1.4; }
.tn-kicker { margin: 0 0 8px !important; font-size: 12px !important; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #6b6890; }
.tn-note { margin: 0 !important; font-size: 12.5px !important; color: #6b6890; }
.tn-none { color: #5d5a7d; }
.tn-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border: 0; border-radius: 14px; background: #d3cdfb; color: #150e5e; font: 700 14px/1.1 var(--font-read); text-decoration: none; cursor: pointer; }
.tn-btn.is-go { background: #21167c; color: #fff; }
.tn-btn.is-white { background: #fff; color: #150e5e; box-shadow: inset 0 0 0 2px #d3cdfb; }
.tn-btn.is-lamp { background: #fde68a; color: #2a2550; }
.tn-keep { background: linear-gradient(90deg, #efe9ff, #fdeefb); }
.tn-size-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.tn-size-top b { font-size: 22px; }
.tn-size-top span { font-size: 14px; color: #5d5a7d; }
.tn-bar { height: 12px; border-radius: 999px; background: #efedfd; overflow: hidden; }
.tn-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #967dfc, #c39cfa, #f0b4f1); }
.tn-tiers { display: grid; grid-template-columns: repeat(4, 1fr); margin: 8px 0 0; padding: 0; list-style: none; font-size: 13px; font-weight: 700; color: #8a87a8; }
.tn-tiers li { display: block; text-align: center; }
.tn-tiers li:first-child { text-align: left; }
.tn-tiers li:last-child { text-align: right; }
.tn-tiers small { display: block; font-weight: 600; font-size: 11.5px; }
.tn-tiers .is-on { color: #150e5e; }
.tn-tiers .is-here { text-decoration: underline 3px #c39cfa; text-underline-offset: 4px; }
.tn-dim { background: #2a2550; color: #fff; }
.tn-dim .tn-kicker { color: #fde68a; }
.tn-q p { margin: 8px 0; }
.tn-q-btns { display: grid; gap: 8px; }
.tn-q-why { color: #fde68a; }
.tn-dim.is-lit { background: #fffbea; color: #150e5e; }
.tn-dim.is-lit .tn-kicker { color: #7a5300; }
.tn-next-row { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.tn-next-ico { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border: 2px dashed #3b82f6; border-radius: 14px; background: #eff6ff; font-size: 24px; }
.tn-next-row b { display: block; font-size: 16px; }
.tn-next-row small { display: block; font-size: 13.5px; line-height: 1.35; color: #5d5a7d; }
.tn-next .tn-btn { width: 100%; box-sizing: border-box; }
.tn-log ol { display: grid; max-height: 280px; margin: 0; padding: 0 4px 0 0; overflow-y: auto; list-style: none; }
.tn-log li { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid #efedfa; font-size: 14px; line-height: 1.3; }
.tn-log li:first-child { border-top: 0; }
.tn-log li > span:first-child { font-size: 20px; text-align: center; }
.tn-log li small { display: block; color: #6b6890; font-size: 12.5px; }
.tn-log li time { font-size: 12.5px; font-weight: 700; color: #6b6890; white-space: nowrap; }
.tn-how ul { display: grid; gap: 8px; margin: 0 0 10px; padding: 0; list-style: none; }
.tn-how li { display: grid; grid-template-columns: 26px 1fr; gap: 8px; font-size: 14px; line-height: 1.35; }
.tn-how li > span:first-child { font-size: 18px; }
@media (max-width: 900px) {
  .tn { grid-template-columns: minmax(0, 1fr); }
  .tn-stage { position: relative; top: 0; }
}
@media (max-width: 700px) {
  .tn-stage { border-radius: 22px; }
  .tn-stage-top { padding: 14px 14px 0; }
  .tn-grow { padding: 2px 14px 14px; }
}

/* the Games page's tile */
.gm-pic.is-town { background: linear-gradient(#e9f3ff, #f6f1ff); overflow: hidden; }
.gm-town { position: absolute; top: 50%; left: 50%; width: 100%; transform: translate(-50%, -50%); }
.gm-town canvas { display: block; width: 100%; }

/* ---------- the profile's town card ---------- */
.pf-town-pic { position: relative; overflow: hidden; border-radius: 16px; background: linear-gradient(#e9f3ff, #f6f1ff); }
.pf-town-pic canvas { display: block; width: 100%; }
.pf-town-tag { position: absolute; left: 10px; bottom: 10px; padding: 4px 10px; border-radius: 999px; background: #fff; color: #150e5e; font-size: 13px; font-weight: 800; box-shadow: 0 2px 8px rgba(30, 26, 103, .15); }
.pf-town-go { display: inline-block; margin-top: 8px; font-weight: 700; }
.pf-town-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pf-town-flags span { padding: 4px 10px; border-radius: 999px; background: #efedfd; color: #21167c; font-size: 12.5px; font-weight: 700; }

/* ---------- Ballot-ready ---------- */
/* the ring (the home page's election box) */
.br { display: flex; align-items: center; gap: 12px; margin: 12px 0 0; padding: 10px 12px; border-radius: 18px; background: #f3f1fb; color: #150e5e; text-decoration: none; }
.br-ring { flex: none; width: 52px; height: 52px; transform: rotate(-90deg); }
.br-ring circle { fill: none; stroke-width: 8; }
.br-ring .br-bg { stroke: #e1ddf7; }
.br-ring .br-fg { stroke: #967dfc; stroke-linecap: round; }
.br-txt { display: grid; gap: 1px; min-width: 0; }
.br-txt b { font-size: 16px; }
.br-txt span { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #6b6890; }
.br-txt small { font-size: 13px; color: #4e4a7a; }
.br.is-full { background: linear-gradient(90deg, #efe9ff, #fdeefb); }
/* a visitor, until Election Day: plan on any device (the owner's pick of mock-join; js/feed.js drawJoin) */
.hm-join { position: relative; z-index: 2; margin: 12px 0 0; padding: 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .3); font-size: 13.5px; line-height: 1.45; }
.hm-join-go { margin-left: 2px; padding: 5px 12px; border: 0; border-radius: 999px; background: #fff; color: #150e5e; font: 800 13px var(--font-read, system-ui); cursor: pointer; }
@media (hover: hover) { .hm-join-go:hover { background: #efedfd; } }
.br.is-start .br-txt b { font-size: 15px; }
/* on the violet election box (the right column, and the phone's hero) */
.hm-violet .br { background: rgba(255, 255, 255, .12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); color: #fff; }
.hm-violet .br-txt span, .hm-violet .br-txt small { color: rgba(255, 255, 255, .85); }
.hm-violet .br-ring .br-bg { stroke: rgba(255, 255, 255, .22); }
.hm-violet .br-ring .br-fg { stroke: #f0b4f1; }
.hm-violet .br.is-full { background: rgba(240, 180, 241, .28); }

/* the voter guide's meter and the races' Read marks */
.vg-ready { margin: 0 0 14px; padding: 14px 16px; border-radius: 18px; background: #f3f1fb; color: #150e5e; }
.vg-ready-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.vg-ready-top b { font-size: 17px; }
.vg-ready-top strong { font-size: 24px; line-height: 1; }
.vg-ready-segs { display: flex; gap: 4px; margin: 10px 0 8px; }
.vg-ready-segs i { flex: 1; height: 9px; border-radius: 999px; background: #e1ddf7; }
.vg-ready-segs i.is-on { background: linear-gradient(90deg, #967dfc, #f0b4f1); }
/* a long ballot (js/voter.js readyBox): one bar, filled as far as they've read */
.vg-ready-fill { flex: 1; display: flex; height: 9px; border-radius: 999px; background: #e1ddf7; overflow: hidden; }
.vg-ready-segs .vg-ready-fill i { flex: none; height: 100%; }
.vg-ready p { margin: 0; font-size: 13.5px; line-height: 1.4; color: #4e4a7a; }
.vg-ready.is-full { background: linear-gradient(90deg, #efe9ff, #fdeefb); }
/* a visitor: joining is the first step, still open (the owner's pick of mock-join) */
.vg-ready-segs i.is-join { flex: none; width: 22px; background: #fff; box-shadow: inset 0 0 0 2px #f0b4f1; }
.vg-ready-join { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-top: 12px; padding: 10px 12px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 2px #f0b4f1; }
.vg-ready-join > i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #21167c; color: #fff; font-style: normal; font-weight: 800; font-size: 13px; }
.vg-ready-join b { display: block; font-size: 14.5px; }
.vg-ready-join small { display: block; color: #6b6890; font-size: 12.5px; line-height: 1.35; }
.vg-ready-join-go { padding: 9px 16px; border: 0; border-radius: 12px; background: #21167c; color: #fff; font: 800 14px var(--font-read, system-ui); cursor: pointer; }
@media (hover: hover) { .vg-ready-join-go:hover { background: #3424b8; } }
/* Texas: no phones where you vote, so print (until Election Day) */
.vg-phone-note { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 8px; margin: 0 0 14px; padding: 10px 14px; border-radius: 16px; background: #fff8e6; color: #5a4300; font-size: 13.5px; line-height: 1.45; }
.vg-phone-note .vg-link { font-weight: 700; }
.vg-readmark { flex: none; padding: 3px 8px; border-radius: 999px; background: #e3f5ec; color: #0a7d4f; font-size: 12px; font-weight: 800; white-space: nowrap; }
.vg-readmark.is-todo { background: #efedfd; color: #4e4a7a; font-weight: 700; }
.vg-readhint { margin: 6px 0 0; font-size: 13px; color: #4e4a7a; }

/* Your ballot's results, after an election (the owner's pick of mock-join; js/results.js) */
.hm-results[hidden] { display: none; }
.hr-sample { margin: 0 0 6px; padding: 4px 10px; border-radius: 10px; background: #fff4d6; color: #7a5300; font-size: 12.5px; font-weight: 700; }
.hr-h { margin: 2px 0 2px; font-size: 21px; color: #150e5e; }
.hr-sum { margin: 0 0 8px; color: #4a4675; font-size: 14px; }
.hr-rows { display: grid; }
.hr-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; padding: 9px 2px; border-top: 1px solid #f0eefb; font-size: 14px; }
.hr-row span { color: #4a4675; overflow-wrap: anywhere; }
.hr-row b { text-align: right; color: #150e5e; }
.hr-row em { grid-column: 1 / -1; color: #6b6890; font-size: 12.5px; font-style: normal; }
.hr-row em.is-yes { color: #0a7d4f; font-weight: 700; }
.hr-more summary { padding: 8px 2px; color: #4232d4; font-weight: 700; font-size: 14px; cursor: pointer; }
.hr-new { margin-top: 12px; padding: 12px 14px; border-radius: 16px; background: #f7f5ff; color: #150e5e; }
.hr-new p { margin: 4px 0 10px; color: #4a4675; font-size: 13px; line-height: 1.4; }
.hr-follow, .hr-join-go { padding: 8px 14px; border: 0; border-radius: 12px; background: #21167c; color: #fff; font: 800 13.5px var(--font-read, system-ui); cursor: pointer; }
.hr-follow:disabled { background: #e3f5ec; color: #0a7d4f; cursor: default; }
.hr-note { margin: 10px 0 0; color: #6b6890; font-size: 12px; line-height: 1.4; }
.hr-join { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 0; padding: 10px 12px; border-radius: 14px; background: linear-gradient(120deg, #f3eeff, #fdf0fb); color: #3d3a6b; font-size: 13.5px; }
