/* =====================================================
   LOGO TRUNG TÂM
===================================================== */

.logo-button {
    width: 150px;
    height: 150px;
    padding: 12px;
    overflow: hidden;

    background: #fff;
    border-color: #e6bd55;
}

.logo-button img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}


/* =====================================================
   VÙNG THÔNG TIN KHÁCH CỐ ĐỊNH
===================================================== */

.customer-slot {
    width: 100%;
    height: 96px;
    flex: 0 0 96px;
}

.customer-summary {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 10px 18px;

    background: rgba(255, 253, 245, 0.94);
    border: 2px solid #efb637;
    border-radius: 15px;

    box-shadow: 0 10px 30px rgba(134, 57, 0, 0.14);
    animation: summaryIn 0.3s ease;
}

.customer-summary[hidden] {
    display: none;
}

.summary-label {
    display: block;
    margin-bottom: 5px;

    color: #c2410c;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1.5px;
}

.summary-details {
    display: grid;

    grid-template-columns:
        minmax(280px, 1.7fr)
        minmax(170px, 0.9fr)
        auto;

    align-items: center;
    gap: 12px;
}

.customer-summary h2 {
    margin: 0;

    color: #9f1239;
    font-size: clamp(20px, 1.8vw, 30px);
    line-height: 1.05;

    /* Cho phép hiển thị đầy đủ tên khách hàng */
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    word-break: normal;

    /* Giới hạn tối đa hai dòng */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.customer-summary h2 {
    margin: 0;

    color: #9f1239;
    font-size: clamp(22px, 2.2vw, 34px);
    line-height: 1;

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

.customer-summary p {
    margin: 0;
    font-size: 15px;
    white-space: nowrap;
}

.ready-message {
    padding: 7px 11px;

    color: #166534;
    background: #dcfce7;

    border-radius: 999px;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}


/* =====================================================
   HIỆU ỨNG QUAY
===================================================== */



.wheel-button.is-spinning {
    pointer-events: none;
    opacity: 0.92;
}

.tap-hint kbd {
    padding: 4px 9px;

    color: #fff;
    background: #172033;

    border-radius: 6px;
    box-shadow: 0 3px #667085;

    font: inherit;
    font-weight: 900;
}

.modal-open {
    overflow: hidden;
}

@keyframes summaryIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
}




/* =====================================================
   GIAO DIỆN DESKTOP — LUÔN NẰM TRONG MỘT TRANG
===================================================== */

@media (min-width: 901px) {

    html,
    body.customer-page-body {
        width: 100%;
        height: 100%;
        margin: 0;
        overflow: hidden;
    }

    .customer-page-body > .site-footer {
        display: none;
    }

    .customer-page-body .promo-page {
        width: 100%;
        height: 100vh;
        min-height: 0;

        padding:
            14px
            clamp(36px, 4vw, 76px)
            18px;

        grid-template-columns:
            minmax(520px, 44%)
            minmax(520px, 56%);

        gap: 24px;
        align-items: center;
    }

    /* Cột trái gồm đúng ba vùng:
       1. Thông tin khách
       2. Nội dung chương trình
       3. Hướng dẫn bấm
    */

    .customer-page-body .promo-copy {
        width: 100%;
        height: 100%;
        max-width: 760px;

        display: grid;
        grid-template-rows:
            96px
            minmax(0, 1fr)
            42px;

        align-items: center;
    }

    .customer-page-body #promo-intro {
        height: 100%;
        min-height: 0;

        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .customer-page-body .sale-tag {
        align-self: flex-start;
        padding: 9px 18px;
    }

    .customer-page-body .promo-copy h1 {
        margin: 10px 0 6px;

        font-size: clamp(40px, 6.1vh, 72px);
        line-height: 0.98;
    }

    .customer-page-body #promo-intro > p {
        margin: 5px 0;
        font-size: clamp(14px, 1.7vh, 18px);
    }

    .customer-page-body .mega-sale {
        width: clamp(125px, 19vh, 190px);
        margin: 10px auto;
    }

    .customer-page-body .mega-sale strong {
        font-size: clamp(32px, 4.8vh, 48px);
    }

    .customer-page-body .mega-sale b {
        font-size: clamp(30px, 4.3vh, 44px);
    }

    .customer-page-body .tap-hint {
        margin: 0;

        text-align: center;
        font-size: clamp(14px, 1.8vh, 18px);
    }

    /* Vòng quay co theo cả chiều rộng và chiều cao */

    .customer-page-body .wheel-stage {
        width: min(48vw, 82vh, 690px);
        max-width: 100%;
        max-height: 82vh;
    }

    .customer-page-body .prize-label {
        transform:
            rotate(
                calc(
                    (360deg / var(--count)) * var(--i)
                    + (180deg / var(--count))
                )
            )
            translateY(
                calc(-1 * min(13.5vw, 22vh, 195px))
            )
            rotate(90deg);
    }
}


/* =====================================================
   TABLET VÀ ĐIỆN THOẠI
===================================================== */

@media (max-width: 900px) {

    .customer-slot {
        height: 150px;
        flex-basis: 150px;
    }

    .summary-details {
        grid-template-columns: 1fr;
        gap: 7px;
        text-align: center;
    }

    .customer-summary {
        padding: 14px;
    }

    .customer-summary h2 {
        white-space: normal;
    }

    .ready-message {
        justify-self: center;
    }
}

@media (max-width: 520px) {

    .logo-button {
        width: 108px;
        height: 108px;
        padding: 8px;
    }

    .customer-slot {
        height: 165px;
        flex-basis: 165px;
    }

    .customer-summary p {
        font-size: 14px;
    }
}

/* =====================================================
   VỊ TRÍ NỘI DUNG TRÊN TỪNG Ô VÒNG QUAY
===================================================== */

.promo-wheel {
    --label-radius: 190px;
}

/*
 * Selector này có độ ưu tiên cao để ghi đè
 * các thiết lập prize-label cũ.
 */
body.customer-page-body
.promo-wheel
.prize-label {
    position: absolute;
    z-index: 3;

    left: 50%;
    top: 50%;

    width: 135px;
    min-height: 42px;
    margin: 0;

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

    color: #fff;
    font-size: clamp(11px, 1.05vw, 17px);
    font-weight: 900;
    line-height: 1.15;
    text-align: center;

    white-space: normal;
    overflow: visible;
    overflow-wrap: break-word;
    word-break: normal;

    text-shadow:
        0 1px 2px rgba(0, 0, 0, 0.65);

    transform-origin: 0 0;

    transform:
        rotate(
            calc(
                (360deg / var(--count)) * var(--i)
                + (180deg / var(--count))
            )
        )
        translateY(
            calc(-1 * var(--label-radius))
        )
        rotate(90deg)
        translateX(-50%);
}

body.customer-page-body
.promo-wheel
.prize-label.dark {
    color: #d71920;
    text-shadow: none;
}

/*
 * Tên giải dài được phép xuống dòng,
 * nhưng không tràn khỏi ô.
 */
body.customer-page-body
.promo-wheel
.prize-label {
    max-height: 55px;
}

/* Màn hình nhỏ */
@media (max-width: 900px) {
    body.customer-page-body
    .promo-wheel
    .prize-label {
        width: 115px;
        font-size: 12px;
    }
}

@media (max-width: 520px) {
    body.customer-page-body
    .promo-wheel
    .prize-label {
        width: 88px;
        min-height: 34px;
        max-height: 44px;

        font-size: 9px;
        line-height: 1.1;
    }
}

/* =====================================================
   HIỆU ỨNG DỪNG ĐÚNG Ô KẾT QUẢ
===================================================== */

.promo-wheel {
    transform: rotate(0deg);

    transition:
        transform 5s
        cubic-bezier(0.12, 0.68, 0.12, 1);
}

.promo-wheel.is-spinning {
    pointer-events: none;
}

.wheel-button.is-spinning {
    pointer-events: none;
    opacity: 0.88;
}


/* =====================================================
   POPUP KẾT QUẢ
===================================================== */

.result-overlay {
    position: fixed;
    z-index: 2000;
    inset: 0;

    display: grid;
    place-items: center;

    padding: 20px;

    background: rgba(43, 18, 0, 0.78);
    backdrop-filter: blur(5px);
}

.result-overlay[hidden] {
    display: none;
}

.result-card {
    position: relative;

    width: min(440px, 100%);
    padding: 28px;

    color: #172033;
    background: #fff;

    border: 3px solid #efb637;
    border-radius: 18px;

    text-align: center;

    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.45);

    animation: resultShow 0.35s ease;
}

.result-icon {
    display: grid;
    place-items: center;

    width: 72px;
    height: 72px;

    margin: 0 auto 12px;

    color: #fff;
    background: linear-gradient(
        135deg,
        #f59e0b,
        #ed1c24
    );

    border-radius: 50%;

    font-size: 36px;
}

.result-card h2 {
    margin: 5px 0;

    color: #9f1239;
    font-size: 29px;
}

.result-card .result-prize-name {
    margin: 15px 0;

    color: #ed1c24;
    font-size: 25px;
    font-weight: 900;
}

.result-card .result-message {
    color: #475467;
    font-size: 15px;
    line-height: 1.5;
}

.result-card .result-spins {
    display: inline-block;

    margin: 8px 0 16px;
    padding: 7px 13px;

    color: #166534;
    background: #dcfce7;

    border-radius: 999px;

    font-size: 13px;
    font-weight: 800;
}

.result-card button {
    min-width: 150px;
}

@keyframes resultShow {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* =====================================================
   HIỆU ỨNG PHÁO GIẤY ĐƠN GIẢN
===================================================== */

.confetti-piece {
    position: fixed;
    z-index: 2100;
    top: -20px;

    width: 10px;
    height: 16px;

    pointer-events: none;

    animation:
        confettiFall 2.8s linear forwards;
}

@keyframes confettiFall {
    from {
        opacity: 1;

        transform:
            translateY(-20px)
            rotate(0deg);
    }

    to {
        opacity: 0;

        transform:
            translateY(110vh)
            rotate(720deg);
    }
}