body {
    margin: 0;
    padding: 0;
    background-color: #0a0a0a;
    /* ใส่พื้นหลังลายไทย และทับด้วยสีดำโปร่งแสงเพื่อให้ตัวหนังสือยังอ่านง่าย */
    /* นำรูปภาพที่คุณหามาได้ เซฟเป็นชื่อ bg-thai.jpg ไว้ในโฟลเดอร์เดียวกับไฟล์นี้ */
    background-image: linear-gradient(rgba(10, 10, 10, 0.3), rgba(10, 10, 10, 0.85)), url('bg-thai.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #f0f0f0;
    font-family: 'Sarabun', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh; /* ล็อกความสูงไว้ที่ 100% ของหน้าจอ */
    width: 100vw;
    overflow: hidden; /* ป้องกันการเลื่อนหน้าจอ (Scroll) */
}

.container {
    width: 100%;
    max-width: 900px;
    padding: 1.5rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    animation: fadeIn 2s ease-in;
}

.portrait-container {
    margin-bottom: 1.5rem;
    flex-shrink: 1; /* ยอมให้หดตัวได้ถ้าย่อจอ */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 45vh; /* ความสูงของรูปแปรผันตามขนาดจอ (45% ของจอ) */
    width: 100%;
}

.portrait {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    border: 2px solid #555;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    border-radius: 4px;
    object-fit: contain; /* รักษาสัดส่วนรูปไว้เสมอ ไม่ให้เบี้ยว */
}

.message {
    flex-shrink: 0;
    text-align: center;
}

.message h1 {
    /* ปรับขนาดตัวอักษรอัตโนมัติ: ขั้นต่ำ 1.5rem, ปกติ 4vw, สูงสุด 2.2rem */
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    margin-bottom: 0.8rem;
    font-weight: 400;
    color: #e0e0e0;
    letter-spacing: 1px;
}

.message p {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    line-height: 1.6;
    margin-bottom: 0.3rem;
    color: #cccccc;
}

.message .signature {
    margin-top: 1.5rem;
    font-size: clamp(0.8rem, 1.5vw, 1rem);
    color: #888888;
}

.enter-button {
    display: inline-block;
    margin-top: 2rem;
    padding: clamp(10px, 2vh, 12px) clamp(20px, 4vw, 30px);
    border: 1px solid #555;
    background-color: rgba(30, 30, 30, 0.6); /* พื้นหลังปุ่มโปร่งแสงเล็กน้อย */
    backdrop-filter: blur(5px); /* เบลอพื้นหลังลายไทยหลังปุ่ม */
    -webkit-backdrop-filter: blur(5px);
    color: #cccccc;
    text-decoration: none;
    font-size: clamp(0.9rem, 2vw, 1rem);
    border-radius: 30px;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.enter-button:hover {
    background-color: #444;
    color: #ffffff;
    border-color: #aaaaaa;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}
