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

body {
    margin: 20px auto;
    padding: 0 10px;
    padding-bottom: 20px;
    text-align: center;
    font-family: 'Arial', sans-serif;
    background-color: #f8f9fa;
}

h1, h2, h4 {
    margin-bottom: 10px;
}

.top-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.top-image:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.input-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    max-width: 360px;
    height: 40px;
    background-color: white;
    border-radius: 30px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.2);
    margin: 10px auto;
    padding: 0;
    overflow: hidden;
}

.input-container input {
    border: none;
    outline: none;
    background-color: transparent;
    text-align: center;
    width: 100%;
    height: 100%;
    border-radius: 25px;
    font-size: 16px;
    padding-left: 10px;
    box-sizing: border-box;
}

.input-container .icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    pointer-events: none;
    z-index: 10;
}

.submit-btn {
    background-color: #f8f9fa;
    border: 1px solid #dfe1e5;
    color: #3c4043;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 27px;
    padding: 0 16px;
    height: 36px;
    border-radius: 4px;
    cursor: pointer;
    margin: auto;
    display: block;
    margin-top: 20px;
    transition: 0.2s;
}

.submit-btn:hover {
    border-color: #dadce0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.result {
    text-align: left;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 40px;
}

.meanings {
    text-align: justify;
	
    }

 p {
            margin: 0;
            padding: 5px 0;
        }

.score-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 20px; 
    font-size: 18px;
    font-weight: bold;
    border-radius: 15px; 
    background-color: #F5F5F5;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1); 
    width: fit-content; 
    max-width: 90%; 
    margin: 10px auto; 
    text-align: center;
}

.image-container {
    text-align: center;
    margin: 10px 0;
}

.grade-image {
    width: 20px; 
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.error {
    color: red;
    font-weight: bold;
}

#google_translate_element {
    margin-top: 20px;
    text-align: center;
}


/* ---------- Responsive สำหรับมือถือ ---------- */
@media (max-width: 480px) {
    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 18px;
    }

    .top-image {
        width: 100%;
        max-width: 300px;
    }

    .input-container {
        width: 100%;
        max-width: 280px;
    }

    .submit-btn {
        font-size: 12px;
        height: 32px;
    }

    .result {
        text-align: center;
 	padding-left: 30px;  
        padding-right: 30px; 
    }

    .score-container {
        flex-direction: column;
        font-size: 14px;
    }

footer {
    padding-bottom: 15px;
    }
}