:root {
  --bg: #0f0c1a;
  --panel: #1a1528;
  --panel-2: #231c36;
  --ink: #f4effc;
  --muted: #a69cc0;
  --accent: #ff5fa2;
  --accent-soft: rgba(255, 95, 162, 0.16);
  --amber: #ffb547;
  --green: #5ee6a8;
  --green-soft: rgba(94, 230, 168, 0.14);
  --border: #2e2645;
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(255, 95, 162, 0.18), transparent 60%),
    radial-gradient(800px 500px at 95% 0%, rgba(255, 181, 71, 0.12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.45;
}

a { color: var(--amber); }

.hero {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 30px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand { flex-shrink: 0; display: block; }
.brand img { display: block; height: 130px; width: auto; border-radius: 16px; box-shadow: 0 0 32px rgba(178, 92, 255, 0.35); }
.hero h1 {
  margin: 0 0 6px;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  background: linear-gradient(90deg, var(--accent), var(--amber));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p { margin: 0; color: var(--muted); }
@media (max-width: 700px) {
  .hero { flex-direction: column; text-align: center; gap: 16px; }
  .brand img { height: 96px; }
}

.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 28px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px 40px;
  align-items: start;
}
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
@media (max-width: 900px) { .panel { position: static; max-height: none; } }

.field { margin-bottom: 22px; }
.field > label, .label { display: block; font-weight: 600; margin-bottom: 8px; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.hint { margin: -4px 0 8px; font-size: 0.8rem; color: var(--muted); }
.hint:empty { display: none; }
.hint.center { text-align: center; margin: 8px 0 0; }

.link-btn {
  border: 0;
  background: none;
  color: var(--amber);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
}
.link-btn:disabled { opacity: 0.6; cursor: progress; }

.chip-input {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  cursor: text;
}
.chip-input:focus-within { border-color: var(--accent); }
.chip-input input {
  flex: 1;
  min-width: 140px;
  border: 0;
  outline: 0;
  font: inherit;
  padding: 4px;
  background: transparent;
  color: var(--ink);
}

.chips { display: contents; list-style: none; }
.chips li {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 3px 4px 3px 10px;
  border-radius: 999px;
  font-size: 0.9rem;
}
.chips button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 4px;
}

.quick-add { margin-top: 10px; font-size: 0.85rem; color: var(--muted); }
.quick-add > div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.quick-add button {
  border: 1px dashed var(--border);
  background: none;
  border-radius: 999px;
  padding: 3px 10px;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}
.quick-add button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.quick-add button:disabled { opacity: 0.3; cursor: default; }

.toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.toggles label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  user-select: none;
}
.toggles label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.toggles input { position: absolute; opacity: 0; pointer-events: none; }
.toggles label:has(input:focus-visible) { outline: 2px solid var(--amber); }

select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: var(--panel-2);
  color: var(--ink);
}

.primary, .surprise {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.primary { border: 1px solid var(--accent); background: transparent; color: var(--accent); }
.surprise {
  border: 0;
  font-size: 1.05rem;
  background: linear-gradient(90deg, var(--accent), #ff7b6b);
  color: #fff;
  box-shadow: 0 6px 24px rgba(255, 95, 162, 0.3);
}
.primary:hover, .surprise:hover { filter: brightness(1.1); }

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 18px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

.summary { margin: 0 0 16px; color: var(--muted); }
.summary:empty { display: none; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45); }

.card.featured { grid-column: 1 / -1; border-color: rgba(255, 95, 162, 0.5); }
@media (min-width: 720px) {
  .card.featured { flex-direction: row; }
  .card.featured .photo { width: 46%; aspect-ratio: auto; min-height: 340px; flex-shrink: 0; }
  .card.featured .body { padding: 24px 26px; }
  .card.featured .title { font-size: 1.6rem; }
}
.card.featured .title::before {
  content: "Top pick";
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}

.photo {
  position: relative;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #3a1f4d, #1d2a4a);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.photo .emoji { font-size: 4rem; }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 12, 26, 0.65), transparent 40%);
  pointer-events: none;
}
.photo .strength {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(15, 12, 26, 0.75);
  backdrop-filter: blur(6px);
}

.body { padding: 16px 18px 18px; }
.title { margin: 0 0 6px; font-size: 1.15rem; }
.meta { margin: 0 0 8px; font-size: 0.82rem; color: var(--muted); }
.match { margin: 0; font-weight: 600; color: var(--green); font-size: 0.92rem; }
.missing { margin: 2px 0 0; font-size: 0.88rem; color: var(--amber); }
.missing:empty, .match:empty { display: none; }

.badges { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.badges li {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
}
.badges li.hit { background: var(--green-soft); color: var(--green); font-weight: 600; }

details summary { cursor: pointer; font-weight: 600; font-size: 0.92rem; }
.ings { list-style: none; padding: 0; margin: 10px 0; font-size: 0.88rem; }
.ings li { padding: 3px 0; border-bottom: 1px dashed var(--border); display: flex; gap: 8px; }
.ings li::before { content: "○"; color: var(--amber); }
.ings li.have::before { content: "✓"; color: var(--green); }
.ings li.pantry { color: var(--muted); }
.ings li.pantry::before { content: "·"; color: var(--muted); }
.ings .qty { margin-left: auto; color: var(--muted); white-space: nowrap; }
.steps { margin: 0; padding-left: 20px; font-size: 0.9rem; }
.steps li { margin-bottom: 4px; }

.card.about {
  grid-column: 1 / -1;
  border-color: rgba(255, 181, 71, 0.4);
  background: linear-gradient(135deg, rgba(255, 95, 162, 0.12), rgba(255, 181, 71, 0.08)), var(--panel);
}
.card.about:hover { transform: none; box-shadow: none; }
.card.about .body { padding: 26px 28px; max-width: 820px; }
.card.about p { margin: 0 0 12px; font-size: 1.045rem; }
.card.about .title { font-size: 1.525rem; margin-bottom: 12px; }
.card.about h3 { margin: 20px 0 8px; font-size: 1.175rem; }
.eyebrow { margin: 0 0 4px; font-size: 0.845rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.promises { margin: 0 0 12px; font-size: 1.045rem; }
.card.about .promises summary { cursor: pointer; list-style: none; font-weight: 400; font-size: inherit; }
.promises summary::-webkit-details-marker { display: none; }
.more-link::before { content: "more…"; color: var(--amber); text-decoration: underline; }
.promises[open] .more-link::before { content: "less"; }
.promises ul { margin: 8px 0 0; padding-left: 20px; font-size: 1.025rem; }
.promises li { margin-bottom: 4px; }
.pay { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.pay a {
  padding: 8px 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #ff7b6b);
  color: #fff;
  font-weight: 600;
  font-size: 1.005rem;
  text-decoration: none;
}
.pay a:hover { filter: brightness(1.1); }
.card.about .fine { font-size: 0.925rem; color: var(--muted); }

.credits { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 0 20px 40px; }
