/* 转盘高于吸顶导航和已打开的购物车：购物车保留显示，但由转盘遮罩拦截交互。 */
#tt-backdrop {
    z-index: 10010;
}

#tt_wheel-popup {
    z-index: 10020;
}

#tt_wheel-popup .modal-content {
        border-color: transparent;
        background-color: rgba(255, 255, 255, 1);
        height: 520px;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: #ccc #f1f1f1;
    }
.activity-turntable-container {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    overflow-x: hidden;
    overflow-y: scroll;
    position: relative;
    scrollbar-width: none;
}
/* 弹窗左侧弹出：钉在屏幕左边缘，由左向右滑入 */
.wheel-popup--left#tt_wheel-popup .modal-dialog {
    margin: 0;
    height: 100vh;
    animation: wheel-slide-in-left .3s ease-out;
}

/* 弹窗右侧弹出：钉在屏幕右边缘，由右向左滑入 */
.wheel-popup--right#tt_wheel-popup .modal-dialog {
    margin: 0 auto;
    margin-right: 0;
    height: 100vh;
    animation: wheel-slide-in-right .3s ease-out;
}

/* 左/右侧弹出时：内容铺满屏幕高度、圆角为零、超出滚动 */
.wheel-popup--left#tt_wheel-popup .modal-content,
.wheel-popup--right#tt_wheel-popup .modal-content {
    height: 100vh;
    border-radius: 0;
    overflow-y: auto;
    scrollbar-width: none;
}

/* 内部元素垂直居中 */
.wheel-popup--left#tt_wheel-popup .modal-body,
.wheel-popup--right#tt_wheel-popup .modal-body {
    display: flex;
    align-items: center;
    min-height: 100vh;
}

@keyframes wheel-slide-in-left {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes wheel-slide-in-right {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}
@media (min-width: 992px) {
    .wheel-popup--left#tt_wheel-popup .modal-body,
    .wheel-popup--left#tt_wheel-popup .activity-turntable-container {
        padding-left: 0;
    }

    .wheel-popup--right#tt_wheel-popup .modal-body,
    .wheel-popup--right#tt_wheel-popup .activity-turntable-container {
        padding-right: 0;
    }

    .wheel-popup--right#tt_wheel-popup .activity-turntable-container {
        flex-direction: row-reverse;
    }
}

    .tt_loading {
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        background: rgba(255, 255, 255, 0.95);
        z-index: 20;
        font-size: 14px;
        color: #555;
    }
    .tt_loading.hide { display: none; }
    .tt_spinner {
        width: 24px;
        height: 24px;
        border: 3px solid #3BB2C2;
        border-top-color: transparent;
        border-radius: 50%;
        animation: tt-spin 0.8s linear infinite;
    }
    @keyframes tt-spin { to { transform: rotate(360deg); } }

    .wheel-section {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }

.activity-turntable-container .form-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    min-height: 400px;
    max-height: 100%;
}


    .activity-turntable-container .title {
        text-align: center;
    }

        .activity-turntable-container .title h1 {
            font-size: 1.6rem;
            margin-bottom: 10px;
            line-height: 1.8;
        }

        .activity-turntable-container .title p {
            font-size: 1rem;
            opacity: 0.9;
            line-height: 1.6;
        }

    .wheel-container {
        position: relative;
        width: 400px;
        height: 400px;
        margin: 20px auto;
        background-size: 100% 100%;
        background-repeat: no-repeat;
    }
/* 半圆转盘同放大、右对齐、超出部分隐藏；指针保持居中（位置同步） */

.wheel-section.wheel-large .wheel-container {
    margin: 20px 0 20px auto;
    width: 650px;
    height: 650px;
}

.wheel-section.wheel-large .wheel-container {
    margin-left: -280px;
}

.wheel-popup--right#tt_wheel-popup .wheel-section.wheel-large .wheel-container {
    margin-right: -280px;
    margin-left: 0;
}

    .wheel-section .wheel {
        width: 100%;
        height: 100%;
        border-radius: 50%;
        background: conic-gradient(#3BB2C2 0deg 30deg, rgba(31,144,158,0.2) 30deg 60deg, #3BB2C2 60deg 90deg, rgba(31,144,158,0.2) 90deg 120deg, #3BB2C2 120deg 150deg, rgba(31,144,158,0.2) 150deg 180deg, #3BB2C2 180deg 210deg, rgba(31,144,158,0.2) 210deg 240deg, #3BB2C2 240deg 270deg, rgba(31,144,158,0.2) 270deg 300deg, #3BB2C2 300deg 330deg, rgba(31,144,158,0.2) 330deg 360deg);
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
        /* ease-out：起步快、末段渐渐减速到停（转盘"慢下来"的效果）。曲线 y 值单调递增、无 >1 过冲。 */
        transition: transform 4s cubic-bezier(0.2, 0.85, 0.3, 1);
        transform: rotate(0deg);
        position: relative;
        overflow: hidden;
    }

    #tt_wheel-popup .wheel-section .wheel-item {
        position: absolute;
        width: 28%;
        height: auto;
        text-align: center;
        display: block;
        align-items: initial;
        justify-content: initial;
        font-weight: bold;
        color: #fff;
        font-size: 14px;
        line-height: 1.15;
        padding: 0;
        box-sizing: border-box;
        transform-origin: center;
        pointer-events: none;
    }

        #tt_wheel-popup .wheel-section .wheel-item span {
            display: -webkit-box;
            overflow: hidden;
            overflow-wrap: anywhere;
            word-break: break-word;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            transform: none;
            white-space: normal;
            text-shadow: 0 1px 1px rgba(255, 255, 255, 0.4);
        }

        #tt_wheel-popup .wheel-section .wheel.wheel-labels-dense .wheel-item {
            width: 25%;
            font-size: 14px;
        }

        #tt_wheel-popup .wheel-section .wheel.wheel-labels-compact .wheel-item {
            width: 22%;
            font-size: 10px;
            line-height: 1.1;
        }

        /* 静态 nth-child(1..12) 标题规则已移除：renderWheel 按 awards.length 沿扇区中线定位标题。 */
    .wheel-section .wheel-center {
        position: absolute;
        width: 70px;
        top: calc(50% - 64px);
        left: calc(50% - 35px);
        z-index: 10;
        cursor: default;
        pointer-events: none;
    }

    .pointer {
        position: absolute;
        top: calc(50% - 82px);
        left: 50%;
        transform: translateX(-50%);
        width: 25px;
        height: 50px;
        background: #fff;
        clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
        z-index: 11;
    }
#tt_wheel-popup .activity-turntable-container .form-section{
    height: 100%;
}
.form-container {
    padding: 0px 25px 25px;
    width: 100%;
    max-height: 100%;
    overflow-y: scroll;
    scrollbar-width: none;
    transition: all 0.3s ease;
}

    .result-container {
        background: rgba(255, 255, 255, 0.1);
        padding: 0px 25px 25px;
        border-radius: 15px;
        width: 100%;
        text-align: center;
        display: none;
    }

    .activity-turntable-container .form-group input {
        width: 100%;
        padding: 7px 16px;
        margin: 10px 0;
        border: 1px solid rgba(0, 0, 0, 0.8);
        border-radius: 20px;
        background: rgba(255, 255, 255, 0.9);
        font-size: 1rem;
        transition: all 0.3s;
    }

        .activity-turntable-container  .form-group input:focus {
            outline: none;
            border-color: var(--theme-color);
            box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
        }

    .activity-turntable-container .submit-btn {
        width: 100%;
        padding: 6px;
        background: var(--theme-color);
        color: #fff;
        border: none;
        border-radius: 10px;
        font-size: 1.2rem;
        font-weight: bold;
        cursor: pointer;
        transition: all 0.3s;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
    }

        .activity-turntable-container .submit-btn:hover {
            background: var(--theme-color);
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
        }

        .activity-turntable-container  .submit-btn:disabled {
            background: #cccccc;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

    .activity-turntable-container .congrats-title {
        font-size: 1.8rem;
        color: #000;
        font-weight: bold;
        margin-bottom: 10px;
    }

    .activity-turntable-container .discount-info {
        margin-bottom: 25px;
        line-height: 1.6;
    }

    .activity-turntable-container .coupon-code {
        background-image: url(/assets/images/coupon/coupon_info_bg-border.png);
        background-repeat: no-repeat;
        background-size: 100% 100%;
        color: #000;
        padding: 12px;
        border-radius: 10px;
        font-size: 2rem;
        font-weight: bold;
        letter-spacing: 3px;
        margin: 20px auto;
        max-width: 600px;
    }

.activity-turntable-container .copy-btn {
    padding: 14px 25px;
    background: var(--theme-color);
    color: #fff;
    border: none;
    border-radius: 23px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    justify-content: center;
    width: 100%;
    text-align: center;
    max-width: 600px;
}

        .activity-turntable-container .copy-btn:hover {
            background: var(--theme-color);
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
        }

    .activity-turntable-container .note {
        text-align: center;
        font-size: 0.85rem;
        opacity: 0.7;
    }

    .activity-turntable-container .spinner {
        display: inline-block;
        width: 20px;
        height: 20px;
        border: 3px solid rgba(255, 255, 255, 0.3);
        border-radius: 50%;
        border-top-color: #1a237e;
        animation: spin 1s ease-in-out infinite;
    }
.bg-img-wheel {
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
}
    @keyframes spin {
        to {
            transform: rotate(360deg);
        }
    }

    @keyframes pulse {
        0% {
            transform: scale(1);
        }

        50% {
            transform: scale(1.05);
        }

        100% {
            transform: scale(1);
        }
    }

    .pulse {
        animation: pulse 2s infinite;
    }

    @media (min-width: 576px) {
        .wheel-popup .modal-dialog {
            max-width: 900px;
        }
    }

@media (max-width: 991px) {
    .wheel-section.wheel-large .wheel-container {
        width: 350px;
        height: 350px;
        margin: 0 auto !important;
    }

    .activity-turntable-container {
        flex-direction: column !important;
    }

        .activity-turntable-container .form-section {
            padding: 0;
            width: 100%;
            min-height: 300px;
        }

    #tt_wheel-popup .modal-content {
        height: 80vh;
    }

    .activity-turntable-container {
        flex-direction: column;
    }

    .wheel-section {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 10px 20px 0;
    }

    .activity-turntable-container .title h1 {
        font-size: 1.2rem;
    }

    .result-container, .form-container {
        padding: 0px 0px 20px;
    }

    .activity-turntable-container .congrats-title {
        font-size: 1.4rem;
    }

    .activity-turntable-container .copy-btn {
        font-size: 1rem;
    }

    .activity-turntable-container .coupon-code {
        font-size: 1.7rem;
    }

    .wheel-container {
        width: 300px;
        height: 300px;
        margin: 0 auto;
    }

    .activity-turntable-container .wheel-center {
        width: 50px;
        top: calc(50% - 44px);
        left: calc(50% - 25px);
    }
}

/* ==================== 内联专属（.ttp-instance 作用域） ==================== */
/* 镜像 #tt_wheel-popup 的 wheel-item 规则；补全 transform-origin:center（避免 rotate 绕 bottom-right、文字乱）。 */
/* 覆盖共享 base 的 .activity-turntable-container{height:100%}（弹窗依赖 modal-content 固定高度，内联无固定高度→auto，避免布局塌陷）。 */
.ttp-instance .activity-turntable-container {
    height: auto;
}

.ttp-instance .wheel-section .wheel-item {
    position: absolute;
    width: 28%;
    height: auto;
    text-align: center;
    display: block;
    align-items: initial;
    justify-content: initial;
    font-weight: bold;
    color: var(--theme-color);
    font-size: 14px;
    line-height: 1.15;
    padding: 0;
    box-sizing: border-box;
    transform-origin: center;
    pointer-events: none;
}

.ttp-instance .wheel-section .wheel-item span {
    display: -webkit-box;
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    transform: none;
    white-space: normal;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.4);
}

.ttp-instance .wheel.wheel-labels-dense .wheel-item { width: 25%; font-size: 14px; }
.ttp-instance .wheel.wheel-labels-compact .wheel-item { width: 22%; font-size: 10px; line-height: 1.1; }
.ttp-instance .wheel-center { cursor: default; pointer-events: none; }
.ttp-instance .ttp-error { color: #ff3b30; font-size: 12px; min-height: 16px; }
.ttp-instance .ttp-result { text-align: center; }
