/* --- BỐ CỤC NÔNG TRẠI --- */
.farm-arena {
    height: 220px;
    background: linear-gradient(180deg, #81c784 0%, #388e3c 100%);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.4);
    position: relative; 
    overflow: hidden;
}

/* Nền cánh đồng (Kẻ sọc màu xanh lá đậm nhạt) */
.farm-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0,0,0,0.05) 0px,
        rgba(0,0,0,0.05) 20px,
        transparent 20px,
        transparent 40px
    );
    z-index: 1;
}

/* Khu vực sọt hàng */
.crate-zone {
    position: absolute;
    bottom: 30px;
    left: 45%; /* Lệch sang phải một chút nhường chỗ cho bác nông dân */
    width: 50%;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    z-index: 3;
}

/* Thùng gỗ */
.wood-crate {
    width: 70px;
    height: 60px;
    background: #8d6e63;
    border: 4px solid #5d4037;
    border-radius: 5px;
    position: relative;
    box-shadow: 0 10px 15px rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
}

/* Nông sản tràn ra miệng sọt */
.crate-content {
    position: absolute;
    top: -25px;
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.5));
    z-index: 1;
}

/* Mặt trước thùng đè lên nông sản tạo chiều sâu */
.crate-front {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 80%;
    background: repeating-linear-gradient(
        90deg,
        #8d6e63 0px,
        #8d6e63 10px,
        #795548 10px,
        #795548 12px
    );
    z-index: 2;
    border-radius: 2px;
}

/* Thùng lớn được phóng to */
.crate-large {
    transform: scale(1.3);
    margin-bottom: 10px; /* Đẩy lên xíu cho bằng với thùng nhỏ */
}

/* Nhãn ghi số lượng gắn trên sọt */
.crate-label {
    position: absolute;
    bottom: 5px;
    z-index: 4;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: bold;
    color: white;
    font-size: 1.1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    border: 2px solid white;
}

/* Bảng so sánh ❓ LẦN */
.compare-sign {
    position: absolute;
    top: 20%;
    left: 60%;
    transform: translateX(-50%);
    background: #fff9c4;
    border: 3px dashed #ffb300;
    padding: 5px 15px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 1.2rem;
    color: #e65100;
    z-index: 4;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    animation: bounce-sign 2s ease-in-out infinite alternate;
}

@keyframes bounce-sign {
    0% { transform: translate(-50%, 0); }
    100% { transform: translate(-50%, -10px); }
}

/* Hiệu ứng sọt hàng bay lên khi đóng gói thành công (dùng transform cực mượt) */
.ship-out {
    animation: ship-away 1s cubic-bezier(0.5, 0, 0.2, 1) forwards !important;
}

@keyframes ship-away {
    0% { transform: scale(1) translateY(0); opacity: 1; }
    30% { transform: scale(1.1) translateY(10px); opacity: 1; } /* Lấy đà */
    100% { transform: scale(0.5) translateY(-200px); opacity: 0; } /* Bay vút lên */
}

/* Sọt lớn lấy đà khác sọt nhỏ một xíu vì có sẵn scale(1.3) */
.crate-large.ship-out {
    animation: ship-away-large 1s cubic-bezier(0.5, 0, 0.2, 1) forwards !important;
}
@keyframes ship-away-large {
    0% { transform: scale(1.3) translateY(0); opacity: 1; }
    30% { transform: scale(1.4) translateY(10px); opacity: 1; }
    100% { transform: scale(0.6) translateY(-200px); opacity: 0; }
}

/* Nhân vật Nông dân */
.farmer-char {
    position: absolute;
    bottom: 20px;
    left: 10%;
    font-size: 4.5rem;
    z-index: 5;
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.5));
}

/* Nhảy mừng */
.happy-jump {
    animation: build-jump 0.8s ease-out forwards !important;
}
@keyframes build-jump {
    0% { transform: translateY(0); }
    50% { transform: translateY(-30px) scale(1.1); }
    100% { transform: translateY(0); }
}

/* Rung lắc khi sai */
.shake-error { animation: shake-char 0.4s !important; }
@keyframes shake-char {
    0% { transform: translateX(0); }
    25% { transform: translateX(-10px) rotate(-5deg); }
    50% { transform: translateX(10px) rotate(5deg); }
    75% { transform: translateX(-10px) rotate(-5deg); }
    100% { transform: translateX(0); }
}

.min-h-75 { min-height: 85px; }