/* 16-bit political campaign. Palette + rules: see CLAUDE.md "Visual design". */
:root {
  --page: #c9e9a0;
  --sky: #b8e2f2;
  --grass: #6fbf4a;
  --grass-hi: #8fd468;
  --sand: #f2dfa6;
  --cream: #fffbe8;
  --ink: #2b2a22;
  --muted: #5a5544;
  --muted-2: #4a4636;
  --track: #e6dfc4;
  --red: #d8333a;
  --gold: #f0c040;
  --blue: #2f5fd0;
  --dex-red: #d8333a;
  --dex-red-dark: #9e1f26;
  --dex-red-hi: #ef6066;
  --lens: #2f8fe0;
  --lens-dark: #1c5fa6;
  --lens-hi: #8fd0ff;
  --bezel: #e4e0d4;
  --frame: #6a8caf;
  --lcd: #1f3a2a;
  --lcd-edge: #3c5a44;
  --lcd-text: #d8f0b8;
  --head: 'Bungee', sans-serif;
  --pixel: 'Press Start 2P', monospace;
  --body: 'VT323', monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font: 22px/1.2 var(--body);
}
a { color: var(--blue); }
a:hover { color: var(--ink); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.wrap { max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.red { color: var(--red); }
.muted { color: var(--muted); font-size: 20px; }
.label { font-family: var(--pixel); font-size: 10px; line-height: 1.5; }
.label-lg { margin: 0; font-family: var(--pixel); font-size: 14px; font-weight: 400; }
.grow { flex: 1; }
.mobile-only { display: none; }
@keyframes blink { 50% { opacity: 0; } }
.blink { color: var(--red); animation: blink 1s steps(1) infinite; }

/* ---- Chrome ---- */
.disclaimer {
  background: var(--ink); color: var(--cream);
  font-family: var(--pixel); font-size: 9px; letter-spacing: 1px; line-height: 1.6;
  text-align: center; padding: 8px 16px;
}
.bunting { height: 8px; background: repeating-linear-gradient(90deg, var(--red) 0 16px, var(--cream) 16px 32px, var(--blue) 32px 48px); }

.nav { padding-top: 20px; padding-bottom: 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-family: var(--pixel); font-size: 12px; line-height: 1.6; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.nav-links a { font-family: var(--pixel); font-size: 10px; color: var(--ink); text-decoration: none; padding: 14px 12px; }
.nav-links .nav-gold { background: var(--gold); box-shadow: 4px 4px 0 var(--ink); }
.nav-links a[aria-current="page"] { outline: 3px solid var(--ink); }
.menu-btn {
  display: none; width: 44px; height: 44px; padding: 0; cursor: pointer;
  background: var(--gold); border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  place-items: center;
}

.footer { background: var(--sand); border-top: 4px solid var(--ink); color: var(--muted-2); padding: 28px 24px; text-align: center; font-size: 20px; }
.footer p { margin: 0 auto; max-width: 820px; }
.footer .small { margin-top: 10px; font-size: 18px; }

.scanlines { position: fixed; inset: 0; pointer-events: none; z-index: 5; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.07) 0 2px, transparent 2px 4px); }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 20; transform: translate(-50%, 20px);
  max-width: calc(100vw - 32px); padding: 12px 16px;
  background: var(--ink); color: var(--cream); border: 4px solid var(--ink); box-shadow: inset 0 0 0 3px var(--gold);
  font-size: 22px; opacity: 0; pointer-events: none; transition: opacity 0.15s, transform 0.15s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- Boxes ---- */
.panel { background: var(--cream); border: 4px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); }
.panel-double { box-shadow: inset 0 0 0 4px var(--cream), inset 0 0 0 8px var(--ink), 8px 8px 0 var(--ink); }
.textbox { position: relative; border: 4px solid var(--ink); }
.textbox p { margin: 0; font-size: 28px; line-height: 1.25; }
.textbox .blink { position: absolute; right: 18px; bottom: 8px; font-size: 22px; }
.textbox-blue { background: var(--cream); box-shadow: inset 0 0 0 4px var(--cream), inset 0 0 0 8px var(--blue), 8px 8px 0 var(--ink); padding: 24px 28px 28px; }
.textbox-white { background: #ffffff; box-shadow: 6px 6px 0 var(--ink); padding: 16px 22px 20px; }
.textbox-white p { line-height: 1.2; }
.swatch { width: 14px; height: 14px; flex: none; outline: 2px solid var(--ink); display: inline-block; }
.swatch.sm { width: 10px; height: 10px; }
.track { height: 12px; background: var(--track); border: 3px solid var(--ink); }
.track > div { height: 100%; }

.btn {
  display: inline-block; cursor: pointer; text-decoration: none; text-align: center;
  font-family: var(--head); font-size: 18px; line-height: 1.2;
  padding: 18px 22px; border: 4px solid var(--ink); box-shadow: 6px 6px 0 var(--ink);
}
.btn:active { transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--ink); }
.btn-red { color: var(--cream); background: var(--red); }
.btn-red:hover { color: var(--cream); background: #c42a31; }
.btn-blue { color: var(--cream); background: var(--blue); }
.btn-white { color: var(--ink); background: #ffffff; }
.text-btn { background: none; border: 0; cursor: pointer; font-family: var(--pixel); font-size: 11px; padding: 12px 8px; color: var(--ink); }
.text-btn:disabled { opacity: 0.3; cursor: default; }
.icon-btn { background: none; border: 0; cursor: pointer; font-family: var(--pixel); font-size: 14px; padding: 6px 8px; }

/* ---- Hero + Congress ---- */
.hero { padding-top: 48px; padding-bottom: 64px; display: flex; flex-wrap: wrap; gap: 32px; align-items: stretch; }
.hero-main { flex: 1 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.kicker { margin: 0; font-family: var(--pixel); font-size: 10px; color: #9a5f00; letter-spacing: 1px; line-height: 1.6; }
.title { margin: 0; font-family: var(--head); font-weight: 400; font-size: 56px; line-height: 1.15; text-shadow: 5px 5px 0 var(--cream), 9px 9px 0 #8fcf6a; }
.title .red { text-shadow: 5px 5px 0 var(--cream); }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.cta-row > span { font-size: 24px; flex: 1 1 260px; }

.congress { flex: 1.4 1 560px; min-width: 0; padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.congress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.congress p { margin: 0; }
/* Explicit aspect ratio + no overflow: Safari can mis-size inline SVGs with height:auto and spill over the button below */
.seats { display: block; width: 100%; height: auto; aspect-ratio: 200 / 106; overflow: hidden; }
.seats circle { cursor: pointer; stroke: var(--ink); stroke-width: 0.35; }
.seats circle:hover { stroke-width: 0.9; }
.seats text { text-anchor: middle; fill: var(--ink); pointer-events: none; }
.congress-screen { position: relative; }
.seat-tip {
  position: absolute; z-index: 3; transform: translate(-50%, calc(-100% - 14px)); pointer-events: none;
  display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; white-space: nowrap;
  background: #ffffff; border: 3px solid var(--ink); border-radius: 8px; box-shadow: inset 0 0 0 2px #ffffff, inset 0 0 0 4px var(--frame), 4px 4px 0 var(--ink);
}
.seat-tip .pic { width: 52px; height: 52px; box-shadow: inset 0 -12px 0 color-mix(in srgb, var(--tc) 60%, #ffffff); }
.seat-tip .pic .art { width: 48px; height: 48px; }
.seat-tip-text { display: flex; flex-direction: column; gap: 2px; font-size: 20px; line-height: 1.1; }
.seat-tip-text b { font-family: var(--head); font-weight: 400; font-size: 15px; }
.seat-tip-text .label { font-size: 8px; color: var(--muted); }
.seats-total { font-family: var(--head); font-size: 9px; }
.seats-sub { font-family: var(--body); font-size: 6px; fill: var(--muted) !important; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; font-size: 22px; }
.legend li { display: flex; align-items: center; gap: 10px; }
.legend b { font-family: var(--pixel); font-size: 11px; font-weight: 400; }
.legend-mini { display: none; }

/* ---- Vote popup: a Pokédex ---- */
.vote-dialog {
  width: 560px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px);
  padding: 0; color: var(--ink); overflow: auto;
  background: var(--dex-red); border: 4px solid var(--ink); border-radius: 18px;
  box-shadow: inset 0 4px 0 var(--dex-red-hi), inset 0 -8px 0 var(--dex-red-dark), 10px 10px 0 rgba(43, 42, 34, 0.6);
}
.vote-dialog::backdrop { background: rgba(43, 42, 34, 0.55); }

.dex-top { display: flex; align-items: center; gap: 10px; padding: 16px 18px 14px; border-bottom: 4px solid var(--ink); box-shadow: 0 4px 0 var(--dex-red-dark); }
.dex-lens {
  flex: none; width: 58px; height: 58px; border-radius: 50%;
  background: var(--lens); border: 5px solid #ffffff; outline: 4px solid var(--ink);
  box-shadow: inset -7px -7px 0 var(--lens-dark), inset 7px 7px 0 var(--lens-hi);
}
.dex-led { flex: none; align-self: flex-start; margin-top: 4px; width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--ink); }
.dex-led.red { background: #ff6b6b; }
.dex-led.yellow { background: var(--gold); }
.dex-led.green { background: #5fd068; }
.dex-title { margin-left: auto; font-family: var(--pixel); font-size: 11px; letter-spacing: 2px; color: var(--cream); text-shadow: 2px 2px 0 var(--dex-red-dark); }
.dex-close {
  flex: none; width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  background: var(--ink); color: var(--cream); border: 3px solid var(--ink); font-family: var(--pixel); font-size: 12px;
  box-shadow: 0 3px 0 var(--dex-red-dark);
}

.vote { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px; }

/* Main screen: gray bezel, cream display, angled bottom-left corner like the handheld */
.dex-screen {
  background: var(--bezel); border: 4px solid var(--ink); border-radius: 8px 8px 8px 32px;
  padding: 10px 18px 10px; box-shadow: 4px 4px 0 var(--dex-red-dark);
}
.dex-screen-dots { display: flex; justify-content: center; gap: 12px; margin-bottom: 8px; }
.dex-screen-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--red); border: 2px solid var(--ink); }
.dex-display { background: var(--cream); border: 4px solid var(--ink); border-radius: 4px; padding: 12px 14px; }
.dex-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 10px; font-family: var(--pixel); font-size: 10px; line-height: 1.5; color: var(--muted); }
.dex-entry { display: flex; gap: 16px; align-items: center; }
.dex-screen-foot { display: flex; justify-content: flex-end; padding: 8px 4px 2px; }
.dex-speaker { width: 44px; height: 3px; background: var(--ink); box-shadow: 0 6px 0 var(--ink), 0 12px 0 var(--ink); margin-bottom: 12px; }

/* Picture slot: the Pokémon's sprite (crisp 2×) standing on a type-colored floor, or its type emblem */
.emblem {
  flex: none; width: 200px; height: 200px; display: grid; place-items: center; overflow: hidden;
  background: color-mix(in srgb, var(--tc) 30%, #ffffff); border: 4px solid var(--ink); border-radius: 4px;
  box-shadow: inset 0 -48px 0 color-mix(in srgb, var(--tc) 60%, #ffffff);
}
.art { display: block; image-rendering: pixelated; object-fit: contain; }
.emblem .art { width: 192px; height: 192px; }
.pic {
  flex: none; width: 104px; height: 104px; display: inline-grid; place-items: center; overflow: hidden;
  background: color-mix(in srgb, var(--tc) 30%, #ffffff); border: 3px solid var(--ink); border-radius: 4px;
  box-shadow: inset 0 -26px 0 color-mix(in srgb, var(--tc) 60%, #ffffff);
}
.pic .art { width: 96px; height: 96px; }

.plate-info { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; min-width: 0; }
.pname { margin: 0; font-family: var(--head); font-weight: 400; font-size: 30px; line-height: 1.05; overflow-wrap: anywhere; }
.pname.long { font-size: 22px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.type-pill { font-family: var(--pixel); font-size: 9px; color: var(--ink); background: var(--tc); padding: 5px 8px; border: 2px solid var(--ink); border-radius: 999px; }
.type-pill.dark { color: var(--cream); }
.share-btn {
  cursor: pointer; font-family: var(--pixel); font-size: 9px; padding: 8px 12px; min-height: 34px;
  background: var(--gold); color: var(--ink); border: 3px solid var(--ink); border-radius: 999px; box-shadow: 0 3px 0 var(--ink);
}
.share-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.wiki { font-family: var(--pixel); font-size: 9px; line-height: 1.6; text-underline-offset: 4px; padding: 4px 0; }

/* Game-style dialog box (blue-gray double frame) */
.dex .textbox-white { border-radius: 8px; box-shadow: inset 0 0 0 3px #ffffff, inset 0 0 0 7px var(--frame), 4px 4px 0 var(--dex-red-dark); padding: 16px 24px 20px; }

.menu {
  padding: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  background: var(--cream); border: 4px solid var(--ink); border-radius: 8px; box-shadow: 4px 4px 0 var(--dex-red-dark);
}
.party-opt {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 10px;
  font-family: var(--head); font-size: 14px; text-align: left; cursor: pointer;
  background: transparent; border: 3px solid var(--ink); border-radius: 6px;
}
.party-opt:last-child { grid-column: 1 / -1; }
.party-opt .cursor { width: 12px; flex: none; color: var(--red); visibility: hidden; }
.party-opt .key { margin-left: auto; font-family: var(--body); font-size: 18px; color: var(--muted); }
.party-opt:not(:disabled):hover, .party-opt:focus-visible { background: #ffffff; }
.party-opt:not(:disabled):hover .cursor, .party-opt:focus-visible .cursor, .party-opt.on .cursor { visibility: visible; }
.party-opt.on { background: #ffffff; box-shadow: 4px 4px 0 var(--pc); cursor: default; }
.party-opt:disabled:not(.on) { opacity: 0.4; cursor: default; }

/* Exit poll on the Pokédex's second (green LCD) screen */
.poll {
  padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 8px;
  background: var(--lcd); color: var(--lcd-text); border: 4px solid var(--ink); border-radius: 8px;
  box-shadow: inset 0 0 0 3px var(--lcd-edge), 4px 4px 0 var(--dex-red-dark);
}
.poll-row { display: grid; grid-template-columns: 110px 1fr 48px; align-items: center; gap: 10px; font-size: 20px; }
.poll-row .label { text-align: right; }
.poll .track { background: var(--lcd-edge); border-color: #0f1d14; }
.poll-locked {
  background: var(--lcd); color: var(--lcd-text); border: 4px dashed var(--lcd-edge); border-radius: 8px; padding: 22px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
}

.vote-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.vote-nav .keys { flex: 1; text-align: center; color: var(--cream); font-size: 18px; }
.dex-btn {
  cursor: pointer; font-family: var(--pixel); font-size: 10px; padding: 12px 14px; min-height: 44px;
  background: var(--ink); color: var(--cream); border: 3px solid var(--ink); border-radius: 999px; box-shadow: 0 4px 0 var(--dex-red-dark);
}
.dex-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--dex-red-dark); }
.dex-btn:disabled { opacity: 0.4; cursor: default; }
.vote-dialog.advancing #v-next { background: var(--gold); color: var(--ink); animation: blink 0.5s steps(1) infinite; }
.dpad { position: relative; flex: none; width: 42px; height: 42px; }
.dpad::before, .dpad::after { content: ''; position: absolute; background: var(--ink); border-radius: 3px; }
.dpad::before { left: 14px; top: 0; width: 14px; height: 42px; }
.dpad::after { left: 0; top: 14px; width: 42px; height: 14px; }

/* ---- My Ballot ---- */
.ballot { padding-top: 8px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 32px; }
.ballot-head { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-end; justify-content: space-between; }
.ballot-head > div { display: flex; flex-direction: column; gap: 12px; }
.ballot-title { margin: 0; font-family: var(--head); font-weight: 400; font-size: 64px; line-height: 1; text-shadow: 5px 5px 0 var(--cream); }
.progress { padding: 24px 28px; display: flex; flex-direction: column; gap: 12px; }
.progress-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.progress-top > span:last-child { font-size: 26px; }
.progress-bar { display: flex; align-items: center; gap: 10px; }
.progress-bar .tag { font-family: var(--pixel); font-size: 9px; color: var(--gold); background: var(--ink); padding: 4px 5px; }
.progress-bar .track { flex: 1; height: 20px; border-width: 4px; }
.cols { display: flex; flex-wrap: wrap; gap: 28px; }
.lineup { flex: 1 1 520px; min-width: 0; padding: 24px 28px; display: flex; flex-direction: column; gap: 12px; box-shadow: 8px 8px 0 var(--ink); }
.lineup-row { display: grid; grid-template-columns: 150px 1fr 44px; align-items: center; gap: 12px; }
.lineup-row .track { height: 16px; }
.lineup-row .label { text-align: right; }
.lineup p { margin: 6px 0 0; }
.agree {
  flex: 1 1 360px; min-width: 0; padding: 24px 28px; background: var(--gold); border: 4px solid var(--ink); box-shadow: 8px 8px 0 var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center;
}
.agree .big { font-family: var(--head); font-size: 88px; line-height: 1; }
.badge { font-family: var(--pixel); font-size: 10px; color: var(--cream); background: var(--ink); padding: 10px 12px; transform: rotate(-3deg); }
.agree small { font-size: 18px; color: #4a3a00; }
.votes-panel { padding: 24px 28px; display: flex; flex-direction: column; gap: 16px; box-shadow: 8px 8px 0 var(--ink); }
.votes-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab { font-family: var(--pixel); font-size: 9px; padding: 12px; min-height: 44px; cursor: pointer; border: 3px solid var(--ink); background: #ffffff; }
.tab[aria-pressed="true"] { background: var(--gold); box-shadow: 3px 3px 0 var(--ink); }
.table-wrap { overflow-x: auto; }
.votes-table { width: 100%; min-width: 600px; border-collapse: collapse; font-size: 22px; }
.votes-table th { text-align: left; font-family: var(--pixel); font-size: 9px; font-weight: 400; color: var(--muted); padding: 8px 10px; border-bottom: 4px solid var(--ink); }
.votes-table td { padding: 10px; border-bottom: 2px dashed #c9c0a0; }
.votes-table .dexno { font-family: var(--pixel); font-size: 9px; color: var(--muted); }
.votes-table .pk { display: inline-flex; align-items: center; gap: 12px; font-family: var(--head); font-size: 18px; color: var(--ink); text-decoration: none; }
.votes-table .pk:hover { text-decoration: underline; }
.votes-table .who { display: inline-flex; align-items: center; gap: 8px; }
.votes-table .who .swatch { width: 12px; height: 12px; }
.votes-table .match { font-family: var(--pixel); font-size: 10px; }
.show-all { align-self: center; font-family: var(--pixel); font-size: 10px; background: var(--sand); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); padding: 14px 16px; cursor: pointer; min-height: 44px; }
.empty { text-align: center; padding: 16px; font-size: 24px; }
.share-row { display: flex; flex-wrap: wrap; gap: 28px; align-items: center; }
.share-frame { flex: 1 1 520px; min-width: 0; background: var(--sky); border: 4px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); padding: 18px; }
.share-card { background: var(--cream); border: 4px solid var(--ink); box-shadow: inset 0 0 0 4px var(--cream), inset 0 0 0 8px var(--red); padding: 24px 26px; display: flex; flex-direction: column; gap: 12px; }
.share-card .bunting { height: 8px; background: repeating-linear-gradient(90deg, var(--red) 0 14px, var(--cream) 14px 28px, var(--blue) 28px 42px); }
.share-card .hd { font-family: var(--head); font-size: 34px; line-height: 1; }
.splitbar { display: flex; height: 22px; border: 3px solid var(--ink); background: var(--track); }
.splitbar span { display: block; height: 100%; }
.share-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.share-side h2 { margin: 0; font-family: var(--head); font-weight: 400; font-size: 30px; }
.share-side p { margin: 0; font-size: 24px; }
.share-side .btn { font-size: 16px; padding: 14px 18px; text-align: left; min-height: 48px; }
.share-side .btn:disabled { opacity: 0.5; cursor: default; }

/* ---- Pokémon game skin (site-wide): Pokédex header, rounded game boxes ---- */
.gold { color: var(--gold); }

/* Header = top of a Pokédex */
.dex-bar {
  background: var(--dex-red); border-bottom: 4px solid var(--ink);
  box-shadow: inset 0 4px 0 var(--dex-red-hi), inset 0 -6px 0 var(--dex-red-dark);
}
.dex-bar .nav { padding-top: 14px; padding-bottom: 18px; justify-content: flex-start; }
.dex-bar .logo { color: var(--cream); text-shadow: 2px 2px 0 var(--dex-red-dark); gap: 14px; }
.dex-lens.sm { width: 44px; height: 44px; border-width: 4px; outline-width: 3px; box-shadow: inset -5px -5px 0 var(--lens-dark), inset 5px 5px 0 var(--lens-hi); }
.dex-leds { display: flex; gap: 8px; align-self: flex-start; margin-top: 2px; }
.dex-leds .dex-led { margin: 0; width: 14px; height: 14px; }
.dex-bar .nav-links { margin-left: auto; align-items: center; gap: 12px; }
.dex-bar .nav-links a { color: var(--cream); border-radius: 999px; }
.dex-bar .nav-links a:hover { background: var(--dex-red-dark); }
.dex-bar .nav-links .nav-gold { color: var(--ink); background: var(--gold); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--dex-red-dark); padding: 12px 16px; }
.dex-bar .nav-links .nav-gold:hover { background: #ffd65c; }
.dex-bar .nav-links a[aria-current="page"] { outline: none; box-shadow: 0 4px 0 var(--dex-red-dark), inset 0 0 0 3px var(--cream); }
.dex-bar .menu-btn { border-radius: 10px; box-shadow: 0 4px 0 var(--dex-red-dark); }

/* Rounded game boxes */
.panel { border-radius: 10px; }
.panel-double { border-radius: 10px; }
.textbox { border-radius: 10px; }
.textbox-blue { box-shadow: inset 0 0 0 4px #ffffff, inset 0 0 0 9px var(--frame), 8px 8px 0 var(--ink); background: #ffffff; }
.btn { border-radius: 10px; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.18), 6px 6px 0 var(--ink); }
.btn:active { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18), 3px 3px 0 var(--ink); }
.track { border-radius: 999px; overflow: hidden; }
.swatch { border-radius: 3px; }
.toast { border-radius: 10px; }

/* Congress on a Pokédex screen */
.congress {
  background: var(--bezel); border: 4px solid var(--ink); border-radius: 10px 10px 10px 40px;
  box-shadow: 8px 8px 0 var(--ink); padding: 14px 28px 28px;
}
.congress .dex-screen-dots { margin-bottom: 0; }
.congress-screen { padding: 12px; }
.congress .legend { padding: 4px 4px 0; }

/* My Ballot */
.progress .progress-bar .tag { border-radius: 6px; }
.progress .track { height: 22px; background: var(--ink); border-color: var(--ink); padding: 3px; }
.progress .track > div { border-radius: 999px; box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.35); }
.lineup { border-radius: 10px; }
.lineup-row .track > div { box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.3); }
.agree {
  border-radius: 16px;
  box-shadow: inset 0 0 0 4px #ffe48a, inset 0 0 0 8px var(--ink), 8px 8px 0 var(--ink);
  padding: 28px 32px;
}
.badge { border-radius: 999px; padding: 10px 16px; box-shadow: 0 0 0 3px var(--gold), 0 0 0 6px var(--ink); }
.votes-panel { border-radius: 10px; }
.tab { border-radius: 999px; padding: 12px 16px; }
.show-all { border-radius: 999px; }
.pic { border-radius: 8px; }
.share-frame { border-radius: 10px; }
.share-card { border-radius: 8px; }
.splitbar { border-radius: 999px; overflow: hidden; }

/* ---- Pokédex page: the whole site is the device ---- */
/* Red body, gray-bezel screens around every panel, green LCD for scores, gray base. */
/* html = gray base (shows below the footer on short pages), body = red device */
html { background: var(--bezel); }
body { background: var(--dex-red); min-height: 0; }
.btn-gold { color: var(--ink); background: var(--gold); }
.btn-gold:hover { color: var(--ink); background: #ffd65c; }

/* Text sitting directly on the red body */
.kicker { color: var(--gold); text-shadow: 2px 2px 0 var(--dex-red-dark); }
.title, .ballot-title { color: var(--cream); text-shadow: 5px 5px 0 var(--ink); }
.title .gold, .ballot-title .gold { color: var(--gold); text-shadow: 5px 5px 0 var(--ink); }
.cta-row > span, .share-side h2, .share-side p { color: var(--cream); }
.share-side .muted { color: #ffd9db; }

/* Screens: an ink-lined gray bezel ring drawn outside the box (doesn't change layout) */
.progress, .lineup, .agree, .votes-panel, .share-frame {
  box-shadow: 0 0 0 10px var(--bezel), 0 0 0 14px var(--ink), 10px 10px 0 14px var(--dex-red-dark);
}
.progress { box-shadow: inset 0 0 0 4px var(--cream), inset 0 0 0 8px var(--ink), 0 0 0 10px var(--bezel), 0 0 0 14px var(--ink), 10px 10px 0 14px var(--dex-red-dark); }
.congress { box-shadow: 10px 10px 0 var(--dex-red-dark); }
.textbox-blue { box-shadow: inset 0 0 0 4px #ffffff, inset 0 0 0 9px var(--frame), 8px 8px 0 var(--dex-red-dark); }
.btn { box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.18), 6px 6px 0 var(--dex-red-dark); }
.btn:active { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18), 3px 3px 0 var(--dex-red-dark); }

/* My Ballot */
.ballot { gap: 44px; padding-top: 22px; }
.ballot .cols { gap: 44px; }
.ballot #ballot-body > section { margin-top: 44px !important; }
.agree { background: var(--lcd); color: var(--lcd-text); border-color: var(--ink); }
.agree .big { color: var(--lcd-text); text-shadow: 4px 4px 0 #0f1d14; }
.agree small { color: #a9c98f; }
.badge { color: var(--ink); background: var(--gold); box-shadow: 0 0 0 3px var(--ink); }
.share-frame { border-radius: 8px 8px 8px 32px; }

/* Device base */
.footer { background: var(--bezel); color: var(--muted-2); border-top: 4px solid var(--ink); box-shadow: inset 0 6px 0 var(--dex-red-dark); }

/* ---- Fun stats ---- */
.stats { padding-top: 8px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 32px; }
.stats-title { margin: 0; text-align: center; font-family: var(--head); font-weight: 400; font-size: 34px; color: var(--cream); text-shadow: 4px 4px 0 var(--ink); }
.stat-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
.stat-card {
  display: flex; flex-direction: column; gap: 12px; text-align: left; color: var(--ink); font: inherit; cursor: pointer;
  background: var(--cream); border: 4px solid var(--ink); border-radius: 10px; padding: 16px;
  box-shadow: 0 0 0 10px var(--bezel), 0 0 0 14px var(--ink), 10px 10px 0 14px var(--dex-red-dark);
}
div.stat-card { cursor: default; }
button.stat-card:hover { background: #ffffff; }
.stat-card > .label { font-size: 10px; color: var(--red); }
.stat-card.empty p { margin: 0; color: var(--muted); }
.stat-main { display: flex; align-items: center; gap: 14px; }
.stat-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 20px; line-height: 1.15; }
.stat-text b { font-family: var(--head); font-weight: 400; font-size: 20px; overflow-wrap: break-word; }
.muted-label { font-size: 8px; color: var(--muted); }
.party-tile {
  flex: none; width: 104px; height: 104px; display: grid; place-items: center; text-align: center;
  background: var(--pc); color: var(--pink); border: 3px solid var(--ink); border-radius: 8px;
  box-shadow: inset 0 6px 0 rgba(255, 255, 255, 0.28); font-family: var(--pixel); font-size: 11px;
}
.stat-card .splitbar { height: 16px; }
.type-lean {
  background: var(--cream); border: 4px solid var(--ink); border-radius: 10px; padding: 20px 24px;
  box-shadow: 0 0 0 10px var(--bezel), 0 0 0 14px var(--ink), 10px 10px 0 14px var(--dex-red-dark);
}
.type-lean p { margin: 6px 0 14px; }
.type-lean ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px 24px; }
.type-lean li { display: flex; align-items: center; gap: 10px; font-size: 20px; }
.type-lean .type-pill { flex: none; min-width: 92px; text-align: center; }
.type-lean .lean { display: inline-flex; align-items: center; gap: 6px; }
.type-lean .lean b { font-weight: 400; font-family: var(--head); font-size: 14px; }

/* ---- Phone ---- */
@media (max-width: 760px) {
  body { font-size: 20px; }
  .wrap { padding-left: 16px; padding-right: 16px; }
  .desktop-only { display: none; }
  .mobile-only { display: block; }
  .disclaimer { display: none; }
  .bunting { height: 6px; background: repeating-linear-gradient(90deg, var(--red) 0 12px, var(--cream) 12px 24px, var(--blue) 24px 36px); }

  .nav { padding-top: 14px; padding-bottom: 14px; flex-wrap: nowrap; }
  .logo { font-family: var(--head); font-size: 16px; line-height: 1.2; }
  .dex-bar .logo { font-family: var(--head); font-size: 16px; line-height: 1.2; }
  .dex-leds { display: none; }
  .dex-bar .nav { padding-top: 12px; padding-bottom: 14px; }
  .dex-bar .nav-links { top: 76px; margin-left: 0; border-radius: 10px; overflow: hidden; }
  .dex-bar .nav-links a { color: var(--ink); border-radius: 0; }
  .dex-bar .nav-links .nav-gold { border: 0; box-shadow: none; }
  .dex-bar .menu-btn { margin-left: auto; }
  .congress { border-radius: 10px 10px 10px 24px; }
  .menu-btn { display: grid; }
  .nav-links {
    display: none; position: absolute; right: 16px; top: 72px; z-index: 10; flex-direction: column; gap: 0;
    background: var(--cream); border: 4px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); min-width: 200px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 16px; }
  .nav-links .nav-gold { box-shadow: none; }
  .nav { position: relative; }

  .hero { padding-top: 16px; padding-bottom: 24px; flex-direction: column; gap: 14px; }
  .hero-main { display: contents; }
  .kicker, .title { display: none; }
  .textbox-blue { order: 1; padding: 14px 16px; box-shadow: inset 0 0 0 3px var(--cream), inset 0 0 0 6px var(--blue), 4px 4px 0 var(--ink); }
  .textbox-blue p { font-size: 24px; line-height: 1.15; }
  .textbox-blue .blink { display: none; }
  .congress { order: 2; flex: none; padding: 12px 14px; gap: 8px; box-shadow: 4px 4px 0 var(--ink); }
  .congress .label-lg { font-size: 9px; }
  .congress .muted { font-size: 18px; }
  .cta-row { order: 3; }
  .cta-row .btn { width: 100%; padding: 16px; box-shadow: 4px 4px 0 var(--ink); }
  .legend { display: none; }
  .legend-mini { display: flex; flex-wrap: wrap; gap: 4px 12px; list-style: none; margin: 0; padding: 0; font-size: 18px; }
  .legend-mini li { display: flex; align-items: center; gap: 6px; }

  /* Vote popup as a bottom sheet */
  .vote-dialog { width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; border-width: 4px 0 0; border-radius: 18px 18px 0 0; box-shadow: inset 0 4px 0 var(--dex-red-hi); }
  .dex-top { padding: 12px 14px 10px; }
  .dex-lens { width: 42px; height: 42px; border-width: 4px; outline-width: 3px; box-shadow: inset -5px -5px 0 var(--lens-dark), inset 5px 5px 0 var(--lens-hi); }
  .dex-led { width: 12px; height: 12px; }
  .vote { padding: 14px 14px 18px; gap: 12px; }
  .dex-screen { padding: 8px 10px; border-radius: 8px 8px 8px 22px; }
  .dex-display { padding: 10px; }
  .dex-entry { gap: 12px; }
  .emblem { width: 104px; height: 104px; box-shadow: inset 0 -26px 0 color-mix(in srgb, var(--tc) 60%, #ffffff); }
  .emblem .art { width: 96px; height: 96px; }
  .emblem svg { width: 56px; height: auto; }
  .pname { font-size: 24px; }
  .pname.long { font-size: 18px; }
  .textbox p { font-size: 24px; }
  .dex .textbox-white { padding: 12px 16px 16px; }
  .menu { padding: 10px; gap: 6px; }
  .party-opt { font-size: 12px; gap: 8px; padding: 8px; min-height: 52px; }
  .party-opt .key { display: none; }
  .poll-row { grid-template-columns: 96px 1fr 44px; font-size: 18px; }
  .vote-nav .keys, .dpad { display: none; }
  .pic { width: 80px; height: 80px; box-shadow: inset 0 -20px 0 color-mix(in srgb, var(--tc) 60%, #ffffff); }
  .pic .art { width: 96px; height: 96px; }

  .ballot { gap: 24px; padding-bottom: 40px; }
  .ballot-title { font-size: 44px; }
  .ballot-head .btn { width: 100%; }
  .progress, .lineup, .agree, .votes-panel { padding: 18px; box-shadow: 4px 4px 0 var(--ink); }
  .lineup, .share-frame, .share-side, .agree { flex-basis: 100%; }
  .lineup-row { grid-template-columns: 112px 1fr 36px; gap: 8px; font-size: 20px; }
  .agree .big { font-size: 64px; }
  .share-card .hd { font-size: 24px; }

  .progress, .lineup, .agree, .votes-panel, .share-frame { box-shadow: 0 0 0 6px var(--bezel), 0 0 0 9px var(--ink), 5px 5px 0 9px var(--dex-red-dark); }
  .progress { box-shadow: inset 0 0 0 4px var(--cream), inset 0 0 0 8px var(--ink), 0 0 0 6px var(--bezel), 0 0 0 9px var(--ink), 5px 5px 0 9px var(--dex-red-dark); }
  .congress { box-shadow: 5px 5px 0 var(--dex-red-dark); }
  .textbox-blue { box-shadow: inset 0 0 0 3px #ffffff, inset 0 0 0 6px var(--frame), 4px 4px 0 var(--dex-red-dark); }
  .cta-row .btn { box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.18), 4px 4px 0 var(--dex-red-dark); }
  .ballot, .ballot .cols { gap: 30px; }
  .ballot #ballot-body > section { margin-top: 30px !important; }
  .wrap.ballot { padding-left: 26px; padding-right: 26px; }
  .stats { gap: 26px; padding-bottom: 48px; }
  .stats.wrap { padding-left: 26px; padding-right: 26px; }
  .stats-title { font-size: 24px; }
  .stat-cards { gap: 30px; grid-template-columns: 1fr; }
  .stat-card, .type-lean { box-shadow: 0 0 0 6px var(--bezel), 0 0 0 9px var(--ink), 5px 5px 0 9px var(--dex-red-dark); }
  .stat-card .pic, .party-tile { width: 88px; height: 88px; }
  .type-lean { padding: 16px; }
}
