/* --- Cài đặt chung --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-image: url('https://images.pexels.com/photos/176851/pexels-photo-176851.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2');
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: #ffffff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
}

h1, h2, h3 {
    color: #2c3e50;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

h2 {
    font-size: 2em;
    color: #c0392b;
    margin-top: 30px;
}

h3 {
    text-align: left;
    border-bottom: 2px solid #e74c3c;
    padding-bottom: 5px;
    margin-top: 25px;
}

p {
    text-align: justify;
    margin-bottom: 15px;
}

/* --- Nút Bấm --- */
#gieoQueBtn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 20px;
}

#gieoQueBtn:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
}

/* --- Khu vực kết quả --- */
#ketQua {
    margin-top: 30px;
    border-top: 1px solid #ddd;
    padding-top: 20px;
}

.yNghiaNgan {
    font-style: italic;
    font-size: 1.2em;
    color: #555;
    text-align: center;
}

#luanGiai p {
    margin-bottom: 10px;
}

#luanGiai strong {
    color: #2c3e50;
}

/* --- Hình tượng quẻ --- */
#hinhTuongQue {
    margin: 20px auto;
    width: 100px;
}

.line {
    height: 8px;
    background-color: #34495e;
    margin-bottom: 8px;
    border-radius: 2px;
}

.broken {
    width: 45%;
    display: inline-block;
}

.broken:first-child {
    margin-right: 10%;
}


/* --- Lớp tiện ích --- */
.hidden {
    display: none;
}
/* --- CSS CHO THƯ VIỆN 64 QUẺ --- */
.gallery-container {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.que-gallery {
    display: grid;
    /* Tạo các cột tự động, mỗi cột rộng tối thiểu 80px */
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 20px; /* Khoảng cách giữa các quẻ */
    margin-top: 20px;
}

.que-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f9f9f9;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.que-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.hinh-tuong-nho .line {
    height: 4px; /* Làm vạch mỏng hơn */
    margin-bottom: 4px; /* Giảm khoảng cách giữa các vạch */
    width: 40px; /* Chiều rộng của vạch */
}
.hinh-tuong-nho .broken-container {
    width: 40px; /* Chiều rộng tổng */
}

.hinh-tuong-nho .broken {
    width: 45%; /* 45% của 40px */
    height: 4px;
    margin-bottom: 4px;
}
.hinh-tuong-nho .broken:first-child {
     margin-right: 10%; /* 10% của 40px */
}

.ten-que-nho {
    font-size: 12px;
    font-weight: bold;
    color: #34495e;
    margin-top: 8px;
    text-align: center;
}