/* Original confection illustrations. The host owns tile states and motion. */
.candy > span {
  position: relative;
  display: block;
  width: 72%;
  height: 72%;
  margin: auto;
  flex: 0 0 auto;
  pointer-events: none;
  box-sizing: border-box;
  filter: drop-shadow(0 3px 1px #160b2580);
}
.candy > span::before,
.candy > span::after {
  content: "";
  position: absolute;
  pointer-events: none;
  box-sizing: border-box;
}

/* Cranberry jelly: tall teardrop, warm red and a liquid glass gleam. */
.candy[data-type="0"] > span {
  width: 61%;
  height: 73%;
  border-radius: 58% 42% 48% 48% / 71% 71% 29% 29%;
  background: radial-gradient(ellipse at 29% 25%, #fff0ba 0%, #ff9b83 10%, transparent 29%),
    radial-gradient(ellipse at 43% 35%, #ff6460 10%, #e92c47 49%, #b60d37 77%, #7a1734 100%);
  box-shadow: inset 0 -3px 2px #800d35aa, inset 1px 1px 1px #ffb5a0;
}
.candy[data-type="0"] > span::before {
  top: 17%; left: 19%; width: 18%; height: 29%;
  border-radius: 70%; transform: rotate(21deg);
  background: linear-gradient(#fff9dcde, #ffc7af12);
}
.candy[data-type="0"] > span::after {
  bottom: 13%; right: 14%; width: 32%; height: 9%;
  border-radius: 100%; background: #ff879e85; transform: rotate(-13deg);
}

/* Pistachio sugar tree: stacked branches form a distinct evergreen outline. */
.candy[data-type="1"] > span {
  background: linear-gradient(130deg, #c5f19a 0%, #5cbe81 27%, #239b69 56%, #11694d 100%);
  clip-path: polygon(50% 0, 76% 29%, 66% 29%, 91% 57%, 76% 57%, 100% 85%, 61% 85%, 61% 100%, 39% 100%, 39% 85%, 0 85%, 24% 57%, 9% 57%, 34% 29%, 24% 29%);
}
.candy[data-type="1"] > span::before {
  inset: 3% 45% 14% 13%;
  background: linear-gradient(100deg, #e9ffcaa8, transparent);
  clip-path: polygon(88% 0, 38% 36%, 67% 36%, 11% 69%, 50% 67%, 0 100%, 81% 100%);
}
.candy[data-type="1"] > span::after {
  inset: 0;
  background: radial-gradient(circle at 48% 18%, #fffbe8 0 2%, transparent 3%), radial-gradient(circle at 36% 48%, #fffbe8 0 2%, transparent 3%), radial-gradient(circle at 62% 64%, #fffbe8 0 2%, transparent 3%), radial-gradient(circle at 30% 76%, #fffbe8 0 2%, transparent 3%);
}

/* Butter toffee: a bevelled square with a hand-pulled central crease. */
.candy[data-type="2"] > span {
  width: 67%; height: 67%; border-radius: 20%;
  background: linear-gradient(135deg, #fff2af 0%, #fbd477 18%, #e8aa45 54%, #bd742d 100%);
  border: 1px solid #ffdea1;
  box-shadow: inset 2px 2px 1px #fff4c6a6, inset -3px -4px 1px #a8623280, 0 3px 0 #7e432e;
  transform: rotate(-7deg);
}
.candy[data-type="2"] > span::before {
  inset: 15% 14%; border-radius: 18%;
  border-top: 1px solid #fff0aa; border-left: 1px solid #fff0aa90;
  border-bottom: 2px solid #c7893c8c;
}
.candy[data-type="2"] > span::after {
  top: 24%; left: 29%; width: 39%; height: 48%; border-radius: 50%;
  border-left: 2px solid #c0863b80; transform: rotate(26deg);
}

/* Rose peppermint: round cream sweet with six curling rose ribbons. */
.candy[data-type="3"] > span {
  border-radius: 50%;
  background: conic-gradient(from 15deg, #fff4dc 0deg 33deg, #ed81a1 34deg 60deg, #fff4dc 61deg 93deg, #e86991 94deg 120deg, #fff4dc 121deg 153deg, #ed81a1 154deg 180deg, #fff4dc 181deg 213deg, #e86991 214deg 240deg, #fff4dc 241deg 273deg, #ed81a1 274deg 300deg, #fff4dc 301deg 333deg, #e86991 334deg 360deg);
  border: 2px solid #ffd5cc;
  box-shadow: inset -3px -4px 3px #a5335950, inset 2px 2px 2px #fffdf0, 0 2px 0 #983756;
}
.candy[data-type="3"] > span::before {
  inset: 25%; border-radius: 50%;
  background: conic-gradient(from 62deg, #fff4dc 0deg 33deg, #e87598 34deg 60deg, #fff4dc 61deg 93deg, #e87598 94deg 120deg, #fff4dc 121deg 153deg, #e87598 154deg 180deg, #fff4dc 181deg 213deg, #e87598 214deg 240deg, #fff4dc 241deg 273deg, #e87598 274deg 300deg, #fff4dc 301deg 333deg, #e87598 334deg 360deg);
}
.candy[data-type="3"] > span::after {
  inset: 0; border-radius: inherit;
  background: radial-gradient(ellipse at 29% 22%, #ffffffc9, #ffffff15 31%, transparent 49%);
}

/* Blueberry gumdrop: squat, flat-bottomed dome in saturated winter blue. */
.candy[data-type="4"] > span {
  height: 62%; margin-top: auto; margin-bottom: auto;
  border-radius: 49% 49% 22% 22% / 76% 76% 24% 24%;
  background: radial-gradient(ellipse at 33% 24%, #b9f6ff 0%, #70cee8 18%, #3289d0 52%, #2553a5 85%);
  box-shadow: inset 0 -3px 1px #263e8599, inset 1px 2px 1px #a1e4ffbd;
}
.candy[data-type="4"] > span::before {
  inset: 9%; border-radius: inherit; opacity: .8;
  background-image: radial-gradient(circle, #e6fcffb3 0 .7px, transparent 1px);
  background-size: 6px 6px;
}
.candy[data-type="4"] > span::after {
  top: 12%; left: 20%; width: 33%; height: 19%; border-radius: 50%;
  background: #e4ffff75; transform: rotate(-25deg);
}

/* Violet iced star: a crisp five-point biscuit with lavender icing. */
.candy[data-type="5"] > span {
  width: 77%; height: 77%;
  background: linear-gradient(135deg, #e4baf8 0%, #b57bdf 38%, #8354b9 68%, #643582 100%);
  clip-path: polygon(50% 0, 64% 33%, 100% 36%, 73% 60%, 81% 97%, 50% 78%, 19% 97%, 27% 60%, 0 36%, 36% 33%);
}
.candy[data-type="5"] > span::before {
  inset: 11%;
  background: linear-gradient(140deg, #fff0ff 0%, #d6b2f0 35%, #b084da 70%);
  clip-path: inherit;
}
.candy[data-type="5"] > span::after {
  left: 44%; top: 23%; width: 9%; height: 28%; border-radius: 50%;
  background: #fff7fdb3; transform: rotate(18deg);
}

/* Same illustrations can be used beside counters and recipe labels. */
.candy.candy--mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  min-width: 1.45rem;
  padding: 0;
  vertical-align: middle;
  background: transparent;
  border: 0;
  box-shadow: none;
}
