:root {
  --bg: #f4ede2;
  --card: #fffaf3;
  --ink: #2f261d;
  --muted: #8a7a66;
  --line: #e6dac8;
  --accent: #b4541f;     /* warm autumn rust */
  --accent-soft: #f3dcc9;
  --green: #4f7a4d;
  --shadow: 0 6px 24px rgba(90, 60, 30, 0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow-x: hidden;
}

.mountains {
  position: fixed;
  inset: auto 0 0 0;
  height: 38vh;
  background:
    radial-gradient(120% 100% at 20% 100%, #d9c5a8 0 40%, transparent 41%),
    radial-gradient(120% 100% at 70% 100%, #cbb491 0 38%, transparent 39%),
    linear-gradient(to top, #e7d8bf 0%, transparent 70%);
  opacity: .55;
  z-index: 0;
  pointer-events: none;
}

header, nav, main, footer { width: 100%; max-width: 720px; padding: 0 20px; z-index: 1; }

/* ---------------- Hero ---------------- */
.hero { text-align: center; padding-top: 46px; }
.kicker {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 6px;
}
.hero h1 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: clamp(34px, 8vw, 54px);
  line-height: 1.02;
  margin: 0;
}
.hero h1 span { color: var(--accent); }
.dates { color: var(--muted); margin: 8px 0 0; font-weight: 500; }

.countdown {
  display: inline-flex;
  gap: 14px;
  margin-top: 18px;
  padding: 10px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.countdown .unit { text-align: center; min-width: 42px; }
.countdown .num { font-family: "Fraunces", serif; font-size: 24px; font-weight: 600; }
.countdown .lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.countdown.done { font-weight: 600; color: var(--accent); padding: 12px 18px; }

/* ---------------- Stepper ---------------- */
.stepper {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 28px auto 6px;
}
.step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 5px 11px;
}
.step .dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--line);
  color: #fff; font-size: 12px; font-weight: 600;
}
.step.done .dot { background: var(--green); }
.step.current { background: var(--card); border-color: var(--line); color: var(--ink); box-shadow: var(--shadow); }
.step.current .dot { background: var(--accent); }
.step .name { font-weight: 500; }
@media (max-width: 520px) { .step .name { display: none; } .step { padding: 5px; } }

/* ---------------- Main ---------------- */
main { padding-top: 18px; padding-bottom: 40px; }
.loading { text-align: center; color: var(--muted); padding: 40px; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px;
  box-shadow: var(--shadow);
  animation: rise .35s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.panel h2 {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 26px;
  margin: 0 0 4px;
  display: flex; align-items: center; gap: 10px;
}
.panel .blurb { color: var(--muted); margin: 0 0 20px; line-height: 1.5; }

label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 6px; color: var(--ink); }
input[type=text], textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  color: var(--ink);
  margin-bottom: 14px;
}
input:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { resize: vertical; min-height: 64px; }

.btn {
  appearance: none;
  border: none;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .08s, background .15s;
}
.btn:hover { background: #9c4719; }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }

.note { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.you {
  background: var(--accent-soft);
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}

/* People chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 14px;
  font-weight: 500;
}
.count-big { font-family: "Fraunces", serif; font-size: 40px; color: var(--accent); line-height: 1; }

/* Suggestion cards */
.cards { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.bookcard {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  background: #fff;
  display: flex; gap: 14px; align-items: flex-start;
}
.bookcard .body { flex: 1; min-width: 0; }
.bookcard .title { font-family: "Fraunces", serif; font-size: 18px; font-weight: 600; }
.bookcard .author { color: var(--muted); font-size: 14px; }
.bookcard .reason { margin-top: 6px; font-size: 14px; line-height: 1.5; font-style: italic; color: #5e5043; }
.bookcard.winner { border-color: var(--accent); border-width: 2px; background: var(--accent-soft); }

.votebtn {
  flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 9px 12px;
  cursor: pointer;
  font: inherit;
  min-width: 56px;
  transition: all .12s;
}
.votebtn .ic { font-size: 20px; filter: grayscale(1); opacity: .6; }
.votebtn .vlbl { font-size: 10px; color: var(--muted); }
.votebtn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.votebtn.on .ic { filter: none; opacity: 1; }
.votebtn.on .vlbl { color: #fff; }
.rank { flex-shrink: 0; font-family: "Fraunces", serif; font-size: 22px; color: var(--muted); min-width: 28px; text-align: center; }
.votecount { flex-shrink: 0; text-align: center; min-width: 48px; }
.votecount .n { font-family: "Fraunces", serif; font-size: 22px; color: var(--accent); }
.votecount .vlbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

.admin-del {
  background: transparent; border: none; color: #c0392b; cursor: pointer;
  font-size: 16px; padding: 2px 6px; align-self: flex-start;
}
.admin-pin { font-size: 12px; }

.winner-hero { text-align: center; padding: 8px 0 18px; }
.winner-hero .lbl { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; color: var(--accent); font-weight: 600; }
.winner-hero .wt { font-family: "Fraunces", serif; font-size: 30px; font-weight: 600; margin: 6px 0 2px; }
.winner-hero .wa { color: var(--muted); }

/* Discussion questions */
.qlist { list-style: none; padding: 0; margin: 8px 0 0; counter-reset: q; }
.qlist li {
  position: relative;
  padding: 12px 12px 12px 46px;
  border-bottom: 1px solid var(--line);
  line-height: 1.5;
}
.qlist li:last-child { border-bottom: none; }
.qlist li::before {
  counter-increment: q;
  content: counter(q);
  position: absolute; left: 10px; top: 11px;
  width: 24px; height: 24px;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 600;
}
.tipbox {
  margin-top: 16px;
  background: var(--accent-soft);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.55;
}

/* Admin bar — fixed to the bottom of the viewport so it's reliably visible,
   also on mobile. Respects the iOS home-indicator safe area. */
.admin-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 720px;
  background: #2f261d;
  color: #f4ede2;
  border-radius: 14px 14px 0 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 20;
  box-shadow: 0 -4px 20px rgba(0,0,0,.22);
}
/* Make room so the fixed bar never covers the footer/content. */
body.has-admin { padding-bottom: 150px; }
body.has-admin .toast { bottom: 160px; }
.admin-bar .alabel { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; opacity: .7; margin-bottom: 8px; }
.admin-bar .phasebtns { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-bar .pbtn {
  border: 1px solid rgba(255,255,255,.25);
  background: transparent; color: #f4ede2;
  border-radius: 999px; padding: 6px 12px; cursor: pointer; font: inherit; font-size: 13px;
}
.admin-bar .pbtn.active { background: var(--accent); border-color: var(--accent); }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 20px 30px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #2f261d; color: #fff; padding: 12px 20px; border-radius: 12px;
  font-size: 14px; z-index: 50; box-shadow: var(--shadow);
  animation: rise .25s ease;
}
.empty { text-align: center; color: var(--muted); padding: 24px; font-style: italic; }
