:root {
  --bg: #07080c; --bg2: #0f1118; --panel: #12141d; --line: #2a2e3d;
  --white: #f7f3ea; --dim: #9aa0b3; --red: #e3182d; --red2: #b5101f; --blue: #1f48d6; --blue2: #1634a3;
  --indie: #f2c230; --world: #19b36b; --meme: #a35bff;
  --px: "Press Start 2P", monospace; --body: "Pixelify Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--white); font: 18px/1.5 var(--body); overflow-x: hidden; }
a { color: inherit; }
img { image-rendering: pixelated; }
.stars { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .35;
  background-image: radial-gradient(#fff 1px, transparent 1.5px), radial-gradient(#fff 1px, transparent 1.5px);
  background-size: 90px 90px, 140px 140px; background-position: 0 0, 45px 70px; }

/* pixel buttons */
.px-btn { font: 12px var(--px); color: var(--white); background: var(--panel); border: 0; padding: 14px 18px; cursor: pointer; text-decoration: none; display: inline-block;
  box-shadow: 0 -4px 0 0 var(--white), 0 4px 0 0 var(--white), -4px 0 0 0 var(--white), 4px 0 0 0 var(--white), inset 0 -4px 0 rgba(0,0,0,.35); transition: transform .08s; }
.px-btn:hover { transform: translateY(-2px); }
.px-btn:active { transform: translateY(2px); }
.px-btn.red { background: var(--red); } .px-btn.blue { background: var(--blue); }
.px-btn.ghost { background: transparent; }
.px-btn.sm { font-size: 10px; padding: 9px 12px; }
.px-btn.big { width: 100%; font-size: 14px; padding: 20px; }
.px-btn:disabled { opacity: .5; cursor: wait; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; padding: 12px 24px; background: rgba(7,8,12,.92); border-bottom: 4px solid var(--white); backdrop-filter: blur(6px); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 16px var(--px); }
.brand img { width: 40px; height: 40px; }
.top nav { display: flex; gap: 22px; margin: 0 auto; }
.top nav a { font: 11px var(--px); text-decoration: none; color: var(--dim); }
.top nav a:hover { color: var(--white); }
.top-r { display: flex; gap: 14px; }

main { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* hero */
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center; padding: 70px 0 50px; }
.kicker { font: 10px var(--px); color: var(--indie); letter-spacing: 1px; }
h1 { font: 44px/1.25 var(--px); margin: 18px 0; text-shadow: 4px 4px 0 var(--blue); }
h1 em { font-style: normal; color: var(--red); text-shadow: 4px 4px 0 var(--white); }
.lead { color: #cfd2dc; font-size: 20px; max-width: 540px; }
.hero-cta { display: flex; gap: 22px; flex-wrap: wrap; margin: 30px 0; }
.ca-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--panel); border: 3px solid var(--line); padding: 10px 14px; max-width: 560px; }
.ca-bar .lbl { font: 10px var(--px); color: var(--red); }
.ca-bar code { font: 13px monospace; color: var(--dim); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hero-r { text-align: center; }
.box-wrap { position: relative; display: inline-block; }
.hero-logo, .empty img, footer img, .brand img { mix-blend-mode: lighten; }
.hero-logo { width: min(420px, 80vw); animation: bob 2.6s steps(4) infinite; }
@keyframes bob { 50% { transform: translateY(-10px); } }
.ballot-fly { position: absolute; inset: 0; pointer-events: none; }
.ballot-fly i { position: absolute; width: 26px; height: 34px; background: var(--white); border: 3px solid #000; top: -10px; animation: drop 1.6s steps(8) forwards; }
.ballot-fly i::after { content: "★"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; color: #000; }
@keyframes drop { 0% { transform: translateY(-60px) rotate(-20deg); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(150px) rotate(10deg); opacity: 0; } }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.stats div { background: var(--panel); border: 3px solid var(--line); padding: 14px 8px; }
.stats b { display: block; font: 18px var(--px); color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats span { font: 8px var(--px); color: var(--dim); }

.ticker { overflow: hidden; border-block: 4px solid var(--white); background: var(--red); margin: 0 -20px; }
.ticker-in { white-space: nowrap; font: 12px var(--px); padding: 12px 0; display: inline-block; animation: tick 28s linear infinite; }
@keyframes tick { from { transform: translateX(100vw); } to { transform: translateX(-100%); } }

/* sections */
.sec { padding: 70px 0 20px; }
h2 { font: 22px var(--px); margin: 0 0 30px; display: flex; align-items: center; gap: 14px; }
h2 .num { background: var(--blue); padding: 8px 10px; font-size: 14px; box-shadow: 4px 4px 0 var(--white); }
.panel { background: var(--panel); border: 4px solid var(--white); box-shadow: 8px 8px 0 #000, 8px 8px 0 4px var(--line); padding: 22px; }
.flabel { font: 10px var(--px); color: var(--dim); display: block; margin-bottom: 10px; }

/* form */
.launch-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: start; }
form label { display: block; font: 10px var(--px); color: var(--dim); margin-bottom: 16px; }
input, textarea, select { display: block; width: 100%; margin-top: 8px; background: var(--bg); color: var(--white); border: 3px solid var(--line); padding: 11px 12px; font: 18px var(--body); outline: none; border-radius: 0; }
input:focus, textarea:focus, select:focus { border-color: var(--white); }
.row2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; }
.field { margin-bottom: 16px; }
.parties, .filters { display: flex; gap: 8px; flex-wrap: wrap; }
.parties button, .filters button { font: 10px var(--px); padding: 10px 12px; background: var(--bg); color: var(--dim); border: 3px solid var(--line); cursor: pointer; }
.parties button.on, .filters button.on { color: #fff; border-color: #fff; }
.parties button[data-p="red"].on, .filters button[data-f="red"].on { background: var(--red); }
.parties button[data-p="blue"].on, .filters button[data-f="blue"].on { background: var(--blue); }
.parties button[data-p="indie"].on, .filters button[data-f="indie"].on { background: var(--indie); color: #000; }
.parties button[data-p="world"].on, .filters button[data-f="world"].on { background: var(--world); }
.parties button[data-p="meme"].on, .filters button[data-f="meme"].on { background: var(--meme); }
.filters button[data-f="all"].on { background: var(--white); color: #000; }
.pic-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pic-row .file { margin: 4px; }
.chk { display: flex !important; align-items: center; gap: 10px; font: 16px var(--body) !important; color: var(--white) !important; text-transform: none; }
.chk input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--red); }
.rules { align-items: flex-start !important; color: var(--dim) !important; font-size: 15px !important; }
.rules input { margin-top: 3px; }
small { color: var(--dim); font-size: 14px; }
.link { background: none; border: 0; color: var(--red); cursor: pointer; font: 15px var(--body); text-decoration: underline; }
details { margin-bottom: 16px; border: 3px dashed var(--line); padding: 10px 12px; }
details summary { font: 10px var(--px); color: var(--dim); cursor: pointer; }
details[open] summary { margin-bottom: 14px; }
.cost { color: var(--dim); font-size: 15px; margin: 4px 0 18px; }
.steps { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 6px; }
.steps li { font-size: 15px; color: var(--dim); padding-left: 28px; position: relative; }
.steps li::before { content: "□"; position: absolute; left: 4px; }
.steps li.doing { color: var(--indie); } .steps li.doing::before { content: "▶"; }
.steps li.done { color: var(--world); } .steps li.done::before { content: "■"; }
.steps li.fail { color: var(--red); } .steps li.fail::before { content: "✕"; }
.result { margin-top: 16px; background: var(--bg); border: 3px solid var(--indie); padding: 14px; font-size: 16px; word-break: break-all; }
.result b { font: 11px var(--px); color: var(--indie); }

/* cards */
.preview { position: sticky; top: 90px; }
.hint { color: var(--dim); font-size: 14px; text-align: center; margin-top: 18px; }
.card { background: var(--panel); border: 4px solid var(--white); box-shadow: 6px 6px 0 #000; display: flex; flex-direction: column; }
.card canvas, .card img.pic { width: 100%; aspect-ratio: 1; display: block; border-bottom: 4px solid var(--white); background: #000; object-fit: cover; }
.card-b { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.card-t { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card-t b { font-size: 20px; line-height: 1.2; word-break: break-word; }
.party-tag { font: 8px var(--px); padding: 6px 7px; flex: none; color: #fff; }
.party-tag.red { background: var(--red); } .party-tag.blue { background: var(--blue); } .party-tag.indie { background: var(--indie); color: #000; } .party-tag.world { background: var(--world); } .party-tag.meme { background: var(--meme); }
.tick { font: 11px var(--px); color: var(--indie); margin: 2px 0; }
.slogan { margin: 0; color: #e6e3da; font-style: italic; }
.insp { margin: 0; color: var(--dim); font-size: 14px; }
.big-card .card-t b { font-size: 24px; }

.ballot-bar { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.sorts { display: flex; gap: 10px; }
.sorts select, .sorts input { margin: 0; width: auto; font-size: 16px; padding: 8px 10px; }
.sorts select { font: 10px var(--px); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 26px; }
.card .meta { display: flex; justify-content: space-between; font-size: 14px; color: var(--dim); margin-top: auto; padding-top: 8px; }
.card .acts { display: flex; gap: 8px; padding: 0 14px 14px; }
.card .acts .px-btn { flex: 1; text-align: center; box-shadow: none; border: 3px solid var(--white); padding: 10px 6px; }
.card .acts .vote { background: var(--red); }
.card .acts .vote.voted { background: var(--world); }
.votes-n { font: 10px var(--px); color: var(--white); }
.rank { position: absolute; top: 8px; left: 8px; font: 10px var(--px); background: var(--indie); color: #000; padding: 6px 7px; }
.card { position: relative; }
.empty { text-align: center; display: grid; justify-items: center; gap: 10px; padding: 40px; }
.empty img { width: 110px; }
.empty p { font: 14px var(--px); margin: 8px 0 0; }

/* race */
.race-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; }
.party-bar { display: flex; height: 44px; border: 4px solid var(--white); background: var(--bg); }
.party-bar div { height: 100%; transition: width .6s steps(10); }
.party-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: 15px; }
.party-legend i { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; }
.top5 { display: grid; gap: 12px; }
.top5 .r { display: grid; grid-template-columns: 26px 1fr 52px; gap: 10px; align-items: center; font-size: 15px; }
.top5 .r b { font: 10px var(--px); color: var(--indie); }
.top5 .bar { height: 22px; background: var(--bg); border: 3px solid var(--line); position: relative; }
.top5 .bar span { position: absolute; inset: 0 auto 0 0; }
.top5 .bar em { position: relative; font-style: normal; padding-left: 8px; font-size: 14px; line-height: 16px; white-space: nowrap; }
.top5 .n { font: 10px var(--px); text-align: right; }
.dim { color: var(--dim); }

/* how */
.how { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 34px; }
.step b { font: 24px var(--px); color: var(--red); }
.step h3 { font: 12px var(--px); margin: 14px 0 10px; }
.step p { margin: 0; color: #cfd2dc; font-size: 16px; }
.rulesbox ul { margin: 0; padding-left: 20px; color: #cfd2dc; display: grid; gap: 6px; }

footer { margin-top: 80px; border-top: 4px solid var(--white); padding: 26px 24px 40px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 15px; }
footer img { width: 34px; }
footer .dim { margin-left: auto; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120px); background: var(--white); color: #000; font: 11px var(--px); padding: 14px 18px; z-index: 50; transition: transform .2s; box-shadow: 6px 6px 0 var(--red); }
.toast.show { transform: translateX(-50%) translateY(0); }

@media (max-width: 900px) {
  .hero, .launch-grid, .race-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 40px; }
  .hero-r { order: -1; }
  .hero-logo { width: 240px; }
  h1 { font-size: 28px; }
  .top nav { display: none; }
  .top { padding: 10px 16px; justify-content: space-between; }
  .brand span { font-size: 12px; }
  .how { grid-template-columns: 1fr 1fr; }
  .preview { position: static; }
  main { padding: 0 16px; }
  .ticker { margin: 0 -16px; }
}
@media (max-width: 520px) {
  .how { grid-template-columns: 1fr; }
  h2 { font-size: 15px; }
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .stats b { font-size: 14px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .card-t b { font-size: 16px; }
  .card .acts { flex-direction: column; }
  .sorts { width: 100%; }
  .sorts select, .sorts input { flex: 1; min-width: 0; }
  footer .dim { margin-left: 0; }
}
