/* The Great Geekish Mince Off
   Mincemeat-dark page, pastry-gold accents, icing-sugar text.
   The one loud element is the pie badge: every score is a pie seen from above. */

@font-face { font-family: "Shrikhand"; src: url("/fonts/shrikhand.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("/fonts/atkinson-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("/fonts/atkinson-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("/fonts/atkinson-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --mince: #2b0d1b;
  --plum: #45182d;
  --plum-raised: #52203a;
  --plum-line: #6a2c4b;
  --icing: #fff8f0;
  --icing-soft: #ead6de;
  --muted: #c4a2b3;
  --gold: #f2b457;
  --gold-deep: #d9913a;
  --crust: #b8692f;
  --burnt: #5e3119;
  --good: #8fd3a8;
  --bad: #ff8a99;
  --cold: #3593d2;
  --hot: #e36f35;

  --display: "Shrikhand", "Cooper Black", Georgia, serif;
  --body: "Atkinson", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* type scale, roughly a fourth */
  --t-small: 0.875rem;
  --t-base: 1rem;
  --t-md: 1.333rem;
  --t-lg: 1.777rem;
  --t-xl: 2.369rem;
  --t-xxl: clamp(3.2rem, 11vw, 7.5rem);

  --gap: 1.25rem;
  --wrap: 68rem;
  --radius-sm: 6px;
  --radius-lg: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--mince);
  color: var(--icing);
  font: 400 var(--t-base)/1.55 var(--body);
}
img { max-width: 100%; display: block; }
a { color: var(--gold); text-underline-offset: 0.18em; }
a:hover { color: var(--icing); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; }
h2 { font: 400 var(--t-lg)/1.1 var(--display); letter-spacing: 0.01em; }
h3 { font-size: var(--t-md); font-weight: 700; }
p { margin: 0 0 1em; max-width: 66ch; }
.wrap { width: min(var(--wrap), 100% - 2rem); margin-inline: auto; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.site-header { border-bottom: 1px solid var(--plum-line); }
.site-header .wrap { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 0.9rem 0; }
.wordmark { font: 400 1.35rem/1 var(--display); color: var(--icing); text-decoration: none; margin-right: auto; }
.wordmark small { display: block; font: 700 0.75rem/1.2 var(--body); color: var(--muted); letter-spacing: 0.02em; margin-top: 0.3rem; }
.site-nav ul { list-style: none; display: flex; gap: 0.25rem; margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav a { display: block; padding: 0.45rem 0.7rem; border-radius: var(--radius-sm); color: var(--icing-soft); text-decoration: none; font-weight: 700; }
.site-nav a:hover { background: var(--plum); color: var(--icing); }
.site-nav a[aria-current="page"] { color: var(--gold); box-shadow: inset 0 -3px 0 var(--gold); border-radius: 0; }

/* ---------- buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 2.9rem; padding: 0.6rem 1.25rem;
  border: 0; border-radius: 999px;
  background: var(--gold); color: var(--mince);
  font: 700 var(--t-base)/1 var(--body); text-decoration: none; cursor: pointer;
}
.button:hover { background: var(--icing); color: var(--mince); }
.button[disabled] { opacity: 0.55; cursor: not-allowed; }
.button.secondary { background: transparent; color: var(--icing); box-shadow: inset 0 0 0 2px var(--plum-line); }
.button.secondary:hover { box-shadow: inset 0 0 0 2px var(--gold); color: var(--gold); }
.button.small { min-height: 2.2rem; padding: 0.35rem 0.85rem; font-size: var(--t-small); }
.button.danger { background: var(--bad); }

/* ---------- hero ---------- */
.hero { padding: clamp(2rem, 6vw, 4rem) 0 2rem; display: grid; gap: 1.5rem; grid-template-columns: 1fr; align-items: end; }
@media (min-width: 52rem) { .hero { grid-template-columns: auto 1fr; gap: 3rem; } }
.hero-year {
  font: 400 var(--t-xxl)/0.85 var(--display);
  color: var(--gold);
  margin: 0;
  text-shadow: 0.04em 0.05em 0 var(--crust);
}
.hero-copy h1 { font: 700 var(--t-xl)/1.1 var(--body); margin-bottom: 0.4rem; }
.hero-copy p { font-size: var(--t-md); color: var(--icing-soft); margin-bottom: 1.25rem; }
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }

/* ---------- sections ---------- */
section.block { padding: 2rem 0; border-top: 1px solid var(--plum-line); }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.block-head p { margin: 0; color: var(--muted); }

/* ---------- stats: one panel split by hairlines, not a pile of cards ---------- */
.stats {
  display: grid; grid-template-columns: repeat(2, 1fr);
  background: var(--plum); border-radius: var(--radius-lg); overflow: hidden;
  gap: 1px; border: 1px solid var(--plum-line);
}
@media (min-width: 40rem) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 62rem) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--plum); padding: 1.1rem 1.2rem 1.2rem; box-shadow: 0 0 0 1px var(--plum-line); min-width: 0; }
.stat dt { color: var(--icing-soft); font-weight: 700; font-size: var(--t-small); }
.stat dd { margin: 0.2rem 0 0; }
.stat .num { font: 400 var(--t-xl)/1.1 var(--display); color: var(--icing); display: block; }
.stat .num.text { font: 700 var(--t-md)/1.25 var(--body); overflow-wrap: anywhere; }
.stat .note { display: block; color: var(--muted); font-size: var(--t-small); margin-top: 0.15rem; }
.stat.wide { grid-column: span 2; }
.delta-up { color: var(--good); }
.delta-down { color: var(--bad); }

/* hot vs cold split bar */
.split { display: flex; gap: 2px; height: 14px; margin: 0.6rem 0 0.4rem; }
.split span { display: block; height: 100%; }
.split .cold { background: var(--cold); border-radius: 4px 0 0 4px; }
.split .hot { background: var(--hot); border-radius: 0 4px 4px 0; }
.split-legend { display: flex; justify-content: space-between; font-size: var(--t-small); color: var(--icing-soft); }
.dot { display: inline-block; width: 0.65em; height: 0.65em; border-radius: 50%; margin-right: 0.35em; vertical-align: 0.05em; }
.dot.cold { background: var(--cold); }
.dot.hot { background: var(--hot); }

/* ---------- pie badge ---------- */
.pie-badge { position: relative; display: inline-grid; place-items: center; flex: none; width: var(--size, 64px); height: var(--size, 64px); }
.pie-badge svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pie-badge b { position: relative; font: 400 calc(var(--size, 64px) * 0.36)/1 var(--display); color: var(--mince); letter-spacing: -0.02em; padding-bottom: 0.08em; }
.pie-badge.burnt b { color: var(--icing); }
.pie-badge.sm { --size: 48px; }
.pie-badge.lg { --size: 132px; }
.pie-badge.xl { --size: 168px; }

/* ---------- review cards ---------- */
.review-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.review {
  display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 1rem;
  padding: 1rem 1.1rem; background: var(--plum); border-radius: var(--radius-lg);
}
.review h3 { font-size: var(--t-base); margin: 0; }
.review .meta { color: var(--muted); font-size: var(--t-small); margin: 0.1rem 0 0.4rem; }
.review .comment { margin: 0; color: var(--icing-soft); white-space: pre-line; overflow-wrap: anywhere; }
.review .photos { display: flex; gap: 0.5rem; margin-top: 0.75rem; flex-wrap: wrap; }
.review .photos a { display: block; border-radius: var(--radius-sm); overflow: hidden; }
.review .photos img { width: 112px; height: 112px; object-fit: cover; }
.review .badge-col { grid-row: span 3; }
.temp-tag { display: inline-flex; align-items: center; font-weight: 700; color: var(--icing-soft); }

/* ---------- leaderboards ---------- */
.boards { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
@media (min-width: 48rem) { .boards { grid-template-columns: repeat(3, 1fr); } }
.board h3 { margin-bottom: 0.6rem; }
.board ol { list-style: none; margin: 0; padding: 0; }
.board li { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.45rem 0; border-bottom: 1px solid var(--plum-line); }
.board li .place { width: 1.6rem; flex: none; text-align: center; color: var(--muted); font-weight: 700; }
.board li .who { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.board li .count { font-weight: 700; color: var(--icing-soft); font-variant-numeric: tabular-nums; }
.board .empty { color: var(--muted); }
.board .more { margin-top: 0.6rem; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--plum-line); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 0.6rem 0.8rem; text-align: left; border-bottom: 1px solid var(--plum-line); vertical-align: top; }
thead th { background: var(--plum); color: var(--icing-soft); font-size: var(--t-small); position: sticky; top: 0; }
td.num, th.num { text-align: right; }
tbody tr:nth-child(-n+3) td:first-child { color: var(--gold); font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }

/* ---------- results ---------- */
.podium { display: grid; gap: 1.25rem; grid-template-columns: 1fr; margin: 1.5rem 0 1rem; }
@media (min-width: 46rem) { .podium { grid-template-columns: 1fr 1.25fr 1fr; align-items: end; } }
.podium-place { text-align: center; background: var(--plum); border-radius: var(--radius-lg); padding: 1.5rem 1rem 1.25rem; }
.podium-place .pie-badge { margin: 0 auto 0.75rem; }
.podium-place .label { font-weight: 700; color: var(--muted); }
.podium-place .name { font: 700 var(--t-md)/1.25 var(--body); margin: 0.25rem 0; overflow-wrap: anywhere; }
.podium-place.first { padding-top: 2rem; box-shadow: inset 0 0 0 2px var(--gold); }
@media (min-width: 46rem) { .podium-place.first { order: 2; } .podium-place.second { order: 1; } .podium-place.third { order: 3; } }
.tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs button { font: 700 var(--t-small)/1 var(--body); padding: 0.6rem 1rem; border-radius: 999px; border: 0; background: var(--plum); color: var(--icing-soft); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--gold); color: var(--mince); }
.hall { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.hall li { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 1.25rem; padding: 1rem 1.2rem; background: var(--plum); border-radius: var(--radius-lg); align-items: center; }
.hall .year { font: 400 var(--t-xl)/1 var(--display); color: var(--gold); grid-row: span 2; }
.hall .winner { font-weight: 700; }
.hall .others { color: var(--muted); font-size: var(--t-small); }

/* ---------- forms ---------- */
.form { display: grid; gap: 1.5rem; max-width: 40rem; }
.field { display: grid; gap: 0.4rem; }
.field > label, .field legend { font-weight: 700; }
.field .hint { color: var(--muted); font-size: var(--t-small); margin: 0; }
fieldset { border: 0; padding: 0; margin: 0; }
input[type="text"], input[type="number"], input[type="search"], input[type="password"], input[type="datetime-local"], textarea, select {
  width: 100%; font: inherit; color: var(--icing);
  background: var(--plum); border: 2px solid var(--plum-line); border-radius: 10px;
  padding: 0.7rem 0.85rem; min-height: 3rem;
}
textarea { min-height: 7rem; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.8; }
input:focus, textarea:focus, select:focus { border-color: var(--gold); outline: none; }
.field.invalid input, .field.invalid textarea { border-color: var(--bad); }
.field-error { color: var(--bad); font-weight: 700; font-size: var(--t-small); margin: 0; }

.choice-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: inline-flex; align-items: center; min-height: 3rem; padding: 0.6rem 1.15rem;
  border-radius: 999px; background: var(--plum); border: 2px solid var(--plum-line); font-weight: 700;
}
.choice input:checked + span { background: var(--gold); color: var(--mince); border-color: var(--gold); }
.choice input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 3px; }
.choice.cold input:checked + span { background: var(--cold); border-color: var(--cold); color: var(--icing); }
.choice.hot input:checked + span { background: var(--hot); border-color: var(--hot); color: var(--mince); }

.check { display: flex; gap: 0.75rem; align-items: flex-start; }
.check input { width: 1.4rem; height: 1.4rem; margin-top: 0.1rem; accent-color: var(--gold); flex: none; }

/* combobox list for the pie picker */
.combo { position: relative; }
.combo-list {
  list-style: none; margin: 0.35rem 0 0; padding: 0.35rem; position: absolute; z-index: 5; left: 0; right: 0;
  background: var(--plum-raised); border: 2px solid var(--plum-line); border-radius: 12px;
  max-height: 18rem; overflow-y: auto; box-shadow: 0 14px 30px rgba(20, 3, 10, 0.55);
}
.combo-list[hidden] { display: none; }
.combo-list li { padding: 0.65rem 0.75rem; border-radius: 8px; cursor: pointer; }
.combo-list li[aria-selected="true"], .combo-list li:hover { background: var(--plum-line); }
.combo-list li.add { color: var(--gold); font-weight: 700; }
.combo-list li.note { color: var(--muted); cursor: default; background: none; font-size: var(--t-small); }
.chosen { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.7rem 0.9rem; background: var(--plum); border: 2px solid var(--gold); border-radius: 10px; }
.chosen strong { overflow-wrap: anywhere; }

/* score: slider plus the live pie badge */
.score-row { display: flex; align-items: center; gap: 1.25rem; }
.score-row .controls { flex: 1; display: grid; gap: 0.6rem; }
.score-row input[type="number"] { width: 6.5rem; }
input[type="range"] { width: 100%; accent-color: var(--gold); height: 2rem; }
.score-word { font-weight: 700; color: var(--icing-soft); min-height: 1.5em; }

.photo-picker { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.photo-thumb { position: relative; }
.photo-thumb img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; }
.photo-thumb button { position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--icing); color: var(--mince); font-weight: 700; cursor: pointer; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.panel { background: var(--plum); border-radius: var(--radius-lg); padding: 1.5rem; }
.panel.success { box-shadow: inset 0 0 0 2px var(--good); }
.panel.notice { box-shadow: inset 0 0 0 2px var(--gold); }
.form-status { font-weight: 700; }
.form-status.error { color: var(--bad); }

/* ---------- next-to-try lists ---------- */
.next { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
@media (min-width: 48rem) { .next { grid-template-columns: repeat(3, 1fr); } }
.next ul { list-style: none; margin: 0; padding: 0; }
.next li { padding: 0.45rem 0; border-bottom: 1px solid var(--plum-line); display: flex; justify-content: space-between; gap: 0.75rem; }
.next li span:last-child { color: var(--muted); white-space: nowrap; }
.chips { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.chips li { border: 0; padding: 0.3rem 0.7rem; background: var(--plum); border-radius: 999px; }

/* ---------- prose (rules page) ---------- */
.prose { max-width: 44rem; }
.prose h2 { margin-top: 2rem; }
.prose h3 { margin: 1.6rem 0 0.4rem; }
.prose ul { padding-left: 1.2rem; }

/* ---------- admin ---------- */
.admin-grid { display: grid; gap: 2rem; }
.admin-row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.admin-review { padding: 0.9rem 1rem; background: var(--plum); border-radius: 12px; display: grid; gap: 0.4rem; }
.admin-review.hidden-review { opacity: 0.55; }
.flag { color: var(--gold); font-weight: 700; }
.admin-table td { font-size: var(--t-small); }
.admin-table input[type="text"] { min-height: 2.3rem; padding: 0.35rem 0.6rem; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--plum-line); margin-top: 3rem; padding: 2rem 0 3rem; color: var(--muted); font-size: var(--t-small); }
.site-footer p { margin: 0 0 0.4rem; }

.loading { color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .reveal-pop { animation: pop 600ms cubic-bezier(.2, 1.4, .4, 1) both; }
  @keyframes pop { from { transform: scale(0.6) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
}
