/* ============================================================
   MCF Crafts - Rendu front (v1.0.0)
   Table de craft style Minecraft + infobulle facon jeu
   ============================================================ */

.mcf-craft {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 1.4em auto;
}

.mcf-craft.alignleft {
    align-items: flex-start;
}

.mcf-craft.alignright {
    align-items: flex-end;
}

.mcf-craft-caption {
    margin: 10px 0 0;
    font-size: 0.85em;
    line-height: 1.5;
    font-style: italic;
    color: inherit;
    opacity: 0.72;
    text-align: center;
    max-width: 420px;
}

.mcf-craft-gui {
    display: flex;
    align-items: center;
    gap: 18px;
    background: #c6c6c6;
    padding: 16px;
    border: 3px solid;
    border-color: #ffffff #555555 #555555 #ffffff;
    border-radius: 3px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}

.mcf-craft-grid {
    display: grid;
    grid-template-columns: repeat(3, 44px);
    grid-template-rows: repeat(3, 44px);
    gap: 4px;
}

.mcf-craft-slot {
    width: 44px;
    height: 44px;
    background: #8b8b8b;
    border: 2.5px solid;
    border-color: #373737 #ffffff #ffffff #373737;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.mcf-craft-slot.has-item {
    cursor: pointer;
}

.mcf-craft-slot.has-item:hover {
    background: #9d9d9d;
}

.mcf-craft-frame {
    display: none;
    line-height: 0;
    text-decoration: none !important;
    border: 0 !important;
    box-shadow: none !important;
}

.mcf-craft-frame.is-active,
.mcf-craft-frame[data-frame="all"] {
    display: block;
}

.mcf-craft-item {
    width: auto;
    height: auto;
    max-width: 32px;
    max-height: 32px;
    object-fit: contain;
    image-rendering: auto;
    display: block;
}

.mcf-craft-arrow {
    width: 34px;
    height: 24px;
    position: relative;
    flex: 0 0 auto;
}

.mcf-craft-arrow::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 20px;
    height: 8px;
    background: #8b8b8b;
}

.mcf-craft-arrow::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    border-left: 14px solid #8b8b8b;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
}

.mcf-craft-result-wrap {
    padding: 6px;
}

.mcf-craft-slot.mcf-craft-result {
    width: 52px;
    height: 52px;
}

.mcf-craft-result .mcf-craft-item {
    max-width: 38px;
    max-height: 38px;
}

.mcf-craft-count {
    position: absolute;
    right: 1px;
    bottom: -1px;
    font-family: monospace;
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    text-shadow: 2px 2px 0 #3f3f3f;
    pointer-events: none;
}

/* --- Infobulle facon jeu --- */

.mcf-craft-tip {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 999999;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .06s linear, visibility .06s linear;
    will-change: transform;
}

.mcf-craft-tip.is-visible {
    opacity: 1;
    visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
    .mcf-craft-tip {
        transition: none;
    }
}

.mcf-craft-tip-box {
    display: block;
    background: rgba(16, 0, 16, .94);
    border: 2px solid #25015b;
    outline: 2px solid rgba(16, 0, 16, .94);
    padding: 5px 9px;
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    border-radius: 2px;
}

/* --- Mobile : grille reduite --- */

@media (max-width: 480px) {
    .mcf-craft-gui {
        gap: 12px;
        padding: 12px;
    }

    .mcf-craft-grid {
        grid-template-columns: repeat(3, 38px);
        grid-template-rows: repeat(3, 38px);
    }

    .mcf-craft-slot {
        width: 38px;
        height: 38px;
    }

    .mcf-craft-item {
        max-width: 28px;
        max-height: 28px;
    }

    .mcf-craft-slot.mcf-craft-result {
        width: 46px;
        height: 46px;
    }

    .mcf-craft-result .mcf-craft-item {
        max-width: 34px;
        max-height: 34px;
    }

    .mcf-craft-arrow {
        width: 26px;
    }

    .mcf-craft-arrow::before {
        width: 12px;
    }
}
