/* Our Recipes – sticker-shop look: pink frame, dark dotted panel,
   chunky pink & yellow headings, yellow pill buttons, round stickers. */
:root {
  --frame: #f6bfd0;           /* pink page around the panel */
  --panel: #19181b;           /* the dark board */
  --surface: #232227;         /* cards on the board */
  --surface-2: #2d2b31;       /* inputs, wells */
  --text: #f4eee6;
  --muted: #c6bec2;
  --line: #3a373e;
  --pink: #f7b6cc;
  --yellow: #f6c244;
  --coral: #f06a63;
  --green: #3fb56c;
  --blue: #6cc5e8;
  --accent: var(--pink);
  --accent-deep: var(--pink);
  --accent-soft: rgba(247, 182, 204, .14);
  --ink: #1b1a1d;             /* text on yellow / pink */
  --good: #6fd497;
  --star: var(--yellow);
  --radius: 22px;
  --display: "Luckiest Guy", "Arial Black", system-ui, sans-serif;
  --label: "Barlow Semi Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: Barlow, system-ui, sans-serif;
  color-scheme: dark;         /* the board is dark in both modes; the pink frame stays pink */
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--frame);
  color: var(--text);
  font: 17px/1.55 var(--body);
  min-height: 100vh;
  padding: 12px 10px calc(92px + env(safe-area-inset-bottom));
}
img { max-width: 100%; display: block; }
a { color: var(--pink); }
::selection { background: var(--pink); color: var(--ink); }

/* ---------- the dark dotted board ---------- */
.frame {
  position: relative; max-width: 1120px; margin: 0 auto; min-height: calc(100vh - 24px);
  border-radius: 28px;
  /* small, faint confetti dots: texture, not noise */
  background:
    radial-gradient(circle, rgba(247, 182, 204, .32) .9px, transparent 1.4px) 0 0 / 52px 52px,
    radial-gradient(circle, rgba(246, 194, 68, .28) .9px, transparent 1.4px) 26px 26px / 52px 52px,
    radial-gradient(circle, rgba(63, 181, 108, .24) .9px, transparent 1.4px) 13px 39px / 52px 52px,
    radial-gradient(circle, rgba(108, 197, 232, .24) .9px, transparent 1.4px) 39px 13px / 52px 52px,
    var(--panel);
  box-shadow: 0 20px 60px rgba(60, 20, 35, .25);
}
@media (min-width: 900px) {
  body { padding: 56px 72px 56px; }
  .frame { min-height: calc(100vh - 112px); border-radius: 36px; }
}

/* ---------- stickers ---------- */
.sticker { display: none; }
.sticker svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .25)); }
.ring-text { font: 22px var(--display); letter-spacing: 1.5px; }
@media (min-width: 900px) {
  .sticker { display: block; position: absolute; z-index: 5; }
  .sticker-brand {
    width: 190px; height: 190px; left: -64px; top: -48px; transform: rotate(-10deg);
    transition: transform .4s cubic-bezier(.34, 1.56, .64, 1);
  }
  .sticker-brand:hover { transform: rotate(-2deg) scale(1.06); }
  .sticker-pot { width: 170px; height: 170px; right: -58px; top: 260px; transform: rotate(12deg); pointer-events: none; }
}
@media (min-width: 900px) and (prefers-reduced-motion: no-preference) {
  .sticker-brand svg text, .sticker-pot svg text { transform-origin: 120px 120px; animation: spinText 30s linear infinite; }
}
@keyframes spinText { to { transform: rotate(360deg); } }

/* ---------- header + nav ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 6px; }
.brand-mobile { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mobile img { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--yellow); }
.brand-mobile span { font: 1.45rem/1 var(--display); color: var(--pink); letter-spacing: .5px; padding-top: 4px; }
.logout { font: 500 .85rem var(--label); text-transform: uppercase; letter-spacing: 1.5px; }
.account-links { display: flex; align-items: center; gap: 12px; }
.account-link {
  font: 600 .82rem var(--label); text-transform: uppercase; letter-spacing: 1.2px; text-decoration: none;
  color: var(--ink); background: var(--pink); border-radius: 999px; padding: 5px 11px; white-space: nowrap;
  max-width: 140px; overflow: hidden; text-overflow: ellipsis;
}

.tabs {
  position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--panel); border: 2px solid var(--pink); border-radius: 26px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.tabs a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 4px; padding: 7px 0 8px; border-radius: 20px;
  font: 500 .72rem var(--label); text-transform: uppercase; letter-spacing: 1px; color: var(--muted); text-decoration: none;
}
.tabs a span { font-size: 1.2rem; filter: grayscale(.6); }
.tabs a.active { background: var(--yellow); color: var(--ink); }
.tabs a.active span { filter: none; }

@media (min-width: 900px) {
  .brand-mobile { display: none; }
  .topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 30px 30px 0 150px; }
  .topbar .tabs { grid-column: 2; }
  .account-links { grid-column: 3; justify-self: end; }
  .tabs {
    position: static; display: flex; gap: clamp(16px, 2.6vw, 34px); background: none; border: 0; box-shadow: none; border-radius: 0;
  }
  .tabs a { flex-direction: row; margin: 0; padding: 4px 0; border-radius: 0; font-size: 1.05rem; letter-spacing: 1.5px; color: var(--pink); border-bottom: 2px solid transparent; }
  .tabs a span { display: none; }
  .tabs a:hover { color: var(--text); }
  .tabs a.active { background: none; color: var(--yellow); border-bottom-color: var(--yellow); }
}

.view { max-width: 980px; margin: 0 auto; padding: 14px 16px 40px; }

/* Text that sits straight on the dotted board gets a soft halo in the board's own color,
   which hides the dots right around the letters. */
.topbar, .view {
  text-shadow: 0 0 2px var(--panel), 0 0 4px var(--panel), 0 0 8px var(--panel), 0 0 12px var(--panel);
}
/* ...but not on things that already have their own solid background */
.card, .day, dialog, .btn, .chip, .cook-pill, .servings-chip, .stepper, .scaled-note, .dropzone,
.tabs a.active, input, textarea, select, .steps li::before, .recipe-card .pic, .hero {
  text-shadow: none;
}
@media (max-width: 899px) { .tabs { text-shadow: none; } }
@media (min-width: 900px) {
  .view { padding: 18px 40px 60px; }
  .back-link { display: inline-block; margin-left: clamp(0px, 190px - 8vw, 130px); }
}

/* ---------- type ---------- */
h1, h2, h3 { margin: 0 0 .45em; line-height: 1.05; font-weight: 400; }
h1 { font: clamp(2.2rem, 7vw, 3.6rem)/1 var(--display); color: var(--pink); letter-spacing: .5px; text-transform: uppercase; }
h2 { font: 1.55rem/1.1 var(--display); color: var(--yellow); letter-spacing: .5px; }
h3 { font: 600 1.1rem/1.2 var(--label); text-transform: uppercase; letter-spacing: 1px; color: var(--text); }
h1 .alt { color: var(--yellow); display: block; }
.page-hero { text-align: center; margin: 10px 0 8px; }
.page-hero h1 { font-size: clamp(2.6rem, 11vw, 5.4rem); margin-bottom: .2em; transform: rotate(-1.5deg); }
.page-hero p, .tagline {
  font: 500 .95rem/1.4 var(--label); text-transform: uppercase; letter-spacing: 1.6px; color: var(--text); opacity: .85; margin: 0;
}
.page-hero p a { color: var(--yellow); }

/* ---------- building blocks ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.center { justify-content: center; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hint { color: var(--muted); font-size: .92rem; margin: 0; }

label { font: 600 .85rem var(--label); text-transform: uppercase; letter-spacing: 1.2px; display: block; margin-bottom: 6px; color: var(--pink); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], textarea, select {
  width: 100%; font: inherit; color: var(--text);
  background: var(--surface-2); border: 2px solid transparent; border-radius: 16px; padding: 11px 14px;
  transition: border-color .2s;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
textarea { resize: vertical; min-height: 84px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--yellow); }
.check { display: flex; gap: 10px; align-items: center; font: 400 1rem var(--body); text-transform: none; letter-spacing: 0; color: var(--text); margin: 0; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--yellow); }

.btn {
  font: 600 .9rem var(--label); text-transform: uppercase; letter-spacing: 1.2px; cursor: pointer;
  border: 2px solid var(--line); background: transparent; color: var(--text);
  padding: 9px 18px; border-radius: 999px; display: inline-flex; gap: 6px; align-items: center; justify-content: center;
  text-decoration: none; transition: transform .15s cubic-bezier(.34, 1.56, .64, 1), border-color .2s, background .2s;
}
.btn:hover { border-color: var(--pink); color: var(--pink); }
.btn:active { transform: scale(.95); }
.btn.primary {
  font: 1.2rem/1 var(--display); letter-spacing: .8px; padding: 14px 30px 11px;
  background: var(--yellow); color: var(--ink); border-color: var(--yellow);
  box-shadow: 0 5px 0 #c99a2a;
}
.btn.primary:hover { color: var(--ink); transform: translateY(-2px); box-shadow: 0 7px 0 #c99a2a; }
.btn.primary:active { transform: translateY(3px); box-shadow: 0 2px 0 #c99a2a; }
.btn.small { padding: 6px 13px; font-size: .8rem; }
.btn.primary.small { font-size: 1rem; padding: 10px 18px 8px; }
.btn.danger { color: var(--coral); border-color: rgba(240, 106, 99, .4); }
.btn:disabled { opacity: .6; cursor: progress; }
.link-btn { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; }
.icon-btn { background: none; border: 0; cursor: pointer; font-size: 1.2rem; padding: 4px 6px; color: var(--muted); }
.icon-btn:hover { color: var(--coral); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: var(--pink); color: var(--ink); border-radius: 999px; padding: 3px 12px;
  font: 600 .78rem var(--label); text-transform: uppercase; letter-spacing: 1px;
  display: inline-flex; align-items: center; gap: 4px;
}
.chips .chip:nth-child(4n+2) { background: var(--yellow); }
.chips .chip:nth-child(4n+3) { background: var(--green); }
.chips .chip:nth-child(4n+4) { background: var(--blue); }
.chip button { background: none; border: 0; cursor: pointer; color: var(--ink); padding: 0 0 0 2px; font-size: 1rem; line-height: 1; opacity: .7; }
.chips .chip.have { background: var(--green); }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); font: 500 1rem var(--label); text-transform: uppercase; letter-spacing: 1.2px; }
.empty .big { font-size: 2.4rem; }
.empty a { color: var(--yellow); }

/* ---------- recipe grid (like the sticker products) ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 14px; }
@media (min-width: 760px) { .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 34px 26px; } }
.recipe-card { text-decoration: none; color: inherit; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.recipe-card .pic {
  width: 100%; aspect-ratio: 4 / 5; border-radius: 18px; overflow: hidden; background: var(--surface-2);
  display: grid; place-items: center; font-size: 2.6rem;
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1);
}
.recipe-card:nth-child(odd):hover .pic { transform: rotate(-2deg) scale(1.02); }
.recipe-card:nth-child(even):hover .pic { transform: rotate(2deg) scale(1.02); }
.recipe-card .pic img { width: 100%; height: 100%; object-fit: cover; }
.recipe-card .title { font: 500 .98rem/1.25 var(--label); text-transform: uppercase; letter-spacing: 1.2px; }
.recipe-card .fave { color: var(--coral); }
.recipe-card .cook-pill {
  font: 1rem/1 var(--display); letter-spacing: .6px; background: var(--yellow); color: var(--ink);
  padding: 11px 22px 8px; border-radius: 999px; box-shadow: 0 4px 0 #c99a2a;
}
.stars { color: var(--yellow); letter-spacing: 1px; font-size: .85rem; }

/* ---------- recipe detail ---------- */
.hero { border-radius: var(--radius); overflow: hidden; background: var(--surface-2); aspect-ratio: 1; display: grid; place-items: center; position: relative; border: 4px solid var(--pink); transform: rotate(-1.5deg); }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero .placeholder { text-align: center; color: var(--muted); padding: 20px; font: 500 1rem var(--label); text-transform: uppercase; letter-spacing: 1.2px; }
.detail-grid { display: grid; gap: 22px; }
@media (min-width: 760px) { .detail-grid { grid-template-columns: 1fr 1.3fr; align-items: start; } }
.detail-title-h { font-size: clamp(2rem, 6vw, 3rem); }
.ingredients { list-style: none; padding: 0; margin: 0; }
.ingredients li { padding: 9px 0; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 12px; }
.ingredients li:last-child { border-bottom: 0; }
.ingredients .qty { color: var(--yellow); text-align: right; font-weight: 500; }
.ingredients li.have .name::after { content: " ✓"; color: var(--good); font-weight: 600; }
.steps { padding-left: 0; margin: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 0 0 14px 46px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--pink); color: var(--ink); font: 1rem/34px var(--display); text-align: center;
}
.meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font: 500 .9rem var(--label); text-transform: uppercase; letter-spacing: 1px; }
.rating button { background: none; border: 0; font-size: 1.7rem; cursor: pointer; color: var(--line); padding: 0 1px; }
.rating button.on { color: var(--yellow); }
.fav { font-size: 1.6rem; background: none; border: 0; cursor: pointer; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.photos figure { margin: 0; position: relative; }
.photos img { aspect-ratio: 1; object-fit: cover; border-radius: 14px; width: 100%; }
.photos figure button { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.6); color: #fff; border: 0; border-radius: 999px; width: 26px; height: 26px; cursor: pointer; }

/* ---------- swaps (our version of a recipe) ---------- */
.ingredients li { align-items: center; }
.ingredients li > .name, .ingredients li > .swap-body { flex: 1; }
.swap-btn {
  flex: none; width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  border: 2px solid var(--line); background: transparent; color: var(--muted); font: 700 .95rem/1 var(--body);
  transition: border-color .2s, color .2s, background .2s;
}
.swap-btn:hover { border-color: var(--coral); color: var(--coral); }
.swap-btn.on { background: var(--coral); border-color: var(--coral); color: var(--ink); }
.ingredients li.swapped {
  background: rgba(240, 106, 99, .12); border: 1px dashed rgba(240, 106, 99, .55); border-radius: 14px;
  padding: 10px 12px; margin: 6px 0;
}
.swap-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.swap-old { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); text-decoration: line-through; text-decoration-color: var(--coral); text-decoration-thickness: 2px; }
.swap-old .qty { color: var(--muted); }
.swap-row { display: flex; align-items: flex-start; gap: 8px; }
.swap-row .swap-tag { margin-top: 2px; }
.swap-row .swap-new { flex: 1; font-weight: 600; color: var(--text); }
.swap-qty { display: block; font-weight: 500; color: var(--yellow); font-size: .92rem; }
.swap-tag {
  flex: none; background: var(--coral); color: var(--ink); border-radius: 999px; padding: 2px 9px 1px;
  font: .78rem/1.4 var(--display); letter-spacing: .6px; text-transform: uppercase;
}
.swap-note { font-size: .86rem; color: var(--pink); }
.swap-mention { background: rgba(240, 106, 99, .16); border-radius: 6px; padding: 0 4px; white-space: normal; }
.swap-mention s { color: var(--muted); text-decoration-color: var(--coral); text-decoration-thickness: 2px; }
.swap-mention em { color: var(--coral); font-style: normal; font-weight: 600; }
.twist-banner {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: rgba(240, 106, 99, .14); border: 2px solid var(--coral); border-radius: 16px; padding: 9px 12px;
  font-weight: 600; text-shadow: none;
}
.twist-tag {
  font: .82rem/1 var(--display); letter-spacing: .6px; text-transform: uppercase; color: var(--ink);
  background: var(--coral); border-radius: 999px; padding: 6px 12px 4px; text-shadow: none; transform: rotate(-3deg);
}
.idea {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; cursor: pointer;
  background: var(--surface-2); color: var(--text); border: 2px solid transparent; border-radius: 14px; padding: 10px 12px; font: inherit;
}
.idea .qty { color: var(--yellow); font-size: .9rem; }
.idea:hover { border-color: var(--pink); }
.idea.picked { border-color: var(--yellow); }

/* ---------- servings ---------- */
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: 999px; padding: 4px; }
.stepper button {
  width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--yellow); color: var(--ink); font: 700 1.35rem/1 var(--body);
  transition: transform .15s cubic-bezier(.34, 1.56, .64, 1);
}
.stepper button:active { transform: scale(.88); }
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper span { min-width: 104px; text-align: center; font: 600 .9rem var(--label); text-transform: uppercase; letter-spacing: 1px; }
.servings-chip {
  border: 0; cursor: pointer; flex: none; font: 600 .72rem/1 var(--label); text-transform: uppercase; letter-spacing: 1px;
  background: var(--yellow); color: var(--ink); border-radius: 999px; padding: 6px 10px;
}
.scaled-note { margin: 0 0 8px; font-size: .88rem; color: var(--ink); background: var(--pink); border-radius: 14px; padding: 8px 12px; }
.scaled-note .link-btn { color: var(--ink); font-weight: 700; }

/* ---------- import ---------- */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 28px 16px; border: 3px dashed var(--yellow); border-radius: var(--radius);
  background: rgba(246, 194, 68, .08); color: var(--text); cursor: pointer; margin: 0;
  font: 500 .95rem var(--label); text-transform: uppercase; letter-spacing: 1.2px;
  transition: transform .2s;
}
.dropzone .dz-icon { font-size: 2.2rem; }
.dropzone.over { transform: scale(1.02); }
.dropzone.has-file { border-style: solid; color: var(--yellow); }
.import-pic { width: 64px; height: 64px; border-radius: 14px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; flex: none; font-size: 1.6rem; }
.import-pic img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- generated suggestions ---------- */
.suggestion { border: 2px solid var(--pink); }

/* ---------- plan ---------- */
.week { display: grid; gap: 12px; }
@media (min-width: 900px) { .week { grid-template-columns: repeat(2, 1fr); } }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.day.today { border: 2px solid var(--yellow); }
.day h3 { margin: 0 0 6px; color: var(--pink); }
.day.today h3::after { content: " · today ♥"; color: var(--yellow); }
.meal { display: flex; gap: 10px; align-items: center; padding: 6px 0; }
.meal img, .meal .noimg { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.meal .tag { font: 500 .72rem var(--label); color: var(--muted); text-transform: uppercase; letter-spacing: 1px; width: 66px; flex: none; }
.meal a { flex: 1; color: var(--text); text-decoration: none; font-weight: 500; }

/* ---------- shopping ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px dashed var(--line); }
.list li .text { flex: 1; }
.list li.done .text { text-decoration: line-through; color: var(--muted); }

/* ---------- login ---------- */
.login { max-width: 400px; margin: 24px auto; text-align: center; }
.login .stack, .login label, .login input { text-align: left; }
.login-logo { width: 150px; height: 150px; margin: 0 auto 6px; border-radius: 50%; border: 5px solid var(--yellow); animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-5px) rotate(-3deg); } }

/* ---------- misc ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--yellow); color: var(--ink); padding: 11px 18px 9px; border-radius: 999px; font: 1rem/1.2 var(--display); letter-spacing: .5px;
  opacity: 0; pointer-events: none; transition: .2s; max-width: calc(100% - 32px); z-index: 30; box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 900px) { .toast { bottom: 34px; } }
.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
dialog { border: 2px solid var(--pink); border-radius: var(--radius); padding: 22px; background: var(--panel); color: var(--text); width: min(440px, calc(100% - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.5); }
dialog::backdrop { background: rgba(25, 10, 18, .6); }
dialog h2 { font-size: 1.5rem; }
dialog.prompt-dialog { width: min(560px, calc(100% - 32px)); }
.idea-chips .chip { border: 0; cursor: pointer; }
.idea-chips .chip:hover { filter: brightness(1.08); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
