.craft-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px clamp(16px, 4vw, 56px);
    border-bottom: 1px solid rgba(170, 110, 255, .18);
    background: #0d0b15;
}

.craft-logo {
    color: #c7a0ff;
    font-size: 25px;
    font-weight: 900;
    text-decoration: none;
    letter-spacing: 2px;
}

.craft-nav nav {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
}

.craft-nav nav a {
    color: #aaa4ba;
    text-decoration: none;
    font-size: 14px;
}

.craft-nav nav a:hover,
.craft-nav nav a.active {
    color: #c7a0ff;
}

.craft-balance {
    color: #d8c1ff;
    font-weight: 800;
    white-space: nowrap;
}

.craft-container {
    width: min(1440px, 94%);
    margin: 0 auto;
    padding: 36px 0 64px;
    color: #f5f0ff;
}

.craft-hero {
    padding: 32px 0;
}

.craft-eyebrow {
    color: #b78aff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 3px;
}

.craft-hero h1 {
    margin: 12px 0;
    font-size: clamp(34px, 5vw, 54px);
    letter-spacing: -1.5px;
}

.craft-hero h1 span {
    color: #b78aff;
}

.craft-hero p,
.craft-panel-heading p,
.craft-possible-panel > p {
    color: #a9a2b8;
    line-height: 1.6;
}

.craft-rules {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.craft-rule,
.craft-panel {
    border: 1px solid rgba(177, 129, 255, .18);
    border-radius: 16px;
    background: linear-gradient(145deg, #171321, #100e18);
}

.craft-rule {
    display: grid;
    gap: 9px;
    padding: 18px;
}

.craft-rule span {
    font-size: 21px;
}

.craft-rule strong {
    font-size: 23px;
    color: #d3b5ff;
}

.craft-rule small {
    color: #aaa3b9;
    line-height: 1.4;
}

.craft-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr);
    align-items: start;
    gap: 20px;
}

.craft-panel {
    min-width: 0;
    padding: 22px;
}

.craft-panel h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.craft-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.craft-panel-heading p {
    margin: 0 0 16px;
    font-size: 13px;
}

.craft-counter {
    padding: 8px 12px;
    border: 1px solid rgba(183, 138, 255, .35);
    border-radius: 10px;
    color: #d3b5ff;
    white-space: nowrap;
    font-weight: 800;
}

.craft-status {
    margin: 12px 0;
    color: #bdb3d0;
    font-size: 13px;
    line-height: 1.5;
}

.craft-status.error {
    color: #ff929f;
}

.craft-status.success {
    color: #8ef0bc;
}

.craft-items {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.craft-item {
    position: relative;
    min-width: 0;
    padding: 14px 8px;
    border: 1px solid #30263e;
    border-radius: 12px;
    background: #13101b;
    color: #f5f0ff;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .15s;
}

.craft-item:hover:not(:disabled) {
    border-color: #a779ed;
    transform: translateY(-2px);
}

.craft-item.selected {
    border-color: #b78aff;
    background: rgba(133, 75, 207, .2);
    box-shadow: inset 0 0 0 1px rgba(183, 138, 255, .25);
}

.craft-item:disabled {
    cursor: not-allowed;
    opacity: .42;
}

.craft-item-icon {
    display: block;
    margin-bottom: 8px;
    font-size: 30px;
}

.craft-item-name {
    display: block;
    min-height: 34px;
    overflow-wrap: anywhere;
    font-size: 12px;
    line-height: 1.4;
}

.craft-item-value {
    display: block;
    margin-top: 8px;
    color: #c9a8ff;
    font-size: 12px;
    font-weight: 800;
}

.craft-item-rarity {
    display: block;
    margin-top: 5px;
    color: #9e96af;
    font-size: 10px;
}

.craft-item-check {
    position: absolute;
    top: 7px;
    right: 8px;
    color: #d3b5ff;
    font-weight: 900;
}

.craft-result-panel {
    position: sticky;
    top: 18px;
}

.craft-result-box {
    display: flex;
    min-height: 210px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 18px 0;
    padding: 20px;
    border: 1px dashed rgba(183, 138, 255, .35);
    border-radius: 14px;
    background: rgba(183, 138, 255, .04);
    text-align: center;
}

.craft-result-icon {
    font-size: 52px;
}

.craft-result-box strong {
    overflow-wrap: anywhere;
}

.craft-result-box p {
    margin: 0;
    color: #a9a2b8;
    font-size: 13px;
    line-height: 1.5;
}

.craft-cost {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 0;
    border-top: 1px solid #30263e;
    border-bottom: 1px solid #30263e;
}

.craft-cost span {
    color: #aaa3b9;
    font-size: 13px;
}

.craft-cost strong {
    color: #d3b5ff;
    font-size: 22px;
}

.craft-note {
    min-height: 42px;
    color: #a9a2b8;
    font-size: 12px;
    line-height: 1.6;
}

.craft-button,
.craft-clear-button {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    font-weight: 900;
    cursor: pointer;
}

.craft-button {
    border: 0;
    background: linear-gradient(100deg, #8c55d9, #b184ff);
    color: #fff;
}

.craft-button:hover:not(:disabled) {
    filter: brightness(1.1);
}

.craft-button:disabled,
.craft-clear-button:disabled {
    cursor: not-allowed;
    opacity: .4;
}

.craft-clear-button {
    margin-top: 9px;
    border: 1px solid #42344f;
    background: transparent;
    color: #d2c7e3;
}

.craft-possible-panel {
    margin-top: 20px;
}

.craft-possible-items {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.craft-possible-item {
    padding: 12px 6px;
    border: 1px solid #30263e;
    border-radius: 10px;
    background: #13101b;
    text-align: center;
    overflow-wrap: anywhere;
}

.craft-possible-item span {
    display: block;
    margin-bottom: 8px;
    font-size: 25px;
}

.craft-possible-item strong {
    font-size: 11px;
    line-height: 1.4;
}

.craft-possible-item small {
    display: block;
    margin-top: 6px;
    color: #c9a8ff;
}

@media (max-width: 950px) {
    .craft-rules {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .craft-workspace {
        grid-template-columns: 1fr;
    }

    .craft-result-panel {
        position: static;
    }

    .craft-possible-items {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .craft-nav {
        flex-wrap: wrap;
    }

    .craft-nav nav {
        order: 3;
        width: 100%;
        gap: 16px;
    }

    .craft-items {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .craft-panel {
        padding: 15px;
    }

    .craft-possible-items {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.craft-chance {
    display: block;
    margin-top: 5px;
    color: #a9f0c4;
    font-size: 13px;
    font-weight: 900;
}

.craft-fail-item {
    border-color: rgba(255, 115, 130, .45);
    background: rgba(255, 80, 100, .06);
}

.craft-fail-label {
    display: block;
    margin-top: 5px;
    color: #ff9aa5;
    font-size: 10px;
}