/* Reset & base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    font-family: 'Kanit', sans-serif;
    background-color: #f5f0e9;
    /* เบจอ่อน */
    color: #4a3720;
    /* น้ำตาลเข้ม */
    overflow-x: hidden;
    touch-action: pan-y;
    /* ให้ swipe แนวตั้งทำงาน */
    -webkit-overflow-scrolling: touch;
    /* iOS smooth scroll */
}

body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    padding: 0px 20px;
    position: relative;
    min-height: 100vh;
}

.text-brown {
    color: #5a4730;
}

.fs-0-5rem {
    font-size: 0.5rem !important;
}

.fs-0-7rem {
    font-size: 0.7rem !important;
}

.fs-0-7-5rem {
    font-size: 0.75rem !important;
}

.fs-1-2rem {
    font-size: 1.2rem !important;
}

.fs-1-5rem {
    font-size: 1.5rem !important;
}

.fs-1-8rem {
    font-size: 1.8rem !important;
}

.fs-1-8-5rem {
    font-size: 1.85rem !important;
}

.fs-1-9rem {
    font-size: 1.9rem !important;
}

.fs-1-9-5rem {
    font-size: 1.95rem !important;
}

.fs-2rem {
    font-size: 2rem !important;
}

.fs-2-5rem {
    font-size: 2.5rem !important;
}

.fs-3rem {
    font-size: 3rem !important;
}

/* ชื่อเว็บด้านบนสุด */
header {
    width: 100%;
    max-width: 320px;
    margin-bottom: 40px;
    font-family: 'Oswald', serif;
    font-weight: 600;
    font-size: 1.8rem;
    color: #5a4730;
    user-select: none;
    margin-left: auto;
    margin-right: auto;
}

.oswald {
    font-family: 'Oswald', serif !important;
}

/* container เป็น Bootstrap container (centered) */
/* .container {
    max-width: 500px;
    width: 100%;
    position: relative;
    margin: 0 auto;
} */

.container {
    max-width: 500px;
    width: 100%;
    height: 100%;
    opacity: 1;
    transition: opacity 0.6s ease;
    position: absolute;
    /* ซ้อนทับกัน */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 0;
    overflow: scroll;
    -ms-overflow-style: none;
    /* IE & Edge */
    scrollbar-width: none;
    /* Firefox */
    /* ให้ยืดเท่าหน้าจอ */
    overflow-y: auto;
    /* ให้ scroll ตามเนื้อหา */
    -webkit-overflow-scrolling: touch;
}

.container::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

.quiz-step {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* ✅ ไม่ให้ progress bar หาย */
    align-items: center;
    padding-top: 60px;
    /* height: 140%; */
    /* กัน progress bar ชิดขอบบนเกินไป */
}

.pay-div {
    padding-top: 260px;
    padding-bottom: 100px;
}

#pre-pay {
    padding-top: 650px;
}

/* .quiz-step {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s ease;
    padding-top: 10%;
} */

/* .quiz-wrap {
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
} */


.visible {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

.hidden {
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}

/* .progress-wrapper {
    width: 100%;
    height: 12px;
    background: linear-gradient(90deg, #f7e1c4, #fbe8b1);
    border-radius: 10px;
    overflow: hidden;
    margin: 15px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
} */

.progress-wrapper {
    position: absolute;
    /* ยึดตำแหน่ง */
    top: 72px;
    /* ระยะห่างจากบน */
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    /* ขนาดกว้าง */
    height: 12px;
    background: linear-gradient(90deg, #f7e1c4, #fbe8b1);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 10;
    /* กันถูกทับ */
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #f8b195, #f67280);
    border-radius: 10px;
    transition: width 0.6s ease-in-out;
}

#quiz-container:not(.hidden) {
    opacity: 1;
    transition: opacity 0.6s ease;
}

#quiz-container.fade-out {
    opacity: 0;
    mix-blend-mode: multiply;
    /* หรือ multiply/overlay แล้วแต่ style */
    transition: opacity 0.6s ease;
}


.question-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #f5f0e6;
    z-index: -1;
}

.question-background img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
    /* transition: opacity 0.3s ease; */
}

.bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* ใช้เต็ม parent */
    background-repeat: repeat-y;
    background-size: auto;
    background-position: top center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.bg-layer.current {
    opacity: 1;
    z-index: 1;
}

.bg-layer.next {
    z-index: 0;
}


.question-text {
    font-size: 1.2rem;
    padding: 1rem;
    text-align: center;
    border-radius: 16px;

    /* พื้นหลัง parchment */
    /* background: linear-gradient(135deg, #fdf6e3, #f5e0b3); */
    /* background-blend-mode: multiply; */

    background-color: #e4d6c6;

    /* ขอบทองบาง ๆ */
    border: 2px solid #3b2615;

    /* เงา fantasy glow */
    /* box-shadow: 0 4px 12px rgba(210, 160, 80, 0.3); */

    /* ฟอนต์ fantasy */
    color: #3b2615;
    line-height: 1.6;
}

/* เพิ่ม shimmer effect เวลาขึ้นคำถามใหม่ */
.question-text.fade-in {
    animation: fadeInScroll 0.8s ease-out;
}

@keyframes fadeInScroll {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

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

.quiz-controls {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

/* Base style */
.nav-btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Secondary (ย้อนกลับ) */
.secondary-btn {
    background-color: #d6c0a8;
    /* beige warm */
    color: #4b2e18;
    border: 2px solid #4b2e18;
}

.secondary-btn:hover {
    background-color: #c4ad94;
    border: 2px solid #4b2e18;
    transform: translateY(-2px);
}

/* Primary (ถัดไป) */
.primary-btn {
    /* background: linear-gradient(135deg, #ffb347, #ffcc33); amber → gold */
    background-color: #4b2e18;
    border: 2px solid #4b2e18;
    color: #c4ad94;
    box-shadow: 0 0 12px rgba(255, 187, 51, 0.6);
    position: relative;
    overflow: hidden;
}

/* Glow hover effect */
.primary-btn:hover {
    box-shadow: 0 0 18px rgba(255, 200, 80, 0.8);
    transform: translateY(-2px);
    border: 2px solid #4b2e18;
    background-color: #c4ad94;
    color: #4b2e18;
}

/* Click effect */
.primary-btn:active {
    transform: scale(0.97);
    box-shadow: 0 0 8px rgba(255, 180, 60, 0.6);
    border: 2px solid #4b2e18;
}

.brown-btn {
    background-color: #5c3a21;
    border: 2px solid #5c3a21;
    color: white;
    position: relative;
    overflow: hidden;
    border-radius: 30px;
}

.brown-btn:hover {
    background-color: #5c3a21;
    color: white;
}

.brown-btn:active {
    background-color: #5c3a21;
    color: white;
}

.choices-container {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 80%;
    margin-inline: auto;
}

/* ปุ่มตัวเลือก Modern Fantasy Glow */
.choice-btn {
    position: relative;
    padding: 14px 18px;
    /* เอาเว้นซ้ายสำหรับ badge ออก */
    font-size: 1rem;
    font-weight: 600;
    text-align: left;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    overflow: hidden;
    color: #4b2e18;
    background: linear-gradient(135deg, #fffaf3, #f5e0b3);
    box-shadow: 0 4px 12px rgba(210, 160, 80, 0.35), 0 0 15px rgba(245, 224, 197, 0.2);
    transition: all 0.3s ease;
    font-family: 'Kanit', sans-serif;
}

/* Shine effect */
.choice-btn::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.35) 50%, rgba(255, 255, 255, 0) 100%);
    transform: rotate(25deg) translateX(-100%);
    pointer-events: none;
    transition: transform 0.8s ease;
}

/* Hover / Tap effect */
.choice-btn:hover::after,
.choice-btn:active::after {
    transform: rotate(25deg) translateX(100%);
}

.choice-btn:active {
    transform: scale(0.98);
}

/* Selected state */
.choice-btn.selected {
    /* background: linear-gradient(135deg, #d9a441, #b57a3a); */
    background: linear-gradient(135deg, #994d12, #4b2e18);
    border: 0.5px solid #4b2e18;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
    box-shadow: 0 6px 15px rgba(210, 160, 80, 0.7), 0 0 30px rgba(245, 224, 197, 0.45);
}

/* Responsive มือถือ */
@media (hover: none) {
    .choice-btn:hover::after {
        transform: rotate(25deg) translateX(-100%);
    }
}

.start-btn {
    background-color: #5c3a21;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 32px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Kanit', sans-serif;
    margin-top: 20px;
}

button.restart-btn {
    background-color: #c4ad94;
    color: #4b2e18;
    border: none;
    border-radius: 12px;
    padding: 12px 32px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Kanit', sans-serif;
    margin-top: 20px;
}

.start-blue-btn {
    background-color: #19abf9;
    box-shadow: 0 0 12px rgba(255, 187, 51, 0.6);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 32px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Kanit', sans-serif;
    margin-top: 20px;
}

/* Ripple animation */
.ripple-wrap {
    display: none;
    overflow: hidden;
    position: fixed;
    font-size: 0;
    z-index: 1000;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

@keyframes RIPPLER {
    0% {
        border-width: 0;
    }

    40% {
        height: 0;
        width: 0;
        border-width: 1500px;
        margin-top: -1500px;
        margin-left: -1500px;
        border-color: #d9cbb7;
    }

    41% {
        height: 0;
        width: 0;
        border-width: 1500px;
        margin-top: -1500px;
        margin-left: -1500px;
        border-color: #d9cbb7;
    }

    100% {
        border-width: 1500px;
        height: 2000px;
        width: 2000px;
        margin-top: -2500px;
        margin-left: -2500px;
        border-color: #d9cbb7;
    }
}

.ripple {
    display: block;
    height: 0;
    width: 0;
    border-width: 0px;
    border-style: solid;
    border-color: #aba090;
    border-radius: 100%;
    position: absolute;
    -webkit-animation: none;
    animation: none;
}

.ripple-wrap.goripple {
    display: block;
}

.ripple-wrap.goripple .ripple {
    animation-name: RIPPLER;
    animation-duration: 1.5s;
    animation-fill-mode: forwards;
}

/* กล่อง background หลังรูปสัตว์ */
.image-background {
    background-color: #d9cbb7;
    /* เบจเข้มกว่า background */
    border-top-left-radius: 140px;
    border-top-right-radius: 140px;
    width: 280px;
    height: 320px;
    margin: 0 auto 24px auto;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(90, 71, 48, 0.15);
}

#confettiCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    /* อยู่เหนือ background */
}

#confettiCanvas2 {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    /* อยู่เหนือ background */
}

@keyframes sparkleMove {
    0% {
        transform: rotate(120deg) scale(1);
        opacity: 0.9;
    }

    50% {
        transform: rotate(130deg) scale(1.1);
        opacity: 1;
    }

    100% {
        transform: rotate(120deg) scale(1);
        opacity: 0.9;
    }
}

@keyframes sparkleMoveReverse {
    0% {
        transform: rotate(-20deg) scale(1);
        opacity: 0.9;
    }

    50% {
        transform: rotate(-10deg) scale(1.1);
        opacity: 1;
    }

    100% {
        transform: rotate(-20deg) scale(1);
        opacity: 0.9;
    }
}

/* วิ้งมุมบนขวา */
.image-background::before {
    content: "";
    position: absolute;
    top: 0;
    right: -50px;
    width: 120px;
    height: 120px;
    background: white;
    clip-path: polygon(50% 0%, 58% 37%, 100% 49%, 100% 50%, 59% 57%, 50% 100%, 39% 57%, 0 51%, 0 52%, 41% 36%);
    opacity: 0.9;
    animation: sparkleMove 3s ease-in-out infinite;
}

/* วิ้งมุมล่างซ้าย */
.image-background::after {
    content: "";
    position: absolute;
    bottom: 10px;
    left: -50px;
    width: 120px;
    height: 120px;
    background: white;
    clip-path: polygon(50% 0%, 58% 37%, 100% 49%, 100% 50%, 59% 57%, 50% 100%, 39% 57%, 0 51%, 0 52%, 41% 36%);
    transform: rotate(-20deg);
    opacity: 0.9;
    animation: sparkleMove 3s ease-in-out infinite;
}

/* กล่อง background หลังรูปสัตว์ */
.result-background {
    background-color: #fcfcf9;
    /* เบจเข้มกว่า background */
    border-top-left-radius: 140px;
    border-top-right-radius: 140px;
    width: 280px;
    height: 320px;
    margin: 0 auto 24px auto;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cat-image {
    width: 200px;
    height: 200px;

    min-width: 200px;
    min-height: 200px;

    max-width: 200px;
    max-height: 200px;

    border-radius: 0;
    object-fit: contain;
    object-position: center center;
    opacity: 1;
    transition: opacity 2s ease;
    background-color: transparent;
    overflow: hidden;
    display: block;
    margin: auto;
}

.cat-image.fade-out {
    opacity: 0;
}

.animal-image {
    width: 260px;
    height: 260px;
    border-radius: 0;
    object-fit: contain;
    object-position: center center;
    opacity: 1;
    transition: opacity 2s ease;
    background-color: transparent;
    overflow: hidden;
    display: block;
    margin: auto;
}

.animal-image-second {
    margin-left: -60px;
    /* ค่านี้ทำให้รูปทับกัน */
}

.animal-image.fade-out {
    opacity: 0;
}

/* ปุ่มเริ่มทดสอบ ปรับใช้ Bootstrap btn + custom */
.start-btn {
    background-color: #5c3a21 !important;
    /* น้ำตาลเข้ม */
    border: none !important;
    padding: 14px 32px !important;
    border-radius: 12px !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: #fff !important;
    cursor: pointer !important;
    box-shadow: 0 4px 8px rgba(92, 58, 33, 0.6);
    transition: background-color 0.3s ease, transform 0.15s ease;
    user-select: none;
    width: 100% !important;
    max-width: 320px !important;
    font-family: 'Kanit', sans-serif !important;
    margin: 0 auto;
}

button.restart-btn {
    background-color: #c4ad94 !important;
    /* น้ำตาลเข้ม */
    border: none !important;
    padding: 14px 32px !important;
    border-radius: 12px !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: #4b2e18 !important;
    cursor: pointer !important;
    box-shadow: 0 4px 8px rgba(92, 58, 33, 0.6);
    transition: background-color 0.3s ease, transform 0.15s ease;
    user-select: none;
    width: 100% !important;
    max-width: 320px !important;
    font-family: 'Kanit', sans-serif !important;
    margin: 0 auto;
}

.wallpaper-btn {
    background: linear-gradient(270deg, #6d4c2b, #b79363, #6d4c2b);
    background-size: 400% 400%;
    color: #fff !important;
    border: none !important;
    padding: 14px 32px !important;
    border-radius: 12px !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    box-shadow: 0 4px 8px rgba(92, 58, 33, 0.6);
    transition: transform 0.15s ease, box-shadow 0.3s ease;
    user-select: none;
    width: 100% !important;
    max-width: 320px !important;
    font-family: 'Kanit', sans-serif !important;
    margin: 0 auto;

    /* ✨ Gradient Animation */
    animation: gradientShift 6s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.wallpaper-btn:hover {
    box-shadow: 0 4px 8px rgba(92, 58, 33, 0.6);
}


/* ปุ่มเริ่มทดสอบ ปรับใช้ Bootstrap btn + custom */
.start-blue-btn {
    background-color: #19abf9 !important;
    /* น้ำตาลเข้ม */
    border: none !important;
    padding: 14px 32px !important;
    border-radius: 12px !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: #fff !important;
    cursor: pointer !important;
    box-shadow: 0 0 12px rgba(255, 187, 51, 0.6);
    transition: background-color 0.3s ease, transform 0.15s ease;
    user-select: none;
    width: 100% !important;
    max-width: 320px !important;
    font-family: 'Kanit', sans-serif !important;
    margin: 0 auto;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-2px);
    }
}

.start-blue-btn.attention {
    animation: bounce 1.5s infinite ease-in-out;
}


.start-btn:active {
    transform: scale(0.95);
    background-color: #4a2e19 !important;
}

button.restart-btn:active {
    transform: scale(0.95);
    background-color: #c4ad94 !important;
}

.start-blue-btn:active {
    transform: scale(0.95);
    background-color: #19abf9 !important;
}

#pay {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    text-align: center;
}

#pay h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

#pay p {
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.qr-container {
    background-color: #fff;
    padding: 16px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.qr-code {
    width: 350px;
    height: 350px;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.qr-container.expired .qr-code {
    opacity: 0.4;
    filter: grayscale(100%);
}

.qr-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    text-align: center;
}

.qr-overlay.hidden {
    display: none;
}

/* .pay-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.pay-actions .btn {
  flex: 1;
  width: unset;
} */

#cancelPayBtn2 {
    background-color: #c4ad94;
    color: #4b2e18;
}

.sample-images img {
    width: 150px;
    height: auto;
}

#soundToggleBtnDiv {
    position: fixed;
    top: 30px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 9998;
    /* เว้นระยะห่างระหว่าง span กับปุ่ม */
}

/* ปุ่มเปิด/ปิดเสียง อยู่มุมบนขวา fixed */
#soundToggleBtn {
    background-color: #5c3a21;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 8px 16px;
    font-weight: 600;
    font-family: 'Kanit', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(92, 58, 33, 0.6);
    user-select: none;
    z-index: 9998;
    font-size: 1rem;
    white-space: nowrap;
    transition: background-color 0.3s ease;
}

#soundToggleBtn:hover {
    background-color: #4a2e19;
}

.supportDiv {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 9998;
    /* เว้นระยะห่างระหว่าง span กับปุ่ม */
}

/* ปุ่มใหม่ support-btn */
button.support-btn {
    background: linear-gradient(270deg, #c4ad94, #e1d0ba, #c4ad94);
    background-size: 200% 200%;
    color: #4b2e18 !important;
    border: 1px solid #4b2e18 !important;
    padding: 14px 32px !important;
    border-radius: 12px !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    box-shadow: 0 4px 8px rgba(92, 58, 33, 0.6);
    transition: transform 0.15s ease;
    user-select: none;
    width: 100% !important;
    max-width: 320px !important;
    font-family: 'Kanit', sans-serif !important;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    animation: gradientMove 5s ease infinite, pulseEffect 0.75s ease-in-out infinite;
}

/* Hover effect */
button.support-btn:hover {
    transform: scale(1.05);
}

/* Gradient animation */
@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Pulse Animation */
@keyframes pulseEffect {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.01);
    }

    /* ขยายขึ้นมานิดเดียว */
    100% {
        transform: scale(1);
    }
}

/* Ripple effect */
button.support-btn::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

button.support-btn:active::after {
    animation: ripple 0.6s linear;
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.6;
    }

    100% {
        transform: scale(8);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 480px) {
    .question-background {
        height: 101%;
    }

    .quiz-step {
        height: 101%;
    }

    .question-background-long {
        height: 105%;
    }

    .question-background-style {
        height: 114%;
    }

    .question-background-zodiac {
        height: 140%;
    }

    .image-background {
        width: 80vw;
        height: 330px;
        border-top-left-radius: 180px;
        border-top-right-radius: 180px;
    }

    .result-background {
        width: 80vw;
        height: 330px;
        border-top-left-radius: 180px;
        border-top-right-radius: 180px;
    }

    .animal-image {
        width: 85vw;
        height: 270px;
    }

    /* .container {
        max-width: 90vw;
    } */

    .start-btn {
        max-width: 90vw !important;
        padding: 12px 24px !important;
        font-size: 1rem !important;
    }

    button.restart-btn {
        max-width: 90vw !important;
        padding: 12px 24px !important;
        font-size: 1rem !important;
    }

    .wallpaper-btn {
        max-width: 90vw !important;
        padding: 12px 24px !important;
        font-size: 1rem !important;
    }

    button.support-btn {
        max-width: 90vw !important;
        padding: 12px 24px !important;
        font-size: 1rem !important;
    }

    .start-blue-btn {
        max-width: 90vw !important;
        padding: 12px 24px !important;
        font-size: 1rem !important;
    }

    .start-blue-btn-quiz {
        max-width: 74vw !important;
    }

    header {
        max-width: 90vw;
        font-size: 1.5rem;
    }

    #soundToggleBtn {
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    .cat-image {
        width: 180px;
        height: 180px;

        min-width: 180px;
        min-height: 180px;

        max-width: 180px;
        max-height: 180px;
    }

    .question-text {
        font-size: 1rem;
    }
}

@media (max-width: 375px) {
    .question-background {
        height: 108%;
    }

    .quiz-step {
        height: 108%;
    }

    .question-background-long {
        height: 112%;
    }

    .question-background-style {
        height: 118%;
    }

    .question-background-zodiac {
        height: 140%;
    }
}

.preloader-container {
    position: fixed;
    top: -40;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    flex-direction: column;
    /* จากแนวนอน → แนวตั้ง */
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    width: 100%;
    height: 110vh;
    background: #f5f0e9;
    z-index: 9999;
}

.preloader-container.active_new {
    -webkit-transform: translateY(-120vh);
    transform: translateY(-120vh);
    -webkit-transition: ease-in-out 0.8s;
    transition: ease-in-out 0.8s;
    -webkit-transition-delay: 1s;
    transition-delay: 1s;
}

.preloader-text {
    font-family: "Inter", sans-serif !important;
    font-optical-sizing: auto;
    font-weight: 800 !important;
    font-style: normal !important;
    font-size: 2.5rem;
    letter-spacing: 5px;
    top: 0;
    height: 70vh;
    position: absolute;
    padding-top: 45vh;
    width: 100%;
    margin: auto;
    text-align: center;
}

/* Animation for individual letters */
.preloader-text span {
    opacity: 0;
    animation: topToBottom 10s forwards;
    transform-origin: center;
}

.loader {
    width: 160px;
    height: 185px;
    position: relative;
    background: #fff;
    border-radius: 100px 100px 0 0;
}

.loader:after {
    content: "";
    position: absolute;
    width: 100px;
    height: 125px;
    left: 50%;
    top: 25px;
    transform: translateX(-50%);
    background-image: radial-gradient(circle, #000 48%, transparent 55%),
        radial-gradient(circle, #000 48%, transparent 55%),
        radial-gradient(circle, #fff 30%, transparent 45%),
        radial-gradient(circle, #000 48%, transparent 51%),
        linear-gradient(#000 20px, transparent 0),
        linear-gradient(#cfecf9 60px, transparent 0),
        radial-gradient(circle, #cfecf9 50%, transparent 51%),
        radial-gradient(circle, #cfecf9 50%, transparent 51%);
    background-repeat: no-repeat;
    background-size: 16px 16px, 16px 16px, 10px 10px, 42px 42px, 12px 3px,
        50px 25px, 70px 70px, 70px 70px;
    background-position: 25px 10px, 55px 10px, 36px 44px, 50% 30px, 50% 85px,
        50% 50px, 50% 22px, 50% 45px;
    animation: faceLift 3s linear infinite alternate;
}

.loader:before {
    content: "";
    position: absolute;
    width: 140%;
    height: 125px;
    left: -20%;
    top: 0;
    background-image: radial-gradient(circle, #fff 48%, transparent 50%),
        radial-gradient(circle, #fff 48%, transparent 50%);
    background-repeat: no-repeat;
    background-size: 65px 65px;
    background-position: 0px 12px, 145px 12px;
    animation: earLift 3s linear infinite alternate;
}

@keyframes faceLift {
    0% {
        transform: translateX(-60%);
    }

    100% {
        transform: translateX(-30%);
    }
}

@keyframes earLift {
    0% {
        transform: translateX(10px);
    }

    100% {
        transform: translateX(0px);
    }
}

.loader-load {
    display: block;
    position: relative;
    height: 32px;
    width: 140px;
    border: 3px solid #fff;
    border-radius: 20px;
    box-sizing: border-box;
}

.loader-load:before {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #be9669;
    animation: ballbns 2s ease-in-out infinite alternate;
}

@keyframes ballbns {
    0% {
        left: 0;
        transform: translateX(0%);
    }

    100% {
        left: 100%;
        transform: translateX(-100%);
    }
}


.mt-6 {
    margin-top: 4rem !important;
}

.mt-7 {
    margin-top: 5rem !important;
}

.mb-6 {
    margin-bottom: 4rem !important;
}

.mb-7 {
    margin-bottom: 5rem !important;
}

.wow {
    visibility: hidden;
}

.unlock-card {
    background: #d9cbb7;
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    margin-top: 30px;
    position: relative;
    box-shadow: 0 0 25px rgba(255, 215, 100, 0.2);
    width: 100%;
}

.locked-content {
    font-size: 1.1rem;
    color: #4a3720;
    margin-bottom: 20px;
    position: relative;
}

.floating-key {
    font-size: 2.5rem;
    animation: floatKey 2s ease-in-out infinite;
    cursor: pointer;
}

.fantasy-key {
    text-shadow: 0 0 10px #f5f0e9, 0 0 20px #f5f0e9;
}

@keyframes floatKey {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-8px) rotate(-10deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

.unlock-btn {
    background: linear-gradient(135deg, #ffcc70, #ffdd94);
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #4a3720;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(255, 220, 120, 0.6);
}

.unlock-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(255, 220, 120, 0.9);
}

.result-text-pre-pay {
    text-align: left !important;
    padding-left: 1.2rem !important;
    padding-right: 1.2rem !important;
}

.result-wrapper {
    position: relative;
    max-height: 100px;
}

.blur-overlay-50 {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    /* Safari */
    pointer-events: none;
}

.blur-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    /* Safari */
    pointer-events: none;
}

.resul-image {
    width: 100%;
    height: auto;
}

#full-result {
    position: fixed;
    /* เต็มจอ overlay */
    inset: 0;
    /* top:0; left:0; right:0; bottom:0 */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* ถ้าอยากให้อยู่ด้านบน */
    align-items: center;
    /* จัดกึ่งกลางแนวนอน */
    overflow-y: auto;
    /* ให้ scroll ได้ */
    padding: 4rem 1rem 6rem;
    /* กันขอบบน/ล่างนิดหน่อย */
    box-sizing: border-box;
}

.text-start {
    text-align: left !important;
}

.full-result-div {
    background: #d9cbb7;
    /* #d9cbb7 #fff3e1 */
    border: none;
    /* border: 2px solid #4a3720; */
    border-radius: 12px;
}

.vip-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #4a3720;
    /* น้ำตาล */
    color: #f5f0e9;
    /* เบจครีม */
    padding: 20px 14px;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 600;
    margin: 12px 0;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
    letter-spacing: 0.5px;
    position: relative;
    /* ต้องมีเพื่อวาง pseudo-element */
    overflow: hidden;
    /* ตัดแสงไม่ให้ล้นออกมา */
}

.vip-badge i {
    color: #f5f0e9;
    font-size: 1rem;
}

/* ทำ shine effect */
.vip-badge::before {
    content: "";
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.6) 50%,
            rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    animation: shine 2s infinite;
}

/* Animation ให้แสงวิ้งวิ่งผ่าน */
@keyframes shine {
    0% {
        left: -75%;
    }

    100% {
        left: 125%;
    }
}

#zodiacSelect {
    -webkit-appearance: none;
    /* Safari/Chrome */
    -moz-appearance: none;
    /* Firefox */
    appearance: none;
    /* Default */

    width: 100%;
    max-width: 320px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 2px solid #c9b9a3;
    /* ขอบน้ำตาลอ่อน */
    background-color: #fdfaf5;
    /* ครีมอ่อน */
    color: #4a3720;
    /* ตัวอักษรน้ำตาลเข้ม */
    font-size: 1rem;
    font-family: 'Quicksand', 'Kanit', sans-serif;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.25s ease;
    margin: 8px 0;
}

/* Hover / Focus */
#zodiacSelect:focus {
    outline: none;
    border-color: #a3825a;
    box-shadow: 0 0 6px rgba(163, 130, 90, 0.4);
    background-color: #fffdf9;
}

/* Custom arrow */
#zodiacSelect {
    background-image: url('data:image/svg+xml;utf8,<svg fill="%234a3720" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    /* เผื่อ arrow */
}

/* .question-background-zodiac img {
    height: 140%;
} */

.more-benefit {
    text-decoration: underline;
    color: #4a3720;
}

.mb-0 {
    margin-bottom: 0 !important;
}


.ads-wrapper {
    position: relative;
    display: inline-block;
    width: 80%;
    margin: 0 auto;
    text-align: center;
    /* จัด wrapper ให้อยู่กลาง */
    margin-top: 1.5rem;
}

.ads-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
}

.ads-close {
    position: absolute;
    top: -30px;
    /* ดันขึ้นไปเหนือรูป */
    right: 0;
    /* มุมขวาของ wrapper */
    background: rgba(255, 255, 255, 0.75);
    border: none;
    border-radius: 25px;
    font-size: 14px;
    padding: 1px 10px;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    /* เงาเล็กๆให้ดูเด่น */
}

.ads-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.ads-popup.hidden {
    display: none;
}

.ads-popup-content {
    position: relative;
    width: 345px;
    /* ปรับตามต้องการ */
    height: 345px;
    /* ทำเป็นสี่เหลี่ยมด้านเท่า */
}

.ads-img-popup {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    cursor: pointer;
}

.ads-popup-content .ads-close {
    position: absolute;
    top: -35px;
    right: 0px;
    width: 31%;
    height: 8%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 20px;
    padding: 5px 8px;
    font-size: 14px;
    cursor: pointer;
    z-index: 10;
    white-space: nowrap;
    box-sizing: border-box;
    max-width: calc(100% - 16px);
    overflow: hidden;
    text-overflow: ellipsis;

    /* จัดกลางข้อความและไอคอน */
    display: flex;
    align-items: center;
    /* จัดกึ่งกลางแนวตั้ง */
    justify-content: center;
    /* จัดกึ่งกลางแนวนอน */
    gap: 4px;
    /* เว้นช่องระหว่าง icon กับข้อความ */
}

.btn-icon {
    width: 25px;
    /* ปรับขนาดได้ */
    height: 25px;
    /* ถ้าอยากได้สี่เหลี่ยมด้านเท่า */
    object-fit: contain;
    /* ไม่บิดสัดส่วน */
    position: relative;
    top: -4px;
    /* ขยับขึ้น หรือลองปรับเป็น +2px ถ้าอยากให้ลง */
}

.result-text-server {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
    font-size: 1.15rem !important;
}

.btn-confirm-custom {
    background-color: #5c3a21;
    color: #fff;
    border-radius: 6px;
    border: none;
    font-weight: 600;
}

.btn-confirm-custom:hover {
    background-color: #472b16;
    /* เวลาผู้ใช้ hover */
}

.brown-download-btn {
    font-size: 1.05rem;
    padding: 4px 10px;
}

.brown2-btn {
    background-color: #5c3a21;
    border: 2px solid #5c3a21;
    color: white;
    position: relative;
    border-radius: 30px;
}

.brown2-btn:hover {
    background-color: #5c3a21;
    color: white;
}

.brown2-btn:active {
    background-color: #5c3a21;
    color: white;
}

.brown3-btn {
    background-color: #c4ad94;
    border: 2.5px solid #5c3a21;
    color: #5c3a21;
    position: relative;
    border-radius: 30px;
}

.brown3-btn:hover {
    background-color: #c4ad94;
    color: #5c3a21;
}

.brown3-btn:active {
    background-color: #c4ad94;
    color: #5c3a21;
}

.support-link {
    color: #5c3a21;
}

.premium-text {
    /* font-weight: 700;
    font-size: 1.8rem;
    color: #5c3a21; */
    position: relative;
    display: inline-block;

    /* Gradient for shine */
    background: linear-gradient(120deg,
            #5c3a21 0%,
            #cfbd73 20%,
            #5c3a21 40%);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;

    animation: textShine 5s linear infinite;
}

@keyframes textShine {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.brown-check-btn {
    background-color: #5c3a21; /* สีเข้มเหมือน brown2-btn */
    color: #fff !important;
    border: 2px solid rgba(183, 147, 99, 0.8);
    border-radius: 30px;
    font-weight: 600;
    font-size: 1.05rem;
    padding: 5px 10px; /* ขนาดเหมือน start-btn */
    width: 100%;
    max-width: 320px;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(92, 58, 33, 0.6);
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    animation: pulseGlow 0.5s infinite;
    font-family: 'Kanit', sans-serif;
}

.brown-check-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 12px rgba(183, 147, 99, 0.8);
}

.brown-check-btn:active {
    transform: scale(0.95);
    box-shadow: 0 0 6px rgba(92, 58, 33, 0.6);
}

@keyframes pulseGlow {
    0%,
    100% {
        box-shadow: 0 0 8px rgba(183, 147, 99, 0.6);
    }

    50% {
        box-shadow: 0 0 16px rgba(183, 147, 99, 0.9);
    }
}

.collabDiv {
    position: fixed;
    top: 30px;
    left: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 9998;
    /* เว้นระยะห่างระหว่าง span กับปุ่ม */
}

.btn-collab-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    position: relative;
    top: -4.5px;
}

.collab-btn {
    background-color: #19abf9 !important;
    /* น้ำตาลเข้ม */
    border: none !important;
    padding: 5px 10px !important;
    border-radius: 12px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #fff !important;
    cursor: pointer !important;
    box-shadow: 0 0 12px rgba(255, 187, 51, 0.6);
    transition: background-color 0.3s ease, transform 0.15s ease;
    user-select: none;
    width: 100% !important;
    max-width: 320px !important;
    font-family: 'Kanit', sans-serif !important;
    margin: 0 auto;
    max-width: 74vw !important;
    animation: pulseGlow 0.5s infinite;
}

.collab-btn:active {
    transform: scale(0.95);
    background-color: #19abf9 !important;
}

.collab-btn.attention {
    animation: pulseScale 1.5s infinite ease-in-out;
}

@keyframes pulseScale {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02); /* ขยายออกนิดนึง */
    }
}