/* Crafting recipe tables: catalog/partials/recipe */

.recipe-container {
    font-family: 'Baloo 2', Arial, sans-serif;
    color: var(--cartoon-ink);
}

.recipe-caption {
    margin: 0 0 10px;
    font-family: 'Baloo 2', Arial, sans-serif;
    font-size: 17px;
    font-weight: 600;
    color: var(--cartoon-ink);
}

/* Station the recipe is made at, e.g. Crafting Table */
.recipe-station {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 4px 12px 4px 4px;
    border-radius: 999px;
    background: var(--cartoon-soft);
    border: 2px solid var(--cartoon-line);
    font-size: 14px;
    font-weight: 700;
}

.recipe-station-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #fff;
}

.recipe-station-icon img {
    width: 22px;
    height: 22px;
    image-rendering: pixelated;
}

/* The table itself: ingredients, arrow and output in a row */
.recipe-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    background: #f7faf3;
    border: 2px solid var(--cartoon-line);
}

/* 3x3 crafting grid */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(3, 56px);
    gap: 4px;
    padding: 8px;
    border-radius: 12px;
    background: #8b8b8b;
    border: 3px solid #373737;
}

.recipe-slot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: #bdbdbd;
    border: 2px solid #373737;
}

.recipe-slot img {
    width: 40px;
    height: 40px;
    image-rendering: pixelated;
}

.recipe-slot > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.recipe-slot > a:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Output slot: solid green so the result stands out */
.recipe-output-slot {
    width: 64px;
    height: 64px;
    background: var(--gx-blue);
    border-color: var(--gx-blue-dark);
}

.recipe-output-slot img {
    width: 40px;
    height: 40px;
}

.recipe-output-slot .badge {
    margin: 0 4px 4px 0;
    background: #1f2d1a;
    color: #fff;
    border-radius: 6px;
}

/* Arrow between the grid and the output: solid triangle */
.recipe-arrow {
    display: inline-block;
    flex: 0 0 auto;
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 16px solid var(--gx-blue);
}

/* Furnace style: input, flame and fuel stacked, then the output */
.recipe-furnace-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.recipe-flame {
    display: inline-flex;
    width: 28px;
    height: 28px;
}

.recipe-flame svg {
    width: 100%;
    height: 100%;
}

.recipe-fuel-slot {
    background: #bdbdbd;
}

/* Tag ingredients rotate through their options; only the active one shows */
.recipe-tag-rotator {
    position: relative;
    width: 100%;
    height: 100%;
}

.recipe-tag-frame {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
}

.recipe-tag-frame.is-active {
    display: flex;
}

.recipe-slot .recipe-tag-rotator {
    display: flex;
    align-items: center;
    justify-content: center;
}

.recipe-slot .recipe-tag-frame {
    position: static;
    display: none;
    width: 100%;
    height: 100%;
}

.recipe-slot .recipe-tag-frame.is-active {
    display: flex;
}

/* Ingredient list underneath: solid rows */
.recipe-ingredients {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.recipe-ingredients li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    border-radius: 12px;
    background: #fff;
    border: 2px solid var(--cartoon-line);
    font-size: 14px;
    font-weight: 700;
}

.recipe-ingredient-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 8px;
    background: #bdbdbd;
    border: 2px solid #373737;
}

.recipe-ingredient-icon img {
    width: 34px;
    height: 34px;
    image-rendering: pixelated;
}

.recipe-ingredient-options {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.recipe-ingredient-options a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 5px;
    background: #bdbdbd;
    border: 2px solid #373737;
    flex-shrink: 0;
}

.recipe-ingredient-options img {
    width: 22px;
    height: 22px;
    image-rendering: pixelated;
}

.recipe-ingredient-count {
    display: inline-block;
    min-width: 36px;
    padding: 2px 8px;
    border-radius: 8px;
    background: var(--gx-blue);
    color: #fff;
    text-align: center;
    font-weight: 800;
}

@media (max-width: 575.98px) {
    .recipe-grid {
        grid-template-columns: repeat(3, 48px);
    }

    .recipe-slot {
        width: 48px;
        height: 48px;
    }

    .recipe-slot img {
        width: 34px;
        height: 34px;
    }

    .recipe-output-slot {
        width: 56px;
        height: 56px;
    }
}
