:root {
  --bg: #eff3ec;
  --paper: #fcfbf7;
  --ink: #2d2626;
  --muted: #6b6771;
  --line: rgba(27, 34, 48, 0.12);
  --line-strong: rgba(27, 34, 48, 0.24);
  --salmon: #ef7a5c;
  --teal: #3ca99b;
  --acid: #d8ea4f;
  --sky: #6bb0ff;
  --rose: #f2b5ca;
  --gold: #f2c75c;
  --pink: #f2b5ca;
  --shadow: 0 18px 48px rgba(53, 42, 33, 0.12);
  --shadow-soft: 0 10px 28px rgba(53, 42, 33, 0.08);
  --width: min(960px, calc(100vw - 28px));
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 8%, rgba(243, 208, 133, 0.28), transparent 24%),
    radial-gradient(circle at 86% 12%, rgba(189, 231, 226, 0.26), transparent 28%),
    linear-gradient(180deg, #f8f7f1 0%, var(--bg) 100%);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.page-wash { position: fixed; inset: 0; pointer-events: none; }

h1, h2, h3, p { margin: 0; }

.vote-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 12px max(14px, calc((100vw - 960px) / 2));
  background: rgba(252, 250, 246, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--acid);
  color: #2d2a23;
  font-family: "Noto Serif SC", serif;
  font-size: 18px;
  font-weight: 900;
}

.brand-text p {
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
}

.brand-text h1 { font-size: 17px; line-height: 1.2; font-weight: 900; }

.progress-pill {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(216, 234, 79, 0.2);
  font-family: "IBM Plex Mono", "Noto Sans SC", monospace;
  font-size: 12px;
  font-weight: 700;
}

.progress-pill.is-done { background: rgba(60, 169, 155, 0.2); }

.vote-shell {
  width: var(--width);
  margin: 0 auto;
  padding: 18px 0 140px;
  display: grid;
  gap: 16px;
}

.card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.kicker {
  color: #b95d46;
  font-family: "IBM Plex Mono", "Noto Sans SC", monospace;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.card h2 {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 26px;
  line-height: 1.15;
}

.card-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
}

.card-sub b { color: #b95d46; }
.hint-tap { display: block; margin-top: 4px; font-size: 12.5px; opacity: 0.86; }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.status-pill {
  flex: 0 0 auto;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.8);
  color: var(--muted);
  font-family: "IBM Plex Mono", "Noto Sans SC", monospace;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.ok { background: rgba(60, 169, 155, 0.18); color: #2c7a6f; border-color: rgba(60, 169, 155, 0.3); }

/* ---- voter ---- */
.text-field { display: grid; gap: 6px; margin-top: 14px; }
.text-field span { font-size: 13px; font-weight: 800; color: var(--muted); }
.text-field input,
.text-field select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 253, 249, 0.9);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

/* ---- project pool ---- */
.pool {
  margin-top: 16px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 252, 246, 0.6);
}

.pool-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  font-family: "IBM Plex Mono", "Noto Sans SC", monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.pool-grid { display: flex; flex-wrap: wrap; gap: 8px; }

.proj {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-soft);
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.proj:active { cursor: grabbing; }

.proj.is-held {
  border-color: var(--salmon);
  box-shadow: 0 0 0 3px rgba(239, 122, 92, 0.3);
  transform: translateY(-1px);
}

.proj.is-own {
  opacity: 0.5;
  cursor: not-allowed;
}

.proj-top {
  display: flex;
  gap: 8px;
  align-items: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--muted);
}

.proj-track-tag {
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(216, 234, 79, 0.3);
  font-weight: 700;
}

.proj-track-tag.iteration { background: rgba(107, 176, 255, 0.22); }

.proj strong { font-size: 15px; font-weight: 800; line-height: 1.2; }
.proj small { color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.4; }

.proj-own-flag {
  align-self: flex-start;
  margin-top: 2px;
  font-size: 10px;
  color: var(--salmon);
  font-weight: 800;
}

/* ---- award buckets ---- */
.award-buckets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.bucket {
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background:
    radial-gradient(circle at 16% 12%, var(--bucket-glow, rgba(216,234,79,0.18)), transparent 50%),
    rgba(255, 252, 246, 0.85);
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.bucket[data-tone="rose"] { --bucket-glow: rgba(242, 181, 202, 0.3); }
.bucket[data-tone="teal"] { --bucket-glow: rgba(60, 169, 155, 0.2); }
.bucket[data-tone="pink"] { --bucket-glow: rgba(242, 181, 202, 0.3); }
.bucket[data-tone="sky"] { --bucket-glow: rgba(107, 176, 255, 0.24); }
.bucket[data-tone="acid"] { --bucket-glow: rgba(216, 234, 79, 0.34); }
.bucket[data-tone="gold"] { --bucket-glow: rgba(242, 199, 92, 0.3); }

.bucket.drop-ok {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(60, 169, 155, 0.22);
}
.bucket.drop-full {
  border-color: var(--salmon);
  box-shadow: 0 0 0 4px rgba(239, 122, 92, 0.22);
}

.bucket-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.bucket-emoji { font-size: 22px; }
.bucket-title { font-family: "Noto Serif SC", serif; font-size: 18px; font-weight: 700; }
.bucket-count {
  margin-left: auto;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.bucket-count.full { color: var(--salmon); }
.bucket-count.ok { color: #2c7a6f; }

.bucket-desc { color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.45; margin-bottom: 8px; }

.bucket-slots { display: flex; flex-wrap: wrap; gap: 6px; min-height: 38px; align-content: flex-start; }

.bucket-empty {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  opacity: 0.7;
  align-self: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  font-size: 13px;
  font-weight: 800;
  box-shadow: var(--shadow-soft);
}

.chip button {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 999px;
  background: rgba(239, 122, 92, 0.16);
  color: #b95d46;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}

/* ---- tracks ---- */
.tracks { display: grid; gap: 14px; margin-top: 14px; }

.track {
  padding: 16px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(circle at 14% 12%, var(--bucket-glow, rgba(216,234,79,0.2)), transparent 52%),
    rgba(255, 252, 246, 0.85);
}
.track[data-tone="acid"] { --bucket-glow: rgba(216, 234, 79, 0.34); }
.track[data-tone="teal"] { --bucket-glow: rgba(60, 169, 155, 0.22); }

.track-head { display: flex; align-items: center; gap: 8px; }
.track-head .bucket-emoji { font-size: 24px; }
.track-head h3 { font-family: "Noto Serif SC", serif; font-size: 20px; font-weight: 700; }

.track-abstain {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}

.track-step-label {
  margin: 12px 0 8px;
  font-family: "IBM Plex Mono", "Noto Sans SC", monospace;
  font-size: 12px;
  font-weight: 700;
  color: #b95d46;
}

.track-pool { display: flex; flex-wrap: wrap; gap: 7px; }

.cand {
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}
.cand small { display: block; color: var(--muted); font-size: 11px; font-weight: 600; }
.cand.shortlisted { border-color: var(--teal); background: rgba(60, 169, 155, 0.14); }
.cand.is-held { border-color: var(--salmon); box-shadow: 0 0 0 3px rgba(239,122,92,0.3); }

.track-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 40px;
  padding: 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: rgba(60, 169, 155, 0.06);
}

.tray-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--teal);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  font-size: 13.5px;
  font-weight: 800;
  cursor: grab;
  touch-action: none;
  user-select: none;
  box-shadow: var(--shadow-soft);
}
.tray-item:active { cursor: grabbing; }
.tray-item.is-held { border-color: var(--salmon); box-shadow: 0 0 0 3px rgba(239,122,92,0.3); }
.tray-item.placed { opacity: 0.45; cursor: default; border-style: dashed; }
.tray-placed { font-size: 10px; color: var(--muted); font-weight: 700; }

.podium { display: grid; gap: 8px; margin-top: 6px; }

.podium-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  min-height: 50px;
}
.podium-slot.drop-ok { border-style: solid; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(60,169,155,0.2); }
.podium-slot.filled { border-style: solid; background: rgba(255, 252, 246, 0.95); }

.podium-medal { font-size: 22px; flex: 0 0 auto; }
.podium-rank { font-family: "IBM Plex Mono", monospace; font-size: 12px; font-weight: 700; color: var(--muted); flex: 0 0 auto; width: 56px; }
.podium-fill { flex: 1 1 auto; min-width: 0; }
.podium-fill strong { font-size: 15px; font-weight: 800; }
.podium-empty { color: var(--muted); font-size: 13px; font-weight: 600; opacity: 0.7; }
.podium-slot .chip button { margin-left: auto; }

.track.abstained .track-step-label,
.track.abstained .track-pool,
.track.abstained .podium { opacity: 0.4; pointer-events: none; }

/* ---- review ---- */
.check-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 252, 246, 0.7);
  border: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.5;
}
.check-list li.ok { color: #2c7a6f; }
.check-list li.bad { color: #b95d46; background: rgba(239, 122, 92, 0.08); }
.check-list .mark { flex: 0 0 auto; font-size: 15px; }

.review-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.btn-primary, .btn-ghost {
  min-height: 50px;
  padding: 0 22px;
  border-radius: 12px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}
.btn-primary {
  flex: 1 1 auto;
  border: 1px solid rgba(94, 108, 12, 0.3);
  background: var(--acid);
  color: #2d2a23;
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost {
  border: 1px solid var(--line-strong);
  background: rgba(255, 252, 246, 0.8);
  color: var(--ink);
}

.submit-msg { margin-top: 12px; font-weight: 700; line-height: 1.5; }
.submit-msg.ok { color: #2c7a6f; }
.submit-msg.bad { color: #b95d46; }

/* ---- held bar (mobile pick-up indicator) ---- */
.held-bar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 24px);
  padding: 10px 12px 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.3);
  font-size: 13.5px;
  font-weight: 700;
}
.held-bar #held-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.held-bar button {
  flex: 0 0 auto;
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* drag ghost */
.drag-ghost {
  position: fixed;
  z-index: 80;
  pointer-events: none;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
  transform: translate(-50%, -140%);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.is-dragging { cursor: grabbing; }
body.is-holding .bucket,
body.is-holding .podium-slot { outline: 2px dashed rgba(60, 169, 155, 0.4); outline-offset: 2px; }

@media (max-width: 640px) {
  .award-buckets { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .card h2 { font-size: 22px; }
}
