.magic-wand-page {
    --fi-green: #ff9f45;
    --fi-cyan: #75e7ff;
    --fi-gold: #ffd45f;
    --fi-violet: #caa7ff;
    --fi-red: #ff8fa3;
}

.magic-wand-page .fi-progress {
    background: linear-gradient(90deg, var(--fi-violet), var(--fi-cyan), var(--fi-green), var(--fi-gold));
}

.magic-wand-page .fi-hero::before {
    background:
        linear-gradient(90deg, rgba(4, 8, 18, 0.99) 0%, rgba(4, 8, 18, 0.94) 42%, rgba(11, 8, 29, 0.48) 68%, rgba(20, 8, 25, 0.15)),
        radial-gradient(circle at 79% 45%, rgba(255, 143, 44, 0.26), transparent 15rem),
        radial-gradient(circle at 76% 48%, rgba(117, 231, 255, 0.2), transparent 29rem),
        url("../../pics/minecraft-114-magic-wand-hero.png") 80% 48% / min(44vw, 560px) auto no-repeat,
        #07101d;
}

.magic-wand-page .fi-hero h1 {
    max-width: 11ch;
}

.magic-wand-page .fi-hero h1 span,
.magic-wand-page .fi-shot figcaption strong {
    color: var(--fi-green);
}

.magic-wand-page .fi-step-index,
.magic-wand-page .fi-primary {
    color: #180b02;
}

.magic-wand-page .fi-download {
    border-color: rgba(202, 167, 255, 0.36);
    background: linear-gradient(135deg, rgba(202, 167, 255, 0.12), rgba(255, 159, 69, 0.1));
}

.mw-texture-lab {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
    gap: 1.4rem;
    align-items: center;
    margin: 1.5rem 0;
    padding: 1.4rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(117, 231, 255, 0.06), rgba(202, 167, 255, 0.07));
}

.mw-texture-preview {
    display: grid;
    place-items: center;
    min-height: 310px;
    border-radius: 9px;
    background-color: #121722;
    background-image:
        linear-gradient(45deg, #252b38 25%, transparent 25%),
        linear-gradient(-45deg, #252b38 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #252b38 75%),
        linear-gradient(-45deg, transparent 75%, #252b38 75%);
    background-position: 0 0, 0 16px, 16px -16px, -16px 0;
    background-size: 32px 32px;
}

.mw-texture-preview img {
    width: min(76%, 250px);
    height: auto;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 20px rgba(255, 148, 55, 0.5));
}

.mw-texture-copy h3 {
    margin-top: 0;
}

.mw-resource-chain {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.7rem;
    margin: 1.3rem 0;
}

.mw-resource-node {
    position: relative;
    min-width: 0;
    padding: 1rem;
    border: 1px solid rgba(117, 231, 255, 0.25);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.035);
}

.mw-resource-node:not(:last-child)::after {
    content: "→";
    position: absolute;
    top: 50%;
    right: -0.62rem;
    z-index: 2;
    color: var(--fi-cyan);
    transform: translate(50%, -50%);
    font-weight: 900;
}

.mw-resource-node strong,
.mw-resource-node code {
    overflow-wrap: anywhere;
}

.mw-recipe {
    display: grid;
    grid-template-columns: auto 42px minmax(160px, 1fr);
    gap: 1rem;
    align-items: center;
    margin: 1.4rem 0;
}

.mw-recipe-grid {
    display: grid;
    grid-template-columns: repeat(3, 66px);
    grid-template-rows: repeat(3, 66px);
    gap: 5px;
}

.mw-recipe-cell {
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.045);
    color: rgba(247, 244, 236, 0.84);
    font-size: 0.78rem;
    text-align: center;
}

.mw-recipe-arrow {
    color: var(--fi-green);
    font-size: 2rem;
    font-weight: 900;
}

.mw-recipe-result {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.mw-recipe-result img {
    width: 96px;
    height: 96px;
    image-rendering: pixelated;
}

.mw-flow-figure img {
    display: block;
    width: min(100%, 800px);
    height: auto;
    margin-inline: auto;
}

@media (max-width: 820px) {
    .mw-resource-chain {
        grid-template-columns: 1fr 1fr;
    }

    .mw-resource-node:not(:last-child)::after {
        display: none;
    }
}

@media (max-width: 700px) {
    .magic-wand-page .fi-hero::before {
        background:
            linear-gradient(0deg, rgba(4, 8, 18, 0.99) 0%, rgba(4, 8, 18, 0.91) 55%, rgba(11, 8, 29, 0.3) 86%),
            radial-gradient(circle at 72% 23%, rgba(255, 143, 44, 0.22), transparent 13rem),
            url("../../pics/minecraft-114-magic-wand-hero.png") 70% 18% / 70vw auto no-repeat,
            #07101d;
    }

    .magic-wand-page .fi-lesson,
    .magic-wand-page .fi-section,
    .magic-wand-page .fi-steps,
    .magic-wand-page .fi-step,
    .magic-wand-page .fi-code,
    .magic-wand-page pre {
        min-width: 0;
        max-width: 100%;
    }

    .magic-wand-page .fi-section :not(pre) > code,
    .magic-wand-page .fi-step :not(pre) > code {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .mw-texture-lab,
    .mw-resource-chain,
    .mw-recipe {
        grid-template-columns: 1fr;
    }

    .mw-texture-preview {
        min-height: 250px;
    }

    .mw-recipe-arrow {
        transform: rotate(90deg);
        justify-self: center;
    }
}
