/* =========================
   Material Planner
========================= */

.material-planner-page {
    --planner-blue: #2f9fe8;
    --planner-blue-light: #65baf0;
    --planner-blue-bright: #7bc7f5;
    --planner-blue-dark: #2377ad;

    --planner-blue-soft: rgba(47, 159, 232, 0.10);
    --planner-blue-soft-hover: rgba(47, 159, 232, 0.16);

    --planner-panel-blue: #202a31;

    --planner-gray: #242424;
    --planner-gray-dark: #1b1b1b;
    --planner-gray-light: #2b2b2b;

    --planner-border: #555;
    --planner-border-soft: #444;

    width: min(100% - 32px, 1000px);

    margin: 0 auto;
    padding: 40px 0 60px;
}


/* =========================
   Add Material
========================= */

.planner-input-card {
    position: relative;

    box-sizing: border-box;
    overflow: visible;

    padding: 28px;

    background-color: var(--planner-panel-blue);

    background-image:
        linear-gradient(
            rgba(47, 159, 232, 0.045) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(47, 159, 232, 0.045) 1px,
            transparent 1px
        );

    background-size: 24px 24px;

    border: 2px solid #356f94;
    border-radius: 12px;

    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.30),
        0 0 16px rgba(47, 159, 232, 0.06);
}


/* Blueprint Corners */

.planner-input-card::before,
.planner-input-card::after {
    content: "";

    position: absolute;

    width: 42px;
    height: 42px;

    pointer-events: none;
}


/* Top Right */

.planner-input-card::before {
    top: 12px;
    right: 12px;

    border-top: 1px solid rgba(101, 186, 240, 0.32);
    border-right: 1px solid rgba(101, 186, 240, 0.32);
}


/* Bottom Left */

.planner-input-card::after {
    bottom: 12px;
    left: 12px;

    border-bottom: 1px solid rgba(101, 186, 240, 0.24);
    border-left: 1px solid rgba(101, 186, 240, 0.24);
}


.planner-input-card h2 {
    position: relative;
    z-index: 1;

    margin: 0 0 24px;

    color: var(--planner-blue-bright);

    font-size: 20px;
}


/* =========================
   Input Layout
========================= */

.planner-input-grid {
    position: relative;
    z-index: 20;

    display: grid;
    grid-template-columns: 1fr 220px;

    gap: 20px;
}


.material-select-group,
.amount-input-group {
    display: flex;
    flex-direction: column;

    gap: 9px;
}


.material-select-group {
    position: relative;
}


.material-select-group label,
.amount-input-group label {
    color: #bcbcbc;

    font-size: 12px;
}


/* =========================
   Inputs
========================= */

.material-search,
.material-amount {
    box-sizing: border-box;

    width: 100%;

    padding: 14px 15px;

    background-color: #191b1d;
    color: white;

    border: 1px solid #4b555c;
    border-radius: 8px;

    font-size: 13px;

    outline: none;

    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}


.material-search::placeholder,
.material-amount::placeholder {
    color: #717171;
}


.material-search:hover,
.material-amount:hover {
    border-color: var(--planner-blue-dark);
}


.material-search:focus,
.material-amount:focus {
    background-color: #1e2225;

    border-color: var(--planner-blue);

    box-shadow:
        0 0 8px rgba(47, 159, 232, 0.22);
}


/* =========================
   Remove Number Arrows
========================= */

.material-amount::-webkit-outer-spin-button,
.material-amount::-webkit-inner-spin-button,
.input-edit-amount::-webkit-outer-spin-button,
.input-edit-amount::-webkit-inner-spin-button {
    -webkit-appearance: none;

    margin: 0;
}


.material-amount,
.input-edit-amount {
    -moz-appearance: textfield;
    appearance: textfield;
}


/* =========================
   Material Search Dropdown
========================= */

.material-search-results {
    position: absolute;

    top: calc(100% + 6px);
    left: 0;
    right: 0;

    z-index: 10;

    max-height: 260px;

    overflow-y: auto;

    padding: 5px;

    background-color: #1c1c1c;

    border: 1px solid #415c6c;
    border-radius: 8px;

    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.4);

    scrollbar-width: thin;
    scrollbar-color: var(--planner-blue-dark) #1c1c1c;
}


/* =========================
   Search Options
========================= */

.material-search-results .search-option {
    display: flex;
    align-items: center;

    gap: 10px;

    padding: 9px 10px;

    background-color: #232323;
    color: #d4d4d4;

    border: 1px solid #343434;
    border-radius: 5px;

    cursor: pointer;

    transition:
        transform 0.15s ease,
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}


.material-search-results .search-option + .search-option {
    margin-top: 4px;
}


.material-search-results .search-option:hover,
.material-search-results .search-option.selected {
    transform: translateY(-2px);

    background-color: #252c30;
    color: #f0f0f0;

    border-color: #426d86;
}


/* =========================
   Search Scrollbar
========================= */

.material-search-results::-webkit-scrollbar {
    width: 9px;
}


.material-search-results::-webkit-scrollbar-track {
    background-color: #1c1c1c;

    border-radius: 8px;
}


.material-search-results::-webkit-scrollbar-thumb {
    background-color: var(--planner-blue-dark);

    border: 2px solid #1c1c1c;
    border-radius: 8px;
}


.material-search-results::-webkit-scrollbar-thumb:hover {
    background-color: var(--planner-blue);
}


/* =========================
   Add Material Button
========================= */

.add-material-button {
    position: relative;
    z-index: 1;

    display: block;

    margin: 22px 0 0 auto;
    padding: 13px 20px;

    background-color: #347da6;
    color: white;

    border: 1px solid var(--planner-blue);
    border-radius: 8px;

    font-size: 12px;

    cursor: pointer;

    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.25);

    transition:
        transform 0.18s ease,
        background-color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}


.add-material-button:hover {
    transform: translateY(-2px);

    background-color: #428fb8;

    border-color: var(--planner-blue-light);

    box-shadow:
        0 6px 14px rgba(0, 0, 0, 0.3),
        0 0 10px rgba(47, 159, 232, 0.20);
}


/* =========================
   Add Material Error
========================= */

.add-material-button.error {
    background-color: #9e4652;
    color: white;

    border-color: #cf6675;

    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.25),
        0 0 9px rgba(207, 102, 117, 0.18);
}


.add-material-button.error:hover {
    transform: none;

    background-color: #9e4652;

    border-color: #cf6675;
}


/* =========================
   Add Material Success
========================= */

.add-material-button.success {
    background-color: #4f8f61;

    border-color: #70b883;

    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.25),
        0 0 9px rgba(112, 184, 131, 0.18);
}


.add-material-button.success:hover {
    transform: none;

    background-color: #4f8f61;

    border-color: #70b883;
}


/* =========================
   Material List
========================= */

.material-list-section {
    margin-top: 28px;
    padding: 26px;

    background-color: #242424;

    border: 1px solid #555;
    border-radius: 12px;

    box-shadow:
        0 7px 20px rgba(0, 0, 0, 0.26);
}


.material-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 20px;
}


.material-list-header h2 {
    margin: 0;

    font-size: 20px;
}


/* =========================
   Material Count
========================= */

.material-count {
    position: relative;

    overflow: hidden;

    min-width: 70px;

    padding: 13px 12px 8px;

    background-color: var(--planner-blue-soft);
    color: var(--planner-blue-bright);

    border: 1px solid #356f94;
    border-radius: 6px;

    font-size: 10px;

    text-align: center;
}


/* Ruler Decoration INSIDE Badge At Top */

.material-count::before {
    content: "";

    position: absolute;

    top: 3px;
    left: 8px;
    right: 8px;

    height: 4px;

    opacity: 0.42;

    background:
        repeating-linear-gradient(
            90deg,
            var(--planner-blue) 0,
            var(--planner-blue) 1px,
            transparent 1px,
            transparent 7px
        );

    border-top: 1px solid rgba(47, 159, 232, 0.40);

    pointer-events: none;
}


/* Tiny Endpoint Dot */

.material-count::after {
    content: "";

    position: absolute;

    top: 2px;
    left: 7px;

    width: 3px;
    height: 3px;

    background-color: var(--planner-blue);

    border-radius: 50%;

    opacity: 0.70;

    pointer-events: none;
}


/* =========================
   Material List Scroll Area
========================= */

.material-list {
    position: relative;

    max-height: calc(38px + (6 * 92px));

    overflow-y: auto;
    overflow-x: hidden;

    scrollbar-width: thin;
    scrollbar-color: var(--planner-blue-dark) #1c1c1c;
}


.material-list img {
    image-rendering: optimizeQuality;
}


.material-list::-webkit-scrollbar {
    width: 9px;
}


.material-list::-webkit-scrollbar-track {
    background-color: #1c1c1c;

    border-radius: 8px;
}


.material-list::-webkit-scrollbar-thumb {
    background-color: var(--planner-blue-dark);

    border: 2px solid #1c1c1c;
    border-radius: 8px;
}


.material-list::-webkit-scrollbar-thumb:hover {
    background-color: var(--planner-blue);
}


/* =========================
   Material Columns
========================= */

.material-list-columns,
.material-row {
    display: grid;

    grid-template-columns:
        minmax(220px, 1fr)
        130px
        130px
        150px;

    align-items: center;

    gap: 14px;
}


.material-list-columns {
    position: sticky;

    top: 0;
    z-index: 3;

    padding: 0 16px 12px;

    background-color: #242424;
    color: #777;

    border-bottom: 1px solid rgba(255, 255, 255, 0.08);

    font-size: 10px;
    text-transform: uppercase;
}


/* =========================
   Empty Material List
========================= */

.material-list-empty {
    padding: 48px 20px;

    text-align: center;
}


.material-list-empty p {
    margin: 0 0 9px;

    color: #c9c9c9;

    font-size: 14px;
}


.material-list-empty span {
    color: #747474;

    font-size: 10px;
    line-height: 1.6;
}


/* =========================
   Material Row
========================= */

.material-row {
    padding: 15px 16px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.06);

    cursor: pointer;

    transition:
        background-color 0.18s ease,
        box-shadow 0.18s ease;
}


.material-row:last-child {
    border-bottom: none;
}


.material-row:hover {
    background-color: rgba(255, 255, 255, 0.025);
}


.material-row.selected {
    background-color: rgba(47, 159, 232, 0.07);

    box-shadow:
        inset 3px 0 0 var(--planner-blue);
}


/* =========================
   Material Information
========================= */

.material-info {
    display: flex;
    align-items: center;

    gap: 13px;

    min-width: 0;
}


.material-info[role="button"]:focus-visible {
    outline: 2px solid var(--planner-blue);
    outline-offset: 4px;

    border-radius: 5px;
}


.material-image {
    flex-shrink: 0;

    width: 38px;
    height: 38px;

    object-fit: contain;
}


.material-name {
    overflow: hidden;

    color: #e4e4e4;

    font-size: 12px;

    text-overflow: ellipsis;
    white-space: nowrap;
}


.material-total {
    color: #d4d4d4;

    font-size: 12px;
}


.material-stacks {
    color: var(--planner-blue-light);

    font-size: 12px;
}


/* =========================
   Material Actions
========================= */

.material-actions {
    display: flex;

    gap: 7px;
}


.edit-material,
.remove-material,
.save-confirmation,
.cancel-confirmation,
.yes-confirmation,
.no-confirmation {
    padding: 8px 11px;

    border-radius: 6px;

    font-size: 10px;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}


/* Edit */

.edit-material {
    background-color: #252b2f;
    color: #78b9dc;

    border: 1px solid #3d6277;
}


.edit-material:hover {
    background-color: #293640;

    border-color: var(--planner-blue);
}


/* Remove */

.remove-material {
    background-color: #2d2426;
    color: #c9787f;

    border: 1px solid #694348;
}


.remove-material:hover {
    background-color: #39282b;

    border-color: #a85c65;
}


/* Save */

.save-confirmation {
    background-color: #294232;
    color: #82cf94;

    border: 1px solid #4f8f61;
}


.save-confirmation:hover {
    background-color: #31513c;

    border-color: #70b883;
}


/* Cancel */

.cancel-confirmation,
.no-confirmation {
    background-color: #303030;
    color: #bdbdbd;

    border: 1px solid #555;
}


.cancel-confirmation:hover,
.no-confirmation:hover {
    background-color: #383838;

    border-color: #707070;
}


/* Yes */

.yes-confirmation {
    background-color: #48292e;
    color: #e1848e;

    border: 1px solid #a4545e;
}


.yes-confirmation:hover {
    background-color: #583037;

    border-color: #cf6675;
}


/* =========================
   Edit Amount Input
========================= */

.input-edit-amount {
    box-sizing: border-box;

    width: 100%;
    max-width: 100px;

    padding: 7px 9px;

    background-color: #1b1b1b;
    color: white;

    border: 1px solid #3f6f8a;
    border-radius: 6px;

    outline: none;

    font-size: 12px;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}


.input-edit-amount:focus {
    background-color: #202326;

    border-color: var(--planner-blue);

    box-shadow:
        0 0 7px rgba(47, 159, 232, 0.22);
}


/* =========================
   Crafting
========================= */

.crafting-section {
    position: relative;

    margin-top: 14px;
    padding: 26px;

    overflow: visible;

    background-color: #242424;

    border: 1px solid #555;
    border-radius: 12px;

    box-shadow:
        0 7px 20px rgba(0, 0, 0, 0.26);
}


/* =========================
   Material List Connection
========================= */

.crafting-connector {
    position: absolute;

    top: -15px;
    left: 50%;

    width: 2px;
    height: 15px;

    background-color: var(--planner-blue);

    box-shadow:
        0 0 8px rgba(47, 159, 232, 0.35);

    transform: translateX(-50%);
}


.crafting-section::before {
    content: "";

    position: absolute;

    top: -6px;
    left: 50%;

    z-index: 1;

    width: 8px;
    height: 8px;

    background-color: var(--planner-blue);

    border: 2px solid #242424;
    border-radius: 50%;

    box-shadow:
        0 0 7px rgba(47, 159, 232, 0.38);

    transform: translateX(-50%);
}


/* =========================
   Crafting Header
========================= */

.crafting-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 24px;

    margin-bottom: 22px;
}


.crafting-header h2 {
    margin: 0 0 7px;

    color: #eeeeee;

    font-size: 20px;
}


.crafting-description {
    margin: 0;

    color: #999;

    font-size: 12px;
    line-height: 1.5;
}


/* =========================
   Selected Material Badge
========================= */

.crafting-selected-material {
    position: relative;

    flex-shrink: 0;

    min-width: 128px;

    overflow: hidden;

    padding: 12px 12px 9px;

    background-color: var(--planner-blue-soft);
    color: var(--planner-blue-bright);

    border: 1px solid #356f94;
    border-radius: 7px;

    font-size: 10px;

    text-align: center;
}


/* Technical Line INSIDE Badge Near Top */

.crafting-selected-material::before {
    content: "";

    position: absolute;

    top: 3px;
    left: 10px;
    right: 10px;

    height: 3px;

    opacity: 0.38;

    background:
        repeating-linear-gradient(
            90deg,
            var(--planner-blue) 0,
            var(--planner-blue) 1px,
            transparent 1px,
            transparent 8px
        );

    border-top: 1px solid rgba(47, 159, 232, 0.42);

    pointer-events: none;
}


/* Small Endpoint */

.crafting-selected-material::after {
    content: "";

    position: absolute;

    top: 2px;
    right: 9px;

    width: 3px;
    height: 3px;

    background-color: var(--planner-blue);

    border-radius: 50%;

    opacity: 0.65;

    pointer-events: none;
}


/* =========================
   Crafting Content
========================= */

.crafting-content {
    position: relative;
    z-index: 1;
}


/* =========================
   Crafting Empty State
========================= */

.crafting-empty {
    display: flex;
    align-items: center;

    gap: 15px;

    min-height: 82px;

    padding: 18px;

    background-color: rgba(20, 20, 20, 0.45);

    border: 1px dashed #4b4b4b;
    border-radius: 9px;
}


/* =========================
   Crafting Empty Icon
========================= */

.crafting-empty-icon {
    box-sizing: border-box;

    display: grid;
    place-items: center;

    flex-shrink: 0;

    width: 38px;
    height: 38px;

    padding: 0;

    background-color: #202629;
    color: var(--planner-blue);

    border: 1px solid #3d6277;
    border-radius: 7px;

    font-family: Arial, sans-serif;
    font-size: 22px;
    font-weight: 400;
    line-height: 1;

    text-align: center;
}


.crafting-empty p {
    margin: 0 0 5px;

    color: #ddd;

    font-size: 12px;
}


.crafting-empty span {
    color: #888;

    font-size: 11px;
    line-height: 1.5;
}


/* =========================
   Crafting Unavailable
   ========================= */

.crafting-unavailable {
    display: flex;
    align-items: center;

    gap: 15px;

    min-height: 82px;

    padding: 18px;

    background-color: rgba(73, 29, 34, 0.45);

    border: 1px dashed #8a434c;
    border-radius: 9px;
}


.crafting-unavailable-icon {
    box-sizing: border-box;

    display: grid;
    place-items: center;

    flex-shrink: 0;

    width: 38px;
    height: 38px;

    padding: 0;

    background-color: #321d20;
    color: #e57373;

    border: 1px solid #8a434c;
    border-radius: 7px;

    font-family: Arial, sans-serif;
    font-size: 22px;
    font-weight: 400;
    line-height: 1;

    text-align: center;
}


.crafting-unavailable p {
    margin: 0 0 5px;

    color: #f0c7cb;

    font-size: 12px;
}


.crafting-unavailable span {
    color: #b98a90;

    font-size: 11px;
    line-height: 1.5;
}


/* =========================
   Crafting Overview
   ========================= */

.crafting-overview {
    margin-bottom: 18px;
}


.selected-information {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 8px;

    min-height: 70px;

    padding: 12px 16px;

    background-color: #202020;

    border: 1px solid #444;
    border-radius: 9px;

    text-align: center;
}


.info-amount-needed {
    color: var(--planner-blue-bright);

    font-size: 10px;
}


.info-image {
    width: 48px;
    height: 48px;

    padding: 7px;

    box-sizing: border-box;

    background-color: #181a1c;

    border: 1px solid #3f474d;
    border-radius: 7px;

    object-fit: contain;
}


.info-name {
    color: #f0f0f0;

    font-size: 14px;
}


.material-row.selected {
    background-color: rgba(47, 159, 232, 0.07);

    box-shadow:
        inset 3px 0 0 var(--planner-blue);
}


/* =========================
   Recipe / Ingredients
   ========================= */

.crafting-recipe-area {
    display: grid;
    grid-template-columns: 1fr auto 1fr;

    align-items: center;

    gap: 16px;

    overflow: visible;
}


.crafting-recipe,
.crafting-ingredients {
    min-width: 0;

    padding: 18px;

    background-color: rgba(25, 25, 25, 0.72);

    border: 1px solid #444;
    border-radius: 9px;
}


.crafting-ingredients {
    position: relative;
    z-index: 10;

    overflow: visible;
}


.crafting-recipe h3,
.crafting-ingredients h3 {
    margin: 0 0 15px;

    color: #c6c6c6;

    font-size: 12px;
}


/* =========================
   Recipe Flow
   ========================= */

.crafting-recipe-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-height: 174px;

    gap: 8px;
}


/* =========================
   Crafting Grid
   ========================= */

.crafting-grid {
    display: grid;

    grid-template-columns: repeat(3, 52px);
    grid-template-rows: repeat(3, 52px);

    gap: 3px;
}


.crafting-slot {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 52px;
    height: 52px;

    box-sizing: border-box;

    background-color: #25292c;

    border: 2px solid #59636a;
    border-radius: 4px;
}


.crafting-slot:hover {
    background-color: #2b3034;

    border-color: var(--planner-blue-dark);
}


.grid-image {
    display: block;

    width: 36px;
    height: 36px;

    object-fit: contain;

    pointer-events: none;
}


/* =========================
   Crafting Hover Popup
   ========================= */

.popup-container {
    position: absolute;
    z-index: 50;

    left: 50%;
    bottom: calc(100% + 10px);

    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 34px;

    padding: 8px 14px;

    transform: translateX(-50%);

    background-color: #100010;

    border: 2px solid #54205f;
    border-radius: 3px;

    box-shadow:
        inset 0 0 0 1px #743080,
        0 0 0 1px #000;

    white-space: nowrap;

    opacity: 0;
    visibility: hidden;

    pointer-events: none;
}


/* Little downward pointer */

.popup-container::after {
    content: "";

    position: absolute;

    left: 50%;
    top: 100%;

    transform: translateX(-50%);

    width: 0;
    height: 0;

    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid #743080;
}


.popup-name {
    display: flex;
    align-items: center;
    justify-content: center;

    color: #fff;

    font-size: 13px;
    line-height: 1.4;

    text-align: center;
}


/* Popup positions relative to the slot */

.crafting-slot {
    position: relative;
}


.crafting-slot:focus-visible,
.furnace-item:focus-visible,
.cutter-slot:focus-visible,
.needed-items-image-wrapper:focus-visible {
    outline: 2px solid #b84cff;
    outline-offset: 3px;
}


/* Show popup */

.crafting-slot:hover .popup-container,
.crafting-slot:focus .popup-container {
    opacity: 1;
    visibility: visible;
}


/* =========================
   Variant Hover Popup
   ========================= */

.varient-container {
    position: absolute;
    z-index: 1000;

    left: 50%;
    bottom: calc(100% + 6px);

    display: flex;
    flex-direction: column;
    align-items: center;

    width: 360px;
    max-height: 430px;

    padding: 12px;

    transform: translateX(-50%);

    background-color: #100010;

    border: 2px solid #54205f;
    border-radius: 4px;

    box-shadow:
        inset 0 0 0 1px #743080,
        0 0 0 1px #000;

    opacity: 0;
    visibility: hidden;

    pointer-events: none;
}


/* Downward triangle */

.varient-container::after {
    content: "";

    position: absolute;

    left: 50%;
    top: 100%;

    transform: translateX(-50%);

    width: 0;
    height: 0;

    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #743080;
}


/* =========================
   Title
   ========================= */

.varient-title {
    color: #fff;

    font-size: 13px;
    line-height: 1.3;

    text-align: center;
}


.tag-name {
    margin-top: 2px;

    color: #c79cff;

    font-size: 10px;
    line-height: 1.3;

    text-align: center;
}


/* Fading divider */

.tag-name::after {
    content: "";

    display: block;

    width: 250px;
    height: 2px;

    margin: 9px auto 10px;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(116, 48, 128, 0.35),
        #743080,
        rgba(116, 48, 128, 0.35),
        transparent
    );
}


/* =========================
   Variant Grid
   ========================= */

.varient-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);

    gap: 8px;

    width: 100%;
    max-height: 320px;

    padding-right: 4px;

    overflow-y: auto;
    overflow-x: hidden;

    scrollbar-width: thin;
    scrollbar-color: #743080 #181818;
}


/* =========================
   Variant Slot
   ========================= */

.varient-grid-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 5px;

    min-width: 0;
    min-height: 78px;

    padding: 7px 5px;

    background-color: #1b1b1d;

    border: 1px solid #45304a;
    border-radius: 4px;

    text-align: center;
}


.varient-grid-slot:hover {
    background-color: #232025;

    border-color: #743080;
}


/* =========================
   Images
   ========================= */

.varient-image {
    width: 38px;
    height: 38px;

    margin-bottom: 3px;
    padding-bottom: 6px;

    border-bottom: 1px solid rgba(116, 48, 128, 0.35);

    object-fit: contain;

    pointer-events: none;
}


/* =========================
   Names
   ========================= */

.varient-name {
    color: #e6e6e6;

    font-size: 9px;
    line-height: 1.3;

    text-align: center;
}


/* =========================
   Focus Popup
   ========================= */

.crafting-slot:focus > .varient-container,
.furnace-item:focus > .varient-container,
.cutter-slot:focus > .varient-container,
.needed-items-image-wrapper:focus > .varient-container {
    opacity: 1;
    visibility: visible;

    pointer-events: auto;
}


/* =========================
   Hover Popup
   Desktop / mouse only
   ========================= */

@media (hover: hover) and (pointer: fine) {

    .crafting-slot:hover > .varient-container,
    .furnace-item:hover > .varient-container,
    .cutter-slot:hover > .varient-container,
    .needed-items-image-wrapper:hover > .varient-container,
    .varient-container:hover {
        opacity: 1;
        visibility: visible;

        pointer-events: auto;
    }
}


/* =========================
   Scrollbar
   ========================= */

.varient-grid::-webkit-scrollbar {
    width: 8px;
}


.varient-grid::-webkit-scrollbar-track {
    background-color: #181818;

    border-radius: 4px;
}


.varient-grid::-webkit-scrollbar-thumb {
    background-color: #743080;

    border-radius: 4px;
}


.varient-grid::-webkit-scrollbar-thumb:hover {
    background-color: #8d419b;
}


/* =========================
   Mobile
   ========================= */

@media (max-width: 700px) {

    .varient-container {
        position: fixed;

        top: 50%;
        left: 50%;
        bottom: auto;

        z-index: 2147483647;

        box-sizing: border-box;

        width: min(360px, calc(100vw - 32px));
        max-height: min(390px, calc(100dvh - 64px));

        padding: 10px;

        transform: translate(-50%, -50%);
    }


    .varient-container.mobile-open {
        opacity: 1;
        visibility: visible;

        pointer-events: auto;
    }


    /* Popup is centered, so no pointer arrow */

    .varient-container::after {
        display: none;
    }


    .varient-grid {
        grid-template-columns: repeat(4, 1fr);

        gap: 6px;

        max-height: 280px;
    }


    .varient-grid-slot {
        min-height: 70px;

        padding: 6px 4px;
    }


    .varient-image {
        width: 34px;
        height: 34px;
    }


    .varient-name {
        font-size: 8px;
    }


    .tag-name::after {
        width: 210px;
    }
}


/* =========================
   Recipe Arrow
   ========================= */

.recipe-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
}


.arrow-image {
    display: block;

    width: 38px;
    height: auto;

    object-fit: contain;
}


/* =========================
   Crafting Ingredients
   ========================= */

.crafting-ingredient-list {
    display: flex;
    flex-direction: column;

    gap: 7px;

    min-height: 174px;
}


/* =========================
   Crafting Mobile
   ========================= */

@media (max-width: 700px) {

    .selected-information {
        padding: 12px;
    }


    .crafting-recipe-area {
        grid-template-columns: 1fr;

        gap: 16px;
    }


    .recipe-arrow {
        transform: rotate(90deg);
    }


    .crafting-recipe-flow,
    .crafting-ingredient-list {
        min-height: auto;
    }
}


/* =========================
   Furnace Wrapper
   ========================= */

.furnace-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 12px;

    width: 100%;
}


/* =========================
   Furnace Recipe
   ========================= */

.furnace-inputs {
    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 8px;
}


.furnace-item,
.furnace-output {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 7px;

    min-width: 92px;

    padding: 12px 14px;

    background-color: #202020;

    border: 1px solid #444;
    border-radius: 8px;

    text-align: center;
}


.furnace-input {
    border-color: #4c5b64;
}


.furnace-fuel {
    border-color: #4f4f4f;
}


.furnace-output {
    border-color: #356f94;
}


.furnace-item {
    position: relative;
}


/* =========================
   Furnace Item Images
   ========================= */

.item-image {
    width: 46px;
    height: 46px;

    padding: 6px;

    box-sizing: border-box;

    background-color: #181a1c;

    border: 1px solid #3f474d;
    border-radius: 6px;

    object-fit: contain;
}


.material-name {
    color: #d7d7d7;

    font-size: 10px;
}


/* =========================
   Furnace Fire
   ========================= */

.furnace-fire {
    width: 30px;
    height: 30px;

    object-fit: contain;
}


/* =========================
   Furnace Arrow
   ========================= */

.makes-arrow {
    width: 42px;
    height: auto;

    object-fit: contain;

    margin: 0 18px;
}


/* =========================
   Furnace Mobile
   ========================= */

@media (max-width: 700px) {

    .crafting-recipe-flow {
        flex-direction: column;

        gap: 14px;
    }


    .makes-arrow {
        margin: 0;

        transform: rotate(90deg);
    }
}


/* =========================
   Stonecutter Recipe
   ========================= */

.stone-cutter-container,
.stone-cutter-container2 {
    display: flex;
    align-items: center;
    justify-content: center;
}


/* Top row:
   Input + Stonecutter
*/

.stone-cutter-container {
    flex-direction: row;

    gap: 10px;
}


/* Bottom section:
   Arrow
   Output
*/

.stone-cutter-container2 {
    flex-direction: column;

    gap: 6px;

    margin-top: 4px;
}


.stone-cutter-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}


/* =========================
   Slots
   ========================= */

.cutter-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 7px;

    min-width: 92px;
    min-height: 92px;

    padding: 10px 12px;

    box-sizing: border-box;

    background-color: #202020;

    border: 1px solid #4c5b64;
    border-radius: 8px;

    text-align: center;
}


/* Output slot */

.stone-cutter-container2 .cutter-slot {
    border-color: #356f94;
}


/* =========================
   Item Images
   ========================= */

.cutter-slot .item-image {
    width: 46px;
    height: 46px;

    padding: 6px;

    box-sizing: border-box;

    background-color: #181a1c;

    border: 1px solid #3f474d;
    border-radius: 6px;

    object-fit: contain;
}


.cutter-slot .material-name {
    color: #d7d7d7;

    font-size: 10px;
}


/* =========================
   Plus
   ========================= */

.stone-cutter-container .plus {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 26px;
    height: 26px;

    color: var(--planner-blue-bright);

    font-family: Arial, sans-serif;
    font-size: 24px;
    line-height: 1;
}


/* =========================
   Stonecutter
   ========================= */

.cutter-image {
    width: 52px;
    height: 52px;

    padding: 6px;

    box-sizing: border-box;

    background-color: #181a1c;

    border: 1px solid #3f474d;
    border-radius: 7px;

    object-fit: contain;
}


/* =========================
   Arrow
   ========================= */

.stone-cutter-container2 .arrow-image {
    width: 22px;
    height: 22px;

    object-fit: contain;

    transform: rotate(90deg);
}


/* =========================
   Mobile
   ========================= */

@media (max-width: 700px) {

    .stone-cutter-container {
        gap: 8px;
    }


    .stone-cutter-container2 {
        gap: 5px;

        margin-top: 3px;
    }


    .cutter-slot {
        min-width: 82px;
        min-height: 82px;

        padding: 9px;
    }


    .cutter-slot .item-image {
        width: 42px;
        height: 42px;
    }


    .stone-cutter-container .plus {
        width: 24px;
        height: 24px;

        font-size: 22px;
    }


    .cutter-image {
        width: 46px;
        height: 46px;
    }


    .stone-cutter-container2 .arrow-image {
        width: 20px;
        height: 20px;
    }
}


/* =========================
   Ingredients Needed List
   ========================= */

.needed-list-container {
    position: relative;

    display: flex;
    flex-direction: column;

    gap: 8px;

    width: 100%;

    overflow: visible;
}


/* =========================
   Ingredient Box
   ========================= */

.needed-item-box {
    position: relative;
    z-index: 1;

    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;

    gap: 10px;

    width: 100%;
    min-height: 58px;

    padding: 10px 12px;

    box-sizing: border-box;

    overflow: visible;

    background-color: #252525;

    border: 1px solid #454545;
    border-radius: 7px;
}


.needed-item-box:hover {
    z-index: 20;

    background-color: #2a2a2a;

    border-color: #555;
}


/* =========================
   Tagged Ingredient Layout
   ========================= */

.needed-item-box:has(.needed-item-top-row) {
    display: flex;
    flex-direction: column;
    align-items: stretch;

    gap: 2px;
}


.needed-item-top-row {
    position: relative;

    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;

    gap: 10px;

    width: 100%;

    overflow: visible;
}


.needed-item-text {
    display: flex;
    flex-direction: column;
    justify-content: center;

    gap: 1px;

    min-width: 0;
}


/* =========================
   Image Wrapper
   ========================= */

.needed-items-image-wrapper {
    position: relative;
    z-index: 30;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: visible;
}


/* =========================
   Images
   ========================= */

.needed-item-img,
.needed-item-image {
    width: 40px;
    height: 40px;

    padding: 5px;

    box-sizing: border-box;

    background-color: #1a1a1a;

    border: 1px solid #3f474d;
    border-radius: 6px;

    object-fit: contain;
}


/* =========================
   Item Name
   ========================= */

.needed-item-title {
    min-width: 0;

    color: #eeeeee;

    font-size: 11px;
    line-height: 1.3;
}


/* =========================
   Amount
   ========================= */

.needed-item-amount {
    justify-self: end;

    color: var(--planner-blue-bright);

    font-size: 0.7rem;
    line-height: 1;

    text-align: right;
    white-space: nowrap;

    flex-shrink: 0;
}


/* =========================
   Tag
   ========================= */

.needed-item-tag {
    margin: 0;

    color: #9c9c9c;

    font-size: 9px;
    line-height: 1.2;

    word-break: break-word;
}


/* =========================
   Ingredient Variant Popup
   ========================= */

.crafting-ingredient-list,
.crafting-ingredients {
    overflow: visible;
}


/* =========================
   Mobile
   ========================= */

@media (max-width: 700px) {

    .needed-item-box,
    .needed-item-top-row {
        gap: 8px;
    }


    .needed-item-box {
        min-height: 54px;

        padding: 9px 10px;
    }


    .needed-item-img,
    .needed-item-image {
        width: 36px;
        height: 36px;

        padding: 4px;
    }


    .needed-item-title {
        font-size: 10px;
    }


    .needed-item-amount {
        font-size: 12px;
    }


    .needed-item-tag {
        margin: 0;

        font-size: 8px;
    }
}


/* =========================
   Summary
========================= */

.material-summary {
    position: relative;

    margin-top: 28px;
    padding: 26px;

    overflow: hidden;

    background-color: var(--planner-panel-blue);

    background-image:
        linear-gradient(
            rgba(47, 159, 232, 0.045) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(47, 159, 232, 0.045) 1px,
            transparent 1px
        );

    background-size: 24px 24px;

    border: 2px solid #356f94;
    border-radius: 12px;

    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.30),
        0 0 16px rgba(47, 159, 232, 0.06);
}


/* =========================
   Blueprint Corners
========================= */

.material-summary::before,
.material-summary::after {
    content: "";

    position: absolute;

    width: 42px;
    height: 42px;

    pointer-events: none;
}


/* Top Left */

.material-summary::before {
    top: 12px;
    left: 12px;

    border-top: 1px solid rgba(101, 186, 240, 0.32);
    border-left: 1px solid rgba(101, 186, 240, 0.32);
}


/* Bottom Right */

.material-summary::after {
    right: 12px;
    bottom: 12px;

    border-right: 1px solid rgba(101, 186, 240, 0.24);
    border-bottom: 1px solid rgba(101, 186, 240, 0.24);
}


.material-summary h2 {
    position: relative;
    z-index: 1;

    margin: 0 0 22px;

    color: var(--planner-blue-bright);

    font-size: 20px;
}


/* =========================
   Summary Stats
========================= */

.summary-stats {
    position: relative;
    z-index: 1;

    display: grid;
    grid-template-columns: repeat(3, 1fr);

    gap: 16px;
}


/* Styled Like Add Material Inputs */

.summary-stat {
    box-sizing: border-box;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 9px;

    min-height: 84px;

    padding: 16px 14px;

    /* SOLID background hides blueprint grid */
    background-color: #191b1d;

    border: 1px solid #4b555c;
    border-radius: 8px;

    text-align: center;

    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}


/* Same hover language as Add Material inputs */

.summary-stat:hover {
    background-color: #1e2225;

    border-color: var(--planner-blue-dark);

    box-shadow:
        0 0 8px rgba(47, 159, 232, 0.10);
}


/* =========================
   Summary Values
========================= */

.summary-value {
    color: var(--planner-blue-bright);

    font-size: 20px;
}


.summary-label {
    color: #9aaab4;

    font-size: 9px;

    text-transform: uppercase;
    letter-spacing: 0.6px;
}


/* =========================
   Clear Material List
========================= */

.clear-material-list {
    position: relative;
    z-index: 1;

    display: block;

    margin: 22px auto 0;
    padding: 11px 16px;

    background-color: rgba(20, 23, 26, 0.68);
    color: #b8c3ca;

    border: 1px solid #58636b;
    border-radius: 7px;

    font-size: 9px;

    cursor: pointer;

    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.22),
        inset 0 0 0 1px rgba(255, 255, 255, 0.015);

    transition:
        color 0.18s ease,
        background-color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}


.clear-material-list:hover {
    transform: translateY(-1px);

    background-color: rgba(71, 34, 41, 0.72);
    color: #f08b9b;

    border-color: #a95565;

    box-shadow:
        0 5px 12px rgba(0, 0, 0, 0.28),
        0 0 8px rgba(183, 73, 91, 0.12);
}


/* =========================
   Roadmap
========================= */

.planner-roadmap {
    position: relative;

    margin-top: 32px;
    padding: 28px;

    overflow: hidden;

    /* Purple card gradient */
    background:
        linear-gradient(
            135deg,
            rgba(184, 76, 255, 0.14),
            #242124
        );

    border: 1px solid #5d4b57;
    border-radius: 12px;

    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.28),
        0 0 18px rgba(184, 76, 255, 0.04);
}


/* =========================
   Roadmap Header
========================= */

.roadmap-header {
    position: relative;
    z-index: 1;

    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 24px;

    margin-bottom: 22px;
}


.roadmap-header h2 {
    margin: 0 0 8px;

    color: #c79cff;

    font-size: 20px;
}


.roadmap-header p {
    max-width: 640px;

    margin: 0;

    color: #ab9db1;

    font-size: 12px;
    line-height: 1.6;
}


/* =========================
   Changelog Link
========================= */

.roadmap-link {
    position: relative;
    z-index: 1;

    flex-shrink: 0;

    padding: 9px 12px;

    background-color: rgba(184, 76, 255, 0.07);
    color: #c79cff;

    border: 1px solid #694c7a;
    border-radius: 7px;

    font-size: 10px;

    text-decoration: none;

    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease;
}


.roadmap-link:hover {
    transform: translateY(-1px);

    background-color: rgba(184, 76, 255, 0.13);
    color: #d8b9ff;

    border-color: #9869b4;
}


/* =========================
   Roadmap Image
========================= */

.roadmap-image-frame {
    image-rendering: auto;

    position: relative;

    overflow: hidden;

    padding: 12px;

    background-color: #181818;

    border: 1px solid #494149;
    border-radius: 10px;

    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.02),
        0 5px 16px rgba(0, 0, 0, 0.28);
}


.roadmap-image-frame::before {
    content: "";

    position: absolute;
    inset: 0;

    pointer-events: none;

    background:
        linear-gradient(
            135deg,
            rgba(184, 76, 255, 0.03),
            transparent 35%,
            rgba(199, 156, 255, 0.018)
        );
}


.roadmap-image {
    position: relative;
    z-index: 1;

    image-rendering: auto;

    display: block;

    width: 100%;
    height: auto;

    border-radius: 6px;
}


/* =========================
   Roadmap Lightbox
========================= */

.roadmap-image-frame {
    cursor: zoom-in;
}


.roadmap-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 30px;

    background-color: rgba(8, 8, 8, 0.92);

    backdrop-filter: blur(4px);
}


.roadmap-lightbox.hidden {
    display: none;
}


/* =========================
   Roadmap Viewport
========================= */

.roadmap-lightbox-viewport {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 95vw;
    height: 88vh;

    overflow: hidden;

    cursor: default;
}


.roadmap-lightbox-viewport.zoomed {
    cursor: grab;
}


.roadmap-lightbox-viewport.dragging {
    cursor: grabbing;
}


/* =========================
   Enlarged Roadmap
========================= */

.roadmap-lightbox-image {
    display: block;

    image-rendering: auto;

    max-width: 100%;
    max-height: 100%;

    width: auto;
    height: auto;

    border: 1px solid #694c7a;
    border-radius: 10px;

    box-shadow:
        0 18px 50px rgba(0, 0, 0, 0.55),
        0 0 22px rgba(184, 76, 255, 0.12);

    transform-origin: center center;

    user-select: none;

    transition: transform 0.12s ease;
}


.roadmap-lightbox-viewport.dragging .roadmap-lightbox-image {
    transition: none;
}


/* =========================
   Zoom Controls
========================= */

.roadmap-lightbox-controls {
    position: fixed;

    top: 22px;
    left: 50%;

    z-index: 1002;

    display: flex;
    align-items: center;

    gap: 7px;

    padding: 6px;

    background-color: #242024;

    border: 1px solid #694c7a;
    border-radius: 9px;

    box-shadow:
        0 5px 16px rgba(0, 0, 0, 0.32);

    transform: translateX(-50%);
}


.roadmap-lightbox-controls button {
    box-sizing: border-box;

    display: grid;
    place-items: center;

    min-width: 36px;
    height: 36px;

    padding: 0 10px;

    background-color: #191919;
    color: #d8b9ff;

    border: 1px solid #514657;
    border-radius: 6px;

    font-family: Arial, sans-serif;
    font-size: 18px;
    line-height: 1;

    cursor: pointer;

    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease;
}


.roadmap-lightbox-controls button:hover {
    background-color: rgba(184, 76, 255, 0.12);
    color: white;

    border-color: #9869b4;
}


.roadmap-lightbox-controls .roadmap-zoom-reset {
    font-size: 12px;
}


.roadmap-zoom-level {
    min-width: 52px;

    color: #c7c7c7;

    font-family: Arial, sans-serif;
    font-size: 12px;

    text-align: center;
}


/* =========================
   Close Button
========================= */

.roadmap-lightbox-close {
    position: fixed;

    top: 22px;
    right: 26px;

    z-index: 1002;

    box-sizing: border-box;

    display: grid;
    place-items: center;

    width: 40px;
    height: 40px;

    padding: 0;

    background-color: #242024;
    color: #d8b9ff;

    border: 1px solid #694c7a;
    border-radius: 8px;

    font-family: Arial, sans-serif;
    font-size: 24px;
    font-weight: 400;
    line-height: 1;

    cursor: pointer;

    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease;
}


.roadmap-lightbox-close:hover {
    background-color: rgba(184, 76, 255, 0.12);
    color: white;

    border-color: #9869b4;
}


/* =========================
   Smaller Screens
========================= */

@media (max-width: 700px) {

    .material-planner-page {
        width: min(100% - 20px, 1000px);

        padding-top: 28px;
    }


    .planner-input-card,
    .material-list-section,
    .material-summary,
    .crafting-section,
    .planner-roadmap {
        padding: 20px;
    }


    .planner-input-grid {
        grid-template-columns: 1fr;
    }


    .add-material-button {
        width: 100%;

        margin-top: 20px;
    }


    .material-list-columns {
        display: none;
    }


    .material-row {
        grid-template-columns: 1fr auto;

        gap: 12px;

        padding: 16px 4px;
    }


    .material-info {
        grid-column: 1 / 3;
    }


    .material-total,
    .material-stacks {
        font-size: 11px;
    }


    .material-total::before {
        content: "Amount: ";

        color: #777;
    }


    .material-stacks::before {
        content: "Stacks: ";

        color: #777;
    }


    .material-actions {
        grid-column: 1 / 3;
    }


    .edit-material,
    .remove-material,
    .save-confirmation,
    .cancel-confirmation,
    .yes-confirmation,
    .no-confirmation {
        flex: 1;
    }


    .summary-stats {
        grid-template-columns: 1fr;
    }


    .crafting-header,
    .roadmap-header {
        flex-direction: column;

        gap: 14px;
    }


    .crafting-selected-material,
    .roadmap-link {
        align-self: flex-start;
    }


    .crafting-overview,
    .crafting-recipe-area {
        grid-template-columns: 1fr;
    }


    .crafting-recipe-flow {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;

        gap: 8px;

        min-height: 174px;
    }


    .crafting-arrow {
        transform: rotate(90deg);
    }


    .crafting-recipe-item {
        box-sizing: border-box;

        width: 100%;
    }


    .crafting-material-profile {
        align-items: flex-start;
    }


    .roadmap-image-frame {
        padding: 7px;
    }
}


.disclaimer {
    margin-top: 4px;

    color: #e57373;

    font-size: 9px;
    line-height: 1.4;

    text-align: center;
}