/* --- BỐ CỤC BẢN VẼ KIẾN TRÚC --- */
.blueprint-arena {
    height: 240px;
    background: #1565c0; /* Màu xanh blueprint */
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    position: relative; 
    overflow: hidden;
    border-radius: 12px;
}

/* Nền lưới kỹ thuật (Blueprint) */
.blueprint-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.2) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: 1;
}

/* Cấu trúc lâu đài */
.castle-structure {
    position: absolute;
    bottom: 20px;
    left: 55%;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-end;
    gap: 5px;
    z-index: 3;
    opacity: 0.8;
}

/* Cổng thành ở giữa */
.castle-gate {
    width: 60px;
    height: 60px;
    border: 3px dashed rgba(255, 255, 255, 0.5);
    border-radius: 30px 30px 0 0; /* Mái vòm tròn */
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.5s;
}

/* Biểu tượng ở giữa cổng */
.gate-icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.5));
}

/* Tòa tháp hai bên */
.castle-tower {
    width: 40px;
    height: 100px;
    border: 3px dashed rgba(255, 255, 255, 0.5);
    position: relative;
    transition: all 0.5s;
}
.castle-tower::before {
    content: '';
    position: absolute;
    top: -20px; left: -3px;
    border-left: 23px solid transparent;
    border-right: 23px solid transparent;
    border-bottom: 20px solid transparent; /* Mái nhọn, màu sẽ đổi khi đúng */
    transition: all 0.5s;
}

/* --- HIỆU ỨNG TRẢ LỜI ĐÚNG (XÂY THÀNH CÔNG) --- */
.build-success {
    opacity: 1 !important;
    animation: glow-building 1s ease-out forwards;
}
.build-success .castle-gate, .build-success .castle-tower {
    border-style: solid;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}
.build-success .castle-tower::before {
    border-bottom-color: currentColor; /* Lấy màu border được truyền vào từ JS */
}

@keyframes glow-building {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.1); }
    100% { transform: translateX(-50%) scale(1); }
}

/* Rung lắc đỏ khi tính sai */
.build-error {
    animation: flash-red 0.5s forwards;
}
@keyframes flash-red {
    0%, 100% { filter: none; }
    50% { filter: drop-shadow(0 0 20px #f44336) sepia(1) hue-rotate(-50deg); }
}

/* Nhân vật Kiến trúc sư */
.architect-char {
    position: absolute;
    bottom: 20px;
    left: 15%;
    font-size: 4.5rem;
    z-index: 5;
    filter: drop-shadow(0 5px 10px 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 nhân vật khi sai */
.shake-error { animation: shake-char 0.4s !important; }
@keyframes shake-char {
    0% { transform: translateX(0); }
    25% { transform: translateX(-15px) rotate(-10deg); }
    50% { transform: translateX(15px) rotate(10deg); }
    75% { transform: translateX(-15px) rotate(-10deg); }
    100% { transform: translateX(0); }
}

.min-h-75 { min-height: 85px; }