 :root {
    --primary: #FFCB05;
    /* Vàng */
    --secondary: #00AEEF;
    /* Xanh dương */
    --accent: #F39C12;
    /* Cam */
    --danger: #FF5E5E;
    /* Đỏ */
    --success: #2ECC71;
    /* Xanh lá */
    --text: #333;
    --white: #fff;
    --bg-body: #f0f8ff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Baloo 2', cursive;
    background-color: var(--bg-body);
    color: var(--text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- HEADER (Giống trang chủ nhưng đơn giản hơn) --- */
header {
    background-color: var(--white);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--secondary);
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo span {
    color: var(--accent);
    margin-left: 5px;
}

.btn-quit {
    background-color: transparent;
    border: 2px solid var(--danger);
    color: var(--danger);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-quit:hover {
    background-color: var(--danger);
    color: var(--white);
}

/* --- GAME CONTAINER --- */
.game-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

/* --- TOPIC INFO & PROGRESS --- */
.topic-header {
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
}

.topic-title {
    font-size: 1.8rem;
    color: var(--secondary);
    margin-bottom: 10px;
}

.progress-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 10px;
    height: 12px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background-color: var(--success);
    width: 0%;
    /* JS sẽ cập nhật */
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    text-align: right;
    font-size: 0.9rem;
    color: #777;
    margin-top: 5px;
    font-weight: bold;
}

/* --- FLASHCARD AREA (3D FLIP) --- */
.scene {
    width: 100%;
    max-width: 500px;
    height: 350px;
    /* Chiều cao cố định cho card */
    perspective: 1000px;
    /* Tạo chiều sâu 3D */
    margin-bottom: 30px;
    cursor: pointer;
}

.flashcard {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    border-radius: 25px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.flashcard.is-flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    /* Safari */
    backface-visibility: hidden;
    border-radius: 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--white);
    padding: 20px;
    border: 4px solid var(--secondary);
}

/* --- FRONT FACE --- */
.card-front {
    /* Mặc định */
}

.card-image {
    width: 180px;
    height: 180px;
    object-fit: contain;
    margin-bottom: 20px;
}

.card-word {
    font-size: 2.5rem;
    color: var(--secondary);
    font-weight: 800;
}

.card-pronun {
    font-size: 1.2rem;
    color: #888;
    font-style: italic;
}

/* --- BACK FACE --- */
.card-back {
    transform: rotateY(180deg);
    background-color: #FFF9C4;
    /* Màu vàng nhạt cho mặt sau */
    border-color: var(--primary);
}

.card-meaning {
    font-size: 2rem;
    color: var(--text);
    font-weight: bold;
    margin-bottom: 15px;
}

.card-example {
    font-size: 1.2rem;
    color: #555;
    text-align: center;
    font-style: italic;
    background: rgba(255, 255, 255, 0.6);
    padding: 10px;
    border-radius: 10px;
}

/* --- CONTROLS --- */
.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.btn-control {
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
    transition: transform 0.1s;
}

.btn-control:active {
    transform: translateY(4px);
    box-shadow: none;
}

.btn-prev,
.btn-next {
    background-color: var(--secondary);
    color: white;
}

.btn-prev:disabled,
.btn-next:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-audio {
    background-color: var(--accent);
    color: white;
    width: 70px;
    /* Nút loa to hơn xíu */
    height: 70px;
    font-size: 2rem;
}

.btn-flip-mobile {
    display: none;
    /* Chỉ hiện trên mobile nếu cần */
    background-color: var(--success);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    border: none;
    margin-top: 10px;
}

/* --- RESPONSIVE --- */
@media (max-width: 600px) {
    .scene {
        height: 300px;
    }

    .card-image {
        width: 120px;
        height: 120px;
    }

    .card-word {
        font-size: 2rem;
    }

    .controls {
        gap: 10px;
    }

    .btn-control {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .btn-audio {
        width: 60px;
        height: 60px;
    }

    .btn-flip-mobile {
        display: block;
        /* Hiện nút lật trên mobile cho rõ ràng */
    }
}

