.recipe-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 284px), 320px));
  gap: 14px;
  align-items: start;
  margin-block: 16px;
}

.recipe {
  --recipe-slot: 44px;
  margin: 0;
  min-width: 0;
  padding: 12px;
  border: 1px solid #34302b;
  border-radius: 12px;
  background: var(--guide-card, #1f1f1f);
  color: var(--guide-text-warm, #f3e4c9);
}

.recipe-panel {
  border-radius: 8px;
  background: #232323;
  padding: 10px;
}

.recipe-station {
  display: block;
  margin-bottom: 9px;
  color: #d2c1a5;
  font-size: 13px;
  font-weight: 700;
}

.recipe-gui {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 132px;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(3, var(--recipe-slot));
}

.recipe-slot {
  display: grid;
  place-items: center;
  width: var(--recipe-slot);
  height: var(--recipe-slot);
  box-sizing: border-box;
  border-style: solid;
  border-width: 2px;
  border-image: url("/gaidy/assets/recipe-slot.f657453525d9.png") 1 fill stretch;
  image-rendering: pixelated;
  cursor: default;
}

.recipe-slot:focus-visible {
  outline: 2px solid var(--guide-accent, #ffc75a);
  outline-offset: -2px;
  z-index: 1;
}

.recipe-slot.recipe-output {
  --recipe-slot: 50px;
}

.recipe-sprite {
  display: block;
  width: 32px;
  height: 32px;
  background-image: url("/gaidy/assets/recipe-atlas.fae43426cbb1.webp");
  background-repeat: no-repeat;
  background-position: var(--sprite-position);
  image-rendering: pixelated;
}

.recipe-count {
  position: absolute;
  align-self: end;
  justify-self: end;
  margin: 0 1px 1px 0;
  color: white;
  font: bold 14px/1 ui-monospace, monospace;
  text-shadow: 1px 1px #221a15, -1px 1px #221a15, 1px -1px #221a15, -1px -1px #221a15;
}

.recipe-tooltip {
  display: none;
  position: absolute;
  z-index: 3;
  top: -4px;
  left: 50%;
  transform: translate(-50%, -100%);
  width: max-content;
  max-width: min(100%, 246px);
  padding: 5px 8px;
  border: 2px solid #542485;
  background: #140918;
  color: #fff;
  font: 700 13px/1.25 ui-monospace, monospace;
  text-align: center;
  pointer-events: none;
  overflow-wrap: anywhere;
}

.recipe-slot:focus-visible .recipe-tooltip,
.recipe-slot.recipe-tap .recipe-tooltip {
  display: block;
}

@media (hover: hover) {
  .recipe-slot:hover .recipe-tooltip {
    display: block;
  }
}

.recipe .recipe-slot.recipe-tooltip-dismissed .recipe-tooltip {
  display: none;
}

.recipe-arrow {
  flex: 0 0 23px;
  height: 16px;
  background: #b7b7b7;
  clip-path: polygon(0 30%, 56% 30%, 56% 0, 66% 0, 100% 50%, 66% 100%, 56% 100%, 56% 70%, 0 70%);
}

.recipe-furnace-stack {
  display: grid;
  justify-items: center;
  align-items: center;
  gap: 3px;
}

.recipe-flame {
  width: 14px;
  height: 14px;
  transform: scale(1.35);
}

.recipe-heat {
  width: 24px;
  height: 16px;
}

.recipe-brewer {
  display: grid;
  grid-template-columns: repeat(3, var(--recipe-slot));
  justify-items: center;
  align-items: center;
  row-gap: 3px;
  background: linear-gradient(#747474, #747474) center 60% / 71% 2px no-repeat;
}

.recipe-brewer > .recipe-slot:nth-child(3) {
  grid-area: 1 / 2;
}

.recipe-brew-fuel {
  grid-area: 2 / 1;
  width: 18px;
  height: 4px;
}

.recipe-bubbles {
  grid-area: 2 / 2;
  width: 12px;
  height: 29px;
}

.recipe-brew-arrow {
  grid-area: 2 / 3;
  width: 9px;
  height: 28px;
}

.recipe-bottles {
  grid-area: 3 / 1 / 3 / -1;
  display: flex;
}

.recipe-pattern-inputs {
  display: grid;
  grid-template-columns: repeat(2, var(--recipe-slot));
}

.recipe-pattern-inputs .recipe-empty {
  grid-column: 1 / -1;
  justify-self: center;
}

.recipe-empty-icon {
  width: 16px;
  height: 16px;
  transform: scale(1.6);
}

.recipe-cut,
.recipe-pattern {
  display: grid;
  place-items: center;
  width: 40px;
  height: 44px;
  background: #757575;
}

.recipe-cut > *,
.recipe-pattern > * {
  grid-area: 1 / 1;
}

.recipe-cut-tile,
.recipe-pattern-tile {
  justify-self: center;
  width: 16px;
  height: 18px;
  transform: scale(2.15);
}

.recipe-cut-preview,
.recipe-pattern-preview {
  z-index: 1;
}

.recipe-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: 5px 6px;
  margin-top: 10px;
  overflow-wrap: anywhere;
  text-align: left;
}

.recipe-title,
.recipe-needs,
.recipe-fuel,
.recipe-note {
  flex-basis: 100%;
}

.recipe-title {
  font-size: 17px;
  line-height: 1.25;
}

.recipe-needs,
.recipe-fuel,
.recipe-note {
  font-size: 15px;
  line-height: 1.36;
}

.recipe-fuel,
.recipe-note {
  color: #d2c1a5;
}

.recipe-chip {
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--guide-button-gradient, #ffc75a);
  color: var(--guide-ink, #181818);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

@media (max-width: 480px) {
  .recipe {
    --recipe-slot: 42px;
  }
  .recipe-gui {
    gap: 7px;
  }
  .recipe-slot.recipe-output {
    --recipe-slot: 46px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .recipe-await .recipe-item,
  .recipe-await .recipe-count {
    opacity: 0;
  }

  .recipe-reveal .recipe-item,
  .recipe-reveal .recipe-count {
    animation: recipe-reveal 180ms steps(5, end) both;
    animation-delay: calc(var(--recipe-order) * 65ms);
  }

  .recipe-reveal .recipe-output .recipe-item,
  .recipe-reveal .recipe-output .recipe-count {
    animation-timing-function: ease-out;
    animation-name: recipe-pop;
  }

  @keyframes recipe-reveal {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  @keyframes recipe-pop {
    from { opacity: 0; scale: .7; }
    65% { opacity: 1; scale: 1.12; }
    to { opacity: 1; scale: 1; }
  }
}
