:root {
  --bg: #fdfaf3;
  --surface: #ffffff;
  --surface-alt: #f7f1e4;
  --line: #e7dfcd;
  --line-strong: #d6cab0;
  --text: #241d12;
  --muted: #7d7263;
  --amber: #f5b301;
  --amber-ink: #9a6800;
  --amber-wash: #fff6dc;
  --red: #e0503a;
  --red-hover: #c94329;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(36, 29, 18, 0.05), 0 4px 14px rgba(36, 29, 18, 0.05);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  font-size: 15px;
}

h1, h2 {
  font-family: "Fraunces", Georgia, serif;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.01em;
}

a { color: var(--amber-ink); }

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.75rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: rgba(253, 250, 243, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: inherit;
}

.logo { font-size: 1.6rem; line-height: 1; }

.wordmark {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 800;
  font-size: 1.3rem;
}

.wordmark em { font-style: normal; color: var(--amber-ink); }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.6rem);
  min-width: 0;
}

.back { text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.back:hover { text-decoration: underline; }

/* "Why the chicken?" dropdown — CSS only, no JS */

.menu { position: relative; }

.menu summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--amber-ink);
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  white-space: nowrap;
  user-select: none;
}

.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: " ▾"; font-size: 0.75em; }
.menu[open] summary { background: var(--amber-wash); border-color: var(--amber); }
.menu summary:hover { background: var(--amber-wash); }

.menu-body {
  position: absolute;
  right: 0;
  top: calc(100% + 0.6rem);
  width: min(30rem, calc(100vw - 2rem));
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem;
  z-index: 40;
}

.menu-body p { margin: 0 0 0.7rem; color: var(--muted); font-size: 0.88rem; line-height: 1.6; }
.menu-body .attribution { font-size: 0.76rem; margin-bottom: 0; }
.menu-body .attribution a { color: var(--muted); }

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
  font-size: 0.85rem;
}

.stats strong { color: var(--amber-ink); font-variant-numeric: tabular-nums; }
.stats span { color: var(--muted); }

/* ---------- layout ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  gap: clamp(1.2rem, 3vw, 2.5rem);
  align-items: start;
  padding: clamp(1.4rem, 3vw, 2.4rem) clamp(1rem, 4vw, 3rem) 4rem;
  max-width: 1440px;
  margin: 0 auto;
}

.layout > * { min-width: 0; }

.single {
  max-width: 34rem;
  margin: 0 auto;
  padding: clamp(1.4rem, 4vw, 2.5rem) 1rem 4rem;
}

/* ---------- bid panel ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem;
  position: sticky;
  top: 4.2rem;
}

.single .panel { position: static; }

.panel h2 { font-size: 1.15rem; margin-bottom: 0.2rem; }

.error {
  background: #fdece8;
  border: 1px solid #f0b8ac;
  color: #8e2c17;
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  margin: 0.8rem 0 0;
}

.panel label {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  margin: 0.85rem 0 0.3rem;
}

.optional { font-weight: 400; color: var(--muted); font-size: 0.76rem; }

textarea, input[type="text"], input[type="number"] {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.92rem;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
}

textarea::placeholder, input::placeholder { color: #b0a695; }

textarea:focus, input:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-wash);
}

.hint { margin: 0.55rem 0 0; text-align: center; font-size: 0.75rem; color: var(--muted); }

.cta {
  display: block;
  width: 100%;
  margin-top: 1rem;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.2rem;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.06s ease;
}

.cta:hover { background: var(--red-hover); }
.cta:active { transform: scale(0.99); }

.fine { margin: 0.6rem 0 0; font-size: 0.72rem; color: var(--muted); }

/* The terms checkbox: a checkbox and its sentence on one line, so it reads as a line of
   fine print rather than another labelled field. */
.agree {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.9rem 0 0;
  font-weight: 400;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--muted);
  cursor: pointer;
}

.agree input[type="checkbox"] {
  flex: none;
  width: 0.95rem;
  height: 0.95rem;
  margin: 0.14rem 0 0;
  accent-color: var(--red);
  cursor: pointer;
}

.agree a { color: var(--amber-ink); font-weight: 600; }

/* ---------- board heading + outbid banner ---------- */

.board-head { text-align: center; margin-bottom: 1.2rem; }

.board-head h1 {
  font-size: 1.25rem;
  font-weight: 800;
}

.board-head .dim { color: var(--muted); font-weight: 600; }

.outbid {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.15rem 0.5rem;
  margin: 0.7rem 0 0;
  padding: 0.5rem 1.1rem;
  background: var(--amber-wash);
  border: 1px solid var(--amber);
  border-radius: 999px;
  font-size: 0.92rem;
}

.outbid strong {
  font-size: 1.15rem;
  color: var(--amber-ink);
  font-variant-numeric: tabular-nums;
}

.outbid .rule { color: var(--muted); font-size: 0.78rem; }

.outbid.standalone { display: flex; margin: 0.6rem 0 0; }

/* mobile-only call to action → /bid */

.mobile-cta {
  display: none;
  margin-top: 0.9rem;
  background: var(--red);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  border-radius: 8px;
  padding: 0.7rem 1.2rem;
  text-align: center;
}

.mobile-cta:hover { background: var(--red-hover); }

/* ---------- board ---------- */

.bids {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bid {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.bid:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }

.bid.top {
  border-color: var(--amber);
  background: linear-gradient(120deg, var(--amber-wash), var(--surface) 60%);
  padding: 1rem 1.1rem;
}

.num {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 800;
  font-size: 1rem;
  color: var(--muted);
  min-width: 1.6rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.bid.top .num { color: var(--amber-ink); font-size: 1.25rem; }
.bid.top .num::before { content: "👑"; display: block; font-size: 0.85rem; }

.bid .body { flex: 1; min-width: 0; }

.fear-text { margin: 0; overflow-wrap: anywhere; }
.bid.top .fear-text { font-size: 1.08rem; font-weight: 500; }

.meta { margin: 0.1rem 0 0; font-size: 0.76rem; color: var(--muted); }
.meta a { color: var(--amber-ink); text-decoration: none; font-weight: 600; }
.meta a:hover { text-decoration: underline; }

.amount {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--amber-ink);
  background: var(--amber-wash);
  border: 1px solid var(--amber);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

.empty {
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 2.5rem 1.2rem;
  text-align: center;
}

/* ---------- notice pages (success / cancel) ---------- */

.wrap { max-width: 640px; margin: 0 auto; padding: 2.5rem 1.25rem; }

.notice {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 3rem 1.5rem;
  margin-top: 2.5rem;
}

.notice .big { font-size: 3rem; margin-bottom: 0.5rem; }
.notice h1 { font-size: 1.7rem; }
.notice p { color: var(--muted); }

.btn {
  display: inline-block;
  margin-top: 1rem;
  background: var(--red);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  border-radius: 8px;
  padding: 0.7rem 1.4rem;
}

.btn:hover { background: var(--red-hover); }

/* ---------- the grill (success page) ---------- */

.notice.burning { background: linear-gradient(to bottom, var(--surface) 55%, var(--amber-wash)); }

.grill {
  position: relative;
  width: 240px;
  height: 200px;
  margin: 0 auto 1.75rem;
}

/* the bird, sitting on the grate and slowly turning */
.grill .bird {
  position: absolute;
  left: 50%;
  top: 52px;
  z-index: 3;
  font-size: 3.6rem;
  line-height: 1;
  transform: translateX(-50%);
  filter: saturate(0.8) brightness(0.92) drop-shadow(0 2px 6px rgba(154, 104, 0, 0.35));
  animation: sizzle 3.2s ease-in-out infinite;
}

@keyframes sizzle {
  0%, 100% { transform: translateX(-50%) rotate(-2deg); }
  50%      { transform: translateX(-50%) rotate(2deg) translateY(1px); }
}

/* two hairline bars, read as a grate in perspective */
.grill .grate {
  position: absolute;
  left: 22%;
  right: 22%;
  top: 118px;
  z-index: 2;
  height: 10px;
  background: repeating-linear-gradient(
    to bottom,
    var(--line-strong) 0 1.5px,
    transparent 1.5px 6px
  );
}

.grill .flames {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 30px;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}

.grill .flames i {
  width: 26px;
  height: 26px;
  border-radius: 0 50% 50% 50%;
  background: linear-gradient(215deg, var(--amber) 0%, #ff8a24 48%, var(--red) 100%);
  transform: rotate(45deg);
  transform-origin: 50% 100%;
  animation: lick 1.5s ease-in-out infinite;
}

.grill .flames i:nth-child(odd)  { width: 20px; height: 20px; opacity: 0.85; }
.grill .flames i:nth-child(2)    { animation-delay: -0.9s; }
.grill .flames i:nth-child(3)    { animation-delay: -0.4s; width: 30px; height: 30px; }
.grill .flames i:nth-child(4)    { animation-delay: -1.2s; width: 34px; height: 34px; }
.grill .flames i:nth-child(5)    { animation-delay: -0.2s; width: 30px; height: 30px; }
.grill .flames i:nth-child(6)    { animation-delay: -0.7s; }
.grill .flames i:nth-child(7)    { animation-delay: -1.4s; }

@keyframes lick {
  0%, 100% { transform: rotate(45deg) scale(1);    opacity: 0.8; }
  50%      { transform: rotate(45deg) scale(1.22); opacity: 1; }
}

/* the coal bed under it all */
.grill .embers {
  position: absolute;
  left: 26%;
  right: 26%;
  bottom: 22px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 138, 36, 0.55), rgba(224, 80, 58, 0) 70%);
  filter: blur(2px);
  animation: glow 2.4s ease-in-out infinite;
}

@keyframes glow {
  0%, 100% { opacity: 0.7; }
  50%      { opacity: 1; }
}

/* what your fear turns into */
.grill .smoke {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 4;
  transform: translateX(-50%);
}

.grill .smoke i {
  position: absolute;
  bottom: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0;
  animation: rise 5s ease-out infinite;
}

.grill .smoke i:nth-child(1) { left: -16px; animation-delay: 0s; }
.grill .smoke i:nth-child(2) { left: 2px;   animation-delay: -1.7s; }
.grill .smoke i:nth-child(3) { left: 16px;  animation-delay: -3.4s; }

@keyframes rise {
  0%   { transform: translate(0, 0) scale(0.4);         opacity: 0; }
  20%  {                                                opacity: 0.22; }
  100% { transform: translate(14px, -58px) scale(2.1);  opacity: 0; }
}

.verse {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--text);
  margin: 1rem 0 0;
}

.verse.last { color: var(--amber-ink); }

.receipt {
  margin: 1.6rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
}

@media (prefers-reduced-motion: reduce) {
  .grill .bird,
  .grill .flames i,
  .grill .embers { animation: none; }
  .grill .smoke { display: none; }
}

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--line);
  padding: 1.3rem clamp(1rem, 4vw, 3rem);
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

footer p { margin: 0; }

/* ---------- terms ---------- */

.terms {
  max-width: 1440px;
  margin: 0 auto 1.3rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.terms h2 {
  font-size: 0.72rem;
  font-family: inherit;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.8rem;
}

/* Four columns, each a term over its sentence: column flow down two rows keeps every
   dt above its own dd. Below the breakpoint it falls back to a plain stack. */
.terms dl {
  margin: 0;
}

.terms dt {
  font-weight: 700;
  font-size: 0.76rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.terms dd { margin: 0; line-height: 1.55; }

/* Stacked: a hairline between entries, none above the first. */
.terms dd + dt {
  border-top: 1px solid var(--line);
  margin-top: 0.9rem;
  padding-top: 0.9rem;
}

@media (min-width: 821px) {
  .terms dl {
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto 1fr;
    gap: 0.25rem clamp(1.2rem, 3vw, 2.2rem);
  }
  .terms dd + dt { border-top: none; margin-top: 0; padding-top: 0; }
  /* A hairline between the columns, none before the first. */
  .terms dt ~ dt,
  .terms dt ~ dt + dd {
    border-left: 1px solid var(--line);
    padding-left: clamp(1.2rem, 3vw, 2.2rem);
  }
}

/* ---------- responsive ---------- */

/* Below this width the inline form is dropped entirely and visitors are sent
   to /bid instead, so the board is the first thing on the page. */
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; padding-top: 1.2rem; }
  .layout > .panel { display: none; }
  .mobile-cta { display: block; }
  .stats { display: none; }
  .board-head { margin-bottom: 1rem; }
}

@media (max-width: 460px) {
  .board-head h1 { font-size: 1.1rem; }
  .outbid { width: 100%; justify-content: center; }
}
