/* ตั้งค่าพื้นฐานสำหรับทั้งหน้า */
body {
    background-color: #2c3e50; /* สีพื้นหลังเข้ม */
    color: #ecf0f1; /* สีตัวอักษรขาว */
    font-family: Comic Sans MS, Comic Sans MS;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.main-container {
    text-align: center;
    display: flex; /* เปิดใช้งาน Flexbox */
    flex-direction: column; /* จัดเรียงจากบนลงล่าง */
    align-items: center; /* จัดให้อยู่กลางแนวนอน */
}

/* (เพิ่ม) สไตล์สำหรับกล่องแสดงข้อความด้านบน */
#text-display-area {
    min-height: 40px; /* กำหนดความสูงขั้นต่ำ กัน layout กระโดด */
    margin-bottom: 20px;
    padding: 10px;
    font-size: 2rem; /* ขนาดตัวอักษร */
    color: #f1c40f; /* สีตัวอักษร (ลองเปลี่ยนสีให้เด่นขึ้น) */
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
    word-wrap: break-word; /* ทำให้ตัดคำเมื่อข้อความยาวเกินไป */
}

/* กล่องนาฬิกา */
.clock-container {
    /* position: relative;  <-- ลบบรรทัดนี้ออก */
    width: 1000px;
    height: auto; <-- ลบบรรทัดนี้ออก หรือปรับเป็น auto */
    padding: 20px 0; /* เพิ่ม padding เพื่อความสวยงาม */
    background-color: rgba(0, 0, 0, 0.4);
    border: 5px solid #3498db;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    /* overflow: hidden; <-- ลบบรรทัดนี้ออก */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px; /* เพิ่มระยะห่างด้านล่าง */
}

/* ส่วนแสดงเวลา */
#clock-display {
    font-family: 'Comic Sans MS', Comic Sans MS;
    font-size: 10rem;
    font-weight: 700;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
    /* z-index: 10; <-- ลบบรรทัดนี้ออก */
    /* position: relative; <-- ลบบรรทัดนี้ออก */
}

/* พื้นที่สำหรับภาพและข้อความ */
#custom-content {
    /* ลบของเก่าออกทั้งหมด แล้วใส่ชุดใหม่นี้แทน */
    min-height: 700px; /* กำหนดความสูงขั้นต่ำ */
    width: 1000px; /* กำหนดความกว้างให้เท่ากับนาฬิกา */
    margin-bottom: 20px; /* เพิ่มระยะห่างด้านล่าง */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem; /* ปรับขนาดฟอนต์ให้เหมาะสม */
    color: #ecf0f1;
    background-color: rgba(0, 0, 0, 0.2); /* เพิ่มพื้นหลังจางๆ */
    border-radius: 10px;
    padding: 20px;
    box-sizing: border-box;
    text-align: center;

     background-image: url('SafetyRules.png'); /* <-- !! แก้ชื่อไฟล์เป็นของคุณ !! */
    background-size: cover; /* ทำให้รูปเต็มพื้นที่โดยไม่เสียสัดส่วน */
    background-position: center; /* จัดให้รูปอยู่ตรงกลาง */
    background-repeat: no-repeat; /* ไม่ต้องแสดงรูปซ้ำ */
}

/* รูปภาพที่ถูกใส่เข้ามา */
#custom-content img {
    /* ลบของเก่าออก แล้วใส่ชุดใหม่นี้แทน */
    max-width: 100%; /* ทำให้ความกว้างไม่เกินกล่อง */
    max-height: 500px; /* กำหนดความสูงสูงสุด (ปรับได้ตามชอบ) */
    border-radius: 8px; /* ทำให้ขอบมน */
    object-fit: contain;
}

/* ส่วนควบคุม */
.controls {
    margin-top: 30px;
    padding: 20px;
    background-color: #34495e;
    border-radius: 10px;
}

.control-group {
    margin-bottom: 15px;
}

label {
    margin-right: 10px;
}

input[type="text"], button {
    padding: 20px 12px;
    border-radius: 5px;
    border: none;
    font-size: 1rem;
}

input[type="text"] {
    background-color: #ecf0f1;
    color: #2c3e50;
}

button {
    background-color: #3498db;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

#clear-btn {
    background-color: #e74c3c;
}

#clear-btn:hover {
    background-color: #c0392b;
}




