/* M5: Phân Loại To - Nhỏ - Style */


h1, h2, h3 { font-family: 'Baloo 2', cursive; color: #FF6B8B; }

.game-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.back-btn {
    display: inline-flex; align-items: center; gap: 8px; font-weight: 700;
    color: #FF6B8B; background: #fff; padding: 8px 16px; border-radius: 99px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); align-self: flex-start; margin-bottom: 5px;
    transition: transform 0.2s;
}

.back-btn:active { transform: scale(0.95); }

.game-header { text-align: center; margin-bottom: 20px; }
.game-header h1 { font-size: 2.5rem; margin-bottom: 5px; }
.game-header p { font-size: 1.1rem; color: #7B8B9A; margin-bottom: 15px; }

.score-board {
    display: inline-block; background: #FFD18C; padding: 6px 20px;
    border-radius: 99px; font-weight: 800; font-size: 1.1rem; color: #A0522D;
    box-shadow: 0 4px 0px #E5B26A; margin-bottom: 10px;
}

/* Các Mâm đựng */
.game-area {
    flex: 1; display: flex; flex-direction: column; justify-content: space-between;
}

.trays-container {
    display: flex; justify-content: space-around; align-items: flex-end; flex: 1;
    padding-bottom: 20px;
}

.tray-zone {
    display: flex; flex-direction: column; align-items: center; gap: 15px; position: relative;
    width: 45%; max-width: 300px;
}

.tray-label {
    font-family: 'Baloo 2', cursive; font-size: 1.5rem; font-weight: 800;
    color: white; padding: 5px 20px; border-radius: 99px; box-shadow: 0 4px 0px rgba(0,0,0,0.1);
    z-index: 2;
}
.label-big { background: #FF6B8B; }
.label-small { background: #48C6EF; }

.tray-circle {
    border-radius: 50%; width: 100%; aspect-ratio: 1/0.5;
    /* Mô phỏng cái mâm hình bầu dục (phối cảnh) */
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.8) 0%, rgba(200,200,200,0.4) 100%);
    box-shadow: inset 0 10px 20px rgba(0,0,0,0.1), 0 20px 30px rgba(0,0,0,0.1);
    border: 8px solid;
    position: relative;
    transition: transform 0.2s, background 0.2s;
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center; align-content: center; gap: 5px; padding: 10px;
}

.circle-big { border-color: #FF9EBB; }
.circle-small { border-color: #8FE3FF; }

.tray-zone.hover .tray-circle { transform: scale(1.05); background: rgba(255,255,255,0.9); }

/* Chứa trái cây ở dưới */
.fruits-container {
    height: 180px; background: rgba(255,255,255,0.6);
    border-radius: 30px; border: 4px dashed #FFD18C;
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 15px;
    position: relative; padding: 20px;
}

/* Biểu tượng trái cây kéo thả */
.drag-fruit {
    display: inline-flex; align-items: center; justify-content: center;
    cursor: grab; transition: transform 0.2s;
    filter: drop-shadow(0 8px 8px rgba(0,0,0,0.2));
    user-select: none; z-index: 10;
}

.fruit-big { font-size: 5rem; width: 100px; height: 100px; }
.fruit-small { font-size: 2.5rem; width: 50px; height: 50px; }

.drag-fruit:active { cursor: grabbing; }

.drag-fruit.dragging {
    position: absolute; z-index: 100; transform: scale(1.1); transition: none;
}

.drag-fruit.matched {
    position: relative !important; z-index: 5;
    left: auto !important; top: auto !important;
    transform: scale(1) !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

/* Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(5px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s; z-index: 1000;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal-content {
    background: white; padding: 40px; border-radius: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2); transform: scale(0.8); transition: transform 0.3s;
    max-width: 90%; width: 400px;
}
.modal-overlay.show .modal-content { transform: scale(1); }
.modal-icon { font-size: 5rem; margin-bottom: 20px; animation: bounce 2s infinite; }
.btn-primary {
    background: #FF6B8B; color: white; border: none; padding: 12px 30px;
    font-size: 1.2rem; font-family: 'Baloo 2', cursive; border-radius: 99px;
    cursor: pointer; box-shadow: 0 6px 0px #D83A5A; margin: 10px;
}
.btn-secondary {
    display: inline-block; background: #E2E8F0; color: #4A5568; margin: 10px;
    border: none; padding: 12px 30px; font-size: 1.2rem; font-family: 'Baloo 2', cursive;
    border-radius: 99px; cursor: pointer; box-shadow: 0 6px 0px #CBD5E0;
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-20px);}
    60% {transform: translateY(-10px);}
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .tray-label { font-size: 1.2rem; padding: 4px 15px; }
    .fruit-big { font-size: 4rem; width: 70px; height: 70px; }
    .fruit-small { font-size: 2rem; width: 40px; height: 40px; }
    .game-header h1 { font-size: 2rem; }
}
