/* Reset & base */
:root {
    --container-bg: #f5f0e9;
    --image-bg: #d9cbb7;
    --sparkle-color: #ffffff;
    --h2-color: #4a3720;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    width: 100vw;
    font-family: 'Kanit', sans-serif;
    background-color: var(--container-bg);
    color: #4a3720;
    overflow-x: hidden;
}

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

.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;
}

#export-div {
    background-color: var(--container-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    width: 100%;
    /* ให้กว้างเต็ม container */
    max-width: 500px;
    /* คุมขนาดเวลาแสดงบนเว็บ */
    margin: 0 auto;
    /* จัดให้อยู่กลาง */
}

.container {
    max-width: 500px;
    width: 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;
    overflow: visible !important;
}

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

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

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

/* กล่อง background หลังรูปสัตว์ */
.image-background {
    background-color: var(--image-bg);
    /* เบจเข้มกว่า 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);
    overflow: visible;
    /* กันโดนตัด */
}

/* วิ้งมุมบนขวา */
/* .image-background::before {
    content: "";
    position: absolute;
    top: 0;
    right: -50px;
    width: 120px;
    height: 120px;
    background: var(--sparkle-color);
    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: var(--sparkle-color);
    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;
} */

.sparkle-before {
  position: absolute;
  top: 0;
  right: -50px;
  width: 120px;
  height: 120px;
  background: var(--sparkle-color);
  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); /* เอียงเฉย ๆ */
  animation: sparkleMove 3s ease-in-out infinite;
}

.sparkle-after {
  position: absolute;
  bottom: 10px;
  left: -50px;
  width: 120px;
  height: 120px;
  background: var(--sparkle-color);
  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(-15deg); /* เอียงเฉย ๆ */
  animation: sparkleMove 3s ease-in-out infinite;
}

.no-sparkle
{
    display: none;
}
/* .image-background.no-sparkle::before,
.image-background.no-sparkle::after {
    display: none;
} */
@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;
    }
}


.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.fade-out {
    opacity: 0;
}

/* Responsive */
@media (max-width: 480px) {
    .image-background {
        width: 80vw;
        height: 330px;
        border-top-left-radius: 180px;
        border-top-right-radius: 180px;
    }

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

.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;
}

h2 {
    color: var(--h2-color);
}

/* ปุ่มเริ่มทดสอบ ปรับใช้ Bootstrap btn + custom */
button.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.start-btn:active {
    transform: scale(0.95);
    background-color: #4a2e19 !important;
}

/* Responsive */
@media (max-width: 480px) {
    button.start-btn {
        max-width: 90vw !important;
        padding: 12px 24px !important;
        font-size: 1rem !important;
    }
}

input[type="color"] {
    -webkit-appearance: none;
    /* ลบสไตล์ default (Safari/Chrome) */
    -moz-appearance: none;
    /* ลบสไตล์ default (Firefox) */
    appearance: none;
    /* ลบสไตล์ default (อื่น ๆ) */

    border: 2px solid #4a3720;
    border-radius: 50%;
    /* กลม */
    width: 42px;
    height: 42px;
    padding: 0;
    cursor: pointer;
    background: none;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* สำหรับ Chrome/Safari */
input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 50%;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}

/* สำหรับ Firefox */
input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 50%;
}

/* 🎨 Input Text */
.custom-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 2px solid #c9b9a3;
    /* ขอบเบจน้ำตาล */
    background: #fdfaf5;
    /* ครีมอ่อน */
    color: #4a3720;
    font-size: 1rem;
    font-family: 'Quicksand', 'Kanit', sans-serif;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.25s ease;
}

.custom-input:focus {
    outline: none;
    border-color: #a3825a;
    /* น้ำตาลอ่อน */
    box-shadow: 0 0 6px rgba(163, 130, 90, 0.5);
    background: #fffdf9;
}

/* 🎨 Checkbox */
.custom-checkbox {
    display: flex;
    justify-content: center;
    /* จัดให้อยู่ตรงกลางแนวนอน */
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #4a3720;
    font-size: 1rem;
    user-select: none;
    margin-top: 16px;
    width: 100%;
    /* บังคับเต็มบรรทัด → justify-content มีผล */
    text-align: center;
}

/* ซ่อน input เดิม */
.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

/* กรอบวงกลมแทน */
.custom-checkbox .checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #a3825a;
    border-radius: 50%;
    background: #f5f0e9;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: all 0.25s ease;
    display: inline-block;
    position: relative;
}

/* ตอน checked → เติมวงกลมเล็กด้านใน */
.custom-checkbox input:checked+.checkmark {
    background: radial-gradient(circle, #a3825a 50%, #f5f0e9 100%);
    box-shadow: 0 0 6px rgba(163, 130, 90, 0.6);
}

/* ใส่วิ้งแฟนตาซีเล็ก ๆ */
.custom-checkbox input:checked+.checkmark::after {
    content: "✧";
    position: absolute;
    top: -2px;
    left: 3px;
    font-size: 14px;
    color: #d9cbb7;
    /* animation: sparkle2 1s ease-in-out infinite alternate; */
}

/* @keyframes sparkle2 {
  from { transform: scale(0.9) rotate(0deg); opacity: 0.8; }
  to   { transform: scale(1.2) rotate(15deg); opacity: 1; }
} */

/* Modal ปรับสวย */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: none;
    justify-content: center;
    font-weight: 600;
}

.modal-body {
    padding: 1rem 2rem;
}

/* Gallery เลื่อนลื่น + snap */
#animalCarousel {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
}

#animalCarousel::-webkit-scrollbar {
    height: 5px;
}

#animalCarousel::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

/* Thumbnail สวยๆ พร้อม shadow */
.animal-thumb {
    height: 120px;
    width: auto;
    cursor: pointer;
    border-radius: 12px;
    transition: transform 0.25s, box-shadow 0.25s;
    scroll-snap-align: center;
}

.animal-thumb:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.animal-thumb.selected {
    border: 3px solid #ff9800;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

button.animal-btn {
    background-color: #d9cbb7; /* น้ำตาลอ่อน พรีเมียม */
    color: #4a3720; /* ข้อความสีน้ำตาลเข้ม */
    border: 1px solid #4a3720;
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: background-color 0.3s ease, transform 0.15s ease, box-shadow 0.3s ease;
    font-family: 'Kanit', sans-serif;
}

button.animal-btn:hover {
    background-color: #cbb99d;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

button.animal-btn:active {
    transform: scale(0.95);
    background-color: #bca886;
}

#export-div h2 {
    display: block;
    width: 100%;           /* ขยาย text ให้ใกล้เต็ม div */
    text-align: center;
    white-space: nowrap;
    font-family: 'Kanit', sans-serif !important;
}