/* =========================================================
   NOTES FROM OTHER KITCHENS + KITCHEN BUDDIES (notes.js)
   ========================================================= */
@font-face { font-family: "Me e"; src: url(fonts/Me-e.otf) format("opentype"); font-display: swap; }

/* ---------- Buddies: Verity's drawings, stacked in layers ---------- */
.buddy { position: relative; display: inline-block; overflow: hidden; vertical-align: middle; }
.buddy i { position: absolute; inset: 0; display: block; }
.buddy .bln, .buddy .bfl { -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-size: 1000% 900%; mask-size: 1000% 900%; }
.buddy .bln { -webkit-mask-image: url(images/lines.png); mask-image: url(images/lines.png); }
.buddy .bfl { -webkit-mask-image: url(images/fills.png); mask-image: url(images/fills.png); }
.buddy .bbk { background: url(images/baked.png) no-repeat; background-size: 1000% 900%; }
.buddy .a-tilt, .buddy .a-nose, .buddy .a-wave, .buddy .a-hop, .buddy .a-blink, .buddy .a-purse { animation-delay: var(--bd, 0s); }
.a-tilt  { animation: b-tilt 7s ease-in-out infinite; transform-origin: 50% 70%; }
.a-nose  { animation: b-nose 5s ease-in-out infinite; transform-origin: 50% 60%; }
.a-wave  { animation: b-wave 6s ease-in-out infinite; transform-origin: 86% 92%; }
.a-hop   { animation: b-hop 4.5s ease-in-out infinite; }
.a-blink { animation: b-blink 4.2s linear infinite; transform-origin: 50% 44.3%; }
.a-purse { animation: b-purse 6.4s ease-in-out infinite; transform-origin: 50% 57%; }
@keyframes b-tilt  { 0%, 70%, 100% { transform: rotate(0) } 78% { transform: rotate(-2.5deg) } 88% { transform: rotate(2deg) } }
@keyframes b-nose  { 0%, 84%, 100% { transform: translate(0, 0) } 86% { transform: translate(-0.8%, -0.4%) } 88% { transform: translate(0.8%, 0) } 90% { transform: translate(-0.6%, -0.3%) } 92% { transform: translate(0.5%, 0) } 94% { transform: translate(0, 0) } }
@keyframes b-wave  { 0%, 80%, 100% { transform: rotate(0) } 85% { transform: rotate(-9deg) } 90% { transform: rotate(6deg) } 95% { transform: rotate(-4deg) } }
@keyframes b-hop   { 0%, 86%, 100% { transform: translateY(0) } 90% { transform: translateY(-4%) } 94% { transform: translateY(0) } 97% { transform: translateY(-1.5%) } }
@keyframes b-blink { 0%, 91%, 97%, 100% { transform: scaleY(1) } 94% { transform: scaleY(0.08) } }
@keyframes b-purse { 0%, 78%, 100% { transform: scale(1) } 83%, 90% { transform: scale(0.62, 1.15) } }
@media (prefers-reduced-motion: reduce) { .buddy i { animation: none !important; } }

/* ---------- The two quiet lines on a recipe ---------- */
.nb-top { margin: -0.1em 0 0.35em; text-align: center; font-size: 0.7em; }
.nb-top a, .nb-end a { color: #6b5640; text-decoration: none; }
.nb-u { border-bottom: 1px dashed rgba(107, 86, 64, 0.55); }
.nb-top a:hover, .nb-end a:hover, .nb-top a:focus-visible, .nb-end a:focus-visible { color: #7a3b16; }
.nb-top a:hover .nb-u, .nb-end a:hover .nb-u { border-bottom-color: #7a3b16; }
.nb-end { margin: 0.7em 0 0; text-align: right; font-size: 0.72em; }
.nb-stars {
  display: inline-block;
  letter-spacing: 0.08em;
  font-size: 1.15em;
  line-height: 1;
  background: linear-gradient(90deg, #a8462a calc(var(--v) / 5 * 100%), #cdb48e 0);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.nb-stars.small { font-size: 0.95em; }

/* ---------- Shared bits of the hidden pages ---------- */
.nb-page { display: flex; flex-direction: column; height: 100%; color: #2b2118; }
.nb-title {
  margin: 0;
  font: 400 1.75em/1.05 "Me e", "Me", "Caveat", cursive;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-align: center;
  color: #2b2118;
}
.nb-for { margin: 0.25em 0 0; text-align: center; font-size: 0.85em; color: #5a4632; }
.nb-back { color: #8a4b1c; text-decoration: none; font-size: 0.9em; }
.nb-back:hover { text-decoration: underline wavy; text-underline-offset: 4px; }
.nb-btn {
  font: 400 1.2em/1 "Me e", "Me", "Caveat", cursive;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #1e1a17;
  background: #fbf3e2;
  border: 2px solid #1e1a17;
  border-radius: 9px;
  box-shadow: 0 2px 0 #1e1a17;
  padding: 0.35em 0.9em 0.3em;
  min-height: 34px;
  cursor: pointer;
}
.nb-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 3px 0 #1e1a17; }
.nb-btn:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 1px 0 #1e1a17; }
.nb-btn:disabled { opacity: 0.4; cursor: default; }
.nb-btn-main { background: #f0a35e; }
.nb-btn-small { font-size: 1em; padding: 0.3em 0.75em 0.25em; }
.nb-stamp {
  display: inline-block;
  font: 700 0.62em/1.25 "Courier Prime", monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35em 0.55em;
  border: 2px solid;
  border-radius: 5px;
  transform: rotate(var(--r, -5deg));
  opacity: 0.9;
}

/* ---------- Reading: the register ---------- */
.nb-made { margin: 0.8em 0 0; display: flex; align-items: center; justify-content: center; gap: 0.4em; font-size: 0.9em; flex-wrap: wrap; }
.nb-count { display: inline-flex; gap: 2px; }
.nb-count b { width: 1.15em; padding: 0.15em 0; text-align: center; background: #1e1a17; color: #f6ead0; border-radius: 3px; font: 700 1.1em/1 "Courier Prime", monospace; }
.nb-tally { margin: 0.6em 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.45em; }
.nb-hd { display: flex; gap: 0.7em; margin-top: 0.9em; padding-bottom: 0.25em; border-bottom: 2px solid #2b2118; font: 700 0.58em "Courier Prime", monospace; letter-spacing: 0.15em; text-transform: uppercase; color: #5a4632; }
.nb-hd .h1 { width: 6.6em; } .nb-hd .h2 { flex: 1; } .nb-hd .h3 { width: 9.5em; text-align: center; }
.nb-rows { display: flex; flex-direction: column; }
.nb-row { display: flex; align-items: center; gap: 0.7em; min-height: 5.6em; padding: 0.45em 0; border-bottom: 1.5px solid rgba(80, 120, 190, 0.35); }
.nb-ph { flex: none; background: #fffdf6; padding: 3px 3px 8px; box-shadow: 0 2px 4px rgba(40, 25, 10, 0.25); transform: rotate(-2deg); line-height: 0; }
.nb-row:nth-child(even) .nb-ph { transform: rotate(1.5deg); }
.nb-nob { display: inline-flex; width: 58px; height: 68px; align-items: center; justify-content: center; font: 700 26px/1 Caveat, cursive; color: #c9a37a; }
.nb-txt { flex: 1; min-width: 0; }
.nb-note { display: block; font: 400 1.05em/1.2 "Patrick Hand", "Caveat", cursive; color: #2a3550; overflow-wrap: anywhere; }
.nb-who { display: block; margin-top: 0.3em; font-size: 0.66em; color: #5a4632; }
.nb-st { flex: none; width: 6.4em; display: flex; justify-content: center; }
.nb-st .nb-stamp { max-width: 9em; text-align: center; }
.nb-read-r { padding-top: 0.2em; }
.nb-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(107, 86, 64, 0.4) transparent; padding-right: 0.3em; }
.nb-lines .nb-row { min-height: 5.6em; }
.nb-foot { flex: none; display: flex; flex-direction: column; align-items: center; gap: 0.7em; padding-top: 0.9em; }
.nb-empty { margin: 2.2em 0 0; text-align: center; line-height: 1.5; }
.nb-empty-ink { margin: 0.6em 0 0; text-align: center; font: 600 1.5em/1 Caveat, cursive; color: #23324f; transform: rotate(-3deg); }

/* ---------- Leaving a note: the buddy maker ---------- */
.nb-maker { align-items: center; }
.nb-frame { margin-top: 0.9em; padding: 6px; background: #fffdf6; border: 2px solid #1e1a17; border-radius: 6px; box-shadow: 0 3px 0 #1e1a17; line-height: 0; }
.nb-dice { margin-top: 1em; display: inline-flex; align-items: center; gap: 0.45em; font-size: 1.35em; }
.nb-dice svg { width: 1em; height: 1em; fill: none; stroke: #1e1a17; stroke-width: 2; }
.nb-dice svg circle { fill: #1e1a17; stroke: none; }
.nb-hint { margin: 1em 0 0; font-size: 0.8em; color: #5a4632; }
.nb-rolls { margin: 0.5em 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.45em; }
.nb-tocard { margin-top: auto; align-self: flex-end; }

/* ---------- Leaving a note: the card ---------- */
.nb-card { font-size: 0.95em; }
.nb-card .nb-title, .nb-card .nb-for { text-align: left; }
.nb-rate-row { margin-top: 0.4em; display: flex; gap: 0.1em; }
.nb-star { border: 0; background: none; padding: 0 0.08em; font: 1.6em/1 Georgia, serif; color: #cdb48e; cursor: pointer; min-width: 30px; min-height: 30px; }
.nb-star.on { color: #a8462a; }
.nb-star:hover { transform: scale(1.12); }
.nb-stamps { margin-top: 0.35em; display: flex; flex-wrap: wrap; gap: 0.4em; }
.nb-pick { --r: 0deg; color: var(--c); border-color: var(--c); background: transparent; cursor: pointer; font-size: 0.66em; min-height: 30px; }
.nb-pick.on { --r: -3deg; color: #fffdf6; background: var(--c); opacity: 1; }
.nb-lbl { display: block; margin-top: 0.7em; font: 700 0.72em "Courier Prime", monospace; color: #2b2118; }
.nb-lbl i { font-weight: 400; color: #6b5640; }
.nb-left { float: right; font-weight: 400; color: #5a4632; }
.nb-left.over { color: #8a2f1c; font-weight: 700; }
.nb-field {
  display: block; width: 100%; box-sizing: border-box;
  margin-top: 0.15em; padding: 0.2em 0.1em;
  border: 0; border-bottom: 2px solid rgba(80, 120, 190, 0.45); border-radius: 0;
  background: transparent;
  font: 400 1.45em/1.35 "Patrick Hand", "Caveat", cursive; color: #2a3550;
  resize: none;
}
.nb-field:focus { outline: none; border-bottom-color: #2a3550; background: rgba(255, 253, 246, 0.5); }
textarea.nb-field { background-image: repeating-linear-gradient(180deg, transparent 0 1.32em, rgba(80, 120, 190, 0.22) 1.32em 1.38em); }
.nb-two { display: flex; gap: 1em; }
.nb-two .nb-lbl { flex: 1; min-width: 0; }
.nb-check { margin-top: 0.6em; display: flex; align-items: center; gap: 0.5em; font-size: 0.75em; cursor: pointer; }
.nb-check input { width: 18px; height: 18px; accent-color: #8a4b1c; }
.nb-honey { position: absolute; left: -9999px; width: 1px; height: 1px; }
.nb-error { margin: 0.5em 0 0; font-size: 0.72em; color: #8a2f1c; }
.nb-send-row { margin-top: auto; display: flex; align-items: flex-end; gap: 0.8em; padding-top: 0.6em; }
.nb-rules { flex: 1; margin: 0; font-size: 0.58em; line-height: 1.45; color: #5a4632; }
.nb-rules a { color: #8a4b1c; }
.nb-send { font-size: 1.45em; padding: 0.3em 1em 0.25em; }
.nb-sent { align-items: center; justify-content: center; text-align: center; gap: 0.7em; }
.nb-sent p { margin: 0; max-width: 20em; line-height: 1.45; }
.nb-ph-big { transform: rotate(-4deg); }
.nb-achieve { padding: 0.45em 0.8em; background: #1e1a17; color: #f7e27a; font: 700 0.7em "Courier Prime", monospace; letter-spacing: 0.06em; text-transform: uppercase; }

/* 2 Dec: clearer rating stars on the card: labelled, outlined until picked, then filled */
.nb-rate-row { align-items: center; margin-top: 0.55em; }
.nb-rate-row::before { content: "Your rating"; margin-right: 0.6em; font: 700 0.72em "Courier Prime", monospace; color: #2b2118; }
.nb-star { color: transparent; -webkit-text-stroke: 1.5px #7a5a3a; font-size: 1.7em; }
.nb-star.on { color: #a8462a; -webkit-text-stroke: 1.5px #a8462a; }
.nb-rate-row:hover .nb-star { -webkit-text-stroke-color: #a8462a; }

/* the invisible page-turn edges sit over the sides of the page: switch them off on the notes pages so buttons get the click */
.book:has(.sheet .nb-page) .edge { pointer-events: none; }
