/* ─── Cocktail Pledge — styles ─────────────────────────────────────────── */
:root {
  --bg: #160d1f;
  --bg-2: #1f1430;
  --card: #271a3a;
  --card-2: #2f2046;
  --ink: #f6eefc;
  --muted: #b39fc9;
  --line: #3c2c54;
  --accent: #ff5d8f;     /* cocktail pink */
  --accent-2: #ffd166;   /* citrus */
  --mint: #4fe0b0;
  --danger: #ff7a7a;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(255,93,143,.25), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(255,209,102,.16), transparent 55%),
    var(--bg);
  line-height: 1.55;
}

h1, h2, h3 { font-family: "Fraunces", Georgia, serif; line-height: 1.1; margin: 0; }
a { color: inherit; }
.muted { color: var(--muted); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px 60px; }

/* ─── Gate (shared-password login) ──────────────────────────────────────── */
.gate {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 500px at 70% 0%, rgba(255,93,143,.3), transparent 60%),
    radial-gradient(700px 400px at 0% 100%, rgba(255,209,102,.18), transparent 55%),
    var(--bg);
}
.gate-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  padding: 38px 32px; text-align: center; max-width: 380px; width: 100%; box-shadow: var(--shadow);
}
.gate-emoji { font-size: 40px; }
.gate-card h1 { font-size: 30px; margin: 10px 0 6px; }
.gate-card form { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.gate-card input {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; color: var(--ink); font-size: 16px; font-family: inherit; text-align: center;
}
.gate-card input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.gate-card .btn { justify-content: center; }
body.locked { overflow: hidden; }
/* While booting (before JS decides) hide the app so nothing flashes pre-gate. */
body.booting .hero, body.booting .wrap, body.booting .footer { display: none; }

/* ─── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  padding: 70px 20px 50px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent);
}
.hero-inner { max-width: 760px; margin: 0 auto; }
.kicker {
  text-transform: uppercase; letter-spacing: .25em; font-size: 12px;
  color: var(--accent-2); margin: 0 0 14px; font-weight: 700;
}
.title { font-size: clamp(40px, 8vw, 76px); font-weight: 900; letter-spacing: -.02em; }
.tagline { font-size: clamp(17px, 3.5vw, 22px); color: var(--muted); margin: 14px 0 0; }
.blurb { margin: 26px auto 0; max-width: 620px; text-align: left; }
.blurb p { margin: 0 0 12px; color: #ddd0ec; }

.stats { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 30px 0 6px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 18px; min-width: 96px;
}
.stat b { display: block; font-size: 26px; font-family: "Fraunces", serif; color: var(--accent-2); }
.stat span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px;
  padding: 12px 22px; font-weight: 600; font-size: 15px;
  cursor: pointer; text-decoration: none; transition: transform .08s ease, filter .15s ease;
  font-family: inherit;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: linear-gradient(135deg, var(--accent), #ff8a5d); color: #2a0d1a; box-shadow: var(--shadow); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--card); }
.btn-small { padding: 8px 14px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ─── Sections ──────────────────────────────────────────────────────────── */
.section { padding: 52px 0 8px; }
.section-head { margin-bottom: 26px; }
.section-head h2 { font-size: clamp(26px, 5vw, 36px); }
.section-head .muted { margin: 8px 0 0; max-width: 640px; }

/* ─── How it works ──────────────────────────────────────────────────────── */
.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 36px 0 8px; }
.how-step {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; gap: 14px; align-items: flex-start;
}
.how-step span {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #2a0d1a; font-weight: 800;
  display: grid; place-items: center; font-family: "Fraunces", serif;
}
.how-step p { margin: 0; font-size: 14.5px; color: #ddd0ec; }

/* ─── Cocktails ─────────────────────────────────────────────────────────── */
.cocktail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.cocktail {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 10px; transition: opacity .2s, border-color .2s;
}
.cocktail.locked { opacity: .82; }
.cocktail.unlocked { border-color: var(--mint); box-shadow: 0 0 0 1px rgba(79,224,176,.3), var(--shadow); }
.cocktail.requested { border-style: dashed; }
.cocktail-top { display: flex; align-items: center; gap: 10px; }
.cocktail-emoji { font-size: 28px; line-height: 1; }
.cocktail h3 { font-size: 19px; flex: 1; }
.lock-badge { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.cocktail.unlocked .lock-badge { color: var(--mint); }
.cocktail .desc { color: var(--muted); font-size: 13.5px; margin: 0; }
.cocktail .tag {
  align-self: flex-start; font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 2px 9px;
}
.progress { height: 7px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--mint)); transition: width .35s ease; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ing-chip {
  font-size: 12.5px; border-radius: 999px; padding: 5px 11px; font-family: inherit;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--ink);
}
.ing-chip.done { color: var(--mint); border-color: rgba(79,224,176,.4); }
.ing-chip.todo { cursor: pointer; border-color: var(--accent); color: var(--ink); }
.ing-chip.todo:hover { background: var(--accent); color: #2a0d1a; }
.adj-line { font-size: 12px; color: var(--muted); margin: 2px 0 0; }

/* ─── Bottle board ──────────────────────────────────────────────────────── */
.bottle-uses.pop { color: var(--mint); font-weight: 600; }
.bottle-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.bottle {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden;
}
.bottle.claimed { background: linear-gradient(180deg, var(--card-2), var(--card)); border-color: var(--mint); }
.bottle-top { display: flex; align-items: center; gap: 10px; }
.bottle-emoji { font-size: 26px; }
.bottle-name { font-weight: 600; font-size: 16px; }
.bottle-cat { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.bottle-uses { font-size: 12px; color: var(--accent-2); }
.bottle-claim { margin-top: auto; }

.named {
  background: var(--bg-2); border-radius: 12px; padding: 10px 12px; border: 1px dashed var(--mint);
}
.named.host-supplied { border-color: var(--accent-2); }
.named.host-supplied .label-tag { color: var(--accent-2); }
.named .label-tag { font-weight: 700; color: var(--mint); font-size: 15px; }
.named .by { font-size: 12.5px; color: var(--muted); }
.named-actions { display: flex; gap: 8px; margin-top: 8px; }
.link-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 12px; text-decoration: underline; font-family: inherit; padding: 0; }
.link-btn:hover { color: var(--accent); }

.loading { color: var(--muted); padding: 20px 0; }

.card-soft {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  padding: 30px; margin-top: 40px;
}
.fine-print { font-size: 13px; color: var(--muted); margin: 6px 0 0; }

/* ─── Shopping list ─────────────────────────────────────────────────────── */
.shopping-list { margin-top: 14px; }
.shop-items { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.shop-items li {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px;
}

/* ─── Claim unlock preview + reminders ──────────────────────────────────── */
.unlock-preview {
  background: var(--bg-2); border: 1px dashed var(--mint); border-radius: 12px;
  padding: 10px 14px; font-size: 13.5px; margin-top: 6px; color: #ddd0ec;
}
.pledge-reminder { font-size: 13px; color: var(--muted); background: var(--bg-2); border-radius: 10px; padding: 10px 12px; margin: 4px 0 0; }

.request-cta { text-align: center; margin: 28px 0 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }

.request-modal { max-width: 720px; }
.catalog-results {
  display: grid; gap: 8px; max-height: 280px; overflow-y: auto; padding-right: 2px;
}
.catalog-option {
  width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  text-align: left; background: var(--bg-2); color: var(--ink); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; cursor: pointer; font-family: inherit;
}
.catalog-option:hover, .catalog-option.selected { border-color: var(--accent); background: #2c1c42; }
.catalog-option.too-many { opacity: .82; }
.catalog-emoji { font-size: 22px; }
.catalog-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.catalog-main strong, .catalog-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catalog-main small { color: var(--muted); font-size: 12px; }
.catalog-badge {
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px;
  color: var(--accent-2); font-size: 11px; white-space: nowrap;
}
.catalog-preview {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; display: flex; flex-direction: column; gap: 12px;
}
.catalog-preview-head { display: flex; gap: 12px; align-items: flex-start; }
.catalog-preview-emoji { font-size: 28px; line-height: 1; }
.catalog-preview h4 { font-size: 18px; margin: 0 0 4px; }
.catalog-preview p { color: var(--muted); margin: 0; font-size: 13.5px; }
.preview-group { display: grid; gap: 7px; }
.preview-group > span {
  color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; font-weight: 700;
}
.preview-group > div { display: flex; flex-wrap: wrap; gap: 6px; }
.preview-chip {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; font-size: 12.5px;
}
.preview-group.adds .preview-chip { border-color: rgba(79,224,176,.55); color: var(--mint); }
.catalog-empty { margin: 0; padding: 12px; background: var(--bg-2); border-radius: 10px; }

/* ─── Footer ────────────────────────────────────────────────────────────── */
.footer { text-align: center; color: var(--muted); padding: 40px 20px 60px; border-top: 1px solid var(--line); margin-top: 30px; }
.footer-link { color: var(--muted); margin-left: 8px; }
.footer-link:hover { color: var(--accent); }

body.route-active .hero,
body.route-active .wrap,
body.route-active .footer { display: none; }

.route-page {
  min-height: 100vh; padding: 44px 20px 70px; max-width: 1180px; margin: 0 auto;
}
.route-head { max-width: 760px; margin-bottom: 28px; }
.route-head h1 {
  font-family: "Fraunces", serif; font-size: clamp(34px, 7vw, 72px); line-height: .95; margin: 12px 0;
}
.route-head .link-btn { display: inline-flex; margin-bottom: 20px; color: var(--accent-2); }

.bar-labels {
  display: flex; gap: 18px; overflow-x: auto; padding: 10px 0 26px; scroll-snap-type: x proximity;
}
.bar-card {
  flex: 0 0 min(330px, 82vw); scroll-snap-align: start;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow);
}
.bar-card.compact { flex-basis: min(250px, 76vw); padding: 12px; }
.bar-art {
  aspect-ratio: 3 / 4; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 14px;
}
.bar-art img { width: 100%; height: 100%; object-fit: cover; }
.bar-card h3 { font-size: 22px; margin-bottom: 4px; }
.bar-card.compact h3 { font-size: 18px; }
.bar-card p { color: var(--muted); margin: 0; font-size: 13.5px; }
.label-rail { margin: -6px -4px 0; padding-inline: 4px; }
.label-placeholder {
  width: 82%; background: #fffdf6; color: #1c1326; border: 2px solid #e7dcc4; border-radius: 12px;
  text-align: center; padding: 24px 18px; transform: rotate(-1deg);
}
.label-placeholder b { display: block; font-family: "Fraunces", serif; font-size: 26px; margin: 8px 0; }
.bar-card.compact .label-placeholder b { font-size: 20px; }
.label-placeholder span { color: #6b5b78; font-size: 13px; }

.admin-gate, .admin-toolbar, .admin-section {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; max-width: 440px;
}
.admin-gate { display: flex; flex-direction: column; gap: 12px; }
.admin-gate label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.admin-gate input,
.admin-bottle-form input,
.admin-bottle-form select {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; color: var(--ink); font-size: 15px; font-family: inherit;
}
.admin-toolbar { max-width: none; display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.admin-section { max-width: none; margin-bottom: 16px; }
.admin-section-head { margin-bottom: 14px; }
.admin-section-head h2 { font-size: 25px; margin-bottom: 4px; }
.admin-section-head .muted { margin: 0; }
.admin-bottle-form {
  display: grid; grid-template-columns: minmax(190px, 1.5fr) minmax(130px, .9fr) 86px 100px auto;
  gap: 10px; align-items: end; margin-bottom: 16px;
}
.admin-bottle-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.admin-bottle-form .form-error { grid-column: 1 / -1; margin: -2px 0 0; }
.admin-bottle-list { display: grid; gap: 8px; }
.admin-bottle-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px;
}
.admin-bottle-row.claimed { border-color: rgba(79,224,176,.48); }
.admin-bottle-row.host { border-color: rgba(255,209,102,.58); }
.admin-bottle-main { min-width: 0; display: flex; gap: 10px; align-items: center; }
.admin-bottle-main h3 { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-bottle-main p { color: var(--muted); font-size: 12.5px; margin: 2px 0 0; }
.admin-bottle-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.label-queue { display: grid; gap: 14px; }
.queue-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px;
  display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 16px;
}
.queue-card h3 { font-size: 21px; margin-bottom: 4px; }
.queue-meta { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.queue-prompt {
  width: 100%; min-height: 118px; resize: vertical; background: var(--bg-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; font: 13px/1.45 "Inter", system-ui, sans-serif;
}
.queue-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.queue-actions select, .queue-actions input[type=file] {
  background: var(--bg-2); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 9px; font-family: inherit;
}
.queue-media { display: grid; gap: 10px; }
.queue-thumb {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; min-height: 120px;
  display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--muted); font-size: 13px;
}
.queue-thumb img { width: 100%; height: 100%; object-fit: cover; }
.status-pill {
  display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 9px; color: var(--accent-2); font-size: 12px; margin-left: 6px;
}

/* ─── Modals ────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(8,4,14,.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal[role], .modal {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 26px; width: 100%; max-width: 440px; position: relative; box-shadow: var(--shadow);
  max-height: 92vh; overflow-y: auto;
}
.modal h3 { font-size: 24px; }
.modal-close { position: absolute; top: 14px; right: 14px; background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.modal-close:hover { color: var(--ink); }
.modal form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.modal label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.modal input {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; color: var(--ink); font-size: 15px; font-family: inherit;
}
.modal input[type=file] { padding: 10px; }
.modal input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.form-error { color: var(--danger); font-size: 13px; margin: 0; }

/* ─── Label ─────────────────────────────────────────────────────────────── */
.label-modal { max-width: 420px; }
.generated-label-preview {
  display: block; width: 100%; max-height: 62vh; object-fit: contain;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; margin: 18px 0;
}
.label {
  background: #fffdf6; color: #1c1326; border-radius: 14px; padding: 28px 24px 24px;
  margin: 18px 0; text-align: center; position: relative; box-shadow: var(--shadow);
  border: 2px solid #e7dcc4;
}
.label-tape { position: absolute; top: -12px; left: 50%; transform: translateX(-50%) rotate(-2deg); width: 120px; height: 22px; background: rgba(255,93,143,.45); border-radius: 3px; }
.label-kicker { text-transform: uppercase; letter-spacing: .2em; font-size: 11px; color: #b07; margin: 0; font-weight: 700; }
.label-name { font-family: "Fraunces", serif; font-weight: 900; font-size: 30px; margin: 8px 0 2px; color: #1c1326; }
.label-of { font-size: 14px; color: #6b5b78; margin: 0; }
.label-by { font-size: 15px; margin: 12px 0 0; color: #1c1326; font-weight: 600; }
.label-note { font-style: italic; color: #6b5b78; font-size: 13px; margin: 8px 0 0; }
.label-event { font-size: 12px; color: #9a8aa6; margin: 14px 0 0; border-top: 1px dashed #d8cbb6; padding-top: 10px; }

/* ─── Toast ─────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--mint); color: #08231a; padding: 12px 20px; border-radius: 999px;
  font-weight: 600; box-shadow: var(--shadow); z-index: 60; font-size: 14px;
}
.toast.error { background: var(--danger); color: #2a0808; }

/* ─── Print ─────────────────────────────────────────────────────────────── */
@media print {
  body * { visibility: hidden; }
  #bottle-label, #bottle-label *, #generated-label-preview { visibility: visible; }
  #bottle-label, #generated-label-preview {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 320px; max-height: 90vh; box-shadow: none; border: 2px solid #333;
  }
}

@media (max-width: 760px) {
  .queue-card { grid-template-columns: 1fr; }
  .admin-toolbar { flex-wrap: wrap; }
  .admin-bottle-form { grid-template-columns: 1fr 1fr; }
  .admin-bottle-form button, .admin-bottle-form .form-error { grid-column: 1 / -1; }
  .admin-bottle-row { grid-template-columns: 1fr; align-items: start; }
  .admin-bottle-row .status-pill { width: max-content; margin-left: 0; }
  .admin-bottle-actions { justify-content: flex-start; }
}
