/* =========================================
   KOII Bracelet Builder
========================================= */

.koii-builder {
    max-width: 760px;
    margin: 0 auto;
    padding: 20px 16px 60px;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Hiragino Kaku Gothic ProN",
        "Yu Gothic",
        "Noto Sans JP",
        sans-serif;

    color: #222;
}


/* TOP
----------------------------------------- */

.koii-builder__top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 18px;

    font-size: 14px;
}

.koii-builder__stats {
    display: flex;
    align-items: center;
    gap: 8px;

    color: #888;
}

.koii-price {
    color: #a85c52;
}

.koii-price strong {
    font-size: 20px;
}

.koii-divider {
    color: #ddd;
}

.koii-wrist {
    color: #b56e64;
}


/* STAGE
----------------------------------------- */

.koii-stage-wrap {
    width: 100%;
    display: flex;
    justify-content: center;

    margin-bottom: 20px;
}

.koii-stage {

    position: relative;

    width: min(88vw, 580px);
    aspect-ratio: 1 / 1;

    overflow: hidden;

    border-radius: 50%;

    background:
        radial-gradient(
            circle at 45% 35%,
            #ffffff 0%,
            #f8f6f3 48%,
            #e7e0d8 100%
        );

    border: 8px solid rgba(210, 199, 186, 0.6);

    box-shadow:
        inset 0 0 30px rgba(0,0,0,0.08),
        0 10px 35px rgba(0,0,0,0.08);
}


.koii-empty-message {

    position: absolute;

    left: 50%;
    top: 50%;

    transform: translate(-50%, -50%);

    width: 80%;

    text-align: center;

    font-weight: 600;

    color: #777;

    pointer-events: none;
}


/* BEADS
----------------------------------------- */

.koii-stage-bead {

    position: absolute;

    left: 0;
    top: 0;

    border-radius: 50%;

    pointer-events: none;

    will-change:
        left,
        top,
        transform;

    box-shadow:
        inset -6px -8px 12px rgba(0,0,0,.15),
        inset 5px 5px 10px rgba(255,255,255,.55),
        0 4px 9px rgba(0,0,0,.14);

    z-index: 5;
}

/* 水晶效果 */

.koii-bead--crystal {
    background:
        radial-gradient(
            circle at 32% 25%,
            #ffffff 0%,
            rgba(255,255,255,.8) 15%,
            rgba(215,224,225,.58) 48%,
            rgba(180,192,196,.75) 100%
        );
}

.koii-bead--amethyst {
    background:
        radial-gradient(
            circle at 32% 25%,
            #eee0ff 0%,
            #a879bd 35%,
            #704984 68%,
            #402551 100%
        );
}

.koii-bead--rose {
    background:
        radial-gradient(
            circle at 32% 25%,
            #fff1f2 0%,
            #efc2c7 38%,
            #d8939d 70%,
            #ba6e7c 100%
        );
}

.koii-bead--aqua {
    background:
        radial-gradient(
            circle at 32% 25%,
            #e5fbff 0%,
            #78bed1 38%,
            #428ca6 70%,
            #23596f 100%
        );
}


/* ACTION BUTTONS
----------------------------------------- */

.koii-actions {

    display: grid;

    grid-template-columns:
        1fr
        1fr
        2fr;

    gap: 10px;

    margin-bottom: 24px;
}


.koii-action-btn {

    min-height: 50px;

    border-radius: 999px;

    padding: 10px 18px;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition: .2s;
}


.koii-action-btn--light {

    background: #fff;

    border: 1px solid #dedbd6;

    color: #222;
}


.koii-action-btn--dark {

    background: #242a27;

    border: 1px solid #242a27;

    color: #fff;
}


/* SEARCH
----------------------------------------- */

.koii-search {

    height: 48px;

    border: 1px solid #e7e3de;

    border-radius: 999px;

    display: flex;
    align-items: center;

    padding: 0 20px;

    color: #aaa;

    margin-bottom: 12px;
}


/* CATEGORY
----------------------------------------- */

.koii-category-tabs {

    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    margin-bottom: 20px;

    border-bottom: 1px solid #eee;
}

.koii-category-tabs button {

    border: 0;

    background: transparent;

    padding: 12px 4px;

    font-weight: 600;

    color: #777;
}

.koii-category-tabs button.active {

    color: #222;

    border-bottom: 3px solid #b56e64;
}


/* PRODUCT GRID
----------------------------------------- */

.koii-product-grid {

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 12px;
}


.koii-product {

    background: #fff;

    border: 1px solid #ebe7e2;

    border-radius: 18px;

    padding: 16px;

    text-align: center;

    box-shadow:
        0 3px 12px rgba(0,0,0,.035);
}


.koii-product__bead {

    display: block;

    width: 86px;
    height: 86px;

    border-radius: 50%;

    margin: 0 auto 12px;

    padding: 0;

    border: 0;

    cursor: pointer;

    appearance: none;

    transition:
        transform .18s ease,
        box-shadow .18s ease;

    box-shadow:
        inset -8px -10px 14px rgba(0,0,0,.12),
        inset 6px 6px 14px rgba(255,255,255,.55),
        0 7px 14px rgba(0,0,0,.10);
}

.koii-product__bead:hover {

    transform: scale(1.06);

    box-shadow:
        inset -8px -10px 14px rgba(0,0,0,.12),
        inset 6px 6px 14px rgba(255,255,255,.55),
        0 10px 22px rgba(0,0,0,.14);
}


.koii-product__bead:active {

    transform: scale(.94);
}

.koii-product__name {

    font-size: 15px;

    font-weight: 700;
}


.koii-product__meta {

    margin-top: 4px;

    font-size: 13px;

    color: #999;
}


.koii-product__controls {

    display: grid;

    grid-template-columns:
        1fr 1fr;

    margin-top: 14px;

    border-top: 1px solid #eee;
}


.koii-product__controls button {

    height: 40px;

    border: 0;

    background: transparent;

    cursor: pointer;

    font-size: 21px;

    color: #555;
}


.koii-product__controls button:first-child {
    border-right: 1px solid #eee;
}


/* MOBILE
----------------------------------------- */

@media (max-width: 600px) {

    .koii-builder {

        padding:
            12px
            10px
            50px;
    }


    .koii-builder__top {

        font-size: 12px;
        gap: 8px;
    }


    .koii-price strong {
        font-size: 17px;
    }


    .koii-stage {

        width: 94vw;

        border-width: 5px;
    }


    .koii-stage-bead {

        width: 38px;
        height: 38px;
    }


    .koii-product-grid {
        grid-template-columns:
            repeat(3, minmax(0,1fr));

        gap: 7px;
    }


    .koii-product {

        padding:
            11px
            5px;

        border-radius: 14px;
    }


    .koii-product__bead {

        width: 64px;
        height: 64px;
    }


    .koii-product__name {

        font-size: 12px;
    }


    .koii-product__meta {

        font-size: 10px;
    }


    .koii-actions {

        grid-template-columns:
            1fr
            1fr
            1.7fr;
    }

}