/* ---------------------------------------------
   MT Leaf Game CSS (With Kanit Font)
   สำหรับฟอร์ม กรอกเบอร์, ต้นไม้, ใบไม้, overlay และ popup
--------------------------------------------- */

/* ---- Import Google Font - Kanit ---- */
@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600&display=swap');

/* ---- Global Font Setting ---- */
* {
    font-family: 'Kanit', sans-serif;
}

/* ---- Zone 1: Phone Form ---- */
#phone-form {
    text-align: center;
    margin: 20px auto;
    font-family: 'Kanit', sans-serif;
}
#phone-form input[type="text"] {
    width: 180px;      /* ทำให้สั้นลง */
    padding: 8px 10px;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid #ccc;
    margin-right: 5px;
    font-family: 'Kanit', sans-serif;
}
#phone-form button {
    padding: 8px 14px;
    font-size: 14px;
    border-radius: 6px;
    border: none;
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
    font-family: 'Kanit', sans-serif;
}
#phone-form button:hover {
    background-color: #45a049;
}

/* ---- Zone 2: Tree Container ---- */
#tree-container {
    position: relative;
    width: 500px;
    height: 500px;
    margin: 20px auto;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* ---- Zone 3: Leaf ---- */
.leaf {
    position: absolute;
    cursor: pointer;
    transition: transform 3s ease-in-out;
}

/* ---- Zone 4: Overlay and Popup ---- */
#overlay {
    position: fixed;
    top:0;
    left:0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    display: none;  /* ซ่อนโดย default */
}
#overlay .popup {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
    transform: scale(0.6);
    opacity: 0;
    transition: all 0.4s ease;
    text-align: center;
    color: black;
    font-family: 'Kanit', sans-serif;
}
#overlay .popup.zoom-in {
    transform: scale(1);
    opacity: 1;
}

#overlay .popup p {
    margin: 8px 0;
    font-size: 16px;
    color: black;
    font-family: 'Kanit', sans-serif;
}

#overlay .popup strong {
    font-weight: 600;
    color: black;
    font-family: 'Kanit', sans-serif;
}

/* ---- Zone 5: Popup Buttons ---- */
#overlay .popup button {
    padding: 6px 12px;
    margin: 5px 3px;
    border-radius: 6px;
    border: none;
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.3s ease;
    font-family: 'Kanit', sans-serif;
}
#overlay .popup button:hover {
    background-color: #45a049;
}

/* ---- Zone 6: Leaf fade-in animation ---- */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.8);}
    to { opacity: 1; transform: scale(1);}
}
.leaf {
    opacity: 0;
    animation: fadeIn 1.5s forwards;
}