:root {
    --primary: #FF6B9E;
    --bg-color: #FFEFF6;
    --card-bg: #FFFFFF;
    --text-color: #333333;
}

* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; }

body {
    font-family: 'Comic Sans MS', 'Nunito', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden; /* Chống cuộn trang trên iPad */
    touch-action: manipulation;
}

/* Header */
#top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background-color: white;
    border-bottom: 4px solid var(--primary);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.user-info { display: flex; align-items: center; gap: 10px; font-weight: bold; font-size: 1.2rem;}
#badge-icon { width: 40px; height: 40px; }
.stars { font-size: 1.5rem; font-weight: bold; color: #FFA500; }

/* Các màn hình */
.screen { display: none; padding: 20px; text-align: center; height: calc(100vh - 80px); overflow-y: auto;}
.screen.active { display: block; animation: fadeIn 0.5s; }

/* Menu chính */
h1 { color: var(--primary); margin-bottom: 30px; font-size: 2.2rem; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 20px; max-width: 800px; margin: 0 auto; }
.game-btn {
    background: white; border: 4px solid var(--primary); border-radius: 20px;
    padding: 20px; font-size: 1.5rem; font-weight: bold; cursor: pointer;
    box-shadow: 0 6px 0 var(--primary); transition: all 0.1s; color: var(--text-color);
}
.game-btn:active { transform: translateY(6px); box-shadow: 0 0 0 var(--primary); }

/* Play Screen */
#back-btn { position: absolute; top: 90px; left: 20px; font-size: 1.2rem; padding: 10px 20px; border-radius: 15px; border: none; background: #ddd; cursor: pointer;}
#game-content { margin-top: 50px; }

/* Màn hình nghỉ ngơi */
.overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(255, 255, 255, 0.95); display: flex; justify-content: center; align-items: center; z-index: 1000; }
.hidden { display: none !important; }
.rest-box { background: white; padding: 40px; border-radius: 30px; border: 5px solid #4CAF50; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.rest-box h2 { color: #4CAF50; font-size: 2.5rem; margin-bottom: 20px;}

@keyframes fadeIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
/* Styling riêng cho Game */
.question-title {
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
}

.options-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

/* Khối màu để bé chọn (Dạng 1) */
.color-box {
    width: 120px;
    height: 120px;
    border-radius: 25px;
    border: 6px solid #fff;
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: transform 0.2s;
}
.color-box:active {
    transform: scale(0.9);
}

/* Khối màu hiển thị để hỏi (Dạng 2) */
.target-color-block {
    width: 180px;
    height: 180px;
    margin: 0 auto;
    border-radius: 50%; /* Tròn cho thân thiện */
    border: 8px solid #fff;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* Nút chữ để chọn tên màu (Dạng 2) */
.text-btn {
    font-family: 'Comic Sans MS', 'Nunito', sans-serif;
    font-size: 1.4rem;
    font-weight: bold;
    padding: 15px 30px;
    background-color: white;
    color: var(--text-color);
    border: 4px solid var(--primary);
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 6px 0 var(--primary);
    transition: all 0.1s;
}
.text-btn:active {
    transform: translateY(6px);
    box-shadow: 0 0 0 var(--primary);
}