:root {
  --bg: #110e0b;
  --panel: #1c1713;
  --panel2: #282019;
  --line: #352b22;
  --text: #f6efe4;
  --muted: #b4a693;
  --dim: #8c7f6f;
  --amber: #f5a524;
  --amber-ink: #1a1206;
  --gold: #ffcc33;
  --green: #4fd18b;
  --warn: #ffb86b;
  --bad: #ff8a80;
  --blue: #8ab4ff;
  --radius: 14px;
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --gutter: 12px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; -webkit-user-select: none; user-select: none; }
img { display: block; }

/* Festival banner (scrolls away) */
.hero {
  position: relative; overflow: hidden;
  padding: calc(18px + env(safe-area-inset-top)) 16px 16px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(245,165,36,0.38) 0%, rgba(245,165,36,0) 55%),
    radial-gradient(90% 120% at 0% 100%, rgba(196,60,30,0.30) 0%, rgba(196,60,30,0) 60%),
    linear-gradient(180deg, #241a10 0%, var(--bg) 100%);
}
.hero::after {
  content: ""; position: absolute; right: -28px; top: -18px; width: 140px; height: 140px; border-radius: 50%;
  border: 18px solid rgba(255, 204, 51, 0.10);
}
.hero-in { position: relative; max-width: 720px; margin: 0 auto; }
.hero h1 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: 0.01em; line-height: 1.3; }
.hero .brand {
  display: block; font-size: 34px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.05;
  background: linear-gradient(90deg, #ffd666, #f5a524 60%, #ff7a3d);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .dot { display: none; }
.hero .event { display: block; margin-top: 4px; color: var(--text); font-size: 16px; }
.when { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.sessions { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.sessions span {
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.10); color: var(--text);
}

/* Sticky bar: tabs, search, filters */
.bar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(17, 14, 11, 0.94);
  -webkit-backdrop-filter: saturate(140%) blur(10px); backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
  padding: calc(6px + env(safe-area-inset-top)) 12px 8px;
}
.tabs, .tools { max-width: 720px; margin-left: auto; margin-right: auto; }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: var(--panel); border-radius: var(--radius); padding: 4px; }
.tabs button {
  min-height: 44px; border: 0; border-radius: 10px; background: transparent;
  font-size: 14px; font-weight: 700; color: var(--muted); padding: 0 2px; cursor: pointer;
  transition: background-color 120ms var(--ease), color 120ms var(--ease);
}
.tabs button[aria-selected="true"] { background: var(--amber); color: var(--amber-ink); }
.badge { display: inline-block; padding: 0 6px; border-radius: 99px; background: var(--panel2); color: var(--text); font-size: 11px; line-height: 1.6; vertical-align: 1px; }
.tabs button[aria-selected="true"] .badge { background: var(--amber-ink); color: var(--amber); }
.badge:empty { display: none; }

.tools { margin-top: 8px; display: grid; gap: 8px; }
.tools[hidden] { display: none; }
#q {
  width: 100%; min-height: 44px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font-size: 16px; padding: 0 12px;
  -webkit-appearance: none; appearance: none;
}
#q::placeholder { color: var(--dim); }
#q:focus { outline: 2px solid var(--amber); outline-offset: 0; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin: 0 -12px; padding: 0 12px; }
.chips::-webkit-scrollbar { display: none; }
.chips[hidden] { display: none; }
.chips .lbl { align-self: center; font-size: 13px; color: var(--muted); flex: none; }
.chips button {
  flex: none; min-height: 36px; padding: 0 13px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--panel); font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer;
  transition: background-color 120ms var(--ease), color 120ms var(--ease);
}
.chips button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Main */
main { padding: var(--s1) var(--gutter) var(--s4); max-width: 720px; margin: 0 auto; min-height: 60vh; }
main.fade { animation: fade 120ms var(--ease); }
@keyframes fade { from { opacity: 0.4; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.group { margin-top: 16px; }
.group h2 {
  margin: 0 0 8px; padding: 0 2px; font-size: 13px; font-weight: 800; color: var(--amber);
  text-transform: uppercase; letter-spacing: 0.06em;
  display: flex; justify-content: space-between; gap: 8px; align-items: baseline;
}
.group h2 small { color: var(--dim); font-weight: 600; font-size: 12px; flex: none; text-transform: none; letter-spacing: 0; }
.empty { color: var(--muted); text-align: center; padding: 32px 8px; }

.beer {
  position: relative;
  background: linear-gradient(180deg, #1f1914 0%, var(--panel) 100%);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s3); margin-bottom: 10px;
  transition: border-color 120ms var(--ease), opacity 120ms var(--ease);
}
.beer.inlist { border-color: #6e5324; }
.row { display: grid; grid-template-columns: 52px 1fr 44px; gap: 10px; align-items: start; }
.rank {
  position: absolute; left: -2px; top: -6px; min-width: 24px; height: 22px; padding: 0 6px; border-radius: 99px;
  background: var(--panel2); border: 1px solid var(--line); color: var(--muted);
  font-size: 12px; font-weight: 800; display: grid; place-items: center;
}
.rank.r1 { background: var(--gold); color: #2a1d00; border-color: var(--gold); }
.rank.r2 { background: #d9dde3; color: #1b1e22; border-color: #d9dde3; }
.rank.r3 { background: #d08a4d; color: #241405; border-color: #d08a4d; }
.lbl-img, .lbl-ph {
  width: 52px; height: 52px; border-radius: 10px; background: var(--panel2); object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06);
}
.lbl-ph {
  display: grid; place-items: center; font-weight: 900; color: rgba(246,239,228,0.55); font-size: 20px;
  background: linear-gradient(135deg, hsl(var(--h) 45% 26%), hsl(var(--h) 40% 16%));
  --h: 30;
}
.lbl-ph.hue0 { --h: 20; } .lbl-ph.hue1 { --h: 45; } .lbl-ph.hue2 { --h: 140; } .lbl-ph.hue3 { --h: 175; }
.lbl-ph.hue4 { --h: 210; } .lbl-ph.hue5 { --h: 260; } .lbl-ph.hue6 { --h: 320; } .lbl-ph.hue7 { --h: 355; }
.info { min-width: 0; }
.name { margin: 0; font-size: 17px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; letter-spacing: -0.01em; }
.meta { margin: 3px 0 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.meta b { color: var(--text); font-weight: 600; }
.abv { color: var(--text); font-weight: 700; }
.notes { margin: 4px 0 0; font-size: 13px; color: var(--dim); overflow-wrap: anywhere; }

.stats { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px 8px; font-size: 13px; align-items: center; }
.chip {
  display: inline-flex; align-items: baseline; gap: 4px; padding: 3px 9px; border-radius: 8px;
  font-weight: 900; font-size: 17px; line-height: 1.2; font-variant-numeric: tabular-nums;
  background: #3a3027; color: var(--text);
}
.chip small { font-size: 11px; font-weight: 700; opacity: 0.8; }
.chip.gold { background: linear-gradient(135deg, #ffd84d, #f5a524); color: #2a1a00; }
.chip.green { background: #1f7a4d; color: #eafff3; }
.chip.ok { background: #4a3e31; color: var(--text); }
.chip.low { background: #3a2f28; color: #d9c9b6; }
.chip.new { background: transparent; border: 1px dashed #5a4a3a; color: var(--muted); font-size: 13px; font-weight: 700; padding: 4px 9px; }
.stat { color: var(--muted); }
.stat b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.flag { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; border: 1px solid; white-space: nowrap; letter-spacing: 0.02em; }
.flag.few { color: var(--warn); border-color: #6f4e26; }
.flag.none { color: var(--bad); border-color: #6f3934; }
.flag.close { color: var(--blue); border-color: #364d7a; }
.tags { margin: 4px 0 0; }
.flag.unconf { color: #e6c3ff; border-color: #5b3f78; border-style: dashed; }
.flag.had { color: #0d2a1a; background: var(--green); border-color: var(--green); }
.ustyle { margin: 4px 0 0; font-size: 12px; color: var(--dim); }

/* One primary action per row (check in); star is a quiet secondary */
.star {
  width: 44px; height: 44px; margin: -4px -4px 0 0; border: 0; border-radius: 12px; background: transparent;
  display: grid; place-items: center; cursor: pointer; color: var(--dim); padding: 0;
  transition: color 120ms var(--ease), background-color 120ms var(--ease), transform 120ms var(--ease);
}
.star svg { width: 26px; height: 26px; }
.star[aria-pressed="true"] { color: var(--amber); }
.star[aria-pressed="true"] svg path { fill: currentColor; }
.star:active { transform: scale(0.88); }
.star.pop { animation: pop 140ms var(--ease); }
@keyframes pop { 50% { transform: scale(1.25); } }

.btn {
  min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2);
  font-size: 15px; font-weight: 700; padding: 0 12px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: var(--text);
  transition: transform 100ms var(--ease), background-color 120ms var(--ease);
}
.btn:active { transform: scale(0.97); }
.actions { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 10px; }
.btn.checkin { background: #ffc000; color: #1a1206; border-color: #ffc000; width: 100%; }
.btn.checkin:disabled { background: transparent; color: var(--dim); border-color: var(--line); border-style: dashed; cursor: default; transform: none; font-weight: 600; }

/* My list */
.summary {
  margin-top: 12px; padding: 14px; border-radius: var(--radius);
  background: radial-gradient(120% 140% at 100% 0%, rgba(245,165,36,0.22), rgba(245,165,36,0) 60%), var(--panel);
  border: 1px solid var(--line); display: grid; gap: 6px;
}
.summary .big { font-size: 24px; font-weight: 900; letter-spacing: -0.01em; }
.summary .big span { color: var(--amber); }
.summary .sub { font-size: 14px; color: var(--muted); }
.progress { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border: 0; border-radius: 99px; background: var(--panel2); overflow: hidden; margin-top: 4px; }
.progress::-webkit-progress-bar { background: var(--panel2); border-radius: 99px; }
.progress::-webkit-progress-value { background: linear-gradient(90deg, var(--green), #b4f06b); border-radius: 99px; transition: width 140ms var(--ease); }
.progress::-moz-progress-bar { background: linear-gradient(90deg, var(--green), #b4f06b); border-radius: 99px; }
.mine .row { grid-template-columns: 52px 1fr; }
.mine.done { opacity: 0.78; }
.mine.done .name { text-decoration: line-through; text-decoration-color: rgba(246,239,228,0.45); text-decoration-thickness: 2px; }
.tick {
  width: 52px; height: 52px; border-radius: 14px; border: 2px solid #5a4a3a; background: var(--panel2);
  display: grid; place-items: center; cursor: pointer; padding: 0; color: transparent;
  transition: background-color 120ms var(--ease), border-color 120ms var(--ease), transform 100ms var(--ease);
}
.tick svg { width: 28px; height: 28px; }
.tick svg path { stroke-dasharray: 30; stroke-dashoffset: 30; transition: stroke-dashoffset 140ms var(--ease); }
.tick:active { transform: scale(0.92); }
.mine.done .tick { background: var(--green); border-color: var(--green); color: #0b2415; }
.mine.done .tick svg path { stroke-dashoffset: 0; }
.tick.bounce { animation: bounce 150ms var(--ease); }
@keyframes bounce { 40% { transform: scale(1.15); } }
.drunkat { margin: 4px 0 0; color: var(--green); font-weight: 800; font-size: 13px; }
.mine .actions { grid-template-columns: 1fr 44px 44px 44px; }
.btn.icon { padding: 0; font-size: 18px; }
.btn.icon:disabled { opacity: 0.3; cursor: default; transform: none; }
.btn.remove { color: var(--bad); }
.listtools { display: flex; justify-content: center; margin-top: 14px; }
.btn.small { min-height: 40px; font-size: 14px; font-weight: 600; color: var(--muted); background: transparent; }

/* Footer */
.foot { padding: 8px 16px calc(32px + env(safe-area-inset-bottom)); text-align: center; color: var(--muted); font-size: 13px; max-width: 720px; margin: 0 auto; }
.foot p { margin: 4px 0; }
.foot .small { font-size: 12px; color: var(--dim); }
.sample { color: var(--warn); }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 99px; font-size: 14px; font-weight: 700;
  max-width: calc(100vw - 32px); z-index: 20; box-shadow: 0 6px 20px rgba(0,0,0,0.55);
  animation: toast 120ms var(--ease);
}
@keyframes toast { from { opacity: 0; transform: translate(-50%, 6px); } }
.toast[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.tba { margin: 18px 0 4px; text-align: center; font-size: 13px; color: var(--dim); font-style: italic; }
