:root {
  --bg: #1F1710;
  --surface-1: #2B2015;
  --surface-2: #35271A;
  --border: rgba(245, 234, 209, 0.12);
  --border-strong: rgba(245, 234, 209, 0.28);

  --text-primary: #F5EAD1;
  --text-secondary: #C4AE8D;
  --text-muted: #8C775A;

  --amber: #E8A33D;
  --amber-dark: #B9791F;
  --foam: #F5EAD1;
  --hops: #7C9A46;

  --receipt-bg: #EDE6D6;
  --receipt-text: #2B2015;
  --receipt-muted: #6B5D45;

  --font-display: 'Staatliches', sans-serif;
  --font-body: 'Work Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
}

/* ---------- Hero ---------- */

.hero {
  text-align: center;
  margin-bottom: 3rem;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 0.5rem;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.75rem, 9vw, 4.5rem);
  letter-spacing: 0.02em;
  margin: 0 0 0.75rem;
  color: var(--text-primary);
}

.hero-sub {
  color: var(--text-secondary);
  font-size: 15px;
  max-width: 420px;
  margin: 0 auto 2.5rem;
}

.mug-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

#beerFill {
  transition: y 1.4s cubic-bezier(0.22, 1, 0.36, 1), height 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.drip {
  fill: var(--amber);
  animation: fall 3.2s ease-in infinite;
}
.drip:nth-child(2) { animation-delay: 1s; }
.drip:nth-child(3) { animation-delay: 2s; }

@keyframes fall {
  0%   { transform: translateY(0); opacity: 0.8; }
  80%  { opacity: 0.3; }
  100% { transform: translateY(14px); opacity: 0; }
}

.mug-readout {
  margin-top: 1rem;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.count {
  font-family: var(--font-display);
  font-size: 2.25rem;
  color: var(--amber);
}

.count-goal {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-muted);
}

.to-go {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0.25rem 0 0;
}

/* ---------- Stat strip ---------- */

.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 3rem;
}

.stat-cell {
  background: var(--surface-1);
  padding: 1.25rem 1rem;
  text-align: center;
}

.stat-cell .value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--text-primary);
  display: block;
}

.stat-cell .label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------- Leaderboard / receipt ---------- */

.leaderboard {
  margin-bottom: 3rem;
}

.receipt {
  background: var(--receipt-bg);
  color: var(--receipt-text);
  border-radius: 4px;
  padding: 1.75rem 1.5rem 1.25rem;
  font-family: var(--font-mono);
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
  position: relative;
}

.receipt::before,
.receipt::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 10px;
  background:
    linear-gradient(135deg, var(--receipt-bg) 50%, transparent 50%) 0 0/14px 14px repeat-x,
    linear-gradient(-135deg, var(--receipt-bg) 50%, transparent 50%) 0 0/14px 14px repeat-x;
}
.receipt::before { top: -9px; }
.receipt::after { bottom: -9px; transform: rotate(180deg); }

.receipt-head {
  text-align: center;
  border-bottom: 1px dashed var(--receipt-muted);
  padding-bottom: 0.85rem;
  margin-bottom: 0.85rem;
}

.receipt-controls {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}

.receipt-search-wrap {
  flex: 1 1 220px;
}

.receipt-filter-wrap {
  flex: 0 1 180px;
}

.receipt-search,
.receipt-filter {
  width: 100%;
  border: 1px solid rgba(43, 32, 21, 0.18);
  border-radius: 999px;
  padding: 0.55rem 0.8rem;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--receipt-text);
  background: rgba(255, 255, 255, 0.45);
}

.receipt-search:focus,
.receipt-filter:focus {
  outline: 2px solid rgba(232, 163, 61, 0.35);
  border-color: var(--amber-dark);
}

.receipt-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.03em;
  margin: 0;
}

.receipt-sub {
  font-size: 12px;
  color: var(--receipt-muted);
  margin: 0.2rem 0 0;
}

.receipt-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 10px;
  align-items: baseline;
  padding: 0.4rem 0;
  font-size: 14px;
}

.receipt-row + .receipt-row {
  border-top: 1px dotted rgba(43,32,21,0.15);
}

.receipt-row .rank {
  color: var(--receipt-muted);
  font-size: 12px;
}

.receipt-row .name {
  font-weight: 500;
}

.receipt-row .count {
  font-family: var(--font-mono);
  font-weight: 500;
}

.receipt-row.leader .name,
.receipt-row.leader .count {
  color: var(--amber-dark);
}

.receipt-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--receipt-muted);
}

.page-btn {
  border: 1px solid rgba(43, 32, 21, 0.18);
  background: var(--surface-2);
  color: var(--receipt-text);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-meta {
  font-size: 11px;
  color: var(--receipt-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.receipt-foot {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--receipt-muted);
  margin-top: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- Shared panel ---------- */

.panel {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
  margin: 0;
  color: var(--text-primary);
}

#month-select {
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ---------- Hall of fame / podium ---------- */

.podium {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.podium li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 0.5rem 0.75rem;
  background: var(--surface-2);
  border-radius: 8px;
  font-size: 14px;
}

.podium li .rank {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-muted);
  text-align: center;
}

.podium li:nth-child(1) .rank { color: var(--amber); }

.podium li .name {
  font-weight: 500;
}

.podium li .count {
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.podium .empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: 0.5rem 0.25rem;
  background: none;
}

/* ---------- Weekday chart ---------- */

.weekday-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 140px;
  padding-top: 0.5rem;
}

.weekday-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 6px;
}

.weekday-bar .bar {
  width: 100%;
  max-width: 32px;
  background: var(--surface-2);
  border-radius: 4px 4px 0 0;
  transition: height 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.weekday-bar.busiest .bar {
  background: var(--amber);
}

.weekday-bar .day-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.weekday-bar .day-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.weekday-bar.busiest .day-count {
  color: var(--amber);
}

/* ---------- Footer ---------- */

.site-footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.site-footer code {
  font-family: var(--font-mono);
  background: var(--surface-1);
  padding: 2px 6px;
  border-radius: 4px;
}

@media (max-width: 480px) {
  main { padding: 3rem 1rem 2rem; }
  .receipt { padding: 1.5rem 1rem 1rem; }
  .panel { padding: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  #beerFill,
  .weekday-bar .bar {
    transition: none;
  }
  .drip { animation: none; opacity: 0; }
}
