:root {
  /* CraveFX brand, "Studio dark" scheme (brand.cravefx.com/colours.html). */
  --bg: #0F0B0F;            /* Studio black */
  --bg-2: #151016;          /* Studio black, lifted a step */
  --card: #1A151B;          /* surfaces: Studio black lifted */
  --card-2: #241E26;
  --line: rgba(185, 161, 255, .16);   /* Nebula hairline */
  --text: #F6F3F0;          /* Warm white */
  --muted: #A69DB8;         /* Warm white muted toward Nebula */
  --accent: #B9A1FF;        /* Nebula: the Studio dark accent */
  --accent-2: #D4C4FF;      /* Pale lavender */
  --violet: #6214FF;        /* Meteor / Signature violet: calls to action */
  --violet-2: #8E69FF;      /* Violet */
  --galaxy: #230068;        /* Galaxy */
  --lime: #DAFF0B;          /* Starlight: a small burst, used sparingly */
  --pink: #FF2DEA;          /* Magenta */
  --blue: #64ACFF;          /* Light blue */
  --good: #0DFE69;          /* Green */
  --bad: #FF2DEA;           /* Magenta (brick red is too dark for text on black) */
  --gold: #DAFF0B;          /* #1: Starlight */
  --silver: #E5E4E6;        /* #2: Light grey */
  --bronze: #FF7A00;        /* #3: Orange */
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --display: tt-travels-next, Unbounded, system-ui, sans-serif;
  --body: "Google Sans Flex", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.5 var(--body);
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% -10%, rgba(98, 20, 255, .22) 0%, transparent 60%),
              radial-gradient(900px 500px at 110% 10%, rgba(35, 0, 104, .5) 0%, transparent 55%),
              var(--bg);
  min-height: 100vh;
}
a { color: var(--accent-2); }
h1, h2 { margin: 0 0 .25rem; line-height: 1.2; letter-spacing: 0; font-weight: 800; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; margin-top: 2rem; }
p { margin: .25rem 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
code { background: var(--card-2); padding: .1em .35em; border-radius: 6px; font-size: .9em; }
[hidden] { display: none !important; }

/* -- header --------------------------------------------------------------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem 1.25rem; border-bottom: 1px solid var(--line);
  background: rgba(15, 11, 15, .94);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: inline-flex; align-items: center; gap: .85rem; min-width: 0; color: var(--text); text-decoration: none; }
/* CraveFX lockup: supplied artwork, white on dark, never under 100px wide. */
.brand-logo { display: block; flex: none; width: auto; height: 32px; min-width: 107px; }
.brand-sep { flex: none; width: 6px; height: 6px; background: var(--lime); }
.brand-name { font-weight: 800; font-size: .95rem; line-height: 1.1; letter-spacing: .01em; white-space: nowrap; }
.who { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.who form { margin: 0; }
.who-name { color: var(--muted); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 12rem; }
.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--card-2); flex: none; }
.avatar.initials { display: inline-grid; place-items: center; font-size: .7rem; font-weight: 700; color: var(--accent); }
.navlink { color: var(--muted); text-decoration: none; padding: .3rem .6rem; border-radius: 8px; font-size: .9rem; }
.navlink.on, .navlink:hover { color: var(--text); background: var(--card-2); }
.linkish { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; font-size: .9rem; padding: .3rem .4rem; }
.linkish:hover { color: var(--text); }
.who .linkish { white-space: nowrap; }

/* -- buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .6rem 1.1rem; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card-2); color: var(--text); text-decoration: none; font: inherit; font-weight: 600;
  cursor: pointer; transition: transform .08s ease, background .15s ease;
}
.btn:hover { background: rgba(98, 20, 255, .22); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--violet); border-color: transparent; color: #fff; }
.btn.primary:hover { background: var(--violet-2); }
.btn:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn.google { background: #fff; color: #1f1f1f; border-color: transparent; }
.btn.google:hover { background: #f1f3f4; }

/* -- hero (sign in / errors) --------------------------------------------- */
.hero { display: grid; place-items: center; min-height: calc(100vh - 60px); padding: 2rem 1rem; }
.hero-card {
  width: min(460px, 100%); text-align: center; padding: 2.5rem 2rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
}
.hero-mark { font-size: 3rem; line-height: 1; margin-bottom: .75rem; }
.hero-card h1 { font-size: 1.9rem; }
.lead { color: var(--muted); font-size: 1.02rem; margin-bottom: 1.5rem; }
.fine { color: var(--muted); font-size: .8rem; margin-top: 1.5rem; }
.notice { padding: .6rem .9rem; border-radius: 10px; background: var(--card-2); font-size: .9rem; }
.notice.bad { background: rgba(255, 45, 234, .12); color: #FFBAFF; border: 1px solid rgba(255, 45, 234, .35); }

/* -- vote page ------------------------------------------------------------ */
.vote, .admin { max-width: 1180px; margin: 0 auto; padding: 1.25rem 1.25rem 4rem; }

.deadline {
  display: flex; align-items: baseline; justify-content: center; gap: .6rem 1rem; flex-wrap: wrap;
  margin-bottom: 1rem; padding: .8rem 1.2rem; border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(98, 20, 255, .18), rgba(185, 161, 255, .08));
  border: 1px solid rgba(98, 20, 255, .45); text-align: center;
}
.deadline-label { font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: .78rem; color: var(--accent-2); }
.deadline-clock { font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .02em; line-height: 1; }
.deadline-when { font-size: .85rem; }
.deadline.soon { border-color: var(--accent); }
.deadline.urgent { border-color: var(--bad); background: rgba(255, 45, 234, .16); animation: pulse 1.2s ease-in-out infinite; }
.deadline.urgent .deadline-label { color: var(--bad); }
.deadline.closed { background: rgba(255, 45, 234, .12); border-color: rgba(255, 45, 234, .5); }
.deadline.closed .deadline-label { color: var(--bad); font-size: 1.1rem; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 45, 234, .35); } 50% { box-shadow: 0 0 0 6px rgba(255, 45, 234, 0); } }
.grid.locked .card { cursor: not-allowed; }
.grid.locked .card:hover { transform: none; box-shadow: none; border-color: var(--line); }
.grid.locked .card:not(.picked) { opacity: .4; }

.tray {
  position: sticky; top: 56px; z-index: 10;
  background: rgba(26, 21, 27, .96);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1rem 1.1rem; margin-bottom: 1.25rem;
}
.tray-head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.tray-head h1 { font-size: 1.25rem; }
.tray-head p { margin: 0; font-size: .85rem; }
.slots { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.slot {
  display: grid; grid-template-columns: auto 56px 1fr auto; align-items: center; gap: .6rem;
  min-height: 72px; padding: .5rem .6rem; border-radius: 12px;
  background: var(--bg-2); border: 1px dashed var(--line);
}
.slot.filled { border-style: solid; background: var(--card-2); }
.slot .medal { font-size: 1.35rem; width: 1.7rem; text-align: center; }
.slot img { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; background: #fff; }
.slot .ph { width: 56px; height: 56px; border-radius: 8px; border: 1px dashed var(--line); }
.slot .name { font-weight: 600; font-size: .92rem; line-height: 1.25; }
.slot .name small { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; }
.slot .empty-label { color: var(--muted); font-size: .9rem; }
.slot .ctl { display: flex; flex-direction: column; gap: 2px; }
.slot .ctl button {
  width: 26px; height: 22px; border-radius: 6px; border: 1px solid var(--line); background: var(--card);
  color: var(--muted); cursor: pointer; font: inherit; font-size: .8rem; line-height: 1; padding: 0;
}
.slot .ctl button:hover { color: var(--text); background: rgba(98, 20, 255, .25); }
.slot .ctl button:disabled { opacity: .3; cursor: default; }
.tray-actions { display: flex; align-items: center; justify-content: flex-end; gap: 1rem; margin-top: .85rem; }

/* The mix: the three picks ARE the slider. Each drink is a segment whose
   width is its share of 100%; the seams between them are the handles. */
.mix-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .7rem; min-height: 1.6em; }
.mix-hint { color: var(--muted); font-size: .88rem; }
.mix-hint.go { color: var(--lime); font-weight: 700; }
.mix-head .linkish { font-size: .85rem; }

.mix {
  position: relative; display: flex; height: 112px; margin-top: .45rem;
  border-radius: 16px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line);
  user-select: none; -webkit-user-select: none;
}
.mix.live { touch-action: none; }
.mix-seg {
  position: relative; min-width: 0; overflow: hidden; display: flex; align-items: center; gap: .7rem;
  padding: 0 .9rem; color: #0F0B0F;
  transition: flex-basis .45s cubic-bezier(.2, 1.1, .3, 1);
}
.mix.dragging .mix-seg { transition: none; }
.mix-seg:first-child { border-radius: 16px 0 0 16px; }
.mix-seg:last-of-type { border-radius: 0 16px 16px 0; }
.mix-seg.c0 { background: linear-gradient(160deg, #D4C4FF, #B9A1FF); }
.mix-seg.c1 { background: linear-gradient(160deg, #A1CEFF, #64ACFF); }
.mix-seg.c2 { background: linear-gradient(160deg, #FFBAFF, #FF66F0); }
.mix-seg.empty {
  justify-content: center; flex-direction: column; gap: .25rem; color: var(--muted);
  background: transparent; border: 2px dashed var(--line); border-radius: 14px; margin: 6px 4px;
}
.mix-seg.empty.next { border-color: rgba(185, 161, 255, .6); color: var(--accent-2); }
.mix-num { font-weight: 900; font-size: 1.4rem; line-height: 1; }
.mix-empty { font-size: .8rem; text-align: center; }

.mix-img {
  flex: none; width: 74px; height: 74px; object-fit: contain; border-radius: 14px; background: #fff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .25);
}
.mix-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.mix-pct { font-weight: 800; font-size: 2rem; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.mix-name { font-weight: 700; font-size: .85rem; opacity: .85; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mix-x {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(15, 11, 15, .18); color: #0F0B0F; font: inherit; font-size: .75rem; line-height: 1; cursor: pointer;
}
.mix-x:hover { background: rgba(15, 11, 15, .35); }

/* Contents step down as a segment narrows (size set from its pixel width). */
.mix-seg[data-size="m"] { flex-direction: column; justify-content: center; gap: .3rem; padding: 0 .4rem; }
.mix-seg[data-size="m"] .mix-img { width: 50px; height: 50px; border-radius: 10px; }
.mix-seg[data-size="m"] .mix-pct { font-size: 1.35rem; text-align: center; }
.mix-seg[data-size="m"] .mix-name { display: none; }
.mix-seg[data-size="s"] { justify-content: center; padding: 0; }
.mix-seg[data-size="s"] .mix-img, .mix-seg[data-size="s"] .mix-name, .mix-seg[data-size="s"] .mix-x { display: none; }
.mix-seg[data-size="s"] .mix-pct { font-size: 1.05rem; }
.mix-seg[data-size="xs"] > * { display: none; }

/* Handles sit on the seams. A wide invisible hit area, a slim white grip. */
.mix-div {
  position: absolute; top: -8px; bottom: -8px; z-index: 3; width: 28px; translate: -50% 0;
  padding: 0; border: 0; background: none; cursor: ew-resize; touch-action: none;
}
.mix-div[hidden] { display: none; }
.mix-div .grip {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 14px; height: 54px; border-radius: 8px;
  background: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .45), 0 0 0 1px rgba(0, 0, 0, .15);
  transition: scale .15s ease, height .15s ease;
}
.mix-div .grip::before, .mix-div .grip::after {
  content: ''; position: absolute; top: 16px; bottom: 16px; width: 2px; border-radius: 1px; background: #434343;
}
.mix-div .grip::before { left: 4px; }
.mix-div .grip::after { right: 4px; }
.mix-div:hover .grip, .mix-div:focus-visible .grip, .mix-div.active .grip { scale: 1.12; height: 64px; }
.mix-div:focus-visible { outline: none; }
.mix-div:focus-visible .grip { box-shadow: 0 0 0 3px var(--accent), 0 4px 14px rgba(0, 0, 0, .45); }
.mix-div:disabled { cursor: default; }
/* Both neighbours' shares, shown above the handle while it is held. */
.mix-tip {
  position: absolute; left: 50%; bottom: calc(100% + 4px); translate: -50% 0; white-space: nowrap; pointer-events: none;
  padding: .25rem .55rem; border-radius: 8px; background: var(--text); color: var(--bg); font-weight: 800; font-size: .8rem;
  opacity: 0; transform: translateY(4px); transition: opacity .15s ease, transform .15s ease;
}
.mix-div.active .mix-tip, .mix-div:focus-visible .mix-tip { opacity: 1; transform: none; }

/* Callouts under the bar for segments too narrow to show their picture. */
.mix-callouts { position: relative; height: 0; transition: height .2s ease; }
.mix-callouts.has { height: 50px; }
.mix-co {
  position: absolute; top: 12px; display: flex; align-items: center; gap: .4rem;
  padding: .25rem .6rem .25rem .3rem; border-radius: 10px; color: #0F0B0F; white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .45); animation: calloutIn .28s cubic-bezier(.2, 1.4, .4, 1);
}
.mix-co[hidden] { display: none; }
.mix-co.c0 { background: #B9A1FF; }
.mix-co.c1 { background: #84BBFF; }
.mix-co.c2 { background: #FF8CFF; }
.co-arrow {
  position: absolute; top: -5px; left: clamp(10px, var(--arrow, 50%), calc(100% - 10px));
  width: 11px; height: 11px; translate: -50% 0; rotate: 45deg; border-radius: 2px; background: inherit;
}
.mix-co img { position: relative; width: 28px; height: 28px; object-fit: contain; background: #fff; border-radius: 6px; }
.co-text { position: relative; display: flex; flex-direction: column; line-height: 1.1; }
.co-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; font-size: .74rem; font-weight: 700; }
.co-pct { font-size: .82rem; font-weight: 900; font-variant-numeric: tabular-nums; }
@keyframes calloutIn { from { opacity: 0; transform: translateY(-6px) scale(.9); } }

@media (max-width: 720px) {
  .mix { height: 96px; }
  .mix-img { width: 54px; height: 54px; }
  .mix-pct { font-size: 1.5rem; }
}

/* The diet pick: one row in the tray, chosen from a sheet of diet drinks. */
.diet-row { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; margin-top: .85rem; padding: .55rem .7rem; border-radius: 12px; background: var(--bg-2); border: 1px dashed var(--line); }
.diet-row.needs { border-color: rgba(13, 254, 105, .65); }
.diet-label { font-weight: 800; color: var(--good); }
.diet-choice { flex: 1; min-width: 0; }
.diet-chip { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; }
.diet-chip img { width: 36px; height: 36px; object-fit: contain; background: #fff; border-radius: 8px; }
.sheet { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 1rem; background: rgba(15, 11, 15, .78); backdrop-filter: blur(4px); }
.sheet[hidden] { display: none !important; }
.sheet-inner { width: min(900px, 100%); max-height: 86vh; overflow: auto; padding: 1rem 1.2rem 1.4rem; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.sheet-head h2 { margin: 0; }
.sheet-head .linkish { font-size: 1.2rem; }
.diet-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
body.sheet-open { overflow: hidden; }
.status { font-size: .9rem; color: var(--muted); }
.status.ok { color: var(--good); }
.status.bad { color: var(--bad); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .25rem; }
.tabs { display: flex; gap: .25rem; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .25rem; }
.tab { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; padding: .4rem .8rem; border-radius: 8px; cursor: pointer; }
.tab.on { background: var(--card-2); color: var(--text); }
.tab .count { color: var(--muted); font-weight: 400; font-size: .85em; }
.search {
  flex: 1 1 220px; max-width: 360px; padding: .55rem .8rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit;
}
.search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.grid {
  list-style: none; margin: .75rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem;
}
.card {
  position: relative; display: flex; flex-direction: column; gap: .5rem; padding: .6rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; text-align: left; color: inherit; font: inherit; width: 100%;
  transition: transform .1s ease, border-color .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); border-color: rgba(185, 161, 255, .45); box-shadow: var(--shadow); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 10px; background: #fff; }
.card .ph { width: 100%; aspect-ratio: 1; border-radius: 10px; border: 1px dashed var(--line); }
.card .name { font-size: .88rem; font-weight: 600; line-height: 1.25; min-height: 2.5em; }
.card .cat { font-size: .74rem; color: var(--muted); }
.card.picked { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(98, 20, 255, .35); }
.card .badge {
  position: absolute; top: .45rem; left: .45rem; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: .95rem; color: #0F0B0F;
  background: var(--accent); box-shadow: 0 2px 8px rgba(0, 0, 0, .4); z-index: 1;
}
.card .badge.r1 { background: var(--gold); }
.card .badge.r2 { background: var(--silver); }
.card .badge.r3 { background: var(--bronze); }
.card.full:not(.picked) { opacity: .55; }
.empty { text-align: center; padding: 2rem; }

/* -- admin ------------------------------------------------------------------- */
.admin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.admin-actions { display: flex; gap: .5rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; margin-top: 1rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; }
.stat .k { color: var(--muted); font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; }
.stat .k::before, .deadline-label::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: .5em; vertical-align: .12em; background: var(--accent); }
.stat .v { font-size: 1.7rem; font-weight: 800; line-height: 1.2; }
.stat .v small { font-size: .9rem; font-weight: 500; color: var(--muted); }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: .55rem .75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
.table th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; background: var(--bg-2); position: sticky; top: 0; }
.table tr:last-child td { border-bottom: 0; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table th.num { text-align: right; }
.table .thumb { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; background: #fff; vertical-align: middle; margin-right: .5rem; }
.table .drink { display: flex; align-items: center; gap: .25rem; white-space: normal; min-width: 220px; }
.table .rank { font-weight: 800; color: var(--muted); width: 2rem; }
.table .rank.r1 { color: var(--gold); }
.table .rank.r2 { color: var(--silver); }
.table .rank.r3 { color: var(--bronze); }
.table .bar { height: 6px; border-radius: 3px; background: var(--accent); min-width: 2px; }
.table .score { font-weight: 800; }
.table .bar.diet { background: var(--good); }
.table .pickchip.diet { background: rgba(13, 254, 105, .14); }
.table .price { white-space: nowrap; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover, .table th.sorted { color: var(--text); }
.table th.sortable .arrow { color: var(--muted); font-size: .75em; }
.table th.sorted .arrow { color: var(--accent-2); }
.table th.sortable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.table .shop { color: var(--muted); text-decoration: none; font-size: .8rem; }
.table .shop:hover { color: var(--accent-2); }
.table .pickchip { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .5rem .15rem .2rem; border-radius: 999px; background: var(--card-2); font-size: .82rem; margin: .1rem .25rem .1rem 0; white-space: nowrap; }
.table .pickchip img { width: 22px; height: 22px; border-radius: 50%; background: #fff; object-fit: contain; }
.table .pickchip b { color: var(--muted); font-weight: 700; }
.table .none { color: var(--muted); font-style: italic; }
.table .pickchip.off { opacity: .55; text-decoration: line-through; }
.table .pickchip.off i { text-decoration: none; font-style: normal; color: var(--bad); }
.table tr.row-off td { opacity: .55; }
.table tr.row-off td:last-child { opacity: 1; }
.switch {
  display: inline-flex; align-items: center; gap: .5rem; padding: 3px 10px 3px 3px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--muted); font: inherit; font-size: .8rem; font-weight: 600;
  cursor: pointer; min-width: 74px;
}
.switch .knob { width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .15s ease, background .15s ease; }
.switch.is-on { border-color: rgba(13, 254, 105, .5); color: var(--good); }
.switch.is-on .knob { background: var(--good); }
.switch.is-off { flex-direction: row-reverse; padding: 3px 3px 3px 10px; }
.switch.is-off .knob { background: var(--bad); }
.switch.is-off { color: var(--bad); border-color: rgba(255, 45, 234, .45); }
.switch:disabled { opacity: .5; cursor: wait; }
#catalogue-section .toolbar { margin: .5rem 0 .75rem; }

/* shopping list */
.table .pick-col { width: 2.2rem; text-align: center; padding-left: .6rem; padding-right: .2rem; }
.table .pick-col input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; vertical-align: middle; }
.table tr.selected td { background: rgba(98, 20, 255, .08); }
.icon-btn {
  width: 26px; height: 24px; border-radius: 6px; border: 1px solid var(--line); background: var(--card);
  color: var(--muted); cursor: pointer; font: inherit; font-size: .8rem; line-height: 1; padding: 0; flex: none;
}
.icon-btn:hover { color: var(--text); background: rgba(98, 20, 255, .25); }
.basket {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 30; width: min(380px, calc(100vw - 2.5rem));
  background: rgba(26, 21, 27, .96); backdrop-filter: blur(12px);
  border: 1px solid rgba(98, 20, 255, .5); border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; max-height: min(70vh, 560px);
}
.basket-head { display: flex; align-items: center; gap: .6rem; padding: .75rem .9rem; border-bottom: 1px solid var(--line); }
.basket-head strong { flex: 1; }
.basket-list { list-style: none; margin: 0; padding: .25rem .5rem; overflow-y: auto; flex: 1; }
.basket-list li { display: flex; align-items: center; gap: .6rem; padding: .4rem .4rem; border-bottom: 1px solid var(--line); }
.basket-list li:last-child { border-bottom: 0; }
.basket-list img { width: 34px; height: 34px; border-radius: 8px; background: #fff; object-fit: contain; flex: none; }
.basket-name { flex: 1; font-size: .88rem; line-height: 1.2; min-width: 0; }
.basket-name small { display: block; color: var(--muted); font-size: .75rem; }
.basket-price { font-variant-numeric: tabular-nums; font-size: .88rem; white-space: nowrap; min-width: 4.2em; text-align: right; }
.stepper { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.stepper .qty {
  width: 2.6em; height: 24px; text-align: center; border-radius: 6px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font: inherit; font-size: .88rem; font-variant-numeric: tabular-nums;
  -moz-appearance: textfield; appearance: textfield;
}
.stepper .qty::-webkit-outer-spin-button, .stepper .qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper .qty:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.basket-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: .75rem; padding: .75rem .9rem; border-top: 1px solid var(--line); background: var(--bg-2); border-radius: 0 0 var(--radius) var(--radius); }
.basket-total { font-size: 1.6rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.basket-actions { display: flex; gap: .4rem; }
.basket-actions .btn { padding: .45rem .8rem; font-size: .88rem; }
@media (max-width: 720px) { .basket { right: .5rem; left: .5rem; bottom: .5rem; width: auto; max-height: 55vh; } }

/* wheel of drinks */
.wheel-wrap { display: grid; grid-template-columns: minmax(220px, 520px) minmax(220px, 1fr); gap: 1.5rem; align-items: start; margin-top: 1rem; }
.wheel-stage { position: relative; width: 100%; max-width: 520px; aspect-ratio: 1; }
.wheel-stage canvas { display: block; width: 100%; height: 100%; border-radius: 50%; cursor: pointer; box-shadow: var(--shadow); transition: transform .12s ease; }
.wheel-stage canvas:hover { transform: scale(1.01); }
.wheel-stage canvas.spinning { cursor: wait; }
.wheel-stage canvas:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.wheel-pointer {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%); z-index: 2;
  width: 0; height: 0; border-left: 16px solid transparent; border-right: 16px solid transparent; border-top: 34px solid var(--text);
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .5));
}
.tweaks { margin-top: 1.5rem; padding: 1rem 1.1rem; border-radius: var(--radius); background: var(--card); border: 1px dashed var(--line); }
.tweaks-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.tweaks-head .muted { flex: 1; }
.tweaks-list { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .35rem .75rem; }
.tweaks-list label { display: flex; align-items: center; gap: .6rem; padding: .35rem .4rem; border-radius: 8px; cursor: pointer; }
.tweaks-list label:hover { background: var(--card-2); }
.tweaks-list input { width: 18px; height: 18px; accent-color: var(--bad); flex: none; }
.tweaks-list img { width: 30px; height: 30px; border-radius: 7px; background: #fff; object-fit: contain; flex: none; }
.tweaks-name { font-size: .9rem; line-height: 1.2; }
.tweaks-name small { display: block; color: var(--muted); font-size: .75rem; }
.tweaks-list li.off .tweaks-name { text-decoration: line-through; color: var(--muted); }
.tweaks-list li.listed { opacity: .55; }
.wheel-hub {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2; cursor: default; user-select: none;
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem;
  background: var(--bg); border: 4px solid var(--accent-2); box-shadow: 0 0 0 4px rgba(15, 11, 15, .6);
}
.wheel-side { display: flex; flex-direction: column; gap: .75rem; }
.wheel-winner {
  text-align: center; padding: 1.25rem 1rem; border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(98, 20, 255, .22), rgba(185, 161, 255, .08));
  border: 1px solid rgba(185, 161, 255, .6); box-shadow: var(--shadow);
}
.wheel-winner img { width: 140px; height: 140px; object-fit: contain; border-radius: 14px; background: #fff; margin: .5rem auto; display: block; }
.wheel-winner-name { font-size: 1.5rem; font-weight: 800; line-height: 1.15; }
.wheel-winner.pop { animation: pop .5s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pop { 0% { transform: scale(.85); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.wheel-history { list-style: none; margin: 0; padding: 0; font-size: .88rem; }
.wheel-history li { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; border-bottom: 1px solid var(--line); }
.wheel-history li:first-child { font-weight: 700; }
@media (max-width: 860px) { .wheel-wrap { grid-template-columns: 1fr; } .wheel-stage { margin: 0 auto; } }
@media (prefers-reduced-motion: reduce) { .wheel-winner.pop { animation: none; } }

/* drinks list: collapsible "same drink" and can + packet groups */
.fam-tools { display: flex; gap: .4rem; }
.fam-tools .btn { padding: .45rem .8rem; font-size: .85rem; }
.table tr.fam-head td { padding: 0; white-space: normal; background: var(--bg-2); border-top: 1px solid var(--line); }
.fam-toggle {
  width: 100%; display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .7rem; padding: .65rem .8rem;
  background: none; border: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.fam-toggle:hover { background: var(--card-2); }
.fam-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.fam-caret { width: 1em; color: var(--accent-2); font-size: .9em; }
.fam-name { font-size: .95rem; }
.fam-kind { font-weight: 700; }
.fam-kind.kind-family { color: #84BBFF; border-color: rgba(100, 172, 255, .45); }
.fam-kind.kind-pair, .chip-pair { color: var(--accent-2); border-color: rgba(185, 161, 255, .45); }
.chip-cheap { color: var(--good); border-color: rgba(13, 254, 105, .5); }
.fam-meta { margin-left: auto; display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; color: var(--muted); font-size: .82rem; }
.fam-count.one-on { color: var(--good); }
.fam-count.none-on { color: var(--bad); }
.fam-cheap.is-off { color: var(--bad); }
.table tr.fam-head.is-open td { background: var(--card-2); }
.table tr.fam-row td { background: rgba(15, 11, 15, .6); }
.table td.fam-member { padding-left: 2.3rem; }
.drink-wrap { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.row-tags { display: inline-flex; gap: .3rem; }

/* presentation setup */
.pres-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.pres-head > div { flex: 1 1 420px; }
.pres-head .btn { margin-top: 1.5rem; }
.pres-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .75rem 0; }
.pres-table td { vertical-align: middle; }
.pres-label { max-width: 170px; padding: .4rem .6rem; }
.pres-select { max-width: 380px; width: 100%; padding: .45rem .6rem; color-scheme: dark; }
.pres-votes { color: var(--muted); font-size: .88rem; }
.chip { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; border: 1px solid var(--line); }
.chip-closed { color: var(--muted); }
.chip-open { color: var(--good); border-color: rgba(13, 254, 105, .5); }

.admin-tabs { display: inline-flex; margin-top: 1rem; flex-wrap: wrap; }
.admin-tabs .tab { padding: .5rem 1rem; }
.panel > h2:first-child, .panel .stats + h2 { margin-top: 1.5rem; }
.panel .stats { margin-top: 1rem; }
.switch.is-off .label { min-width: 3.6em; }
.window {
  margin-top: 1.25rem; padding: 1rem 1.1rem; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr auto; gap: .5rem 1.5rem; align-items: center;
}
.window h2 { margin-top: 0; }
.window p { margin: 0; }
.window.is-open { border-color: rgba(13, 254, 105, .45); }
.window.is-closed { border-color: rgba(255, 45, 234, .5); }
.window.is-closed #window-status { color: var(--bad); }
.window.is-open #window-status { color: var(--good); }
.window-form { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.window-form .search { max-width: 230px; flex: none; color-scheme: dark; }
#window-msg { grid-column: 1 / -1; margin-top: .25rem; }
.danger { margin-top: 2.5rem; padding: 1rem 1.1rem; border-radius: var(--radius); border: 1px solid rgba(255, 45, 234, .4); background: rgba(255, 45, 234, .06); }
.danger h2 { margin-top: 0; color: var(--bad); }
.danger-btn { border-color: rgba(255, 45, 234, .6); color: var(--bad); }
.danger-btn:hover { background: rgba(255, 45, 234, .18); }
@media (max-width: 960px) { .window { grid-template-columns: 1fr; } .window h2 { margin-bottom: .1rem; } }
.table .email { color: var(--muted); font-size: .82rem; }
.table .when { color: var(--muted); font-size: .82rem; }

@media (max-width: 720px) {
  .top { padding: .65rem .9rem; gap: .6rem; }
  .who { gap: .35rem; }
  .brand { gap: .55rem; }
  .brand-logo { height: 30px; min-width: 100px; }
  .brand-sep { display: none; }
  .brand-name { font-size: .7rem; white-space: normal; max-width: 7.5em; }
  .navlink { padding: .3rem .45rem; }
  .linkish { padding: .3rem .25rem; }
  .who-name { display: none; }
  .tray { position: static; }
  .slots { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .5rem; }
  .vote, .admin { padding: .75rem .75rem 4rem; }
}
/* Narrow phones: an admin's extra nav links need the room, so the lockup
   drops to the CraveFX logo alone there (the tab title still names the app). */
@media (max-width: 480px) {
  .top:has(.navlink:not(.replay-intro)) .brand-name { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ==========================================================================
   JUICE THEME — the look and feel layer for sign-in, voting and admin.
   Appended last so it overrides the base styles above. The presentation
   screen loads present.css after this and keeps its own stage.
   ========================================================================== */

:root {
  --radius: 12px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .55);
  --spring: cubic-bezier(.2, 1.5, .35, 1);
}

body {
  background: radial-gradient(1100px 700px at 15% -10%, rgba(98, 20, 255, .24) 0%, transparent 60%),
              radial-gradient(900px 600px at 110% 0%, rgba(35, 0, 104, .55) 0%, transparent 55%),
              radial-gradient(900px 700px at 50% 120%, rgba(45, 87, 255, .12) 0%, transparent 60%),
              var(--bg);
  background-attachment: fixed;
}
h1, h2, .brand-name, .stat .v, .hero-card h1, .deadline-clock, .juice-banner-title, .wheel-winner-name, .basket-total { font-family: var(--display); }
h1 { letter-spacing: 0; }
::selection { background: rgba(98, 20, 255, .45); }

/* Backdrop: drifting blobs and fizz, behind everything. Each blob is a soft
   radial gradient (it reads as a blurred circle) moved only by transform:
   a huge blur filter with a blend mode, re-rendered every frame, made the
   compositor drop parts of the page for a frame now and then. */
.juice-bg { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.juice-bg i { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; will-change: transform; }
.juice-bg i:nth-child(1) { left: -19vmax; top: -17vmax; background: radial-gradient(circle closest-side, rgba(98, 20, 255, .35), rgba(98, 20, 255, .3) 40%, rgba(98, 20, 255, .1) 72%, rgba(98, 20, 255, 0)); animation: blobA 26s ease-in-out infinite alternate; }
.juice-bg i:nth-child(2) { right: -21vmax; top: 3vmax; background: radial-gradient(circle closest-side, rgba(185, 161, 255, .16), rgba(185, 161, 255, .12) 40%, rgba(185, 161, 255, .04) 72%, rgba(185, 161, 255, 0)); animation: blobB 31s ease-in-out infinite alternate; }
.juice-bg i:nth-child(3) { left: 13vmax; bottom: -29vmax; background: radial-gradient(circle closest-side, rgba(45, 87, 255, .18), rgba(45, 87, 255, .14) 40%, rgba(45, 87, 255, .05) 72%, rgba(45, 87, 255, 0)); animation: blobC 23s ease-in-out infinite alternate; }
@keyframes blobA { to { transform: translate(18vmax, 14vmax) scale(1.2); } }
@keyframes blobB { to { transform: translate(-16vmax, 10vmax) scale(.85); } }
@keyframes blobC { to { transform: translate(-10vmax, -12vmax) scale(1.15); } }
.juice-fizz { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -1; pointer-events: none; }
.juice-fx { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 90; pointer-events: none; }

/* Header: frosted glass with a living gradient edge. */
/* No backdrop-filter on the sticky bars: Chrome drops a sticky element with one for a frame
   now and then as the page scrolls under it (the UI "flashing"), so they're near-opaque. */
.top { background: rgba(15, 11, 15, .92); border-bottom: 0; }
.top::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--galaxy), var(--violet), var(--accent), var(--violet), var(--galaxy));
  background-size: 200% 100%; animation: edgeFlow 8s linear infinite; opacity: .8;
}
@keyframes edgeFlow { to { background-position: 200% 0; } }
.brand-sep { transition: transform .5s var(--spring); }
.brand:hover .brand-sep { transform: rotate(90deg) scale(1.4); }
.avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .15), 0 0 16px rgba(185, 161, 255, .5); }
.juice-sound {
  width: 34px; height: 34px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: var(--card);
  font-size: .95rem; cursor: pointer; transition: transform .25s var(--spring), background .2s ease;
}
.juice-sound:hover { transform: scale(1.1) rotate(-8deg); background: var(--card-2); }
.hero-card .juice-sound { position: absolute; top: 14px; right: 14px; }

/* Buttons: springy, glowing, with ripples. */
.btn {
  position: relative; border-radius: 10px; font-weight: 700; letter-spacing: .01em; border-color: var(--line);
  background: var(--card-2);
  transition: transform .25s var(--spring), box-shadow .25s ease, background .2s ease, filter .2s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .45); background: rgba(98, 20, 255, .28); }
.btn:active { transform: translateY(1px) scale(.96); transition-duration: .08s; }
.btn.primary {
  color: #fff; border: 0; text-shadow: 0 1px 2px rgba(15, 11, 15, .35); overflow: hidden;
  background: linear-gradient(135deg, #6214FF 0%, #8E69FF 100%);
  box-shadow: 0 8px 26px rgba(98, 20, 255, .38), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn.primary:hover { background: linear-gradient(135deg, #6214FF 0%, #9B79FF 100%); box-shadow: 0 14px 34px rgba(98, 20, 255, .5), inset 0 1px 0 rgba(255, 255, 255, .4); }
.btn.primary::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .7s ease;
}
.btn.primary:hover::before { transform: translateX(120%); }
.btn.primary:disabled { filter: grayscale(.6) brightness(.8); box-shadow: none; }
.btn.primary.saved-burst { animation: savedBurst .7s var(--spring); }
@keyframes savedBurst { 0% { transform: scale(1); } 30% { transform: scale(1.12); background: linear-gradient(135deg, #00A860, #0DFE69); } 100% { transform: scale(1); } }
.btn.google { background: #fff; color: #1f1f1f; box-shadow: 0 10px 30px rgba(255, 255, 255, .15); }
.btn.google:hover { background: #fff; box-shadow: 0 14px 38px rgba(255, 255, 255, .28); }

/* Position is set from juice.js only on static elements, so absolutely
   placed controls stay put while pressed. */
.juice-host { overflow: hidden; }
.juice-ripple {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, .45) 0%, rgba(255, 255, 255, 0) 60%);
  transform: scale(0); animation: ripple .65s ease-out forwards;
}
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* Tabs: a gradient pill slides under the active one. */
.tabs { position: relative; background: rgba(26, 21, 27, .85); border-color: var(--line); border-radius: 12px; }
.tab { position: relative; z-index: 1; border-radius: 8px; transition: color .2s ease, transform .2s var(--spring); }
.tab:active { transform: scale(.94); }
.tabs.has-ind .tab.on { background: transparent; color: #fff; }
.tab-ind {
  position: absolute; left: 0; top: 0; z-index: 0; border-radius: 8px; pointer-events: none;
  background: linear-gradient(135deg, #6214FF, #8E69FF);
  box-shadow: 0 6px 18px rgba(98, 20, 255, .35);
  transition: transform .45s var(--spring), width .45s var(--spring), height .3s ease, opacity .2s ease;
}
.tab .count { color: inherit; opacity: .75; }

.search { background: rgba(26, 21, 27, .8); border-color: var(--line); border-radius: 10px; transition: box-shadow .25s ease, border-color .25s ease; }
.search:focus { outline: none; border-color: rgba(185, 161, 255, .7); box-shadow: 0 0 0 4px rgba(98, 20, 255, .18), 0 8px 24px rgba(98, 20, 255, .18); }

/* Sign-in: drinks float around a glowing card. */
.hero { position: relative; overflow: hidden; }
.hero-card {
  position: relative; z-index: 2; border-radius: 16px; background: rgba(26, 21, 27, .78); backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(185, 161, 255, .15), 0 0 80px rgba(98, 20, 255, .15);
}
.hero-logo { display: block; width: 140px; height: auto; margin: 0 auto 1.4rem; }
.hero-mark { display: inline-block; animation: heroBob 3.2s ease-in-out infinite; filter: drop-shadow(0 10px 18px rgba(98, 20, 255, .45)); }
@keyframes heroBob { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-10px) rotate(6deg); } }
.hero-card h1 {
  font-weight: 800; font-size: 2rem; line-height: 1.15;
  background: linear-gradient(90deg, #fff, #D4C4FF, #B9A1FF, #fff); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 6s linear infinite;
}
@keyframes shimmer { to { background-position: 300% 0; } }
.floaters { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.floaters img {
  position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s); object-fit: contain;
  background: #fff; border-radius: 22%; padding: 6px; opacity: .9;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .5);
  animation: float var(--t) ease-in-out var(--d) infinite alternate;
}
@keyframes float {
  from { transform: translate(0, 0) rotate(var(--r0)); }
  to { transform: translate(var(--dx), var(--dy)) rotate(var(--r1)); }
}
@media (max-width: 720px) { .floaters img:nth-child(n+6) { display: none; } }

/* Voting: the tray and the mix get depth and gloss. */
.tray {
  background: rgba(26, 21, 27, .96); border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(185, 161, 255, .12);
}
.tray-head h1 { font-weight: 900; }
.mix { background: rgba(15, 11, 15, .6); box-shadow: inset 0 2px 10px rgba(0, 0, 0, .45), inset 0 0 0 1px var(--line); }
.mix-seg:not(.empty)::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .45) 50%, transparent 65%);
  transform: translateX(-130%); animation: segShine 6s ease-in-out infinite;
}
.mix-seg.c1:not(.empty)::after { animation-delay: .5s; }
.mix-seg.c2:not(.empty)::after { animation-delay: 1s; }
@keyframes segShine { 0%, 72% { transform: translateX(-130%); } 88%, 100% { transform: translateX(130%); } }
.mix-seg:not(.empty) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -10px 20px rgba(15, 11, 15, .12); }
.mix-seg.empty.next { animation: nextPulse 1.8s ease-in-out infinite; }
@keyframes nextPulse { 0%, 100% { border-color: rgba(185, 161, 255, .35); } 50% { border-color: rgba(185, 161, 255, .9); box-shadow: 0 0 22px rgba(98, 20, 255, .25); } }
.mix-img { transition: transform .3s var(--spring); }
.mix-seg:not(.empty):hover .mix-img { transform: scale(1.06) rotate(-3deg); }
.mix.dragging .mix-pct { text-shadow: 0 0 18px rgba(255, 255, 255, .7); }
.mix-div .grip { box-shadow: 0 4px 14px rgba(0, 0, 0, .45), 0 0 0 1px rgba(0, 0, 0, .15), 0 0 18px rgba(255, 255, 255, .35); }
.mix-hint.go { color: var(--lime); }
.status { font-weight: 700; display: inline-block; }
.status.ok { color: var(--good); }
.diet-row { background: rgba(15, 11, 15, .55); border-radius: 12px; }
.diet-row.needs { animation: dietPulse 2.2s ease-in-out infinite; }
@keyframes dietPulse { 0%, 100% { border-color: rgba(13, 254, 105, .35); } 50% { border-color: rgba(13, 254, 105, .95); box-shadow: 0 0 22px rgba(13, 254, 105, .18); } }
.diet-chip { animation: chipIn .45s var(--spring); }
@keyframes chipIn { from { transform: scale(.6); opacity: 0; } }

/* Drink cards: glass, 3D tilt with a light that follows the mouse. */
.grid > li.juice-pre { opacity: 0; transform: translateY(22px) scale(.95); transition: opacity .55s ease, transform .6s var(--spring); }
.grid > li.juice-pre.juice-in { opacity: 1; transform: none; }
.card {
  overflow: hidden; border-radius: 12px; background: rgba(26, 21, 27, .82); border-color: rgba(255, 255, 255, .07);
  transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px));
  transition: transform .35s var(--spring), border-color .2s ease, box-shadow .25s ease, opacity .2s ease;
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .25s ease;
  background: radial-gradient(260px circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, .18), transparent 60%);
}
.card:hover { --lift: -6px; transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px)); border-color: rgba(185, 161, 255, .45); box-shadow: 0 20px 40px rgba(0, 0, 0, .55), 0 0 0 1px rgba(185, 161, 255, .2); }
.card:hover::before { opacity: 1; }
.card:active { transition-duration: .1s; transform: perspective(700px) scale(.95); }
.card img { border-radius: 8px; transition: transform .4s var(--spring); }
.card:hover img { transform: scale(1.06); }
.card.picked {
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--accent-2), 0 0 0 6px rgba(98, 20, 255, .22), 0 18px 40px rgba(98, 20, 255, .25);
}
.card .badge { z-index: 3; box-shadow: 0 4px 12px rgba(0, 0, 0, .45), 0 0 0 3px rgba(255, 255, 255, .25); font-family: var(--display); font-size: .82rem; }
.grid.locked .card, .grid.locked .card:hover { transform: none; }

.deadline { border-radius: 12px; backdrop-filter: blur(10px); }
.deadline-clock { font-weight: 800; }

/* The diet sheet springs up. */
.sheet { background: rgba(15, 11, 15, .7); backdrop-filter: blur(8px); animation: fadeIn .25s ease; }
.sheet-inner { border-radius: 16px; background: rgba(26, 21, 27, .96); border: 1px solid rgba(255, 255, 255, .08); animation: sheetUp .5s var(--spring); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes sheetUp { from { transform: translateY(60px) scale(.95); opacity: 0; } }

/* Celebration banner and flying images. */
.juice-banner {
  position: fixed; left: 50%; top: 18px; z-index: 95; transform: translate(-50%, -140%);
  padding: .9rem 1.6rem; border-radius: 14px; text-align: center; color: #fff;
  background: linear-gradient(135deg, #230068, #6214FF 55%, #8E69FF);
  box-shadow: 0 20px 50px rgba(98, 20, 255, .45), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.juice-banner-title { font-size: 1.5rem; font-weight: 900; }
.juice-banner-sub { font-size: .9rem; opacity: .9; margin-top: .15rem; }
.juice-flyer {
  position: fixed; z-index: 92; pointer-events: none; object-fit: contain; background: #fff; border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .55), 0 0 30px rgba(185, 161, 255, .5);
}

/* Admin: tiles, tables and switches with a bit of life. */
.stat {
  border-radius: 12px; background: rgba(26, 21, 27, .8); backdrop-filter: blur(10px); border-color: rgba(255, 255, 255, .07);
  transition: transform .3s var(--spring), box-shadow .3s ease;
}
.stat:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(0, 0, 0, .5); }
.stat .v { font-weight: 800; background: linear-gradient(180deg, #fff, #D4C4FF); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .v small { -webkit-text-fill-color: var(--muted); }
.tablewrap { border-radius: 12px; background: rgba(26, 21, 27, .8); backdrop-filter: blur(10px); border-color: rgba(255, 255, 255, .07); }
.table th { background: rgba(15, 11, 15, .6); }
.table tbody tr { transition: background .15s ease; }
.table tbody tr:hover td { background: rgba(185, 161, 255, .1); }
.table .bar { background: linear-gradient(90deg, var(--violet), var(--accent)); border-radius: 4px; box-shadow: 0 0 10px rgba(98, 20, 255, .35); }
.table .bar.diet { background: linear-gradient(90deg, #00A860, var(--good)); box-shadow: 0 0 10px rgba(13, 254, 105, .35); }
.table.intro .bar { transform-origin: left; animation: barGrow .9s var(--spring) backwards; }
.table.intro tbody tr:nth-child(2) .bar { animation-delay: .06s; }
.table.intro tbody tr:nth-child(3) .bar { animation-delay: .12s; }
.table.intro tbody tr:nth-child(n+4) .bar { animation-delay: .18s; }
@keyframes barGrow { from { transform: scaleX(0); } }
.switch { transition: transform .25s var(--spring), border-color .2s ease; }
.switch:active { transform: scale(.92); }
.switch .knob { transition: transform .3s var(--spring), background .2s ease; }
.switch.is-on .knob { box-shadow: 0 0 10px rgba(13, 254, 105, .7); }
.switch.is-off .knob { box-shadow: 0 0 10px rgba(255, 45, 234, .6); }
.panel { animation: panelIn .45s cubic-bezier(.2, .9, .3, 1); }
@keyframes panelIn { from { opacity: 0; transform: translateY(12px); } }
.basket { border-radius: 16px; background: rgba(26, 21, 27, .96); backdrop-filter: blur(16px); animation: sheetUp .45s var(--spring); }

@media (prefers-reduced-motion: reduce) {
  .juice-bg i, .top::after, .hero-mark, .hero-card h1, .floaters img, .mix-seg::after, .mix-seg.empty.next,
  .diet-row.needs, .sheet, .sheet-inner, .panel, .basket, .table.intro .bar { animation: none !important; }
  .grid > li.juice-pre { opacity: 1; transform: none; }
  .card, .card:hover { transform: none !important; }
}

/* ==========================================================================
   TRAY, ONE ROW: the mix | diet card | reset + save. Slims down once it sticks.
   ========================================================================== */

.tray { padding: .85rem 1rem; transition: padding .35s ease, border-radius .35s ease; }
.tray-sentinel { height: 1px; margin-bottom: -1px; }
.tray-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .9rem; align-items: start; }
.mix-wrap { min-width: 0; }
.mix { margin-top: 0; transition: height .35s cubic-bezier(.3, .9, .3, 1); }

/* The diet pick: a square the same height as the mix. */
.diet-card {
  position: relative; width: 112px; height: 112px; padding: 0; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 16px; border: 2px dashed rgba(13, 254, 105, .45); background: rgba(15, 11, 15, .55);
  color: var(--text); font: inherit; cursor: pointer;
  transition: width .35s cubic-bezier(.3, .9, .3, 1), height .35s cubic-bezier(.3, .9, .3, 1), transform .25s var(--spring), border-color .2s ease, box-shadow .25s ease;
}
.diet-card:hover { transform: translateY(-2px); border-color: rgba(13, 254, 105, .9); box-shadow: 0 10px 24px rgba(0, 0, 0, .45), 0 0 20px rgba(13, 254, 105, .2); }
.diet-card:active { transform: scale(.95); }
.diet-card:disabled { cursor: default; transform: none; }
.diet-card:focus-visible { outline: 3px solid var(--good); outline-offset: 2px; }
.diet-card.needs { animation: dietPulse 2.2s ease-in-out infinite; }
.diet-card.chosen { border: 0; background: linear-gradient(160deg, #ABFFC7, #88FAAE); color: #0F0B0F; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6); }
.diet-card-tag {
  position: absolute; top: 6px; left: 6px; z-index: 2; padding: .1rem .42rem; border-radius: 999px;
  font-size: .68rem; font-weight: 800; background: rgba(13, 254, 105, .2); color: var(--good);
}
.diet-card.chosen .diet-card-tag { background: #00A860; color: #0F0B0F; }
.diet-card-body { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; width: 100%; height: 100%; padding: 1.3rem .4rem .4rem; }
.diet-card-img { width: 60px; height: 60px; object-fit: contain; border-radius: 12px; background: #fff; transition: width .35s ease, height .35s ease; animation: chipIn .45s var(--spring); }
.diet-card-name { max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: .68rem; font-weight: 800; line-height: 1.1; text-align: center; }
.diet-card-plus { font-family: var(--display); font-size: 1.8rem; font-weight: 900; line-height: 1; color: var(--good); }
.diet-card-cta { font-size: .72rem; font-weight: 700; line-height: 1.15; text-align: center; color: var(--muted); }

/* Reset above Save, the status under them, stacked on the right. */
.tray-side { width: 168px; display: flex; flex-direction: column; align-items: stretch; gap: .4rem; padding-top: .15rem; }
.tray-side .btn { width: 100%; padding: .8rem 1rem; }
.tray-side #mix-even { padding: .55rem 1rem; }
.tray-side .btn:disabled { opacity: .45; }
.tray-side .status { font-size: .8rem; line-height: 1.25; text-align: center; }
.tray-side .status:empty { display: none; }

/* Save before everything is filled in: clickable, but plainly not ready. */
.btn.primary.incomplete { filter: grayscale(.9) brightness(.72); box-shadow: none; text-shadow: none; }
.btn.primary.incomplete:hover { transform: none; box-shadow: none; background: linear-gradient(135deg, #6214FF 0%, #8E69FF 100%); }
.btn.primary.incomplete::before { display: none; }
/* Whatever is still missing flashes red while it shakes. */
.diet-card.nudge { border-color: var(--bad) !important; box-shadow: 0 0 0 3px rgba(255, 45, 234, .35), 0 0 24px rgba(255, 45, 234, .35); animation: none; }
.mix.nudge { box-shadow: inset 0 2px 10px rgba(0, 0, 0, .45), 0 0 0 2px var(--bad), 0 0 24px rgba(255, 45, 234, .35); }

/* Compact: once the tray is stuck under the header (desktop only). */
@media (min-width: 721px) {
  .tray.compact { padding: .45rem .7rem; border-radius: 16px; }
  .tray.compact .tray-row { align-items: center; }
  .tray.compact .mix { height: 60px; }
  .tray.compact .diet-card { width: 60px; height: 60px; border-radius: 12px; }
  .tray.compact .diet-card-tag, .tray.compact .diet-card-name, .tray.compact .diet-card-cta { display: none; }
  .tray.compact .diet-card-body { padding: .3rem; }
  .tray.compact .diet-card-img { width: 44px; height: 44px; border-radius: 9px; }
  .tray.compact .diet-card-plus { font-size: 1.5rem; }
  .tray.compact .mix-seg { padding: 0 .55rem; gap: .5rem; }
  .tray.compact .mix-img { width: 44px; height: 44px; border-radius: 10px; }
  .tray.compact .mix-pct { font-size: 1.35rem; }
  .tray.compact .mix-name { display: none; }
  .tray.compact .mix-seg[data-size="m"] { flex-direction: row; gap: .35rem; }
  .tray.compact .mix-seg[data-size="m"] .mix-img { width: 34px; height: 34px; }
  .tray.compact .mix-seg[data-size="m"] .mix-pct { font-size: 1.05rem; }
  .tray.compact .mix-seg.empty { margin: 4px 3px; flex-direction: row; gap: .4rem; }
  .tray.compact .mix-num { font-size: 1.05rem; }
  .tray.compact .mix-x { top: 3px; right: 3px; width: 18px; height: 18px; font-size: .65rem; }
  .tray.compact .mix-div { top: -5px; bottom: -5px; }
  .tray.compact .mix-div .grip { height: 38px; }
  .tray.compact .mix-callouts.has { height: 34px; }
  .tray.compact .mix-co { top: 8px; padding: .15rem .45rem .15rem .2rem; }
  .tray.compact .mix-co img { width: 20px; height: 20px; }
  .tray.compact .co-name { display: none; }
  .tray.compact .tray-side { padding-top: 0; justify-content: center; gap: .25rem; }
  .tray.compact .tray-side .btn { padding: .38rem .7rem; font-size: .82rem; }
  .tray.compact .tray-side #mix-even { padding: .22rem .7rem; font-size: .76rem; }
  .tray.compact .tray-side .status { display: none; }
}

/* Phones: the mix full width on top, then the diet card beside Reset + Save. */
@media (max-width: 720px) {
  .tray-row { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "mix mix" "diet side"; gap: .7rem; }
  .diet-card { grid-area: diet; width: 88px; height: 88px; }
  .tray-side { grid-area: side; width: auto; justify-content: center; padding-top: 0; }
  .mix-wrap { grid-area: mix; }
}

@media (prefers-reduced-motion: reduce) {
  .diet-card.needs, .diet-card-img { animation: none !important; }
}

/* ==========================================================================
   OPENING ANIMATION (static/intro.js). html.intro-pending is set before first
   paint by the inline script in the page head.
   ========================================================================== */

.intro { display: none; }
html.intro-pending body { overflow: hidden; }
html.intro-pending .intro {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, #230068 0%, #140838 55%, #0F0B0F 100%);
  color: #fff;
  -webkit-user-select: none;
  user-select: none;
}
/* Keep the app out of sight until the hand-over animates it in. */
html.intro-pending .top,
html.intro-pending main.vote { opacity: 0; }

.intro-gl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  display: block;
}
.intro-can {
  position: absolute;
  left: 50%;
  top: 50%;
  height: 54.6vh;           /* 0.52 of the viewport for the can, plus the viewBox margin */
  width: auto;
  aspect-ratio: 1.24 / 2.1;
  transform: translate(-50%, -50%);
  overflow: visible;
  filter: drop-shadow(0 0 24px rgba(185, 161, 255, .4));
}
.intro-outline {
  stroke: rgba(255, 255, 255, .85);
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-width: 2.5px;
}
.intro-pct {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% + 30vh);
  text-align: center;
  font: 800 15px/1 var(--body);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .7);
  transition: opacity .25s ease;
}
.intro-skip {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 4;
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .8);
  font: 700 13px/1 var(--body);
  letter-spacing: .04em;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.intro-skip:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.intro-black {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: #000;
  opacity: 0;
  pointer-events: none;
}
/* Drops on the lens (over the 3D view) and the bubbles that rise in the dark. */
.intro-lens,
.intro-fizz {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.intro-lens { z-index: 1; }
.intro-fizz { z-index: 3; }
/* After the hand-over the overlay stays up, click-through, until its bubbles
   have floated off and its fades are done. */
.intro.intro-live {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
  pointer-events: none;
}
/* The intro's breathing vignette (its opacity is driven by intro.js). */
.intro-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse 75% 70% at 50% 50%, rgba(0, 0, 0, 0) 45%, rgba(15, 11, 15, .55) 80%, rgba(10, 7, 10, .85) 100%);
}
/* Replay-the-intro link in the top bar (voting page). */
.replay-intro { display: inline-flex; align-items: center; gap: .25rem; white-space: nowrap; }
.replay-intro span[aria-hidden] { display: inline-block; transition: transform .45s var(--spring, cubic-bezier(.2,.9,.3,1.3)); }
.replay-intro:hover span[aria-hidden] { transform: rotate(-200deg); }
@media (max-width: 720px) { .replay-label { display: none; } }
@media (prefers-reduced-motion: reduce), (pointer: coarse), (max-width: 759px) { .replay-intro { display: none; } }   /* the intro never plays there (too heavy for phones and tablets) */
/* Intro fast-forward: VCR scanlines, tracking noise (drawn by intro.js) and
   the on-screen display. */
.intro-scan {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .3) 0 1px, rgba(0, 0, 0, 0) 1px 3px);
  transition: opacity .15s;
}
.intro.ff .intro-scan { opacity: 1; }
.intro-vcr { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; image-rendering: pixelated; }
.intro-osd {
  position: absolute; top: 5vh; left: 5vw; right: 5vw; z-index: 3;
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: 'VT323', ui-monospace, monospace; font-size: clamp(28px, 5vw, 56px); line-height: 1;
  color: #fff; letter-spacing: .06em; pointer-events: none; opacity: 0;
  text-shadow: 0 0 8px rgba(255, 255, 255, .55), 2px 0 rgba(255, 45, 234, .6), -2px 0 rgba(100, 172, 255, .6);
}
.intro.ff .intro-osd, .intro-osd.osd-play { opacity: 1; }
.intro.ff .osd-mode { animation: osdBlink 1s steps(2, jump-none) infinite; }
.intro-osd.osd-out { opacity: 0; transition: opacity .35s ease; }
.osd-counter { font-size: .7em; opacity: .9; }
@keyframes osdBlink { 50% { opacity: .2; } }

/* the CraveFX glyph where emojis used to be */
.hero-glyph { display: block; height: 1em; width: auto; }
.hub-glyph { display: block; width: 46%; height: auto; margin: auto; }
.juice-sound svg { display: block; }

/* drinks shown as 3D renders (drinkthumbs.js) sit on a soft dark-violet backdrop */
img[data-drink][data-three] { background: none; }
/* the drinks in the cards float, each to its own rhythm, and hold still while hovered */
@keyframes drinkFloat {
  0%, 100% { translate: 0 0; rotate: calc(var(--fl-r, 2deg) * -1); }
  50% { translate: 0 calc(var(--fl-y, 6px) * -1); rotate: var(--fl-r, 2deg); }
}
.card img.floaty { animation: drinkFloat var(--fl-d, 4s) ease-in-out var(--fl-delay, 0s) infinite; }
@media (prefers-reduced-motion: reduce) { .card img.floaty { animation: none; } }
/* the drinks on screen are drawn live (swaying, twirling) on one layer over
   the page, under the header, toolbars and sheets; each picture stays
   underneath, invisible, holding the space */
.drinks-layer { position: fixed; left: 0; top: 0; z-index: 2; pointer-events: none; }
.drinks-fizz { position: fixed; left: 0; top: 0; z-index: 2; pointer-events: none; }
.card img.live-under { opacity: 0; animation: none; }
/* a 3D drink in flight flies without the photo tile behind it */
.juice-flyer[data-three] { background: none !important; box-shadow: none !important; border: 0 !important; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .45)); }
.mix-img[data-three], .mix-co img[data-three], .diet-card-img[data-three] { background: none; }

/* the drinks float in the liquid of the page: the cards are invisible until
   hovered (or focused), when they fade back in; a picked drink keeps its ring */
.card {
  background: transparent; border-color: transparent; box-shadow: none;
  transition: transform .35s var(--spring), background-color .3s ease, border-color .3s ease, box-shadow .3s ease, opacity .2s ease;
}
.card:hover, .card:focus-visible { background: rgba(26, 21, 27, .82); }
.grid.locked .card:hover { background: transparent; border-color: transparent; }
