/* =========================================
   1. KIỂU DÁNG CHUNG & FONT CHỮ
========================================= */
@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400;600;800&display=swap');

body {
    /* Sử dụng font bo tròn vui nhộn */
    font-family: 'Baloo 2', cursive, Arial, sans-serif;

    /* Mặc định cho toàn bộ trang (Trang câu hỏi): Nền Gradient chấm bi */
    background-color: #a8edea;
    background-image:
            radial-gradient(rgba(255,255,255,0.4) 15%, transparent 16%),
            radial-gradient(rgba(255,255,255,0.4) 15%, transparent 16%),
            linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    background-size: 60px 60px, 60px 60px, 100% 100%;
    background-position: 0 0, 30px 30px, 0 0;

    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    box-sizing: border-box;
}

/* =========================================
   2. TRANG CHỦ (INDEX.HTML)
========================================= */
.home-body {
    /* Ghi đè nền chấm bi bằng ảnh nền cho trang chủ */
    background-image: url('./images/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.home-container {
    position: absolute;
    bottom: 40px;
    /*right: 40px; */ /* Bỏ comment nếu muốn đưa sang góc phải */

    background-color: rgba(255, 255, 255, 0.95);
    padding: 20px 15px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    text-align: center;
    max-width: 450px;
    width: calc(100% - 80px);
    box-sizing: border-box;
    z-index: 10;
}

@media (max-width: 600px) {
    .home-container {
        bottom: 20px;
        width: calc(100% - 40px);
        padding: 20px;
    }
}

.home-title {
    color: #ff4757;
    font-size: 28px;
    margin-bottom: 10px;
    line-height: 1.4;
    font-weight: 800;
}

.home-subtitle {
    color: #2f3542;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 35px;
}

/* Nút Bắt đầu */
.btn-start {
    padding: 16px 50px;
    font-size: 22px;
    font-family: 'Baloo 2', cursive;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    background-color: #2ed573;
    color: white;
    border: none;
    border-radius: 50px;
    box-shadow: 0 8px 0 #27ae60, 0 15px 20px rgba(0,0,0,0.2);
    transition: all 0.1s ease;
    position: relative;
    top: 0;
}

.btn-start:active {
    top: 8px;
    box-shadow: 0 0px 0 #27ae60, 0 0px 0px rgba(0,0,0,0) !important;
}

/* =========================================
   3. TRANG CHI TIẾT CÂU HỎI (QUESTION.HTML)
========================================= */
.container {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 30px; /* Bo góc tròn trịa */
    border: 6px solid #fff; /* Viền trắng dày tạo khối */
    width: 100%;
    max-width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1), 0 5px 15px rgba(0,0,0,0.05);
}

h1#question-title {
    color: #ff4757;
    font-size: 2.5rem;
    font-weight: 800;
    margin: 10px 0;
    text-shadow: 3px 3px 0px #ffeaa7, 5px 5px 0px rgba(0,0,0,0.1); /* Đổ bóng chữ viền vàng cute */
    letter-spacing: 1px;
}

#question-text {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2f3542;
    margin-bottom: 15px;
}

/* =========================================
   4. HỆ THỐNG NÚT BẤM 3D (GAME STYLE)
========================================= */
.btn-group {
    margin-top: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap; /* Cho phép nút rớt dòng nếu màn hình điện thoại quá nhỏ */
}

.btn {
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 18px;
    font-family: 'Baloo 2', cursive;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.1s ease; /* Hiệu ứng nhún nhanh */
    position: relative;
    top: 0;
    border: none;
    letter-spacing: 0.5px;
}

/* Hiệu ứng khi click chuột: Nút lún xuống và mất khối 3D */
.btn:active {
    top: 5px;
    box-shadow: 0 0px 0 rgba(0,0,0,0) !important;
}

.btn-primary {
    background-color: #1e90ff;
    color: white;
    box-shadow: 0 5px 0 #0984e3, 0 10px 10px rgba(0,0,0,0.2);
}

.btn-success {
    background-color: #2ed573;
    color: white;
    box-shadow: 0 5px 0 #27ae60, 0 10px 10px rgba(0,0,0,0.2);
}

.btn-warning {
    background-color: #ffa502;
    color: white;
    box-shadow: 0 5px 0 #e67e22, 0 10px 10px rgba(0,0,0,0.2);
}

.btn-secondary {
    background-color: #a4b0be;
    color: white;
    box-shadow: 0 5px 0 #747d8c, 0 10px 10px rgba(0,0,0,0.2);
}

/* =========================================
   5. HIỆU ỨNG ẢNH VÀ CHUYỂN CẢNH KÉO RÈM
========================================= */
.no-transition, .no-transition * {
    transition: none !important;
}

.reveal-wrapper {
    position: relative;
    width: 100%;
    flex-grow: 1;
    margin: 0 auto;
    overflow: hidden;

    /* Style khung ảnh bo tròn mềm mại */
    border-radius: 20px;
    border: 4px solid #f1f2f6;
    background-color: #dfe4ea;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
}

.qa-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Khung che đáp án (Trạng thái ẩn) */
.answer-image-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: inset(0 100% 0 0); /* Giấu ảnh sang phải mượt mà */
}

/* Kích hoạt hiệu ứng (Trạng thái hiển thị đáp án) */
.show-answer .answer-image-wrap {
    clip-path: inset(0 0 0 0);
    transition: clip-path 1s ease-in-out;
}

#question-image {
    opacity: 1;
}

.show-answer #question-image {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

/* =========================================
   6. HIỆU ỨNG NGÔI SAO/TUYẾT RƠI
========================================= */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.star {
    position: absolute;
    top: -10px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8), 0 0 12px rgba(255, 255, 255, 0.6);
    opacity: 0.8;
    animation: fall linear infinite;
}

@keyframes fall {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) scale(0.5);
        opacity: 0;
    }
}