/* Crafting category pages, recipe grids, and crafting item tiles. */


.crafting-item-tile strong {
    display: block;
    color: #2f1809;
    line-height: 1.2;
}

.crafting-category-list-icon {
    border: 1px solid #8f6a47;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 900;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.55);
}

.crafting-category-list-icon {
    font-size: 0.95rem;
}

.crafting-recipe-table-wrap {
    overflow: visible;
    padding-bottom: 0;
}

.crafting-recipe-table-wrap--category {
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 3px;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
    scrollbar-width: thin;
}

.crafting-recipe-table-wrap--category::-webkit-scrollbar {
    height: 10px;
}

.crafting-recipe-table-wrap--category::-webkit-scrollbar-track {
    background:
        linear-gradient(180deg, rgba(255, 253, 238, 0.72), rgba(224, 204, 150, 0.48)),
        var(--scrollbar-track);
    box-shadow: inset 0 0 0 1px rgba(91, 56, 24, 0.16);
}

.crafting-recipe-table-wrap--category::-webkit-scrollbar-thumb {
    border: 3px solid var(--scrollbar-edge);
    border-radius: 999px;
    background:
        linear-gradient(90deg, #b45a43, var(--scrollbar-thumb) 52%, #5d3210);
    background-clip: padding-box;
}

.crafting-recipe-table-wrap--category::-webkit-scrollbar-thumb:hover {
    background:
        linear-gradient(90deg, #c16d4c, var(--scrollbar-thumb-hover) 58%, #3a1209);
    background-clip: padding-box;
}

.crafting-recipe-grid {
    width: 100%;
    min-width: 0;
}

.crafting-grid-head,
.crafting-grid-row {
    display: grid;
    grid-template-columns: minmax(78px, 0.72fr) minmax(150px, 2.3fr) minmax(58px, 0.46fr) minmax(86px, 0.7fr) minmax(74px, 0.62fr);
    width: 100%;
    min-width: 0;
}

.crafting-grid-head {
    position: sticky;
    z-index: 20;
    border-bottom: 1px solid rgba(255, 248, 223, 0.28);
    font-size: 0.73rem;
    font-weight: 900;
    letter-spacing: 0;
    text-align: center;
    text-shadow: 1px 1px 2px #000;
}

.crafting-grid-head span {
    display: grid;
    place-items: center;
    min-width: 0;
}

.crafting-grid-head span:first-child {
    border-left: 0;
}

.crafting-grid-row {
    border-top: 1px solid rgba(73, 51, 31, 0.72);
}

.crafting-grid-cell {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
}

.crafting-grid-cell:first-child {
    border-left: 0;
}

.crafting-grid-label {
    display: none;
}

.crafting-item-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    min-width: 0;
}

.crafting-variant-switcher {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    width: 100%;
    min-width: 0;
    gap: 5px;
}

.crafting-variant-stage {
    width: 100%;
    min-width: 0;
}

.crafting-variant-stage:only-child {
    grid-column: 1 / -1;
}

.crafting-variant {
    display: none;
}

.crafting-item-strip.crafting-variant.is-active {
    --wiki-item-cell-size: 32px;

    display: grid;
    grid-template-columns: repeat(auto-fill, 32px);
    align-items: start;
    width: 100%;
    gap: 2px;
}

.crafting-item-strip.crafting-variant.is-active > .crafting-item-tile--icon-only {
    width: 32px;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 3px;
    gap: 0;
}

.crafting-item-strip.crafting-variant.is-active > .crafting-item-tile--icon-only .crafting-item-icon {
    width: 32px;
    height: 100%;
    border: 0;
    border-radius: 3px;
}

.crafting-item-strip.crafting-variant.is-active > .crafting-item-tile--icon-only .crafting-item-icon span {
    right: 0;
    bottom: 0;
    min-width: 16px;
    padding: 0 3px;
    font-size: 0.56rem;
    line-height: 1.35;
}

.crafting-grid-stat .crafting-variant.is-active {
    display: inline-block;
}

.crafting-variant-arrow {
    display: grid;
    place-items: center;
    width: 22px;
    height: 28px;
    padding: 0;
    border: 1px solid rgba(143, 106, 71, 0.8);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
}

.crafting-variant-arrow:hover,
.crafting-variant-arrow:focus-visible {
    outline: 0;
}

.crafting-item-strip--reward,
.crafting-grid-stat,
.crafting-grid-npc-cell {
    justify-content: center;
}

.crafting-grid-reward {
    justify-content: center;
    text-align: center;
}

.crafting-grid-reward .crafting-item-strip {
    justify-content: center;
    width: 100%;
}

.crafting-grid-stat {
    color: #2f1809;
    font-size: 0.78rem;
    text-align: center;
}

.crafting-grid-stat strong {
    overflow-wrap: anywhere;
}

.crafting-grid-empty {
    color: #2f1809;
    font-weight: 900;
}

.crafting-grid-npc {
    display: grid;
    justify-items: center;
    max-width: 100%;
    gap: 3px;
    text-align: center;
}

.crafting-grid-npc.crafting-variant {
    display: none;
}

.crafting-grid-npc.crafting-variant.is-active {
    display: grid;
}

.crafting-grid-npc img {
    object-fit: contain;
}

.crafting-grid-npc strong {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.15;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.crafting-item-tile {
    position: relative;
    display: grid;
    justify-items: center;
    min-width: 0;
    gap: 4px;
    padding: 3px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    text-align: center;
    transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.crafting-item-tile--named {
    width: 76px;
    min-height: 68px;
}

.crafting-item-tile--icon-only {
    width: 40px;
    min-height: 40px;
}

.crafting-item-tile,
.crafting-item-tile:link,
.crafting-item-tile:visited,
.crafting-item-tile:hover,
.crafting-item-tile:focus-visible,
.crafting-item-tile:focus-within,
.crafting-item-name,
.crafting-item-name strong {
    text-decoration: none;
}

.crafting-item-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff8df;
}

.crafting-item-tile--proto-size-2 {
    width: 84px;
    min-height: 78px;
}

.crafting-item-tile--proto-size-2 .crafting-item-icon {
    width: 46px;
    height: 66px;
}

.crafting-item-tile--proto-size-3 {
    width: 92px;
    min-height: 88px;
}

.crafting-item-tile--proto-size-3 .crafting-item-icon {
    width: 57px;
    height: 98px;
}

.crafting-item-tile--icon-only.crafting-item-tile--proto-size-2,
.crafting-item-tile--icon-only.crafting-item-tile--proto-size-3 {
    width: 40px;
}

.crafting-item-tile--icon-only.crafting-item-tile--proto-size-2 .crafting-item-icon,
.crafting-item-tile--icon-only.crafting-item-tile--proto-size-3 .crafting-item-icon {
    width: 38px;
}

.crafting-item-icon span {
    position: absolute;
    right: -7px;
    bottom: -6px;
    min-width: 22px;
    padding: 0 5px;
    border-radius: 999px;
    background: #5d3210;
    color: #fff;
    font-size: 0.58rem;
    font-weight: 900;
    line-height: 1.5;
    text-align: center;
}

.crafting-item-name {
    display: block;
    width: 100%;
    min-width: 0;
}

.crafting-item-name strong {
    display: -webkit-box;
    overflow: hidden;
    color: #4b4034;
    font-size: 0.62rem;
    line-height: 1.12;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}


.crafting-category-list-icon {
    border-color: #8b6040;
    border-radius: 3px;
    background:
        radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.42), transparent 22px),
        linear-gradient(180deg, #fff9df, #d9c27f);
    color: var(--accent-strong);
}

/* When a real item icon is available, drop the lettered parchment plate so the
   icon image (framed like the shop/item tiles) is the single visible frame. */
.crafting-category-list-icon--img {
    background: none;
    box-shadow: none;
    overflow: hidden;
}

.crafting-recipe-grid {
    border-radius: 2px;
}

/* Map/Mob-aligned crafting browser. */

.crafting-profile {
    display: grid;
    min-width: 0;
    gap: 10px;
}

.crafting-profile-card.map-wiki-card {
    display: grid;
    min-width: 0;
    gap: 0;
    overflow: visible;
    border: 2px solid #7a1a13;
    border-radius: 18px 18px 0 0;
    background: #fbfade;
    box-shadow: 7px 9px 15px rgba(19, 13, 6, 0.36);
}

.crafting-profile-card > .crafting-profile-title {
    border-radius: 15px 15px 0 0;
}

.crafting-profile-title.map-wiki-titlebar {
    min-height: 44px;
    justify-content: flex-start;
    padding: 5px 18px;
    background: #2f1d1f;
    color: #f2e4b5;
}

.crafting-profile-title.map-wiki-titlebar h1 {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    color: inherit;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.18rem, 1.55vw, 1.55rem);
    line-height: 1.1;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
}

.crafting-profile .crafting-browser {
    display: grid;
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
    align-items: start;
    width: 100%;
    min-width: 0;
    gap: 12px;
    padding: 18px 12px 14px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.crafting-profile .crafting-category-panel,
.crafting-profile .crafting-selected-overview,
.crafting-profile .crafting-recipes-panel {
    min-width: 0;
    border: 2px solid #9e332d;
    border-radius: 0;
    background: rgba(255, 255, 232, 0.54);
    box-shadow: none;
}

.crafting-profile .crafting-category-panel {
    position: sticky;
    top: 86px;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    max-height: calc(100vh - 104px);
    min-height: 420px;
    padding: 8px 8px 0;
    overflow: visible;
}

.crafting-profile .crafting-category-panel > h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(230px, 76%);
    min-height: 44px;
    margin: 0 auto 8px;
    padding: 6px 14px;
    border: 1px solid #f0d9a2;
    border-radius: 12px;
    background: #2f1d1f;
    color: #f0d9a2;
    font-family: Tahoma, Arial, sans-serif;
    font-size: clamp(1rem, 1.1vw, 1.18rem);
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    text-shadow: 1px 1px 2px #000;
    box-shadow: 2px 3px 7px rgba(20, 8, 2, 0.36);
}

.crafting-profile .shop-search-form {
    z-index: 90;
    gap: 7px;
    padding: 0 0 8px;
    border-bottom: 1px solid rgba(158, 51, 45, 0.34);
    background: transparent;
}

.crafting-profile .shop-search-form input {
    min-height: 38px;
    padding: 0 11px;
    border-color: rgba(94, 54, 29, 0.52);
    background: #fffced;
}

.crafting-profile .shop-list {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.crafting-profile .shop-list-row {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    min-height: 52px;
    padding: 6px 7px;
    border-bottom-color: rgba(158, 51, 45, 0.22);
}

.crafting-profile .shop-list-row:hover,
.crafting-profile .shop-list-row:focus-visible,
.crafting-profile .shop-list-row.is-active {
    background:
        linear-gradient(90deg, rgba(205, 163, 65, 0.32), transparent 80%),
        #f8edbf;
    color: #5f130f;
    text-decoration: none;
}

.crafting-profile .crafting-category-list-icon {
    width: 38px;
    height: 38px;
}

.crafting-profile .shop-count-pill {
    min-width: 30px;
    min-height: 24px;
    padding: 0 7px;
    border: 1px solid #3a1209;
    background: linear-gradient(180deg, #8b6040, #3a1209);
    color: #fff4cf;
}

.crafting-profile .crafting-browser-detail {
    display: grid;
    align-content: start;
    min-width: 0;
    min-height: 480px;
    gap: 18px;
    padding: 0 4px 4px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.crafting-profile .shop-empty-detail {
    min-height: 420px;
    border: 2px solid #9e332d;
    background: rgba(255, 255, 232, 0.54);
}

.crafting-selected-overview {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 12px 14px;
}

.crafting-selected-art {
    display: grid;
    place-items: center;
    width: 88px;
    height: 88px;
    border: 1px solid rgba(94, 54, 29, 0.42);
    background:
        radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.42), transparent 28px),
        linear-gradient(180deg, #fff9df, #d9c27f);
    box-shadow: inset 0 0 8px rgba(112, 68, 27, 0.16);
    color: #64100d;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2rem;
    font-weight: 900;
}

.crafting-selected-art--img {
    background: rgba(255, 248, 206, 0.85);
}

.crafting-selected-art img {
    filter: drop-shadow(3px 4px 4px rgba(0, 0, 0, 0.32));
}

.crafting-selected-copy {
    display: grid;
    min-width: 0;
    gap: 5px;
}

.crafting-selected-copy h2 {
    margin: 0;
    color: #21170e;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.35rem, 2.4vw, 2rem);
    line-height: 1.05;
}

.crafting-selected-copy p {
    max-width: 760px;
    margin: 0;
    color: #5f4b3d;
    font-size: 0.85rem;
    line-height: 1.4;
}

.crafting-selected-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    color: #5f4b3d;
    font-size: 0.78rem;
    font-weight: 800;
}

.crafting-selected-facts > span {
    display: inline-flex;
    gap: 4px;
}

.crafting-selected-facts strong {
    color: #64100d;
}

.crafting-recipes-panel {
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 10px 12px 12px;
}

.crafting-profile .crafting-recipe-table-wrap--category {
    margin: 0;
    overflow: visible;
    border: 0;
    background: transparent;
}

.crafting-profile .crafting-recipe-grid {
    display: grid;
    gap: 10px;
    border: 0;
    background: transparent;
}

.crafting-profile .crafting-grid-head {
    top: 0;
    min-height: 42px;
    overflow: hidden;
    border: 1px solid #f0d9a2;
    border-radius: 10px;
    background: #2f1d1f;
    color: #f0d9a2;
    box-shadow: 2px 3px 7px rgba(20, 8, 2, 0.3);
}

.crafting-profile .crafting-grid-head span {
    padding: 8px 7px;
    border-left: 1px solid rgba(240, 217, 162, 0.38);
}

.crafting-profile .crafting-grid-row {
    min-height: 94px;
    overflow: visible;
    border: 2px solid #9e332d;
    background: rgba(255, 255, 232, 0.7);
    box-shadow: 2px 3px 6px rgba(38, 19, 6, 0.14);
    transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.crafting-profile .crafting-grid-row:nth-of-type(even) {
    background: rgba(245, 238, 204, 0.78);
}

.crafting-profile .crafting-grid-row:hover {
    border-color: #7a1a13;
    background: #fffbe0;
    box-shadow: 3px 4px 9px rgba(38, 19, 6, 0.22);
}

.crafting-profile .crafting-grid-cell {
    padding: 8px;
    border-left: 1px solid rgba(158, 51, 45, 0.48);
}

.crafting-profile .crafting-grid-reward,
.crafting-profile .crafting-grid-npc-cell {
    background: rgba(232, 211, 148, 0.18);
}

.crafting-profile .crafting-grid-materials {
    background: rgba(255, 252, 232, 0.36);
}

.crafting-profile .crafting-item-strip {
    gap: 7px;
}

.crafting-profile .crafting-item-icon {
    border-color: #9b7447;
    border-radius: 3px;
    background: #fff9df;
    box-shadow: inset 0 0 8px rgba(112, 68, 27, 0.16);
}

.crafting-profile .crafting-item-icon span {
    border: 1px solid #3a1209;
    background: linear-gradient(180deg, #8b6040, #3a1209);
    color: #fff4cf;
}

.crafting-profile .crafting-item-name strong {
    color: #2f1809;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.66rem;
}

.crafting-profile .crafting-grid-stat strong {
    min-width: 48px;
    padding: 5px 7px;
    border: 1px solid rgba(100, 16, 13, 0.24);
    border-radius: 3px;
    background: #fff8cc;
    color: #4b1713;
    font-size: 0.76rem;
    box-shadow: inset 0 0 6px rgba(112, 68, 27, 0.12);
}

.crafting-profile .crafting-grid-stat[data-label="Költség (Yang)"] strong {
    min-width: 0;
    padding-right: 4px;
    padding-left: 4px;
    font-size: 0.68rem;
    white-space: nowrap;
}

.crafting-profile .crafting-grid-npc {
    color: #4b1713;
}

.crafting-profile .crafting-grid-npc img {
    width: 38px;
    height: 38px;
    filter: drop-shadow(2px 3px 3px rgba(0, 0, 0, 0.28));
}

.crafting-profile .crafting-grid-npc strong {
    color: #4b1713;
    font-size: 0.66rem;
}

.crafting-profile .crafting-variant-arrow {
    border-color: #7d321d;
    border-radius: 3px;
    background: #2f1d1f;
    color: #f0d9a2;
    box-shadow: 1px 2px 4px rgba(20, 8, 2, 0.24);
}

.crafting-profile .crafting-variant-arrow:hover,
.crafting-profile .crafting-variant-arrow:focus-visible {
    border-color: #f0d9a2;
    background: #3a2528;
    color: #fff7d7;
}

.crafting-profile .empty-state {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.crafting-profile .empty-state h3 {
    margin: 0 0 6px;
    color: #2c180a;
    font-family: Georgia, "Times New Roman", serif;
}

@media (max-width: 1200px) {
    .crafting-profile .crafting-browser {
        grid-template-columns: minmax(220px, 250px) minmax(0, 1fr);
    }
}

@media (max-width: 860px) {
    .crafting-profile .crafting-browser {
        grid-template-columns: 1fr;
    }

    .crafting-profile .crafting-category-panel {
        position: static;
        max-height: min(42vh, 340px);
        min-height: 0;
    }
}

@media (max-width: 760px) {
    .crafting-profile-title.map-wiki-titlebar {
        min-height: 40px;
        padding: 5px 12px;
    }

    .crafting-profile .crafting-browser {
        gap: 16px;
        padding: 16px 10px 12px;
    }

    .crafting-profile .crafting-browser-detail {
        min-height: 360px;
    }

    .crafting-profile .crafting-category-panel > h2 {
        width: min(230px, 82%);
        min-height: 42px;
    }

    .crafting-selected-overview {
        grid-template-columns: 76px minmax(0, 1fr);
        gap: 12px;
        padding: 10px;
    }

    .crafting-selected-art {
        width: 70px;
        height: 70px;
    }

    .crafting-recipes-panel {
        padding: 10px 8px 8px;
    }
}

@media (max-width: 600px) {
    .crafting-profile .crafting-recipe-table-wrap--category {
        overflow: visible;
    }

    .crafting-profile .crafting-recipe-grid {
        min-width: 0;
    }

    .crafting-profile .crafting-grid-head {
        display: none;
    }

    .crafting-profile .crafting-grid-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        min-width: 0;
        min-height: 0;
    }

    .crafting-profile .crafting-grid-cell {
        display: grid;
        align-content: start;
        justify-items: center;
        min-width: 0;
        gap: 8px;
        padding: 8px;
        border-top: 1px solid rgba(158, 51, 45, 0.48);
        border-left: 0;
    }

    .crafting-profile .crafting-grid-label {
        display: flex;
        align-items: center;
        justify-content: center;
        width: calc(100% + 16px);
        min-height: 28px;
        margin: -8px -8px 2px;
        padding: 4px 6px;
        background: #2f1d1f;
        color: #f0d9a2;
        font-size: 0.64rem;
        font-weight: 900;
        line-height: 1.15;
        text-align: center;
        text-shadow: 1px 1px 2px #000;
    }

    .crafting-profile .crafting-grid-reward {
        grid-column: 1;
        grid-row: 1;
        min-height: 128px;
        border-top: 0;
    }

    .crafting-profile .crafting-grid-npc-cell {
        grid-column: 2;
        grid-row: 1;
        min-height: 128px;
        border-top: 0;
        border-left: 1px solid rgba(158, 51, 45, 0.48);
    }

    .crafting-profile .crafting-grid-materials {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .crafting-profile .crafting-grid-stat[data-label="Esély"] {
        grid-column: 1;
        grid-row: 3;
        min-height: 72px;
    }

    .crafting-profile .crafting-grid-stat[data-label="Költség (Yang)"] {
        grid-column: 2;
        grid-row: 3;
        min-height: 72px;
        border-left: 1px solid rgba(158, 51, 45, 0.48);
    }

    .crafting-profile .crafting-item-strip,
    .crafting-profile .crafting-item-strip--reward {
        justify-content: center;
    }

    .crafting-profile .crafting-variant-switcher {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }
}

@media (max-width: 520px) {
    .crafting-selected-overview {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .crafting-selected-copy {
        justify-items: center;
    }

    .crafting-selected-facts {
        justify-content: center;
    }
}
