:root {
  --ink: #3a2340;
  --muted: #7b5f80;
  --pink: #ff6fb5;
  --hot: #ff2e93;
  --purple: #b388ff;
  --aqua: #29c9e6;
  --lime: #9be15d;
  --yellow: #ffe94a;
  --paper: #fffdf7;
  --hand: "Patrick Hand", "Comic Sans MS", "Chalkboard SE", cursive;
  --bubble: Chewy, "Comic Sans MS", "Chalkboard SE", cursive;
  --marker: "Permanent Marker", "Marker Felt", "Comic Sans MS", cursive;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font: 19px/1.4 var(--hand);
  background-color: #f6ecff;
  /* dotted scrapbook page with faint doodle confetti */
  background-image:
    radial-gradient(circle, rgba(179, 136, 255, 0.28) 1.2px, transparent 1.6px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cg fill='none' stroke-width='2.5' stroke-linecap='round' opacity='0.22'%3E%3Cpath d='M30 40l6 12 13 2-10 9 3 13-12-7-12 7 3-13-10-9 13-2z' stroke='%23ff6fb5'/%3E%3Cpath d='M190 60c6-10 14-10 14-3s-7 6-5 0 11-8 15-3' stroke='%2329c9e6'/%3E%3Cpath d='M120 200s-12-7-12-16a6 6 0 0 1 12-3 6 6 0 0 1 12 3c0 9-12 16-12 16z' stroke='%23b388ff'/%3E%3Ccircle cx='220' cy='190' r='7' stroke='%239be15d'/%3E%3Cpath d='M60 160h14M67 153v14' stroke='%23ffc928'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 22px 22px, 260px 260px;
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; text-decoration: underline wavy var(--pink); text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
a:hover { color: var(--hot); }

/* ---------- header ---------- */

.top { position: relative; text-align: center; padding: 44px 16px 8px; max-width: 640px; margin: 0 auto; }
.top h1 {
  margin: 0;
  font: 400 clamp(56px, 13vw, 96px)/1 var(--bubble);
  letter-spacing: 2px;
}
.l {
  display: inline-block;
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow: 4px 4px 0 var(--ink);
}
.l0 { color: var(--pink); transform: rotate(-6deg) translateY(2px); }
.l1 { color: var(--yellow); transform: rotate(4deg) translateY(-4px); }
.l2 { color: var(--aqua); transform: rotate(-3deg) translateY(3px); }
.l3 { color: var(--lime); transform: rotate(6deg) translateY(-2px); }
.l4 { color: var(--purple); transform: rotate(-5deg) translateY(4px); }
.l5 { color: #ff9f43; transform: rotate(3deg) translateY(-3px); }

.tagline { margin: 14px 0 0; }
.tagline span {
  display: inline-block;
  padding: 4px 16px 6px;
  background: var(--paper);
  font-size: 21px;
  transform: rotate(-1.5deg);
  box-shadow: 2px 3px 0 rgba(58, 35, 64, 0.15);
  /* torn-paper bottom edge */
  clip-path: polygon(0 0, 100% 0, 100% 88%, 96% 100%, 91% 90%, 86% 100%, 80% 91%, 74% 100%, 68% 90%, 62% 100%, 56% 91%, 50% 100%, 44% 90%, 38% 100%, 32% 91%, 26% 100%, 20% 90%, 14% 100%, 8% 91%, 3% 100%, 0 90%);
}
.stats {
  display: inline-block;
  margin: 14px 0 0;
  padding: 3px 14px;
  background: var(--yellow);
  font: 17px/1.4 var(--marker);
  transform: rotate(1.5deg);
  box-shadow: 2px 2px 0 var(--ink);
  border: 2px solid var(--ink);
}

.doodle { position: absolute; width: 44px; height: 44px; }
.d-star { left: 4%; top: 46px; transform: rotate(-14deg); }
.d-flower { right: 6%; top: 34px; width: 50px; height: 50px; }
.d-heart { left: 12%; top: 150px; width: 34px; height: 34px; transform: rotate(12deg); }
.d-swirl { right: 10%; top: 150px; width: 70px; height: 35px; }
.d-sparkle { right: 22%; top: 8px; width: 30px; height: 30px; }

/* ---------- sort buttons as label-maker stickers ---------- */

.sort { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; padding: 22px 16px 4px; }
.sort span { font-family: var(--marker); font-size: 16px; color: var(--muted); margin-right: 2px; }
.sort button {
  font: 18px/1 var(--hand);
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 6px 14px 5px;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
}
.sort button:nth-of-type(odd) { transform: rotate(-2deg); }
.sort button:nth-of-type(even) { transform: rotate(1.5deg); }
.sort button:hover { background: #fff0f8; }
.sort button[aria-pressed="true"] { background: var(--pink); color: #fff; }
.sort button:focus-visible { outline: 3px dashed var(--aqua); outline-offset: 3px; }

/* ---------- cards ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 360px));
  justify-content: center;
  gap: 54px 30px;
  max-width: 1140px;
  margin: 0 auto;
  padding: 40px 20px 50px;
  align-items: start;
}

.card {
  position: relative;
  padding: 22px 22px 22px;
  background: var(--paper);
  box-shadow: 3px 4px 0 rgba(58, 35, 64, 0.18), 0 10px 24px rgba(58, 35, 64, 0.08);
  scroll-margin-top: 30px;
}
.card:target { outline: 3px dashed var(--hot); outline-offset: 6px; }

/* paper styles */
.paper-0 { background-color: #fff6fb; background-image: linear-gradient(rgba(255, 111, 181, 0.16) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 111, 181, 0.16) 1px, transparent 1px); background-size: 18px 18px; }
.paper-1 { background-color: #fffbe6; background-image: linear-gradient(transparent 27px, rgba(41, 201, 230, 0.35) 28px); background-size: 100% 28px; }
.paper-2 { background-color: #f0fbff; background-image: radial-gradient(circle, rgba(179, 136, 255, 0.35) 1.5px, transparent 2px); background-size: 16px 16px; }
.paper-3 { background-color: #f4ffe9; }

.tilt-0 { transform: rotate(-1.2deg); }
.tilt-1 { transform: rotate(0.9deg); }
.tilt-2 { transform: rotate(-0.4deg); }
.tilt-3 { transform: rotate(1.4deg); }
.tilt-4 { transform: rotate(-0.8deg); }

.tape {
  position: absolute;
  height: 28px;
  background: rgba(255, 233, 74, 0.7);
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.35) 0 6px, transparent 6px 12px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  clip-path: polygon(2% 0, 98% 4%, 100% 50%, 97% 100%, 3% 96%, 0 50%);
}
.tape-card { width: 110px; top: -13px; left: 50%; margin-left: -55px; transform: rotate(-3deg); }
.paper-1 .tape-card { background-color: rgba(255, 111, 181, 0.55); }
.paper-2 .tape-card { background-color: rgba(155, 225, 93, 0.6); }
.paper-3 .tape-card { background-color: rgba(41, 201, 230, 0.5); }

/* the drink picture */
.pic { margin: 0 0 6px; text-align: center; }
.pic img { display: inline-block; max-width: 100%; height: auto; }
.sticker { margin-top: -54px; }
.sticker img, .sticker svg {
  max-height: 300px;
  width: auto;
  filter: drop-shadow(2px 4px 3px rgba(58, 35, 64, 0.3));
  transform: rotate(-4deg);
}
.sticker.tall img { max-height: 380px; }
.tilt-1 .sticker img, .tilt-3 .sticker img { transform: rotate(5deg); }
.sticker.placeholder svg { height: 200px; margin-top: 10px; }
.polaroid {
  position: relative;
  display: block;
  margin: 6px auto 8px;
  padding: 10px 10px 34px;
  background: #fff;
  box-shadow: 1px 2px 6px rgba(58, 35, 64, 0.25);
  transform: rotate(2deg);
  width: 92%;
}
.polaroid img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.tape-pic { width: 80px; top: -12px; left: 50%; margin-left: -40px; transform: rotate(4deg); background-color: rgba(179, 136, 255, 0.55); }

/* rating stamp */
.stamp {
  position: absolute;
  right: 10px;
  top: 14px;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--hot);
  color: #fff;
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(12deg);
  z-index: 2;
}
.stamp span { font: 30px/1 var(--bubble); }
.stamp small { font: 12px/1 var(--hand); margin-top: 1px; }

.card h2 { margin: 2px 0 0; font: 400 30px/1.1 var(--bubble); letter-spacing: 0.5px; }
.card h2 a { text-decoration: none; }
.meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 6px 0 10px; }

.stars { display: inline-flex; gap: 3px; }
.star {
  width: 20px;
  height: 20px;
  background: #e9dcef;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.star.on { background: #ffc928; }
.star.half { background: linear-gradient(90deg, #ffc928 50%, #e9dcef 50%); }

dl { margin: 0; }
.row { padding: 7px 0; }
dt { font: 13px/1.5 var(--marker); color: var(--muted); }
dd { margin: 0; }
.sub { display: block; font-size: 16px; color: var(--muted); }

.tags-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.pricetag {
  position: relative;
  display: inline-block;
  padding: 2px 12px 2px 20px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 4px 12px 12px 4px;
  font-size: 19px;
}
.pricetag::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  border: 2px solid var(--ink);
}
.pricetag.hh { background: #fff3a8; }
.pricetag.hh b { font-weight: normal; font-family: var(--marker); font-size: 13px; margin-right: 2px; }
.pricetag .sub { font-size: 15px; color: var(--ink); }

.meter { display: inline-flex; gap: 4px; vertical-align: -2px; margin-right: 8px; }
.heart {
  width: 18px;
  height: 16px;
  background: #ead9ee;
  clip-path: path("M9 16S0 10.5 0 4.6A4.4 4.4 0 0 1 9 2.6 4.4 4.4 0 0 1 18 4.6C18 10.5 9 16 9 16z");
}
.heart.on { background: var(--hot); }
.meter-label { font-size: 17px; color: var(--muted); }

.ingredients { list-style: none; margin: 0; padding: 0; }
.ingredients { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.ingredients li { white-space: nowrap; background: linear-gradient(transparent 55%, rgba(155, 225, 93, 0.55) 55%); }
.ingredients li:not(:last-child)::after { content: " ✿"; color: var(--pink); }

.funfact {
  position: relative;
  margin: 14px 4px 4px;
  padding: 12px 14px 12px;
  background: #fff59a;
  font-size: 18px;
  transform: rotate(-1.5deg);
  box-shadow: 2px 4px 8px rgba(58, 35, 64, 0.15);
}
.funfact b { display: block; font: 400 16px/1.3 var(--marker); color: var(--hot); }

.review { margin-top: 12px; font-size: 19px; }
.review p { margin: 0 0 8px; }
.review p:last-child { margin-bottom: 0; }

.empty {
  grid-column: 1 / -1;
  justify-self: center;
  padding: 18px 26px;
  background: #fff59a;
  font-size: 22px;
  transform: rotate(-2deg);
  box-shadow: 2px 4px 8px rgba(58, 35, 64, 0.15);
}


@media (max-width: 640px) {
  .doodle { display: none; }
  .d-star, .d-flower { display: block; }
  .d-star { left: 2%; top: 20px; width: 36px; height: 36px; }
  .d-flower { right: 2%; top: 16px; width: 40px; height: 40px; }
  .top { padding-top: 36px; }
  .stats { font-size: 15px; }
  .sort { gap: 10px; }
  .sort span { flex-basis: 100%; text-align: center; }
  .sort button { min-height: 42px; padding: 8px 16px 7px; }
  .grid { padding: 34px 14px 40px; gap: 60px; }
  .card { padding: 20px 18px; }
  .stamp { width: 64px; height: 64px; right: 6px; }
  .stamp span { font-size: 26px; }
  .sticker img { max-height: 260px; }
  .sticker.tall img { max-height: 340px; }
  .card h2 { font-size: 28px; padding-right: 8px; }
}


@media (max-width: 360px) {
  .stats { font-size: 13px; padding: 3px 10px; }
}

@media (prefers-reduced-motion: no-preference) {
  .sticker img { transition: transform 0.2s ease; }
  .sticker img:hover { transform: rotate(0deg) scale(1.04); }
}
/* tilted cards and doodles can poke a few pixels past the edge on narrow phones */
html, body { overflow-x: clip; }
