html,
body {
    font-family: 'Noto Sans Thai', sans-serif;
    margin: 0;
    width: 100%;
    padding: 0;
    height: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

body {
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
    touch-action: pan-y;
}

img {
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: auto;
}

input {
    font-family: 'Noto Sans Thai', sans-serif;
}

.game {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    aspect-ratio: 9/16;
}

.page {
    position: absolute;
    width: 100%;
    height: 100%;
    display: none;
}

.page.active {
    display: block;
}

.bg {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* START PAGE */
.headerText {
    position: absolute;
    top: 7%;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
}

.title {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
}

.desc {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
}

.startBtn {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 55%;
}

/* INTRO */
.introText {
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
}

/* QUESTION */
.questionImg {
    position: absolute;
    top: 18%;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
}

.choices {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 80%;
}

.choices img {
    width: 100%;
}

/* NAV BUTTON */
.btnBack {
    position: absolute;
    bottom: 40px;
    left: 40px;
    width: 80px;
}

.btnNext {
    position: absolute;
    bottom: 40px;
    right: 40px;
    width: 80px;
}

.choice {
    border-radius: 20px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: 0.2s;
}

.choice.selected {
    border: 3px solid #2596be;
}

img {
    user-select: none;
    -webkit-user-drag: none;
}

.loadingCenter {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
}

.loadingText {
    position: absolute;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
}

.resultBlur {
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(10px);
    left: 50%;
    transform: translate(-50%);
}

.resultImg {
    position: relative;
    display: block;
    width: 100%;
}

.resultDetailPage {
    cursor: pointer;
}

.resultTopBar {
    position: absolute;
    top: 20px;
    transform: translateX(-50%);
    left: 50%;
    display: flex;
    justify-content: center;
    z-index: 1;
}

.resultSaveBtn,
.resultShareBtn {
    width: 40%;
}

.resultShareBtn,
.resultSaveBtn {
    cursor: pointer;
    transition: transform 0.1s ease;
}

.resultShareBtn:active,
.resultSaveBtn:active {
    transform: scale(0.9);
}

.detailResultImg {
    position: relative;
    display: block;
    width: 100%;
    margin: 70px auto 0px auto;
}

.formPage {
    position: relative;
    min-height: 100dvh;
}

.formCard {
    position: relative;
    margin: 20px auto;
    width: 100%;
    max-width: 480px;
    background: #fffffff0;
    border-radius: 25px;
    padding: 25px;
}

.formBlock {
    position: relative;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.formTitle {
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    color: #2b2f6a;
}

.formSubtitle {
    font-size: 17px;
    text-align: center;
    margin: 10px 0 20px;
    color: #555;
}

.formFields label {
    display: block;
    margin-top: 15px;
    font-size: 16px;
}

.formFields input {
    width: 92%;
    padding: 10px;
    border-radius: 30px;
    border: 1px solid #ccc;
    margin-top: 6px;
}

.formFields input.error {
    border: 2px solid red;
}

.policyText {
    font-size: 12px;
    margin-top: 20px;
    line-height: 1.5;
    text-align: justify;
    text-justify: inter-character;
}

.consentRow {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 15px;
}

.consentText {
    margin-top: 0;
    font-size: 12px;
    line-height: 1.5;
    text-align: justify;
    text-justify: inter-character;
}

.checkboxWrap input {
    display: none;
}

.checkmark {
    width: 30px;
    height: 30px;
    border: 2px solid #333;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
    font-weight: bold;
}

.checkboxWrap input:checked+.checkmark::after {
    content: "✓";
}

.submitBtn {
    width: 130px;
    display: block;
    margin: 25px auto 15px;
    cursor: pointer;
}

.submitBtn.disabled {
    opacity: 0.5;
}

.toast {
    opacity: 0;
    visibility: hidden;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 130px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all .25s ease;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.toast.success {
    background: rgba(34, 197, 94, 0.45);
}

.toast.error {
    background: rgba(239, 68, 68, 0.45);
}

.headerText,
.title,
.desc,
.startBtn,
.introText {
    opacity: 0;
    animation: fadeUp 0.8s ease forwards;
}

.headerText {
    animation-delay: 0.3s;
}

.title {
    animation-delay: 0.6s;
}

.desc {
    animation-delay: 0.9s;
}

.startBtn {
    animation-delay: 1.2s;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translate(-100vw);
    }

    to {
        opacity: 1;
        transform: translate(1);
    }
}

.resultPage {
    overflow-y: auto;
}

.resultBlock {
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.resultBlock,
#resultDetail,
#formBlock {
    position: relative;
    height: 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.resultImg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.musicBtn {
    position: fixed;
    top: 15px;
    right: 15px;
    width: 40px;
    cursor: pointer;
    transition: 0.2s;
    z-index: 1;
}

.musicBtn:active {
    transform: scale(0.8);
}

.qr-code {
    display: none;
}

@media (min-width: 769px) {
    .qr-code {
        display: flex;
        flex-direction: column;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        justify-content: center;
        align-items: center;

    }
    .qr-code {
        text-align: center;
        font-size: 50px;
    }
    .qrImg {
        width: 400px;
    }
    .game {
        display: none;
    }
}

.shareOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: none;
    z-index: 999;
}

.sharePopup {
    opacity: 0;
    visibility: hidden;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    width: 300px;
    background: #fff;
    border-radius: 16px;
    padding: 70px 20px;
    transition: all .25s ease;
    z-index: 1000;
}

.sharePopup.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
}

.shareHeader {
    position: relative;
    text-align: center;
    margin-bottom: 20px;
}

.shareHeader span {
    color: #2b2f6a;
    font-size: 25px;
    font-weight: bold;
}

.closeBtn {
    position: absolute;
    right: -10px;
    top: -65px;
    border: none;
    background: none;
    font-size: 25px;
    cursor: pointer;
}

.shareIcons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.shareIcons img {
    width: 50px;
    transition: 0.2s;
}

.shareIcons img:active {
    transform: scale(0.9);
}

.detailFormWrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
}

.detailFormWrapper .sharedBg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.downBtn {
    position: fixed;
    bottom: 5%;
    right: 8%;
    width: 15%;
    z-index: 9999;
    pointer-events: none;
}