/* Vote page: phones first. Colours follow the deck tokens (deck/deck.css). Light only: the figures are on white. */
:root {
  --bg: #F7F6F2;
  --card: #FFFFFF;
  --ink: #17171C;
  --ink-2: #4A4A55;
  --muted: #85858F;
  --line: #DAD7CE;
  --accent: #C2410C;
  --accent-soft: #FBE9DF;
  --bar: #CFCBC0;
  --radius: 14px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
}
button { font: inherit; color: inherit; }
main { max-width: 760px; margin: 0 auto; padding: 20px 16px calc(120px + env(safe-area-inset-bottom)); }
h1 { font-size: 28px; line-height: 1.25; margin: 4px 0 8px; letter-spacing: -0.01em; }
h2 { font-size: 22px; line-height: 1.3; margin: 0 0 4px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.kicker { color: var(--accent); font-weight: 700; font-size: 15px; margin: 0; }
.desc { color: var(--ink-2); }
.hint { color: var(--muted); font-size: 15px; }

/* full-screen messages: waiting, thanks, closed */
.message { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; }
.message .big { font-size: 26px; font-weight: 700; line-height: 1.35; max-width: 18em; text-wrap: balance; }
.message .icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; margin-bottom: 10px; background: var(--accent-soft); color: var(--accent); }
.dots::after { content: ''; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

/* intro */
.criteria { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 16px 0 20px; }
.criteria ol { margin: 6px 0 0; padding-left: 1.4em; }
.criteria li { margin: 2px 0; }
.criteria .src { font-size: 13px; color: var(--muted); margin: 8px 0 0; }

/* question cards */
.cards { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .15s; }
.card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.card-top { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 8px 14px; }
.letter { font-weight: 800; font-size: 20px; }
.pick { border: 1.5px solid var(--line); background: var(--bg); border-radius: 999px; padding: 7px 16px; font-weight: 600; min-height: 40px; cursor: pointer; }
.card.selected .pick { background: var(--accent); border-color: var(--accent); color: #fff; }
.imgbtn { display: block; width: 100%; padding: 0; border: 0; border-top: 1px solid var(--line); background: #fff; cursor: zoom-in; }
.imgbtn img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: contain; background: #fff; }

/* sticky footer */
.footer { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(247, 246, 242, .96); border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.footer-in { max-width: 760px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.footer .status { flex: 1; color: var(--ink-2); font-size: 15px; }
.btn { border: 0; border-radius: 12px; padding: 0 22px; min-height: 50px; font-weight: 700; font-size: 17px; cursor: pointer; }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:disabled { background: var(--line); color: var(--muted); cursor: default; }
.btn.ghost { background: transparent; color: var(--ink-2); padding: 0 10px; }
.btn.wide { width: 100%; }

/* results */
.overall { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 14px 0 26px; }
.overall .winner { font-size: 26px; font-weight: 800; color: var(--accent); line-height: 1.25; }
.rank { margin-top: 12px; display: flex; flex-direction: column; gap: 9px; }
.rank-row .top { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.rank-row .top b { font-variant-numeric: tabular-nums; }
.track { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; margin-top: 3px; }
.fill { height: 100%; background: var(--bar); border-radius: 999px; }
.rank-row.first .fill, .res-card.first .fill { background: var(--accent); }
.res-q { margin: 0 0 30px; }
.res-q .cards { gap: 12px; }
.res-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.res-card.first { border: 2px solid var(--accent); }
.res-meta { padding: 10px 14px 10px; }
.res-meta .top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.res-meta .name { font-weight: 700; }
.res-meta .num { font-variant-numeric: tabular-nums; font-weight: 700; }
.res-meta .num small { color: var(--muted); font-weight: 400; margin-left: 4px; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 1px 7px; margin-left: 6px; vertical-align: 2px; }
.colophon { color: var(--muted); font-size: 13px; text-align: center; margin-top: 30px; }

/* lightbox */
#lightbox { position: fixed; inset: 0; z-index: 10; background: #111; display: flex; flex-direction: column; }
#lightbox[hidden] { display: none; }
.lb-scroll { flex: 1; overflow: auto; display: flex; align-items: center; -webkit-overflow-scrolling: touch; }
.lb-scroll img { display: block; width: 100%; height: auto; margin: auto; background: #fff; }
#lightbox.zoomed .lb-scroll { align-items: flex-start; }
#lightbox.zoomed .lb-scroll img { width: 260%; max-width: none; }
.lb-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); color: #ccc; font-size: 14px; }
.lb-close { background: #fff; color: #111; border: 0; border-radius: 10px; padding: 9px 18px; font-weight: 700; }

#toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20;
  background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 10px; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; }
#toast.on { opacity: .94; }
