/* VOTEPAD: election night. Black sky, the logo's cream, red and blue, pixel display type, clean readable UI. */
@font-face { font-family: "Pixelify Sans"; src: url("/assets/fonts/pixelify.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("/assets/fonts/nunito.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }

:root {
  --sky: #050507;
  --night: #0b0b10;
  --panel: #111118;
  --line: #24242e;
  --cream: #f8f0e8;
  --paper: #ede6d6;
  --red: #f03038;
  --red-deep: #c4222a;
  --blue: #2048b0;
  --blue-lit: #3466d8;
  --muted: #a49d92;
  --green: #3fd17a;
  --px: "Pixelify Sans", ui-monospace, monospace;
  --body: "Nunito", system-ui, sans-serif;
  --gut: clamp(18px, 3.4vw, 64px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html { background: var(--sky); color-scheme: dark; }
body { margin: 0; background: var(--sky); color: var(--cream); font: 400 16px/1.55 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--cream); color: var(--sky); padding: 8px 14px; z-index: 99; }
.skip:focus { left: 8px; }
.quiet { color: var(--muted); margin: 0; font-size: 14px; }

/* ---------- masthead ---------- */
.mast { position: fixed; inset: 0 0 auto; z-index: 40; display: flex; align-items: center; gap: 28px; padding: 10px var(--gut); background: linear-gradient(var(--sky) 55%, rgba(5, 5, 7, 0)); }
.mast-logo img { height: 46px; width: auto; image-rendering: pixelated; }
.mast-nav { display: flex; gap: 22px; }
.mast-nav a { text-decoration: none; font: 500 17px var(--px); color: var(--paper); padding: 6px 0; background: linear-gradient(var(--red), var(--red)) 0 100% / 0 3px no-repeat; transition: background-size .35s var(--ease); }
.mast-nav a:hover { background-size: 100% 3px; }
.mast-side { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.glyph { width: 38px; height: 38px; display: grid; place-items: center; border: 2px solid var(--line); background: var(--night); transition: border-color .2s; }
.glyph:hover { border-color: var(--cream); }
.glyph svg { width: 18px; height: 18px; fill: var(--cream); }
.pairtag { font-size: 13px; color: var(--muted); }
.pairtag a { color: var(--cream); }
.cachip { height: 38px; padding: 0 12px; border: 2px dashed var(--line); background: transparent; font: 500 14px var(--px); color: var(--muted); cursor: default; }
.cachip.live { border-style: solid; border-color: var(--cream); color: var(--cream); cursor: copy; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 16px; font: 600 16px var(--px); text-decoration: none; border: 2px solid var(--cream); cursor: pointer; box-shadow: 4px 4px 0 var(--sh, var(--blue)); transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .2s; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--sh, var(--blue)); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--sh, var(--blue)); }
.btn-red { background: var(--red); color: var(--cream); --sh: var(--cream); }
.btn-red:hover { background: #ff3c44; }
.btn-ghost { background: var(--sky); color: var(--cream); }
.btn-ghost[aria-disabled="true"] { opacity: .55; }
.btn-big { height: 52px; padding: 0 26px; font-size: 19px; }
.btn[disabled] { opacity: .5; cursor: wait; }

/* ---------- stage: the night scene and the live podium ---------- */
.stage { position: relative; min-height: 100vh; min-height: 100svh; display: grid; grid-template-rows: 1fr auto; grid-template-columns: minmax(0, 1fr); padding: 108px var(--gut) 0; overflow: hidden; isolation: isolate; }
.night { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; image-rendering: pixelated; }
.stage-copy { text-align: center; align-self: center; max-width: 1240px; margin: 0 auto; padding-bottom: 12px; }
.hed { margin: 0; font: 700 clamp(40px, 6.1vw, 132px)/.98 var(--px); letter-spacing: -.01em; text-shadow: 0 5px 0 #000; }
.hed-line { display: inline-block; white-space: nowrap; position: relative; }
.underline { position: absolute; left: 6%; right: 6%; bottom: -.12em; height: .1em; min-height: 6px; background: var(--red); transform-origin: left; box-shadow: 0 3px 0 #000; }
.sec-title .underline { left: 0; right: 0; bottom: -10px; height: 6px; }
.lede { max-width: 640px; margin: clamp(22px, 3vh, 34px) auto 0; font-size: clamp(16px, 1.15vw, 20px); color: var(--paper); text-shadow: 0 2px 8px #000; }
.stage-acts { display: flex; gap: 14px; justify-content: center; margin-top: clamp(20px, 3vh, 32px); flex-wrap: wrap; }

.podium { position: relative; padding: 0 0 clamp(86px, 13vh, 150px); }
.podium-note { text-align: center; font: 500 15px var(--px); color: var(--muted); margin: 0 0 12px; }
.podium-row { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(10px, 1.2vw, 22px); max-width: 1680px; }
.cand { position: relative; background: rgba(11, 11, 16, .92); border: 2px solid var(--line); box-shadow: 0 6px 0 #000; cursor: pointer; transition: transform .25s var(--ease), border-color .2s; text-align: left; padding: 0; width: 100%; }
.cand:hover { transform: translateY(-6px); border-color: var(--cream); }
.cand-face { aspect-ratio: 1; background: var(--night); overflow: hidden; border-bottom: 2px solid var(--line); }
.cand-face img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; transition: transform .5s var(--ease); }
.cand:hover .cand-face img { transform: scale(1.04); }
.cand-txt { padding: 10px 12px 12px; display: grid; gap: 2px; }
.cand-name { font: 600 clamp(15px, 1.05vw, 19px)/1.15 var(--px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cand-num { font-size: 14px; color: var(--paper); font-variant-numeric: tabular-nums; }
.cand-num b { color: var(--cream); }
.cand-lead { position: absolute; top: -12px; left: 10px; background: var(--red); border: 2px solid var(--cream); font: 600 13px var(--px); padding: 1px 8px; box-shadow: 0 3px 0 #000; }
.cand-bar { height: 6px; background: var(--line); margin-top: 6px; }
.cand-bar i { display: block; height: 100%; background: var(--blue-lit); transform-origin: left; }
.cand:first-child .cand-bar i { background: var(--red); }

.flag-rule { display: grid; gap: 6px; padding: 0 var(--gut); }
.flag-rule span { height: 6px; background: var(--red); }
.flag-rule span + span { background: var(--blue); }

/* ---------- sections ---------- */
.race, .ballot, .launch, .feed { padding: clamp(80px, 11vh, 140px) var(--gut) 0; }
.sec-head { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 560px); gap: 24px 64px; align-items: end; justify-content: space-between; margin-bottom: clamp(32px, 5vh, 56px); }
.sec-title { position: relative; margin: 0; font: 700 clamp(40px, 5vw, 96px)/1 var(--px); white-space: nowrap; justify-self: start; text-shadow: 0 5px 0 #000; }
.sec-sub { margin: 0; color: var(--paper); font-size: 17px; }

/* the race */
.race-tabs { display: inline-flex; border: 2px solid var(--line); margin-bottom: 22px; }
.race-tabs button { background: none; border: 0; padding: 10px 18px; font: 600 16px var(--px); color: var(--muted); cursor: pointer; }
.race-tabs button[aria-selected="true"] { background: var(--cream); color: var(--sky); }
.tally { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--line); }
.row { display: grid; grid-template-columns: 56px minmax(150px, 1.1fr) minmax(160px, 2.4fr) 130px 90px minmax(160px, 1.3fr); gap: 20px; align-items: center; padding: 12px 8px; border-bottom: 2px solid var(--line); cursor: pointer; transition: background .2s; }
.row:hover { background: var(--night); }
.row-face { width: 56px; height: 56px; border: 2px solid var(--line); object-fit: cover; image-rendering: pixelated; background: var(--night); }
.row-who b { display: block; font: 600 19px/1.15 var(--px); }
.row-who span { font-size: 13px; color: var(--muted); }
.row-bar { height: 18px; background: var(--night); position: relative; }
.row-bar i { position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); background: repeating-linear-gradient(90deg, var(--blue-lit) 0 10px, var(--blue) 10px 12px); transform-origin: left; }
.row:first-child .row-bar i { background: repeating-linear-gradient(90deg, var(--red) 0 10px, var(--red-deep) 10px 12px); }
.row-vol { font: 600 18px var(--px); text-align: right; font-variant-numeric: tabular-nums; }
.row-count { font-size: 14px; color: var(--muted); text-align: right; }
.row-tick { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tick { font: 500 13px var(--px); padding: 2px 7px; border: 2px solid var(--line); text-decoration: none; color: var(--paper); white-space: nowrap; }
a.tick:hover { border-color: var(--cream); color: var(--cream); }
.race-stamp { font-size: 13px; color: var(--muted); margin: 14px 0 0; }
.empty { padding: 28px 8px; color: var(--paper); border-bottom: 2px solid var(--line); list-style: none; }

/* the ballot */
.ballot-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(12px, 1.4vw, 26px); }
.seat { position: relative; display: grid; border: 2px solid var(--line); background: var(--night); box-shadow: 0 6px 0 #000; cursor: pointer; transition: transform .3s var(--ease), border-color .2s; text-align: left; padding: 0; width: 100%; }
.seat:hover { transform: translateY(-6px); border-color: var(--cream); }
.seat-face { aspect-ratio: 4 / 5; overflow: hidden; background: var(--sky); }
.seat-face img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.seat-txt { padding: 12px 14px 14px; border-top: 2px solid var(--line); }
.seat-txt b { display: block; font: 600 clamp(16px, 1.2vw, 21px)/1.15 var(--px); }
.seat-txt span { font-size: 13px; color: var(--muted); }
.stories { margin-top: clamp(36px, 5vh, 60px); display: flex; gap: 18px 28px; align-items: center; flex-wrap: wrap; }
.stories-title { margin: 0; font: 600 22px var(--px); }
.stories-row { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 4px 14px; border: 2px solid var(--line); background: var(--night); font: 500 15px var(--px); color: var(--paper); cursor: pointer; transition: border-color .2s, background .2s; }
.chip:hover { border-color: var(--cream); color: var(--cream); }
.chip[aria-pressed="true"] { background: var(--cream); color: var(--sky); border-color: var(--cream); }
.chip[disabled] { opacity: .45; cursor: not-allowed; }
.chip img { width: 24px; height: 24px; image-rendering: pixelated; }
.chip-file { position: relative; overflow: hidden; }
.chip-file input { position: absolute; inset: 0; width: 1px; height: 1px; opacity: 0; }
.chip-file:focus-within { outline: 3px solid var(--red); }

/* launch */
.launch-body { display: grid; grid-template-columns: minmax(260px, 420px) minmax(0, 1fr); gap: clamp(28px, 4vw, 80px); align-items: start; }
.slip { position: sticky; top: 96px; margin: 0; background: var(--paper); color: var(--sky); border: 2px solid var(--cream); box-shadow: 0 8px 0 #000; padding: 16px; transform: rotate(-2deg); }
.slip-img { aspect-ratio: 1; background: var(--sky); display: grid; place-items: center; overflow: hidden; }
.slip-img img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.slip-img span { color: var(--muted); font: 500 15px var(--px); padding: 20px; text-align: center; }
.slip figcaption { display: grid; gap: 2px; padding-top: 14px; }
.slip-ticker { font: 700 34px/1 var(--px); color: var(--red-deep); overflow-wrap: anywhere; }
.slip-name { font: 600 19px var(--px); }
.slip-for, .slip-pair { font-size: 14px; color: #4a463f; }
.cast { display: grid; gap: 28px; }
.cast-set { border: 0; padding: 0; margin: 0; display: grid; gap: 12px; }
.cast-set legend { font: 600 22px var(--px); margin-bottom: 12px; padding: 0; }
.cast-two { grid-template-columns: 1fr 1fr; }
.cast-two legend { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 14px; color: var(--muted); }
.field-wide { grid-column: 1 / -1; }
.field input, .field textarea { width: 100%; background: var(--night); border: 2px solid var(--line); padding: 11px 12px; font-size: 16px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--cream); outline: none; }
.who { display: flex; flex-wrap: wrap; gap: 8px; }
.imgpick { display: grid; gap: 6px; }
.imgpick > span { font-size: 14px; color: var(--muted); }
.imgpick-row { display: flex; gap: 10px; flex-wrap: wrap; }
.pairs { display: flex; flex-wrap: wrap; gap: 8px; }
.cast-go { justify-self: start; }
.status { margin: 0; min-height: 24px; color: var(--paper); }
.status.bad { color: #ff7b80; }
.status a { color: var(--cream); }

/* feed */
.feed { padding-bottom: clamp(80px, 11vh, 140px); }
.feed-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.launched { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; border: 2px solid var(--line); padding: 10px; background: var(--night); }
.launched img { width: 64px; height: 64px; object-fit: cover; background: var(--sky); }
.launched b { font: 600 18px var(--px); }
.launched p { margin: 0; font-size: 13px; color: var(--muted); }
.launched a { color: var(--paper); }
.feed-list .empty { grid-column: 1 / -1; border: 2px dashed var(--line); text-align: center; }

/* footer */
.foot { padding-bottom: 40px; }
.foot-in { display: grid; grid-template-columns: 180px minmax(0, 1fr) auto; gap: 40px; align-items: center; padding: 40px var(--gut) 0; }
.foot-logo { width: 180px; height: auto; image-rendering: pixelated; }
.foot-copy p { margin: 0 0 8px; color: var(--paper); font-size: 15px; max-width: 760px; }
.foot-links { display: flex; gap: 10px; }

/* dossier */
.dossier { width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 2px solid var(--cream); background: var(--night); color: var(--cream); box-shadow: 0 10px 0 #000; }
.dossier::backdrop { background: rgba(5, 5, 7, .82); }
.dossier-in { display: grid; grid-template-columns: minmax(200px, 340px) 1fr; }
.dossier-face { width: 100%; aspect-ratio: 1; object-fit: cover; image-rendering: pixelated; background: var(--sky); }
.dossier-main { padding: 24px 28px; display: grid; gap: 10px; align-content: start; }
.dossier-main h3 { margin: 0; font: 700 34px/1 var(--px); }
.dossier-main h4 { margin: 10px 0 0; font: 600 18px var(--px); }
.dossier-role { margin: 0; color: var(--muted); }
.dossier-stats { display: flex; gap: 22px; flex-wrap: wrap; font-size: 15px; color: var(--paper); }
.dossier-stats b { font: 600 20px var(--px); color: var(--cream); display: block; }
.dossier-coins { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dossier-coins li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 6px 0; font-size: 15px; }
.dossier-coins a { color: var(--cream); }
.dossier-x { position: absolute; right: 10px; top: 6px; background: none; border: 0; font: 600 30px var(--px); cursor: pointer; z-index: 2; }

/* ---------- responsive ---------- */
@media (min-width: 2200px) {
  body { font-size: 18px; }
  .podium-row { max-width: 2100px; }
  .mast-logo img { height: 56px; }
}
@media (max-width: 1200px) {
  .mast-nav { display: none; }
  .podium-row { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 760px; }
  .ballot-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .row { grid-template-columns: 48px minmax(120px, 1fr) minmax(100px, 1.6fr) 110px; }
  .row-face { width: 48px; height: 48px; }
  .row-count, .row-tick { display: none; }
  .sec-head { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .mast { gap: 10px; }
  .mast-logo img { height: 36px; }
  .pairtag, #buyBtn { display: none; }
  .cachip { display: none; }
  .glyph { width: 34px; height: 34px; }
  #walletBtn { height: 34px; padding: 0 10px; font-size: 14px; }
  .stage { padding-top: 92px; }
  .hed { font-size: clamp(34px, 10.4vw, 60px); }
  .hed-line { white-space: normal; }
  .podium-row { grid-template-columns: repeat(6, 42vw); overflow-x: auto; scroll-snap-type: x mandatory; max-width: none; padding: 14px 4px 10px; margin: 0 calc(var(--gut) * -1); padding-left: var(--gut); }
  .cand { scroll-snap-align: start; }
  .ballot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row { grid-template-columns: 44px minmax(0, 1fr) 96px; gap: 12px; }
  .row-bar { display: none; }
  .row-face { width: 44px; height: 44px; }
  .launch-body { grid-template-columns: 1fr; }
  .slip { position: relative; top: 0; max-width: 300px; justify-self: center; }
  .cast-two { grid-template-columns: 1fr; }
  .foot-in { grid-template-columns: 1fr; gap: 20px; }
  .dossier-in { grid-template-columns: 1fr; }
  .dossier-face { max-height: 280px; }
  .sec-title { font-size: clamp(34px, 11vw, 56px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
