* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: #fff9e6; /* Màu nền vàng nhạt */
    color: #333;
    display: flex;
    flex-direction: column; /* Xếp dọc các phần tử */
    justify-content: space-between; /* Đẩy header lên nóc, footer xuống đáy */
    align-items: center;
    min-height: 100vh;
    text-align: center;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px 15px;
    flex-grow: 1; /* Căn chỉnh đẩy footer xuống cuối trang */
}

/* --- TRANG TRÍ HEADER & FOOTER --- */
header {
    background-color: #ff6b81;
    color: white;
    width: 100%;
    padding: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border-bottom: 5px dashed #ff4757;
}

footer {
    background-color: #2d3436;
    color: white;
    width: 100%;
    padding: 15px;
    font-weight: bold;
    margin-top: 20px;
}

h1 { 
    color: #ff6b81; 
    font-size: 2.5rem; 
    margin-bottom: 10px; 
    text-shadow: 2px 2px 0px #ffe0b2;
}

p { 
    color: #00acc1; 
    font-size: 1.2rem; 
    font-weight: bold; 
    margin-bottom: 30px; 
}

/* Chia lưới tự động co giãn */
.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
}

/* Thiết kế thẻ tiếng Việt (Màu xanh) */
.flashcard {
    background-color: #e3f2fd;
    border: 4px solid #64b5f6;
    border-radius: 15px;
    padding: 20px 10px;
    cursor: pointer;
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s, background-color 0.3s, border-color 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

.flashcard:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 8px 15px rgba(0,0,0,0.2); 
}

.icon { 
    font-size: 3rem; 
    margin-bottom: 10px; 
}

.word { 
    font-size: 1.3rem; 
    font-weight: 900; 
    color: #1976d2; 
}

/* Thiết kế thẻ tiếng Anh (Màu hồng) */
.flashcard.english {
    background-color: #ffebf0;
    border-color: #ffb8c6;
}

.flashcard.english .word { 
    color: #e84393; 
}

.back-link {
    display: inline-block;
    margin-top: 40px;
    padding: 12px 25px;
    background-color: #ff6b81;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 900;
    font-size: 1.1rem;
    box-shadow: 2px 4px 0px #e84393;
}

.back-link:hover {
    transform: translateY(-2px);
}